/* BCYL - Belichick Your Line-Up. Broadsheet sports page x trading terminal. No external resources. */
:root {
  color-scheme: light;
  --page: #f9f9f7; --surface: #fcfcfb; --ink: #0b0b0b; --ink2: #52514e; --muted: #6f6d67;
  --grid: #e1e0d9; --axis: #c3c2b7; --border: rgba(11,11,11,.14); --wash: rgba(11,11,11,.05);
  --turf: #0f4d2e; --turf-ink: #f4f1e6; --chalk: #f4f1e6; --flag: #eda100;
  --up: #006300; --down: #b4282a; --up-icon: #0ca30c; --down-icon: #d03b3b;
  --s1:#2a78d6; --s2:#eb6834; --s3:#1baf7a; --s4:#eda100; --s5:#e87ba4; --s6:#008300; --s7:#6250d6; --s8:#e34948;
  --dim: #b9b7ae; --dim-text: #6f6d67;
  --div-pos: #2a78d6; --div-neg: #e34948; --div-mid: #f0efec; --heat-cap: 70%;
  --seq-1:#cde2fb; --seq-3:#9ec5f4; --seq-5:#5598e7; --seq-7:#256abf; --seq-9:#104281;
  --font-display: "Bahnschrift","DIN Condensed","Oswald","Impact","Haettenschweiler","Arial Narrow",sans-serif;
  --font-body: "Charter","Iowan Old Style","Palatino Linotype","Book Antiqua",Georgia,serif;
  --font-mono: ui-monospace,"SF Mono","JetBrains Mono",Menlo,Consolas,monospace;
  --font-ui: system-ui,-apple-system,"Segoe UI",sans-serif;
  --shadow: 0 1px 0 rgba(11,11,11,.06), 0 8px 24px -14px rgba(11,11,11,.25);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) { color-scheme: dark; --dark: 1; }
}
/* dark values declared under both scopes (OS preference + explicit toggle) */
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --page:#0d0d0d; --surface:#1a1a19; --ink:#f0efec; --ink2:#c3c2b7; --muted:#898781;
    --grid:#2c2c2a; --axis:#383835; --border:rgba(255,255,255,.12); --wash:rgba(255,255,255,.06);
    --turf:#0b2a1a; --turf-ink:#e9e6d6; --chalk:#e9e6d6;
    --up:#0ca30c; --down:#e66767; --up-icon:#0ca30c; --down-icon:#d03b3b;
    --s1:#3987e5; --s2:#d95926; --s3:#199e70; --s4:#c98500; --s5:#d55181; --s6:#008300; --s7:#9085e9; --s8:#e66767;
    --dim:#4b4a46; --dim-text:#898781;
    --div-pos:#1c5cab; --div-neg:#b32f2f; --div-mid:#383835; --heat-cap:100%;
    --seq-1:#184f95; --seq-3:#1c5cab; --seq-5:#2a78d6; --seq-7:#5598e7; --seq-9:#9ec5f4;
    --shadow: 0 1px 0 rgba(255,255,255,.04), 0 10px 28px -14px rgba(0,0,0,.8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page:#0d0d0d; --surface:#1a1a19; --ink:#f0efec; --ink2:#c3c2b7; --muted:#898781;
  --grid:#2c2c2a; --axis:#383835; --border:rgba(255,255,255,.12); --wash:rgba(255,255,255,.06);
  --turf:#0b2a1a; --turf-ink:#e9e6d6; --chalk:#e9e6d6;
  --up:#0ca30c; --down:#e66767; --up-icon:#0ca30c; --down-icon:#d03b3b;
  --s1:#3987e5; --s2:#d95926; --s3:#199e70; --s4:#c98500; --s5:#d55181; --s6:#008300; --s7:#9085e9; --s8:#e66767;
  --dim:#4b4a46; --dim-text:#898781;
  --div-pos:#1c5cab; --div-neg:#b32f2f; --div-mid:#383835; --heat-cap:100%;
  --seq-1:#184f95; --seq-3:#1c5cab; --seq-5:#2a78d6; --seq-7:#5598e7; --seq-9:#9ec5f4;
  --shadow: 0 1px 0 rgba(255,255,255,.04), 0 10px 28px -14px rgba(0,0,0,.8);
}

*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 16px/1.5 var(--font-body);
  background-image: radial-gradient(circle at 20% -10%, var(--wash), transparent 40%), repeating-linear-gradient(90deg, transparent 0 79px, var(--wash) 79px 80px);
  background-attachment: fixed;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--s1); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--page); padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono, td.n, th.n { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- masthead ---------- */
.masthead { background: var(--turf); color: var(--turf-ink); position: relative; border-bottom: 4px solid var(--flag); }
.masthead::before { /* yard lines */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .16;
  background: repeating-linear-gradient(90deg, transparent 0 59px, currentColor 59px 61px), repeating-linear-gradient(0deg, transparent 0 11px, currentColor 11px 12px);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 90%); mask-image: linear-gradient(180deg, #000, transparent 90%);
}
.masthead .wrap { position: relative; display: flex; flex-wrap: wrap; align-items: end; gap: 1rem 2rem; padding-top: 1.1rem; padding-bottom: .9rem; }
.brand { text-decoration: none; display: block; }
.brand small { display: block; font: 600 .72rem/1 var(--font-mono); letter-spacing: .22em; text-transform: uppercase; opacity: .85; }
.brand b { display: block; font: 800 clamp(1.9rem, 5.2vw, 3.3rem)/.92 var(--font-display); letter-spacing: .01em; text-transform: uppercase; margin-top: .2rem; }
.brand b i { font-style: normal; color: var(--flag); }
.navbar { position: relative; border-top: 1px solid color-mix(in srgb, var(--turf-ink) 30%, transparent); background: color-mix(in srgb, #000 18%, var(--turf)); }
.navbar .wrap { padding-block: .35rem; }
.nav { display: flex; flex-wrap: nowrap; gap: .25rem; align-items: center; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a, .nav button { white-space: nowrap; flex: none; }
.nav button { margin-left: auto; }
.nav a, .nav button {
  font: 700 .9rem/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  color: var(--turf-ink); padding: .6rem .8rem; border: 1px solid transparent; border-radius: 2px; background: none; cursor: pointer;
}
.nav a:hover, .nav button:hover { border-color: currentColor; }
.nav a[aria-current="page"] { background: var(--turf-ink); color: var(--turf); }
.nav button { border-color: color-mix(in srgb, var(--turf-ink) 45%, transparent); }
.nav :focus-visible, .ticker :focus-visible { outline-color: var(--flag); }

.ticker { background: #0b0b0b; color: #f0efec; overflow: hidden; border-bottom: 1px solid #000; font: 600 .82rem/1 var(--font-mono); }
.ticker-track { display: flex; width: max-content; animation: tick 60s linear infinite; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
.ticker ul { display: flex; margin: 0; padding: 0; list-style: none; }
.ticker li { padding: .6rem 1.4rem; white-space: nowrap; border-right: 1px solid #2c2c2a; }
.ticker .sym { color: #c3c2b7; letter-spacing: .08em; margin-right: .5em; }
.ticker .up { color: #0ca30c; } .ticker .dn { color: #ec835a; }
@keyframes tick { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker { overflow-x: auto; } .ticker-track { animation: none; } .ticker-track ul[aria-hidden] { display: none; } }

/* ---------- layout ---------- */
.wrap { width: min(1200px, 100% - 2rem); margin-inline: auto; }
main { padding-block: 1.6rem 3rem; }
.lede { max-width: 62ch; color: var(--ink2); margin: 0 0 1.4rem; font-size: 1.05rem; }
h1, h2, h3 { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .03em; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: .6rem; }
h2 { font-size: 1.5rem; display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
h2 .tag { font: 600 .72rem/1 var(--font-mono); letter-spacing: .14em; color: var(--muted); }
h3 { font-size: 1.1rem; letter-spacing: .06em; }
.panel { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--ink); border-radius: 2px; padding: 1.1rem 1.2rem 1.2rem; margin: 0 0 1.6rem; box-shadow: var(--shadow); }
.panel > header { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; align-items: baseline; justify-content: space-between; margin-bottom: .9rem; }
.panel > header p { margin: 0; color: var(--ink2); font-size: .9rem; max-width: 60ch; }
.grid2 { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid2 > .panel { margin: 0; }
.note { font: .82rem/1.45 var(--font-ui); color: var(--ink2); }
.badge { display: inline-block; font: 700 .7rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; padding: .3rem .5rem; border: 1.5px solid currentColor; border-radius: 2px; }
.notice { border-left: 5px solid var(--flag); background: var(--wash); padding: .7rem 1rem; margin: 0 0 1.4rem; font: .9rem/1.45 var(--font-ui); }
.notice b { font-family: var(--font-display); letter-spacing: .08em; text-transform: uppercase; }

/* ---------- controls ---------- */
.controls { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; align-items: center; margin-bottom: 1rem; font: .9rem var(--font-ui); }
.controls label { font: 700 .72rem/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: .5rem; }
select, .btn, .seg button {
  font: 600 .9rem/1.1 var(--font-ui); color: var(--ink); background: var(--surface); border: 1px solid var(--ink2); border-radius: 2px; padding: .5rem .7rem; min-height: 40px; cursor: pointer;
}
.seg { display: inline-flex; }
.seg button { border-radius: 0; margin-left: -1px; }
.seg button:first-child { border-radius: 2px 0 0 2px; margin-left: 0; }
.seg button:last-child { border-radius: 0 2px 2px 0; }
.seg button[aria-pressed="true"], .btn[aria-pressed="true"] { background: var(--ink); color: var(--page); }
.weeknav { display: flex; gap: .3rem; flex-wrap: wrap; }
.weeknav button { min-width: 44px; font-family: var(--font-mono); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 .8rem; }
.chip { display: inline-flex; align-items: center; gap: .45rem; font: 600 .8rem/1 var(--font-ui); padding: .45rem .65rem; min-height: 36px; background: var(--surface); color: var(--ink2); border: 1px solid var(--axis); border-radius: 999px; cursor: pointer; }
.chip i { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--dim); }
.chip[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); background: var(--wash); }
.chip[aria-pressed="true"] i { border-top-width: 3px; }

/* ---------- tables ---------- */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { border-collapse: collapse; width: 100%; font: .88rem/1.25 var(--font-ui); }
table.data caption { text-align: left; font: 600 .78rem var(--font-ui); color: var(--ink2); padding-bottom: .4rem; }
table.data th { font: 700 .68rem/1.1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: left; padding: .5rem .55rem; border-bottom: 2px solid var(--ink); white-space: nowrap; vertical-align: bottom; }
table.data td { padding: .55rem .55rem; border-bottom: 1px solid var(--grid); white-space: nowrap; }
table.data td.wrapok { white-space: normal; min-width: 14ch; }
table.data .n { text-align: right; }
table.data tbody tr:hover { background: var(--wash); }
table.data th button { all: unset; cursor: pointer; display: inline-flex; gap: .3em; align-items: center; text-transform: inherit; letter-spacing: inherit; }
table.data th button:focus-visible { outline: 3px solid var(--s1); }
table.data th[aria-sort] button::after { content: "\25B2"; font-size: .6rem; }
table.data th[aria-sort="descending"] button::after { content: "\25BC"; }
table.data td.rank { font: 800 1.5rem/1 var(--font-display); width: 3rem; }
table.data td.who b { display: block; font-size: .95rem; }
table.data td.who span { color: var(--muted); font-size: .78rem; }
.mv { font: 700 .82rem var(--font-mono); white-space: nowrap; }
.mv .ic { font-size: .72rem; margin-right: .25em; }
.mv.up .ic { color: var(--up-icon); } .mv.dn .ic { color: var(--down-icon); } .mv.flat { color: var(--muted); }
.pos { color: var(--up); } .neg { color: var(--down); }
.lab { display: inline-block; font: 700 .64rem/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; padding: .22rem .4rem; border: 1px solid currentColor; margin-right: .25rem; border-radius: 2px; }
.lab.riser, .lab.bull { color: var(--up); } .lab.faller, .lab.bear { color: var(--down); }
.spark { display: block; }
.spark path { fill: none; stroke: var(--ink); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
.spark line { stroke: var(--axis); stroke-dasharray: 2 3; }

/* ---------- stat tiles / movers ---------- */
.tiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); margin-bottom: 1.6rem; }
.tile { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--ink); padding: .9rem 1rem; box-shadow: var(--shadow); }
.tile h3 { font: 700 .7rem/1 var(--font-mono); letter-spacing: .16em; color: var(--muted); margin-bottom: .55rem; }
.tile .big { font: 800 2.5rem/1 var(--font-display); letter-spacing: .01em; }
.tile .sub { font: .82rem var(--font-ui); color: var(--ink2); margin-top: .35rem; }
.tile ol { list-style: none; margin: 0; padding: 0; font: .9rem var(--font-ui); }
.tile li { display: flex; justify-content: space-between; gap: .6rem; padding: .3rem 0; border-bottom: 1px solid var(--grid); }
.tile li:last-child { border: 0; }
.tile li span:last-child { font-family: var(--font-mono); font-weight: 700; }

/* ---------- charts ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; font-family: var(--font-ui); touch-action: pan-y; }
.chart svg:focus-visible { outline: 3px solid var(--s1); }
.chart text { fill: var(--ink2); font-size: 11px; }
.chart .axis text { fill: var(--muted); }
.chart .gridl { stroke: var(--grid); stroke-width: 1; }
.chart .base { stroke: var(--axis); }
.chart .ln { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln.dim { stroke: var(--dim); stroke-width: 1.5; }
.chart .lbl.dim { fill: var(--dim-text); }
.chart .lbl.on { fill: var(--ink); font-weight: 700; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--ink2); stroke-width: 1; pointer-events: none; }
.tt { position: absolute; z-index: 5; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--ink2); border-radius: 3px; padding: .5rem .65rem; font: .8rem/1.35 var(--font-ui); box-shadow: var(--shadow); max-width: 260px; min-width: 150px; }
.tt[hidden] { display: none; }
.tt b { font: 700 .72rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; display: block; margin-bottom: .3rem; color: var(--ink2); }
.tt .row { display: flex; align-items: center; gap: .45rem; justify-content: space-between; }
.tt .row .k { display: inline-block; width: 12px; border-top: 3px solid var(--dim); flex: none; }
.tt .row .nm { color: var(--ink2); flex: 1; }
.tt .row .v { font: 700 .85rem var(--font-mono); }
details.tableview { margin-top: .7rem; font: .85rem var(--font-ui); }
details.tableview summary { cursor: pointer; font: 700 .72rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; padding: .3rem 0; }

/* ---------- heat matrices ---------- */
.heat { display: grid; gap: 2px; font: .72rem/1.15 var(--font-ui); min-width: 760px; }
.heat > * { min-width: 0; }
.hh { font: 700 .66rem/1.1 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink2); display: flex; align-items: end; justify-content: center; text-align: center; padding: .3rem 0 .4rem; }
.hr { font: 700 .66rem var(--font-mono); color: var(--muted); display: flex; align-items: center; justify-content: end; padding-right: .4rem; }
.cell {
  --v: 0; border: 0; border-radius: 2px; padding: .3rem .25rem; color: var(--ink); text-align: left; cursor: default;
  background: color-mix(in oklab, var(--tone, var(--div-mid)) calc(var(--v) * var(--heat-cap)), var(--div-mid));
  display: flex; flex-direction: column; justify-content: center; min-height: 52px; font: inherit; position: relative;
}
button.cell { cursor: pointer; }
.cell:hover, .cell:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; z-index: 2; }
.cell b { font-weight: 700; font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell span { font: 600 .66rem var(--font-mono); opacity: .9; }
.cell.pos { --tone: var(--div-pos); } .cell.neg { --tone: var(--div-neg); }
.cell.pos, .cell.neg { color: var(--ink); }
.cell.self { background: repeating-linear-gradient(135deg, var(--grid) 0 4px, transparent 4px 8px); }
.legend-scale { display: flex; align-items: center; gap: .5rem; font: .72rem var(--font-mono); color: var(--ink2); margin: .6rem 0 0; flex-wrap: wrap; }
.legend-scale .bar { width: 180px; height: 10px; border-radius: 2px; background: linear-gradient(90deg, color-mix(in oklab, var(--div-neg) var(--heat-cap), var(--div-mid)), var(--div-mid), color-mix(in oklab, var(--div-pos) var(--heat-cap), var(--div-mid))); }
.pg { font: 800 1.2rem/1 var(--font-display); }

/* ---------- timeline ---------- */
.timeline { display: flex; gap: .7rem; overflow-x: auto; padding: .4rem .2rem 1rem; margin: 0; list-style: none; scroll-snap-type: x proximity; }
.timeline li { flex: 0 0 150px; border: 1px solid var(--border); border-top: 3px solid var(--flag); background: var(--surface); padding: .6rem .7rem .7rem; scroll-snap-align: start; position: relative; }
.timeline li.rep { border-top-color: var(--s1); }
.timeline .yr { font: 800 1.9rem/1 var(--font-display); }
.timeline .champ { font: 700 .95rem/1.15 var(--font-ui); margin-top: .35rem; }
.timeline .tm, .timeline .ru { font: .76rem/1.3 var(--font-ui); color: var(--ink2); }
.timeline .x2 { position: absolute; right: .5rem; top: .6rem; }
.timeline li.live { border-top-style: dashed; border-top-color: var(--muted); }

/* ---------- md render / detail ---------- */
.md h2 { font-size: 1.15rem; margin: 1.3rem 0 .5rem; border-bottom: 1px solid var(--grid); padding-bottom: .25rem; }
.md h1 { display: none; }
.md p, .md li { font: .92rem/1.5 var(--font-ui); max-width: 80ch; }
.md code { font: .85em var(--font-mono); background: var(--wash); padding: .05em .3em; }
.md table { font-size: .82rem; }
.detail { border: 1px solid var(--ink2); background: var(--surface); padding: 1rem 1.1rem; margin-top: 1rem; }
.detail:empty { display: none; }
.detail h3 { margin-bottom: .6rem; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .7rem; margin-bottom: .8rem; }
.kv div { border-left: 3px solid var(--ink); padding-left: .55rem; }
.kv dt { font: 700 .64rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 0; font: 800 1.35rem/1.1 var(--font-display); }
.grade { font: 800 1.35rem/1 var(--font-display); display: inline-block; min-width: 2.4rem; text-align: center; padding: .2rem .3rem; border: 2px solid var(--ink); }
.roast { font: italic .92rem/1.45 var(--font-body); color: var(--ink2); max-width: 70ch; white-space: normal; }

footer { border-top: 4px double var(--ink2); background: var(--surface); }
footer .wrap { padding-block: 1.2rem 2rem; font: .8rem/1.5 var(--font-ui); color: var(--ink2); }
footer ul { margin: .4rem 0 0; padding-left: 1.1rem; }

@media (max-width: 640px) {
  .masthead .wrap { align-items: start; }
  .panel { padding: .9rem .8rem 1rem; }
  table.data td.rank { font-size: 1.2rem; }
}
@media (forced-colors: active) {
  .cell { border: 1px solid CanvasText; background: Canvas; }
  .cell.pos::after { content: " +"; } .cell.neg::after { content: " -"; }
  .chart .ln.dim { stroke: GrayText; }
}
@media print {
  :root, :root[data-theme] { color-scheme: light; --page:#fff; --surface:#fff; --ink:#000; --ink2:#333; --muted:#555; --grid:#ccc; --axis:#999; --wash:#f1f1f1; --div-mid:#f0efec; --div-pos:#2a78d6; --div-neg:#e34948; --heat-cap:60%; --up:#006300; --down:#a00; --dim:#aaa; --dim-text:#555; }
  body { background: #fff; font-size: 11pt; }
  .masthead { background: #fff; color: #000; border-bottom: 3px solid #000; } .masthead::before, .ticker, .nav, .controls, .chips, .skip { display: none !important; }
  .panel, .tile { box-shadow: none; break-inside: avoid; }
  .scroll { overflow: visible; } .heat { min-width: 0; }
  details.tableview:not([open]) > :not(summary) { display: block; } /* print tables */
  a { text-decoration: none; }
}
