/* Quirkpickindx — Automotive instrument cluster theme
   Aesthetic: Dark glassmorphism · Card: Data grid */

:root {
  --graphite-950: #0e0f11;
  --graphite-900: #141518;
  --graphite-800: #1c1d21;
  --graphite-700: #26282d;
  --graphite-600: #34363d;
  --graphite-400: #6b6e78;
  --amber: #f5a524;
  --amber-soft: #ffc766;
  --cream: #f3ead8;
  --cream-dim: #c9c0ae;
  --burgundy: #8c1c3a;
  --burgundy-bright: #c43c62;
  --error: #ffb3c4;
  --edge: linear-gradient(135deg, rgba(245, 165, 36, 0.85), rgba(140, 28, 58, 0.85) 60%, rgba(243, 234, 216, 0.25));
  --radius: 16px;
  --s1: 4px;
  --s2: 8px;
  --s3: 16px;
  --s4: 24px;
  --s5: 40px;
  --s6: 64px;
  --font-sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--cream);
  background-color: var(--graphite-900);
  background-image:
    radial-gradient(900px 520px at 88% -10%, rgba(140, 28, 58, 0.3), transparent 60%),
    radial-gradient(700px 480px at -10% 18%, rgba(245, 165, 36, 0.12), transparent 60%);
}

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

h1, h2, h3, h4 {
  margin: 0 0 var(--s3);
  line-height: 1.2;
  color: var(--cream);
  overflow-wrap: anywhere;
}
h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem); letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 var(--s3); }

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

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

[hidden] { display: none !important; }

.visually-hidden {
  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: 16px;
  top: -100px;
  z-index: 100;
  padding: var(--s2) var(--s3);
  border-radius: 8px;
  background: var(--amber);
  color: var(--graphite-900);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 8px; }
.skip-link:hover { background: var(--amber-soft); color: var(--graphite-900); }

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

.section { padding: var(--s6) 0; }
.section-tight { padding: 0 0 var(--s6); }

.eyebrow {
  display: inline-block;
  margin-bottom: var(--s3);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  overflow-wrap: anywhere;
}

.lede { font-size: 1.15rem; color: var(--cream-dim); max-width: 62ch; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 44px;
  padding: 10px var(--s4);
  border: 1px solid var(--amber);
  border-radius: 999px;
  background: var(--amber);
  color: var(--graphite-900);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.btn:hover { background: var(--amber-soft); color: var(--graphite-900); box-shadow: 0 0 24px rgba(245, 165, 36, 0.35); }
.btn-outline { background: transparent; color: var(--cream); border-color: rgba(243, 234, 216, 0.45); }
.btn-outline:hover { background: rgba(243, 234, 216, 0.1); color: var(--cream); border-color: var(--cream); box-shadow: none; }
.btn-ghost { background: var(--burgundy); color: var(--cream); border-color: var(--burgundy-bright); }
.btn-ghost:hover { background: #a3264a; color: var(--cream); box-shadow: none; }
.btn-sm { min-height: 36px; padding: 6px var(--s3); font-size: 0.875rem; }

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--cream-dim);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-button:hover { background: none; color: var(--amber); }

/* Header */
.site-header {
  position: relative;
  z-index: 40;
  height: 60px;
  background: rgba(17, 18, 21, 0.94);
  color: var(--cream);
  border-bottom: 1px solid rgba(243, 234, 216, 0.08);
}
.header-inner {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--s3);
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  flex: 0 1 auto;
  min-width: 0;
  color: var(--cream);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.brand:hover { color: var(--amber); }
.brand-mark { flex: 0 0 auto; width: 30px; height: 30px; }
.brand-name { min-width: 0; overflow-wrap: anywhere; }

.primary-nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: flex-start;
  overflow-x: auto;
  scrollbar-width: none;
}
.primary-nav::-webkit-scrollbar { display: none; }
.nav-list { display: flex; align-items: center; gap: var(--s1); margin: 0 auto; padding: 0; list-style: none; }
.nav-list li { min-width: 0; flex: 0 0 auto; }
.nav-list a {
  display: block;
  padding: var(--s2) 10px;
  border-radius: 8px;
  color: var(--cream);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.nav-list a:hover { background: rgba(245, 165, 36, 0.12); color: var(--amber-soft); }
.nav-list a[aria-current="page"] { background: rgba(245, 165, 36, 0.12); color: var(--amber); }

.header-actions { display: flex; align-items: center; gap: var(--s2); flex: 0 0 auto; margin-left: auto; }

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(243, 234, 216, 0.3);
  border-radius: 10px;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
}
.nav-toggle:hover { background: rgba(243, 234, 216, 0.08); color: var(--cream); }
.nav-toggle-bar { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; transition: transform 0.25s, opacity 0.25s; }
.nav-toggle.is-active .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-active .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-active .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (min-width: 768px) and (max-width: 1080px) {
  .header-inner { gap: var(--s2); }
  .brand { font-size: 0.95rem; }
  .nav-list a { padding: 6px 6px; font-size: 0.8rem; }
}

/* Glass panels */
.glass {
  position: relative;
  isolation: isolate;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(243, 234, 216, 0.07), rgba(243, 234, 216, 0.025));
  color: var(--cream);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.65);
}
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1px;
  border-radius: inherit;
  background: var(--edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Hero */
.hero { padding: var(--s6) 0; }
.hero-copy { max-width: 780px; margin-bottom: var(--s5); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s4); }

.cluster { padding: var(--s4); }
.cluster-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s4);
}
.tell-tales { display: flex; gap: 12px; }
.tell-tale { width: 26px; height: 26px; color: var(--graphite-400); transition: color 0.4s, filter 0.4s; }
.cluster.is-booting .tell-tale--amber { color: var(--amber); filter: drop-shadow(0 0 6px rgba(245, 165, 36, 0.8)); }
.cluster.is-booting .tell-tale--burgundy { color: var(--burgundy-bright); filter: drop-shadow(0 0 6px rgba(196, 60, 98, 0.8)); }
.cluster.is-ready .tell-tale--ready { color: var(--amber); }
.cluster-status {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-dim);
  overflow-wrap: anywhere;
}

.gauges {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr);
  gap: var(--s4);
  align-items: end;
}
.gauge { min-width: 0; text-align: center; }
.gauge-dial { position: relative; max-width: 420px; margin: 0 auto; transition: transform 0.7s cubic-bezier(0.2, 0.9, 0.3, 1); }
.gauge-side .gauge-dial { max-width: 240px; }
.gauge svg { display: block; width: 100%; height: auto; }
.gauge-face { fill: rgba(14, 15, 17, 0.75); stroke: rgba(243, 234, 216, 0.1); stroke-width: 1; }
.gauge-arc-bg { fill: none; stroke: rgba(243, 234, 216, 0.12); stroke-width: 10; stroke-linecap: round; }
.gauge-arc-fill {
  fill: none;
  stroke: url(#gaugeGradient);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 377;
  stroke-dashoffset: calc(377px * (1 - var(--ratio, 0)));
  transition: stroke-dashoffset 0.9s cubic-bezier(0.3, 1, 0.4, 1);
}
.gauge-ticks { fill: none; stroke: rgba(243, 234, 216, 0.45); stroke-width: 6; stroke-dasharray: 2 30.99; }
.gauge-scale { fill: var(--cream-dim); font-family: var(--font-mono); font-size: 11px; }
.needle {
  transform-box: view-box;
  transform-origin: 100px 100px;
  transform: rotate(var(--angle, -135deg));
  transition: transform 1s cubic-bezier(0.34, 1.4, 0.5, 1);
}
.needle line { stroke: var(--amber); stroke-width: 4; stroke-linecap: round; }
.needle-hub { fill: var(--burgundy); stroke: var(--cream); stroke-width: 2; }
.cluster.is-sweeping .needle { transform: rotate(135deg); }
.cluster.is-sweeping .gauge-arc-fill { stroke-dashoffset: 0; }

.gauge-readout {
  position: absolute;
  left: var(--s3);
  right: var(--s3);
  top: 66%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  pointer-events: none;
}
.readout-label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cream-dim); }
.readout-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(1.1rem, 0.8rem + 1.6vw, 2rem);
  line-height: 1;
  color: var(--amber);
  overflow-wrap: anywhere;
}

.gauge-caption { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: var(--s3) 0 0; }
.gauge-label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cream-dim); }
.gauge-value { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 700; color: var(--amber); overflow-wrap: anywhere; }

.odometer-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: var(--s3); }
.odometer {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
  padding: 6px var(--s2);
  border: 1px solid rgba(245, 165, 36, 0.4);
  border-radius: 8px;
  background: #0a0b0d;
  color: var(--cream);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
}
.odo-digit {
  display: inline-block;
  min-width: 1.3ch;
  padding: 2px var(--s1);
  border-radius: 3px;
  background: linear-gradient(#24252a, #141518 50%, #24252a);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}
.odometer-label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cream-dim); }

/* Speedometer-to-calculator transformation */
.calc-panel {
  margin-top: var(--s5);
  padding-top: var(--s5);
  border-top: 1px solid rgba(243, 234, 216, 0.12);
  transform-origin: 50% 0;
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.js .cluster:not(.is-ready) .calc-panel { opacity: 0; transform: translateY(-24px) scale(0.94); }
.js .cluster:not(.is-ready) .gauge-main .gauge-dial { transform: scale(1.06); }
.cluster.is-ready .gauge-main svg { filter: drop-shadow(0 0 18px rgba(245, 165, 36, 0.25)); }

.calc-intro { max-width: 70ch; margin-bottom: var(--s4); }
.calc-intro p { color: var(--cream-dim); }
.calc-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.calc-layout > * { min-width: 0; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: var(--s4); }
.calc-group {
  min-width: 0;
  margin: 0;
  padding: var(--s4);
  border: 1px solid rgba(243, 234, 216, 0.14);
  border-radius: 12px;
  background: rgba(10, 11, 13, 0.5);
  color: var(--cream);
}
.calc-group legend {
  padding: 0 var(--s2);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  overflow-wrap: anywhere;
}
.calc-actions { display: flex; align-items: center; }
.calc-aside { display: flex; flex-direction: column; gap: var(--s4); }
.calc-note { margin: 0; font-size: 0.85rem; color: var(--cream-dim); }

/* Form fields */
.field { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; margin-bottom: var(--s3); }
.field:last-child { margin-bottom: 0; }
label { font-size: 0.9rem; font-weight: 600; color: var(--cream); }
.field-hint { margin: 0; font-size: 0.8rem; color: var(--cream-dim); }
input, select, textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(243, 234, 216, 0.25);
  border-radius: 8px;
  background: #101114;
  color: var(--cream);
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:hover, select:hover, textarea:hover { border-color: rgba(245, 165, 36, 0.6); background: #101114; color: var(--cream); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--amber-soft); outline-offset: 2px; border-color: var(--amber); }
textarea { resize: vertical; }
input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
.check input.is-invalid { outline: 2px solid var(--error); outline-offset: 2px; }
.field-error { margin: 0; font-size: 0.85rem; color: var(--error); }
.check { display: flex; align-items: flex-start; gap: 12px; font-weight: 500; }
.check input { flex: 0 0 auto; width: 20px; height: 20px; margin: 2px 0 0; padding: 0; accent-color: var(--amber); }

/* Results */
.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: var(--s3); }
.result {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: var(--s4) var(--s3);
  border: 1px solid rgba(245, 165, 36, 0.3);
  border-radius: 12px;
  background: rgba(245, 165, 36, 0.07);
  color: var(--cream);
}
.result--primary { background: linear-gradient(135deg, rgba(140, 28, 58, 0.6), rgba(245, 165, 36, 0.16)); color: var(--cream); border-color: rgba(196, 60, 98, 0.6); }
.result-label { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cream-dim); overflow-wrap: anywhere; }
.result--primary .result-label { color: var(--cream); }
.result-value { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; line-height: 1.1; color: var(--amber); overflow-wrap: anywhere; }
.result--primary .result-value { color: var(--cream); }

/* Vehicle stage */
.vehicle-stage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s3);
  padding: var(--s4) var(--s3);
  border: 1px solid rgba(243, 234, 216, 0.12);
  border-radius: 12px;
  background: radial-gradient(ellipse at 50% 60%, rgba(245, 165, 36, 0.1), rgba(10, 11, 13, 0.55) 70%);
  color: var(--cream);
}
.vehicle { grid-column: 1 / -1; min-width: 0; text-align: center; }
.vehicle-svg { display: block; width: 100%; height: auto; max-width: 440px; margin: 0 auto; }
.cost-tag {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: var(--s3);
  border: 1px solid rgba(243, 234, 216, 0.16);
  border-radius: 12px;
  background: rgba(10, 11, 13, 0.7);
  color: var(--cream);
  transform: translateY(8px);
  transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1), border-color 0.5s, box-shadow 0.5s;
}
.cost-tag.is-visible { transform: none; border-color: rgba(245, 165, 36, 0.65); box-shadow: 0 0 24px -8px rgba(245, 165, 36, 0.55); }
.cost-tag-label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cream-dim); overflow-wrap: anywhere; }
.cost-tag-value { font-family: var(--font-mono); font-size: 1.1rem; font-weight: 700; color: var(--amber); overflow-wrap: anywhere; }

/* Sections and guide cards (data grid) */
.section-head { max-width: 720px; margin-bottom: var(--s5); }
.section-head p { color: var(--cream-dim); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: var(--s4); }
.guide-card { display: flex; flex-direction: column; min-width: 0; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.guide-card:hover { transform: translateY(-4px); box-shadow: 0 30px 50px -24px rgba(245, 165, 36, 0.3); }
.card-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid rgba(245, 165, 36, 0.35);
  border-radius: var(--radius) var(--radius) 0 0;
  background: rgba(10, 11, 13, 0.6);
  color: var(--cream);
}
.card-stat { display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 0; padding: var(--s3); text-align: center; }
.card-stat + .card-stat { border-left: 1px solid rgba(243, 234, 216, 0.12); }
.card-stat-value { font-family: var(--font-mono); font-size: 1.15rem; font-weight: 700; line-height: 1.1; color: var(--amber); overflow-wrap: anywhere; }
.card-stat-label { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cream-dim); overflow-wrap: anywhere; }
.card-body { display: flex; flex-direction: column; gap: var(--s4); flex: 1 1 auto; padding: var(--s4); }
.card-body h3, .card-body p { margin: 0; }
.card-body p { color: var(--cream-dim); }
.card-link { margin-top: auto; font-weight: 700; color: var(--amber); }
.card-link::after { content: " →"; }
.card-link:hover { color: var(--cream); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: var(--s4); margin-bottom: var(--s5); }
.step { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4); min-width: 0; }
.step h3, .step p { margin: 0; }
.step p { color: var(--cream-dim); }
.step-number { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 700; color: var(--amber); }

.callout {
  padding: var(--s4);
  border: 1px solid rgba(196, 60, 98, 0.55);
  border-radius: 12px;
  background: rgba(140, 28, 58, 0.3);
  color: var(--cream);
}
.callout p:last-child { margin-bottom: 0; }
.callout a { color: var(--amber-soft); }
.callout a:hover { color: var(--cream); }

/* Sub-pages */
.page-hero { padding: var(--s6) 0 var(--s5); }
.page-hero--compact { padding-bottom: var(--s5); }
.page-hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s5); align-items: center; }
.page-hero-grid > * { min-width: 0; }
.page-hero-media { margin: 0; padding: var(--s2); }
.page-hero-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--graphite-700), var(--burgundy));
}

.breadcrumb { margin-bottom: var(--s4); font-size: 0.85rem; color: var(--cream-dim); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.breadcrumb li { overflow-wrap: anywhere; }
.breadcrumb li + li::before { content: "/"; margin-right: var(--s2); color: var(--graphite-400); }
.breadcrumb a { color: var(--cream-dim); }
.breadcrumb a:hover { color: var(--amber); }

.mini-calc { display: flex; flex-direction: column; gap: var(--s4); padding: var(--s4); }
.mini-head h2 { margin: 0; }
.mini-head .eyebrow { margin-bottom: var(--s2); }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--s3) var(--s4); }
.mini-grid .field { margin-bottom: 0; }
.mini-calc .table-wrap { margin: 0; }

.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 260px); gap: var(--s5); align-items: start; }
.content-layout > * { min-width: 0; }
.prose { max-width: 74ch; }
.prose h2 { margin-top: var(--s5); font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.1rem; }
.prose ul { margin: 0 0 var(--s3); padding-left: 1.25rem; }
.prose li { margin-bottom: var(--s2); }
.prose p, .prose li { color: var(--cream); }
.prose strong { color: var(--cream); }

.toc { padding: var(--s4); }
.toc-title { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber); }
.toc ul { display: grid; gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.toc a { color: var(--cream-dim); text-decoration: none; overflow-wrap: anywhere; }
.toc a:hover { color: var(--amber); text-decoration: underline; }

.table-wrap {
  margin: var(--s4) 0;
  overflow-x: auto;
  border: 1px solid rgba(243, 234, 216, 0.14);
  border-radius: 12px;
}
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
caption { padding: var(--s3); text-align: left; font-weight: 700; color: var(--cream); }
th, td {
  padding: 12px var(--s3);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(243, 234, 216, 0.1);
  overflow-wrap: break-word;
}
th { background: rgba(245, 165, 36, 0.12); color: var(--cream); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
td { color: var(--cream); }

.pros-cons { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--s4); margin: var(--s4) 0; }
.pc-box {
  min-width: 0;
  padding: var(--s4);
  border-top: 3px solid var(--amber);
  border-radius: 12px;
  background: rgba(10, 11, 13, 0.55);
  color: var(--cream);
}
.pc-box--cons { border-top-color: var(--burgundy-bright); }
.pc-box ul { margin: 0; }

/* Legal */
.legal { padding: var(--s5) var(--s4); max-width: none; }
.legal > * { max-width: 78ch; }
.legal > .table-wrap { max-width: none; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
.contact-grid > * { min-width: 0; }
.contact-form { display: flex; flex-direction: column; gap: var(--s4); padding: var(--s4); }
.contact-form .field { margin-bottom: 0; }
.contact-form .btn { align-self: flex-start; }
.form-note { margin: 0; font-size: 0.85rem; color: var(--cream-dim); }
.form-status { margin: 0; padding: var(--s3); border-radius: 8px; }
.form-status.is-success { background: rgba(245, 165, 36, 0.14); color: var(--cream); border: 1px solid var(--amber); }
.form-status.is-error { background: rgba(140, 28, 58, 0.45); color: var(--cream); border: 1px solid var(--burgundy-bright); }
.contact-info { display: flex; flex-direction: column; gap: var(--s4); }
.info-card { padding: var(--s4); }
.info-card h2 { font-size: 1.3rem; }
.info-card h3 { margin-top: var(--s4); margin-bottom: var(--s2); font-size: 1rem; }
.info-card p:last-child { margin-bottom: 0; }
.info-meta { font-size: 0.85rem; color: var(--cream-dim); }
address { font-style: normal; margin-bottom: var(--s3); }

.map-block {
  position: relative;
  min-height: 280px;
  border: 1px solid rgba(245, 165, 36, 0.35);
  border-radius: var(--radius);
  background-color: #17181b;
  color: var(--cream);
  background-image:
    linear-gradient(115deg, transparent 40%, rgba(140, 28, 58, 0.5) 40%, rgba(140, 28, 58, 0.5) 46%, transparent 46%),
    linear-gradient(90deg, transparent 48%, rgba(245, 165, 36, 0.35) 48%, rgba(245, 165, 36, 0.35) 51%, transparent 51%),
    linear-gradient(0deg, transparent 57%, rgba(245, 165, 36, 0.25) 57%, rgba(245, 165, 36, 0.25) 60%, transparent 60%),
    linear-gradient(35deg, transparent 70%, rgba(243, 234, 216, 0.12) 70%, rgba(243, 234, 216, 0.12) 72%, transparent 72%),
    repeating-linear-gradient(0deg, rgba(243, 234, 216, 0.06) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(243, 234, 216, 0.06) 0 1px, transparent 1px 32px);
}
.map-pin { position: absolute; left: 50%; top: 42%; width: 40px; height: 52px; transform: translate(-50%, -50%); filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6)); }
.map-label {
  position: absolute;
  left: var(--s3);
  right: var(--s3);
  bottom: var(--s3);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s2);
  padding: 12px var(--s3);
  border-radius: 8px;
  background: rgba(10, 11, 13, 0.9);
  color: var(--cream);
  overflow-wrap: anywhere;
}

/* Footer */
.site-footer {
  padding: var(--s6) 0 var(--s4);
  border-top: 1px solid rgba(245, 165, 36, 0.25);
  background: var(--graphite-950);
  color: var(--cream);
}
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: var(--s5); }
.footer-col { min-width: 0; }
.footer-brand .brand { margin-bottom: var(--s3); }
.footer-col p { color: var(--cream-dim); font-size: 0.92rem; }
.company-line { font-size: 0.85rem; overflow-wrap: anywhere; }
.footer-heading { margin-bottom: var(--s3); font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber); }
.footer-links { display: grid; gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.footer-links a { color: var(--cream-dim); text-decoration: none; overflow-wrap: anywhere; }
.footer-links a:hover { color: var(--amber); text-decoration: underline; }
.footer-links a[aria-current="page"] { color: var(--amber); }
.site-footer address { color: var(--cream-dim); font-size: 0.92rem; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s3);
  margin-top: var(--s5);
  padding-top: var(--s4);
  border-top: 1px solid rgba(243, 234, 216, 0.1);
  font-size: 0.85rem;
  color: var(--cream-dim);
}
.footer-bottom p { margin: 0; overflow-wrap: anywhere; }

/* Cookie banner */
.cookie-banner {
  position: fixed;
  left: var(--s3);
  right: var(--s3);
  bottom: var(--s3);
  z-index: 60;
  max-width: 980px;
  margin: 0 auto;
  padding: var(--s4);
  border: 1px solid rgba(245, 165, 36, 0.45);
  border-radius: var(--radius);
  background: rgba(17, 18, 21, 0.97);
  color: var(--cream);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.cookie-banner.is-visible { opacity: 1; transform: none; }
.cookie-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s4); align-items: center; }
.cookie-inner > * { min-width: 0; }
.cookie-title { margin-bottom: var(--s2); font-size: 1.1rem; }
.cookie-text p { margin: 0; font-size: 0.9rem; color: var(--cream-dim); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.cookie-prefs {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3) var(--s4);
  padding-top: var(--s3);
  border-top: 1px solid rgba(243, 234, 216, 0.12);
}

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

@media (min-width: 1024px) {
  .calc-aside { position: sticky; top: var(--s3); }
}

@media (min-width: 768px) {
  .container { padding: 0 var(--s4); }
}

@media (max-width: 767px) {
  .site-header { height: 50px; }
  .header-inner { gap: var(--s2); }

  /* Hamburger dropdown (when the script is running) */
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 45;
    display: none;
    max-height: calc(100vh - 50px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: var(--s3);
    border-bottom: 1px solid rgba(245, 165, 36, 0.3);
    background: var(--graphite-900);
    color: var(--cream);
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.55);
  }
  .primary-nav.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: var(--s1); margin: 0; }
  .nav-list li { flex: 0 0 auto; }
  .nav-list a { padding: 12px var(--s3); font-size: 1rem; white-space: normal; }

  /* Fallback when the script has not loaded: always-visible scrollable menu row */
  html:not(.js) .nav-toggle { display: none; }
  html:not(.js) .site-header { height: auto; }
  html:not(.js) .header-inner {
    flex-wrap: wrap;
    height: auto;
    min-height: 50px;
    padding-top: var(--s2);
    padding-bottom: var(--s2);
  }
  html:not(.js) .primary-nav {
    position: static;
    order: 3;
    display: block;
    flex: 1 1 100%;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  html:not(.js) .nav-list { flex-direction: row; align-items: center; width: max-content; }
  html:not(.js) .nav-list a { padding: var(--s2) 12px; font-size: 0.9rem; white-space: nowrap; }

  .gauges { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
  .gauge-main { grid-column: 1 / -1; order: -1; }
  .page-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .cookie-inner { grid-template-columns: minmax(0, 1fr); }
  .hero, .section { padding: var(--s5) 0; }
  .page-hero { padding: var(--s5) 0 var(--s4); }
  .legal { padding: var(--s4) var(--s3); }
  .page-hero-media { padding: var(--s1); }
}

@media (max-width: 560px) {
  .vehicle-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 399px) {
  .brand { font-size: 0.9rem; gap: 6px; }
  .brand-mark { width: 26px; height: 26px; }
  .header-actions .btn-sm { min-height: 34px; padding: 4px 10px; font-size: 0.75rem; }
  .nav-toggle { width: 38px; height: 38px; }
  .cluster { padding: var(--s3); }
  .calc-group { padding: var(--s3); }
  .mini-calc, .contact-form, .info-card, .toc { padding: var(--s3); }
  .vehicle-stage { grid-template-columns: minmax(0, 1fr); padding: var(--s3); }
  .card-stat { padding: 12px var(--s2); }
  .card-stat-value { font-size: 1rem; }
  .odo-digit { font-size: 1rem; }
  .result-value { font-size: 1.3rem; }
  .cookie-banner { left: var(--s2); right: var(--s2); bottom: var(--s2); padding: var(--s3); }
  .cookie-actions .btn { flex: 1 1 100%; }
  th, td { padding: 12px; }
}

@media (max-width: 339px) {
  .brand-name { font-size: 0.8rem; }
  .header-actions .btn-sm { padding: 4px 8px; font-size: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}