/*
 * Theme layer — mirrors the app's design tokens (DESIGN.md / DESIGN-iOS.md).
 * Default is Dark (the app's always-dark identity, near-black surfaces);
 * a `prefers-color-scheme: light` visitor gets Citrus Wash. Both palettes are
 * pure CSS-variable swaps — no JS, no markup changes.
 */
:root {
  color-scheme: dark;
  /* Dark — app parity: near-black surfaces, neon-green accent, cream emphasis. */
  --bg: #0e0e0e;              /* background */
  --surface: #191919;        /* surfaceContainer — header / hero / footer band */
  --surface-elevated: #1f1f1f; /* surfaceContainerHigh — callout cards */
  --ink: #ffffff;            /* onSurface */
  --strong: #f3ffca;         /* primary (cream) — emphasis text */
  --muted: #ababab;          /* onSurfaceVariant */
  --accent: #ccff00;         /* primaryContainer — links / accent text */
  --accent-fill: #ccff00;    /* neon fill behind dark text (the hero pill) */
  --on-accent-fill: #4a5e00; /* onPrimaryContainer */
  --rule: rgba(72, 72, 72, 0.45); /* outlineVariant hairline */
  --amber: #f0c040;          /* overtimeAmber — the one stoppage signal */
  --glow: rgba(204, 255, 0, 0.55);  /* neon clock glow */
  --glow-amber: rgba(240, 192, 64, 0.5);
  --hero-glow: rgba(204, 255, 0, 0.16); /* radial atmosphere behind the hero */
  --header-bg: rgba(20, 20, 20, 0.72);  /* glassy sticky nav */
  --max: 1080px;
  --measure: 720px;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    /* Citrus Wash — neon is illegible on pale citrus, so accent text goes olive. */
    --bg: #f6f8df;              /* appBackground */
    --surface: #eef2c8;        /* cardSurfaceElevated — header / hero / footer band */
    --surface-elevated: #fdfef0; /* cardSurface — callout cards */
    --ink: #1a1d0c;            /* onSurface */
    --strong: #43560a;         /* accentFg — emphasis text */
    --muted: #565942;          /* metadataText */
    --accent: #43560a;         /* accentFg — links readable on light */
    --accent-fill: #ccff00;    /* accentFill — neon pill stays */
    --on-accent-fill: #1a2200; /* onAccentFill */
    --rule: rgba(26, 29, 12, 0.10); /* cardBorder */
    --amber: #9a6a12;
    --hero-glow: rgba(126, 168, 10, 0.22);
    --header-bg: rgba(238, 242, 200, 0.78);
  }
}

/* Self-hosted Space Grotesk (the app typeface) — variable, latin subset.
   Self-hosted on purpose: a no-third-parties brand shouldn't phone Google Fonts. */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/space-grotesk-latin.woff2") format("woff2");
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Space Grotesk", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* Scroll-reveal — only hidden when JS is present to reveal it. Without JS
   (disabled, failed load, non-executing crawler) content stays visible. */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.js .reveal.in { opacity: 1; transform: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 28px;
  border-radius: 999px;
  line-height: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent-fill);
  color: var(--on-accent-fill);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 34px rgba(204, 255, 0, 0.34);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 9px 18px;
  font-size: 14px;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* Header / nav — sticky, glassy, condenses on scroll */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: transparent;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.site-header.scrolled {
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--rule);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; display: block; }
.site-nav { margin-left: auto; display: flex; gap: 22px; align-items: center; font-size: 15px; }
.site-nav a:not(.btn) { color: var(--muted); }
.site-nav a:not(.btn):hover { color: var(--accent); text-decoration: none; }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(64px, 12vh, 130px) 0 clamp(72px, 12vh, 130px);
  border-bottom: 1px solid var(--rule);
}
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 78% 22%, var(--hero-glow), transparent 70%),
    radial-gradient(50% 40% at 8% 90%, var(--hero-glow), transparent 75%);
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.04;
  mix-blend-mode: overlay;
  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.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero-grid {
  position: relative;
  display: grid;
  gap: clamp(36px, 6vw, 72px);
  align-items: center;
}
@media (min-width: 880px) {
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; }
}
.hero-copy { text-align: center; }
@media (min-width: 880px) { .hero-copy { text-align: left; } }
.kicker {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(40px, 8vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0 0 20px;
}
.hero p.lede {
  font-size: clamp(18px, 2.2vw, 22px);
  color: var(--muted);
  max-width: 30ch;
  margin: 0 auto 34px;
}
@media (min-width: 880px) { .hero p.lede { margin-left: 0; } }
.cta { display: flex; flex-direction: column; align-items: center; gap: 12px; }
@media (min-width: 880px) { .cta { align-items: flex-start; } }
.cta-note { font-size: 14px; color: var(--muted); margin: 0; }

/* Hero visual — the live watch. Mirrors the app's running display
   (store-assets/screenshots/watch/live-match.png + added-time.png): a white
   count-UP clock that keeps its neon glow throughout, an ADDED TIME / BREAK card
   row, and a neon TOTAL card. The one amber signal lives on the ADDED TIME card
   (value + pulsing dot) once the period runs past its length — the clock stays
   white, matching the app. */
.hero-visual { display: flex; justify-content: center; }
.watch {
  position: relative;
  width: clamp(244px, 64vw, 300px);
  aspect-ratio: 0.82;
  border-radius: 34% / 28%;
  padding: 13px;
  background: linear-gradient(160deg, #243d08, #0c1503);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.55),
    0 0 60px var(--hero-glow),
    inset 0 1px 1px rgba(255, 255, 255, 0.08);
}
.watch-screen {
  position: relative;
  height: 100%;
  border-radius: 28% / 24%;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: clamp(7px, 1.6vw, 10px);
  padding: clamp(14px, 4vw, 20px) clamp(13px, 3.4vw, 17px);
  overflow: hidden;
}
.w-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.w-pill {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: #1a2e05;
  padding: 3px 10px;
  border-radius: 999px;
}
.w-time {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}
.w-clock {
  text-align: center;
  font-size: clamp(42px, 11.5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  text-shadow: 0 0 24px var(--glow);
  line-height: 1;
  margin: 2px 0;
}
.w-row { display: flex; gap: 8px; }
.w-card {
  background: rgba(255, 255, 255, 0.05);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
}
.w-row .w-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 6px;
}
.w-card-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}
.w-card-val {
  font-size: clamp(15px, 4.4vw, 18px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: color 0.4s ease;
}
/* Resting palette: added time dim, break cream — the app's secondary readouts. */
.w-added .w-card-val { color: rgba(255, 255, 255, 0.5); }
.w-break .w-card-val { color: #e6dcb0; }
/* The one stoppage signal: ADDED TIME goes amber with a pulsing dot once the
   period runs long. */
.w-added-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.watch.added .w-added-dot { opacity: 1; animation: pulse 1.6s ease-in-out infinite; }
.watch.added .w-added .w-card-val { color: var(--amber); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
/* TOTAL — the running match total, neon, the brightest readout on the screen. */
.w-total {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
}
.w-total-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.w-total-val {
  margin-left: auto;
  font-size: clamp(26px, 7.5vw, 34px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  line-height: 1;
}
@media (prefers-reduced-motion: reduce) {
  .watch.added .w-added-dot { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* Section heading kicker */
.eyebrow {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 28px;
}

/* What it does — alternating feature rows. Each iPhone screen sits large beside
   the copy it proves; rows alternate side on wide viewports and stack
   image-under-text on narrow ones. */
.features { padding: clamp(56px, 9vh, 96px) 0; }
.feature-row {
  display: grid;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: clamp(36px, 6vh, 64px) 0;
}
.feature-row + .feature-row { border-top: 1px solid var(--rule); }
@media (min-width: 760px) {
  .feature-row { grid-template-columns: 1fr 1fr; }
  .feature-row.reversed .feature-text { order: 2; }
  .feature-row.reversed .feature-shot { order: 1; }
}
.feature-text h3 {
  margin: 0 0 12px;
  font-size: clamp(24px, 3.4vw, 32px);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.feature-text p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(17px, 1.7vw, 19px);
  max-width: 42ch;
}
.feature-shot { margin: 0; display: flex; justify-content: center; }
@media (min-width: 760px) {
  .feature-row:not(.reversed) .feature-shot { justify-content: flex-end; }
  .feature-row.reversed .feature-shot { justify-content: flex-start; }
}
.feature-shot img {
  display: block;
  width: clamp(240px, 64vw, 360px);
  height: auto;
  border-radius: 30px;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.5),
    0 0 0 1px var(--rule);
  transition: transform 0.3s ease;
}
.feature-row:hover .feature-shot img { transform: translateY(-6px); }

/* Privacy — a closing full-width statement, no UI to show. */
.privacy-band {
  padding: clamp(56px, 9vh, 96px) 0;
  border-top: 1px solid var(--rule);
  text-align: center;
}
.privacy-band h2 {
  margin: 0 0 14px;
  font-size: clamp(28px, 4.6vw, 44px);
  letter-spacing: -0.025em;
  color: var(--strong);
}
.privacy-band p {
  margin: 0 auto;
  max-width: 46ch;
  color: var(--muted);
  font-size: clamp(17px, 1.9vw, 20px);
}

/* Content pages */
.content { padding: 56px 0 80px; }
.content .wrap { max-width: var(--measure); }
.content h1 { font-size: clamp(34px, 6vw, 46px); letter-spacing: -0.025em; margin: 0 0 8px; }
.content .updated { color: var(--muted); font-size: 14px; margin: 0 0 36px; }
.content h2 { font-size: 23px; margin: 40px 0 12px; letter-spacing: -0.01em; }
.content h3 { font-size: 18px; margin: 28px 0 8px; }
.content p, .content li { color: var(--ink); }
.content ul { padding-left: 22px; }
.content li { margin: 6px 0; }
.content strong { color: var(--strong); }
.callout {
  border: 1px solid var(--rule);
  background: var(--surface-elevated);
  border-radius: 14px;
  padding: 18px 22px;
  margin: 28px 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout p:first-child { margin-top: 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--surface);
  padding: 32px 0;
  color: var(--muted);
  font-size: 14px;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.site-footer .spacer { margin-left: auto; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
