/* =========================================================
   Quirktallyscout — Precision Garage UI
   Aesthetic: Dark glassmorphism · Card: Data grid
   Palette: graphite, silver, amber, off-white
   ========================================================= */

:root {
  --graphite-950: #111316;
  --graphite-900: #16181b;
  --graphite-800: #1e2125;
  --graphite-700: #272b30;
  --graphite-600: #363b42;
  --silver: #c9ced4;
  --silver-dim: #a9b0b8;
  --amber: #f5a524;
  --amber-soft: #ffc766;
  --offwhite: #f3efe7;
  --danger: #ff8a80;
  --success: #8fe3b0;

  --s1: 4px;
  --s2: 8px;
  --s3: 16px;
  --s4: 24px;
  --s5: 40px;
  --s6: 64px;

  --radius: 14px;
  --radius-sm: 8px;
  --glass: rgba(30, 33, 37, 0.62);
  --glass-strong: rgba(22, 24, 27, 0.86);
  --edge: rgba(201, 206, 212, 0.18);

  --header-h: 64px;

  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--offwhite);
  background-color: var(--graphite-900);
  background-image:
    radial-gradient(ellipse 60% 40% at 85% 0%, rgba(245, 165, 36, 0.10), transparent 70%),
    radial-gradient(ellipse 50% 40% at 0% 30%, rgba(201, 206, 212, 0.06), transparent 70%),
    linear-gradient(180deg, var(--graphite-900), var(--graphite-950));
  background-attachment: fixed;
}

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

h1, h2, h3, h4 {
  line-height: 1.2;
  margin: 0 0 var(--s3);
  overflow-wrap: anywhere;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.125rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 var(--s3); }

a {
  color: var(--amber-soft);
  text-underline-offset: 3px;
}
a:hover { color: var(--offwhite); }

:focus-visible {
  outline: 3px solid var(--amber-soft);
  outline-offset: 3px;
  border-radius: 4px;
}

[hidden] { display: none !important; }

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

.skip-link {
  position: absolute;
  left: var(--s3);
  top: var(--s2);
  z-index: 200;
  padding: var(--s2) var(--s3);
  background: var(--amber);
  color: var(--graphite-950);
  font-weight: 700;
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); color: var(--graphite-950); }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--s4);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-soft);
  margin-bottom: var(--s3);
  overflow-wrap: anywhere;
}

.lead {
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  color: var(--silver);
  max-width: 62ch;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 12px var(--s4);
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
  text-align: center;
}
.btn-primary {
  background: var(--amber);
  color: var(--graphite-950);
  border-color: var(--amber);
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--amber-soft);
  color: var(--graphite-950);
  border-color: var(--amber-soft);
}
.btn-ghost {
  background: rgba(22, 24, 27, 0.4);
  color: var(--offwhite);
  border-color: rgba(201, 206, 212, 0.45);
}
.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: rgba(245, 165, 36, 0.14);
  color: var(--offwhite);
  border-color: var(--amber-soft);
}
.btn-sm { padding: var(--s2) var(--s3); font-size: 0.875rem; }

/* ---------- Header ---------- */
.site-header {
  position: relative;
  z-index: 50;
  height: var(--header-h);
  background: rgba(17, 19, 22, 0.94);
  color: var(--offwhite);
  border-bottom: 1px solid var(--edge);
  backdrop-filter: blur(10px);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
  color: var(--offwhite);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}
.brand:hover { color: var(--amber-soft); }
.brand-mark { width: 32px; height: 32px; flex: 0 0 auto; }
.brand-name { min-width: 0; overflow-wrap: anywhere; }

.primary-nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
}
.nav-list {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--s1);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list li { min-width: 0; }
.nav-list a {
  display: block;
  padding: var(--s2) 10px;
  border-radius: var(--radius-sm);
  color: var(--silver);
  background: transparent;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow-wrap: anywhere;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.nav-list a:hover,
.nav-list a:focus-visible,
.nav-list a[aria-current="page"] {
  color: var(--offwhite);
  background: rgba(245, 165, 36, 0.16);
}
.nav-list a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--amber); }

.header-cta { flex: 0 0 auto; }

.nav-toggle {
  display: none;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--edge);
  background: var(--graphite-800);
  color: var(--offwhite);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background-color .2s ease, border-color .2s ease;
}
.nav-toggle:hover,
.nav-toggle:focus-visible,
.nav-toggle.is-active {
  background: var(--graphite-700);
  border-color: var(--amber-soft);
}
.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--offwhite);
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle.is-active .nav-toggle-bar:nth-of-type(2) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active .nav-toggle-bar:nth-of-type(3) { opacity: 0; }
.nav-toggle.is-active .nav-toggle-bar:nth-of-type(4) { transform: translateY(-7px) rotate(-45deg); }

@keyframes nav-drop {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1023px) {
  /* Solid header on tablets & phones so nothing shows through */
  .site-header {
    background: var(--graphite-950);
    backdrop-filter: none;
  }
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 60;
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--s3) var(--s4) var(--s4);
    background-color: var(--graphite-950);
    background-image: linear-gradient(180deg, var(--graphite-900), var(--graphite-950));
    color: var(--offwhite);
    border-top: 1px solid var(--edge);
    border-bottom: 2px solid var(--amber);
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.6);
  }
  .primary-nav.is-open {
    display: block;
    animation: nav-drop .25s ease both;
  }
  .nav-list {
    flex-direction: column;
    gap: var(--s2);
    max-width: 1200px;
    margin: 0 auto;
  }
  .nav-list a {
    padding: 12px var(--s3);
    font-size: 1rem;
    white-space: normal;
    background: var(--graphite-800);
    border: 1px solid var(--edge);
  }
  .nav-list a:hover,
  .nav-list a:focus-visible {
    background: var(--graphite-700);
    border-color: rgba(245, 165, 36, 0.5);
  }
  .nav-list a[aria-current="page"] {
    background: rgba(245, 165, 36, 0.18);
    border-color: var(--amber);
    box-shadow: inset 3px 0 0 var(--amber);
  }
  .header-cta { margin-left: auto; }
}

@media (max-width: 767px) {
  :root { --header-h: 52px; }
  .site-header { height: var(--header-h); }
  .brand-mark { width: 28px; height: 28px; }
  .primary-nav { padding: var(--s3); }
}

/* ---------- Hero ---------- */
.hero { padding: var(--s6) 0; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: var(--s5);
  align-items: center;
}
.hero-grid > * { min-width: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s4); }

.garage { display: grid; gap: var(--s3); min-width: 0; }

.dash-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr));
  gap: var(--s3);
}
.readout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: var(--s3);
  border-radius: var(--radius-sm);
  background: var(--glass);
  color: var(--offwhite);
  border: 1px solid var(--edge);
  backdrop-filter: blur(12px);
}
.readout-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--silver-dim);
  overflow-wrap: anywhere;
}
.readout-value {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--offwhite);
  line-height: 1;
  overflow-wrap: anywhere;
}
.readout-value small { font-size: 0.8rem; color: var(--silver-dim); }
.readout-gauge { align-items: flex-start; }
.gauge { width: 90px; height: auto; }
.gauge-needle {
  transform-origin: 50px 55px;
  transform: rotate(40deg);
  animation: gauge-sweep 4s ease-in-out 3s infinite alternate;
}
@keyframes gauge-sweep {
  0% { transform: rotate(-60deg); }
  60% { transform: rotate(55deg); }
  100% { transform: rotate(30deg); }
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  color: var(--graphite-950);
  box-shadow: 0 0 10px var(--success);
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: 0.35; } }

.eq { display: flex; align-items: flex-end; gap: 4px; height: 28px; }
.eq span {
  width: 6px;
  height: 100%;
  border-radius: 2px;
  background: var(--amber);
  color: var(--graphite-950);
  transform-origin: bottom;
  animation: eq-pulse 1.2s ease-in-out infinite;
}
.eq span:nth-child(2) { animation-delay: .15s; }
.eq span:nth-child(3) { animation-delay: .3s; }
.eq span:nth-child(4) { animation-delay: .45s; }
.eq span:nth-child(5) { animation-delay: .6s; }
@keyframes eq-pulse {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

.garage-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 25%, rgba(245, 165, 36, 0.22), transparent 60%),
    linear-gradient(180deg, #23262b 0%, #16181b 68%, #0f1113 100%);
  color: var(--offwhite);
  border: 1px solid rgba(201, 206, 212, 0.24);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(245, 165, 36, 0.08);
}
.garage-light {
  position: absolute;
  top: var(--s3);
  left: 20%;
  right: 20%;
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, transparent, #fff4dc, transparent);
  color: var(--graphite-950);
  box-shadow: 0 0 36px rgba(255, 220, 160, 0.7);
}
.garage-floor {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 32%;
  background:
    repeating-linear-gradient(90deg, rgba(201, 206, 212, 0.07) 0 1px, transparent 1px 60px),
    linear-gradient(180deg, #1b1e22, #0f1113);
  color: var(--offwhite);
}
.garage-car {
  position: absolute;
  left: 6%;
  bottom: 10%;
  width: 88%;
  height: auto;
}
.garage-scan {
  position: absolute;
  top: 0; bottom: 0;
  left: 0;
  width: 18%;
  background: linear-gradient(90deg, transparent, rgba(245, 165, 36, 0.18), transparent);
  color: var(--offwhite);
  transform: translateX(-120%);
  animation: scan-sweep 5s ease-in-out 3.4s infinite;
  pointer-events: none;
}
@keyframes scan-sweep {
  0% { transform: translateX(-120%); }
  50%, 100% { transform: translateX(560%); }
}
.garage-door {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s3);
  padding-bottom: var(--s4);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.3), transparent 12%, transparent 88%, rgba(0, 0, 0, 0.3)),
    repeating-linear-gradient(180deg, #3d434a 0 26px, #2a2e33 26px 28px, #4a5058 28px 30px);
  color: var(--offwhite);
  transform: translateY(-101%);
  animation: garage-door-open 2.6s cubic-bezier(.65, 0, .35, 1) .5s both;
}
.door-label {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: var(--s2) var(--s3);
  border-radius: var(--radius-sm);
  background: rgba(17, 19, 22, 0.7);
  color: var(--amber-soft);
}
.door-handle {
  width: 80px;
  height: 8px;
  border-radius: 4px;
  background: var(--silver);
  color: var(--graphite-950);
}
@keyframes garage-door-open {
  0% { transform: translateY(0); }
  14% { transform: translateY(-3%); }
  100% { transform: translateY(-101%); }
}

/* ---------- Stats ---------- */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: var(--s4);
  margin-top: var(--s5);
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: var(--s4);
  border-radius: var(--radius);
  background: var(--glass);
  color: var(--offwhite);
  border: 1px solid var(--edge);
  border-top: 2px solid var(--amber);
  backdrop-filter: blur(12px);
}
.stat-value {
  font-family: var(--font-mono);
  font-size: clamp(2.25rem, 5.5vw, 4rem);
  font-weight: 800;
  line-height: 1;
  color: var(--offwhite);
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.stat-value small {
  font-size: 0.35em;
  margin-left: var(--s1);
  color: var(--amber-soft);
  letter-spacing: 0.05em;
}
.stat-value-md { font-size: clamp(1.75rem, 4vw, 2.75rem); }
.stat-label {
  font-size: 0.875rem;
  color: var(--silver-dim);
  overflow-wrap: anywhere;
}

/* ---------- Sections ---------- */
.section { padding: var(--s6) 0; }
.section-alt {
  background: linear-gradient(180deg, rgba(30, 33, 37, 0.5), rgba(17, 19, 22, 0.2));
  color: var(--offwhite);
  border-top: 1px solid var(--edge);
  border-bottom: 1px solid var(--edge);
}
.section-head { max-width: 760px; margin-bottom: var(--s5); }
.section-intro { color: var(--silver); }

/* ---------- Data grid cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--s4);
}
.guide-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  min-width: 0;
  padding: var(--s4);
  border-radius: var(--radius);
  background: var(--glass);
  color: var(--offwhite);
  border: 1px solid var(--edge);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.guide-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--s4);
  right: var(--s4);
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--amber), rgba(201, 206, 212, 0.6), transparent);
}
.guide-card:hover,
.guide-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(245, 165, 36, 0.5);
  box-shadow: 0 28px 50px rgba(0, 0, 0, 0.45);
}
.card-stats {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s3);
  align-items: stretch;
}
.card-index {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--amber);
  letter-spacing: -0.04em;
}
.stat-cells {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s2);
  margin: 0;
}
.stat-cell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 12px var(--s3);
  border-radius: var(--radius-sm);
  background: rgba(17, 19, 22, 0.65);
  color: var(--offwhite);
  border: 1px solid rgba(201, 206, 212, 0.1);
}
.stat-cell dt {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--silver-dim);
  overflow-wrap: anywhere;
}
.stat-cell dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--offwhite);
  overflow-wrap: anywhere;
}
.card-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--edge);
  background: var(--graphite-700);
}
.card-body { display: flex; flex-direction: column; gap: var(--s3); flex: 1 1 auto; min-width: 0; }
.card-body h3 { margin: 0; }
.card-body p { margin: 0; color: var(--silver); }
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  list-style: none;
  margin: 0;
  padding: 0;
}
.tags li {
  padding: var(--s1) 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(201, 206, 212, 0.1);
  color: var(--silver);
  border: 1px solid rgba(201, 206, 212, 0.2);
}
.card-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-weight: 700;
  color: var(--amber-soft);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.card-link:hover,
.card-link:focus-visible { color: var(--offwhite); text-decoration: underline; }

/* ---------- Circuit maps ---------- */
.circuit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--s4);
  margin: var(--s5) 0;
}
.circuit-grid-single { grid-template-columns: minmax(0, 1fr); }
.circuit-panel,
.route-panel {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  min-width: 0;
  padding: var(--s4);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(0deg, rgba(201, 206, 212, 0.04) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(201, 206, 212, 0.04) 0 1px, transparent 1px 24px),
    var(--glass);
  color: var(--offwhite);
  border: 1px solid var(--edge);
  backdrop-filter: blur(12px);
}
.route-panel { margin: var(--s5) 0; }
.circuit-panel figcaption { display: flex; flex-direction: column; gap: 12px; }
.circuit-svg { width: 100%; height: auto; }
.circuit-base {
  fill: none;
  stroke: var(--graphite-600);
  stroke-width: 14;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.circuit-path {
  fill: none;
  stroke: var(--amber);
  stroke-width: 4;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 2.4s ease;
}
.circuit-path-alt { stroke: var(--silver); stroke-dasharray: 1; }
.js .reveal .circuit-path { stroke-dashoffset: 1; }
.js .reveal.is-visible .circuit-path { stroke-dashoffset: 0; }
.circuit-label {
  font-family: var(--font-mono);
  font-size: 13px;
  fill: var(--offwhite);
  letter-spacing: 0.06em;
}

/* ---------- Reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}
.js .reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Plan steps ---------- */
.plan-grid {
  list-style: none;
  margin: var(--s6) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--s4);
}
.plan-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: var(--s4);
  border-radius: var(--radius);
  background: var(--glass);
  color: var(--offwhite);
  border: 1px solid var(--edge);
  border-left: 3px solid var(--amber);
}
.plan-num {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--amber-soft);
}
.plan-step h3 { margin: 0; }
.plan-step p { margin: 0; color: var(--silver); }

/* ---------- Page hero (sub-pages) ---------- */
.page-hero {
  padding: var(--s6) 0;
  border-bottom: 1px solid var(--edge);
  background-color: var(--graphite-900);
  color: var(--offwhite);
  background-size: cover;
  background-position: center;
}
.page-hero-nurburgring {
  background-image: linear-gradient(180deg, rgba(17, 19, 22, 0.82), rgba(17, 19, 22, 0.97)), url("images/page-hero-nurburgring.png");
  color: var(--offwhite);
}
.page-hero-tuning {
  background-image: linear-gradient(180deg, rgba(17, 19, 22, 0.82), rgba(17, 19, 22, 0.97)), url("images/page-hero-tuning.png");
  color: var(--offwhite);
}
.page-hero-klassikwelt {
  background-image: linear-gradient(180deg, rgba(17, 19, 22, 0.82), rgba(17, 19, 22, 0.97)), url("images/page-hero-klassikwelt.png");
  color: var(--offwhite);
}
.page-hero-hockenheim {
  background-image: linear-gradient(180deg, rgba(17, 19, 22, 0.82), rgba(17, 19, 22, 0.97)), url("images/page-hero-hockenheim.png");
  color: var(--offwhite);
}
.page-hero-technoclassica {
  background-image: linear-gradient(180deg, rgba(17, 19, 22, 0.82), rgba(17, 19, 22, 0.97)), url("images/page-hero-technoclassica.png");
  color: var(--offwhite);
}
.page-hero-contact {
  background-image: linear-gradient(180deg, rgba(17, 19, 22, 0.84), rgba(17, 19, 22, 0.97)), url("images/page-hero-contact.png");
  color: var(--offwhite);
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  font-size: 0.875rem;
  color: var(--silver-dim);
  margin-bottom: var(--s4);
  overflow-wrap: anywhere;
}
.breadcrumb a { color: var(--silver); }
.breadcrumb a:hover { color: var(--amber-soft); }

/* ---------- Article layout ---------- */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: var(--s5);
  padding-top: var(--s6);
  padding-bottom: var(--s6);
  align-items: start;
}
.article-layout > * { min-width: 0; }
.article { max-width: 760px; }
.article h2 { margin-top: var(--s5); }
.article h2:first-child { margin-top: 0; }
.article p, .article li { color: var(--silver); }
.article strong { color: var(--offwhite); }

.article-figure { margin: var(--s5) 0; }
.article-figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--edge);
  background: var(--graphite-700);
}
.article-figure figcaption {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--silver-dim);
}

.tip-list { padding-left: var(--s4); margin: 0 0 var(--s4); }
.tip-list li { margin-bottom: var(--s2); }
.tip-list-numbered li { margin-bottom: var(--s3); }

.notice {
  margin: var(--s4) 0;
  padding: var(--s4);
  border-radius: var(--radius-sm);
  background: rgba(245, 165, 36, 0.1);
  color: var(--offwhite);
  border-left: 3px solid var(--amber);
}
.notice p { margin: 0; color: var(--offwhite); }

/* Spec panel */
.spec-panel {
  margin: var(--s5) 0;
  padding: var(--s4);
  border-radius: var(--radius);
  background: var(--glass);
  color: var(--offwhite);
  border: 1px solid var(--edge);
  border-top: 2px solid var(--amber);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.spec-panel h3 { margin: 0; font-family: var(--font-mono); font-size: 1rem; letter-spacing: 0.06em; text-transform: uppercase; }
.spec-note { margin: 0; font-size: 0.875rem; color: var(--silver-dim); }
.spec-row { display: flex; flex-direction: column; gap: 12px; }
.spec-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s2);
  font-weight: 700;
  color: var(--offwhite);
}
.spec-head > * { min-width: 0; overflow-wrap: anywhere; }
.spec-meta { font-family: var(--font-mono); font-size: 0.875rem; color: var(--amber-soft); font-weight: 600; }
.spec-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--graphite-600);
  color: var(--offwhite);
  overflow: hidden;
}
.spec-bar-fill {
  display: block;
  height: 100%;
  width: var(--value, 50%);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--silver), var(--amber));
  color: var(--graphite-950);
  transform-origin: left center;
  transform: scaleX(1);
  transition: transform 1.4s cubic-bezier(.2, .8, .2, 1);
}
.js .reveal .spec-bar-fill { transform: scaleX(0); }
.js .reveal.is-visible .spec-bar-fill { transform: scaleX(1); }
.spec-scale { margin: 0; font-family: var(--font-mono); font-size: 0.75rem; color: var(--silver-dim); }

/* Pros / cons */
.proscons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--s4);
  margin: var(--s5) 0;
}
.pros, .cons {
  min-width: 0;
  padding: var(--s4);
  border-radius: var(--radius);
  background: var(--glass);
  color: var(--offwhite);
  border: 1px solid var(--edge);
}
.pros { border-top: 2px solid var(--success); }
.cons { border-top: 2px solid var(--danger); }
.pros ul, .cons ul { margin: 0; padding-left: var(--s4); }
.pros li, .cons li { margin-bottom: var(--s2); }

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: var(--s4) 0 var(--s5);
  border-radius: var(--radius);
  border: 1px solid var(--edge);
  background: var(--glass);
  color: var(--offwhite);
}
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
caption {
  text-align: left;
  padding: var(--s3);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber-soft);
}
th, td {
  padding: 12px var(--s3);
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--edge);
}
thead th {
  background: rgba(17, 19, 22, 0.7);
  color: var(--offwhite);
  font-weight: 700;
}
tbody th { color: var(--offwhite); font-weight: 600; }
td { color: var(--silver); }

/* Aside */
.article-aside { display: flex; flex-direction: column; gap: var(--s4); }
.aside-panel {
  padding: var(--s4);
  border-radius: var(--radius);
  background: var(--glass);
  color: var(--offwhite);
  border: 1px solid var(--edge);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.aside-panel p { margin: 0; color: var(--silver); }
.aside-title { font-size: 1.125rem; margin: 0; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; }
.aside-subtitle { font-size: 0.9375rem; margin: 0; color: var(--silver); }
.fact-list { margin: 0; display: flex; flex-direction: column; gap: var(--s3); }
.fact-list div { display: flex; flex-direction: column; gap: var(--s1); min-width: 0; }
.fact-list dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--silver-dim);
}
.fact-list dd { margin: 0; color: var(--offwhite); overflow-wrap: anywhere; }
.aside-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }

/* ---------- Legal ---------- */
.legal { padding: var(--s6) 0; }
.legal-inner { max-width: 860px; }
.legal-meta { font-family: var(--font-mono); font-size: 0.875rem; color: var(--silver-dim); margin-bottom: var(--s5); }
.legal-section {
  padding: var(--s4);
  margin-bottom: var(--s4);
  border-radius: var(--radius);
  background: var(--glass);
  color: var(--offwhite);
  border: 1px solid var(--edge);
}
.legal-section h2 { font-size: 1.375rem; }
.legal-section p, .legal-section li { color: var(--silver); }
.legal-section ul { padding-left: var(--s4); margin: 0 0 var(--s3); }
.legal-section li { margin-bottom: var(--s2); }
.legal-section strong { color: var(--offwhite); }

/* ---------- Contact ---------- */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: var(--s5);
  padding-top: var(--s6);
  padding-bottom: var(--s6);
  align-items: start;
}
.contact-layout > * { min-width: 0; }
.contact-form-panel {
  padding: var(--s5);
  border-radius: var(--radius);
  background: var(--glass);
  color: var(--offwhite);
  border: 1px solid var(--edge);
  border-top: 2px solid var(--amber);
  backdrop-filter: blur(12px);
}
.contact-form { display: flex; flex-direction: column; gap: var(--s4); }
.form-field { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.form-field label { font-weight: 600; color: var(--offwhite); }
.form-field input[type="text"],
.form-field input[type="email"],
.form-field select,
.form-field textarea {
  width: 100%;
  min-width: 0;
  padding: 12px var(--s3);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(201, 206, 212, 0.35);
  background: var(--graphite-950);
  color: var(--offwhite);
  font: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.form-field textarea { resize: vertical; }
.form-field input:hover,
.form-field select:hover,
.form-field textarea:hover { border-color: var(--silver); }
.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
  outline: 3px solid var(--amber-soft);
  outline-offset: 2px;
  border-color: var(--amber);
}
.form-field .is-invalid,
.form-field input.is-invalid,
.form-field select.is-invalid,
.form-field textarea.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
}
.form-field input[type="checkbox"].is-invalid { outline: 2px solid var(--danger); outline-offset: 2px; }
.field-error { margin: 0; font-size: 0.875rem; color: var(--danger); }
.form-success {
  margin: 0;
  padding: var(--s3);
  border-radius: var(--radius-sm);
  background: rgba(143, 227, 176, 0.12);
  color: var(--success);
  border: 1px solid rgba(143, 227, 176, 0.4);
}
.check {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  font-weight: 400;
  color: var(--silver);
  cursor: pointer;
}
.check input { margin-top: 5px; width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--amber); }
.contact-aside { display: flex; flex-direction: column; gap: var(--s4); }

.map-block {
  margin: 0;
  padding: var(--s4);
  border-radius: var(--radius);
  background: var(--glass);
  color: var(--offwhite);
  border: 1px solid var(--edge);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.map-block figcaption { font-size: 0.875rem; color: var(--silver-dim); }
.map-canvas {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background:
    repeating-linear-gradient(0deg, rgba(201, 206, 212, 0.07) 0 2px, transparent 2px 34px),
    repeating-linear-gradient(90deg, rgba(201, 206, 212, 0.07) 0 2px, transparent 2px 34px),
    #1c2024;
  color: var(--offwhite);
  border: 1px solid var(--edge);
}
.map-river {
  position: absolute;
  top: 0; bottom: 0;
  right: 18%;
  width: 22%;
  background: linear-gradient(180deg, #24394a, #1e3242);
  color: var(--offwhite);
  transform: skewX(-10deg);
}
.map-road {
  position: absolute;
  background: var(--graphite-600);
  color: var(--offwhite);
}
.map-road-a { left: 0; right: 0; top: 48%; height: 8px; }
.map-road-b { top: 0; bottom: 0; left: 30%; width: 8px; }
.map-road-c { left: 0; right: 40%; top: 22%; height: 5px; transform: rotate(-8deg); transform-origin: left; }
.map-pin {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 40px;
  height: 52px;
  transform: translate(-50%, -100%);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5));
}
.map-label {
  position: absolute;
  left: 50%;
  top: 56%;
  transform: translateX(-50%);
  padding: var(--s1) 12px;
  border-radius: var(--radius-sm);
  background: var(--graphite-950);
  color: var(--offwhite);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow-wrap: anywhere;
}
.map-river-label {
  position: absolute;
  right: 22%;
  top: var(--s3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #b8d4e6;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: var(--s6);
  padding: var(--s6) 0 var(--s5);
  background: var(--graphite-950);
  color: var(--silver);
  border-top: 1px solid var(--edge);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: var(--s5);
}
.footer-grid > * { min-width: 0; }
.footer-brand { display: flex; flex-direction: column; gap: var(--s3); }
.footer-note { font-size: 0.875rem; color: var(--silver-dim); margin: 0; }
.footer-heading {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-soft);
  margin-bottom: var(--s3);
}
.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}
.footer-list a { color: var(--silver); text-decoration: none; }
.footer-list a:hover,
.footer-list a:focus-visible { color: var(--amber-soft); text-decoration: underline; }
.footer-bottom {
  margin-top: var(--s5);
  padding-top: var(--s4);
  border-top: 1px solid var(--edge);
  font-size: 0.875rem;
  color: var(--silver-dim);
  overflow-wrap: anywhere;
}
.footer-bottom p { margin: 0; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  left: var(--s3);
  right: var(--s3);
  bottom: var(--s3);
  z-index: 150;
  max-width: 960px;
  margin: 0 auto;
  border-radius: var(--radius);
  background: var(--glass-strong);
  color: var(--offwhite);
  border: 1px solid rgba(245, 165, 36, 0.45);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.cookie-inner { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.cookie-text { margin: 0; font-size: 0.9375rem; color: var(--silver); }
.cookie-text strong { color: var(--offwhite); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.cookie-prefs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: center;
  padding-top: var(--s3);
  border-top: 1px solid var(--edge);
}

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .article-layout,
  .contact-layout { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .hero, .section, .page-hero { padding: var(--s5) 0; }
  .hero-actions .btn { flex: 1 1 auto; }
  .guide-card::before { left: 0; right: 0; }
  .contact-form-panel { padding: var(--s4); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
  .card-index { font-size: 2.25rem; }
}

@media (max-width: 399px) {
  .container { padding: 0 var(--s3); }
  .brand { font-size: 0.875rem; gap: var(--s1); }
  .brand-mark { width: 24px; height: 24px; }
  .header-inner { gap: var(--s2); }
  .btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
  .nav-toggle { width: 36px; height: 36px; }
  .primary-nav { padding: var(--s2) var(--s3) var(--s3); }
  .nav-list a { padding: 10px 12px; font-size: 0.9375rem; }
  .card-stats { grid-template-columns: minmax(0, 1fr); }
  .stat-cells { grid-template-columns: minmax(0, 1fr); }
  .guide-card, .stat, .spec-panel, .aside-panel, .legal-section, .circuit-panel, .route-panel { padding: var(--s3); }
  .cookie-banner { left: var(--s2); right: var(--s2); bottom: var(--s2); }
  .cookie-inner { padding: var(--s3); }
  .cookie-actions .btn { flex: 1 1 100%; }
  .map-label { white-space: normal; text-align: center; max-width: 80%; }
}

@media (max-width: 339px) {
  .header-cta { display: none; }
}

/* ---------- Reduced motion: disable transitions & animations only ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}