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

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

body {
  margin: 0;
  background:
    radial-gradient(120% 60% at 50% 0%, var(--aviator) 0%, transparent 60%),
    var(--navy);
  background-color: var(--navy);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--sky); text-underline-offset: 2px; }
a:hover { color: var(--white); }

/* jersey-hem stripes: navy / white / sky / white / navy, plus a red pinline */
.stripe {
  height: 14px;
  background: linear-gradient(
    to bottom,
    var(--sky) 0 4px,
    var(--white) 4px 6px,
    var(--aviator) 6px 11px,
    var(--red) 11px 14px
  );
}

.masthead {
  text-align: center;
  padding: 1.25rem 16px 0;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: 0.12em;
  color: var(--white);
  text-decoration: none;
}
.wordmark span { color: var(--sky); }

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

/* --- hero --- */

.hero {
  text-align: center;
  padding: 2.25rem 0 2.5rem;
}

.stamp {
  display: inline-block;
  margin: 0 0 1.25rem;
  padding: 0.2rem 0.7rem;
  border: 2px solid var(--red-bright);
  border-radius: 3px;
  color: var(--red-bright);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: rotate(-2deg);
}

.hero-label {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 4.5vw, 1.75rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ticker {
  margin: 0.25rem 0 0.25rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 12.5vw, 7.5rem); /* room for $X,XXX,XXX.XX at 375px */
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  color: var(--white);
  text-shadow: 0 4px 30px rgba(123, 175, 212, 0.35);
  white-space: nowrap;
}
.ticker .cents { color: var(--red-bright); }

.ticker-sub {
  margin: 0.5rem auto 0;
  max-width: 30ch;
  color: var(--text-muted);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 2rem 0 0;
}

.mini {
  display: flex;
  flex-direction: column;
  padding: 0.8rem 0.4rem;
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: 8px;
}

.mini-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 4.8vw, 1.7rem);
  font-variant-numeric: tabular-nums;
  color: var(--sky);
  line-height: 1.2;
}

.mini-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 0.2rem;
}

.season { margin: 1.75rem 0 0; }

.season-bar {
  height: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--surface-line);
  overflow: hidden;
}

.season-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--sky), var(--white));
  border-radius: 6px 0 0 6px;
}

.season-caption {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.season-caption strong { color: var(--white); font-weight: 600; }

.share-main {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 2rem;
  padding: 0.85rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--white);
  color: var(--navy);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.12s ease, background 0.12s ease;
}
.share-main:hover { background: var(--sky); }
.share-main:active { transform: scale(0.97); }
.share-main:focus-visible { outline: 3px solid var(--red-bright); outline-offset: 3px; }
.share-main svg { width: 1.15rem; height: 1.15rem; fill: currentColor; }

/* --- photo --- */

.photo {
  margin: 0 0 2.5rem;
}

.photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1400 / 1119;
  border-radius: 10px;
  border: 1px solid var(--surface-line);
  filter: saturate(0.85);
}

.photo figcaption {
  margin-top: 0.55rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.photo .credit { display: block; color: var(--silver); font-size: 0.78rem; }
.photo .credit a { color: var(--silver); }

/* --- equivalents --- */

.equiv {
  text-align: center;
  padding: 1.75rem 1rem;
  margin: 0 0 2.5rem;
  border-top: 1px solid var(--surface-line);
  border-bottom: 1px solid var(--surface-line);
}

.equiv h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--silver);
}

.equiv-line {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  line-height: 1.15;
  transition: opacity 0.35s ease;
}
.equiv-line.fading { opacity: 0; }
.equiv-num { color: var(--sky); font-variant-numeric: tabular-nums; }

.equiv-note {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--silver);
  transition: opacity 0.35s ease;
}
.equiv-note.fading { opacity: 0; }

.equiv-fx {
  margin: 0.9rem 0 0;
  font-size: 0.78rem;
  color: var(--silver);
  font-variant-numeric: tabular-nums;
}

/* --- open letter --- */

.letter {
  margin: 0 0 2.5rem;
}

.letter h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  line-height: 1.1;
  text-transform: uppercase;
}
.letter h2 span { display: block; color: var(--sky); }

.letter p { margin: 0 0 1rem; color: var(--text-muted); }
.letter .signoff {
  color: var(--white);
  font-weight: 600;
  border-left: 3px solid var(--red-bright);
  padding-left: 0.8rem;
}

/* --- share row (matches turnout_simulator) --- */

.share-section {
  margin: 0 0 2.5rem;
  text-align: center;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.share-label {
  flex-basis: 100%;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--silver);
  margin-bottom: 0.35rem;
}

.s-share {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border: 1px solid var(--surface-line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--white);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.s-share:hover,
.s-share:focus-visible {
  background: var(--sky);
  color: var(--navy);
  outline: none;
}
.s-share svg { width: 1.1rem; height: 1.1rem; fill: currentColor; }

.s-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--white);
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.s-share:hover .s-tip,
.s-share:focus-visible .s-tip,
.s-share.copied .s-tip { opacity: 1; }

.share-hint {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--silver);
}

/* --- footer --- */

.footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 16px 2.5rem;
  border-top: 1px solid var(--surface-line);
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--silver);
}
.footer p { margin: 0 0 0.75rem; }
.footer a { color: var(--silver); }
.footer a:hover { color: var(--white); }
.footer strong { color: var(--text-muted); }

/* --- toast (copy / share feedback) --- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 1rem);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--white);
  color: var(--navy);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 420px) {
  .mini-stats { gap: 0.4rem; }
  .mini-label { font-size: 0.72rem; }
}

@media (prefers-reduced-motion: reduce) {
  .equiv-line, .equiv-note, .share-main, .toast { transition: none; }
}
