/* ============================================================
   RaceRox — getracerox.com
   Design language ported from the app's DesignSystem/Theme.swift:
   near-black bg, volt accent, heavy expanded caps, hairline strokes.
   ============================================================ */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('assets/fonts/archivo-var.woff2') format('woff2');
}

:root {
  --bg: #0A0A0E;
  --bg-elev: #121218;
  --card: #15151C;
  --card-hi: #1C1C24;
  --volt: #D8FF3E;
  --volt-dim: #b8dc2e;
  --ember: #FF6A3D;
  --ice: #8FC9FF;
  --mint: #53E6C4;
  --violet: #A08CFF;
  --gold: #FFCE54;
  --text: #FFFFFF;
  --text-2: rgba(255, 255, 255, 0.64);
  --text-3: rgba(255, 255, 255, 0.38);
  --stroke: rgba(255, 255, 255, 0.08);
  --stroke-hi: rgba(255, 255, 255, 0.16);
  --font: 'Archivo', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --wrap: 1180px;
  --pad: clamp(20px, 5vw, 48px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--volt); color: #0A0A0E; }

/* Grain overlay — the whole site sits under a faint noise texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* ---------- type utilities ---------- */

.kicker {
  font-size: 12px;
  font-weight: 700;
  font-stretch: 110%;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--volt);
}

.display {
  font-stretch: 125%;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.tnum { font-variant-numeric: tabular-nums; }

/* ---------- shared layout ---------- */

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

section { position: relative; }

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--stroke);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-stretch: 125%;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 0.01em;
}

.logo .rox { color: var(--volt); }

.logo-mark {
  width: 28px; height: 28px;
  border-radius: 7px;
  border: 1px solid var(--stroke-hi);
}

.nav-cta {
  font-size: 13px;
  font-weight: 700;
  font-stretch: 110%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: #0A0A0E;
  background: var(--volt);
  padding: 9px 18px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.nav-cta:hover { background: var(--volt-dim); }

/* ---------- hero ---------- */

.hero {
  padding-top: clamp(120px, 16vh, 180px);
  padding-bottom: clamp(40px, 6vh, 80px);
  position: relative;
}

.hero { overflow: clip; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  margin-top: clamp(28px, 4vh, 48px);
}

.hero h1 {
  font-size: clamp(38px, 6.4vw, 76px);
  margin-top: 18px;
}

@media (max-width: 600px) {
  .hero h1 br { display: none; }
}

.hero h1 .line-volt { color: var(--volt); }
.hero h1 .line-outline {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.36);
}

.hero-sub {
  font-size: clamp(17px, 1.5vw, 20px);
  color: var(--text-2);
  max-width: 34em;
  margin-bottom: 32px;
}

.hero-sub strong { color: var(--text); font-weight: 600; }

.hero-ctas {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.cta-note {
  font-size: 13px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.cta-note b { color: var(--text-2); font-weight: 600; }

/* race-bib chips */
.bib-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 40px;
}

.bib {
  border: 1px solid var(--stroke-hi);
  border-radius: 4px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  font-stretch: 115%;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.02);
}

.bib em { font-style: normal; color: var(--volt); }

/* ---------- app store badge ---------- */

.appstore-badge { display: inline-block; line-height: 0; transition: opacity 0.15s ease; }
.appstore-badge:hover { opacity: 0.85; }
.appstore-badge svg { height: 52px; width: auto; }

/* ---------- phone frames ---------- */

/* iPhone frame: titanium edge, black bezel, Dynamic Island, side buttons */
.phone {
  position: relative;
  border-radius: clamp(40px, 4.6vw, 56px);
  background: #050506;
  padding: clamp(10px, 1.1vw, 14px);
  box-shadow:
    0 0 0 2.5px #46464e,
    0 0 0 4px #0f0f12,
    0 30px 60px rgba(0, 0, 0, 0.5);
}

.phone img {
  border-radius: clamp(30px, 3.6vw, 43px);
  width: 100%;
}

/* Dynamic Island */
.phone::before {
  content: '';
  position: absolute;
  z-index: 2;
  top: 3.2%;
  left: 50%;
  transform: translateX(-50%);
  width: 28%;
  aspect-ratio: 125 / 37;
  border-radius: 999px;
  background: #000;
}

/* power button (right edge) */
.phone::after {
  content: '';
  position: absolute;
  right: -5.5px;
  top: 27%;
  width: 3.5px;
  height: 8.5%;
  border-radius: 0 2px 2px 0;
  background: #46464e;
}

/* volume buttons (left edge) */
.phone i {
  position: absolute;
  left: -5.5px;
  top: 21%;
  width: 3.5px;
  height: 5.5%;
  border-radius: 2px 0 0 2px;
  background: #46464e;
}

.phone i::before {
  content: '';
  position: absolute;
  left: 0;
  top: 135%;
  width: 100%;
  height: 100%;
  border-radius: 2px 0 0 2px;
  background: #46464e;
}

.hero-phones {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-phones .phone-main {
  width: min(280px, 62%);
  transform: rotate(2.5deg);
  z-index: 2;
}

.hero-phones .phone-back {
  position: absolute;
  width: min(220px, 48%);
  right: 2%;
  top: 4%;
  transform: rotate(-7deg);
  opacity: 0.85;
  z-index: 1;
}

/* ---------- station ticker ---------- */

.ticker {
  border-top: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
  overflow: hidden;
  padding: 18px 0;
  margin-top: clamp(48px, 8vh, 96px);
}

.ticker-track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: ticker 40s linear infinite;
}

@keyframes ticker { to { transform: translateX(-50%); } }

.ticker-set {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.ticker-set span {
  font-stretch: 125%;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 18px;
}

.ticker-set i {
  font-style: normal;
  color: var(--volt);
  font-size: 11px;
}

/* ---------- section scaffolding ---------- */

.section {
  padding: clamp(72px, 12vh, 140px) 0 0;
}

.section-head { max-width: 700px; }

.section-head h2 {
  font-size: clamp(32px, 4.6vw, 58px);
  margin: 14px 0 18px;
}

.section-head p {
  color: var(--text-2);
  font-size: clamp(16px, 1.4vw, 19px);
}

/* ---------- how it works ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 4vw, 56px);
  border-top: 1px solid var(--stroke-hi);
  margin-top: clamp(36px, 5vh, 56px);
}

.step {
  padding-top: clamp(24px, 3vw, 36px);
  position: relative;
}

.step-num {
  font-stretch: 125%;
  font-weight: 900;
  font-size: 15px;
  line-height: 1;
  color: var(--volt);
  margin-bottom: 18px;
}

.step h3 {
  font-stretch: 118%;
  font-weight: 800;
  font-size: 19px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}

.step p { color: var(--text-2); font-size: 15.5px; }

/* ---------- feature sections ---------- */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
  padding-top: clamp(72px, 12vh, 140px);
}

.feature.flip .feature-copy { order: 2; }
.feature.flip .feature-shot { order: 1; }

.feature-copy .feat-index {
  font-stretch: 125%;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--volt);
  margin-bottom: 14px;
}

.feature[data-accent="ember"] .feat-index { color: var(--ember); }
.feature[data-accent="ice"]   .feat-index { color: var(--ice); }
.feature[data-accent="mint"]  .feat-index { color: var(--mint); }

.feature-copy h3 {
  font-size: clamp(30px, 3.8vw, 46px);
  margin: 12px 0 18px;
}

.feature-copy > p {
  color: var(--text-2);
  font-size: clamp(16px, 1.35vw, 18px);
  max-width: 30em;
}

.feature-points {
  list-style: none;
  margin-top: 26px;
  display: grid;
  gap: 12px;
}

.feature-points li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  color: var(--text-2);
  font-size: 15.5px;
}

.feature-points li::before {
  content: '//';
  font-weight: 900;
  font-stretch: 125%;
  font-size: 13px;
  flex-shrink: 0;
}

.feature[data-accent="volt"]   .feature-points li::before { color: var(--volt); }
.feature[data-accent="ember"]  .feature-points li::before { color: var(--ember); }
.feature[data-accent="ice"]    .feature-points li::before { color: var(--ice); }
.feature[data-accent="mint"]   .feature-points li::before { color: var(--mint); }

.feature-shot { display: flex; justify-content: center; position: relative; }
.feature-shot .phone { width: min(320px, 82%); }

/* ---------- widgets strip ---------- */

.strip {
  margin-top: clamp(72px, 12vh, 140px);
  border-top: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
}

.strip-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.strip-cell {
  padding: clamp(28px, 3vw, 44px);
}

.strip-cell + .strip-cell { border-left: 1px solid var(--stroke); }

.strip-cell h4 {
  font-stretch: 118%;
  font-weight: 800;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 14px 0 8px;
}

.strip-cell p { color: var(--text-2); font-size: 14.5px; }

.strip-icon {
  width: 40px; height: 40px;
  border-radius: 6px;
  border: 1px solid var(--stroke-hi);
  display: grid;
  place-items: center;
  color: var(--volt);
}

/* ---------- trust ---------- */

.trust-rows { margin-top: clamp(36px, 5vh, 56px); }

.trust-row {
  display: grid;
  grid-template-columns: 80px minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(20px, 3vw, 48px);
  align-items: start;
  border-top: 1px solid var(--stroke-hi);
  padding: clamp(24px, 3vw, 36px) 0;
}

.trust-rows .trust-row:last-child { border-bottom: 1px solid var(--stroke-hi); }

.trust-row .idx {
  font-stretch: 125%;
  font-weight: 900;
  font-size: 15px;
  color: var(--text-3);
  padding-top: 6px;
}

.trust-row .big {
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(22px, 2.4vw, 30px);
  text-transform: uppercase;
  line-height: 1.05;
}

.trust-row .big em { font-style: normal; color: var(--volt); }
.trust-row p { color: var(--text-2); font-size: 15.5px; }

/* ---------- final CTA (inverted volt block) ---------- */

.final {
  margin-top: clamp(80px, 14vh, 160px);
  background: var(--volt);
  color: #0A0A0E;
  position: relative;
  overflow: hidden;
}

.final::before {
  content: 'RaceRox RaceRox RaceRox';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(120px, 22vw, 300px);
  white-space: nowrap;
  color: rgba(10, 10, 14, 0.05);
  pointer-events: none;
}

.final-inner {
  padding: clamp(80px, 12vh, 140px) 0;
  text-align: center;
  position: relative;
}

.final .kicker { color: rgba(10, 10, 14, 0.55); }

.final h2 {
  font-size: clamp(40px, 6.4vw, 84px);
  margin: 16px 0 14px;
}

.final p {
  font-size: clamp(16px, 1.5vw, 19px);
  color: rgba(10, 10, 14, 0.72);
  max-width: 32em;
  margin: 0 auto 36px;
  font-weight: 500;
}

.final .appstore-badge svg { height: 56px; }

.final .cta-note { color: rgba(10, 10, 14, 0.55); display: block; margin-top: 18px; }
.final .cta-note b { color: rgba(10, 10, 14, 0.8); }

/* ---------- footer ---------- */

.footer {
  padding: clamp(40px, 6vh, 64px) 0;
  border-top: 1px solid var(--stroke);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s ease;
}

.footer-links a:hover { color: var(--volt); }

.footer-legal {
  margin-top: 28px;
  font-size: 12.5px;
  color: var(--text-3);
  max-width: 62em;
}

/* ---------- scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
}

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

/* hero load stagger */
.hero .stagger {
  opacity: 0;
  transform: translateY(24px);
  animation: rise 0.8s cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
}

.hero .stagger:nth-child(1) { animation-delay: 0.05s; }
.hero .stagger:nth-child(2) { animation-delay: 0.15s; }
.hero .stagger:nth-child(3) { animation-delay: 0.28s; }
.hero .stagger:nth-child(4) { animation-delay: 0.4s; }
.hero .stagger:nth-child(5) { animation-delay: 0.52s; }

.hero-phones {
  opacity: 0;
  animation: rise 0.9s cubic-bezier(0.2, 0.6, 0.2, 1) 0.35s forwards;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .hero .stagger, .hero-phones { opacity: 1; transform: none; animation: none; transition: none; }
  .ticker-track { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- legal pages ---------- */

.legal-page {
  padding-top: 140px;
  padding-bottom: 80px;
  max-width: 760px;
}

.legal-page h1 {
  font-stretch: 125%;
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1;
  margin-bottom: 8px;
}

.legal-page .updated {
  color: var(--text-3);
  font-size: 14px;
  margin-bottom: 40px;
}

.legal-page h2 {
  font-stretch: 118%;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 18px;
  letter-spacing: 0.04em;
  margin: 40px 0 12px;
  color: var(--volt);
}

.legal-page p, .legal-page li { color: var(--text-2); margin-bottom: 12px; }
.legal-page ul { padding-left: 22px; }
.legal-page a { color: var(--volt); }
.legal-page strong { color: var(--text); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-phones { margin-top: 24px; }
  .hero-phones .phone-main { width: min(280px, 70%); }
  .steps { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 1fr; gap: 36px; }
  .feature.flip .feature-copy { order: 1; }
  .feature.flip .feature-shot { order: 2; }
  .strip-inner { grid-template-columns: 1fr; }
  .strip-cell + .strip-cell { border-left: none; border-top: 1px solid var(--stroke); }
  .trust-row { grid-template-columns: 1fr; gap: 10px; }
  .trust-row .idx { padding-top: 0; }
}
