/* TrueCFB site styles.
   Tokens and component rules come from the TrueCFB design system (tokens.json and components/bundle.css).
   The header band, nav, footer, links and prose rules at the end are the site's own additions. */

/* ---------- fonts (Latin subsets, from the design system) ---------- */
@font-face{font-family:"Barlow Condensed";font-weight:500;font-style:normal;font-display:swap;src:url("../fonts/barlow-condensed-latin-500-normal.woff2") format("woff2")}
@font-face{font-family:"Barlow Condensed";font-weight:600;font-style:normal;font-display:swap;src:url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2")}
@font-face{font-family:"Barlow Condensed";font-weight:700;font-style:normal;font-display:swap;src:url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2")}
@font-face{font-family:"IBM Plex Sans";font-weight:400;font-style:normal;font-display:swap;src:url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2")}
@font-face{font-family:"IBM Plex Sans";font-weight:500;font-style:normal;font-display:swap;src:url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2")}
@font-face{font-family:"IBM Plex Sans";font-weight:600;font-style:normal;font-display:swap;src:url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2")}

/* ---------- tokens ---------- */
:root{
  --bg:#f3f5f2; --panel:#ffffff; --chip:#e9eeea; --line:#d9dfd9; --ink:#17201b; --muted:#5d6b63;
  --accent:#1f6b45; --accent-ink:#ffffff; --up:#1d5fa8; --down:#b0561a;
  --font-display:"Barlow Condensed","Arial Narrow",Arial,sans-serif;
  --font-body:"IBM Plex Sans",system-ui,-apple-system,"Segoe UI",sans-serif;
  --space-4:4px; --space-6:6px; --space-8:8px; --space-10:10px; --space-12:12px; --space-14:14px;
  --space-16:16px; --space-18:18px; --space-20:20px; --space-48:48px;
  --radius-sm:4px; --radius-md:8px; --radius-lg:10px; --radius-pill:999px;
  --page-max:860px; --measure:65ch;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#111613; --panel:#1a211d; --chip:#242d28; --line:#2c3630; --ink:#e8eee9; --muted:#9aa89f;
    --accent:#4fb37e; --accent-ink:#0c1410; --up:#7fb4ee; --down:#eaa066; color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#111613; --panel:#1a211d; --chip:#242d28; --line:#2c3630; --ink:#e8eee9; --muted:#9aa89f;
  --accent:#4fb37e; --accent-ink:#0c1410; --up:#7fb4ee; --down:#eaa066; color-scheme:dark;
}

/* ---------- components (design system) ---------- */
*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--bg);color:var(--ink);font-family:var(--font-body);font-size:15px;line-height:1.45;-webkit-text-size-adjust:100%}

.page{max-width:var(--page-max);margin:0 auto;padding:var(--space-20) var(--space-16) var(--space-48);display:flex;flex-direction:column;gap:var(--space-18)}
h1{font-family:var(--font-display);font-weight:700;font-size:34px;line-height:1.05;margin:0;letter-spacing:.01em;text-wrap:balance}
h2{font-family:var(--font-display);font-weight:600;font-size:21px;letter-spacing:.04em;text-transform:uppercase;margin:0}
.sub{color:var(--muted);margin:var(--space-6) 0 0}
.note{color:var(--muted);font-size:13px;margin:0}
.legend{color:var(--muted);font-size:13px;display:flex;flex-wrap:wrap;gap:var(--space-6) var(--space-16)}
.lab{font-family:var(--font-display);font-weight:600;font-size:15px;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}

.wordmark{font-family:var(--font-display);font-weight:700;line-height:1;letter-spacing:0;color:var(--ink);white-space:nowrap}
.wordmark b{font-weight:inherit;color:var(--accent)}
.wordmark.on-accent,.wordmark.on-accent b{color:var(--accent-ink)}

.panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-lg);padding:var(--space-14);display:flex;flex-direction:column;gap:var(--space-10)}
.controls{flex-direction:row;flex-wrap:wrap;gap:var(--space-12)}

.field{display:flex;flex-direction:column;gap:var(--space-4);flex:1 1 160px;min-width:0}
.panel:not(.controls) > .field{flex:none}
.field label{font-family:var(--font-display);font-weight:600;font-size:15px;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
select{font:inherit;font-weight:500;padding:9px 10px;border-radius:var(--radius-md);border:1px solid var(--line);background:var(--chip);color:var(--ink);width:100%}
input[type=range]{width:100%;accent-color:var(--accent)}
select:focus-visible,input:focus-visible,.seg button:focus-visible,a:focus-visible{outline:2px solid var(--up);outline-offset:2px}

.seg{display:flex;flex-wrap:wrap;gap:var(--space-6)}
.seg button{font:inherit;font-weight:500;padding:8px 14px;border-radius:var(--radius-md);border:1px solid var(--line);background:var(--chip);color:var(--ink);cursor:pointer}
.seg button[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}

.readouts{display:grid;grid-template-columns:repeat(2,1fr);gap:var(--space-10)}
.read{display:flex;flex-direction:column;gap:2px}
.read b{font-family:var(--font-display);font-weight:700;font-size:28px;line-height:1;font-variant-numeric:tabular-nums}
.read span{color:var(--muted);font-size:13px}
.quick{display:grid;grid-template-columns:repeat(4,1fr);gap:var(--space-8)}
.quick div{background:var(--chip);border-radius:var(--radius-md);padding:var(--space-8);display:flex;flex-direction:column;gap:2px}
.quick b{font-family:var(--font-display);font-size:22px;line-height:1;font-variant-numeric:tabular-nums}
.quick span{font-size:12px;color:var(--muted)}

.tablewrap{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-lg);overflow-x:auto}
.panel .tablewrap{border:0;border-radius:0}
table{border-collapse:collapse;width:100%;font-variant-numeric:tabular-nums}
th,td{padding:var(--space-8) var(--space-10);text-align:right;border-bottom:1px solid var(--line);white-space:nowrap}
th{font-family:var(--font-display);font-weight:600;font-size:15px;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
.t-rank th:nth-child(2),.t-rank td:nth-child(2),.t-left th:first-child,.t-left td:first-child{text-align:left;white-space:normal}
tbody tr:last-child td{border-bottom:0}
td.rk{font-family:var(--font-display);font-weight:700;font-size:19px;width:1%}
td.rt{font-weight:600}
.rec{color:var(--muted);font-size:13px;margin-left:var(--space-6);white-space:nowrap}
.sub2{display:block;color:var(--muted);font-size:12px}
.nr{color:var(--muted)}

.gap{display:inline-block;min-width:34px;margin-left:var(--space-6);padding:1px 6px;border-radius:var(--radius-pill);font-size:12px;font-weight:600;background:var(--chip);text-align:center;font-variant-numeric:tabular-nums}
.gap.up{color:var(--up)} .gap.down{color:var(--down)} .gap.same{color:var(--muted)}

/* History chart: one rating line across every season, with a data label for the week under the pointer */
.hc{position:relative}
.hc-plot{border-radius:var(--radius-sm);touch-action:pan-y;cursor:crosshair;-webkit-tap-highlight-color:transparent}
.hc-plot:focus-visible{outline:2px solid var(--up);outline-offset:2px}
.hc-plot svg{display:block;width:100%;height:auto}
.hc-sel{fill:var(--chip)}
.hc-ctx{fill:none;stroke:var(--muted);stroke-width:1;stroke-linejoin:round;opacity:.3}
.hc-line{fill:none;stroke:var(--accent);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.hc-cross{stroke:var(--muted);stroke-width:1}
.hc-dot{fill:var(--accent);stroke:var(--panel);stroke-width:2}
.axis.hc-on{fill:var(--ink);font-weight:600}
.hc-tip{position:absolute;z-index:2;width:max-content;max-width:270px;pointer-events:none;background:var(--panel);border:1px solid var(--muted);border-radius:var(--radius-md);padding:var(--space-8) var(--space-10);display:flex;flex-direction:column;gap:var(--space-6);font-size:13px;font-variant-numeric:tabular-nums}
.hc-h{font-family:var(--font-display);font-weight:600;font-size:15px;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
.hc-v{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 var(--space-6)}
.hc-v b{font-family:var(--font-display);font-weight:700;font-size:26px;line-height:1}
.hc-v .gap{margin-left:0}
.hc-k,.hc-s{color:var(--muted)}
.hc-s{font-size:12px}
.hc-g{font-weight:500}
.hc-g .hc-s{font-weight:400}
/* On a phone the label sits under the chart, so a thumb never covers it */
.hc-narrow .hc-tip{position:static;width:auto;max-width:none;pointer-events:auto;border:0;background:var(--chip);min-height:118px;margin-top:var(--space-8)}
/* Top 25 chart: one line per team, in the team's colour, with its name at the end of the line */
.rk-line{fill:none;stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.rk-line:not([stroke]){stroke:var(--accent)}
.rk-end:not([fill]){fill:var(--accent)}
.rk-name{fill:var(--ink);font-family:var(--font-body);font-size:12px}
.rk a{text-decoration:none}
.rk a:hover .rk-name,.rk a:focus-visible .rk-name{text-decoration:underline}
.rk-mark{stroke:var(--panel);stroke-width:2;color:var(--accent)}
.rk-dim .rk-line,.rk-dim .rk-end{opacity:.14}
.rk-dim .rk-line.on,.rk-dim .rk-end.on{opacity:1}
.rk-dim .rk-line.on{stroke-width:3.5}
.rk-dim .rk-name{fill:var(--muted)}
.rk-dim .rk-name.on{fill:var(--ink);font-weight:600}
.hc-narrow .rk + .hc-tip{min-height:84px}
.hc-key{display:inline-block;width:18px;height:2px;border-radius:1px;background:var(--accent);vertical-align:middle;margin-right:var(--space-6)}
.hc-key.ctx{height:1px;background:var(--muted);opacity:.5}

.grid{stroke:var(--line);stroke-width:1}
.axis{fill:var(--muted);font-family:var(--font-body);font-size:12px}
.lw{fill:none;stroke:var(--accent);stroke-width:3;stroke-linejoin:round}
.ll{fill:none;stroke:var(--down);stroke-width:3;stroke-linejoin:round}
.tw{fill:var(--accent);font-family:var(--font-body);font-size:13px;font-weight:600}
.tl{fill:var(--down);font-family:var(--font-body);font-size:13px;font-weight:600}

/* ---------- site additions ---------- */

[hidden]{display:none !important}
/* The name keeps its own capitals inside headings and labels that are set in capitals. */
.nm{text-transform:none}
.stack{display:flex;flex-direction:column;gap:var(--space-18)}

/* Header: the same green band as the share card, so the site and the posts match. */
.site-head{background:var(--accent);color:var(--accent-ink)}
.site-head .in{max-width:var(--page-max);margin:0 auto;padding:var(--space-12) var(--space-16);display:flex;align-items:center;justify-content:space-between;gap:var(--space-16);flex-wrap:wrap}
.site-head .home{display:inline-flex;text-decoration:none;border-radius:var(--radius-sm)}
.site-head .wordmark{font-size:30px}
.site-nav{display:flex;flex-wrap:wrap;gap:0 var(--space-18)}
.site-nav a{font-family:var(--font-display);font-weight:600;font-size:17px;letter-spacing:.05em;text-transform:uppercase;color:var(--accent-ink);text-decoration:none;padding:var(--space-4) 0;border-bottom:2px solid transparent}
.site-nav a:hover{border-bottom-color:var(--accent-ink)}
.site-nav a[aria-current="page"]{border-bottom-color:var(--accent-ink)}
.site-head a:focus-visible{outline-color:var(--accent-ink)}

/* Links: ink text with a green underline. Team names in tables keep a quiet underline. */
a{color:var(--ink);text-decoration:underline;text-decoration-color:var(--accent);text-decoration-thickness:1.5px;text-underline-offset:3px}
a:hover{text-decoration-thickness:2.5px}
a.tm{text-decoration-color:var(--line);text-decoration-thickness:1px}
a.tm:hover{text-decoration-color:var(--accent);text-decoration-thickness:1.5px}

/* A segmented control used as a field in a controls row */
.field .lab{font-size:15px}
.field .seg button{flex:1 1 auto;padding:9px 12px}

/* The team schedule: two-word column heads may wrap so the table fits a phone */
.t-games th{white-space:normal;line-height:1.15;vertical-align:bottom}
.t-games td{vertical-align:top}
.t-games .sub2 span{white-space:nowrap}
.t-games .sub2 .gap{margin-left:0;margin-right:var(--space-4)}

/* Poll comparison cells: the poll's rank, then how far TrueCFB is from it */
.pr{display:inline-block;min-width:2ch}

/* Rows that act as links (conference table) */
button.link{font:inherit;color:var(--ink);background:none;border:0;padding:0;cursor:pointer;text-align:left;text-decoration:underline;text-decoration-color:var(--line);text-decoration-thickness:1px;text-underline-offset:3px}
button.link:hover{text-decoration-color:var(--accent);text-decoration-thickness:1.5px}
button.link:focus-visible{outline:2px solid var(--up);outline-offset:2px}

/* Status line under a page title */
.status{font-family:var(--font-display);font-weight:600;font-size:17px;letter-spacing:.05em;text-transform:uppercase;color:var(--muted);margin:var(--space-8) 0 0}

/* Prose on the About page */
.prose{display:flex;flex-direction:column;gap:var(--space-10)}
.prose p{margin:0}
ol.rules,ul.plain{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:5px}
.calc{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-14)}
.calc .wide{grid-column:1/-1}
svg.chart{width:100%;height:auto;display:block;max-width:560px}
.cta{display:flex;flex-wrap:wrap;gap:var(--space-6) var(--space-16);align-items:baseline}

/* Footer */
.site-foot{border-top:1px solid var(--line)}
.site-foot .in{max-width:var(--page-max);margin:0 auto;padding:var(--space-18) var(--space-16) var(--space-48);display:flex;flex-direction:column;gap:var(--space-8)}
.site-foot .wordmark{font-size:22px}
.site-foot p{margin:0;color:var(--muted);font-size:13px}
.site-foot a{color:var(--muted)}

@media (max-width:520px){
  h1{font-size:29px}
  th,td{padding:7px 7px}
  .quick{grid-template-columns:repeat(2,1fr)}
  .calc{grid-template-columns:1fr}
  .site-head .in{padding-bottom:var(--space-8);gap:var(--space-4) var(--space-16)}
  .site-head .wordmark{font-size:26px}
  .site-nav{width:100%;gap:0 var(--space-14)}
  .site-nav a{font-size:15px;letter-spacing:.04em}
  /* Six columns on a phone: the record drops under the name and the poll's own rank is left out. */
  .t-rank.six .rec{display:block;margin-left:0}
  .t-rank.six .pr{display:none}
  .t-rank.six .gap{margin-left:0}
  .t-games th,.t-games td{padding-left:5px;padding-right:5px}
  .t-games th:first-child,.t-games td:first-child{padding-left:0}
  .t-games th:last-child,.t-games td:last-child{padding-right:0}
}
