/* ─────────────────────────────────────────────────────────────────────────────
   Illiterati — the chart sheet.

   The society's engraving, printed on newsprint rather than struck in green. The
   inversion is functional, not decorative: a cover is how a listener tells one
   book from another, and covers die on a dark saturated ground with ornament
   behind them. Here the paper is the field, the green is the ink, and nothing
   is laid behind a row of books.

   Type has four jobs and four faces:
     Bodoni Moda   the masthead and chart positions — engraved didone
     Cinzel        mottos and section heads, anything inscribed rather than set
     Public Sans   titles, authors, everything read at length
     Courier Prime measured data — runtimes, ratings, serials, dates
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  --paper:      #F2EFE6;
  --paper-2:    #EAE5D9;
  --paper-3:    #E1DBCC;
  --ink:        #14120E;
  --ink-2:      #4A453B;
  --ink-3:      #746D5E;
  --green:      #123A2A;
  --green-2:    #1D5540;
  --gold:       #7A5F14;
  --gold-lift:  #C9A227;
  --down:       #8C3A22;

  --rule:        rgba(20, 18, 14, .82);
  --rule-mid:    rgba(20, 18, 14, .28);
  --rule-faint:  rgba(20, 18, 14, .14);

  --page:   1220px;
  --pad:    clamp(16px, 2.4vw, 32px);

  --step--2: .6875rem;
  --step--1: .8125rem;
  --step-0:  1rem;
  --step-1:  1.125rem;

  --sans:    "Public Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --display: "Bodoni Moda", Georgia, "Times New Roman", serif;
  --incise:  "Cinzel", Georgia, serif;
  --data:    "Courier Prime", ui-monospace, "SF Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--green) var(--paper-3); }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--green); color: var(--paper); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--paper-3); }
::-webkit-scrollbar-thumb { background: var(--green); border: 3px solid var(--paper-3); border-radius: 8px; }

a { color: inherit; }
img { max-width: 100%; }
input, button, select { font: inherit; color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--green); color: var(--paper); padding: 12px 18px;
  font: 700 var(--step--1)/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
}
.skip:focus { left: 12px; top: 12px; }

/* ── the sheet ─────────────────────────────────────────────────────────────
   One printed page. The engraved ground lives in the masthead only; below the
   first rule the paper stays clean so the covers carry the page.            */

.sheet { max-width: var(--page); margin: 0 auto; padding: clamp(10px, 1.6vw, 20px); }
.plate { position: relative; overflow: hidden; padding: 0 var(--pad) clamp(24px, 3vw, 36px); }
.plate > * { position: relative; z-index: 2; }

.ground { position: absolute; inset: 0 0 auto; height: 210px; overflow: hidden; pointer-events: none; color: var(--green); z-index: 0;
  -webkit-mask-image: linear-gradient(#000 62%, transparent); mask-image: linear-gradient(#000 62%, transparent); }
.ground__mark { position: absolute; display: block; line-height: 0; }
.rosette { position: absolute; pointer-events: none; z-index: 1; color: var(--green); opacity: .5; }
.rosette--tl { top: -150px; left: -140px; }
.rosette--br { display: none; }
@media (max-width: 760px) { .rosette { display: none; } }

/* ── masthead ──────────────────────────────────────────────────────────── */

.head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 12px; }
.head__serial { font: 400 var(--step--2)/1 var(--data); letter-spacing: .16em; color: var(--gold); }
.head__nav { margin-left: auto; display: flex; gap: clamp(12px, 2vw, 24px); flex-wrap: wrap; }
.head__nav a {
  font: 600 var(--step--2)/1 var(--sans); letter-spacing: .15em; text-transform: uppercase;
  text-decoration: none; color: var(--ink-2); padding-bottom: 3px; border-bottom: 2px solid transparent;
}
.head__nav a:hover { color: var(--ink); }
.head__nav a[aria-current] { color: var(--green); border-bottom-color: var(--green); }

.crest { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: clamp(12px, 2.4vw, 22px); margin-top: 12px; }
.crest__motto { font: 600 var(--step--2)/1.6 var(--incise); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.crest__motto--left { text-align: right; }
.crest__seal { width: 52px; height: 52px; border-radius: 50%; display: block; }

/* The society line is a strapline under the seal, not a headline. What a visitor came for is the
   chart, and every pixel this used to take was a book they could not see. */
.declare {
  margin: 8px auto 12px; max-width: 48ch; text-align: center;
  font: 600 var(--step--2)/1.5 var(--incise);
  letter-spacing: .3em; text-transform: uppercase; color: var(--gold); text-wrap: balance;
}
/* Section pages still need a real title, but a modest one. */
.declare--sub {
  margin: 10px auto 6px; max-width: 26ch; color: var(--green);
  font: 900 clamp(22px, 3.2vw, 38px)/1.05 var(--display);
  letter-spacing: -.018em;
}

/* ── the denomination strip ────────────────────────────────────────────── */

.denom { display: flex; flex-wrap: wrap; border-top: 2px solid var(--rule); border-bottom: 1px solid var(--rule); }
.denom a {
  flex: 1 1 118px; text-align: center; padding: 8px 8px; text-decoration: none; color: var(--ink);
  font: 600 var(--step--2)/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  border-right: 1px solid var(--rule-faint);
}
.denom a:last-child { border-right: 0; }
.denom a:hover { background: var(--green); color: var(--paper); }
.denom a[aria-current] { background: var(--green); color: var(--paper); }

/* ── the slot ──────────────────────────────────────────────────────────── */

.slot { display: flex; margin-top: 12px; border: 2px solid var(--green); background: #fff; }
.slot input { flex: 1; min-width: 0; background: transparent; border: 0; font: 400 var(--step-1)/1 var(--data); padding: 13px 15px; outline: none; }
.slot input::placeholder { color: var(--ink-3); }
.slot button {
  padding: 13px clamp(14px, 2.4vw, 24px); background: var(--green); color: var(--paper); border: 0; cursor: pointer;
  font: 700 var(--step--2)/1 var(--sans); letter-spacing: .16em; text-transform: uppercase;
}
.slot button:hover { background: var(--green-2); }

/* ── section rules ─────────────────────────────────────────────────────── */

.rule-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-top: clamp(20px, 2.4vw, 28px); padding-bottom: 6px; border-bottom: 2px solid var(--rule); }
.rule-head h2 { font: 600 var(--step-0)/1.3 var(--incise); letter-spacing: .22em; text-transform: uppercase; color: var(--green); }
.rule-head p { margin-left: auto; font: 400 var(--step--2)/1.4 var(--data); letter-spacing: .08em; color: var(--ink-3); }
.rule-head a { margin-left: auto; font: 700 var(--step--2)/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--green); }

/* ── the chart ─────────────────────────────────────────────────────────────
   Two picks to a line, and the cover carries each one. Aligned narrator/length/
   rating columns were the right answer at full width; at half width they cannot
   coexist with a cover this size, and the cover is what a listener buys by. The
   three facts fold into one spec line instead, still tabular-figured so numbers
   stack down a column.                                                       */

.chart { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(18px, 2.4vw, 34px); }
.pick {
  display: grid; grid-template-columns: 30px auto minmax(0, 1fr);
  gap: 0 clamp(10px, 1.2vw, 15px); align-items: start;
  padding: 10px 0; border-bottom: 1px solid var(--rule-faint); min-width: 0;
}
.pick:hover { background: var(--paper-2); }

.pick__pos {
  display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
  font: 900 clamp(16px, 1.7vw, 21px)/1 var(--display); color: var(--green);
  font-variant-numeric: tabular-nums; align-self: start; padding-top: 4px;
}
.chart[data-unnumbered] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart[data-unnumbered] .pick { grid-template-columns: 0 auto minmax(0, 1fr); }
.chart[data-unnumbered] .pick__pos { display: none; }

.pick__art { display: block; line-height: 0; }
.cover {
  width: clamp(72px, 7vw, 96px); height: clamp(72px, 7vw, 96px);
  object-fit: cover; display: block;
  border: 1px solid var(--rule-mid); background: var(--paper-3);
  box-shadow: 0 1px 2px rgba(20,18,14,.16), 0 8px 18px -8px rgba(20,18,14,.48);
  transition: box-shadow .15s ease, transform .15s ease;
}
.pick__art:hover .cover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(20,18,14,.18), 0 14px 26px -10px rgba(20,18,14,.55); }
.cover--blank { display: grid; place-items: center; color: var(--green); opacity: .4; }
.title-head__art.cover--blank { aspect-ratio: 1; }

/* The body is as tall as the cover, so the buy control costs no extra row height. */
.pick__body { display: flex; flex-direction: column; gap: 1px; min-width: 0; min-height: clamp(72px, 7vw, 96px); }
.pick__body .buy-link { margin-top: auto; align-self: flex-start; }
.entry__title { font: 600 var(--step-0)/1.3 var(--sans); text-decoration: none; color: var(--ink); }
.entry__title:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.entry__by { font-size: var(--step--1); color: var(--ink-2); }
.entry__spec { margin-top: 2px; font: 400 var(--step--2)/1.45 var(--data); color: var(--ink-3); font-variant-numeric: tabular-nums; }
/* Why a recommendation is here. A row that cannot say why is indistinguishable from an ad. */
.entry__why { margin-top: 2px; font: 400 var(--step--2)/1.3 var(--data); color: var(--gold); letter-spacing: .02em; }

/* Movement, only ever rendered when a real prior standing exists. */
.move { font: 700 var(--step--2)/1 var(--data); letter-spacing: .02em; white-space: nowrap; }
.move--up { color: var(--green-2); }
.move--down { color: var(--down); }
.move--same { color: var(--ink-3); }
.move--new { color: var(--gold); text-transform: uppercase; letter-spacing: .06em; }

.buy-link {
  display: inline-block; text-decoration: none; white-space: nowrap;
  font: 700 var(--step--2)/1 var(--sans); letter-spacing: .13em; text-transform: uppercase;
  background: var(--green); color: var(--paper); padding: 8px 11px; border: 1px solid var(--green);
}
.buy-link:hover { background: var(--gold-lift); border-color: var(--gold-lift); color: var(--ink); }

/* One column before the two-up gets cramped, and the buy button drops below the text. */
@media (max-width: 1080px) {
  .chart, .chart[data-unnumbered] { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .pick { grid-template-columns: 26px auto minmax(0, 1fr); }
  .chart[data-unnumbered] .pick { grid-template-columns: 0 auto minmax(0, 1fr); }
  .pick__body { min-height: 0; gap: 3px; }
  .pick__body .buy-link { margin-top: 6px; }
}

/* ── the index ─────────────────────────────────────────────────────────── */

.index-grid { display: grid; gap: 1px; background: var(--rule-mid); border: 1px solid var(--rule-mid); grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); margin-top: 14px; }
.index-grid a { background: var(--paper); padding: 12px 14px; text-decoration: none; display: block; }
.index-grid a:hover { background: var(--green); color: var(--paper); }
.index-grid a:hover span { color: var(--paper); }
.index-grid b { display: block; font: 600 var(--step-0)/1.25 var(--sans); }
.index-grid span { display: block; margin-top: 3px; font: 400 var(--step--2)/1 var(--data); color: var(--gold); letter-spacing: .06em; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chips a { text-decoration: none; border: 1px solid var(--rule-mid); padding: 7px 10px; font: 400 var(--step--2)/1 var(--data); letter-spacing: .04em; }
.chips a:hover { background: var(--green); color: var(--paper); border-color: var(--green); }

/* ── a single title ────────────────────────────────────────────────────── */

.title-head { display: grid; grid-template-columns: minmax(0, 210px) minmax(0, 1fr); gap: clamp(18px, 3vw, 34px); margin-top: clamp(16px, 2.4vw, 26px); align-items: start; }
.title-head__art { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--rule-mid); display: block; box-shadow: 0 2px 4px rgba(20,18,14,.14), 0 18px 34px -18px rgba(20,18,14,.5); }
.title-head h1 { font: 900 clamp(26px, 4vw, 44px)/1.02 var(--display); letter-spacing: -.016em; text-wrap: balance; color: var(--green); }
.title-head .sub { margin-top: 8px; font-size: var(--step-1); color: var(--ink-2); }
.title-head .by { margin-top: 10px; font: 600 var(--step-1)/1 var(--incise); letter-spacing: .08em; color: var(--gold); }
.facts { display: flex; flex-wrap: wrap; margin-top: 16px; border: 1px solid var(--rule-mid); width: fit-content; max-width: 100%; }
.facts div { padding: 8px 13px; border-right: 1px solid var(--rule-faint); }
.facts div:last-child { border-right: 0; }
.facts dt { font: 400 var(--step--2)/1 var(--data); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.facts dd { margin-top: 4px; font: 600 var(--step-0)/1 var(--sans); font-variant-numeric: tabular-nums; }

.buy { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-top: 18px; }
.buy__link { display: grid; gap: 3px; padding: 12px 14px; text-decoration: none; border: 1px solid var(--rule-mid); background: #fff; }
.buy__link:hover { border-color: var(--green); }
.buy__link--primary { background: var(--green); color: var(--paper); border-color: var(--green); }
.buy__link--primary:hover { background: var(--green-2); }
.buy__link--drm { border-color: var(--gold); border-width: 2px; }
.buy__label { font: 700 var(--step-0)/1.2 var(--sans); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.buy__note { font-size: var(--step--1); color: var(--ink-2); }
.buy__link--primary .buy__note { color: rgba(242,239,230,.86); }
.tag-drm { font: 700 var(--step--2)/1 var(--sans); letter-spacing: .09em; text-transform: uppercase; border: 1px solid var(--gold); color: var(--gold); padding: 3px 6px; white-space: nowrap; }
.buy__link--primary .tag-drm { border-color: var(--paper); color: var(--paper); }
.tag-drm--solid { background: var(--gold); color: var(--paper); border-color: var(--gold); }

.drm { margin-top: 16px; padding: 14px 16px; border: 2px solid var(--gold); background: rgba(201,162,39,.12); }
.drm__head { font: 600 var(--step-1)/1.4 var(--sans); display: flex; gap: 9px; align-items: baseline; flex-wrap: wrap; }
.drm__body { margin-top: 6px; font-size: var(--step--1); color: var(--ink-2); }
.drm a { color: var(--green); font-weight: 700; }

.prose { max-width: 68ch; margin-top: clamp(20px, 3vw, 30px); }
.prose h2 { font: 600 var(--step-0)/1.3 var(--incise); letter-spacing: .22em; text-transform: uppercase; color: var(--green); margin-bottom: 10px; padding-bottom: 7px; border-bottom: 2px solid var(--rule); }
.prose h3 { font: 600 var(--step-1)/1.3 var(--sans); margin: 20px 0 6px; }
.prose p { margin-bottom: 13px; }
.prose ul { margin: 0 0 13px 20px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--green); }
.prose code { font: 400 .9em var(--data); background: var(--paper-3); padding: 1px 5px; }

.crumbs { font: 400 var(--step--2)/1.6 var(--data); letter-spacing: .06em; color: var(--ink-3); margin-top: 14px; }
.crumbs a { color: var(--green); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.disclosure { margin-top: 14px; font-size: var(--step--1); color: var(--ink-3); max-width: 66ch; padding-left: 12px; border-left: 2px solid var(--gold); }

.search-note { margin-top: 14px; font: 400 var(--step--1)/1.5 var(--data); color: var(--ink-2); }
.results:empty { display: none; }

/* ── device page ───────────────────────────────────────────────────────── */

.device { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 290px); gap: clamp(20px, 4vw, 48px); align-items: center; margin-top: clamp(18px, 2.6vw, 28px); }
.device__shot { width: 100%; border: 1px solid var(--rule-mid); display: block; box-shadow: 0 2px 4px rgba(20,18,14,.14), 0 20px 40px -20px rgba(20,18,14,.5); }
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 250px); gap: clamp(18px, 3vw, 40px); align-items: center; padding: clamp(20px, 3vw, 30px) 0; border-bottom: 1px solid var(--rule-faint); }
.feature:nth-child(even) > .feature__art { order: -1; }
.feature h3 { font: 900 clamp(20px, 2.6vw, 30px)/1.1 var(--display); letter-spacing: -.01em; color: var(--green); }
.feature p { margin-top: 10px; color: var(--ink-2); max-width: 56ch; }
.feature ul { margin: 12px 0 0 18px; color: var(--ink-2); font-size: var(--step--1); }
.placeholder { display: grid; place-items: center; aspect-ratio: 390/844; border: 1px dashed var(--rule-mid); color: var(--ink-3); font: 400 var(--step--1)/1.4 var(--data); text-align: center; padding: 20px; box-shadow: none; }
@media (max-width: 760px) { .device, .feature { grid-template-columns: 1fr; } .feature:nth-child(even) > .feature__art { order: 0; } }

/* ── foot ──────────────────────────────────────────────────────────────── */

.foot { max-width: var(--page); margin: 0 auto; padding: clamp(20px, 3vw, 32px) clamp(16px, 3vw, 32px) clamp(40px, 5vw, 58px); border-top: 2px solid var(--rule); }
.foot__cols { display: grid; gap: clamp(18px, 3vw, 34px); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.foot h2 { font: 600 var(--step--2)/1 var(--incise); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin-bottom: 9px; }
.foot a { display: block; text-decoration: none; font-size: var(--step--1); color: var(--ink-2); padding: 3px 0; }
.foot a:hover { color: var(--green); }
.foot__fine { margin-top: clamp(18px, 3vw, 28px); padding-top: 14px; border-top: 1px solid var(--rule-faint); font-size: var(--step--2); color: var(--ink-3); display: grid; gap: 6px; max-width: 78ch; }
.foot__fine a { display: inline; color: var(--green); }

@media (max-width: 640px) {
  .crest { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .crest__motto--left { text-align: center; }
  .title-head { grid-template-columns: 1fr; }
  .title-head__art { max-width: 190px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
