/* Pivotal DFS - one stylesheet, mobile-first. Colours from identity/logo.png; every text/background pair here
   meets WCAG AA (text 16.9:1, muted 9.3:1, lime 13.4:1, link blue 8.2:1 on --bg). */
:root {
  --bg: #070b14;
  --surface: #0f1a2e;
  --surface-2: #14233d;
  --line: #22324f;
  --text: #e9eef5;
  --muted: #a7b3c4;
  --lime: #7cf01e;
  --lime-ink: #070b14;
  --blue: #4d9bff;
  --link: #6ea8ff;
  --radius: 12px;
  --maxw: 72rem;
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.45rem, 1.25rem + 1vw, 2rem);
  --step-3: clamp(1.8rem, 1.45rem + 1.8vw, 2.8rem);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-size: var(--step-0); line-height: 1.6;
  background-image: radial-gradient(60rem 30rem at 85% -10%, rgba(77, 155, 255, 0.12), transparent 60%);
  background-repeat: no-repeat;
  /* footer sits at the bottom of the window on short pages, below the content on long ones */
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
}
body > main { flex: 1 0 auto; }
body > .site-footer { flex-shrink: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { color: var(--lime); }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; border-radius: 4px; }
.wrap { width: min(100% - 2rem, var(--maxw)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; background: var(--lime); color: var(--lime-ink); padding: 0.5rem 1rem; z-index: 10; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 5; background: rgba(7, 11, 20, 0.92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 3.6rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: 0.02em; white-space: nowrap; }
.brand img { width: 40px; height: 40px; }
.brand span b { color: var(--lime); }
.nav { margin-left: auto; display: flex; gap: 0.25rem 1rem; flex-wrap: wrap; font-size: var(--step--1); }
.nav a { color: var(--muted); text-decoration: none; padding: 0.4rem 0.2rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--lime); }
@media (max-width: 40rem) {
  /* phones: brand on top, one scrollable row of links underneath */
  .site-header .wrap { flex-wrap: wrap; gap: 0; padding-block: 0.4rem 0; }
  .nav { margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; gap: 1.1rem; padding-bottom: 0.3rem; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
}

/* layout pieces */
main { padding-block: 2rem 3rem; }
h1, h2, h3 { line-height: 1.2; margin: 1.6em 0 0.5em; }
h1 { font-size: var(--step-3); margin-top: 0.4em; }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.kicker { color: var(--lime); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--step--1); }

.hero { display: grid; gap: 1.5rem; align-items: center; padding-block: 1rem 2rem; }
.hero img { width: min(14rem, 60vw); margin-inline: auto; }
.hero h1 { margin: 0 0 0.4em; }
.hero p { font-size: var(--step-1); color: var(--muted); max-width: 38rem; }
.hero .kicker { color: var(--lime); font-size: var(--step--1); margin-bottom: 0.3rem; }
html, body { overflow-x: clip; }
@media (min-width: 48rem) { .hero { grid-template-columns: 16rem 1fr; } .hero img { margin: 0; } }

.button { display: inline-block; background: var(--lime); color: var(--lime-ink); font-weight: 800; padding: 0.7rem 1.2rem; border-radius: 999px; text-decoration: none; }
.button:hover { color: var(--lime-ink); filter: brightness(1.08); }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.card h3 { margin: 0; font-size: var(--step-1); }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--lime); }
.card .meta { color: var(--muted); font-size: var(--step--1); }
/* card thumbnail (the Rewind's perfect-lineup card): full-bleed on top of the card, same 1200:630 shape everywhere,
   so cards in a row stay equal height and tidy on phones and desktop */
.card.has-thumb { padding-top: 0; overflow: hidden; }
.card .thumb { display: block; margin: 0 -1.2rem 0.5rem; aspect-ratio: 1200 / 630; background: var(--line); }
.card .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card .muted { margin: 0; }
.empty { color: var(--muted); font-style: italic; }
.tag { display: inline-block; font-size: var(--step--1); font-weight: 700; color: var(--lime); border: 1px solid var(--lime); border-radius: 999px; padding: 0.05rem 0.6rem; }

/* article */
.article { max-width: 46rem; }
.article .meta { color: var(--muted); font-size: var(--step--1); margin-bottom: 1.5rem; }
.article figure { margin: 1.5rem 0; }
.article figcaption, .credit { color: var(--muted); font-size: var(--step--1); margin-top: 0.4rem; }
.crumbs { font-size: var(--step--1); color: var(--muted); margin-bottom: 0.5rem; }
.crumbs a { color: var(--muted); }
blockquote { margin: 1.5rem 0; padding: 0.6rem 1rem; border-left: 4px solid var(--lime); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; }
.updated { display: inline-block; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0.1rem 0.7rem; }

/* tables scroll sideways on phones instead of breaking the page */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.2rem 0; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; min-width: 32rem; font-size: var(--step--1); font-variant-numeric: tabular-nums; }
th, td { padding: 0.55rem 0.75rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--surface-2); color: var(--muted); font-weight: 700; position: sticky; top: 0; }
tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
td.num, th.num { text-align: right; }
/* a lineup's Total row (render_table "total_row") */
tfoot tr.total td { font-weight: 700; color: var(--text); background: var(--surface-2); border-top: 2px solid var(--line); border-bottom: 0; }

/* team badge: team colour + abbreviation (no logos); text colour picked in build.py for AA contrast */
.team-badge {
  display: inline-block; min-width: 2.9em; text-align: center; padding: 0.08em 0.45em; border-radius: 6px;
  background: var(--tb, var(--surface-2)); color: var(--tbt, var(--text)); font-weight: 800; font-size: 0.82em;
  letter-spacing: 0.03em; line-height: 1.5; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

/* draft preview */
.draft-banner { background: #f5c518; color: #0b0f17; font-weight: 800; text-align: center; padding: 0.5rem 1rem; }
.draft-banner.preview { background: var(--surface-2); color: var(--muted); font-weight: 600; }
.tag.draft { color: #f5c518; border-color: #f5c518; margin-left: 0.4rem; }

/* footer: one compact row (name, link groups, copyright) + one thin line of fine print; wraps to short lines */
.site-footer { border-top: 1px solid var(--line); padding-block: 0.9rem 1rem; color: var(--muted); font-size: 0.85rem; background: rgba(15, 26, 46, 0.35); }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--lime); text-decoration: underline; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 1.6rem; }
.site-footer .footer-mark { display: flex; align-items: center; gap: 0.45rem; color: var(--text); font-weight: 800; white-space: nowrap; }
.footer-mark img { width: 24px; height: 24px; }
.footer-mark b { color: var(--lime); }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.3rem 1.5rem; }
.footer-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.75rem; }
.footer-group ul { display: contents; list-style: none; margin: 0; padding: 0; }
.footer-group li { list-style: none; }
.footer-label { color: var(--text); font-weight: 700; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }
.site-footer .soon { opacity: 0.75; }
.footer-copy { margin-left: auto; white-space: nowrap; }
.footer-fine { margin: 0.5rem 0 0; font-size: 0.78rem; line-height: 1.45; }
.site-footer .footer-fine a { color: var(--lime); text-decoration: underline; }
@media (max-width: 40rem) {
  .footer-copy { order: 1; }
  .footer-links { order: 2; flex-basis: 100%; gap: 0.25rem 1rem; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* Stats page (/stats/): its styles are inline in the page (site/stats_page.py STYLE). */

/* Guides (/guides/, site/guides_page.py) */
.lead { font-size: var(--step-1); max-width: 46rem; }
.guide-jump { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; }
.guide-jump a { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 0.25rem 0.8rem; color: var(--text); text-decoration: none; font-size: var(--step--1); }
.guide-jump a:hover { border-color: var(--lime); color: var(--lime); }
.guide-cat { scroll-margin-top: 4.5rem; }
.guide-cat > h2 { margin-bottom: 0.2em; }
.more { font-weight: 700; }
.article.guide h2 { scroll-margin-top: 4.5rem; }
.article.guide ul, .article.guide ol { padding-left: 1.3rem; }
.article.guide li { margin-bottom: 0.35em; }
.guide-fig img { border-radius: var(--radius); border: 1px solid var(--line); }
.guide-fig figcaption .credit { display: inline; margin-left: 0.3rem; opacity: 0.85; }
.checked { font-size: var(--step--1); border-left: 3px solid var(--blue); padding-left: 0.7rem; }
.faq h3 { font-size: var(--step-0); margin: 1.2em 0 0.3em; }
.sources ul { padding-left: 1.2rem; font-size: var(--step--1); }
.responsible { margin: 2rem 0 0; padding: 0.8rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: var(--step--1); color: var(--muted); }
.responsible p { margin: 0; }
.responsible a { color: var(--lime); }
.learn { margin: 2rem 0 0; padding: 1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-width: 46rem; }
.learn h2 { font-size: var(--step-1); margin: 0 0 0.5rem; }
.learn ul { margin: 0 0 0.5rem; padding-left: 1.2rem; }
.learn li { margin-bottom: 0.3em; }
.learn p { margin: 0; font-size: var(--step--1); }
