/* =========================================================
   TRACE — v4
   Solid section colors: cobalt → white → black → oxblood → white
   8-bit pixel runner · miles counter · static→spin→zoom intro
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Cobalt */
  --cobalt-pale:   #6ba3ff;
  --cobalt-light:  #4a8fff;
  --cobalt:        #2358d8;
  --cobalt-deep:   #1d3fa3;
  --cobalt-deeper: #112874;

  /* Paper / ink / oxblood */
  --paper:         #ffffff;
  --paper-soft:    #f5f4f1;
  --ink:           #0a0a0a;
  --ink-soft:      #16161a;

  /* Lighter, warmer red — brighter than oxblood */
  --oxblood:       #a8253b;
  --oxblood-deep:  #7d182c;

  /* Star accent — dark ocean blue (deep but visibly blue) */
  --ocean:         #1b4f86;

  --font-display: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont,
                  'Segoe UI', Roboto, sans-serif;
  --font-mono:    'Inter Tight', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  /* Soft magnetic lock — free scrolling, but the page nudges
     into each section when you're near its edge. */
  scroll-snap-type: y proximity;
  scroll-padding-top: 0;
}

body {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.5;
  color: var(--paper);
  background: var(--paper);
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important; height: 1px !important;
  opacity: 0 !important;
}

/* =========================================================
   INTRO OVERLAY — static → spin → zoom + cobalt sweep
   ========================================================= */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.intro__mark {
  position: relative;
  width: 56px;
  height: 56px;
  z-index: 2;
  color: var(--cobalt);
  opacity: 0;
  transform: scale(0.92) rotate(0deg);
  animation: intro-mark 3000ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.intro__mark svg { width: 100%; height: 100%; }
.intro__mark line {
  stroke: currentColor;
  stroke-width: 8;
  stroke-linecap: round;
}
.intro__mark .spoke-accent { stroke: var(--ocean); }
.intro__mark .star-core    { fill: var(--ocean); }

@keyframes intro-mark {
  /* fade in static */
  0%   { opacity: 0; transform: scale(0.92) rotate(0deg); }
  10%  { opacity: 1; transform: scale(1)    rotate(0deg); }
  /* hold completely still */
  22%  { opacity: 1; transform: scale(1)    rotate(0deg); }
  /* spin (2 full rotations) */
  60%  { opacity: 1; transform: scale(1.02) rotate(720deg); }
  /* hold briefly */
  68%  { opacity: 1; transform: scale(1.05) rotate(720deg); }
  /* gentle zoom out + soft fade — handed off to overlay fade */
  100% { opacity: 0; transform: scale(1.9)  rotate(720deg); }
}

/* No hard cobalt sweep — the white overlay itself dissolves
   gently to reveal the cobalt hero behind. (Daisy-style.) */
.intro__sweep { display: none; }

/* JS removes is-loading + adds intro-done when the timeline finishes.
   Long, eased fade so the white melts into the cobalt hero. */
body.intro-done .intro {
  opacity: 0;
  transition: opacity 1400ms cubic-bezier(0.4, 0, 0.2, 1);
  visibility: hidden;
  transition-delay: 0ms;
  transition-property: opacity, visibility;
}

body.is-loading {
  overflow: hidden;
  height: 100vh;
}

@media (prefers-reduced-motion: reduce) {
  .intro__mark, .intro__sweep { animation: none; opacity: 1; transform: scale(1); }
  body.is-loading { overflow: auto; height: auto; }
  .intro { display: none; }
}

/* =========================================================
   SECTION COLOR PALETTES — each a solid block with slight fade
   ========================================================= */
.section--cobalt {
  background: linear-gradient(180deg, var(--cobalt-light) 0%, var(--cobalt) 60%, var(--cobalt-deep) 100%);
  color: var(--paper);
}

.section--paper {
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper) 70%, var(--paper-soft) 100%);
  color: var(--ink);
}

.section--ink {
  background: linear-gradient(180deg, var(--ink-soft) 0%, var(--ink) 60%, #000 100%);
  color: var(--paper);
}

.section--oxblood {
  background: linear-gradient(180deg, var(--oxblood) 0%, var(--oxblood) 60%, var(--oxblood-deep) 100%);
  color: var(--paper);
}

/* =========================================================
   FIXED · 8-bit runner top-right (scroll-driven)
   ========================================================= */
.runner {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  /* Snappy color invert so the runner never goes invisible
     during a section transition. */
  transition: opacity 600ms ease 200ms, color 80ms linear;
  color: var(--paper);
}

body.intro-done .runner { opacity: 0.95; }

.runner__frames {
  position: relative;
  width: 32px;
  height: 36px;    /* 16x18 aspect ratio for the new runner */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.runner__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

/* Frame switching — 8-frame run cycle */
body[data-frame="0"] .runner__frame:nth-child(1),
body[data-frame="1"] .runner__frame:nth-child(2),
body[data-frame="2"] .runner__frame:nth-child(3),
body[data-frame="3"] .runner__frame:nth-child(4),
body[data-frame="4"] .runner__frame:nth-child(5),
body[data-frame="5"] .runner__frame:nth-child(6),
body[data-frame="6"] .runner__frame:nth-child(7),
body[data-frame="7"] .runner__frame:nth-child(8) {
  opacity: 1;
}
@keyframes idle-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}

/* =========================================================
   FIXED · live miles counter top-left
   ========================================================= */
.dist {
  position: fixed;
  top: 22px;
  left: 24px;
  z-index: 20;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--paper);
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 600ms ease 200ms, color 80ms linear;
}

body.intro-done .dist { opacity: 0.9; }

.dist__val {
  font-size: 14px;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.dist__unit {
  font-size: 10px;
  letter-spacing: 0.18em;
  opacity: 0.75;
  text-transform: lowercase;
}

/* Section-aware tinting for the fixed UI */
body[data-section="hero"]    .runner,
body[data-section="hero"]    .dist,
body[data-section="ink"]     .runner,
body[data-section="ink"]     .dist,
body[data-section="oxblood"] .runner,
body[data-section="oxblood"] .dist {
  color: var(--paper);
}

body[data-section="paper"] .runner,
body[data-section="paper"] .dist {
  color: var(--ink);
}

/* =========================================================
   FIXED · top scroll-progress hair
   ========================================================= */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 1px;
  z-index: 30;
  pointer-events: none;
  background: rgba(127, 127, 127, 0.18);
}

.progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: currentColor;
  color: var(--paper);
  transition: width 80ms linear, background 400ms ease;
}

body[data-section="paper"] .progress span { background: var(--ink); }

/* =========================================================
   01 · HERO  (cobalt)
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(60px, 10vh, 140px) 24px;
  scroll-snap-align: start;
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: clamp(28px, 5vh, 56px);
}

.wordmark {
  position: relative;
  display: inline-block;
  line-height: 1;
  margin-bottom: clamp(28px, 5vh, 56px);
}

.wordmark__star {
  position: absolute;
  top: -0.06em;
  left: -0.08em;
  width: clamp(52px, 7.5vw, 115px);
  aspect-ratio: 1 / 1;
  transform: translate(-30%, -42%);
  pointer-events: none;
}

/* ---------- Hero entrance animation ----------
   While the intro overlay is up, the 't' sits in line with
   the other letters and the star floats high above, spinning.
   When the overlay begins to fade (body.intro-done), the 't'
   drops into place and the star descends with momentum, the
   rotation decelerating to a smooth rest.
*/
body.is-loading .ltr--t {
  transform: scaleY(1) translateY(0);
}

body.is-loading .wordmark__star {
  transform: translate(-30%, -210%) rotate(0deg);
  animation: hero-star-prespin 1.6s linear infinite;
}

@keyframes hero-star-prespin {
  from { transform: translate(-30%, -210%) rotate(0deg); }
  to   { transform: translate(-30%, -210%) rotate(360deg); }
}

body.intro-done .ltr--t {
  animation: hero-t-drop 1400ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

body.intro-done .wordmark__star {
  animation: hero-star-drop 2000ms cubic-bezier(0.22, 0.61, 0.18, 1) forwards;
}

@keyframes hero-t-drop {
  0%   { transform: scaleY(1)    translateY(0); }
  100% { transform: scaleY(0.78) translateY(0.15em); }
}

@keyframes hero-star-drop {
  0%   { transform: translate(-30%, -210%) rotate(0deg); }
  100% { transform: translate(-30%, -42%)  rotate(1080deg); }
}

@media (prefers-reduced-motion: reduce) {
  body.is-loading .ltr--t,
  body.is-loading .wordmark__star,
  body.intro-done .ltr--t,
  body.intro-done .wordmark__star {
    animation: none;
    transform: none;
  }
  body.is-loading .wordmark__star,
  body.intro-done .wordmark__star {
    transform: translate(-30%, -42%);
  }
  body.is-loading .ltr--t,
  body.intro-done .ltr--t {
    transform: scaleY(0.78) translateY(0.15em);
  }
}

.wordmark__star svg { width: 100%; height: 100%; }
.wordmark__star line {
  stroke: var(--paper);
  stroke-width: 6;
  stroke-linecap: round;
}
.wordmark__star .spoke-accent { stroke: var(--ocean); }
.wordmark__star .star-core    { fill: var(--ocean); }

.wordmark__text {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(96px, 18vw, 260px);
  letter-spacing: -0.06em;
  color: var(--paper);
  line-height: 0.85;
}

.ltr { display: inline-block; }

.ltr--t {
  transform: scaleY(0.78) translateY(0.15em);
  transform-origin: 50% 100%;
  margin-right: -0.02em;
}

.hero__tagline {
  font-size: clamp(18px, 1.7vw, 22px);
  font-weight: 300;
  color: var(--paper);
}

.hero__meta {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
}

.hero__cue {
  position: absolute;
  bottom: clamp(24px, 4vh, 48px);
  left: 0; right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: rgba(255, 255, 255, 0.5);
  animation: bob 2.4s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50%      { transform: translateY(4px); opacity: 0.85; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__cue { animation: none; }
}

/* =========================================================
   02 · MANIFESTO BAND (white)
   ========================================================= */
.band {
  padding: clamp(140px, 22vh, 240px) 24px;
  text-align: center;
  scroll-snap-align: start;
}

.band__inner {
  max-width: 1100px;
  margin: 0 auto;
}

.band__headline {
  font-family: var(--font-display);
  font-size: clamp(48px, 7.5vw, 120px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin-bottom: clamp(32px, 5vh, 56px);
  color: var(--ink);
}

.band__sub {
  font-size: clamp(16px, 1.3vw, 19px);
  font-weight: 300;
  color: #444;
  max-width: 620px;
  margin: 0 auto clamp(32px, 5vh, 48px);
  line-height: 1.6;
}

.band__quiet {
  font-family: var(--font-mono);
  font-style: italic;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--cobalt);
}

/* =========================================================
   03 · SPECS (black)
   ========================================================= */
.specs {
  padding: clamp(140px, 22vh, 240px) 24px clamp(120px, 18vh, 200px);
  scroll-snap-align: start;
}

.specs__inner {
  max-width: 1100px;
  margin: 0 auto;
}

.specs__eyebrow {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  margin-bottom: clamp(24px, 4vh, 40px);
}

.specs__headline {
  font-family: var(--font-display);
  font-size: clamp(48px, 7.5vw, 120px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-align: center;
  margin-bottom: clamp(64px, 10vh, 120px);
  color: var(--paper);
}

.specs__list {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.row {
  display: grid;
  grid-template-columns: 80px minmax(220px, 1fr) minmax(220px, 2fr);
  align-items: baseline;
  gap: 32px;
  padding: clamp(28px, 4vh, 48px) clamp(8px, 1.5vw, 24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  transition: padding-left 320ms cubic-bezier(0.16, 1, 0.3, 1),
              background 320ms ease;
}

.row:hover {
  padding-left: clamp(20px, 3vw, 36px);
  background: rgba(255, 255, 255, 0.04);
}

.row__num {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.5);
}

.row__value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 3.8vw, 56px);
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--paper);
}

.row__label {
  font-size: clamp(14px, 1.1vw, 16px);
  font-weight: 300;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.78);
}

@media (max-width: 720px) {
  .row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .row__num { font-size: 11px; }
}

/* =========================================================
   04 · WAITLIST (oxblood) — Daisy-split sign-up layout
   ========================================================= */
.waitlist {
  padding: clamp(120px, 18vh, 200px) 24px;
  scroll-snap-align: start;
}

.waitlist__inner {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(48px, 8vw, 140px);
  align-items: start;
}

@media (max-width: 880px) {
  .waitlist__inner {
    grid-template-columns: 1fr;
    gap: clamp(48px, 8vh, 80px);
  }
}

/* ---------- LEFT: wordmark + perks ---------- */
.waitlist__left {}

.waitlist__wordmark {
  position: relative;
  display: inline-block;
  line-height: 1;
  margin-bottom: clamp(48px, 8vh, 96px);
}

.waitlist__star {
  position: absolute;
  top: -0.06em;
  left: -0.08em;
  width: clamp(36px, 4.8vw, 64px);
  aspect-ratio: 1 / 1;
  transform: translate(-30%, -42%);
  pointer-events: none;
}

.waitlist__star svg { width: 100%; height: 100%; display: block; }
.waitlist__star line {
  stroke: var(--paper);
  stroke-width: 6;
  stroke-linecap: round;
}
.waitlist__star .spoke-accent { stroke: var(--ocean); }
.waitlist__star .star-core    { fill: var(--ocean); }

.waitlist__name {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(64px, 9vw, 140px);
  letter-spacing: -0.06em;
  color: var(--paper);
  line-height: 0.85;
}

.waitlist__includes-label {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.72);
  text-transform: lowercase;
  margin-bottom: clamp(24px, 3vh, 36px);
}

.waitlist__perks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
}

.waitlist__perks li {
  font-size: clamp(15px, 1.3vw, 18px);
  font-weight: 400;
  color: var(--paper);
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}

@media (max-width: 540px) {
  .waitlist__perks { grid-template-columns: 1fr; }
}

/* ---------- RIGHT: headline + form ---------- */
.waitlist__right {
  padding-top: clamp(0px, 2vh, 12px);
}

.waitlist__headline {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 76px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin-bottom: 18px;
  color: var(--paper);
}

.waitlist__sub {
  font-size: clamp(15px, 1.2vw, 17px);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.80);
  max-width: 520px;
  margin: 0 0 clamp(36px, 5vh, 56px);
  line-height: 1.55;
}

.waitlist__form {
  display: flex;
  align-items: stretch;
  gap: 6px;
  max-width: 520px;
  margin: 0;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(6px);
  transition: border-color 220ms ease, box-shadow 220ms ease;
}

.waitlist__form:focus-within {
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.10);
}

.waitlist__input {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  padding: 13px 18px;
  color: var(--paper);
  outline: none;
}

.waitlist__input::placeholder { color: rgba(255, 255, 255, 0.55); }

.waitlist__button {
  border: 0;
  background: var(--paper);
  color: var(--oxblood-deep);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  padding: 13px 28px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 200ms ease, transform 140ms ease, color 200ms ease;
}

.waitlist__button:hover {
  background: var(--ink);
  color: var(--paper);
}

.waitlist__button:active { transform: scale(0.97); }
.waitlist__button:disabled { opacity: 0.6; cursor: not-allowed; }

.waitlist__status {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.6);
  min-height: 1.4em;
}

.waitlist__status.is-error   { color: #ffd1c8; }
.waitlist__status.is-success { color: var(--paper); }

/* =========================================================
   FOOTER (white)
   ========================================================= */
.footer {
  padding: 48px 24px;
  text-align: center;
}

.footer__line {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #777;
}

/* =========================================================
   Scroll reveals
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 900ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   Mobile
   ========================================================= */
@media (max-width: 640px) {
  .runner   { top: 14px; right: 14px; }
  .runner__frames { width: 22px; height: 22px; }
  .dist     { top: 14px; left: 14px; }
  .dist__val { font-size: 12px; }

  .waitlist__form {
    flex-direction: column;
    border-radius: 18px;
    padding: 8px;
  }
  .waitlist__input { text-align: center; padding: 14px 18px; }
  .waitlist__button { padding: 14px 22px; border-radius: 12px; }

  .wordmark__star { transform: translate(-25%, -45%); }
}
