/* ==========================================================================
   NBAAnalytic.com — styles.css
   A courtside, broadcast-graphics-meets-data-journalism design system.
   Single stylesheet. All design tokens live in CSS custom properties.
   Dark "arena lights" theme is the default; [data-theme="light"] reads
   like a printed program. Degrades gracefully without JS / storage.
   --------------------------------------------------------------------------
   Contents:
     01  Design tokens (colors, type, space, motion)
     02  Reset & base elements
     03  Court-line background texture
     04  Layout primitives (wrap, measure, grids)
     05  Skip link & accessibility
     06  Header / nav / hamburger / search
     07  Buttons, theme toggle, tags & jersey badges
     08  Cards & card grids (staggered fade-up)
     09  Hero & scoreboard stat callouts
     10  Article layout (breadcrumb, byline, TOC, body, bio, related, nav)
     11  Prose: tables, figures, code, blockquotes, ad slots
     12  Footer
     13  Utilities, motion preferences, print
   ========================================================================== */

/* 01 — DESIGN TOKENS ======================================================= */
:root {
  /* Core palette — dark "under the arena lights" (default) */
  --ink:          #0E1116;   /* court / page background */
  --ink-2:        #090B0F;   /* deepest wells */
  --surface:      #171B22;   /* cards, panels */
  --surface-2:    #1E232C;   /* raised surfaces, table headers */
  --line:         rgba(255, 255, 255, 0.085);
  --line-strong:  rgba(255, 255, 255, 0.16);

  --hardwood:     #B5793F;   /* warm hardwood-tone accent */
  --hardwood-soft:rgba(181, 121, 63, 0.16);

  --orange:       #FF6B2C;   /* PRIMARY electric accent */
  --orange-bright:#FF8A3D;
  --teal:         #19C3B2;   /* SECONDARY accent (data highlights, charts) */
  --teal-bright:  #34E3D1;

  --text:         #ECEEF1;
  --text-strong:  #FFFFFF;
  --muted:        #9AA3AD;
  --muted-2:      #6B7480;

  --link:         var(--orange-bright);
  --link-hover:   #FFB07A;

  --good:         #36C46B;
  --warn:         #FFC857;

  /* Court-line decorative stroke color */
  --court-stroke: rgba(255, 255, 255, 0.045);
  --court-stroke-2: rgba(25, 195, 178, 0.05);

  /* Typography */
  --font-display: "Oswald", "Arial Narrow", sans-serif;        /* headlines */
  --font-body:    "Libre Franklin", Georgia, serif;            /* body */
  --font-mono:    "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --fs-300: 0.8125rem;   /* 13px - small print / captions */
  --fs-400: 1rem;        /* 16px - body base */
  --fs-450: 1.075rem;    /* article body */
  --fs-500: 1.25rem;
  --fs-600: 1.5rem;
  --fs-700: 2rem;
  --fs-800: 2.75rem;
  --fs-900: clamp(2.6rem, 6vw, 4.75rem);   /* hero scoreboard */

  --lh-tight: 1.05;
  --lh-snug:  1.2;
  --lh-body:  1.7;

  /* Space scale */
  --s-1: 0.25rem;  --s-2: 0.5rem;  --s-3: 0.75rem;  --s-4: 1rem;
  --s-5: 1.5rem;   --s-6: 2rem;    --s-7: 3rem;      --s-8: 4.5rem;
  --s-9: 6.5rem;

  /* Measure & containers */
  --measure: 720px;        /* article reading width */
  --wrap:    1200px;       /* index / wide grids */

  --radius:    14px;
  --radius-sm: 8px;
  --radius-lg: 22px;

  --shadow:    0 10px 40px -18px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 24px 70px -28px rgba(0, 0, 0, 0.85);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 0.16s;
  --t-med:  0.32s;
}

/* Light theme — "printed program" */
[data-theme="light"] {
  --ink:          #F6F2E8;
  --ink-2:        #ECE6D7;
  --surface:      #FFFFFF;
  --surface-2:    #F3EEE2;
  --line:         rgba(16, 19, 23, 0.12);
  --line-strong:  rgba(16, 19, 23, 0.22);

  --hardwood:     #9A6328;
  --hardwood-soft:rgba(154, 99, 40, 0.12);

  --orange:       #DD4F12;
  --orange-bright:#C8470F;
  --teal:         #0C8A7E;
  --teal-bright:  #0A7468;

  --text:         #15181D;
  --text-strong:  #000000;
  --muted:        #54606B;
  --muted-2:      #76808B;

  --link:         #C8470F;
  --link-hover:   #9A3608;

  --court-stroke:   rgba(16, 19, 23, 0.05);
  --court-stroke-2: rgba(12, 138, 126, 0.07);

  --shadow:    0 10px 36px -20px rgba(40, 30, 12, 0.4);
  --shadow-lg: 0 24px 64px -30px rgba(40, 30, 12, 0.45);
}

/* 02 — RESET & BASE ======================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;   /* sticky header offset for anchors */
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-400);
  line-height: var(--lh-body);
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background var(--t-med) var(--ease), color var(--t-med) var(--ease);
}

main { flex: 1 0 auto; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-snug);
  color: var(--text-strong);
  letter-spacing: 0.01em;
}
h1 { font-size: var(--fs-800); font-weight: 700; line-height: var(--lh-tight); }
h2 { font-size: var(--fs-700); }
h3 { font-size: var(--fs-500); }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }

p, ul, ol, table, figure, pre, blockquote { margin-bottom: var(--s-5); }

img, svg, canvas { max-width: 100%; height: auto; display: block; }

strong, b { font-weight: 600; color: var(--text-strong); }

::selection { background: var(--orange); color: #fff; }

/* 03 — COURT-LINE BACKGROUND TEXTURE ====================================== */
/* Faint center-circle arc + three-point curves drawn with layered radial
   gradients, fixed to the page. Purely decorative, very low opacity. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 14%, transparent 178px, var(--court-stroke) 179px, var(--court-stroke) 181px, transparent 182px),
    radial-gradient(circle at 50% 14%, transparent 96px, var(--court-stroke) 97px, var(--court-stroke) 99px, transparent 100px),
    radial-gradient(circle at -8% 100%, transparent 340px, var(--court-stroke-2) 341px, var(--court-stroke-2) 344px, transparent 345px),
    radial-gradient(circle at 108% 100%, transparent 340px, var(--court-stroke-2) 341px, var(--court-stroke-2) 344px, transparent 345px);
  background-repeat: no-repeat;
}
/* A subtle vignette + hardwood warmth behind everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, var(--hardwood-soft), transparent 60%),
    linear-gradient(180deg, var(--ink-2), var(--ink) 18%, var(--ink));
}

/* 04 — LAYOUT PRIMITIVES =================================================== */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.measure { width: min(100% - 2.5rem, var(--measure)); margin-inline: auto; }

.section { padding-block: var(--s-8); }
.section--tight { padding-block: var(--s-6); }

.grid { display: grid; gap: var(--s-5); }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid--cats  { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* Section heading with a court-line underline and a "stat label" eyebrow */
.section-head { margin-bottom: var(--s-6); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-300);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
}
.eyebrow::before {
  content: "";
  width: 26px; height: 2px;
  background: var(--teal);
  display: inline-block;
}
.section-head h2 {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.section-head .sub { color: var(--muted); max-width: 60ch; margin-top: var(--s-2); }

/* 05 — SKIP LINK & A11Y ==================================================== */
.skip-link {
  position: absolute;
  left: var(--s-4); top: -120px;
  background: var(--orange);
  color: #fff;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius-sm);
  z-index: 200;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: var(--s-4); color: #fff; }

:focus-visible {
  outline: 3px solid var(--teal-bright);
  outline-offset: 3px;
  border-radius: 3px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 06 — HEADER / NAV / SEARCH =============================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--ink) 86%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header__bar {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  height: 68px;
}
/* Brand mark: scoreboard-style wordmark */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-strong);
  white-space: nowrap;
}
.brand:hover { color: var(--text-strong); }
.brand__mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--orange), var(--hardwood));
  color: #fff;
  font-size: 1.1rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}
.brand b { color: var(--orange); font-weight: 700; }
[data-theme="light"] .brand b { color: var(--orange-bright); }

.primary-nav { margin-left: auto; }
.primary-nav ul {
  list-style: none;
  display: flex;
  gap: var(--s-2);
  align-items: center;
  margin: 0; padding: 0;
}
.primary-nav a {
  display: inline-block;
  padding: var(--s-2) var(--s-3);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  position: relative;
}
.primary-nav a::after {
  content: ""; position: absolute;
  left: var(--s-3); right: var(--s-3); bottom: 4px; height: 2px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-fast) var(--ease);
}
.primary-nav a:hover, .primary-nav a[aria-current="page"] { color: var(--text-strong); }
.primary-nav a:hover::after, .primary-nav a[aria-current="page"]::after { transform: scaleX(1); }

/* Header search */
.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search input {
  width: 190px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: var(--s-2) var(--s-3) var(--s-2) 2.1rem;
  border-radius: 999px;
  transition: width var(--t-med) var(--ease), border-color var(--t-fast);
}
.search input::placeholder { color: var(--muted-2); }
.search input:focus { width: 230px; border-color: var(--teal); outline: none; }
.search__icon {
  position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; width: 16px; height: 16px;
}
.search__results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-width: 80vw;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
}
.search__results.open { display: block; }
.search__results a {
  display: block;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
  color: var(--text);
}
.search__results a:last-child { border-bottom: 0; }
.search__results a:hover, .search__results a.active {
  background: var(--surface-2);
  color: var(--text-strong);
}
.search__results .r-cat {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
}
.search__results .r-title { font-family: var(--font-display); font-weight: 500; }
.search__empty { padding: var(--s-4); color: var(--muted); font-size: 0.9rem; }

/* Hamburger */
.nav-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  padding: 0;
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; }

/* 07 — BUTTONS / THEME TOGGLE / TAGS / BADGES ============================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
  padding: var(--s-3) var(--s-5);
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast), box-shadow var(--t-fast);
}
.btn--primary { background: var(--orange); color: #fff; }
.btn--primary:hover { background: var(--orange-bright); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--teal); color: var(--text-strong); transform: translateY(-2px); }

.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--line);
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  display: inline-grid;
  place-items: center;
}
.theme-toggle:hover { border-color: var(--teal); color: var(--teal); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun  { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Category tag — styled like a stitched jersey patch */
.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.28em 0.7em;
  border-radius: 999px;
  color: var(--teal);
  background: color-mix(in srgb, var(--teal) 12%, transparent);
  border: 1px dashed color-mix(in srgb, var(--teal) 45%, transparent);
}
.tag--orange { color: var(--orange); background: color-mix(in srgb, var(--orange) 12%, transparent); border-color: color-mix(in srgb, var(--orange) 45%, transparent); }
.tag--wood   { color: var(--hardwood); background: var(--hardwood-soft); border-color: color-mix(in srgb, var(--hardwood) 50%, transparent); }

/* 08 — CARDS & GRIDS ======================================================= */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--t-med) var(--ease), border-color var(--t-med), box-shadow var(--t-med);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.card__body { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); flex: 1; }
.card__meta { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.15;
}
.card a.card__title-link { color: var(--text-strong); }
.card a.card__title-link::after { content: ""; position: absolute; inset: 0; } /* whole-card click */
.card:hover .card__title { color: var(--orange-bright); }
.card__desc { color: var(--muted); font-size: 0.95rem; }
.card__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
}
.card--accent { border-top: 3px solid var(--orange); }

/* Category navigation card */
.cat-card {
  position: relative;
  display: block;
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--t-med) var(--ease), border-color var(--t-med);
}
.cat-card:hover { transform: translateY(-4px); border-color: var(--teal); }
.cat-card__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3.5rem;
  line-height: 1;
  color: var(--surface-2);
  position: absolute;
  right: var(--s-4); top: var(--s-2);
  -webkit-text-stroke: 1px var(--line-strong);
}
.cat-card h3 { color: var(--text-strong); margin-bottom: var(--s-2); position: relative; }
.cat-card:hover h3 { color: var(--teal); }
.cat-card p { color: var(--muted); font-size: 0.9rem; position: relative; }
.cat-card .count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--orange); letter-spacing: 0.1em; text-transform: uppercase; }

/* Staggered fade-up: gated on the `js` class set by the inline head script,
   so non-JS visitors always see content and there is no visible->hidden flash.
   If IntersectionObserver is missing, main.js adds .in to everything. */
.reveal { opacity: 1; transform: none; }
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
}
.js .reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

/* 09 — HERO & SCOREBOARD CALLOUTS ========================================= */
.hero {
  position: relative;
  padding-block: var(--s-9) var(--s-8);
  overflow: hidden;
}
.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-300);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: var(--s-4);
}
.hero h1 {
  font-size: var(--fs-900);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  max-width: 16ch;
}
.hero h1 .hl { color: var(--orange); }
.hero__lede {
  font-size: var(--fs-500);
  color: var(--muted);
  max-width: 54ch;
  margin-top: var(--s-5);
  line-height: 1.5;
}
.hero__cta { margin-top: var(--s-6); display: flex; gap: var(--s-3); flex-wrap: wrap; }

/* Scoreboard strip — a row of tabular stat callouts */
.scoreboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: var(--s-7);
}
.stat {
  background: var(--surface);
  padding: var(--s-5);
  text-align: center;
}
.stat__num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--orange);
  line-height: 1;
}
.stat--teal .stat__num { color: var(--teal); }
.stat__label {
  display: block;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: var(--s-3);
}

/* Featured article block */
.featured {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--s-6);
  align-items: center;
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius-lg);
  padding: var(--s-7);
}
.featured__tagline { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--orange); margin-bottom: var(--s-4); }
.featured h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); text-transform: uppercase; line-height: 1.04; }
.featured h2 a { color: var(--text-strong); }
.featured h2 a:hover { color: var(--orange-bright); }
.featured p { color: var(--muted); margin-top: var(--s-4); }
.featured__meta { margin-top: var(--s-5); display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; }
.featured__art {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(115deg, transparent, transparent 16px, rgba(255,255,255,0.02) 16px, rgba(255,255,255,0.02) 17px),
    radial-gradient(circle at 70% 30%, color-mix(in srgb, var(--teal) 30%, transparent), transparent 60%),
    radial-gradient(circle at 20% 80%, color-mix(in srgb, var(--orange) 35%, transparent), transparent 55%),
    var(--ink-2);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  display: grid; place-items: center;
}
.featured__art .court-arc {
  position: absolute; width: 150%; aspect-ratio: 1; border-radius: 50%;
  border: 1.5px solid var(--court-stroke); border-bottom: none;
  bottom: -55%; left: -25%;
}
.featured__art .big-num {
  font-family: var(--font-display); font-weight: 700; font-size: 6rem;
  color: rgba(255,255,255,0.07); -webkit-text-stroke: 1px var(--line-strong); letter-spacing: 0.02em;
}

/* 10 — ARTICLE LAYOUT ====================================================== */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding-block: var(--s-5) 0;
}
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2); padding: 0; margin: 0; }
.breadcrumb li::after { content: "/"; margin-left: var(--s-2); color: var(--line-strong); }
.breadcrumb li:last-child::after { content: ""; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--teal); }

.article-header { padding-block: var(--s-5) var(--s-6); }
.article-header h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.3rem);
  text-transform: uppercase;
  letter-spacing: 0.005em;
  margin-block: var(--s-4) var(--s-5);
}
.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}
.byline .author { color: var(--text); }
.byline time, .byline .readtime { color: var(--muted); }
.byline .dot { color: var(--line-strong); }

/* Article grid: body + sticky TOC aside on wide screens */
.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
}
@media (min-width: 1040px) {
  .article-grid {
    grid-template-columns: 1fr minmax(0, var(--measure)) 1fr;
  }
  .article-grid > .article-body { grid-column: 2; }
  .toc { grid-column: 3; }
}

/* Table of contents (static fallback + JS-generated share styles) */
.toc {
  align-self: start;
  position: sticky;
  top: 92px;
  font-size: 0.85rem;
  max-width: 240px;
}
.toc__title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: var(--s-3);
}
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: var(--s-2) var(--s-4);
  color: var(--muted);
  border-left: 2px solid transparent;
  margin-left: -1px;
  line-height: 1.3;
}
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--orange); border-left-color: var(--orange); }
@media (max-width: 1039px) {
  .toc {
    position: static; max-width: none; margin-bottom: var(--s-6);
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: var(--s-4);
  }
  .toc[hidden] { display: none; }
}

/* 11 — PROSE ELEMENTS ====================================================== */
.article-body { font-size: var(--fs-450); }
.article-body > * { max-width: var(--measure); }
.article-body p { color: var(--text); }
.article-body h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin-top: var(--s-8);
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 90px;
}
.article-body h3 { font-size: 1.35rem; margin-top: var(--s-6); margin-bottom: var(--s-3); color: var(--text-strong); }
.article-body ul, .article-body ol { padding-left: 1.3em; }
.article-body li { margin-bottom: var(--s-2); }
.article-body li::marker { color: var(--orange); }
.article-body a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent); text-underline-offset: 3px; }
.article-body a:hover { text-decoration-color: var(--link-hover); }

/* Lead paragraph */
.article-body .lead { font-size: 1.3rem; line-height: 1.55; color: var(--text-strong); font-weight: 400; }

/* Formula / definition callout */
.formula {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius-sm);
  padding: var(--s-4) var(--s-5);
  overflow-x: auto;
  color: var(--text-strong);
}
.formula .label { display:block; font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; color: var(--teal); margin-bottom: var(--s-2); }

/* Oversized stat pull-out — a grid-breaking moment */
.pullstat {
  margin-block: var(--s-7);
  padding: var(--s-6);
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
}
.pullstat .n {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.5rem, 11vw, 6.5rem);
  line-height: 0.9;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
}
.pullstat .n.teal { color: var(--teal); }
.pullstat .cap { display: block; color: var(--muted); margin-top: var(--s-3); font-size: 1rem; max-width: 42ch; margin-inline: auto; }

/* Broadcast box-score tables */
.article-body table, table.boxscore {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
table.boxscore caption, .article-body table caption {
  caption-side: bottom;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted-2);
  text-align: left;
  padding: var(--s-3) var(--s-2) 0;
  letter-spacing: 0.02em;
}
thead th {
  background: var(--surface-2);
  font-family: var(--font-display);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.74rem;
  color: var(--muted);
  text-align: right;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
thead th:first-child, tbody th { text-align: left; }
tbody td, tbody th {
  padding: var(--s-3) var(--s-4);
  text-align: right;
  border-bottom: 1px solid var(--line);
}
tbody th { font-weight: 500; color: var(--text-strong); font-family: var(--font-body); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--teal) 6%, transparent); }
td.hl, th.hl { color: var(--orange); font-weight: 600; }
.table-scroll { overflow-x: auto; margin-bottom: var(--s-5); -webkit-overflow-scrolling: touch; }
.table-scroll table { margin-bottom: var(--s-2); }

/* Figures / charts */
figure { margin-inline: 0; }
figure img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}
figcaption {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted-2);
  margin-top: var(--s-3);
  line-height: 1.5;
  letter-spacing: 0.01em;
}
figcaption .src { color: var(--teal); }

/* Full-bleed figure — breaks the measure for shot charts / trends */
.figure-bleed {
  max-width: var(--wrap) !important;
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: calc((var(--measure) - min(100vw - 2.5rem, var(--wrap))) / 2);
  margin-block: var(--s-7);
}
@media (max-width: 1240px) {
  .figure-bleed { margin-inline: auto; width: 100%; }
}

/* Code blocks */
pre {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s-5);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.65;
  -webkit-overflow-scrolling: touch;
}
[data-theme="light"] pre { background: #1b1f27; }
pre code { color: #d6dde6; font-family: var(--font-mono); }
:not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--surface-2);
  padding: 0.12em 0.42em;
  border-radius: 5px;
  color: var(--teal);
  border: 1px solid var(--line);
}
.code-label {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted-2); margin-bottom: var(--s-2); display: block;
}

/* Blockquote */
blockquote {
  border-left: 3px solid var(--hardwood);
  padding: var(--s-2) var(--s-5);
  color: var(--muted);
  font-style: italic;
  font-size: 1.1rem;
}

/* Ad slots — empty, structurally ready, clearly labelled */
.ad-slot {
  margin-block: var(--s-7);
  min-height: 90px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--surface) 40%, transparent);
}
.ad-slot::before { content: "Advertisement"; }

/* Author bio box */
.author-box {
  display: flex;
  gap: var(--s-5);
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s-5);
  margin-top: var(--s-8);
}
.author-box__avatar {
  flex: none;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hardwood), var(--orange));
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; color: #fff;
}
.author-box h4 { font-size: 1.1rem; color: var(--text-strong); margin-bottom: var(--s-2); text-transform: uppercase; letter-spacing: 0.04em; }
.author-box p { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* Sources list */
.sources {
  margin-top: var(--s-7);
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.sources h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--teal); margin-bottom: var(--s-3); }
.sources ul { margin: 0; padding-left: 1.2em; font-size: 0.92rem; }
.sources li { color: var(--muted); }

/* Related articles + prev/next */
.related { margin-top: var(--s-8); }
.prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
  margin-top: var(--s-7);
}
.prevnext a {
  display: block;
  padding: var(--s-4) var(--s-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.prevnext a:hover { border-color: var(--orange); transform: translateY(-2px); }
.prevnext .dir { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); display: block; margin-bottom: var(--s-2); }
.prevnext .t { font-family: var(--font-display); font-weight: 500; color: var(--text-strong); line-height: 1.15; }
.prevnext .next { text-align: right; }
.prevnext .next:only-child { grid-column: 2; }

/* TODO author note (visible reminder where a data pull is pending) */
.todo-note {
  border: 1px dashed var(--warn);
  background: color-mix(in srgb, var(--warn) 8%, transparent);
  color: var(--warn);
  padding: var(--s-4);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

/* 12 — FOOTER ============================================================== */
.site-footer {
  margin-top: var(--s-9);
  border-top: 1px solid var(--line);
  background: var(--ink-2);
  padding-block: var(--s-7) var(--s-6);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--s-6);
}
.site-footer h5 { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.82rem; color: var(--muted); margin-bottom: var(--s-4); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.site-footer a { color: var(--text); font-size: 0.92rem; }
.site-footer a:hover { color: var(--orange); }
.site-footer .blurb { color: var(--muted); font-size: 0.92rem; max-width: 38ch; }
.site-footer__bottom {
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: var(--s-4); justify-content: space-between;
  color: var(--muted-2); font-size: 0.82rem; font-family: var(--font-mono); letter-spacing: 0.02em;
}

/* 13 — UTILITIES / MOTION / PRINT ========================================= */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.hide { display: none !important; }
.nojs-hide { } /* shown by default; main.js may toggle */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---- Responsive ---- */
@media (max-width: 980px) {
  .featured { grid-template-columns: 1fr; }
  .featured__art { order: -1; }
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  :root { --fs-800: 2.1rem; --fs-700: 1.6rem; }
  .primary-nav {
    position: fixed;
    inset: 68px 0 auto 0;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
    margin: 0;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
    transform: translateY(-150%);
    transition: transform var(--t-med) var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .primary-nav.open { transform: translateY(0); }
  .primary-nav ul { flex-direction: column; align-items: stretch; padding: var(--s-4); gap: 0; }
  .primary-nav a { padding: var(--s-4); border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .primary-nav a::after { display: none; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .search { order: 3; }
  .search input { width: 100%; }
  .search__results { width: 100%; right: auto; left: 0; }
  .site-footer__grid { grid-template-columns: 1fr; }
  .prevnext { grid-template-columns: 1fr; }
  .prevnext .next { text-align: left; }
  .prevnext .next:only-child { grid-column: 1; }
}
@media (max-width: 420px) {
  .site-header__bar { gap: var(--s-2); }
  .brand { font-size: 1.15rem; }
  .scoreboard { grid-template-columns: repeat(2, 1fr); }
}

@media print {
  .site-header, .site-footer, .ad-slot, .toc, .prevnext, .search, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .article-body > * { max-width: none; }
}
