/* ============================================================
   USMNT 2026 — "Matchday"
   Broadcast scoreboard meets longform journalism.
   ============================================================ */
:root {
  --ink:    #0B1622;
  --ink-2:  #0F1E2E;
  --ink-3:  #15293c;
  --chalk:  #EDEFE9;
  --muted:  #8597a8;
  --navy:   #1f4e85;
  --red:    #C8102E;
  --gold:   #E8B14B;
  --win:    #6fcf97;
  --loss:   #e0617a;
  --maxw: 720px;
  --display: "Saira Condensed", system-ui, sans-serif;
  --body: "Newsreader", Georgia, serif;
  --mono: "Spline Sans Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

/* ---------- Matchday spine ---------- */
.spine { position: fixed; left: 26px; top: 0; bottom: 0; width: 14px; z-index: 50; pointer-events: none; }
.spine__rail { position: absolute; top: 12vh; bottom: 12vh; left: 6px; width: 2px; background: rgba(255,255,255,.10); }
.spine__fill { position: absolute; top: 0; left: 0; width: 100%; height: 0; background: linear-gradient(var(--gold), var(--red)); }
.spine__marks { position: absolute; top: 12vh; bottom: 12vh; left: 0; margin: 0; padding: 0; list-style: none; width: 14px; }
.spine__marks li { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); border: 2px solid var(--muted); transform: translate(-1.5px,-50%); transition: background .3s, border-color .3s, box-shadow .3s; }
.spine__marks li.on { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 4px rgba(232,177,75,.18); }
@media (max-width: 880px) { .spine { display: none; } }

/* ---------- Shared type ---------- */
.kicker, .eyebrow, .chart__title, .chart__sub, .chart__legend, .live__meta, .live__updated, .foot, .table, .statrow {
  font-family: var(--mono);
}
.kicker, .eyebrow {
  font-size: 13px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 1.2rem;
}
.eyebrow { color: var(--muted); }

h1, h2, .band__head, .hero__title { font-family: var(--display); font-weight: 900; line-height: .98; letter-spacing: -.01em; }

section { padding: 14vh 28px; }
.band { max-width: var(--maxw); margin: 0 auto; }
.band--alt { max-width: 760px; }
.band__head { font-size: clamp(2.2rem, 6vw, 4rem); margin: 0 0 1.6rem; }
.prose p { margin: 0 0 1.1rem; }
.prose { color: #d7dee5; }

/* ---------- Hero ---------- */
.hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; max-width: 880px; margin: 0 auto; position: relative; background: linear-gradient(180deg, #0a1622 0%, #0d2036 52%, #0b1622 100%); }
.hero > * { position: relative; z-index: 2; }
/* Generated "stadium night" atmosphere — floodlight glow, crowd warmth, chalk line */
.hero::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; margin-left: -50vw; width: 100vw; z-index: 0;
  background:
    radial-gradient(90% 60% at 16% -8%, rgba(232,177,75,.22), transparent 46%),
    radial-gradient(90% 60% at 86% -10%, rgba(120,170,235,.18), transparent 48%),
    radial-gradient(150% 130% at 50% 128%, rgba(200,16,46,.12), transparent 56%),
    linear-gradient(180deg, rgba(8,16,24,.48) 0%, rgba(8,16,24,.62) 55%, rgba(8,16,24,.86) 100%),
    linear-gradient(180deg, transparent 87.5%, rgba(237,239,233,.16) 87.7%, transparent 88.4%),
    url("../assets/hero.jpg") center / cover no-repeat;
}
.hero::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; margin-left: -50vw; width: 100vw; z-index: 1; opacity: .55; pointer-events: none; mix-blend-mode: screen;
  background:
    linear-gradient(108deg, transparent 12%, rgba(232,177,75,.06) 18%, transparent 26%),
    linear-gradient(72deg, transparent 70%, rgba(160,200,255,.05) 78%, transparent 86%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/></svg>");
  background-size: cover, cover, 180px 180px;
}
.hero__title { font-size: clamp(5rem, 22vw, 16rem); margin: .1em 0 .2em; }
.hero__dek { font-size: clamp(1.1rem, 2.4vw, 1.5rem); max-width: 30ch; color: #cdd6df; }
.hero__cue { font-family: var(--mono); font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); margin-top: 3rem; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .hero__cue { animation: none; } }

/* Mobile hero: swap to the tall variant */
@media (max-width: 640px) {
  .hero::before {
    background:
      radial-gradient(90% 60% at 16% -8%, rgba(232,177,75,.22), transparent 46%),
      radial-gradient(90% 60% at 86% -10%, rgba(120,170,235,.18), transparent 48%),
      radial-gradient(150% 130% at 50% 128%, rgba(200,16,46,.12), transparent 56%),
      linear-gradient(180deg, rgba(8,16,24,.48) 0%, rgba(8,16,24,.62) 55%, rgba(8,16,24,.88) 100%),
      url("../assets/hero-mobile.jpg") center / cover no-repeat;
  }
}

/* Quiet full-bleed section textures (kept very low-contrast over the ink background) */
#moment, #arcIntro, #opener, #next { position: relative; }
#moment > *, #arcIntro > *, #opener > *, #next > * { position: relative; z-index: 1; }
#moment::before, #arcIntro::before, #opener::before, #next::before {
  content: ""; position: absolute; z-index: 0;
  top: 0; bottom: 0; left: 50%; margin-left: -50vw; width: 100vw;
  background: center / cover no-repeat; pointer-events: none;
  /* keep each texture inside its own section and fade the edges into the ink,
     so adjacent section backdrops never overlap or seam against the live card */
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 3rem, #000 calc(100% - 3rem), transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0, #000 3rem, #000 calc(100% - 3rem), transparent 100%);
}
#moment::before   { background-image: url("../assets/crowd.jpg");       opacity: .20; }
#arcIntro::before { background-image: url("../assets/tex-chalk.jpg");   opacity: .12; }
#opener::before   { background-image: url("../assets/celebration.jpg"); opacity: .15; }
#next::before     { background-image: url("../assets/tex-net.jpg");     opacity: .14; }

.hero__scoreline { display: inline-flex; align-items: center; gap: 14px; font-family: var(--mono); font-size: 14px; letter-spacing: .15em; color: var(--muted); border: 1px solid rgba(255,255,255,.12); border-radius: 4px; padding: 8px 14px; width: max-content; margin-bottom: 2.5rem; }
.hero__nums b { color: var(--chalk); font-size: 20px; }
.hero__nums i { color: var(--muted); padding: 0 3px; font-style: normal; }
.hero__status { color: var(--gold); border-left: 1px solid rgba(255,255,255,.12); padding-left: 12px; }

/* ---------- Stat rows ---------- */
.statrow, .opener__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap: 1px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.08); margin-top: 2rem; }
.statrow > div, .opener__stats > div { background: var(--ink); padding: 16px; }
.statrow .num, .opener__stats .num { font-family: var(--display); font-weight: 700; font-size: 2.1rem; color: var(--gold); display: block; line-height: 1; }
.statrow .lbl, .opener__stats .lbl { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 6px; display: block; }

/* ---------- Scrolly arc ---------- */
.scrolly { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0; max-width: 1180px; margin: 0 auto; padding: 6vh 28px; }
.scrolly__graphic { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; }
.chartwrap { width: 100%; }
.chart__title { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin: 0; }
.chart__sub { font-size: 12px; color: var(--muted); margin: 4px 0 10px; min-height: 1.2em; }
#arcChart { width: 100%; height: 56vh; display: block; }
.chart__legend { font-size: 12px; color: var(--muted); margin-top: 8px; }
.chart__legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 5px 0 14px; vertical-align: middle; }
.dot--w { background: var(--win); } .dot--d { background: var(--muted); } .dot--l { background: var(--loss); }

.scrolly__steps { padding-left: 6vw; }
.step { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; }
.step__card { background: var(--ink-2); border: 1px solid rgba(255,255,255,.08); border-left: 3px solid var(--muted); border-radius: 4px; padding: 22px 24px; opacity: .35; transform: translateY(8px); transition: opacity .4s, transform .4s, border-color .4s; }
.step.is-active .step__card { opacity: 1; transform: none; border-left-color: var(--gold); }
.step__phase { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0 0 8px; }
.step__card h3 { font-family: var(--display); font-weight: 700; font-size: 1.7rem; margin: 0 0 .5rem; line-height: 1; }
.step__card p { margin: 0; font-size: 1rem; color: #cdd6df; }
@media (max-width: 880px) {
  .scrolly { grid-template-columns: 1fr; }
  .scrolly__graphic { position: sticky; height: 52vh; top: 0; background: var(--ink); z-index: 5; box-shadow: 0 12px 24px var(--ink); }
  .scrolly__steps { padding-left: 0; }
  .step { min-height: 70vh; }
}

/* ---------- Cards (key players) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 14px; margin-top: 2rem; }
.card { background: var(--ink-2); border: 1px solid rgba(255,255,255,.08); border-radius: 5px; padding: 18px; }
.card__tag { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.card__name { font-family: var(--display); font-weight: 700; font-size: 1.5rem; margin: 4px 0 2px; line-height: 1; }
.card__club { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.card__blurb { font-size: .95rem; color: #cdd6df; margin: 10px 0 0; }
.card__stat { font-family: var(--mono); font-size: 12px; color: var(--chalk); margin-top: 10px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 8px; }

/* ---------- Opener ---------- */
.bigscore { font-family: var(--display); color: var(--gold); }
.opener { display: grid; grid-template-columns: 1.2fr 1fr; gap: 26px; margin-top: 2rem; }
@media (max-width: 700px) { .opener { grid-template-columns: 1fr; } }
.goals { list-style: none; margin: 0; padding: 0; }
.goals li { display: grid; grid-template-columns: 54px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.goals .min { font-family: var(--mono); color: var(--gold); font-weight: 600; }
.goals .who { font-family: var(--display); font-weight: 600; font-size: 1.25rem; line-height: 1; }
.goals .det { font-size: .9rem; color: var(--muted); display: block; margin-top: 3px; font-family: var(--mono); }

/* ---------- Live ---------- */
.live { max-width: 760px; margin: 0 auto; border: 1px solid rgba(232,177,75,.25); border-radius: 8px; background: linear-gradient(180deg, rgba(232,177,75,.05), rgba(11,22,34,0)); }
/* Completed-match cards in the archive: quieter than the live card, spaced when stacked */
#archiveMatches .live { margin-top: 1.5rem; padding: 2.2rem 28px; border-color: rgba(255,255,255,.10); background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(11,22,34,0)); }
#archiveMatches .live + .live { margin-top: 2rem; }
.live__head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.live__pill { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; padding: 4px 10px; border-radius: 100px; background: var(--ink-3); color: var(--muted); }
.live__pill.is-live { background: var(--red); color: #fff; animation: pulse 1.6s infinite; }
.live__pill.is-final { background: var(--gold); color: var(--ink); }
@keyframes pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .live__pill.is-live { animation: none; } }
.live__score { display: flex; align-items: center; gap: 20px; font-family: var(--display); margin: 1.4rem 0 .4rem; }
.live__t { font-weight: 700; font-size: clamp(1.6rem,5vw,2.6rem); color: var(--muted); }
.live__n { font-size: clamp(2.6rem,9vw,5rem); font-weight: 900; }
.live__n b { color: var(--chalk); } .live__n i { color: var(--muted); font-style: normal; padding: 0 6px; }
.live__meta { font-size: 13px; color: var(--muted); }
.live__lineup { font-family: var(--mono); font-size: 12.5px; color: #cdd6df; margin: .8rem 0 0; line-height: 1.7; }
.live__lineup b { color: var(--gold); letter-spacing: .1em; }
.timeline { list-style: none; margin: 1.6rem 0 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.08); }
.timeline .tmin { font-family: var(--mono); color: var(--gold); }
.timeline .tev { font-size: .98rem; }
.timeline .tev b { font-family: var(--display); font-weight: 600; }
.timeline--empty { color: var(--muted); font-family: var(--mono); font-size: 13px; padding: 16px 0; }
.live__updated { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 1.4rem; }

/* ---------- Table ---------- */
.table { width: 100%; border-collapse: collapse; margin-top: 1.6rem; font-size: 14px; }
.table th, .table td { text-align: right; padding: 9px 8px; border-bottom: 1px solid rgba(255,255,255,.08); }
.table th:first-child, .table td:first-child { text-align: left; }
.table thead th { color: var(--muted); font-weight: 500; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.table tr.us td { color: var(--gold); font-weight: 600; }

/* ---------- Footer ---------- */
.foot { max-width: var(--maxw); margin: 0 auto; color: var(--muted); font-size: 13px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 2rem; }
.foot code { color: var(--chalk); }
.foot__time { margin-top: .6rem; opacity: .7; }
