/* ==========================================================================
   RUN IT BACK — shared design system (report + dashboard)
   ========================================================================== */
:root {
  /* brand */
  --navy-950: #060f1d;
  --navy-900: #0a1628;
  --navy-800: #0f2140;
  --navy-700: #183257;
  --navy-600: #25466f;
  --red: #d22b3f;
  --red-dark: #a91d30;
  --field: #1c6e47;
  --field-dark: #124a30;
  --gold: #e8a300;

  /* surfaces + ink */
  --paper: #f3f4f7;
  --card: #ffffff;
  --ink: #0d1726;
  --ink-2: #445066;
  --muted: #6b778c;
  --hair: #e3e6ec;
  --hair-2: #d3d8e1;
  --grid: #eceef2;
  --axis: #c3c9d4;

  /* position identity (validated: dataviz validate_palette, light surface) */
  --pos-qb: #2563c9;
  --pos-rb: #e0512b;
  --pos-wr: #12a071;
  --pos-te: #e8a300;
  --series: #183257;          /* single-series default: navy */
  --series-hi: #d22b3f;       /* highlight: red */
  --series-muted: #b9c2d0;

  /* type */
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* shape */
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-1: 0 1px 2px rgba(10, 22, 40, .06), 0 1px 1px rgba(10, 22, 40, .04);
  --shadow-2: 0 10px 30px -12px rgba(10, 22, 40, .25), 0 2px 6px rgba(10, 22, 40, .06);
  --maxw: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--navy-700); text-underline-offset: 3px; }
a:hover { color: var(--red); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.02; letter-spacing: .005em; margin: 0; }
p { margin: 0 0 1em; }
strong { font-weight: 650; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--red); color: #fff; padding: 8px 14px; border-radius: 6px; font-weight: 600; }
.skip-link:focus { top: 12px; color: #fff; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 4px; }

/* ------------------------------------------------------------------ nav */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(10, 22, 40, .94);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #fff;
}
.site-nav::after { /* thin red/white "stripe" under the bar */
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px;
  background: linear-gradient(90deg, var(--red) 0 33%, #fff 33% 34%, var(--navy-600) 34% 100%);
  opacity: .9;
}
.nav-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; margin-right: auto; }
.brand:hover { color: #fff; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-text { font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: .06em; text-transform: uppercase; line-height: 1; }
.brand-text small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 10.5px; letter-spacing: .14em; color: #9fb0c8; margin-top: 3px; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 8px 14px; border-radius: 8px;
  color: #c9d4e3; text-decoration: none; font-weight: 600; font-size: 14px; letter-spacing: .02em;
  position: relative; transition: color .2s, background .2s;
}
.nav-links a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav-links a[aria-current="page"], .nav-links a.is-active { color: #fff; }
.nav-links a[aria-current="page"]::after, .nav-links a.is-active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; background: var(--red); border-radius: 2px;
}
.nav-links .nav-cta { background: var(--red); color: #fff; margin-left: 8px; }
.nav-links .nav-cta:hover { background: var(--red-dark); }
.nav-links .nav-cta[aria-current="page"]::after { display: none; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; padding: 8px; cursor: pointer; border-radius: 8px; }
.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: calc(var(--nav-h) + 3px); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--navy-900); border-bottom: 1px solid rgba(255, 255, 255, .1);
    padding: 8px var(--gutter) 16px;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav-links.open { transform: none; opacity: 1; visibility: visible; }
  .nav-links a { padding: 14px 8px; border-bottom: 1px solid rgba(255, 255, 255, .06); font-size: 16px; }
  .nav-links a[aria-current="page"]::after, .nav-links a.is-active::after { left: 8px; right: auto; width: 32px; }
  .nav-links .nav-cta { margin: 12px 0 0; text-align: center; border-bottom: 0; }
  .brand-text small { display: none; }
}

/* ------------------------------------------------------------------ shared blocks */
.eyebrow {
  display: inline-block;
  font-family: var(--font-body); font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--red);
}
.eyebrow::before { content: ""; display: inline-block; vertical-align: middle; width: 18px; height: 3px; margin: -2px 8px 0 0; background: currentColor; border-radius: 2px; }
.card {
  background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 14px/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase;
  padding: 14px 22px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .15s, background .2s, color .2s, box-shadow .2s, border-color .2s;
}
.btn:active { transform: translateY(1px); }
.btn[hidden] { display: none; }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 8px 20px -8px rgba(210, 43, 63, .7); }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-ghost:hover { border-color: #fff; color: #fff; background: rgba(255, 255, 255, .06); }
.btn-outline { background: #fff; color: var(--navy-800); border-color: var(--hair-2); }
.btn-outline:hover { border-color: var(--navy-700); color: var(--navy-900); }

/* team + player identity */
.team-badge {
  --tc: var(--navy-700);
  display: inline-grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 1px solid var(--hair); position: relative; overflow: hidden;
}
.team-badge img { width: 82%; height: 82%; object-fit: contain; }
.team-badge .fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: var(--tc); color: #fff; font: 800 9px/1 var(--font-body); letter-spacing: .02em;
}
.team-badge.loaded .fallback { display: none; }
.avatar {
  --tc: var(--navy-700);
  width: 44px; height: 44px; border-radius: 50%; flex: none; position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--tc), var(--navy-900)); color: #fff;
  display: grid; place-items: center; font: 800 15px/1 var(--font-display); letter-spacing: .04em;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7), 0 0 0 1px var(--hair);
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; background: #e9edf3; opacity: 0; transition: opacity .3s; }
.avatar img.loaded { opacity: 1; }
.pos-pill {
  display: inline-block; font: 700 11px/1 var(--font-body); letter-spacing: .06em; padding: 4px 7px; border-radius: 5px;
  color: #fff; background: var(--navy-700);
}
.pos-pill.QB { background: var(--pos-qb); } .pos-pill.RB { background: #c4431f; }
.pos-pill.WR { background: #0d7f59; } .pos-pill.TE { background: #9a6c00; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }
.linekey { display: inline-block; width: 16px; height: 3px; border-radius: 2px; vertical-align: 3px; margin-right: 6px; }

/* ------------------------------------------------------------------ charts (shared) */
.chart { position: relative; width: 100%; min-height: 240px; }
.chart svg { display: block; overflow: visible; font-family: var(--font-body); }
.chart .grid line { stroke: var(--grid); shape-rendering: crispEdges; }
.chart .grid path { display: none; }
.chart .axis path, .chart .axis line { stroke: var(--axis); shape-rendering: crispEdges; }
.chart .axis text { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .axis-label { fill: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; }
.chart .dlabel { fill: var(--ink); font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.chart .dlabel.muted { fill: var(--ink-2); font-weight: 550; }
.chart .annot { fill: var(--ink-2); font-size: 12px; }
.chart .annot-line { stroke: var(--ink-2); stroke-width: 1; }
.chart .mark { transition: opacity .15s; }
.chart .mark:hover, .chart .mark.is-hover { opacity: .78; }
.chart .crosshair { stroke: var(--ink-2); stroke-width: 1; pointer-events: none; }
.chart .empty { fill: var(--muted); font-size: 14px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); margin: 0 0 10px; padding: 0; list-style: none; }
.chart-legend li { display: flex; align-items: center; }

.tooltip {
  position: fixed; z-index: 300; pointer-events: none;
  min-width: 140px; max-width: 280px;
  background: var(--navy-950); color: #fff; border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, .45);
  font-size: 13px; line-height: 1.35;
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.tooltip.show { opacity: 1; transform: none; }
.tooltip .tt-title { font-size: 11.5px; color: #9fb0c8; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 4px; }
.tooltip .tt-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.tooltip .tt-head .avatar { width: 38px; height: 38px; }
.tooltip .tt-name { font-weight: 700; font-size: 14px; }
.tooltip .tt-sub { color: #9fb0c8; font-size: 12px; }
.tooltip .tt-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.tooltip .tt-row b { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.tooltip .tt-row span { color: #c9d4e3; }

/* ------------------------------------------------------------------ ranked bars (HTML; used by both pages) */
.ranked { display: grid; gap: 3px; }
.rk-row { display: grid; grid-template-columns: 22px minmax(150px, 1.2fr) 2fr 72px; align-items: center; gap: 10px; padding: 3px 6px; border-radius: 8px; transition: background .15s; }
.rk-row:hover, .rk-row:focus-visible { background: var(--paper); }
.rk-row.clickable { cursor: pointer; }
.rk-row.clickable:active { transform: scale(.995); }
.rk-rank { font: 700 12px/1 var(--font-body); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.rk-id { display: flex; align-items: center; gap: 9px; min-width: 0; }
.rk-text { display: flex; flex-direction: column; min-width: 0; }
.rk-label { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-track { position: relative; height: 14px; }
.rk-bar { position: absolute; top: 0; bottom: 0; border-radius: 0 4px 4px 0; transition: width .6s cubic-bezier(.2, .7, .2, 1), left .6s, background .3s; }
.rk-val { font-size: 13px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.rk-row.is-hi .rk-label { color: var(--red); }
.rk-empty { color: var(--muted); padding: 30px 0; text-align: center; }
.ranked .team-badge { width: 22px; height: 22px; }
.ranked.players .avatar { width: 34px; height: 34px; font-size: 12px; }
@media (max-width: 520px) { .rk-row { grid-template-columns: 18px minmax(110px, 1fr) 1fr 58px; gap: 6px; } }


/* ------------------------------------------------------------------ motion switch (nav) */
.motion-toggle { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px solid rgba(255, 255, 255, .18); color: #c9d4e3; border-radius: 8px; padding: 7px 10px; font: 600 13px/1 var(--font-body); cursor: pointer; transition: border-color .2s, color .2s; }
.motion-toggle:hover { color: #fff; border-color: rgba(255, 255, 255, .45); }
.motion-toggle .mt-icon { width: 8px; height: 8px; border-radius: 50%; background: #5fd49b; box-shadow: 0 0 0 3px rgba(95, 212, 155, .2); }
.motion-toggle[aria-pressed="false"] .mt-icon { background: #7d889b; box-shadow: none; }
.motion-toggle .mt-state { color: #fff; }
@media (max-width: 820px) { .motion-toggle { width: 100%; justify-content: flex-start; padding: 14px 8px; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .06); border-radius: 0; font-size: 16px; } }

/* small tool buttons (both pages) */
.tool { font: 600 12.5px/1 var(--font-body); color: var(--ink-2); background: #fff; border: 1.5px solid var(--hair-2); border-radius: 9px; padding: 8px 12px; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.tool:hover { border-color: var(--navy-700); color: var(--ink); }
.tool[aria-pressed="true"] { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.tool.icon { width: 34px; padding: 8px 0; font-size: 16px; }
/* ------------------------------------------------------------------ footer */
.site-footer { background: var(--navy-950); color: #9fb0c8; padding: 48px 0 40px; font-size: 13.5px; margin-top: 0; }
.site-footer .foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer h4 { font: 700 12px/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: #fff; margin-bottom: 14px; }
.site-footer a { color: #c9d4e3; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer .brand-text { font-size: 22px; color: #fff; }
.site-footer .disclaimer { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 12px; color: #7d8ca3; }
@media (max-width: 760px) { .site-footer .foot-grid { grid-template-columns: 1fr; gap: 24px; } }

/* ------------------------------------------------------------------ motion */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
