/* shin2chin — "The Fight Ledger."
   Editorial record-book x fight poster. Three voices, strictly cast:
   - Big Shoulders (condensed poster caps): mastheads, headings, rank numerals
   - Spectral (bookish serif): prose
   - IBM Plex Mono: every data numeral, label, and table figure
   Corner-red is BRAND ink (chrome, rules, emphasis) and never touches data
   marks; data stays in the validated slot-1 blue with selected dark steps.
   Text wears text tokens. Chart surfaces match the palette-validated hexes. */

:root {
  color-scheme: light;
  --surface-1: #fcfcfb;         /* validated chart surface */
  --paper:     #f7f5f0;         /* warm page paper */
  --surface-2: #efece5;
  --text-primary: #131210;
  --text-secondary: #57534b;
  --series-1: #2a78d6;          /* data only */
  --accent:   #b3271e;          /* corner red: brand only */
  --grid: #dedacf;
  --rule: #131210;
  --grain-opacity: 0.5;
  --content-w: 980px;   /* one width for masthead, main, and footer */
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-1: #1a1a19; --paper: #161513; --surface-2: #232220;
    --text-primary: #f4f2ec; --text-secondary: #b5b1a4;
    --series-1: #3987e5; --accent: #e0564a;
    --grid: #33312c; --rule: #f4f2ec; --grain-opacity: 0.25;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1: #1a1a19; --paper: #161513; --surface-2: #232220;
  --text-primary: #f4f2ec; --text-secondary: #b5b1a4;
  --series-1: #3987e5; --accent: #e0564a;
  --grid: #33312c; --rule: #f4f2ec; --grain-opacity: 0.25;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--text-primary);
  font: 17px/1.65 "Spectral", Georgia, serif;
  position: relative;
}
/* Print grain: one SVG turbulence tile, fixed, never intercepting input. */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: calc(var(--grain-opacity) * 0.06);
  background-image: 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='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
header.top { position: relative; z-index: 4; }
main { position: relative; z-index: 3; }
footer { position: relative; z-index: 2; }

h1, h2, .brand, .rank {
  font-family: "Big Shoulders Display", "Arial Narrow", sans-serif;
  text-transform: uppercase; letter-spacing: 0.015em;
}
code, .num, .value, .tick, .meta, .mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

a { color: inherit; text-decoration: none; }
main a { border-bottom: 1px solid var(--grid); transition: border-color .15s, color .15s; }
main a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- masthead ---------- */
header.top {
  display: flex; justify-content: space-between; align-items: baseline;
  max-width: var(--content-w); margin: 0 auto; padding: 26px 24px 14px;
  border-bottom: 3px solid var(--rule);
}
.brand { font-weight: 800; font-size: 1.9rem; line-height: 1; }
.brand em { font-style: normal; color: var(--accent); }
.brand small {
  display: block; font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--text-secondary); margin-top: 4px;
}
.top nav a {
  font-family: "Big Shoulders Display", sans-serif; text-transform: uppercase;
  font-weight: 600; font-size: 1.02rem; letter-spacing: 0.08em;
  margin-left: 22px; color: var(--text-secondary);
  border-bottom: 3px solid transparent; padding-bottom: 2px;
}
.top nav a:hover { color: var(--text-primary); border-color: var(--accent); }

main { max-width: var(--content-w); margin: 0 auto; padding: 0 24px 56px; }

/* Staggered editorial page-load: one orchestrated reveal, then stillness. */
@media (prefers-reduced-motion: no-preference) {
  main > * { animation: rise .5s cubic-bezier(.2,.7,.3,1) both; }
  main > *:nth-child(1) { animation-delay: .04s; }
  main > *:nth-child(2) { animation-delay: .12s; }
  main > *:nth-child(3) { animation-delay: .2s; }
  main > *:nth-child(4) { animation-delay: .28s; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } }
}

/* ---------- hero: centered, like the posters the design borrows from */
.hero { padding: 52px 0 12px; text-align: center; }
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 800; line-height: 0.94;
  margin: 0 auto 10px; max-width: 16ch;
}
.hero h1::after {
  content: ""; display: block; width: 72px; height: 6px;
  background: var(--accent); margin: 18px auto 0;
}
.hero p { color: var(--text-secondary); max-width: 52ch;
  font-size: 1.06rem; margin-left: auto; margin-right: auto; }
.hero #search, .hero #search-results { margin-left: auto;
  margin-right: auto; text-align: left; }

#search {
  width: 100%; max-width: 460px; padding: 13px 16px; font-size: 1rem;
  font-family: "IBM Plex Mono", monospace;
  border: 1.5px solid var(--rule); border-radius: 0;
  background: var(--surface-1); color: var(--text-primary);
  box-shadow: 4px 4px 0 var(--grid); transition: box-shadow .15s;
}
#search:focus { outline: none; box-shadow: 4px 4px 0 var(--accent); }
#search-results { list-style: none; margin: 8px 0 0; padding: 0; max-width: 460px;
  background: var(--text-primary);
  box-shadow: 5px 5px 0 rgb(0 0 0 / 0.25); }
#search-results:empty, #search-results[hidden] { display: none; border: 0; box-shadow: none; }
#search-results li + li { border-top: 1px solid rgb(255 255 255 / 0.14); }
#search-results li a {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; padding: 9px 14px; color: var(--paper);
}
#search-results li a:hover, #search-results li.active a {
  background: var(--accent); color: var(--paper); text-decoration: none; }
#search-results .meta { color: var(--text-secondary); font-size: 0.78rem; }

/* ---------- sections & type ---------- */
h2 {
  font-size: 1.6rem; font-weight: 700; margin: 44px 0 10px;
  display: flex; align-items: center; gap: 12px;
}
h2::after { content: ""; flex: 1; height: 1px; background: var(--grid); }
.sub, .hint, .note { color: var(--text-secondary); }
.hint, .fine { font-size: 0.86rem; }
.note { font-style: italic; }
article.fighter h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 800; line-height: 0.95;
  margin: 36px 0 4px;
}
article.fighter .sub { font-family: "IBM Plex Mono", monospace; font-size: 0.85rem;
  letter-spacing: 0.04em; }

/* ---------- tale of the tape ---------- */
.skillcard {
  display: flex; gap: 0; margin: 22px 0; width: fit-content;
  border: 1.5px solid var(--rule); background: var(--surface-1);
  box-shadow: 6px 6px 0 var(--grid);
}
.skillcard .stat { padding: 14px 22px 12px; }
.skillcard .stat + .stat { border-left: 1px solid var(--grid); }
.skillcard .label { display: block; font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.22em; margin-bottom: 2px; }
.skillcard .value { font-size: 1.7rem; font-weight: 500; }
.skillcard .stat:first-child .value { color: var(--series-1); }

/* ---------- ledger tables ---------- */
table.ledger { width: 100%; border-collapse: collapse; font-size: 0.9rem;
  font-family: "Spectral", serif; }
.ledger th {
  text-align: left; font-family: "IBM Plex Mono", monospace; font-weight: 500;
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--text-secondary); border-bottom: 2px solid var(--rule);
  padding: 8px 10px 6px;
}
.ledger td { padding: 8px 10px; border-bottom: 1px solid var(--grid); }
.ledger tbody tr { transition: background .12s; }
.ledger tbody tr:hover { background: var(--surface-2); }
.ledger .num { text-align: right; }
/* Dates never wrap: their hyphens are otherwise legal break points, and
   a squeezed table splits 2016-12-29 across two lines. */
.ledger td.date { white-space: nowrap; }
.ledger td.sub { font-size: 0.82rem; }
.res-win { font-weight: 700; }
.res-win::before { content: "W"; display: none; }
.res-loss, .res-draw, .res-nc { color: var(--text-secondary); }
.rank { font-size: 1.15rem; font-weight: 700; color: var(--text-secondary); }
tbody tr:first-child .rank { color: var(--accent); }

/* ---------- chart ---------- */
svg.traj {
  width: 100%; height: auto; display: block; margin-top: 10px;
  background: var(--surface-1); border: 1.5px solid var(--rule);
  box-shadow: 6px 6px 0 var(--grid);
}
.traj .grid { stroke: var(--grid); stroke-width: 1; }
.traj .tick { fill: var(--text-secondary); font-size: 11px;
  font-family: "IBM Plex Mono", monospace; }
.traj .band { fill: var(--series-1); opacity: 0.13; }
.traj .line { fill: none; stroke: var(--series-1); stroke-width: 2;
  stroke-linejoin: round; }
.traj .dot { fill: var(--series-1); transition: r .1s; }
.traj .hit { fill: transparent; cursor: crosshair; }
.traj .pt:hover .dot { r: 5.5; }

.tooltip {
  position: fixed; z-index: 10; pointer-events: none;
  background: var(--text-primary); color: var(--paper);
  font-family: "IBM Plex Mono", monospace; font-size: 0.78rem;
  padding: 7px 11px; border-radius: 0; box-shadow: 4px 4px 0 rgb(0 0 0 / .2);
}

/* ---------- footer: brand column, site nav, provenance, legal bar ---- */
footer {
  max-width: var(--content-w); margin: 0 auto; padding: 32px 24px 34px;
  border-top: 3px solid var(--rule); color: var(--text-secondary);
  font-size: 0.9rem;
}
footer .fine { font-family: "IBM Plex Mono", monospace; font-size: 0.72rem;
  letter-spacing: 0.04em; text-transform: uppercase; }
.foot-grid { display: grid; gap: 32px;
  grid-template-columns: minmax(0, 2.2fr) 1fr 1.4fr; }
.foot-brand .brand { font-size: 1.5rem; display: inline-block; }
.foot-brand p { margin: 12px 0 0; font-size: 0.88rem; max-width: 40ch; }
.foot-head { font-family: "IBM Plex Mono", monospace; font-size: 0.62rem;
  text-transform: uppercase; letter-spacing: 0.22em; margin: 6px 0 10px; }
.foot-col a { display: block; padding: 2px 0;
  font-family: "Big Shoulders Display", "Arial Narrow", sans-serif;
  text-transform: uppercase; font-weight: 600; font-size: 0.98rem;
  letter-spacing: 0.08em; color: var(--text-secondary);
  transition: color .15s; }
.foot-col a:hover { color: var(--accent); }
.foot-note { margin: 0 0 6px; font-size: 0.88rem; }
.foot-note.mono { font-size: 0.75rem; }
.foot-bottom { display: flex; justify-content: space-between;
  align-items: baseline; gap: 18px; flex-wrap: wrap;
  border-top: 1px solid var(--grid); margin-top: 28px; padding-top: 14px; }
.foot-bottom .mono { font-size: 0.75rem; }
@media (max-width: 720px) {
  .foot-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 620px) {
  .skillcard { flex-direction: column; }
  .skillcard .stat + .stat { border-left: 0; border-top: 1px solid var(--grid); }
  .top { flex-direction: column; gap: 10px; }
  .top nav a { margin: 0 22px 0 0; }
}

/* event verdict marks: icon + position, never color alone */
.verdict { text-align: center; font-family: "IBM Plex Mono", monospace; }
.verdict.hit { color: var(--text-primary); font-weight: 700; }
.verdict.miss { color: var(--accent); }

/* comparison chart: two validated series, identity never color alone */
:root { --series-2: #eb6834; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) { --series-2: #d95926; }
}
:root[data-theme="dark"] { --series-2: #d95926; }
.traj .line.s2 { stroke: var(--series-2); }
.traj .dot.s2 { fill: var(--series-2); }
.traj .serieslabel { fill: var(--text-primary); font-size: 12px;
  font-family: "IBM Plex Mono", monospace; }
.legend { display: flex; gap: 22px; margin-top: 8px;
  font-family: "IBM Plex Mono", monospace; font-size: 0.78rem;
  color: var(--text-secondary); }
.legend .chip { display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; margin-right: 7px; }
.legend .chip.s1 { background: var(--series-1); }
.legend .chip.s2 { background: var(--series-2); }
.skillcard.metrics { flex-wrap: wrap; }
.skillcard.metrics .stat { cursor: help; padding: 12px 16px 10px; }
.skillcard.metrics .value { font-size: 1.25rem; }
.skillcard.metrics .label { letter-spacing: 0.14em; }

/* UX round (2026-08-13): masthead search, mobile tables, focus, glossary */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mastsearch { position: relative; flex: 1; max-width: 250px; margin: 0 18px; }
.mastsearch #search { max-width: none; padding: 8px 12px; font-size: 0.85rem;
  box-shadow: none; }
.mastsearch #search-results { position: absolute; top: 100%; left: 0;
  width: 380px; right: auto; z-index: 20; margin-top: 4px; max-width: none;
  box-shadow: 5px 5px 0 rgb(0 0 0 / 0.25); }
.ledger .yr td { font-family: "Big Shoulders Display", sans-serif;
  font-size: 1.05rem; font-weight: 700; letter-spacing: 0.06em;
  border-bottom: 2px solid var(--rule); padding-top: 18px; }
details.glossary { margin: 6px 0 0; font-size: 0.88rem; }
details.glossary summary { cursor: pointer; color: var(--text-secondary);
  font-family: "IBM Plex Mono", monospace; font-size: 0.78rem; }
details.glossary dt { font-weight: 600; margin-top: 8px; }
details.glossary dd { margin: 2px 0 0; color: var(--text-secondary); }
@media (max-width: 720px) {
  table.ledger { display: block; overflow-x: auto; white-space: nowrap;
    -webkit-overflow-scrolling: touch; }
  .mastsearch { max-width: none; margin: 8px 0 0; }
}

/* Level-up round (2026-08-13): the print shop details.
   One dramatic move per page type; refinement everywhere else. */

/* Press mark: the red bar a printer runs across the top of the sheet. */
body { border-top: 6px solid var(--accent); }

/* Ink selection */
::selection { background: var(--accent); color: var(--paper); }

/* Double rules, the record-book signature: thick over thin. */
header.top { border-bottom: none; position: relative; }
header.top::after { content: ""; position: absolute; left: 24px; right: 24px;
  bottom: 0; height: 5px;
  border-top: 3px solid var(--rule); border-bottom: 1px solid var(--rule); }
.ledger thead th { border-bottom: 3px double var(--rule); }
footer { border-top: none; position: relative; }
footer::before { content: ""; position: absolute; left: 24px; right: 24px;
  top: 0; height: 5px;
  border-top: 1px solid var(--rule); border-bottom: 3px solid var(--rule); }

/* (A ghost display word behind the hero was tried here and removed:
   it landed in the same space as the real headline and the two display
   texts interleaved. Poster flourishes at this scale need a render
   check before shipping; the lesson stays so it is not retried blind.) */

/* Red tick before section heads: an editorial index mark. */
h2::before { content: ""; width: 9px; height: 9px; background: var(--accent);
  flex: none; }

/* Links: underline that draws in, no layout shift. */
main a { border-bottom: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat; background-position: 0 100%;
  background-size: 0% 1.5px; transition: background-size .18s, color .15s; }
main a:hover { background-size: 100% 1.5px; }

/* Table rows: the hover picks up a corner-red spine. */
.ledger tbody tr:hover { box-shadow: inset 3px 0 0 var(--accent); }

/* Fighter pages read as posters: bigger name, red underline like the hero. */
article.fighter h1 { font-size: clamp(2.6rem, 7vw, 4.4rem); }
article.fighter h1::after { content: ""; display: block; width: 56px;
  height: 5px; background: var(--accent); margin-top: 12px; }

/* Essays (methodology, notes) open with a Spectral drop cap on the first
   PROSE block. Notes lead with a date line (p.sub), which must never get
   the cap: a 3.4em "2" from 2026-08-14 is the bug this selector pair
   fixes. First selector: methodology, whose first p is prose. Second:
   notes, where the first prose p follows the date line. */
.essay > p:first-of-type:not(.sub)::first-letter,
.essay > p.sub + p::first-letter {
  font-family: "Spectral", serif; font-weight: 600;
  font-size: 3.4em; line-height: 0.8; float: left;
  padding: 6px 10px 0 0; color: var(--accent);
}

/* The tale of the tape gets a firmer press on hover: shadow only, no
   transform. Animating transform promotes the card to its own GPU
   layer, which re-rasterizes neighbors and made the CHART's hard-edged
   shadow shimmer on retina displays (invisible to computed-style
   checks and to software-rendered headless browsers; the operator's
   eyes caught it, 2026-08-16). Charts themselves never react: their
   hover job is the point tooltips. */
.skillcard { transition: box-shadow .15s; }
.skillcard:hover { box-shadow: 8px 8px 0 var(--grid); }
@media (prefers-reduced-motion: reduce) {
  .skillcard { transition: none; }
}

/* Interactivity round (2026-08-13): movers, compare, your picks */
.movers { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.movers caption { text-align: left; font-family: "Big Shoulders Display",
  sans-serif; font-size: 1.05rem; font-weight: 700; text-transform:
  uppercase; letter-spacing: 0.06em; padding-bottom: 6px; }
.delta.up { color: var(--series-1); font-weight: 600; }
.delta.down { color: var(--accent); font-weight: 600; }
.cmp-pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  margin: 18px 0; }
.cmp-picker { position: relative; }
.cmp-picker label { display: block; font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--text-secondary); margin-bottom: 6px; }
.cmp-picker input { width: 100%; padding: 10px 14px; font-size: 0.95rem;
  font-family: "IBM Plex Mono", monospace; border: 1.5px solid var(--rule);
  background: var(--surface-1); color: var(--text-primary);
  box-shadow: 4px 4px 0 var(--grid); }
.cmp-picker input:focus { outline: none; box-shadow: 4px 4px 0 var(--accent); }
.cmp-picker ul { list-style: none; margin: 4px 0 0; padding: 0;
  position: absolute; left: 0; right: 0; z-index: 40;
  background: var(--text-primary);
  box-shadow: 5px 5px 0 rgb(0 0 0 / 0.25); }
.cmp-picker ul[hidden] { display: none; }
.cmp-picker li a { display: flex; justify-content: space-between; gap: 10px;
  padding: 9px 12px; color: var(--paper); }
.cmp-picker li a:hover, .cmp-picker li.active a { background: var(--accent); }
.cmp-picker .meta { color: var(--paper); opacity: 0.65; font-size: 0.78rem; white-space: nowrap; }
table.tape { max-width: 620px; margin: 18px 0; }
.tape th { text-align: center; }
.tape .corner-red { color: var(--series-2); }
.tape .corner-blue { color: var(--series-1); }
.pickcell { white-space: nowrap; }
.pickbtn { font-family: "IBM Plex Mono", monospace; font-size: 0.75rem;
  padding: 4px 9px; margin-right: 6px; cursor: pointer;
  border: 1.5px solid var(--grid); background: var(--surface-1);
  color: var(--text-primary); transition: border-color .12s, box-shadow .12s; }
.pickbtn:hover { border-color: var(--rule); }
.pickbtn.selected { border-color: var(--accent);
  box-shadow: 2px 2px 0 var(--accent); font-weight: 600; }
.mypicks { color: var(--text-primary); }
@media (max-width: 720px) {
  .movers, .cmp-pickers { grid-template-columns: 1fr; }
}

/* Odds on upcoming cards: a quiet best-price button per bout, expanding
   to the full line sheet in a ledger-within-the-ledger row. */
.oddsbtn { font-family: "IBM Plex Mono", monospace; font-size: 0.82rem;
  padding: 4px 9px; cursor: pointer; white-space: nowrap;
  min-width: 8em; text-align: center;
  border: 1.5px solid var(--grid); background: var(--surface-1);
  color: var(--text-primary); transition: border-color .12s; }
.oddsbtn:hover { border-color: var(--rule); }
.oddsbtn.open { border-color: var(--accent); }
.oddsbtn .nbooks { display: block; font-size: 0.6rem; text-transform:
  uppercase; letter-spacing: 0.14em; color: var(--text-secondary);
  margin-top: 2px; }
tr.oddsdetail > td { background: var(--surface-1);
  box-shadow: inset 3px 0 0 var(--accent); padding: 4px 16px 16px; }
tr.oddsdetail:hover, tr.oddsdetail > td:hover { background: var(--surface-1); }
.sheethead { font-family: "IBM Plex Mono", monospace; font-size: 0.62rem;
  text-transform: uppercase; letter-spacing: 0.22em;
  color: var(--text-secondary); margin: 8px 0 2px; }
table.linesheet { width: auto; min-width: 300px; }
.linesheet td, .linesheet th { padding: 5px 14px 5px 0; }
.linesheet td.best { font-weight: 700; color: var(--series-1); }
.morebooks td { padding-top: 8px; }
.morebooks button { font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 3px 9px; cursor: pointer; border: 1.5px solid var(--grid);
  background: var(--surface-1); color: var(--text-secondary); }
.morebooks button:hover { border-color: var(--rule);
  color: var(--text-primary); }

.nextcard { font-size: 1.15rem; }
.nextcard a { font-family: "Big Shoulders Display", sans-serif;
  font-size: 1.5rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.02em; margin-right: 10px; }
.nextcard .hint { display: block; margin-top: 2px; }
