/* ============================================================
   SEVEN TUNING — base layer
   Design tokens, reset, typography primitives.
   ============================================================ */

:root {
  /* ---- Type scale (fluid) ---- */
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.85rem + 0.15vw, 0.9375rem);
  --text-base: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.4vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.25rem + 1.1vw, 2.125rem);
  --text-2xl: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
  --text-3xl: clamp(2.4rem, 1.3rem + 4.2vw, 4.5rem);

  /* ---- Spacing (4px base) ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* ---- Radii ---- */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 999px;

  /* ---- Fonts ---- */
  --font-ui: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* ---- Layout ---- */
  --shell: 1280px;
  --gutter: clamp(1rem, 4vw, 2.75rem);
  --header-h: 60px;
  --bar-h: 34px;

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --dur: 0.42s;
}

/* ============================================================
   THEME — dark is the brand. Light is the daylight workshop.
   ============================================================ */

:root,
[data-theme='dark'] {
  --bg: #06070a;
  --bg-deep: #030407;
  --surface: #0b0d13;
  --surface-2: #101319;
  --surface-3: #161a22;
  --surface-inset: #04050800;

  --border: #1b1f28;
  --border-strong: #262b36;
  --divider: #14181f;

  --text: #eceef2;
  --text-2: #a9b0bd;
  --text-3: #8a93a3;
  --text-inverse: #06070a;

  --accent: #00d4f0;
  --accent-soft: #0a3a44;
  --accent-dim: #0d7f92;
  --accent-glow: rgba(0, 212, 240, 0.16);
  --accent-ink: #04121a;

  --plate: #f5c800;
  --plate-ink: #171203;
  --plate-blue: #1a3fc4;

  --ok: #2fd68a;
  --warn: #f0a13a;
  --danger: #f4536b;

  --grid-line: rgba(255, 255, 255, 0.016);
  --scrim: rgba(3, 4, 7, 0.72);
  --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, 0.85), 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.45);
  --img-veil: 0.42;
  --hero-tint: linear-gradient(180deg, rgba(6, 7, 10, 0.55) 0%, rgba(6, 7, 10, 0.78) 46%, var(--bg) 100%);
}
:root:not([data-theme='light']),
[data-theme='dark'] {
  color-scheme: dark;
}

[data-theme='light'] {
  color-scheme: light;

  --bg: #f4f5f7;
  --bg-deep: #e9ebef;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eff1f4;
  --surface-inset: #ffffff00;

  --border: #dfe2e8;
  --border-strong: #c8ccd4;
  --divider: #e6e8ed;

  --text: #101318;
  --text-2: #4d5462;
  --text-3: #5a616e;
  --text-inverse: #ffffff;

  --accent: #007e94;
  --accent-soft: #d7f0f6;
  --accent-dim: #0a99b0;
  --accent-glow: rgba(0, 126, 148, 0.14);
  --accent-ink: #ffffff;

  --plate: #f2c400;
  --plate-ink: #171203;
  --plate-blue: #1a3fc4;

  --ok: #0f9d58;
  --warn: #b26b00;
  --danger: #d02440;

  --grid-line: rgba(16, 19, 24, 0.028);
  --scrim: rgba(255, 255, 255, 0.7);
  --shadow-lg: 0 20px 50px -20px rgba(16, 19, 24, 0.22), 0 1px 3px rgba(16, 19, 24, 0.07);
  --shadow-sm: 0 1px 3px rgba(16, 19, 24, 0.09);
  --img-veil: 0.1;
  --hero-tint: linear-gradient(180deg, rgba(8, 10, 14, 0.62) 0%, rgba(10, 12, 16, 0.55) 40%, var(--bg) 100%);
}

/* ============================================================
   RESET
   ============================================================ */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-6));
  /* Literal hex, not a custom property: Android Chrome and iOS Safari paint
     the overscroll / status-bar canvas from the root's used background, and
     they often keep the first computed colour if that colour came from a
     variable. data-theme flips the hex so light → dark does not leave white
     strips above and below the page. */
  background-color: #030407;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overflow-anchor: auto;
}
html[data-theme='light'] {
  background-color: #e9ebef;
}
html[data-theme='dark'] {
  background-color: #030407;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

table {
  border-collapse: collapse;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-full);
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}

/* ============================================================
   TYPOGRAPHY PRIMITIVES
   ============================================================ */

h1,
h2,
h3,
h4 {
  font-weight: 560;
  line-height: 1.08;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

h1 {
  font-size: var(--text-3xl);
  letter-spacing: -0.04em;
}
h2 {
  font-size: var(--text-2xl);
  letter-spacing: -0.035em;
}
h3 {
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
  line-height: 1.25;
}
h4 {
  font-size: var(--text-base);
  letter-spacing: -0.012em;
  line-height: 1.35;
}

p {
  text-wrap: pretty;
}

strong {
  font-weight: 560;
  color: var(--text);
}

/* Monospace technical label — the spine of the whole interface */
.mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 450;
  font-feature-settings: 'zero' 1;
}

.tnum {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'zero' 1;
}

.muted {
  color: var(--text-2);
}
.faint {
  color: var(--text-3);
}
.accent {
  color: var(--accent);
}

.lede {
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--text-2);
  letter-spacing: -0.012em;
  max-width: 62ch;
}

/* ============================================================
   LAYOUT PRIMITIVES
   ============================================================ */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
  position: relative;
  overflow-x: clip;
  isolation: isolate;
}

.section--tight {
  padding-block: clamp(var(--space-12), 5vw, var(--space-20));
}

.rule {
  height: 1px;
  background: var(--divider);
  border: 0;
}

.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;
}
.sr-only--focus:focus,
.sr-only--focus:focus-visible {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  width: auto;
  height: auto;
  margin: 0;
  padding: 10px 14px;
  clip: auto;
  overflow: visible;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r-sm);
}
.field.hp,
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
}

/* Blueprint grid backdrop */
.grid-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-color: color-mix(in oklab, var(--accent) 5%, transparent);
  background-image: linear-gradient(color-mix(in oklab, var(--accent) 5%, var(--grid-line)) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in oklab, var(--accent) 5%, var(--grid-line)) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 55% at 50% 28%, #000 12%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 28%, #000 12%, transparent 72%);
  z-index: 0;
  overflow: hidden;
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--delay, 0ms);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   PRINT — the vehicle report has to survive paper
   ============================================================ */

@media print {
  .site-bar,
  .site-header,
  .hero,
  .dock,
  .no-print,
  .site-footer {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
}
