/* M5CS.org — shared styles for the public site (Simple/).
   Hand-written, no build step. Every text color here is checked to WCAG AAA
   against the surfaces it sits on. */

@import url("https://fonts.googleapis.com/css2?family=Chivo+Mono:wght@400;500;600&display=swap");

@font-face {
  font-family: "Geist";
  src: url("https://cdn.jsdelivr.net/npm/geist@1.7.0/dist/fonts/geist-sans/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("https://cdn.jsdelivr.net/npm/geist@1.7.0/dist/fonts/geist-mono/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --ink:      #060501;   /* page */
  --panel:    #0b130d;   /* raised surfaces */
  --panel-2:  #121c14;   /* hover / nested */
  --rule:     #2a3d2e;
  --text:     #ece8df;
  --muted:    #aab3a5;   /* 8–9:1 on ink and panel */
  --accent:   #fed7aa;   /* actions only */
  --on-accent:#0d0b06;
  --green:    #8fd19e;
  --ref:      #c4a5ff;   /* Reference (build-sheet) figures — never anything else */

  /* The three CS paints and two calipers, as data colors. Same swatches as
     the tracker (application.css, .swatch.*) so a car reads the same in both. */
  --fdg:  #3E5643;
  --fbhg: #686868;
  --bhg:  linear-gradient(135deg, #c2c2c2 0%, #949494 35%, #7a7a7a 60%, #ababab 100%);
  --bhg-flat: #a3a3a3;   /* stripes and bars can't take a gradient */
  --red:  #cc2200;
  --gold: #e6b800;
  --link: #6b8c72;   /* text links; hover goes to --gold */
  --unk-line: #7d8b80;

  --wrap: 1120px;
  --gutter: 24px;
  --radius: 10px;
  --font: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --display: "Chivo Mono", "Geist Mono", ui-monospace, monospace;

  /* Type scale. Five steps plus a stat size; every font-size below uses one. */
  --t-xs:   0.8125rem;  /* meta, chart axes, tile names */
  --t-sm:   0.9375rem;  /* secondary: labels, nav, buttons, tables, footer */
  --t-md:   1rem;       /* body */
  --t-lg:   1.25rem;    /* h3, lede */
  --t-stat: 1.5rem;     /* figure values */
  --t-xl:   clamp(1.65rem, 1.2rem + 1.4vw, 2.1rem);  /* h2 */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a { transition: color .15s; }
a:hover { color: var(--gold); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.mono { font-family: var(--mono); font-feature-settings: "zero" 1; }
.muted { color: var(--muted); }
.ref { color: var(--ref); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (max-width: 640px) { :root { --gutter: 16px; } body { font-size: 1rem; } }

/* ── Type scale (1.25 ratio) ───────────────────────────────────────── */
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.15; margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.025em; }
h2 { font-size: var(--t-xl); letter-spacing: -0.02em; }
h3 { font-size: var(--t-md); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
p { margin: 0 0 1em; max-width: 68ch; }
.lede { font-size: var(--t-lg); line-height: 1.5; color: var(--muted); max-width: 60ch; }

/* ── Header / nav ──────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink);   /* opaque: a see-through bar let card photos sit behind the nav text */
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--rule); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; transition: opacity .35s ease, transform .35s ease; }
.brand-off .brand { opacity: 0; transform: translateY(12px); pointer-events: none; }
.nav a.nav-cta { margin-left: 12px; color: var(--on-accent); background: linear-gradient(180deg, #E1CFC8, #AF9186); font-weight: 600; }
.nav a.nav-cta:hover, .nav a.nav-cta[aria-current="page"] { background: linear-gradient(180deg, #EDE1DC, #C2A89E); color: var(--on-accent); }
.brand img { height: 40px; width: auto; }
.nav { display: flex; gap: 4px; margin-left: auto; }
/* Desktop: logo left, links centred, CTA right — all on the content width.
   The guide rail's gold bar runs flush with the top of the viewport and
   slides between links; leading edge first, trailing edge catching up. */
.nav-links { display: contents; }
.nb-bar { display: none; }
@media (min-width: 761px) {
  .site-header .wrap { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; }
  .site-header .brand { justify-self: start; }
  .site-header .nav { display: contents; }
  .site-header .nav-links { position: relative; display: flex; gap: 4px; align-self: stretch; }
  .site-header .nav-links::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--rule); border-radius: 2px; }
  .site-header .nav-links a { display: flex; align-items: center; border-radius: 0; color: var(--muted); transition: color .3s ease; }
  .site-header .nav .nav-links a[aria-current="page"] { box-shadow: none; }
  .nb-bar {
    display: block; position: absolute; top: 0; height: 2px; border-radius: 2px; opacity: 0;
    left: var(--nb-left, 0); right: var(--nb-right, 100%);
    background: var(--gold); box-shadow: 0 0 12px rgba(230, 184, 0, .45);
    transition: left .45s cubic-bezier(.65, 0, .35, 1), right .45s cubic-bezier(.65, 0, .35, 1), opacity .3s;
  }
  .nb-bar.on { opacity: 1; }
  .nb-bar.right { transition-delay: .12s, 0s, 0s; }
  .nb-bar.left  { transition-delay: 0s, .12s, 0s; }
  .nb-bar.snap  { transition: none; }
  .site-header .nav-links a:hover { background: none; }
  .site-header .nav-cta { justify-self: end; margin-left: 0; }
}
.nav a {
  color: var(--link); text-decoration: none; font-size: var(--t-sm);
  padding: 8px 12px; border-radius: 8px;
}
.nav a:hover { color: var(--gold); background: var(--panel); }
.nav a[aria-current="page"]:not(.nav-cta) { color: var(--gold); background: none; border-radius: 0; box-shadow: inset 0 -3px 0 var(--rule); }
.nav-toggle {
  display: none; margin-left: auto; background: none; border: 1px solid var(--rule);
  color: var(--text); border-radius: 8px; padding: 8px 12px; font: inherit; font-size: var(--t-sm); cursor: pointer;
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 64px;
    flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px;
    background: var(--ink); border-bottom: 1px solid var(--rule);
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 4px; font-size: var(--t-md); border-radius: 0; border-bottom: 1px solid var(--rule); }
  .nav a:last-child { border-bottom: 0; }
  .nav a.nav-cta { margin: 12px 0 0; padding: 12px; text-align: center; border-radius: 8px; border-bottom: 0; }
}

/* ── Sections ──────────────────────────────────────────────────────── */
/* Short pages: main takes the spare height, so the footer sits at the bottom. */
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
main { display: block; flex: 1 0 auto; }
.section { padding: 72px 0; }
.section.section-flush { padding-top: 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head p { margin: 0; color: var(--muted); }
@media (max-width: 640px) { .section { padding: 48px 0; } }

/* ── Hero: the production run ──────────────────────────────────────── */
/* Full-bleed: the 1,132-cell grid spans the viewport, not the 1120px wrap. */
.hero {
  position: relative; padding: 32px 0 64px;
  border-bottom: 1px solid var(--rule);
}
/* The photo sits behind the chart only, sized to its full height and
   faded at the sides, dimmed so chips stay legible over it. */
.fleet { position: relative; isolation: isolate; overflow: clip; }
.fleet::before {
  content: ""; position: absolute; z-index: -1; top: 0; left: 50%; height: 100%; aspect-ratio: 950 / 600;
  transform: translateX(-50%); background: url("background.jpg") center / cover; opacity: 0.85;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
/* On phones the chart is taller than wide: fit the photo to the width instead. */
@media (max-width: 640px) {
  .fleet::before { top: 50%; left: 0; width: 100%; height: auto; transform: translateY(-50%); }
}
.hero-inner { position: relative; padding: 0 clamp(16px, 3vw, 48px); max-width: 1600px; margin: 0 auto; }
.hero-top { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px; }
.count-line { display: flex; justify-content: center; align-items: baseline; gap: 0.25em; flex-wrap: wrap; font-size: clamp(2.8rem, 8vw, 7rem); line-height: 0.9; }
.hero-logo { height: 0.72em; width: auto; align-self: baseline; margin-right: 0.2em; transition: opacity .35s ease; }
.hero-logo.gone { opacity: 0; }
.hero-logo-link { display: contents; }
.hero-logo-link.gone-link { pointer-events: none; }
.count { font-weight: 300; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.count-of { font-weight: 300; letter-spacing: -0.05em; color: var(--muted); font-variant-numeric: tabular-nums; }
.count-of .of { font-size: max(0.5em, 24px); color: var(--fbhg); letter-spacing: 0; }
.count-of .n-built { color: var(--text); }
.count-of .fn { font-size: 0.3em; vertical-align: super; letter-spacing: 0; color: var(--muted); text-decoration: none; margin-left: 0.05em; }
.count-of .fn:hover { color: var(--text); }
.count-of strong { color: var(--text); font-weight: 400; }
.hero-side { max-width: 72ch; margin: 0 auto; }
.hero-side .lede { margin: 0 auto; max-width: none; font-size: var(--t-sm); }
/* Source note on the asterisk: hover or tap, like the "?" on the original index. */
.count-of .fn-wrap { position: relative; top: -1.6em; display: inline-block; font-size: 0.3em; vertical-align: baseline; letter-spacing: 0; line-height: 1; }
.count-of .fn-wrap .fn { font-size: 1em; vertical-align: baseline; cursor: pointer; }
.fn-tip {
  position: absolute; left: 50%; top: 100%; transform: translateX(-50%); padding-top: 10px;
  visibility: hidden; opacity: 0; translate: 0 -8px; transition: opacity .18s ease, translate .18s ease, visibility .18s; z-index: 10;
}
.fn-tip span {
  display: block; position: relative; white-space: nowrap; padding: 8px 12px; border-radius: 8px;
  background: #f3f4f6; color: #111; font: 400 var(--t-xs)/1.4 var(--font); letter-spacing: 0; text-align: center;
}
.fn-tip span::after { content: ""; position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); border: 5px solid transparent; border-bottom-color: #f3f4f6; }
.fn-tip a { color: #7c2d12; }
.fn-wrap:hover .fn-tip, .fn-wrap:focus-within .fn-tip, .fn-wrap.open .fn-tip { visibility: visible; opacity: 1; translate: 0 0; }
@media (max-width: 640px) { .fn-tip { left: auto; right: -8px; transform: none; } .fn-tip span { white-space: normal; width: 240px; text-wrap: balance; } .fn-tip br { display: none; } .fn-tip span::after { left: auto; right: 6px; transform: none; } }

.fleet {
  --cols: 57; --cb: 3px; --mark: 14px;
  display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 3px;
  grid-template-rows: repeat(var(--rows, 20), auto); grid-auto-flow: column;   /* fills top to bottom */
  margin-top: 20px; padding: 0; list-style: none;
}
@media (max-width: 1100px) { .fleet { --cols: 40; --mark: 12px; } }
@media (max-width: 640px)  { .fleet { --cols: 28; gap: 2px; --cb: 2px; --mark: 8px; grid-auto-flow: row; grid-template-rows: none; } }   /* left to right, then down */

/* One chip per car, in the tracker's swatch colors: paint fill, caliper
   color along the bottom edge. Partial records are striped instead of
   solid; an unknown paint or caliper is a dotted line with no fill. */
.fleet span, .legend i {
  aspect-ratio: 1; border-radius: 2px; background: transparent;
  box-shadow: inset 0 0 0 1px #233127;
}
.fleet span[class], .legend i[class] { box-shadow: none; }
/* Caliper color as a right triangle in the bottom-right corner. */
.fleet span[class]::before, .legend i[class]::before {
  content: ""; position: absolute; right: 0; bottom: 0; width: 50%; height: 50%;
  background: var(--cal, transparent); clip-path: polygon(100% 0, 100% 100%, 0 100%); border-bottom-right-radius: 2px;
}
.p-fdg  { --paint: var(--fdg); }
.p-fbhg { --paint: var(--fbhg); }
.p-bhg  { --paint: var(--bhg-flat); }
.k-red  { --cal: var(--red); }
.k-gold { --cal: var(--gold); }
.fleet .solid, .legend .solid { background: var(--paint); }
.fleet .solid.p-bhg, .legend .solid.p-bhg { background: var(--bhg); }
/* Salvage: paint stripes over red stripes running the other way. */
.fleet .stripe, .legend .stripe {
  background:
    repeating-linear-gradient(135deg, var(--paint) 0 2px, transparent 2px 4.5px),
    repeating-linear-gradient(45deg, var(--red) 0 1.5px, transparent 1.5px 4.5px);
}
.fleet .k-unk, .legend .k-unk { --cal: var(--ink); }
.fleet .p-unk, .legend .p-unk { border: 1px dotted var(--unk-line); }
.fleet span, .legend i { position: relative; }
/* "?" for unknown paint, drawn in the page color; no caliper corner. */
.fleet .p-unk::before, .legend .p-unk::before { display: none; }
.fleet .p-unk::after, .legend .p-unk::after {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--ink); font: 700 var(--mark, 14px)/1 var(--font);
}
.fleet .p-unk::after, .legend .p-unk::after { content: "?"; }
.fleet .p-unk, .legend .p-unk { background: rgba(74,74,74,0.35); }
.fleet .p-unk::after, .legend .p-unk::after { color: var(--unk-line); }
@media (prefers-reduced-motion: no-preference) {
  .fleet.animate span { animation: cell-in 0.5s ease-out both; animation-delay: calc(var(--i) * 0.5ms); }
  @keyframes cell-in { from { opacity: 0; } }
}

.legend { display: grid; grid-template-columns: repeat(3, 1fr) 0.85fr; gap: 12px; margin-top: 22px; font-size: var(--t-sm); color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
/* Each key row: swatch and name left, count right. */
.legend .group > span, .legend .cals > span, .legend .status > span { display: flex; cursor: default; }
.legend b { margin-left: auto; padding-left: 12px; }
.legend [data-hl]:hover { color: var(--text); }
.fleet span { transition: opacity .15s; }
.fleet.dimming span { opacity: 0.15; }
.fleet.dimming span.hl { opacity: 1; }
.legend i { width: 16px; display: inline-block; --cb: 3px; --mark: 11px; }
.legend svg.tri { width: 12px; height: 12px; flex: none; }
.legend svg.tri path { stroke: var(--unk-line); stroke-width: 1; stroke-linejoin: round; }
.legend b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.legend .group { display: grid; gap: 10px; padding: 12px 16px; border: 1px solid var(--rule); border-radius: 8px; background: rgba(11,19,13,0.6); }
.legend .group > span:first-child { color: var(--text); font-size: 1.1rem; white-space: nowrap; }
.legend .group > span:first-child i { width: 20px; --mark: 13px; }
/* Calipers on one row, one equal column each. */
.legend .group > .cals { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 10px; font-size: var(--t-xs); }
.legend .group > .cals > span { gap: 6px; }
.legend .group > .cals b { padding-left: 6px; }
/* Status items: a fourth column of three stacked cards. */
.legend .status { display: grid; grid-template-rows: repeat(3, 1fr); gap: 6px; }
.legend .status > span { white-space: nowrap; padding: 0 14px; }
@media (max-width: 1100px) { .legend { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .legend { grid-template-columns: 1fr; } .legend .status > span { padding: 10px 14px; } }

/* ── Breakdown: paint and calipers ─────────────────────────────────── */
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px; }
.panel h3 { margin-bottom: 18px; }
.paint-rows { display: grid; gap: 14px; }
.paint-row { display: grid; grid-template-columns: 290px 1fr auto; align-items: center; gap: 14px; }
.paint-name { display: flex; align-items: center; gap: 10px; }
.chip { width: 18px; height: 18px; border-radius: 3px; flex: none; border: 1px solid rgba(255,255,255,.15); }
.bar { height: 26px; border-radius: 6px; background: #1a261c; overflow: hidden; display: flex; }
.bar > i { display: flex; align-items: center; height: 100%; padding: 0 10px; font-style: normal; font-size: var(--t-xs); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.bar .b-red  { background: var(--red); color: #fff; }
.bar .b-gold { background: var(--gold); color: var(--on-accent); }
.bar .b-unk  { background: repeating-linear-gradient(90deg, var(--unk-line) 0 2px, transparent 2px 5px); }
.paint-n { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 3ch; text-align: right; }
.paint-name .pct { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 3.5ch; text-align: right; }
.paint-n .ref { font-weight: 400; margin-left: 6px; }
@media (max-width: 520px) { .paint-row { grid-template-columns: 1fr auto; } .paint-row .bar { grid-column: 1 / -1; order: 3; } }

/* ── Where they're from: an abstracted tile map ────────────────────────── */
/* Each country is one tile on a coarse grid that keeps rough geography
   (Americas left, Europe centre, Gulf and Asia-Pacific right). Under 760px
   the grid gives way to a plain list in the same order. */
.wide { padding: 0 clamp(16px, 3vw, 48px); max-width: 1600px; margin: 0 auto; }
.geo { display: grid; grid-template-columns: repeat(14, 1fr); grid-auto-rows: minmax(104px, auto); gap: 4px; grid-auto-flow: row dense; }
.geo-tile.big { grid-column: span 2; grid-row: span 2; }
.geo-tile {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr); align-content: space-between;
  padding: 10px 12px; background: var(--panel); border-radius: 6px; box-shadow: inset 0 0 0 1px var(--rule);
  min-width: 0;
}
.geo-tile svg { position: absolute; top: 34px; left: 10px; width: calc(100% - 46px); height: calc(100% - 42px); }
.geo-tile.big svg { top: 44px; width: calc(100% - 24px); height: calc(100% - 100px); }
.geo-tile path { fill: #4f6b55; fill-opacity: var(--heat, 0.1); stroke: var(--accent); stroke-opacity: 0.45; stroke-width: 1; vector-effect: non-scaling-stroke; }
.geo-tile .gt-top, .geo-tile .gt-n { position: relative; }
.geo-tile .gt-ref { position: absolute; top: 10px; right: 12px; font-size: var(--t-xs); color: var(--muted); opacity: 0.8; font-variant-numeric: tabular-nums; text-shadow: 0 0 6px var(--panel); }
.geo-tile.big .gt-ref { font-size: var(--t-md); }
.geo-tile .gt-top { display: flex; align-items: center; gap: 6px; font-size: var(--t-xs); color: var(--text); line-height: 1.2; }
.geo-tile .gt-top .flag { font-size: 1.6rem; line-height: 1; }
.geo-tile .gt-top .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 0 6px var(--panel), 0 0 2px var(--panel); }
.geo-tile .gt-n { justify-self: end; font-size: var(--t-stat); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.geo-tile.big .gt-n { font-size: clamp(2rem, 3.6vw, 3.2rem); font-weight: 300; letter-spacing: -0.03em; }
.geo-tile.big .gt-top { font-size: var(--t-md); }
.geo-foot { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-top: 16px; color: var(--muted); font-size: var(--t-sm); }
.geo-foot p { margin: 0; }
@media (max-width: 1100px) { .geo { grid-template-columns: repeat(10, 1fr); } }
@media (max-width: 760px) {
  .geo { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 84px; }
}

/* ── Price chart ───────────────────────────────────────────────────── */
.price-grid { display: grid; grid-template-columns: 1fr 260px; gap: 20px; align-items: start; }
@media (max-width: 860px) { .price-grid { grid-template-columns: 1fr; } }
.chart svg { width: 100%; height: auto; display: block; }
.chart .axis text { fill: var(--muted); font: 400 var(--t-xs) var(--font); font-variant-numeric: tabular-nums; }
.chart .grid line { stroke: #1f2c22; }
.dot-sold { fill: var(--accent); }
.dot-ask { fill: none; stroke: var(--accent); stroke-opacity: 0.6; }
.price-key { display: flex; gap: 8px 20px; flex-wrap: wrap; margin-top: 12px; font-size: var(--t-sm); color: var(--muted); }
.price-key span { display: inline-flex; align-items: center; gap: 8px; }
.price-key svg { width: 10px; height: 10px; overflow: visible; }
.sub-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.latest { margin-bottom: 48px; }
.latest-more { display: flex; justify-content: center; margin-top: 24px; }
.latest .cards { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1080px) { .latest .cards { grid-template-columns: repeat(3, 1fr); } .latest .card:nth-child(4) { display: none; } }
@media (max-width: 760px)  { .latest .cards { grid-template-columns: repeat(2, 1fr); } .latest .card:nth-child(4) { display: flex; } }
@media (max-width: 520px)  { .latest .cards { grid-template-columns: 1fr; } }
.figures { display: grid; gap: 16px; margin: 0; }
.figures div { border-left: 2px solid var(--rule); padding-left: 14px; }
.figures dt { color: var(--muted); font-size: var(--t-sm); }
.figures .fig-sales { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; }
.figures .fig-sales .seg { grid-column: 2; grid-row: 1 / 3; }
.figures dd { margin: 2px 0 0; font-size: var(--t-stat); font-weight: 600; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button {
  font: inherit; font-size: var(--t-sm); color: var(--muted); background: none; border: 0;
  padding: 6px 12px; border-radius: 6px; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); }

/* ── Listing cards ─────────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1080px) { .cards { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px)  { .cards { grid-template-columns: 1fr; } }
/* Matches the current site's listing cards. */
.card {
  display: flex; flex-direction: column; background: #0b130c; border: 1px solid #1e3022;
  border-radius: 12px; overflow: hidden; color: inherit; text-decoration: none; transition: border-color .15s;
}
.card:hover { border-color: #2a3d2e; }
.card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; display: block; background: #0f1a10; }
.card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.card-price { display: flex; align-items: flex-start; gap: 6px; }
.card-flag { font-size: 1.125rem; line-height: 1.1; margin-top: 1px; flex: none; }
.card-price strong { font-size: var(--t-md); font-weight: 600; color: #f1f5f9; line-height: 1.3; font-variant-numeric: tabular-nums; }
.card-miles { margin-left: auto; flex: none; font: 500 var(--t-xs)/1.5 var(--mono); color: #f1f5f9; }
.card .bidding { font-size: var(--t-sm); font-weight: 600; color: #f59e0b; letter-spacing: .02em; }
.card .unlisted { color: #8fb196; font-weight: 500; }
/* The old #3d5c43 is under 3:1 here; this keeps the hue at 8:1. */
.card-meta { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; font: var(--t-xs)/1.4 var(--mono); color: #8fb196; }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; }
.toolbar select {
  font: inherit; font-size: var(--t-sm); color: var(--text); background: var(--panel);
  border: 1px solid var(--rule); border-radius: 8px; padding: 8px 12px;
}
.toolbar .count-note { margin-left: auto; color: var(--muted); }

/* ── Buttons, forms ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600; font-size: var(--t-sm);
  padding: 11px 18px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: #ffe4c4; }
.btn-quiet { background: none; color: var(--text); border-color: var(--rule); }
.btn-quiet:hover { border-color: var(--muted); }
.form { display: grid; gap: 16px; max-width: 520px; }
.form label { display: grid; gap: 6px; font-size: var(--t-sm); }
.form input, .form textarea, .form select {
  font: inherit; color: var(--text); background: var(--ink); border: 1px solid var(--rule);
  border-radius: 8px; padding: 11px 12px;
}
.form input:focus, .form textarea:focus { border-color: var(--accent); outline: none; }
.form-status { margin: 0; }

/* ── Long-form pages (guide, about) ────────────────────────────────── */
.page-head { padding: 28px 0 32px; }
.page-head .lede { margin-top: 16px; }
.prose { max-width: 70ch; line-height: 1.7; }
.prose h2 { margin: 56px 0 14px; line-height: 1.15; }
.prose h3 { line-height: 1.25; }
.prose h3 { margin: 32px 0 10px; }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--muted); }
.toc { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.toc a { display: block; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 999px; text-decoration: none; color: var(--link); font-size: var(--t-sm); }
.toc a:hover { color: var(--gold); border-color: var(--muted); }

/* Guide: sticky jump-link rail. A bar tracks the section in view; it
   stretches toward the next item, then its trailing edge catches up. */
.guide-layout { display: block; }
.guide-nav { margin-bottom: 8px; }
.gn-bar { display: none; }
.guide-help { margin-top: 56px; scroll-margin-top: 88px; }
@media (min-width: 1000px) {
  .guide-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 56px; align-items: start; }
  .guide-nav { position: sticky; top: 96px; margin: 0; }
  .guide-help { max-width: calc(200px + 56px + 70ch); }
  .guide-layout .prose > h2:first-child { margin-top: 0; }
  .guide-nav nav { position: relative; padding-left: 18px; }
  .guide-nav nav::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--rule); border-radius: 2px; }
  .guide-nav .toc { flex-direction: column; flex-wrap: nowrap; gap: 2px; margin: 0; }
  .guide-nav .toc a {
    border: 0; border-radius: 0; padding: 7px 0; color: var(--muted);
    transition: color .3s ease, transform .45s cubic-bezier(.2, .8, .2, 1);
  }
  .guide-nav .toc a:hover { color: var(--gold); }
  .guide-nav .toc a.is-active { color: var(--gold); transform: translateX(6px); }
  .gn-bar {
    display: block; position: absolute; left: 0; width: 2px; border-radius: 2px;
    top: var(--gn-top, 0); bottom: var(--gn-bottom, 100%);
    background: var(--gold); box-shadow: 0 0 12px rgba(230, 184, 0, .45);
    transition: top .45s cubic-bezier(.65, 0, .35, 1), bottom .45s cubic-bezier(.65, 0, .35, 1), opacity .3s;
  }
  /* Leading edge moves first; trailing edge follows — reads as a stretch. */
  .gn-bar.down { transition-delay: .12s, 0s, 0s; }
  .gn-bar.up   { transition-delay: 0s, .12s, 0s; }
}
@media (prefers-reduced-motion: reduce) {
  .gn-bar, .nb-bar, .guide-nav .toc a, .site-header .nav-links a { transition: none !important; }
}
.vin-anatomy { font-family: var(--mono); font-size: clamp(1.1rem, 3.6vw, 1.8rem); letter-spacing: 0.08em; overflow-wrap: anywhere; }
.vin-anatomy .v { color: var(--accent); }
.table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.table th, .table td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table th { color: var(--muted); font-weight: 500; }
.table td.n { font-variant-numeric: tabular-nums; text-align: right; }
.table th.n { text-align: right; }
.parts-total { font-size: var(--t-lg); }
.parts-total strong { font-size: var(--t-xl); display: block; line-height: 1.2; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

/* ── Videos ────────────────────────────────────────────────────────── */
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
@media (max-width: 520px) { .videos { grid-template-columns: 1fr 1fr; gap: 10px; } }
.video-title { margin-bottom: 12px; }
.video-feature { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; margin-bottom: 16px; padding: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--rule); background: #000; cursor: pointer; }
.video-feature img, .video-feature iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.video-feature .play { position: absolute; left: 50%; top: 50%; width: 88px; height: 88px; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(6,5,1,.72); display: grid; place-items: center; transition: background .15s, transform .15s; }
.video-feature .play svg { width: 34px; height: 34px; margin-left: 5px; fill: var(--accent); }
.video-feature:hover .play { background: rgba(6,5,1,.9); transform: translate(-50%, -50%) scale(1.06); }
@media (max-width: 520px) { .video-feature .play { width: 60px; height: 60px; } .video-feature .play svg { width: 24px; height: 24px; } }
.videos a { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--rule); }
.videos img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }

/* ── Footer ────────────────────────────────────────────────────────── */
.site-footer { background: linear-gradient(to bottom, var(--ink), var(--panel)); margin-top: 24px; padding: 40px 0 32px; color: var(--muted); font-size: var(--t-sm); }
.footer-copy { margin: 0; max-width: none; }
.footer-legal a { color: #8aa490; text-decoration: none; }
.footer-legal a:hover { color: var(--gold); }
.footer-legal { margin-top: 20px; padding-top: 20px; border-top: 1px solid rgba(42,61,46,.6); display: flex; gap: 8px 24px; justify-content: space-between; flex-wrap: wrap; font-size: var(--t-xs); }
.footer-legal p { margin: 0; }

.empty { padding: 32px; text-align: center; color: var(--muted); border: 1px dashed var(--rule); border-radius: var(--radius); }

.cost-bands { grid-template-columns: repeat(3, 1fr); margin: 8px 0 16px; }
.cost-bands dd { font-size: var(--t-lg); }
.cost-bands p { margin: 6px 0 0; font-size: var(--t-sm); }
@media (max-width: 640px) { .cost-bands { grid-template-columns: 1fr; } }

/* CS basics, above the paint panel */
.basics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0 0 24px; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.basics div { padding: 18px 20px; outline: 1px solid var(--rule); outline-offset: -0.5px; }
.basics dt { color: var(--muted); font-size: var(--t-sm); }
.basics dd { margin: 4px 0 0; font-size: var(--t-md); line-height: 1.4; }
.basics dd strong { display: block; font-size: var(--t-stat); font-weight: 600; line-height: 1.15; }
@media (max-width: 860px) { .basics { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .basics { grid-template-columns: 1fr; } }
.geo-tile.zero { background: var(--ink); }
.geo-tile.zero path { fill-opacity: 0; stroke-opacity: 0.3; }
.geo-tile.zero .gt-n { color: var(--muted); font-weight: 400; }
.geo-tile .gt-n { text-shadow: 0 0 8px var(--panel), 0 0 3px var(--panel); }
.latest .card-price strong { font-size: var(--t-md); white-space: nowrap; }
.latest .card-price .muted { white-space: nowrap; }
.geo-tile .gt-top { padding-right: 2.6em; }
.card-meta span:first-child { white-space: nowrap; flex: none; }
.card-meta span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── CS Parts: group overview ───────────────────────────────────── */
.part-groups { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 20px; }
.part-groups .pg { grid-column: span 2; }
.part-groups .pg:nth-child(n+4) { grid-column: span 3; }
@media (max-width: 960px) { .part-groups { grid-template-columns: 1fr 1fr; } .part-groups .pg, .part-groups .pg:nth-child(n+4) { grid-column: auto; } }
@media (max-width: 640px) { .part-groups { grid-template-columns: 1fr; } }
.pg { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px 24px; display: flex; flex-direction: column; }
.pg-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pg-n { font: var(--t-xs) var(--mono); color: var(--muted); white-space: nowrap; }
.pg-total { margin: 10px 0 10px; font-size: var(--t-xl); font-weight: 300; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.pg-bar { height: 4px; border-radius: 2px; background: #1a261c; margin-bottom: 16px; }
.pg-bar i { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
.pg-blurb { color: var(--muted); font-size: var(--t-sm); line-height: 1.5; }
.pg-top { list-style: none; margin: auto 0 0; padding: 12px 0 0; border-top: 1px solid var(--rule); display: grid; gap: 6px; font-size: var(--t-sm); }
.pg-top li { display: flex; justify-content: space-between; gap: 12px; }
.pg-top b { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pg-foot { font-size: var(--t-sm); max-width: 70ch; margin: 0 auto 48px; text-align: center; }

/* ── Contact card (reusable: [data-contact]) ───────────────────────── */
/* Follows the current site's brokerage callout: copy left, form right. */
.contact-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.contact-card .ct-copy { padding: 40px; display: flex; flex-direction: column; gap: 14px; }
.contact-card .ct-copy p { margin: 0; color: var(--muted); font-size: var(--t-sm); line-height: 1.6; }
.contact-card h2 { margin: 0; font-size: var(--t-xl); max-width: none; }
.ct-eyebrow { font: 500 var(--t-xs) var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.ct-points { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; font-size: var(--t-sm); color: var(--muted); }
.ct-points li { display: flex; gap: 10px; }
.ct-points strong { color: var(--text); font-weight: 500; }
.ct-points li::before { content: "✓"; color: var(--accent); }
.contact-card .ct-form { padding: 40px; gap: 6px; max-width: none; background: var(--panel-2); border-left: 1px solid var(--rule); align-content: start; }
.ct-form label { font: 500 var(--t-xs) var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 8px; }
.ct-form label:first-of-type { margin-top: 0; }
.ct-form textarea { resize: vertical; }
.ct-form > div { margin-top: 12px; }
.ct-form .form-status:empty { display: none; }
@media (max-width: 760px) {
  .contact-card { grid-template-columns: 1fr; }
  .contact-card .ct-copy, .contact-card .ct-form { padding: 24px; }
  .contact-card .ct-form { border-left: 0; border-top: 1px solid var(--rule); }
}
.callout { border-left: 3px solid var(--accent); background: var(--panel); padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; margin: 24px 0; }
.callout p:last-child { margin-bottom: 0; }
.guide-layout [id] { scroll-margin-top: 88px; }
@media (prefers-reduced-motion: no-preference) { html:has(.guide-layout) { scroll-behavior: smooth; } }
