/* My Racer's Edge — marketing landing page (index.html only).
   Legal/support pages keep using styles.css. Palette mirrors the app's
   dark theme (lib/common/theme/app_colors.dart). */

:root {
  --bg: #0b0d10;
  --bg-2: #101319;
  --surface: #161b25;
  --surface-2: #1c2230;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eef2f7;
  --muted: #9aa6b8;
  --faint: #6b778a;

  --accent: #00f0ff;
  --accent-ink: #031417;
  --accent-soft: rgba(0, 240, 255, 0.1);
  --accent-glow: rgba(0, 240, 255, 0.28);
  --red: #ff3355;
  --gold: #f5c542;

  --radius: 16px;
  --radius-lg: 24px;
  --wrap: 1180px;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px }

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

img { max-width: 100%; display: block }
a { color: inherit; text-decoration: none }
h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
  text-wrap: balance;
}
p { margin: 0 0 16px }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums }
.red { color: var(--red) }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px }
@media (max-width: 540px) { .wrap { padding: 0 16px } }

.skip-link {
  position: absolute; left: -999px; top: 10px; z-index: 100;
  background: var(--surface); padding: 10px 14px; border-radius: 8px;
}
.skip-link:focus { left: 10px; outline: 2px solid var(--accent) }

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

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 22px; border-radius: 12px;
  font-weight: 700; font-size: 0.98rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn-sm { padding: 9px 16px; font-size: 0.9rem; border-radius: 10px }
.btn-primary {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.4), 0 8px 28px -8px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px var(--accent), 0 12px 32px -8px var(--accent-glow) }
.btn-ghost { border-color: var(--line-strong); color: var(--text); background: rgba(255, 255, 255, 0.03) }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent) }

.link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px }

/* ── Header ────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 13, 16, 0.78);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 800; letter-spacing: -0.01em }
.brand img { height: 40px; width: auto }
.nav-links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0 }
.nav-links a { padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 0.95rem }
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05) }
@media (max-width: 860px) { .nav-links { display: none } }
@media (max-width: 400px) { .brand span { display: none } }

/* ── Checkered motif ───────────────────────────────────── */
.checker {
  position: absolute; pointer-events: none;
  background-image: conic-gradient(rgba(255, 255, 255, 0.05) 25%, transparent 0 50%, rgba(255, 255, 255, 0.05) 0 75%, transparent 0);
  background-size: 28px 28px;
}

/* ── Hero ──────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  padding: 88px 0 96px;
  background:
    radial-gradient(800px 520px at 78% 38%, rgba(0, 240, 255, 0.13), transparent 60%),
    radial-gradient(600px 420px at 8% 0%, rgba(255, 51, 85, 0.08), transparent 60%);
}
.hero .checker {
  top: 0; right: 0; width: 55%; height: 100%;
  -webkit-mask-image: linear-gradient(to left, #000, transparent 85%);
  mask-image: linear-gradient(to left, #000, transparent 85%);
  opacity: 0.7;
}
.hero-grid {
  position: relative;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center;
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 10px; margin-bottom: 24px;
  border: 1px solid rgba(0, 240, 255, 0.3); border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 0.85rem; font-weight: 600;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent) }
.hero h1 { font-size: clamp(2.5rem, 5.6vw, 4.4rem); font-weight: 800; margin-bottom: 22px }
.accent { color: var(--accent) }
.lead { color: var(--muted); font-size: 1.13rem; max-width: 36em }
.hero .lead { font-size: 1.2rem; margin-bottom: 32px }

.store-badges { display: flex; flex-wrap: wrap; gap: 12px; align-items: center }
.store-badges.center { justify-content: center }
.store-badge { display: inline-block; border-radius: 10px; transition: transform 0.15s ease, opacity 0.2s }
.store-badge:hover { transform: translateY(-2px) }
.store-badge img { height: 52px; width: auto }
.fineprint { margin-top: 16px; color: var(--faint); font-size: 0.9rem }

/* Hero phones */
.hero-visual { position: relative; height: 620px }
.phone {
  position: relative;
  border-radius: 38px; padding: 10px;
  background: linear-gradient(145deg, #2a3140, #0e1117 55%, #232a37);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 40px 80px -20px rgba(0, 0, 0, 0.8),
    0 0 60px -10px rgba(0, 240, 255, 0.15);
}
.phone img { border-radius: 29px; width: 100%; height: auto }
.hero-visual .phone { position: absolute; width: 290px }
.phone-front { right: 8%; top: 0; z-index: 2; transform: rotate(3deg) }
.phone-back { left: 2%; top: 64px; z-index: 1; transform: rotate(-6deg); opacity: 0.55; filter: saturate(0.8) }
.float-chip {
  position: absolute; z-index: 3;
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 16px; border-radius: 14px;
  background: rgba(22, 27, 37, 0.86);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.7);
  font-size: 1.25rem; font-weight: 700;
}
.chip-label { font-family: var(--font-body); font-size: 0.72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em }
.chip-lap { right: 0; bottom: 110px; border-color: rgba(245, 197, 66, 0.45) }
.chip-lap .mono { color: var(--gold) }
.chip-delta { left: 14%; bottom: 24px }

@media (max-width: 960px) {
  .hero { padding: 56px 0 64px }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; text-align: center }
  .hero .lead { margin-left: auto; margin-right: auto }
  .hero .store-badges { justify-content: center }
  .hero-visual { height: 520px; max-width: 460px; margin: 0 auto; width: 100% }
  .hero-visual .phone { width: 240px }
  .phone-front { right: 6% }
  .phone-back { left: 6% }
  .hero .checker { width: 100% }
}
@media (max-width: 480px) {
  .hero-visual { height: 440px }
  .hero-visual .phone { width: 200px }
  .phone-back { left: 0 }
  .phone-front { right: 0 }
  .chip-lap { bottom: 90px; right: -4px }
  .chip-delta { left: 0 }
}

/* ── Value strip ───────────────────────────────────────── */
.strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-2) }
.strip-list {
  list-style: none; margin: 0 auto; padding-top: 28px; padding-bottom: 28px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.strip-list li { display: flex; flex-direction: column; gap: 2px; padding-left: 16px; border-left: 2px solid var(--accent) }
.strip-list strong { font-family: var(--font-head); font-size: 1.15rem }
.strip-list span { color: var(--muted); font-size: 0.92rem }
@media (max-width: 860px) { .strip-list { grid-template-columns: repeat(2, 1fr); row-gap: 24px } }

/* ── Sections ──────────────────────────────────────────── */
.section { padding: 112px 0 }
@media (max-width: 720px) { .section { padding: 72px 0 } }
.kicker {
  color: var(--accent); font-weight: 700; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 14px;
}
.section h2 { font-size: clamp(2rem, 3.8vw, 3rem); font-weight: 800 }
.section-header { margin-bottom: 48px; max-width: 640px }
.section-header.center { text-align: center; margin-left: auto; margin-right: auto }
.section-header.center .lead { margin: 0 auto }

/* Feature rows */
.feature-alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line) }
.feature-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 72px; align-items: center }
.feature-grid.reverse .feature-copy { order: 2 }
.feature-visual { display: flex; justify-content: center; position: relative }
.feature-visual::before {
  content: ""; position: absolute; inset: 10% 5%;
  background: radial-gradient(closest-side, rgba(0, 240, 255, 0.18), transparent);
  filter: blur(20px);
}
.feature-visual .phone { width: 100%; max-width: 310px }
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: 1fr; gap: 48px }
  .feature-grid.reverse .feature-copy { order: 0 }
  .feature-visual .phone { max-width: 270px }
}

.checks { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 16px }
.checks li { position: relative; padding-left: 34px; color: var(--muted) }
.checks li strong { color: var(--text); font-weight: 600 }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 3px;
  width: 22px; height: 22px; border-radius: 7px;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300f0ff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
  border: 1px solid rgba(0, 240, 255, 0.25);
}
.checks.compact { gap: 12px; margin: 24px 0 32px }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px }
@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, 1fr) } }
@media (max-width: 620px) { .cards { grid-template-columns: 1fr } }
.card {
  padding: 28px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: rgba(0, 240, 255, 0.3); transform: translateY(-2px) }
.card h3 { font-size: 1.2rem; margin: 18px 0 8px }
.card p { color: var(--muted); margin: 0; font-size: 0.97rem }
.card-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent-soft); border: 1px solid rgba(0, 240, 255, 0.2);
}
.card-icon svg { width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round }

/* Steps */
.how { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line) }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: none }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr } }
.step { position: relative; padding: 32px 28px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg) }
.step-num { display: block; font-size: 2.4rem; font-weight: 700; color: var(--accent); line-height: 1; margin-bottom: 20px; opacity: 0.9 }
.step h3 { font-size: 1.3rem; margin-bottom: 8px }
.step p { color: var(--muted); margin: 0 }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 420px)); gap: 24px; justify-content: center }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr } }
.plan {
  position: relative; display: flex; flex-direction: column;
  padding: 36px 32px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line);
}
.plan h3 { font-size: 1.7rem; margin-bottom: 6px }
.plan-sub { color: var(--muted); margin: 0 }
.plan .btn { margin-top: auto }
.plan-pro {
  border-color: rgba(0, 240, 255, 0.45);
  background:
    radial-gradient(400px 240px at 100% 0%, rgba(0, 240, 255, 0.12), transparent 70%),
    var(--surface);
  box-shadow: 0 30px 60px -30px rgba(0, 240, 255, 0.35);
}
.plan-tag {
  position: absolute; top: 20px; right: 20px; margin: 0;
  padding: 4px 10px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
}
.plans-note { text-align: center; color: var(--faint); font-size: 0.9rem; max-width: 620px; margin: 32px auto 0 }

/* FAQ */
.faq-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 64px; align-items: start }
@media (max-width: 900px) { .faq-grid { grid-template-columns: 1fr; gap: 0 } }
.accordion { display: grid; gap: 12px }
.qa { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color 0.2s }
.qa[open] { border-color: rgba(0, 240, 255, 0.3) }
.qa summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 22px; font-weight: 600; font-size: 1.02rem;
}
.qa summary::-webkit-details-marker { display: none }
.qa summary::after {
  content: ""; flex-shrink: 0; width: 12px; height: 12px;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(45deg) translate(-3px, -3px); transition: transform 0.2s ease;
}
.qa[open] summary::after { transform: rotate(225deg) translate(-3px, -3px) }
.qa p { padding: 0 22px 20px; margin: 0; color: var(--muted) }

/* Download CTA */
.cta-box {
  position: relative; overflow: hidden; text-align: center;
  padding: 72px 32px; border-radius: 32px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(0, 240, 255, 0.16), transparent 70%),
    var(--surface);
}
.cta-box .checker { inset: 0; -webkit-mask-image: radial-gradient(closest-side, transparent 40%, #000); mask-image: radial-gradient(closest-side, transparent 40%, #000); opacity: 0.6 }
.cta-box > * { position: relative }
.cta-logo { width: 220px; height: auto; margin: 0 auto 24px }
.cta-box .lead { margin: 0 auto 32px }
@media (max-width: 540px) { .cta-box { padding: 56px 20px } .cta-logo { width: 180px } }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 36px 0; color: var(--muted); font-size: 0.92rem }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap }
.footer-brand { display: flex; flex-direction: column; gap: 2px }
.footer-brand strong { color: var(--text); font-family: var(--font-head) }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0 }
.footer-links a:hover { color: var(--accent) }

/* Reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease }
.reveal.is-visible { opacity: 1; transform: none }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
  .reveal { opacity: 1; transform: none; transition: none }
  * { transition-duration: 0.01ms !important }
}

/* ── /app download page (QR code target) ───────────────── */
.app-page { min-height: 100vh; display: flex; flex-direction: column }
.app-page main { flex: 1 }
.app-page .hero { padding-bottom: 72px }
.app-page .hero h1 { font-size: clamp(2.5rem, 5.2vw, 4rem) }

/* app-redirect.js marks the visitor's platform with .highlight; soften the
   other store once one has been picked (desktop highlights both). */
.store-badges:has(.highlight) .store-btn-img:not(.highlight) { opacity: 0.45 }
.store-badges:has(.highlight) .store-btn-img:not(.highlight):hover { opacity: 1 }

.app-highlights {
  list-style: none; margin: 40px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.app-highlights li {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 18px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
  text-align: left;
}
.app-highlights strong { font-family: var(--font-head); font-size: 1rem }
.app-highlights span { color: var(--muted); font-size: 0.9rem; line-height: 1.45 }
@media (max-width: 960px) { .app-highlights { max-width: 560px; margin-left: auto; margin-right: auto } }
@media (max-width: 480px) { .app-highlights { grid-template-columns: 1fr } }

.interstitial {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 24px; padding: 14px 20px; max-width: 420px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.interstitial p { margin: 0 }
@media (max-width: 960px) { .interstitial { margin-left: auto; margin-right: auto } }
.spinner {
  width: 20px; height: 20px; flex-shrink: 0; border-radius: 50%;
  border: 3px solid var(--line-strong); border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }
