/* Sport Score Tracker - marketing site.
   Tokens mirror the Sport Score Tracker DS (ds-bundle/tokens/tokens.css, canonical spec DESIGN.md).
   DARK IS THE DEFAULT THEME (true-black, Apple-Fitness-grade); light is the high-contrast
   sunlight surface. Depth comes from surface lightness, never borders or shadows. ONE accent,
   spent only on the primary action and "live" moments. */

:root {
  /* ---- Accent (the ONE accent) ---- */
  --accent: #FF375F;
  --accent-pressed: #D80E45;
  --accent-tint: rgba(255, 55, 95, 0.18);
  --on-accent: #FFFFFF;

  /* ---- Neutrals ---- */
  --bg: #000000;
  --bg-elevated: #1C1C1E;
  --surface: #1C1C1E;
  --surface-2: #2C2C2E;
  --surface-3: #3A3A3C;
  --fill: rgba(118, 118, 128, 0.24);
  --separator: #38383A;

  /* ---- Text (Apple label-opacity ramp) ---- */
  --text-primary: #FFFFFF;
  --text-secondary: rgba(235, 235, 245, 0.60);
  --text-muted: rgba(235, 235, 245, 0.30);
  --text-inverse: #000000;

  --success: #30D158;

  /* ---- Radius (cards 18, large overlays 22 - never side by side) ---- */
  --r-sm: 8px;
  --r-md: 12px;
  --r-control: 14px;
  --r-card: 18px;
  --r-xl: 22px;
  --r-pill: 999px;

  --maxw: 1080px;
  --maxw-narrow: 720px;

  /* System stack only - matches the app's SF Pro, keeps the site tracker- and CDN-free. */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;

  --nav-bg: rgba(0, 0, 0, 0.78);
  --shot-glow: rgba(255, 55, 95, 0.14);
  color-scheme: dark;
}

/* Light theme - auto via OS preference (unless the toggle forced dark)... */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --accent-tint: rgba(255, 55, 95, 0.12);
    --bg: #F2F2F7;
    --bg-elevated: #FFFFFF;
    --surface: #FFFFFF;
    --surface-2: #F2F2F7;
    --surface-3: #FFFFFF;
    --fill: rgba(120, 120, 128, 0.20);
    --separator: #C6C6C8;
    --text-primary: #000000;
    --text-secondary: rgba(60, 60, 67, 0.60);
    --text-muted: rgba(60, 60, 67, 0.30);
    --text-inverse: #FFFFFF;
    --success: #34C759;
    --nav-bg: rgba(242, 242, 247, 0.82);
    --shot-glow: rgba(255, 55, 95, 0.10);
    color-scheme: light;
  }
}
/* ...and explicitly via the toggle (wins in both directions). */
:root[data-theme="light"] {
  --accent-tint: rgba(255, 55, 95, 0.12);
  --bg: #F2F2F7;
  --bg-elevated: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F2F2F7;
  --surface-3: #FFFFFF;
  --fill: rgba(120, 120, 128, 0.20);
  --separator: #C6C6C8;
  --text-primary: #000000;
  --text-secondary: rgba(60, 60, 67, 0.60);
  --text-muted: rgba(60, 60, 67, 0.30);
  --text-inverse: #FFFFFF;
  --success: #34C759;
  --nav-bg: rgba(242, 242, 247, 0.82);
  --shot-glow: rgba(255, 55, 95, 0.10);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

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

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

h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.12; }

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.container--narrow { max-width: var(--maxw-narrow); }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 16px;
  border-radius: var(--r-sm);
  z-index: 200;
}
.skip:focus { left: 16px; top: 16px; }

/* ── Eyebrow (12/700 uppercase tracked - decorative) ─────────────────── */
.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 18px;
}
.eyebrow .dot { color: var(--accent); }

/* ── Buttons (tone rules from DESIGN.md §5) ──────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.2;
  padding: 14px 24px;
  border-radius: var(--r-control);
  border: 0;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}
.btn:active { transform: scale(0.98); }

.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-pressed); }

.btn--tinted { background: var(--accent-tint); color: var(--accent); }
.btn--tinted:hover { opacity: 0.85; }

.btn--plain { background: transparent; color: var(--text-secondary); padding: 14px 12px; }
.btn--plain:hover { color: var(--text-primary); }

.btn--sm { font-size: 15px; padding: 10px 18px; }

/* ── Nav ─────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav { background: var(--bg); }
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.brand img { width: 28px; height: 28px; border-radius: 7px; display: block; }
.brand__accent { color: var(--accent); }

.nav__links {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 15px;
  color: var(--text-secondary);
}
.nav__links a:hover { color: var(--text-primary); }

.nav__cta { margin-left: 4px; }
.nav__cta-mobile { display: none; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--fill);
  color: var(--text-secondary);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text-primary); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: none; }
}
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.nav__toggle span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--text-primary);
}

.nav__mobile {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px 24px 20px;
}
.nav__mobile a {
  padding: 12px 0;
  font-size: 17px;
  color: var(--text-secondary);
}
.nav__mobile a.btn { color: var(--on-accent); justify-content: center; margin-top: 8px; }
.nav__mobile.open { display: flex; }

@media (max-width: 860px) {
  .nav__links, .nav__cta { display: none; }
  .nav__cta-mobile { display: inline-flex; margin-left: auto; }
  .nav__toggle { display: flex; }
}
@media (max-width: 480px) {
  /* Keep the bar inside a 320-390px viewport: the menu + hero carry the CTA. */
  .nav__inner { gap: 10px; }
  .nav__cta-mobile { display: none; }
  .theme-toggle { margin-left: auto; }
}

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 72px 0 40px;
  text-align: center;
}
.hero__glow {
  position: absolute;
  top: -240px;
  left: 50%;
  transform: translateX(-50%);
  width: min(920px, 120vw);
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--shot-glow), transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(34px, 7vw, 60px);
  font-weight: 800;
  max-width: 820px;
  margin: 0 auto;
}
.hero h1 .accent { color: var(--accent); }
.hero__lead {
  max-width: 640px;
  margin: 20px auto 0;
  font-size: clamp(17px, 2.4vw, 20px);
  color: var(--text-secondary);
}
.hero__buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}
.hero__note { margin-top: 14px; font-size: 13px; color: var(--text-muted); }

/* ── Phone frame ─────────────────────────────────────────────────────── */
.phone {
  position: relative;
  width: min(320px, 78vw);
  margin: 48px auto 0;
  padding: 12px;
  background: var(--surface-2);
  border-radius: 48px;
  /* A genuinely floating thing (device mockup), so a shadow is allowed here. */
  box-shadow: 0 30px 90px -24px rgba(0, 0, 0, 0.45);
}
.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 38px;
}
.phone--sm { width: min(280px, 72vw); }

/* Phone + Apple Watch duo (hero). The watch overlaps the phone's lower-left,
   the way Apple stages the pair. The watch face is always black, so one image
   works in both themes. */
.devices {
  position: relative;
  display: inline-block;
  margin: 48px auto 0;
}
.devices .phone { margin: 0; }
.watch {
  position: absolute;
  left: -50px;
  bottom: 40px;
  width: 116px;
  padding: 8px;
  background: #1d1d1f;
  /* Apple Watch case squircle; strapless, the way Apple stages Watch marketing shots. */
  border-radius: 32px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.55);
}
.watch img { display: block; width: 100%; height: auto; border-radius: 26px; }
@media (max-width: 560px) {
  .watch { left: -30px; bottom: 24px; width: 86px; border-radius: 26px; padding: 6px; }
}
@media (max-width: 380px) {
  .watch { display: none; }
}

/* ── Screenshot gallery ("A look inside") ────────────────────────────── */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  margin-top: 48px;
}
@media (max-width: 860px) { .gallery { grid-template-columns: repeat(2, 1fr); gap: 28px 20px; } }
@media (max-width: 420px) { .gallery { grid-template-columns: repeat(2, 1fr); gap: 22px 14px; } }
.gallery figure { margin: 0; text-align: center; }
.gallery .phone {
  width: 100%;
  margin: 0 0 14px;
  padding: 8px;
  border-radius: 34px;
}
.gallery .phone img { border-radius: 27px; }
.gallery figcaption {
  font-size: 14px;
  font-weight: 600;
}
.gallery figcaption span {
  display: block;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Sections ────────────────────────────────────────────────────────── */
.section { padding: 72px 0; }
.section--alt { background: var(--bg-elevated); }
.section__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
  text-align: center;
}
.section__title {
  font-size: clamp(26px, 4.6vw, 38px);
  font-weight: 800;
  text-align: center;
}
.section__lead {
  max-width: 640px;
  margin: 14px auto 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 17px;
}

/* ── Cards (surface, radius 18, NO border/shadow) ────────────────────── */
.grid {
  display: grid;
  gap: 16px;
  margin-top: 44px;
}
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid--3, .grid--2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 24px;
}
.section--alt .card { background: var(--surface-2); }
.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--accent-tint);
  color: var(--accent);
  margin-bottom: 14px;
}
.card__icon svg { width: 20px; height: 20px; }
.card h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.card p { margin: 0; font-size: 15px; color: var(--text-secondary); }

/* ── Stat strip (big tabular numerals - the one stat treatment) ──────── */
.stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 48px;
  margin-top: 44px;
  text-align: center;
}
.stats div { min-width: 120px; }
.stats .value {
  display: block;
  font-size: 34px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.stats .label { font-size: 13px; color: var(--text-secondary); }

/* ── Sports grid (the internal-link hub) ─────────────────────────────── */
.sports {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-top: 44px;
}
@media (max-width: 960px) { .sports { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) { .sports { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 420px) { .sports { grid-template-columns: repeat(2, 1fr); } }

.sport {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 10px 16px;
  background: var(--surface);
  border-radius: var(--r-card);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.12s ease, background 0.12s ease;
}
.section--alt .sport { background: var(--surface-2); }
.sport:hover { transform: translateY(-2px); background: var(--surface-2); }
.section--alt .sport:hover { background: var(--surface-3); }
.sport svg { width: 26px; height: 26px; color: var(--text-secondary); }
.sport:hover svg { color: var(--accent); }

/* ── Spec table ("scoring at a glance" — the per-page unique-value block) ── */
.spec {
  margin: 24px 0 8px;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--surface);
}
.section--alt .spec { background: var(--surface-2); }
.spec table { width: 100%; border-collapse: collapse; }
.spec caption {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 16px 20px 4px;
}
.spec th, .spec td {
  text-align: left;
  padding: 13px 20px;
  font-size: 15px;
  vertical-align: top;
  border-top: 1px solid var(--separator);
}
.spec tr:first-child th, .spec tr:first-child td { border-top: 0; }
.spec th {
  font-weight: 600;
  color: var(--text-secondary);
  width: 42%;
  white-space: nowrap;
}
.spec td { color: var(--text-primary); font-variant-numeric: tabular-nums; }
@media (max-width: 480px) {
  .spec th, .spec td { padding: 11px 16px; font-size: 14px; }
  .spec th { white-space: normal; }
}

/* ── Scoreline motif (echoes the live scoreboard) ────────────────────── */
.scoreline {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  margin: 28px auto 0;
  padding: 18px 28px;
  background: var(--surface);
  border-radius: var(--r-xl);
}
.scoreline .side { text-align: center; }
.scoreline .side .pts {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.scoreline .side .team { font-size: 12px; color: var(--text-secondary); }
.scoreline .serve { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.scoreline .sep { font-size: 24px; color: var(--text-muted); font-weight: 700; }

/* ── Checklist (Pro / free compare) ──────────────────────────────────── */
.plan { background: var(--surface); border-radius: var(--r-card); padding: 28px; }
.section--alt .plan { background: var(--surface-2); }
.plan--pro { outline: 2px solid var(--accent); outline-offset: -2px; }
.plan h3 { font-size: 20px; font-weight: 700; }
.plan .price { margin: 6px 0 18px; color: var(--text-secondary); font-size: 15px; }
.plan .price strong { color: var(--text-primary); font-size: 22px; font-weight: 800; }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.plan li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 15px;
  color: var(--text-secondary);
}
.plan li svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 3px; color: var(--accent); }
.plan--free li svg { color: var(--text-muted); }
.plan .badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-tint);
  border-radius: var(--r-pill);
  padding: 4px 10px;
  margin-bottom: 12px;
}

/* ── FAQ ─────────────────────────────────────────────────────────────── */
.faq { max-width: var(--maxw-narrow); margin: 36px auto 0; display: grid; gap: 10px; }
.faq details {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 4px 22px;
}
.section--alt .faq details { background: var(--surface-2); }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  padding: 16px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 22px;
  font-weight: 400;
  color: var(--text-muted);
  flex: 0 0 auto;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 18px; color: var(--text-secondary); font-size: 15px; }
.faq details a { color: var(--accent); text-decoration: underline; }

/* ── CTA band ────────────────────────────────────────────────────────── */
.cta { padding: 88px 0; text-align: center; }
.cta__title { font-size: clamp(28px, 5vw, 44px); font-weight: 800; }
.cta__lead { margin: 14px auto 0; max-width: 560px; color: var(--text-secondary); font-size: 17px; }
.cta .hero__buttons { margin-top: 28px; }

.store-badge { display: inline-block; }
.store-badge img { display: block; height: 54px; width: auto; }
.store-badge--lg img { height: 64px; }

/* ── Page head (sub-pages) ───────────────────────────────────────────── */
.pagehead {
  position: relative;
  padding: 64px 0 24px;
  text-align: center;
}
.pagehead h1 { font-size: clamp(30px, 5.6vw, 46px); font-weight: 800; max-width: 780px; margin: 0 auto; }
.pagehead__lead {
  max-width: 640px;
  margin: 18px auto 0;
  color: var(--text-secondary);
  font-size: 17px;
}
.pagehead .hero__buttons { margin-top: 28px; }

.breadcrumb { font-size: 13px; color: var(--text-muted); margin: 0 0 24px; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--text-primary); }

/* ── Prose (article bodies + legal) ──────────────────────────────────── */
.prose { max-width: var(--maxw-narrow); margin: 0 auto; }
.prose h2 { font-size: 24px; font-weight: 700; margin: 40px 0 12px; }
.prose h3 { font-size: 18px; font-weight: 600; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--text-secondary); font-size: 16px; }
.prose ul { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose strong { color: var(--text-primary); }
.prose a { color: var(--accent); text-decoration: underline; }

.legal { padding: 56px 0 80px; }
.legal h1 { font-size: clamp(30px, 6vw, 44px); font-weight: 800; margin-bottom: 8px; }
.legal .updated { color: var(--text-muted); font-size: 13px; margin: 0 0 32px; }

/* ── Related links ───────────────────────────────────────────────────── */
.related {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}
@media (max-width: 720px) { .related { grid-template-columns: 1fr; } }
.related a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 18px 20px;
  transition: background 0.12s ease;
}
.related a:hover { background: var(--surface-2); }
.related strong { font-size: 15px; }
.related span { font-size: 13px; color: var(--text-secondary); }

/* ── Footer ──────────────────────────────────────────────────────────── */
.footer { padding: 64px 0 40px; background: var(--bg-elevated); }
.footer__inner {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.footer__brand { max-width: 360px; }
.footer__brand p { font-size: 14px; color: var(--text-secondary); margin: 12px 0 0; }
.footer__links { display: flex; gap: 56px; flex-wrap: wrap; }
.footer__links > div { display: flex; flex-direction: column; gap: 8px; min-width: 140px; }
.footer__heading {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 4px;
}
.footer__links a { font-size: 14px; color: var(--text-secondary); }
.footer__links a:hover { color: var(--text-primary); }
.footer__bottom {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--separator);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}
.footer__bottom a { color: var(--text-secondary); }

/* ── Theme-dependent screenshot swap ─────────────────────────────────────
   Works with auto (prefers-color-scheme) AND the manual toggle. Lives LAST
   so it wins the cascade over `.phone img { display: block }`. */
img.shot--light { display: none !important; }
img.shot--dark { display: block !important; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) img.shot--dark { display: none !important; }
  :root:not([data-theme="dark"]) img.shot--light { display: block !important; }
}
:root[data-theme="light"] img.shot--dark { display: none !important; }
:root[data-theme="light"] img.shot--light { display: block !important; }
