/* ──────────────────────────────────────────────────────────────────────
 * SurfCheck — Global homepage (v2)
 * Loaded by index.html only. Tokens only — every color/font here comes
 * from brand.css's :root / [data-theme="light"] block (D-001, D-008).
 * No raw hex, no border-radius anywhere in this file.
 * ────────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { background: var(--void); color: var(--foam); font-family: var(--fb); line-height: 1.55; min-height: 100vh; }
a { color: inherit; }

.home-page { max-width: 1200px; margin: 0 auto; padding: 0 var(--pad) 48px; }

/* ── Hero ── */
.home-hero { padding: 48px 0 32px; text-align: center; }
.home-h1 {
  font-family: var(--fd); font-weight: 700; letter-spacing: 0.01em;
  font-size: clamp(2rem, 6vw, 3.4rem); color: var(--foam); line-height: 1.15;
}
.home-h1-line2 { color: var(--tidal); }
.home-coverage-line {
  font-family: var(--fm); font-size: 0.78rem; font-weight: 600; color: var(--mist);
  letter-spacing: 0.08em; margin-top: 16px;
}
.home-subcopy {
  font-family: var(--fb); font-size: 1rem; color: var(--fog);
  max-width: 56ch; margin: 14px auto 0; line-height: 1.6;
}

/* ── Search ── */
.home-search { position: relative; max-width: 420px; margin: 28px auto 0; }
.home-search-input {
  width: 100%; font-family: var(--fb); font-size: 0.95rem; color: var(--foam);
  background: var(--surface); border: 1px solid var(--border-dim);
  padding: 12px 16px; outline: none; transition: border-color 0.15s;
}
.home-search-input:focus { border-color: var(--tidal); }
.home-search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20;
  background: var(--surface); border: 1px solid var(--border);
  text-align: left; max-height: 320px; overflow-y: auto;
}
.home-search-row {
  display: block; padding: 10px 16px; font-family: var(--fb); font-size: 0.88rem;
  color: var(--foam); text-decoration: none; border-bottom: 1px solid var(--border-dim);
}
.home-search-row:last-child { border-bottom: none; }
.home-search-row:hover, .home-search-row.active { background: var(--raised); color: var(--tidal); }
.home-search-row .region { color: var(--fog); font-family: var(--fm); font-size: 0.72rem; }
.home-search-empty { padding: 10px 16px; font-family: var(--fm); font-size: 0.78rem; color: var(--fog); }

/* ── Stat strip ── */
.home-stat-strip {
  display: flex; justify-content: center; gap: 28px; flex-wrap: wrap;
  margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border-dim);
}
.home-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.home-stat-n { font-family: var(--fd); font-weight: 800; font-size: 1.3rem; color: var(--tidal); }
.home-stat-l { font-family: var(--fm); font-size: 0.65rem; color: var(--mist); text-transform: uppercase; letter-spacing: 0.08em; }

/* ── Shared section header ── */
.home-block-h {
  font-family: var(--fd); font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--foam);
  padding: 8px 16px; background: var(--abyss); line-height: 1;
}

/* ── Coverage map ── */
.home-map-section { margin: 28px 0; border: 1px solid var(--border-dim); }
.home-map { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; background: var(--abyss); }
.home-map-sea { fill: var(--abyss); }
.home-map-land { fill: var(--deep); stroke: var(--border-dim); stroke-width: 0.6; }
.home-map-grat { stroke: var(--border-dim); stroke-width: 0.4; opacity: 0.5; }
.home-map-dot { fill: var(--tidal); stroke: var(--void); stroke-width: 0.5; transition: r 0.1s; }
.home-map-dot-link:hover .home-map-dot { r: 4.2; }
.home-map-label {
  font-family: var(--fd); font-size: 13px; font-weight: 700; fill: var(--foam);
  letter-spacing: 0.06em; text-transform: uppercase; transition: fill 0.15s;
}
.home-map-label-link:hover .home-map-label { fill: var(--tidal); }

/* ── Leaderboard ── */
.home-leaderboard { margin: 28px 0; border: 1px solid var(--border-dim); }
.home-leaderboard-list { background: var(--surface); }
.home-lb-row {
  display: grid; grid-template-columns: 28px 1fr auto auto; align-items: center; gap: 12px;
  padding: 10px 16px; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--border-dim); transition: background 0.15s;
}
.home-lb-row:last-child { border-bottom: none; }
.home-lb-row:hover { background: var(--raised); }
.home-lb-rank { font-family: var(--fm); font-size: 0.75rem; color: var(--fog); }
.home-lb-name { font-family: var(--fd); font-weight: 700; font-size: 0.9rem; color: var(--foam); }
.home-lb-region { font-family: var(--fm); font-size: 0.68rem; color: var(--mist); display: block; margin-top: 1px; }
.home-lb-height { font-family: var(--fd); font-weight: 700; font-size: 0.85rem; color: var(--foam); white-space: nowrap; }
.home-lb-score { font-family: var(--fd); font-weight: 800; font-size: 0.82rem; padding: 3px 9px; white-space: nowrap; }
.home-lb-score.go   { background: var(--tidal-glow); color: var(--tidal); }
.home-lb-score.fair { background: var(--amber-glow); color: var(--amber); }
.home-lb-score.bad  { background: var(--storm-glow); color: var(--storm); }
.home-lb-loading { padding: 16px; font-family: var(--fm); font-size: 0.78rem; color: var(--fog); }

/* ── Country rows ── */
.home-countries { margin: 28px 0; }
.home-country-row, .home-country-link {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px;
  text-decoration: none; color: inherit;
}
.home-country-row {
  background: var(--surface); border: 1px solid var(--border-dim);
  padding: 16px 18px; margin-bottom: 10px;
  transition: border-color 0.15s, background 0.15s;
}
a.home-country-row:hover { border-color: var(--tidal); background: var(--raised); }
.home-country-row-solo { padding: 0; overflow: hidden; }
.home-country-link { padding: 16px 18px; transition: background 0.15s; }
.home-country-row-solo .home-country-link:hover { background: var(--raised); }
.home-country-name { font-family: var(--fd); font-weight: 800; font-size: 1.2rem; color: var(--tidal); }
.home-country-meta { font-family: var(--fm); font-size: 0.75rem; color: var(--mist); }
.home-country-live { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.home-country-score { font-family: var(--fd); font-weight: 700; font-size: 0.8rem; padding: 3px 8px; }
.home-country-score.go   { background: var(--tidal-glow); color: var(--tidal); }
.home-country-score.fair { background: var(--amber-glow); color: var(--amber); }
.home-country-score.bad  { background: var(--storm-glow); color: var(--storm); }
.home-daystrip { display: flex; gap: 2px; }
.home-daystrip-cell { width: 22px; height: 8px; background: var(--border-dim); }
.home-daystrip-cell.go   { background: var(--tidal); }
.home-daystrip-cell.fair { background: var(--amber); }
.home-daystrip-cell.bad  { background: var(--storm); }

.home-county-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 18px 16px;
}
.home-county-chip {
  font-family: var(--fb); font-size: 0.78rem; font-weight: 500; color: var(--mist);
  background: var(--raised); border: 1px solid var(--border-dim);
  padding: 5px 11px; text-decoration: none; transition: color 0.15s, border-color 0.15s;
}
.home-county-chip:hover { color: var(--tidal); border-color: var(--tidal); }

/* ── Tools strip ── */
.home-tools { display: flex; gap: 10px; flex-wrap: wrap; margin: 28px 0; }
.home-tool-chip {
  flex: 1; min-width: 140px; display: flex; align-items: center; justify-content: space-between;
  font-family: var(--fb); font-size: 0.85rem; font-weight: 500; color: var(--foam);
  background: var(--surface); border: 1px solid var(--border-dim);
  padding: 12px 16px; text-decoration: none; transition: border-color 0.15s, color 0.15s;
}
.home-tool-chip:hover { border-color: var(--tidal); color: var(--tidal); }
.home-tool-chip .arrow { color: var(--fog); }

/* ── Footer credits ── */
.home-footer-credits {
  margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border-dim);
  font-family: var(--fm); font-size: 0.68rem; color: var(--fog); line-height: 1.7;
}
.home-footer-credits a { color: var(--mist); text-decoration: underline; text-decoration-color: var(--border); }
.home-footer-credits a:hover { color: var(--tidal); }

/* ── Responsive ── */
@media (max-width: 480px) {
  .home-page { padding: 0 14px 36px; }
  .home-hero { padding: 32px 0 24px; }
  .home-stat-strip { gap: 18px; }
  .home-lb-row { grid-template-columns: 20px 1fr auto; }
  .home-lb-height { display: none; }
}

@media (min-width: 700px) {
  .home-country-row-solo .home-county-chips { padding: 0 18px 18px; }
}
