/* ============================================================================
   MAIN — page composition. Reads tokens.css and system.css.
   No raw values. Anything reusable across pages belongs in system.css instead.
   ========================================================================== */

/* ── HEADER ───────────────────────────────────────────────────────────────
   Persistent, therefore part of the composition and counted in the mass
   scheme — not "chrome" that can be ignored when the first screen is measured.
   It stays translucent over live content rather than going solid, because a bar
   that flips to opaque while content is still travelling under it cuts a hard
   edge through that content.                                                  */

.site-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgb(var(--graphite-900-rgb) / 0.72);
  backdrop-filter: blur(14px);
  border-bottom: var(--hairline) solid transparent;
  transition: border-color var(--dur-3) var(--ease-out),
              background-color var(--dur-3) var(--ease-out);
}

.site-header.is-past-hero {
  background: rgb(var(--graphite-900-rgb) / 0.92);
  border-bottom-color: var(--graphite-700);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  width: 100%;
}

/* The mark is the one piece of the header that is a shape before it is a
   word, so it is sized as one. Fluid rather than fixed: at 1600px it wants the
   presence the wordmark was drawn for, at 390px it must not push the menu
   button off the row. */
.site-header__mark img {
  height: clamp(2.6rem, 1.6rem + 1.6vw, 3.6rem);
  width: auto;
  display: block;
}

/* ── NAV ─────────────────────────────────────────────────────────────────── */

.nav { display: flex; align-items: center; gap: var(--sp-5); }

.nav__list {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  list-style: none;
}

.nav__link {
  display: inline-block;
  padding-block: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--ink-on-dark-muted);
  text-decoration: none;              /* nav is not prose; position is the affordance */
  transition: color var(--dur-2) var(--ease-out);
}

.nav__link:hover,
.nav__link[aria-current='page'] { color: var(--ink-on-dark); }

.nav__link[aria-current='page'] { position: relative; }
.nav__link[aria-current='page']::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  height: var(--hairline);
  background: var(--ink-on-dark);
}

/* The Service dropdown. A real floating layer, so it is the one place a
   shadow is honest. */
.nav__group { position: relative; }

.nav__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: none;
  border: 0;
  padding-block: var(--sp-2);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--ink-on-dark-muted);
}

.nav__toggle:hover, .nav__toggle[aria-expanded='true'] { color: var(--ink-on-dark); }

.nav__menu {
  position: absolute;
  inset-block-start: calc(100% + var(--sp-3));
  inset-inline-start: 0;
  min-width: 14rem;
  padding: var(--sp-3);
  background: var(--graphite-800);
  border: var(--hairline) solid var(--graphite-700);
  border-radius: var(--radius);
  box-shadow: var(--lift);
  list-style: none;
  display: grid;
  gap: var(--sp-1);
}

.nav__menu[hidden] { display: none; }

.nav__menu .nav__link { display: block; padding: var(--sp-3); }

.nav-toggle-mobile { display: none; }

/* ── HERO ─────────────────────────────────────────────────────────────────
   The governing event: subject, identity mass, spec strip, CTA cluster, field,
   reserved air. Named parts, each with a selector, because a single
   full-viewport wrapper declares nothing.                                     */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  padding-block: calc(var(--header-h) + var(--sp-7)) var(--sp-8);
  background: var(--graphite-900);
  overflow: hidden;
  isolation: isolate;
}

/* The active field. An authored ground, not a backdrop: the still and the
   canvas occupy the same box, so the scene replaces the still without the
   composition moving. */
.hero__field {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero__still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__still { object-fit: cover; object-position: 88% 64%; }

/* The scrim is built at the field layer and is part of the composition, not a
   patch: it darkens the left third the type stands in, and it is what makes the
   reserved air read as a graded field rather than as an empty corner. Text is
   never made legible by weighting the type or shadowing it. */
.hero__field::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg,
      rgb(var(--graphite-900-rgb) / 0.94) 0%,
      rgb(var(--graphite-900-rgb) / 0.86) 26%,
      rgb(var(--graphite-900-rgb) / 0.34) 52%,
      rgb(var(--graphite-900-rgb) / 0.06) 72%),
    linear-gradient(to top,
      rgb(var(--graphite-900-rgb) / 0.78) 0%,
      rgb(var(--graphite-900-rgb) / 0) 42%);
  pointer-events: none;
}

/* The reserved region. It is bounded by the identity mass and the field, and
   its job is to be the air the subject is seen in — it is not spare room. */
.hero__inner {
  display: grid;
  gap: var(--sp-7);
  width: 100%;
}

.hero__identity { max-width: 38rem; }

.hero__eyebrow { margin-block-end: var(--sp-4); }

.hero__title {
  text-wrap: balance;
}

.hero__claim {
  margin-block-start: var(--sp-5);
  max-width: 34ch;
}

.hero__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--sp-6);
}

.hero__cta { display: flex; flex-wrap: wrap; gap: var(--sp-4); }

.hero__spec { flex: 0 1 auto; }
.hero__spec .spec-strip { justify-content: flex-end; }

/* ── INVENTORY ────────────────────────────────────────────────────────────
   Two to four cars. Not a grid of cards — each car is a record with a full
   measure of room, separated by a hairline and a large interval. Four equal
   modules would be one module shown four times.                               */

.lot {
  display: grid;
  gap: var(--sp-6);
  padding-block: var(--sp-8);
  border-top: var(--hairline) solid var(--rule);
}

.lot:last-child { border-bottom: var(--hairline) solid var(--rule); }

@media (min-width: 56rem) {
  .lot {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--sp-8);
    align-items: start;
  }
  /* the second record inverts its column order, so the page develops rather
     than repeating a formula down its own length */
  .lot:nth-child(even) .lot__media { order: 2; }
}

.lot__media {
  aspect-ratio: 16 / 10;
  background: var(--graphite-800);
  border: var(--hairline) solid var(--rule);
  overflow: hidden;
}

.lot__media img { width: 100%; height: 100%; object-fit: cover; }

.lot__index {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  color: var(--text-muted);
}

.lot__title { margin-block: var(--sp-3) var(--sp-5); }

.lot__spec { margin-block-end: var(--sp-6); }

/* ── BUILD — the configurator's entry ─────────────────────────────────────── */

.build-entry {
  display: grid;
  gap: var(--sp-8);
}

@media (min-width: 56rem) {
  .build-entry { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
}

.build-entry__steps {
  display: grid;
  gap: 0;
  border-top: var(--hairline) solid var(--rule);
}

.build-step {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: var(--sp-5);
  padding-block: var(--sp-5);
  border-bottom: var(--hairline) solid var(--rule);
}

.build-step__n {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  color: var(--text-muted);
  padding-block-start: 0.2em;
}

.build-step__body > .t-h3 + p { margin-block-start: var(--sp-2); }

/* ── WHO WE ARE ───────────────────────────────────────────────────────────── */

.about {
  display: grid;
  gap: var(--sp-8);
}

@media (min-width: 56rem) {
  .about { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); align-items: start; }
}

.about__figures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
}

.about__figures img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: var(--hairline) solid var(--rule);
}

/* the second image drops a step, so the pair reads as composed rather than
   as two slots in a row */
@media (min-width: 40rem) {
  .about__figures img:nth-child(2) { margin-block-start: var(--sp-7); }
}

/* ── SERVICES ─────────────────────────────────────────────────────────────── */

.services { display: grid; gap: 0; border-top: var(--hairline) solid var(--rule); }

.service {
  display: grid;
  gap: var(--sp-4);
  padding-block: var(--sp-7);
  border-bottom: var(--hairline) solid var(--rule);
}

@media (min-width: 56rem) {
  .service { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--sp-8); align-items: start; }
}

/* ── CONSIGNMENT ──────────────────────────────────────────────────────────── */

.consign { max-width: var(--page-narrow); }

/* ── SOCIAL / REVIEWS / EVENTS ────────────────────────────────────────────── */

.strands {
  display: grid;
  gap: var(--sp-8);
}

@media (min-width: 56rem) {
  .strands { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-7); }
}

.strand { display: grid; gap: var(--sp-4); align-content: start; }

.quote {
  margin: 0;
  padding-block-start: var(--sp-4);
  border-top: var(--hairline) solid var(--rule);
}

.quote p { max-width: 34ch; }
.quote figcaption { margin-block-start: var(--sp-3); }

.events { display: grid; gap: 0; }

.event {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--sp-4);
  padding-block: var(--sp-4);
  border-bottom: var(--hairline) solid var(--rule);
}

.event:first-child { border-top: var(--hairline) solid var(--rule); }

.event__date {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── FOOTER ───────────────────────────────────────────────────────────────── */

.site-footer {
  background: var(--graphite-950);
  color: var(--ink-on-dark);
  padding-block: var(--sp-9) var(--sp-7);
}

.site-footer__top {
  display: grid;
  gap: var(--sp-8);
  padding-block-end: var(--sp-8);
  border-bottom: var(--hairline) solid var(--graphite-700);
}

@media (min-width: 56rem) {
  .site-footer__top { grid-template-columns: minmax(0, 5fr) repeat(2, minmax(0, 3fr)); }
}

.site-footer__mark img { height: 3.5rem; width: auto; }

.footer-list { list-style: none; display: grid; gap: var(--sp-3); }
.footer-list a { color: var(--ink-on-dark-muted); text-decoration: none; font-size: var(--fs-body-s); }
.footer-list a:hover { color: var(--ink-on-dark); }

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-block-start: var(--sp-6);
}

/* ── NARROW ───────────────────────────────────────────────────────────────── */

@media (max-width: 55.99rem) {
  .nav__list { display: none; }

  .nav-toggle-mobile {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    min-height: 2.75rem;
    padding-inline: var(--sp-3);
    background: none;
    border: var(--hairline) solid var(--graphite-700);
    border-radius: var(--radius);
    color: var(--ink-on-dark);
    font-family: var(--font-mono);
    font-size: var(--fs-label);
    letter-spacing: var(--ls-label);
    text-transform: uppercase;
    cursor: pointer;
  }

  .nav.is-open .nav__list {
    display: grid;
    gap: var(--sp-1);
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    padding: var(--sp-5) var(--gutter) var(--sp-7);
    background: var(--graphite-900);
    border-bottom: var(--hairline) solid var(--graphite-700);
  }

  .nav.is-open .nav__menu { position: static; box-shadow: none; background: none; border: 0; padding-inline: var(--sp-5); }

  /* The mobile hero is a separate composition, not the desktop one narrowed:
     type above, subject below, the spec strip under the subject. */
  .hero { min-height: 92svh; align-items: start; }
  .hero__still { object-position: 62% 74%; }
  .hero__field::after {
    background:
      linear-gradient(to bottom,
        rgb(var(--graphite-900-rgb) / 0.9) 0%,
        rgb(var(--graphite-900-rgb) / 0.6) 30%,
        rgb(var(--graphite-900-rgb) / 0.08) 54%),
      linear-gradient(to top,
        rgb(var(--graphite-900-rgb) / 0.9) 0%,
        rgb(var(--graphite-900-rgb) / 0) 40%);
  }
  .hero__inner { gap: var(--sp-6); }
  .hero__foot { flex-direction: column; align-items: stretch; }
  .hero__spec { min-width: 0; }
  .hero__spec .spec-strip { justify-content: flex-start; gap: var(--sp-5); }
  .hero__cta .btn { flex: 1 1 auto; justify-content: center; }
}

/* ── SCENE SCOPE ──────────────────────────────────────────────────────────
   The canvas is sticky inside a scope that spans the hero and the reveal, with
   a negative bottom margin pulling the content back over it. Sticky rather
   than fixed on purpose: the scene then starts and stops exactly where its
   scope does, with no scroll listener deciding when it should be visible and
   no chance of it surviving into a section it does not belong to.            */

.scene-scope {
  position: relative;
  background: var(--graphite-900);
}

.scene-mount {
  position: sticky;
  inset-block-start: 0;
  height: 100svh;
  z-index: 0;
  pointer-events: none;      /* the scene is not draggable, so it must not look it */
}

/* The hero is pulled back OVER the mount. The mount used to carry
   `margin-block-end: -100svh` instead, and that is a different thing than it
   looks: a negative bottom margin equal to the height collapses the sticky
   element to a zero-height margin box, and a sticky box is held inside its
   containing block by its MARGIN box. With nothing to hold, the canvas kept
   travelling a full viewport past the end of .scene-scope and hung over the
   first screen of Inventory — invisible only for as long as the scene happened
   to render mostly transparent. Pulling the following section up instead leaves
   the mount a real 100svh margin box, so it stops where its scope does. */
.scene-scope > .hero { margin-block-start: -100svh; }

.scene-mount canvas { width: 100%; height: 100%; display: block; }

/* The scrim travels with the canvas, so the reserved left third holds through
   the whole sequence rather than only over the hero's own still. */
.scene-mount::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg,
      rgb(var(--graphite-900-rgb) / 0.94) 0%,
      rgb(var(--graphite-900-rgb) / 0.86) 26%,
      rgb(var(--graphite-900-rgb) / 0.34) 52%,
      rgb(var(--graphite-900-rgb) / 0.06) 72%),
    linear-gradient(to top,
      rgb(var(--graphite-900-rgb) / 0.72) 0%,
      rgb(var(--graphite-900-rgb) / 0) 40%);
  pointer-events: none;
}

/* Two scrims would be one too many, so the still's own goes when the scene
   takes over. */
[data-scene-state='live'] .hero__field::after { opacity: 0; }

.scene-scope .hero,
.scene-scope .reveal {
  position: relative;
  z-index: 1;
  background: transparent;
}

/* ── REVEAL — the scroll sequence ─────────────────────────────────────────
   One screen per note. The text is what the visitor came for, so it is real
   HTML in the flow and it reads with the scene switched off; the car turning
   underneath is what binds each fact to the part it is about.                */

.reveal { position: relative; }

.reveal__note {
  min-height: 100svh;
  display: grid;
  align-content: center;
  padding-block: var(--sp-8);
}

.reveal__note .page { width: 100%; }

.note__body { max-width: 34rem; }

.note__index { margin-block-end: var(--sp-4); }

.note__fact {
  margin-block-start: var(--sp-5);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-3) var(--sp-5);
  padding-block-start: var(--sp-4);
  border-top: var(--hairline) solid var(--rule);
}

.note__figure {
  font-family: var(--font-mono);
  font-size: var(--fs-h3);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* The static path. Not the animation stopped — the same facts, composed as one
   plate, arriving together. Every note is present, readable and in order. */
.reveal[data-static] .reveal__note {
  min-height: 0;
  padding-block: var(--sp-6);
  border-top: var(--hairline) solid var(--rule);
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

.reveal[data-static] { padding-block-start: var(--sp-7); }

@media (prefers-reduced-motion: reduce) {
  .reveal__note {
    min-height: 0;
    padding-block: var(--sp-6);
    border-top: var(--hairline) solid var(--rule);
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }
}

/* ── NARROW ───────────────────────────────────────────────────────────────
   The mobile sequence is authored, not inherited: fewer stages, a nearer
   camera declared per note in the markup, and a scrim graded top-to-bottom
   because the type sits above the car rather than beside it.                 */

@media (max-width: 55.99rem) {
  .scene-mount::after {
    background:
      linear-gradient(to bottom,
        rgb(var(--graphite-900-rgb) / 0.9) 0%,
        rgb(var(--graphite-900-rgb) / 0.6) 30%,
        rgb(var(--graphite-900-rgb) / 0.08) 54%),
      linear-gradient(to top,
        rgb(var(--graphite-900-rgb) / 0.86) 0%,
        rgb(var(--graphite-900-rgb) / 0) 38%);
  }

  .reveal__note { align-content: start; padding-block-start: var(--sp-9); }

  /* dropped on narrow — the two model notes and the pipes carry the sequence;
     a fourth stage on a phone is scroll spent for a detail nobody can see */
  .reveal__note[data-narrow-drop] { display: none; }
}

/* ── CALLOUTS ─────────────────────────────────────────────────────────────
   A label with a line to the part it names, drawn over the canvas by
   assets/js/scene/choreography.js. Everything here is presentation only: the
   geometry is computed from the car, because a leader line that is positioned
   in CSS stops pointing at anything the moment the car turns.

   It sits ABOVE the scrim and below the text. The scrim is a ::after on the
   same element, so without the z-index the pseudo-element would paint over the
   line at exactly the side where the label is.                              */

.callouts {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease-out);
}

.callouts.is-on { opacity: 1; }

.callouts__line {
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1;
  stroke-opacity: 0.55;
}

/* The ring reads as a measurement mark rather than a pin: it is pointing at a
   part, not dropping a location. */
.callouts__ring {
  fill: none;
  stroke: var(--text);
  stroke-width: 1;
  stroke-opacity: 0.7;
}

.callouts__dot { fill: var(--text); }

.scene-mount::after { z-index: 0; }

/* On a phone the label is the width of the screen, so a leader line would have
   nowhere to go but across its own text. The note keeps the fact; the line is
   what gets cut. */
@media (max-width: 47.99rem) {
  .callouts { display: none; }
}


/* ── PLATE ────────────────────────────────────────────────────────────────
   A model name set as a filled mark rather than a coloured word.

   This is the ONLY sanctioned use of oxblood on the dark ground, and the reason
   is a measurement, not a preference: #820007 is 2.18:1 as text on graphite —
   unreadable — and 10.76:1 as a fill with --bone-050 on it. So it is a plate
   with a label, never a red heading.                                        */

.plate {
  display: inline-block;
  background: var(--oxblood);
  color: var(--bone-050);
  padding: 0.18em 0.5em 0.24em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* On the light ground the same name is oxblood TEXT, because there it measures
   8.55:1 and a filled plate would be the louder of the two. */
[data-ground="light"] .plate {
  background: none;
  color: var(--oxblood);
  padding: 0;
}
