/* Pickwell design system: tokens in 3 layers (primitive -> semantic -> component) */
:root {
  /* primitives */
  --paper-50: #FAF8F3;
  --paper-100: #F2EEE4;
  --paper-200: #E4DED0;
  --ink-900: #0F1114;
  --ink-800: #1A1D22;
  --ink-700: #2A2E35;
  --ink-500: #5B616B;
  --ink-400: #7D838C;
  --signal-500: #E8441A;
  --signal-600: #C7350F;
  --turf-500: #1F7A4D;
  --turf-100: #DDEFE5;
  --gold-500: #C9971C;
  --sky-500: #2463C9;

  /* semantic (day) */
  --bg: var(--paper-50);
  --bg-raised: #FFFFFF;
  --bg-sunken: var(--paper-100);
  --line: var(--paper-200);
  --text: var(--ink-900);
  --text-muted: var(--ink-500);
  --accent: var(--signal-600);
  --accent-strong: var(--signal-600);
  --accent-ink: #FFFFFF;
  --up: var(--turf-500);
  --down: var(--signal-600);
  --live: var(--signal-500);

  /* type */
  --f-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --f-serif: "Newsreader", Georgia, serif;
  --f-sans: "Inter", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  /* space + radius */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --r-1: 2px; --r-2: 6px; --r-pill: 999px;
  --maxw: 1240px;
}
:root[data-theme="night"] {
  --bg: var(--ink-900);
  --bg-raised: var(--ink-800);
  --bg-sunken: #0A0B0D;
  --line: var(--ink-700);
  --text: var(--paper-50);
  --text-muted: #9298A1;
  --accent: #FF6A3D;
  --accent-strong: #FF6A3D;
  --accent-ink: var(--ink-900);
  --up: #3FBF7F;
  --down: #FF6A3D;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--f-sans); font-size: 16px; line-height: 1.5; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s-5); }
@media (max-width: 640px) { .wrap { padding: 0 var(--s-4); } }

/* type scale */
.t-display { font-family: var(--f-display); font-weight: 800; text-transform: uppercase; letter-spacing: -0.01em; line-height: 0.92; }
.t-d1 { font-size: clamp(48px, 8vw, 112px); }
.t-d2 { font-size: clamp(36px, 5vw, 64px); }
.t-d3 { font-size: clamp(26px, 3vw, 36px); }
.t-head { font-family: var(--f-serif); font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; }
.t-kicker { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.t-meta { font-family: var(--f-mono); font-size: 12px; color: var(--text-muted); letter-spacing: 0.02em; }
.t-body { font-family: var(--f-serif); font-size: 19px; line-height: 1.6; }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* masthead */
.mast { border-bottom: 2px solid var(--text); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.mast-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); height: 64px; }
.logo { font-family: var(--f-display); font-weight: 900; font-size: 30px; text-transform: uppercase; text-decoration: none; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.logo i { width: 14px; height: 14px; background: var(--accent); display: inline-block; transform: rotate(45deg); }
.nav { display: flex; gap: var(--s-5); font-weight: 600; font-size: 14px; }
.nav a { text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a[aria-current="page"], .nav a:hover { border-color: var(--accent); }
.mast-actions { display: flex; gap: var(--s-2); align-items: center; }
.ticker { border-top: 1px solid var(--line); font-family: var(--f-mono); font-size: 12px; overflow: hidden; white-space: nowrap; }
.ticker .wrap { display: flex; gap: var(--s-6); height: 34px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.ticker b { color: var(--accent); }
.ticker .wrap { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.btn.menu-btn { display: none; }
.nav .nav-theme { display: none; }
@media (max-width: 900px) {
  .nav { display: none; }
  .btn.menu-btn { display: inline-flex; }
  .mast-actions .theme-toggle { display: none; }
  .nav .nav-theme { display: inline-flex; align-self: flex-start; margin-top: 8px; }
  .mast-top { height: 56px; }
  .logo { font-size: 24px; }
}

/* buttons */
.btn { font-family: var(--f-sans); font-weight: 700; font-size: 14px; border-radius: var(--r-1); padding: 10px 16px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 2px solid var(--text); background: transparent; color: var(--text); text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { border-color: transparent; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--sky-500); outline-offset: 2px; }

/* chips + badges */
.chip { font-family: var(--f-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid var(--line); padding: 4px 8px; border-radius: var(--r-pill); display: inline-flex; gap: 6px; align-items: center; background: var(--bg-raised); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.badge-live { background: var(--live); color: #fff; font-family: var(--f-mono); font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: var(--r-1); letter-spacing: 0.06em; }
.pos { font-family: var(--f-mono); font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: var(--r-1); background: var(--bg-sunken); border: 1px solid var(--line); }
.up { color: var(--up); } .down { color: var(--down); }

/* cards */
.card { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--r-1); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; }
.card-media { aspect-ratio: 16/10; background: var(--bg-sunken); position: relative; overflow: hidden; }
.card-body { padding: var(--s-4); display: grid; gap: var(--s-2); }
.card h3 { margin: 0; font-family: var(--f-serif); font-size: 21px; line-height: 1.2; font-weight: 600; }
.card:hover h3 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.card-row { display: grid; grid-template-columns: 112px 1fr; gap: var(--s-3); padding: var(--s-3) 0; border-top: 1px solid var(--line); text-decoration: none; }
.card-row .card-media { aspect-ratio: 1; }
.card-row h3 { font-family: var(--f-serif); font-size: 17px; line-height: 1.25; margin: 0 0 4px; font-weight: 600; }

/* art: generated field-graphics instead of photos */
/* field graphic: base color, shadow plane, hash-mark bands, yard lines, film grain, cropped number */
.art { position: absolute; inset: 0; overflow: hidden;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(100deg, transparent 0 56%, rgba(0,0,0,.24) 56% 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.45) 0 1px, transparent 1px 2%) 0 30% / 100% 9px no-repeat,
    repeating-linear-gradient(90deg, rgba(255,255,255,.45) 0 1px, transparent 1px 2%) 0 70% / 100% 9px no-repeat,
    radial-gradient(120% 90% at 20% 0%, rgba(255,255,255,.16), transparent 60%),
    var(--a, #1F7A4D); }
.art::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.28) 0 2px, transparent 2px 10%); }
.art::after { content: attr(data-n); position: absolute; right: -2%; bottom: -16%; font-family: var(--f-display); font-weight: 900; font-size: clamp(96px, 18vw, 300px); color: rgba(255,255,255,.94); line-height: 1; letter-spacing: -0.05em; text-shadow: 0 0 0 transparent; }
.card-row .art::after { font-size: 72px; right: -6%; bottom: -14%; }
.art-tag { position: absolute; left: 4%; top: 7%; z-index: 1; display: grid; gap: 6px; color: #fff; font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.art-tag b { font-family: var(--f-display); font-size: clamp(28px, 4vw, 56px); font-weight: 900; letter-spacing: -0.01em; line-height: .9; }
.art-yards { position: absolute; left: 0; right: 0; bottom: 8%; display: flex; justify-content: space-around; padding: 0 5%; font-family: var(--f-display); font-weight: 800; font-size: clamp(14px, 2vw, 26px); color: rgba(255,255,255,.55); z-index: 1; pointer-events: none; }
@media (max-width: 600px) { .art-yards { display: none; } }

/* section heads */
.sec-head { display: flex; align-items: end; justify-content: space-between; border-top: 2px solid var(--text); padding-top: var(--s-3); margin: var(--s-7) 0 var(--s-5); gap: var(--s-4); }
.sec-head h2 { margin: 0; }

/* tables (board + rankings) */
.board { width: 100%; border-collapse: collapse; font-size: 14px; }
.board th { text-align: left; font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 600; padding: 10px 12px; border-bottom: 2px solid var(--text); position: sticky; top: 64px; background: var(--bg); }
.board td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.board tr:hover td { background: var(--bg-sunken); }
.board .rk { font-family: var(--f-display); font-weight: 800; font-size: 28px; width: 56px; }
.board .who b { display: block; font-size: 15px; }
.board .who span { font-size: 12px; color: var(--text-muted); }
.bar { height: 6px; background: var(--bg-sunken); border-radius: 3px; overflow: hidden; width: 96px; }
.bar i { display: block; height: 100%; background: var(--accent); }

/* mobile board becomes stacked rows */
@media (max-width: 720px) {
  .board thead { display: none; }
  .board, .board tbody, .board tr, .board td { display: block; width: 100%; }
  .board tr { display: grid; grid-template-columns: 44px 1fr auto; grid-template-areas: "rk who grade" "rk meta meta"; column-gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .board td { border: 0; padding: 0; }
  .board .rk { grid-area: rk; font-size: 26px; width: auto; }
  .board .who { grid-area: who; }
  .board .grade { grid-area: grade; text-align: right; }
  .board .m { display: inline-block; width: auto; margin-right: 12px; font-size: 12px; color: var(--text-muted); }
  .board .m-wrap { grid-area: meta; display: block; margin-top: 6px; }
  .board .hide-sm { display: none; }
}

/* footer */
.foot { border-top: 2px solid var(--text); margin-top: var(--s-8); padding: var(--s-6) 0 var(--s-7); font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s-5); }
.foot a { text-decoration: none; display: block; padding: 4px 0; color: var(--text-muted); }
.disclaimer { font-family: var(--f-mono); font-size: 11px; color: var(--text-muted); margin-top: var(--s-6); }
@media (max-width: 720px) { .foot-grid { grid-template-columns: 1fr 1fr; } }

.theme-toggle { font-family: var(--f-mono); font-size: 11px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
