/* USask Baja SAE — site styles */

/* ---------- Fonts (self-hosted, no third-party requests) ---------- */
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --ivory: #f4f5f3;
  --paper: #ffffff;
  --ink: #16201c;
  --muted: #69716c;
  --line: #dfe2de;
  --forest: #13382c;
  --forest-deep: #0c261e;
  --champagne: #3d8b37;
  --champagne-soft: #9fd18f;
  --serif: var(--sans);
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 1160px;
  --band: #13382c;
  --band-deep: #0c261e;
  --on-band: #f4f5f3;
  --header-bg: rgba(244, 245, 243, 0.92);
  --topo-ink: rgba(19, 56, 44, 0.11);
  color-scheme: light;
}

/* Dark mode: follows the device unless the visitor picks a theme with the toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ivory: #0e1311;
    --paper: #141a17;
    --ink: #e7ece8;
    --muted: #9ba59f;
    --line: #27312c;
    --forest: #a8d89a;
    --forest-deep: #c6e7bb;
    --champagne: #78c768;
    --champagne-soft: #9fd18f;
    --band: #10281f;
    --band-deep: #09150f;
    --header-bg: rgba(14, 19, 17, 0.88);
    --topo-ink: rgba(168, 216, 154, 0.075);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ivory: #0e1311;
  --paper: #141a17;
  --ink: #e7ece8;
  --muted: #9ba59f;
  --line: #27312c;
  --forest: #a8d89a;
  --forest-deep: #c6e7bb;
  --champagne: #78c768;
  --champagne-soft: #9fd18f;
  --band: #10281f;
  --band-deep: #09150f;
  --header-bg: rgba(14, 19, 17, 0.88);
  --topo-ink: rgba(168, 216, 154, 0.075);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
}

main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

::selection { background: var(--champagne-soft); color: var(--forest-deep); }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.08;
  margin: 0 0 0.45em;
  letter-spacing: -0.025em;
}
h1 { font-size: clamp(2.4rem, 5.6vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
em { font-style: normal; color: var(--champagne); }

p { margin: 0 0 1.1em; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .container { padding: 0 16px; } }

.eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--champagne);
  margin-bottom: 16px;
}

.rule {
  width: 56px;
  height: 1px;
  background: var(--champagne);
  border: 0;
  margin: 28px 0;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand img { width: 48px; height: auto; }
.brand-name {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--forest);
}
.brand-name small {
  display: block;
  font-family: var(--sans);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: -2px;
}

.site-nav { margin-left: auto; }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: 28px; }

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.theme-toggle:hover { border-color: var(--champagne); color: var(--champagne); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--forest);
  color: var(--forest);
  font: 600 0.75rem var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 14px;
  cursor: pointer;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; }
.site-nav a {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.site-nav a:hover { color: var(--champagne); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--champagne); }

@media (max-width: 1080px) {
  .nav-toggle { display: block; }
  .header-actions { margin-left: auto; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ivory);
    border-bottom: 1px solid var(--line);
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 8px 16px 20px; }
  .site-nav a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .site-nav a[aria-current="page"] { color: var(--champagne); border-bottom-color: var(--line); }
}

/* ---------- Hero ---------- */
.hero { padding: 96px 0 104px; border-bottom: 1px solid var(--line); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
}
.hero p.lead { max-width: 520px; }
.hero-logo { justify-self: center; width: 100%; max-width: 460px; }
@media (max-width: 880px) {
  .hero { padding: 56px 0 72px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-logo { max-width: 320px; order: -1; }
}

.page-hero { padding: 96px 0 72px; border-bottom: 1px solid var(--line); }
.page-hero p.lead { max-width: 620px; }
@media (max-width: 600px) { .page-hero { padding: 56px 0 48px; } }

.lead { font-size: 1.12rem; color: var(--muted); max-width: 680px; }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.btn {
  display: inline-block;
  padding: 15px 30px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--forest);
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.btn-primary { background: var(--forest); color: var(--ivory); }
.btn-primary:hover { background: var(--forest-deep); }
.btn-ghost { color: var(--forest); }
.btn-ghost:hover { background: var(--forest); color: var(--ivory); }
.on-dark .btn-primary { background: var(--champagne-soft); border-color: var(--champagne-soft); color: var(--band-deep); }
.on-dark .btn-primary:hover { background: #fff; border-color: #fff; }
.on-dark .btn-ghost { color: var(--on-band); border-color: rgba(244, 245, 243, 0.5); }
.on-dark .btn-ghost:hover { background: var(--on-band); color: var(--band-deep); }

/* ---------- Sections ---------- */
section { padding: 112px 0; }
section + section { border-top: 1px solid var(--line); }
section.paper { background: var(--paper); }
@media (max-width: 600px) { section { padding: 72px 0; } }

.split {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 64px;
}
@media (max-width: 880px) { .split { grid-template-columns: 1fr; gap: 16px; } }

.statement {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  line-height: 1.45;
  letter-spacing: -0.015em;
  color: var(--forest);
  margin: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  margin-top: 56px;
}
.cell {
  padding: 40px 32px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cell .num {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--champagne);
  display: block;
  margin-bottom: 18px;
}
.cell h3 { font-size: 1.2rem; }
.cell p { color: var(--muted); margin: 0; }
.cell a { color: var(--forest); }

/* ---------- Roadmap ---------- */
.roadmap { list-style: none; padding: 0; margin: 56px 0 0; counter-reset: step; }
.roadmap li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.roadmap li:last-child { border-bottom: 1px solid var(--line); }
.roadmap .phase {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2px;
}
.roadmap li.current .phase { color: var(--champagne); }
.roadmap li.current .phase::after { content: " · Now"; }
.roadmap h3 { margin-bottom: 6px; }
.roadmap p { color: var(--muted); margin: 0; max-width: 620px; }
@media (max-width: 600px) { .roadmap li { grid-template-columns: 1fr; gap: 8px; } }

/* ---------- People / sponsors / gallery ---------- */
.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 48px 32px;
}
.person img, .person .avatar {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--band);
  margin-bottom: 18px;
}
.person .avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--champagne-soft);
}
.person h3 { font-size: 1.15rem; margin-bottom: 2px; }
.person .role {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--champagne);
}
.person p { color: var(--muted); font-size: 0.95rem; margin: 6px 0 0; }

.tier { margin-bottom: 72px; }
.tier:last-child { margin-bottom: 0; }
.sponsor {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  text-decoration: none;
}
.sponsor img { max-height: 80px; width: auto; }
.sponsor span { font-weight: 700; font-size: 1.2rem; color: var(--forest); }

.gallery-item { margin: 0; }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery-item figcaption { padding-top: 12px; color: var(--muted); font-size: 0.92rem; }

/* Shown automatically when a list in js/data.js is empty */
.empty-state {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 80px 32px;
  text-align: center;
}
.empty-state h3 { font-size: 1.6rem; color: var(--forest); }
.empty-state p { color: var(--muted); max-width: 480px; margin: 0 auto; }
.empty-state .actions { justify-content: center; }

/* ---------- Contact ---------- */
.contact-line {
  display: block;
  font-weight: 600;
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  letter-spacing: -0.015em;
  color: var(--forest);
  text-decoration: none;
  word-break: break-word;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  transition: color 0.2s;
}
.contact-line:hover { color: var(--champagne); }

/* ---------- Dark band ---------- */
.band {
  background: var(--band);
  color: var(--on-band);
  text-align: center;
}
section.band + section, section + section.band { border-top: 0; }
.band h2 { color: var(--on-band); }
.band em { color: var(--champagne-soft); }
.band p { color: rgba(244, 245, 243, 0.72); max-width: 560px; margin: 0 auto; }
.band .eyebrow { color: var(--champagne-soft); }
.band .actions { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--band-deep);
  color: rgba(244, 245, 243, 0.65);
  font-size: 0.85rem;
  padding: 56px 0;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
}
.site-footer .brand-name { color: var(--on-band); font-size: 1.1rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 24px; }
.site-footer a {
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--champagne-soft);
}
.site-footer a:hover { color: var(--on-band); }

/* Keyboard focus */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--champagne);
  outline-offset: 3px;
}

/* ---------- Topographic texture ---------- */
.topo { position: relative; isolation: isolate; overflow: hidden; }
.topo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--topo-ink);
  -webkit-mask: url("../assets/img/topo.svg") center / cover no-repeat;
  mask: url("../assets/img/topo.svg") center / cover no-repeat;
  pointer-events: none;
}
.band.topo::before, .site-footer.topo::before { background: rgba(244, 245, 243, 0.07); }
.page-hero.topo::before { -webkit-mask-position: 30% 70%; mask-position: 30% 70%; }

/* ---------- Build tracker ---------- */
.two-col { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 64px; align-items: start; }
@media (max-width: 880px) { .two-col { grid-template-columns: 1fr; gap: 56px; } }

.progress-list { list-style: none; margin: 32px 0 0; padding: 0; }
.progress-list li { padding: 14px 0; border-top: 1px solid var(--line); }
.progress-list li:last-child { border-bottom: 1px solid var(--line); }
.progress-head { display: flex; justify-content: space-between; gap: 16px; font-weight: 600; margin-bottom: 10px; }
.progress-head .pct { font-family: var(--mono); font-weight: 500; color: var(--champagne); }
.progress-track { height: 6px; background: var(--line); overflow: hidden; }
.progress-fill {
  height: 100%;
  background: var(--champagne);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Countdown ---------- */
.countdown { border: 1px solid var(--line); background: var(--paper); padding: 32px; }
@media (max-width: 600px) { .countdown { padding: 24px 18px; } }
.countdown h3 { margin-bottom: 4px; }
.countdown .where { color: var(--muted); margin: 0 0 24px; }
.count-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.count-cell { text-align: center; border: 1px solid var(--line); padding: 14px 4px; }
.count-cell .n {
  display: block;
  font-family: var(--mono);
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
  line-height: 1.1;
  color: var(--forest);
  font-variant-numeric: tabular-nums;
}
.count-cell .u { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.countdown .note { font-size: 0.9rem; color: var(--muted); margin: 18px 0 0; }

/* ---------- Spec sheet ---------- */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  margin-top: 48px;
}
.spec { padding: 28px 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.spec .label { display: block; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.spec .value { font-size: clamp(1.9rem, 3.6vw, 2.6rem); font-weight: 700; letter-spacing: -0.03em; color: var(--forest); font-variant-numeric: tabular-nums; }
.spec .value.tbd { color: var(--muted); opacity: 0.6; }
.spec .unit { font-family: var(--mono); font-size: 0.85rem; color: var(--champagne); margin-left: 6px; }

/* ---------- Sub-team quiz ---------- */
.quiz { border: 1px solid var(--line); background: var(--paper); padding: 40px; margin-top: 56px; }
@media (max-width: 600px) { .quiz { padding: 24px 18px; } }
.quiz-step { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--champagne); }
.quiz h3 { font-size: 1.5rem; margin: 10px 0 24px; }
.quiz-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.quiz-option {
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: var(--ivory);
  border: 1px solid var(--line);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.quiz-option:hover { border-color: var(--champagne); transform: translateY(-2px); }
.quiz-bar { height: 3px; background: var(--line); margin-bottom: 28px; }
.quiz-bar span { display: block; height: 100%; background: var(--champagne); transform-origin: left; transition: transform 0.4s ease; }
.quiz-result p { color: var(--muted); max-width: 560px; }
.quiz-restart { background: none; border: 0; padding: 0; font: inherit; color: var(--champagne); text-decoration: underline; cursor: pointer; }

/* ---------- Sponsor placement diagram ---------- */
.placement { display: grid; grid-template-columns: 1.4fr 0.6fr; gap: 48px; align-items: center; margin-top: 48px; }
@media (max-width: 880px) { .placement { grid-template-columns: 1fr; } }
.placement svg { width: 100%; height: auto; }
.car-line { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.car-thin { fill: none; stroke: var(--muted); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.car-tire { fill: none; stroke: var(--ink); stroke-width: 18; stroke-dasharray: 8 5; }
.car-rim { fill: var(--paper); stroke: var(--ink); stroke-width: 3; }
.car-ground { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 2 9; stroke-linecap: round; }
.zone {
  fill: var(--champagne);
  fill-opacity: 0.12;
  stroke: var(--champagne);
  stroke-width: 2;
  stroke-dasharray: 6 5;
  cursor: pointer;
  transition: fill-opacity 0.25s;
}
.zone.active { fill-opacity: 0.45; stroke-dasharray: none; }
.zone-label { font-family: var(--mono); font-size: 15px; fill: var(--forest); pointer-events: none; }
.tier-list { list-style: none; margin: 0; padding: 0; }
.tier-btn {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 16px 0;
  cursor: pointer;
}
.tier-list li:last-child .tier-btn { border-bottom: 1px solid var(--line); }
.tier-btn strong { display: block; transition: color 0.2s; }
.tier-btn span { color: var(--muted); font-size: 0.92rem; }
.tier-btn.active strong, .tier-btn:hover strong { color: var(--champagne); }

/* ---------- Build log ---------- */
.posts { list-style: none; margin: 0; padding: 0; }
.post { display: grid; grid-template-columns: 160px 1fr; gap: 32px; padding: 40px 0; border-top: 1px solid var(--line); }
.post:last-child { border-bottom: 1px solid var(--line); }
.post time { font-family: var(--mono); font-size: 0.8rem; color: var(--champagne); padding-top: 6px; }
.post h3 { font-size: 1.5rem; }
.post p { color: var(--muted); max-width: 680px; margin: 0; }
.post img { margin-top: 20px; max-width: 680px; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
@media (max-width: 600px) { .post { grid-template-columns: 1fr; gap: 8px; } }

/* ---------- Socials ---------- */
.social-list { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.social-list a {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 12px 18px;
  transition: border-color 0.2s, color 0.2s;
}
.social-list a:hover { border-color: var(--champagne); color: var(--champagne); }

/* Each logo has a light-mode and a dark-mode version; show the one matching the theme */
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  @view-transition { navigation: auto; }

  /* main.js adds .reveal to content and .in once it scrolls into view */
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s ease, transform 0.7s ease;
  }
  .reveal.in { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

.statement + .lead { margin-top: 28px; }

/* ---------- 3D car viewer ---------- */
.viewer-section { padding-top: 56px; }
.viewer {
  position: relative;
  height: min(74vh, 700px);
  min-height: 460px;
  border: 1px solid var(--line);
  background: var(--paper);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.viewer canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.viewer canvas:active { cursor: grabbing; }
.hotspot-layer { position: absolute; inset: 0; pointer-events: none; }
.hotspot {
  position: absolute;
  left: -17px;
  top: -17px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--champagne);
  background: var(--paper);
  color: var(--champagne);
  font: 500 0.72rem var(--mono);
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.25s, background 0.2s, color 0.2s;
}
.hotspot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid var(--champagne);
  opacity: 0;
}
.hotspot:hover, .hotspot.active { background: var(--champagne); color: var(--paper); }
.hotspot.faded { opacity: 0.25; }
.viewer-hint {
  position: absolute;
  top: 16px;
  left: 16px;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.viewer-tools { position: absolute; left: 16px; bottom: 16px; right: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.tool {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.tool:hover, .tool[aria-pressed="true"] { border-color: var(--champagne); color: var(--champagne); }
.part-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  width: min(340px, calc(100% - 32px));
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}
.part-panel[hidden] { display: none; }
.part-num { font-family: var(--mono); font-size: 0.75rem; color: var(--champagne); }
.part-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
}
.part-close:hover { color: var(--champagne); }
.part-panel h3 { margin: 8px 0 10px; font-size: 1.35rem; }
.part-text { color: var(--muted); font-size: 0.95rem; }
.part-owner { font-size: 0.9rem; margin-bottom: 18px; }
.part-team { font-weight: 600; color: var(--champagne); }
.part-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.viewer-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; color: var(--muted); }
.viewer-fallback[hidden] { display: none; }
.viewer-note { color: var(--muted); font-size: 0.9rem; margin-top: 16px; }
@media (max-width: 700px) {
  .viewer { height: 78vh; }
  .viewer-hint { display: none; }
  .part-panel { top: 12px; left: 12px; right: 12px; width: auto; padding: 16px 16px 14px; }
  .part-panel .part-actions .tool { padding: 8px 10px; }
  .viewer-tools { left: 12px; right: 12px; bottom: 12px; gap: 6px; }
  .tool { padding: 8px 10px; font-size: 0.66rem; }
  .part-panel h3 { font-size: 1.15rem; }
  .part-text { font-size: 0.88rem; margin-bottom: 10px; }
}
@media (prefers-reduced-motion: no-preference) {
  .hotspot::after { animation: ping 2.4s ease-out infinite; }
  @keyframes ping {
    0% { transform: scale(0.8); opacity: 0.7; }
    80%, 100% { transform: scale(1.5); opacity: 0; }
  }
}

/* Frame colour swatches */
.livery { position: absolute; left: 16px; top: 44px; display: flex; align-items: center; gap: 8px; }
.livery span { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
  padding: 0;
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--champagne); }
.swatch-green { background: #2c7a2a; }
.swatch-gold { background: #c9961a; }
.swatch-black { background: #1e2120; }
.swatch-white { background: #e6e9e4; }
@media (max-width: 700px) { .livery { top: auto; bottom: 96px; left: 12px; } }
