/* MOTORSCOUT — Design tokens & base */

:root {
  /* Palette — monochrome dark-first */
  --ink: oklch(0.11 0.006 250);          /* near-black */
  --ink-2: oklch(0.15 0.006 250);        /* raised surface */
  --ink-3: oklch(0.19 0.006 250);        /* card */
  --ink-4: oklch(0.24 0.006 250);        /* elevated card */
  --line: oklch(0.28 0.006 250);         /* hairline */
  --line-2: oklch(0.35 0.006 250);       /* stronger hairline */
  --mute: oklch(0.55 0.005 250);         /* secondary text */
  --mute-2: oklch(0.72 0.005 250);       /* tertiary text */
  --paper: oklch(0.96 0.004 80);         /* warm off-white */
  --paper-2: oklch(0.90 0.006 80);
  --fg: oklch(0.97 0.004 80);            /* primary text on dark */

  /* Accent — automotive signal red (dashboard-warning red, not fire-truck) */
  --accent: oklch(0.62 0.22 27);
  --accent-mute: oklch(0.48 0.18 27);
  --accent-soft: oklch(0.62 0.22 27 / 0.18);

  /* Scout-word tint: 15% darker than foreground */
  --scout-word: oklch(0.83 0.004 80);

  /* Type */
  --f-display: "Familjen Grotesk", "Neue Haas Grotesk", ui-sans-serif, system-ui, sans-serif;
  --f-serif: "Instrument Serif", "Times New Roman", Georgia, serif;
  --f-sans: "Familjen Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --gutter: clamp(20px, 4vw, 56px);
  --max: 1440px;
}

/* Accent variants (Tweaks) — red is default set in :root */
:root[data-accent="red"] {
  --accent: oklch(0.62 0.22 27);
  --accent-mute: oklch(0.48 0.18 27);
  --accent-soft: oklch(0.62 0.22 27 / 0.18);
}
:root[data-accent="mono"] {
  --accent: var(--fg);
  --accent-mute: oklch(0.75 0.005 80);
  --accent-soft: oklch(0.95 0.005 80 / 0.12);
}
:root[data-accent="ice"] {
  --accent: oklch(0.82 0.14 230);
  --accent-mute: oklch(0.66 0.12 230);
  --accent-soft: oklch(0.82 0.14 230 / 0.18);
}
:root[data-accent="amber"] {
  --accent: oklch(0.82 0.14 68);
  --accent-mute: oklch(0.66 0.12 68);
  --accent-soft: oklch(0.82 0.14 68 / 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--ink); color: var(--fg); }
body {
  font-family: var(--f-sans);
  font-feature-settings: "ss01", "cv11", "cv02";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

/* Type ramp */
.mono {
  font-family: var(--f-mono);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--mute-2);
}
.mono-lg { font-family: var(--f-mono); letter-spacing: 0.02em; }
.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute-2);
}

h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 500; letter-spacing: -0.02em; margin: 0; line-height: 1; }
h1 { font-size: clamp(52px, 9.5vw, 152px); letter-spacing: -0.045em; font-weight: 500; }
h2 { font-size: clamp(38px, 5.2vw, 84px); letter-spacing: -0.035em; font-weight: 500; }
h3 { font-size: clamp(24px, 2.2vw, 34px); letter-spacing: -0.02em; font-weight: 500; }
h4 { font-size: 18px; letter-spacing: -0.01em; font-weight: 500; }

/* Serif italic — the "cursive" complement for secondary headline phrases */
.serif { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.serif-em { font-family: var(--f-serif); font-style: italic; font-weight: 400; color: var(--mute-2); letter-spacing: -0.005em; }

/* Wordmark — SCOUT is 15% darker than MOTOR */
.wordmark { font-family: var(--f-display); font-weight: 500; letter-spacing: -0.01em; }
.wordmark .m { color: var(--fg); }
.wordmark .s { color: var(--scout-word); }

p { margin: 0; }

/* Layout helpers */
.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.section { padding: clamp(72px, 10vw, 144px) 0; position: relative; }
.section-tight { padding: clamp(48px, 6vw, 88px) 0; }

.hrule { height: 1px; background: var(--line); border: 0; margin: 0; }
.hrule-strong { height: 1px; background: var(--line-2); border: 0; margin: 0; }

/* Section header pattern */
.sec-head {
  display: grid;
  grid-template-columns: minmax(180px, 220px) 1fr;
  gap: clamp(24px, 4vw, 64px);
  align-items: baseline;
  margin-bottom: clamp(40px, 6vw, 88px);
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.sec-head .idx { display: flex; justify-content: space-between; color: var(--mute-2); }
.sec-head h2 { max-width: 22ch; }

@media (max-width: 720px) {
  .sec-head { grid-template-columns: 1fr; gap: 20px; }
  .sec-head .idx { max-width: 100%; }
}

/* Buttons — slide-fill hover */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 22px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--fg);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: border-color 260ms var(--ease), color 260ms var(--ease);
  text-decoration: none;
  min-width: 200px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
}
.btn::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--paper);
  transform: translateX(-101%);
  transition: transform 500ms cubic-bezier(0.76, 0, 0.24, 1);
  z-index: -1;
}
.btn:hover { color: var(--ink); border-color: var(--paper); }
.btn:hover::before { transform: translateX(0); }
.btn > * { position: relative; z-index: 1; }
.btn .arr { transition: transform 400ms var(--ease-out); display: inline-block; }
.btn:hover .arr { transform: translateX(8px); }

.btn-primary {
  color: var(--ink);
  border-color: var(--paper);
}
.btn-primary::before { transform: translateX(0); background: var(--paper); }
.btn-primary:hover { color: var(--fg); border-color: var(--fg); }
.btn-primary:hover::before { transform: translateX(101%); }

.btn-ghost { border-color: var(--line); }
.btn-ghost::before { background: var(--accent); }
.btn-ghost:hover { color: var(--fg); border-color: var(--accent); }

/* Red accent variant */
.btn-red { border-color: var(--accent); color: var(--fg); }
.btn-red::before { background: var(--accent); transform: translateX(0); }
.btn-red:hover { color: var(--fg); border-color: var(--accent-mute); }
.btn-red:hover::before { transform: translateX(101%); }

.link-mono {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: opacity 260ms var(--ease);
}
.link-mono:hover { opacity: 0.6; }
.link-mono .arr { transition: transform 260ms var(--ease); }
.link-mono:hover .arr { transform: translateX(4px); }

/* Tags / status pills */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line-2);
  color: var(--fg);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 2px;
  background: oklch(0.09 0.006 250 / 0.7);
}
.tag .dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 8px var(--accent); }
.tag.live { border-color: var(--accent); color: var(--accent); }
.tag.live .dot { animation: livePulse 1.6s ease-in-out infinite; }
@keyframes livePulse {
  0%,100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 var(--accent), 0 0 8px var(--accent); }
  50% { opacity: 0.7; transform: scale(1.2); box-shadow: 0 0 0 5px transparent, 0 0 10px var(--accent); }
}

/* Reveal on scroll — respect reduced motion */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out); will-change: opacity, transform; }
.reveal.in { opacity: 1; transform: none; }
.reveal-x { opacity: 0; transform: translateX(-24px); transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out); }
.reveal-x.in { opacity: 1; transform: none; }
.reveal-scale { opacity: 0; transform: scale(0.985); transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out); }
.reveal-scale.in { opacity: 1; transform: none; }
.reveal-blur { opacity: 0; filter: blur(8px); transition: opacity 1100ms var(--ease-out), filter 1100ms var(--ease-out); }
.reveal-blur.in { opacity: 1; filter: none; }

/* Word-by-word text reveal */
.reveal-words > * {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.3em);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
.reveal-words.in > * { opacity: 1; transform: none; }

/* Staggered children */
[data-stagger] > * { opacity: 0; transform: translateY(20px); transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out); }
[data-stagger].in > * { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-x, .reveal-scale, .reveal-blur { opacity: 1 !important; transform: none !important; filter: none !important; }
  .reveal-words > *, [data-stagger] > * { opacity: 1 !important; transform: none !important; }
  * { animation-duration: 0.001ms !important; transition-duration: 200ms !important; }
}

/* Prevent body horizontal scroll from any wide child */
body { max-width: 100vw; }

/* Utility */
.stack-8 > * + * { margin-top: 8px; }
.stack-12 > * + * { margin-top: 12px; }
.stack-16 > * + * { margin-top: 16px; }
.stack-24 > * + * { margin-top: 24px; }
.stack-32 > * + * { margin-top: 32px; }
.stack-48 > * + * { margin-top: 48px; }

.dim { color: var(--mute-2); }
.dim-2 { color: var(--mute); }

/* Magnetic hover — the element follows the cursor slightly */
.magnet { transition: transform 400ms var(--ease-out); will-change: transform; }

/* 3D tilt on cursor */
.tilt {
  transform-style: preserve-3d;
  transform: perspective(1200px) rotateX(var(--tilt-rx, 0deg)) rotateY(var(--tilt-ry, 0deg));
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
}
.tilt-inner { transform: translateZ(24px); }

/* Spotlight card — a soft glow follows the cursor within .spotlight */
.spotlight {
  position: relative;
  overflow: hidden;
}
.spotlight::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), oklch(0.62 0.22 27 / 0.14), transparent 40%);
  opacity: 0;
  transition: opacity 400ms var(--ease);
  pointer-events: none;
  z-index: 1;
}
.spotlight:hover::before { opacity: 1; }
.spotlight > * { position: relative; z-index: 2; }

/* Marquee ticker — thin process band */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  background: oklch(0.08 0.006 250);
  position: relative;
}
.marquee::before,
.marquee::after {
  content: '';
  position: absolute; top: 0; bottom: 0; width: 96px;
  z-index: 2; pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(90deg, oklch(0.08 0.006 250), transparent); }
.marquee::after  { right: 0; background: linear-gradient(270deg, oklch(0.08 0.006 250), transparent); }
.marquee-track {
  display: inline-flex;
  gap: 40px;
  animation: marquee 55s linear infinite;
  will-change: transform;
}
.marquee-track .item {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--mute-2);
  display: inline-flex; align-items: center; gap: 12px;
  padding: 4px 0;
  transition: color 260ms var(--ease);
}
.marquee-track .item.em { color: var(--fg); }
.marquee-track .num {
  color: var(--accent);
  font-weight: 500;
  min-width: 22px;
}
.marquee-track .sep {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--line-2);
  align-self: center;
}
.marquee-track .sep.hot { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Photo mask helper — dark bottom-to-top fade */
.photo-mask {
  position: relative;
  overflow: hidden;
}
.photo-mask::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, oklch(0.06 0.006 250 / 0.2) 0%, oklch(0.06 0.006 250 / 0) 30%, oklch(0.06 0.006 250 / 0.4) 70%, oklch(0.06 0.006 250 / 0.85) 100%);
  pointer-events: none;
}

/* Fine grid overlay */
.grid-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
  background-image:
    linear-gradient(to right, oklch(0.35 0.006 250 / 0.15) 1px, transparent 1px);
  background-size: calc((100vw - 2 * var(--gutter)) / 12) 100%;
  background-position: var(--gutter) 0;
  display: none;
}
:root[data-grid="on"] .grid-overlay { display: block; }


/* =============================================================
   NAV — shared header layout for Nav / SiteNav / HiwNav / WhyNav
   ============================================================= */
.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-cta {
  min-width: 180px;
  padding: 14px 20px;
}
.nav-link {
  font-family: var(--f-sans);
  font-size: 15px;
  color: var(--mute-2);
  text-decoration: none;
  transition: color 260ms var(--ease);
  letter-spacing: -0.005em;
  position: relative;
  padding: 4px 0;
  font-weight: 500;
  white-space: nowrap;
}
.nav-link::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 340ms var(--ease-out);
}
.nav-link:hover { color: var(--fg); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.is-active { color: var(--fg); }
.nav-link.is-active::after { transform: scaleX(1); }

@media (max-width: 900px) {
  .nav-links { display: none !important; }
  .nav-cta { display: none !important; }
  .nav-wrap { height: 68px !important; }
}


/* =============================================================
   MOBILE PASS
   Progressive simplification for tablet + phone breakpoints.
   Ordered general -> specific so overrides land correctly.
   ============================================================= */

/* Tablet / small-laptop tightening */
@media (max-width: 900px) {
  :root { --gutter: clamp(18px, 5vw, 28px); }
  .section { padding: clamp(56px, 9vw, 96px) 0; }
  .section-tight { padding: clamp(40px, 6vw, 72px) 0; }
  /* Ensure hero photo doesn't shove content under fixed nav that's now shorter */
  .hero { padding-top: 96px !important; }
  .hiw-hero { padding-top: 96px !important; }
  /* Larger tap targets on primary buttons */
  .btn { min-height: 48px; }
}

/* Phone breakpoint */
@media (max-width: 680px) {
  :root {
    --gutter: 20px;
    --max: 100vw;
  }

  /* Type ramp: cap oversized clamps that render fine on 375-430px anyway */
  h1 { font-size: clamp(44px, 12vw, 64px); letter-spacing: -0.03em; }
  h2 { font-size: clamp(32px, 8vw, 44px); letter-spacing: -0.02em; }
  h3 { font-size: clamp(22px, 5.5vw, 28px); }

  /* Section padding: compact without collapsing rhythm */
  .section { padding: 56px 0; }
  .section-tight { padding: 40px 0; }

  /* Section header — index + title stack, more breathing room */
  .sec-head {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 32px;
  }
  .sec-head h2 { max-width: none; }

  /* Hero: tighter top padding (mobile nav is 68px vs desktop 84px) */
  .hero {
    padding-top: 88px !important;
    min-height: auto !important;
  }
  .hiw-hero {
    padding-top: 88px !important;
    min-height: auto !important;
  }
  .hero > .wrap {
    padding-bottom: 64px !important;
  }
  /* Softer hero photo darkening so imagery still reads on mobile */
  .hero .hero-headline {
    font-size: clamp(52px, 15vw, 84px) !important;
  }

  /* Buttons — full-width by default in mobile flows, still tap-friendly */
  .btn {
    min-width: 0;
    padding: 16px 20px;
    min-height: 52px;
    gap: 16px;
    font-size: 11px;
  }

  /* Cards / tiles — remove micro-hover tilts (touch UX) */
  .tilt {
    transform: none !important;
  }
  .spotlight::before { display: none; }

  /* Marquee — a hair thinner on mobile */
  .marquee { padding: 10px 0; }
  .marquee-track { gap: 28px; animation-duration: 45s; }
  .marquee-track .item { font-size: 10px; letter-spacing: 0.22em; }

  /* Tag pills a hair smaller */
  .tag { padding: 5px 8px; font-size: 9px; }

  /* Utility: hide on mobile */
  .hide-mobile { display: none !important; }
}

/* Very small phones (iPhone SE et al.) */
@media (max-width: 380px) {
  :root { --gutter: 16px; }
  h1 { font-size: 40px !important; }
  h2 { font-size: 30px !important; }
  .section { padding: 48px 0; }
}

/* Reduce motion — mobile users often have it on */
@media (max-width: 680px) and (prefers-reduced-motion: no-preference) {
  /* Keep reveals but shorten the parallax-y bits */
  .reveal, .reveal-x, .reveal-scale, .reveal-blur {
    transition-duration: 600ms !important;
  }
}


/* v12.2 — mobile fixes */
/* No sideways scrolling: clip anything wider than the viewport. */
html, body { overflow-x: hidden; overflow-x: clip; max-width: 100%; }
#root { overflow-x: clip; }
@media (max-width: 680px) {
  /* Inner-page hero eyebrows (e.g. "[ How It Works ] · Five stages…") — hidden on mobile. */
  .page-eyebrow { display: none !important; }
}
