/* ============================================================
   HELM & ABLE — Operator's Atlas
   Brand locked: Navy #0F1F3C/#0B1729 · Gold #C9A94B/#E8CC80 · Cream #F7F4EE
   Fonts: Playfair Display (headings) · DM Sans (body) · DM Mono (labels)
   ============================================================ */

:root {
  /* Brand */
  --navy:        #0F1F3C;
  --navy-deep:   #0B1729;
  --gold:        #C9A94B;
  --gold-light:  #E8CC80;
  --white:       #FEFEFF;
  --cream:       #F7F4EE;

  --navy-line:   rgba(201, 169, 75, 0.18); /* hairline gold */
  --text-on-navy:     #FEFEFF;
  --text-muted-navy:  rgba(254, 254, 255, 0.66);
  --text-faint-navy:  rgba(254, 254, 255, 0.42);
  --text-on-cream:    #0F1F3C;
  --text-muted-cream: #4a566b;

  /* Fonts */
  --font-head: "Playfair Display", Georgia, serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;

  /* Type scale (fluid) */
  --text-xs:   clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm:   clamp(0.875rem, 0.84rem + 0.2vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg:   clamp(1.125rem, 1.05rem + 0.4vw, 1.375rem);
  --text-xl:   clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
  --text-2xl:  clamp(2rem, 1.3rem + 2.6vw, 3.5rem);
  --text-3xl:  clamp(2.6rem, 1.4rem + 4.4vw, 5rem);
  --text-count: clamp(3rem, 1rem + 8vw, 7rem);

  /* Spacing (4px base) */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --space-12: 3rem; --space-16: 4rem; --space-20: 5rem; --space-24: 6rem; --space-32: 8rem;

  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 14px;
  --content: 1120px; --content-narrow: 720px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t: 220ms var(--ease);
}

/* Reset */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; scroll-behavior: smooth;
  scroll-padding-top: var(--space-16);
}
body {
  min-height: 100dvh; line-height: 1.6;
  font-family: var(--font-body); font-size: var(--text-base);
  color: var(--text-on-navy); background: var(--navy);
  overflow-x: hidden;
}
img,svg,canvas { display: block; max-width: 100%; height: auto; }
ul[role="list"] { list-style: none; }
input,button,textarea,select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }

h1,h2,h3,h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.12; text-wrap: balance; letter-spacing: -0.01em; }
p { text-wrap: pretty; max-width: 64ch; }

::selection { background: rgba(201,169,75,0.28); color: var(--white); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: var(--radius-sm); }

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* ---------- Layout primitives ---------- */
.wrap { max-width: var(--content); margin-inline: auto; padding-inline: var(--space-6); }
.wrap-narrow { max-width: var(--content-narrow); margin-inline: auto; padding-inline: var(--space-6); }
section { padding-block: clamp(var(--space-16), 9vw, var(--space-32)); }
.section-cream { background: var(--cream); color: var(--text-on-cream); }
.section-cream p { color: var(--text-muted-cream); }
.section-deep { background: var(--navy-deep); }

.eyebrow {
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold);
  display: inline-block; margin-bottom: var(--space-4);
}
.section-cream .eyebrow { color: #9c7d22; }

/* Gold left-bar accent */
.leftbar { position: relative; padding-left: var(--space-6); }
.leftbar::before {
  content: ""; position: absolute; left: 0; top: 0.15em; bottom: 0.15em;
  width: 3px; background: var(--gold); border-radius: 2px;
}

/* Diagonal stripe texture (navy on navy, subtle) */
.stripe-bg {
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.018) 0 2px, transparent 2px 22px);
}

h1.display { font-size: var(--text-3xl); }
h2.title { font-size: var(--text-2xl); }
h3.sub { font-size: var(--text-xl); }
.lede { font-size: var(--text-lg); color: var(--text-muted-navy); max-width: 56ch; }
.section-cream .lede { color: var(--text-muted-cream); }
.muted { color: var(--text-muted-navy); }
.micro { font-size: var(--text-sm); color: var(--text-faint-navy); }

/* ---------- Buttons (ONE primary per screen) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-body); font-weight: 600; font-size: var(--text-sm);
  padding: var(--space-3) var(--space-6); border-radius: var(--radius-md);
  transition: var(--t); letter-spacing: 0.01em;
}
.btn-primary { background: var(--gold); color: var(--navy-deep); }
.btn-primary:hover { background: var(--gold-light); transform: translateY(-1px); }
.btn-ghost { color: var(--white); border: 1px solid rgba(254,254,255,0.28); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-light); }
.section-cream .btn-ghost { color: var(--navy); border-color: rgba(15,31,60,0.28); }
.section-cream .btn-ghost:hover { border-color: var(--gold-active, #9c7d22); }
.btn .arr { transition: transform var(--t); }
.btn:hover .arr { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15,31,60,0.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--navy-line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; padding-block: var(--space-4); }
.logo { display: flex; align-items: center; gap: var(--space-3); }
.logo svg { width: 30px; height: 30px; color: var(--gold); }
.logo .name { font-family: var(--font-head); font-size: 1.15rem; font-weight: 600; letter-spacing: 0.01em; }
.nav { display: flex; align-items: center; gap: var(--space-6); }
.nav a { font-size: var(--text-sm); color: var(--text-muted-navy); transition: var(--t); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--gold-light); }
.nav-cta { font-weight: 600; }
@media (max-width: 720px) { .nav .nav-link { display: none; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); border-top: 1px solid var(--navy-line); padding-block: var(--space-12); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: var(--space-8); justify-content: space-between; align-items: flex-start; }
.site-footer .micro { max-width: 48ch; line-height: 1.7; }
.site-footer a { color: var(--text-muted-navy); }
.site-footer a:hover { color: var(--gold-light); }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(var(--space-20), 13vw, 11rem); overflow: hidden; }
.hero-glow {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 70% 10%, rgba(201,169,75,0.10), transparent 70%),
    radial-gradient(40% 40% at 15% 90%, rgba(201,169,75,0.05), transparent 70%);
}
.hero .wrap { position: relative; z-index: 1; }
.hero .lede { margin-top: var(--space-6); }
.trust-line { margin-top: var(--space-8); font-size: var(--text-sm); color: var(--text-faint-navy); display: flex; align-items: center; gap: var(--space-2); max-width: 60ch; }
.trust-line svg { width: 18px; height: 18px; color: var(--gold); flex-shrink: 0; }
.hero-actions { margin-top: var(--space-10); display: flex; flex-wrap: wrap; gap: var(--space-4); }

/* ---------- Fork cards ---------- */
.fork-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); margin-top: var(--space-10); }
@media (max-width: 760px) { .fork-grid { grid-template-columns: 1fr; } }
.fork-card {
  background: rgba(255,255,255,0.03); border: 1px solid var(--navy-line);
  border-radius: var(--radius-lg); padding: var(--space-8);
  display: flex; flex-direction: column; transition: var(--t);
}
.fork-card:hover { border-color: rgba(201,169,75,0.5); transform: translateY(-3px); background: rgba(255,255,255,0.05); }
.fork-card h3 { font-size: var(--text-xl); margin-bottom: var(--space-3); }
.fork-card p { color: var(--text-muted-navy); font-size: var(--text-base); flex: 1; }
.fork-card .btn { margin-top: var(--space-6); align-self: flex-start; }

/* ---------- Generic cards / steps ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); }
@media (max-width: 820px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }
.card {
  background: rgba(255,255,255,0.03); border: 1px solid var(--navy-line);
  border-radius: var(--radius-lg); padding: var(--space-6);
}
.section-cream .card { background: #fff; border-color: rgba(15,31,60,0.10); box-shadow: 0 1px 3px rgba(15,31,60,0.05); }
.card .step-n { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.2em; color: var(--gold); }
.section-cream .card .step-n { color: #9c7d22; }
.card h4 { font-size: var(--text-lg); margin: var(--space-3) 0; }
.card p { font-size: var(--text-sm); }

.stat-big { font-family: var(--font-head); font-size: var(--text-2xl); color: var(--gold); line-height: 1.05; }
.section-cream .stat-big { color: var(--navy); }

/* ---------- Fleet map ---------- */
.fleet { background: var(--navy-deep); }
.fleet-controls { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; justify-content: space-between; margin-bottom: var(--space-8); }
.view-toggle { display: inline-flex; border: 1px solid var(--navy-line); border-radius: var(--radius-md); overflow: hidden; }
.view-toggle button { padding: var(--space-2) var(--space-5); font-size: var(--text-sm); font-family: var(--font-mono); letter-spacing: 0.08em; color: var(--text-muted-navy); transition: var(--t); }
.view-toggle button[aria-pressed="true"] { background: var(--gold); color: var(--navy-deep); font-weight: 600; }
.count-strip { font-family: var(--font-mono); font-size: var(--text-sm); letter-spacing: 0.1em; color: var(--text-muted-navy); }
.count-strip b { color: var(--gold); }

.fleet-grid-wrap { overflow-x: auto; padding-bottom: var(--space-2); }
.fleet-grid { display: grid; gap: 6px; min-width: 640px; }
.fleet-row-head, .fleet-cell { display: flex; align-items: center; }
.fleet-corner, .fleet-col-head, .fleet-row-label {
  font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.06em;
  color: var(--text-muted-navy); text-transform: uppercase; padding: var(--space-2);
}
.fleet-col-head { justify-content: center; text-align: center; }
.fleet-cell {
  justify-content: center; aspect-ratio: 1 / 0.62; border-radius: var(--radius-sm);
  border: 1px solid var(--navy-line); position: relative; transition: var(--t);
  background: rgba(255,255,255,0.015);
}
.fleet-cell .beacon { width: 12px; height: 12px; border-radius: 50%; }
.cell-live { border-color: rgba(201,169,75,0.55); background: rgba(201,169,75,0.08); cursor: pointer; }
.cell-live .beacon { background: var(--gold); box-shadow: 0 0 0 0 rgba(201,169,75,0.6); animation: pulse 2.6s var(--ease) infinite; }
.cell-open { cursor: pointer; }
.cell-open .beacon { background: transparent; border: 1.5px solid var(--text-faint-navy); }
.cell-open:hover { border-color: rgba(201,169,75,0.4); }
.cell-coming { opacity: 0.45; }
.cell-coming .beacon { background: transparent; border: 1px dotted var(--text-faint-navy); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(201,169,75,0.55); } 70% { box-shadow: 0 0 0 9px rgba(201,169,75,0); } 100% { box-shadow: 0 0 0 0 rgba(201,169,75,0); } }
.fleet-legend { display: flex; flex-wrap: wrap; gap: var(--space-6); margin-top: var(--space-6); font-size: var(--text-sm); color: var(--text-muted-navy); }
.fleet-legend span { display: inline-flex; align-items: center; gap: var(--space-2); }
.lg-dot { width: 11px; height: 11px; border-radius: 50%; }

/* ---------- Diagnostic ---------- */
.diag-shell { max-width: 720px; margin-inline: auto; }
.progress-track { height: 4px; background: rgba(255,255,255,0.08); border-radius: 99px; overflow: hidden; margin-bottom: var(--space-8); }
.progress-fill { height: 100%; background: var(--gold); width: 0; transition: width 400ms var(--ease); }
.q-step { display: none; }
.q-step.active { display: block; animation: fade 360ms var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.q-num { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.18em; color: var(--gold); }
.q-title { font-size: var(--text-xl); margin: var(--space-3) 0 var(--space-2); }
.q-help { color: var(--text-muted-navy); font-size: var(--text-sm); margin-bottom: var(--space-6); }
.opts { display: grid; gap: var(--space-3); }
.opt {
  text-align: left; padding: var(--space-4) var(--space-5); border-radius: var(--radius-md);
  border: 1px solid var(--navy-line); background: rgba(255,255,255,0.02);
  font-size: var(--text-base); transition: var(--t); display: flex; justify-content: space-between; align-items: center; gap: var(--space-4);
}
.opt:hover { border-color: rgba(201,169,75,0.5); background: rgba(255,255,255,0.04); }
.opt[aria-pressed="true"] { border-color: var(--gold); background: rgba(201,169,75,0.10); }
.opt .opt-meta { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-faint-navy); }
.field { display: block; margin-bottom: var(--space-5); }
.field label { display: block; font-size: var(--text-sm); color: var(--text-muted-navy); margin-bottom: var(--space-2); }
.field input { width: 100%; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--navy-line); background: rgba(255,255,255,0.04); color: var(--white); }
.field input:focus { border-color: var(--gold); outline: none; }
.q-actions { display: flex; justify-content: space-between; margin-top: var(--space-8); }
.link-back { background: none; color: var(--text-muted-navy); font-size: var(--text-sm); }
.link-back:hover { color: var(--gold-light); }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

/* ---------- Result screen ---------- */
.result-beat { padding-block: clamp(var(--space-16), 10vw, var(--space-32)); }
.beat1 { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.count-up { font-family: var(--font-head); font-size: var(--text-count); color: var(--gold); line-height: 1; font-weight: 600; }
.result-basis { color: var(--text-muted-navy); margin: var(--space-6) auto 0; font-size: var(--text-base); }
.conservative-tag { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); display: inline-block; margin-bottom: var(--space-5); }
.verdict-band { display: inline-block; font-family: var(--font-mono); font-size: var(--text-sm); letter-spacing: 0.1em; padding: var(--space-2) var(--space-4); border: 1px solid var(--gold); border-radius: 99px; color: var(--gold-light); }
.fn-list { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-6); }
.fn-chip { padding: var(--space-3) var(--space-5); border-radius: var(--radius-md); border: 1px solid var(--navy-line); background: rgba(255,255,255,0.03); }
.fn-chip .fn-name { font-weight: 600; }
.fn-chip .fn-sub { font-size: var(--text-xs); color: var(--text-faint-navy); font-family: var(--font-mono); }
.rootcause { margin-top: var(--space-8); padding: var(--space-6); border-left: 3px solid var(--gold); background: rgba(201,169,75,0.06); border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.roi-line { font-size: var(--text-lg); }
.roi-line b { color: var(--gold); }
.gate-note { font-size: var(--text-sm); color: var(--text-faint-navy); margin-top: var(--space-3); }
.sources { font-size: var(--text-xs); color: var(--text-faint-navy); line-height: 1.7; }

/* Ship wheel */
.wheel { color: var(--gold); }
.wheel-hero { width: clamp(120px, 22vw, 220px); opacity: 0.9; }
.wheel-spin { animation: spin 60s linear infinite; transform-origin: 50% 50%; }
.wheel-whisper { position: absolute; right: -4%; top: 12%; width: clamp(180px, 30vw, 380px); opacity: 0.05; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 620ms var(--ease), transform 620ms var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; } .reveal.d2 { transition-delay: 0.16s; } .reveal.d3 { transition-delay: 0.24s; }

.page-head { padding-block: clamp(var(--space-16), 11vw, var(--space-24)) var(--space-8); }
.divider { height: 1px; background: var(--navy-line); border: 0; }
