/* ==============================================
   PilotOS founding-doc styles
   Shared CSS for /philosophy and /origin
   Same aesthetic as the pitch deck — dark + amber gold
   ============================================== */

/* PilotOS mark animation — blades rotate, core pulses */
@keyframes pmark-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes pmark-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.78; }
}
.pmark-blades {
  animation: pmark-rotate 80s linear infinite;
  transform-origin: 50px 50px;
  transform-box: view-box;
}
.pmark-core {
  animation: pmark-pulse 4.5s ease-in-out infinite;
  transform-origin: 50px 50px;
  transform-box: view-box;
}
@media (prefers-reduced-motion: reduce) {
  .pmark-blades, .pmark-core { animation: none; }
}

:root {
  --bg: #0a0a0b;
  --bg-elev: #131316;
  --bg-card: #1a1a1f;
  --border: #2a2a30;
  --text: #f5f5f0;
  --text-dim: #b5b5b0;
  --text-muted: #7a7a76;
  --gold: #f4a300;
  --gold-bright: #ffb730;
  --gold-dim: #8a5a00;
  --accent: #6366f1;
  --green: #34d399;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 17px;
  line-height: 1.65;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(244,163,0,0.06), transparent 45%),
    radial-gradient(circle at 80% 90%, rgba(99,102,241,0.04), transparent 40%);
  pointer-events: none;
  z-index: 0;
}

/* Top navigation */
.doc-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: rgba(10,10,11,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.doc-nav a {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: -0.005em;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}
.doc-nav a:hover {
  color: var(--gold);
  background: rgba(244,163,0,0.06);
}
.doc-nav .brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.doc-nav .brand .dot { color: var(--gold); }

/* Page layout */
.doc-page {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 8rem;
  z-index: 1;
}

/* Hero */
.doc-hero {
  margin-bottom: 4.5rem;
}
.pilotos-mark {
  width: clamp(64px, 6.5vw, 88px);
  height: clamp(64px, 6.5vw, 88px);
  display: block;
  margin-bottom: 1.5rem;
}
.doc-eyebrow {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.25rem;
}
.doc-hero h1 {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.035em;
  margin-bottom: 1.5rem;
  color: var(--text);
}
.doc-hero h1 .gold {
  background: linear-gradient(135deg, var(--gold) 30%, var(--gold-bright));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.doc-hero .doc-lead {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.4;
  color: var(--text-dim);
  letter-spacing: -0.015em;
  margin-bottom: 1.75rem;
  max-width: 640px;
}
.doc-hero .doc-meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.doc-hero .doc-meta .gold-dot {
  color: var(--gold);
}

/* Content sections */
.doc-section {
  margin-bottom: 3.5rem;
}
.doc-section h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
  color: var(--text);
}
.doc-section h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 0.75rem;
  margin-top: 2rem;
}
.doc-section p {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
  letter-spacing: -0.005em;
}
.doc-section p strong {
  color: var(--text);
  font-weight: 600;
}
.doc-section p em {
  color: var(--gold);
  font-style: italic;
  font-weight: 500;
}
.doc-section ul, .doc-section ol {
  list-style: none;
  margin: 1.25rem 0 1.5rem;
  padding-left: 0;
}
.doc-section ul li, .doc-section ol li {
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-dim);
  margin-bottom: 0.85rem;
  padding-left: 1.5rem;
  position: relative;
}
.doc-section ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-weight: 600;
}
.doc-section ol {
  counter-reset: item;
}
.doc-section ol li {
  counter-increment: item;
}
.doc-section ol li::before {
  content: counter(item, decimal-leading-zero);
  position: absolute;
  left: 0;
  font-family: var(--serif);
  font-weight: 700;
  color: var(--gold);
  font-size: 0.95rem;
  top: 0.05rem;
}

/* Pull quote */
.doc-pullquote {
  border-left: 3px solid var(--gold);
  padding: 0.5rem 0 0.5rem 1.75rem;
  margin: 2.5rem 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--text);
}
.doc-pullquote .gold {
  color: var(--gold);
}

/* Highlight callout */
.doc-callout {
  background: linear-gradient(135deg, rgba(244,163,0,0.08), rgba(244,163,0,0.02));
  border: 1px solid rgba(244,163,0,0.3);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
}
.doc-callout .callout-eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}
.doc-callout p:last-child { margin-bottom: 0; }

/* Layered table for synergy layers */
.doc-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.5rem 0 2.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.doc-table th, .doc-table td {
  text-align: left;
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  vertical-align: top;
}
.doc-table thead th {
  background: rgba(244,163,0,0.06);
  color: var(--gold);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.doc-table tbody tr:last-child td { border-bottom: none; }
.doc-table tbody td {
  color: var(--text-dim);
}
.doc-table tbody td:first-child {
  font-weight: 600;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1rem;
  width: 30%;
}

/* Inline emphasis utilities */
.gold { color: var(--gold); }
.gold-bright { color: var(--gold-bright); }
.dim { color: var(--text-dim); }
.muted { color: var(--text-muted); }

/* Footer */
.doc-footer {
  margin-top: 6rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.doc-footer-link {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: -0.005em;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  transition: all 0.2s;
}
.doc-footer-link:hover {
  border-color: rgba(244,163,0,0.4);
  background: rgba(244,163,0,0.04);
  color: var(--gold-bright);
}

/* Mono inline */
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--gold);
  background: rgba(244,163,0,0.06);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

/* Image placeholder / annotation block */
.doc-figure {
  margin: 2.5rem -1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
}
.doc-figure-caption {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  font-style: italic;
}

/* Mobile */
@media (max-width: 700px) {
  body { font-size: 16px; }
  .doc-page { padding: 3rem 1.25rem 5rem; }
  .doc-hero { margin-bottom: 3rem; }
  .doc-section { margin-bottom: 2.5rem; }
  .doc-figure { margin-left: 0; margin-right: 0; }
  .doc-table th, .doc-table td { font-size: 0.85rem; padding: 0.75rem 0.85rem; }
  .doc-table tbody td:first-child { font-size: 0.9rem; }
  .doc-pullquote { padding-left: 1.25rem; }

  /* Compact top nav: hide secondary links, keep brand + Demo now CTA */
  .doc-nav { padding: 0.7rem 0.9rem; }
  .doc-nav > span:last-child {
    flex-wrap: nowrap !important;
    gap: 0.4rem !important;
  }
  .doc-nav > span:last-child a:not([href="/console"]) {
    display: none;
  }
  .doc-nav > span:last-child a[href="/console"] {
    padding: 0.4rem 0.85rem !important;
    font-size: 0.85rem;
  }
}

/* Touch device — disable hover transforms */
@media (hover: none) and (pointer: coarse) {
  .doc-nav a:hover, .doc-footer-link:hover {
    background: var(--bg-card);
    color: var(--gold);
  }
}
