/* GYRE — design system. Dark night-stage + bone workshop-manual duality.
   Interactive = detents (hard 90ms moves). Decorative = slow reveals.
   One lean element per page, never more. See DESIGN.md. */

:root {
  --ink: #0b0e12;
  --coal: #141920;
  --panel: #1a2029;
  --bone: #edefe7;
  --bone-deep: #dfe2d6;
  --white: #f4f6f2;
  --steel: #9aa5b1;
  --slate: #525c66;
  --volt: #d6f42b;
  --volt-deep: #8ea30d;
  --line: rgba(154, 165, 177, 0.16);
  --line-strong: rgba(154, 165, 177, 0.4);
  --ink-line: rgba(11, 14, 18, 0.16);
  --rim: clamp(16px, 2.2vw, 34px);
  --block-y: clamp(72px, 11vh, 148px);
  --detent: 90ms cubic-bezier(0.3, 0, 0.2, 1);
  --drift: 700ms cubic-bezier(0.16, 1, 0.3, 1);
  --mega: clamp(3.2rem, 12.5vw, 10.2rem);
  --h2: clamp(1.9rem, 4.8vw, 3.9rem);
  --h3: clamp(1.2rem, 2.2vw, 1.7rem);
}

/* ---------------- reset & base ---------------- */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--ink);
  color: var(--white);
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-variation-settings: "wdth" 100, "wght" 400;
  font-size: clamp(0.98rem, 1.15vw, 1.06rem);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

h1, h2, h3 {
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  text-transform: uppercase;
  font-variation-settings: "wdth" 122, "wght" 850;
  line-height: 0.94;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.mega { font-size: var(--mega); line-height: 0.88; }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); font-variation-settings: "wdth" 116, "wght" 750; }

.label {
  font-family: "Chakra Petch", Consolas, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel);
}

.volt-text { color: var(--volt); }

p.lede { font-size: clamp(1.08rem, 1.6vw, 1.3rem); line-height: 1.55; max-width: 34em; }
.muted { color: var(--steel); }
.measure { max-width: 38em; }

/* focus */
:focus-visible { outline: 2px solid var(--volt); outline-offset: 3px; }
.manual :focus-visible { outline-color: var(--ink); }

::selection { background: var(--volt); color: var(--ink); }

/* ---------------- halo mark ---------------- */

.halo-mark {
  width: 1em; height: 1em;
  border: 0.09em solid currentColor;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -0.12em;
  flex: none;
}

/* ---------------- shell / nav ---------------- */

.shell { overflow: hidden; position: relative; } /* clips the drawer off-canvas — do NOT remove */

.top {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--rim);
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: flex; align-items: center; gap: 10px;
  font-variation-settings: "wdth" 125, "wght" 900;
  font-size: 1.28rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  padding-right: 0.1em; /* optical: tracked caps overhang */
}
.wordmark .halo-mark { color: var(--volt); font-size: 1.05rem; }

.top nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 34px); }
.top nav a {
  font-family: "Chakra Petch", Consolas, monospace;
  font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--steel);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color var(--detent), border-color var(--detent);
}
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--white); border-bottom-color: var(--volt); }

.nav-cta {
  background: var(--volt); color: var(--ink) !important;
  padding: 10px 18px !important;
  border-bottom: 0 !important;
}
.nav-cta:hover { transform: translateY(1px); box-shadow: inset 0 -2px 0 rgba(11, 14, 18, 0.35); }

.burger { display: none; }

/* drawer (mobile) */
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(320px, 86vw);
  z-index: 70;
  background: var(--coal);
  border-left: 1px solid var(--line);
  transform: translateX(102%);
  transition: transform 240ms cubic-bezier(0.3, 0, 0.2, 1);
  display: flex; flex-direction: column; gap: 4px;
  padding: 84px 28px 28px;
  visibility: hidden;
}
.drawer.open { transform: translateX(0); visibility: visible; }
.drawer a {
  font-variation-settings: "wdth" 118, "wght" 800;
  text-transform: uppercase;
  font-size: 1.5rem;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.drawer a:active { color: var(--volt); }
.drawer .label { margin-top: auto; }

.scrim {
  position: fixed; inset: 0; z-index: 65;
  background: rgba(5, 7, 9, 0.6);
  opacity: 0; pointer-events: none;
  transition: opacity 240ms linear;
}
.scrim.show { opacity: 1; pointer-events: auto; }

@media (max-width: 860px) {
  .top nav { display: none; }
  .burger {
    display: grid; place-items: center;
    width: 44px; height: 44px;
    border: 1px solid var(--line-strong);
  }
  .burger span, .burger::before, .burger::after { content: ""; display: block; width: 18px; height: 2px; background: var(--white); margin: 2.5px 0; }
}

/* ---------------- sections ---------------- */

.stage-sec { background: var(--ink); padding: var(--block-y) var(--rim); }
.manual { background: var(--bone); color: var(--ink); padding: var(--block-y) var(--rim); }
.manual .label { color: var(--slate); }
.manual .muted { color: var(--slate); }

.sec-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: clamp(28px, 5vh, 56px); flex-wrap: wrap; }
.sec-head .label { flex: none; }
.sec-head::after { content: ""; flex: 1; height: 1px; background: var(--line); min-width: 40px; }
.manual .sec-head::after { background: var(--ink-line); }

.wrap { max-width: 1380px; margin: 0 auto; }

/* the lean motif — exactly one per page */
.lean { transform: rotate(-1.6deg); }
@media (prefers-reduced-motion: reduce) { .lean { transform: none; } }

/* ---------------- hero ---------------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  overflow: hidden;
  background: var(--ink);
}
.hero-media { position: absolute; inset: 0; }
.hero-media video, .hero-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 68% 50%;
}
.hero-media::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--ink) 0%, rgba(11, 14, 18, 0.25) 34%, rgba(11, 14, 18, 0.35) 100%);
}
.hero-copy {
  position: relative; z-index: 2;
  padding: 0 var(--rim) clamp(40px, 8vh, 90px);
  display: grid; gap: clamp(14px, 2.4vh, 26px);
}
.hero-copy .mega { max-width: 9.5em; }
.hero-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }

.hero-vitals {
  position: absolute; z-index: 2;
  right: var(--rim); bottom: clamp(40px, 8vh, 90px);
  display: grid; gap: 10px;
  text-align: right;
}
.hero-vitals b { font-variation-settings: "wdth" 120, "wght" 800; font-size: 1.5rem; display: block; }
@media (max-width: 900px) { .hero-vitals { display: none; } }

/* media control — video pause/play, small, honest */
.media-toggle {
  position: absolute; z-index: 3;
  right: var(--rim); top: calc(72px + 14px);
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-strong);
  padding: 8px 12px;
  font-family: "Chakra Petch", Consolas, monospace;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--steel);
  background: color-mix(in srgb, var(--ink) 66%, transparent);
}
.media-toggle:hover { color: var(--white); }

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: "Chakra Petch", Consolas, monospace;
  font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 15px 30px;
  border: 1px solid transparent;
  transition: transform var(--detent), box-shadow var(--detent), background-color var(--detent), color var(--detent), border-color var(--detent);
}
.btn:active { transform: translateY(1px); }
.btn-arm { background: var(--volt); color: var(--ink); }
.btn-arm:hover { box-shadow: inset 0 -3px 0 rgba(11, 14, 18, 0.35); }
.btn-ghost { border-color: var(--line-strong); color: var(--white); }
.btn-ghost:hover { border-color: var(--volt); color: var(--volt); }
.manual .btn-ghost { border-color: var(--ink-line); color: var(--ink); }
.manual .btn-ghost:hover { border-color: var(--ink); }

/* ---------------- manifesto ---------------- */

.manifesto { display: grid; grid-template-columns: minmax(200px, 420px) 1fr; gap: clamp(28px, 5vw, 80px); align-items: start; }
@media (max-width: 900px) { .manifesto { grid-template-columns: 1fr; } }

.gyro-fig { display: grid; place-items: center; padding: 8px 0; }
.gyro-fig svg { width: min(300px, 62vw); height: auto; }
.gyro-spin { transform-origin: 50% 50%; animation: gyro 9s linear infinite; }
@keyframes gyro { to { transform: rotate(360deg); } } /* decorative transform only — never opacity */
@media (prefers-reduced-motion: reduce) { .gyro-spin { animation: none; } }

.manifesto h2 { max-width: 11em; margin-bottom: 0.5em; }
.manifesto .lede { margin-bottom: 1.1em; }

/* ---------------- lineup rail ---------------- */

.rail { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; background: var(--line); border: 1px solid var(--line); }
@media (max-width: 1100px) { .rail { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .rail { grid-template-columns: 1fr; } }

.rail-card {
  background: var(--coal);
  min-width: 0;
  display: flex; flex-direction: column;
  transition: background-color var(--detent);
}
.rail-card:hover { background: var(--panel); }
.rail-card figure { aspect-ratio: 4 / 3; overflow: hidden; position: relative; }
.rail-card img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--drift); }
.rail-card:hover img { transform: scale(1.035); }
.rail-body { padding: 18px 18px 20px; display: grid; gap: 8px; flex: 1; }
.rail-body h3 { font-size: 1.45rem; }
.rail-body .label { font-size: 10px; }
.rail-stat { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; }
.rail-stat b { font-variation-settings: "wdth" 118, "wght" 780; }

/* ---------------- DNA plates ---------------- */

.dna { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 30px); }
@media (max-width: 900px) { .dna { grid-template-columns: 1fr; } }
.dna-plate { border: 1px solid var(--line); background: var(--coal); min-width: 0; }
.dna-plate figure { aspect-ratio: 16 / 10; overflow: hidden; }
.dna-plate img { width: 100%; height: 100%; object-fit: cover; }
.dna-plate .plate-body { padding: 20px; display: grid; gap: 8px; }

/* ---------------- garage ---------------- */

.garage-stage {
  position: relative;
  display: grid;
  min-height: min(72vh, 720px);
  align-items: center;
  border: 1px solid var(--line);
  background: radial-gradient(120% 90% at 50% 30%, var(--coal) 0%, var(--ink) 74%);
  overflow: hidden;
}
.garage-stage figure { position: absolute; inset: 0; }
.garage-stage img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; }
.stage-name {
  position: relative; z-index: 2;
  padding: clamp(18px, 3.5vh, 40px) var(--rim);
  align-self: end;
  text-shadow: 0 2px 30px rgba(5, 7, 9, 0.65);
}
.stage-name h1, .stage-name .stage-title { font-size: clamp(3rem, 10vw, 8.5rem); line-height: 0.88; font-variation-settings: "wdth" 125, "wght" 900; text-transform: uppercase; }
.stage-name .label { margin-bottom: 6px; display: block; }

/* selector — gearbox detents */
.selector {
  display: flex; align-items: stretch; gap: 2px;
  border: 1px solid var(--line);
  background: var(--line);
  margin-top: 2px;
}
.selector button {
  flex: 1;
  min-width: 0;
  background: var(--coal);
  padding: 14px 6px 12px;
  display: grid; gap: 3px; justify-items: center;
  font-family: "Chakra Petch", Consolas, monospace;
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--steel);
  border-top: 3px solid transparent;
  transition: background-color var(--detent), color var(--detent), border-color var(--detent);
}
.selector button b { font-family: "Archivo", sans-serif; font-variation-settings: "wdth" 120, "wght" 850; font-size: 0.95rem; letter-spacing: 0.02em; color: var(--white); }
.selector button:hover { background: var(--panel); }
.selector button[aria-pressed="true"] { background: var(--panel); border-top-color: var(--volt); color: var(--volt); }
.selector button:active { transform: translateY(1px); }

/* spec sheet */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-top: 0;
}
.spec-cell {
  padding: 18px 18px 16px;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.spec-cell + .spec-cell { border-left: 1px solid var(--line); }
@media (max-width: 700px) {
  .spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-cell:nth-child(odd) { border-left: 0; }
}
.spec-cell b { display: block; font-variation-settings: "wdth" 120, "wght" 820; font-size: clamp(1.3rem, 2.4vw, 1.9rem); margin-top: 4px; }
.spec-cell small { color: var(--steel); font-size: 0.78rem; }

/* dyno + story row */
.garage-lower { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(20px, 3vw, 44px); margin-top: clamp(28px, 5vh, 52px); align-items: start; }
@media (max-width: 900px) { .garage-lower { grid-template-columns: 1fr; } }

.dyno { border: 1px solid var(--line); background: var(--coal); padding: 18px; min-width: 0; }
.dyno svg { width: 100%; height: auto; display: block; }
.dyno-legend { display: flex; gap: 18px; margin-top: 10px; flex-wrap: wrap; }
.dyno-legend span { display: inline-flex; align-items: center; gap: 7px; }
.dyno-legend i { width: 18px; height: 2px; background: var(--volt); display: inline-block; }
.dyno-legend .steel-key i { background: var(--steel); }

.pulse-panel { border: 1px solid var(--line); background: var(--coal); padding: 18px; display: grid; gap: 12px; margin-top: 2px; }
.pulse-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pulse-meter { flex: 1; min-width: 120px; height: 34px; }
.pulse-meter svg { width: 100%; height: 100%; display: block; }

/* compare */
.compare-scroller { overflow-x: auto; border: 1px solid var(--line); }
.compare { border-collapse: collapse; width: 100%; min-width: 720px; }
.compare th, .compare td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.compare th:first-child, .compare td:first-child { text-align: left; border-left: 0; position: sticky; left: 0; background: var(--ink); }
.compare thead th { font-family: "Chakra Petch", Consolas, monospace; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--steel); }
.compare tbody th { font-variation-settings: "wdth" 118, "wght" 780; text-transform: uppercase; }
.compare tr:last-child td, .compare tr:last-child th { border-bottom: 0; }

/* ---------------- teardown ---------------- */

.plate-fig { position: relative; border: 1px solid var(--ink-line); background: var(--white); }
.plate-fig > img { width: 100%; height: auto; }

.hotspot {
  position: absolute;
  width: 34px; height: 34px;
  transform: translate(-50%, -50%);
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: color-mix(in srgb, var(--bone) 78%, transparent);
  display: grid; place-items: center;
  font-family: "Chakra Petch", Consolas, monospace;
  font-size: 11px; font-weight: 600;
  color: var(--ink);
  transition: background-color var(--detent), color var(--detent), transform var(--detent);
}
.hotspot:hover { background: var(--ink); color: var(--volt); }
.hotspot[aria-expanded="true"] { background: var(--ink); color: var(--volt); transform: translate(-50%, -50%) scale(1.12); }
@media (pointer: coarse) { .hotspot { width: 44px; height: 44px; } }

.callouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; background: var(--ink-line); border: 1px solid var(--ink-line); border-top: 0; }
@media (max-width: 900px) { .callouts { grid-template-columns: 1fr; } }
.callout { background: var(--bone); padding: 20px; min-width: 0; }
.callout.active { background: var(--white); box-shadow: inset 0 3px 0 var(--volt-deep); }
.callout h3 { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.callout h3 i { font-style: normal; font-family: "Chakra Petch", Consolas, monospace; font-size: 0.8em; color: var(--slate); }

.teardown-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2vw, 26px); }
@media (max-width: 900px) { .teardown-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.strip-item { border-top: 2px solid var(--ink); padding-top: 12px; min-width: 0; }
.strip-item b { font-variation-settings: "wdth" 118, "wght" 800; font-size: 1.2rem; display: block; }

/* ---------------- ride ---------------- */

.ride-grid { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.2fr); gap: clamp(26px, 4vw, 64px); align-items: start; }
@media (max-width: 900px) { .ride-grid { grid-template-columns: 1fr; } }

.field { display: grid; gap: 7px; margin-bottom: 18px; }
.field input, .field select {
  background: rgba(154, 165, 177, 0.07);
  border: 1px solid var(--line-strong);
  color: var(--white);
  padding: 13px 14px;
  font: inherit;
  border-radius: 0;
  width: 100%;
}
.field input:focus, .field select:focus { outline: 2px solid var(--volt); outline-offset: 0; border-color: transparent; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 49%, var(--steel) 50%), linear-gradient(-45deg, transparent 49%, var(--steel) 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }

.ride-note { border-left: 2px solid var(--volt); padding-left: 16px; }

.outlet-card { border: 1px solid var(--line); background: var(--coal); padding: 22px; display: grid; gap: 6px; margin-top: 18px; }

/* ---------------- CTA band ---------------- */

.cta-band { background: var(--volt); color: var(--ink); padding: clamp(48px, 8vh, 96px) var(--rim); }
.cta-band .wrap { display: grid; gap: 18px; justify-items: start; }
.cta-band h2 { max-width: 12em; }
.cta-band .btn-arm { background: var(--ink); color: var(--volt); }
.cta-band .label { color: rgba(11, 14, 18, 0.62); }

/* ---------------- footer ---------------- */

footer { border-top: 1px solid var(--line); padding: clamp(36px, 6vh, 64px) var(--rim) 32px; background: var(--ink); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: clamp(24px, 4vw, 60px); max-width: 1380px; margin: 0 auto; }
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-grid nav { display: grid; gap: 9px; justify-items: start; }
.foot-grid a { color: var(--steel); transition: color var(--detent); }
.foot-grid a:hover { color: var(--volt); }
.foot-base { max-width: 1380px; margin: 28px auto 0; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* ---------------- reveals ---------------- */

/* Gated on .js-anim (set by ui.js). No-JS or stalled IO = everything visible. */
.js-anim .reveal { opacity: 0; transform: translateY(22px); transition: opacity 640ms ease, transform 640ms cubic-bezier(0.16, 1, 0.3, 1); }
.js-anim .reveal.is-in { opacity: 1; transform: none; }
.js-anim .d1 { transition-delay: 70ms; }
.js-anim .d2 { transition-delay: 140ms; }
.js-anim .d3 { transition-delay: 210ms; }
@media (prefers-reduced-motion: reduce) {
  .js-anim .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------------- page plumbing ---------------- */

.pt-0 { padding-top: 0; }
.foot-blurb { margin-top: 12px; max-width: 30em; }

/* pages that start under the fixed header (no full-bleed hero) */
.garage-page, .ride-page, .manual-first { padding-top: calc(76px + clamp(28px, 5vh, 64px)); }

.compare-head, .strip-head { margin-top: clamp(40px, 7vh, 80px); }
.garage-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: clamp(32px, 5vh, 56px); }
.ride-mailnote { margin-top: 12px; font-size: 0.85rem; }
.stage-title { font-size: clamp(3rem, 10vw, 8.5rem); }
.teardown-strip .strip-item p { font-size: 0.9rem; }
.plate-fig { margin-top: clamp(24px, 4vh, 44px); }
.manifesto .plate-fig { margin-top: 0; }
.callout p { font-size: 0.95rem; }

/* ---------------- skip link ---------------- */

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--volt); color: var(--ink);
  padding: 10px 16px;
  transition: top 120ms;
}
.skip:focus { top: 12px; }
