:root {
  --paper: #f3efe6;
  --card: #fffdf8;
  --ink: #17150f;
  --muted: #6b665b;
  --line: #d9d2c3;
  --accent: #ff5a1f;
  --good: #1f7a4d;
  --bad: #c2261b;
  --good-bg: #e6f3ec;
  --bad-bg: #fbe9e7;
  --hit-bg: #ffe3d6;
  --ad-a: #e9e3d6;
  --ad-b: #e3dccd;
  --ad-line: #a79f8d;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15130f;
    --card: #1e1b16;
    --ink: #f0ebe0;
    --muted: #a39d8f;
    --line: #3a352c;
    --accent: #ff6a33;
    --good: #52b883;
    --bad: #ef6b5f;
    --good-bg: #173326;
    --bad-bg: #3a1a17;
    --hit-bg: #4a2616;
    --ad-a: #25221c;
    --ad-b: #2b2720;
    --ad-line: #5a5446;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #15130f;
  --card: #1e1b16;
  --ink: #f0ebe0;
  --muted: #a39d8f;
  --line: #3a352c;
  --accent: #ff6a33;
  --good: #52b883;
  --bad: #ef6b5f;
  --good-bg: #173326;
  --bad-bg: #3a1a17;
  --hit-bg: #4a2616;
  --ad-a: #25221c;
  --ad-b: #2b2720;
  --ad-line: #5a5446;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.5 var(--sans);
  min-height: 100vh;
}
button { font: inherit; color: inherit; cursor: pointer; }

.wrap { max-width: 640px; margin: 0 auto; padding: 24px 16px 64px; }

.top {
  display: flex; justify-content: space-between; align-items: center;
  font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); padding-bottom: 14px; border-bottom: 1.5px solid var(--ink);
  margin-bottom: 28px;
}
.top a { color: inherit; text-decoration: none; }
.top a:hover { color: var(--ink); }
.pips { display: flex; gap: 5px; }
.pip { width: 18px; height: 6px; background: var(--line); }
.pip.on { background: var(--ink); }
.pip.good { background: var(--good); }
.pip.bad { background: var(--bad); }

h1 {
  font: 400 clamp(52px, 13vw, 84px)/.92 var(--serif);
  letter-spacing: -.02em; margin: 8px 0 18px;
}
h1 em { color: var(--accent); }
h2 { font: 400 clamp(30px, 7vw, 40px)/1.05 var(--serif); margin: 0 0 18px; }
.lede { font-size: 19px; max-width: 34ch; margin: 0 0 28px; }
.small { font-size: 13px; color: var(--muted); }
.kicker { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--paper); border: 0;
  padding: 15px 22px; font-weight: 600; font-size: 16px;
  text-decoration: none;
  transition: transform .08s ease, background .15s;
}
.btn:hover { background: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }

/* Rx label card */
.rx {
  background: var(--card); border: 1.5px solid var(--ink);
  padding: 18px 18px 16px; margin-bottom: 22px; position: relative;
}
.rx-row { display: flex; justify-content: space-between; gap: 12px; font: 12px/1.4 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.rx-name { font: 700 clamp(30px, 8vw, 44px)/1 var(--sans); letter-spacing: -.02em; margin: 14px 0 4px; text-transform: uppercase; }
.rx-generic { font: 15px/1.3 var(--mono); color: var(--muted); }
.rx-stripe { height: 8px; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 5px); margin-top: 14px; opacity: .8; }

.q { font-weight: 600; font-size: 19px; margin: 0 0 14px; }
.opts { display: grid; gap: 10px; }
.opt {
  text-align: left; background: var(--card); border: 1.5px solid var(--line);
  padding: 15px 16px; font-size: 17px; line-height: 1.35;
  display: flex; gap: 14px; align-items: baseline;
  transition: border-color .12s, background .12s;
}
.opt:hover:not(:disabled) { border-color: var(--ink); }
.opt:disabled { cursor: default; }
.opt .k { font: 500 13px var(--mono); color: var(--muted); flex: none; }
.opt.right { border-color: var(--good); background: var(--good-bg); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt.dim { opacity: .45; }

/* Reveal */
.reveal { margin-top: 26px; animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.verdict { font: 400 38px/1 var(--serif); margin: 0 0 6px; }
.verdict.good { color: var(--good); }
.verdict.bad { color: var(--bad); }
.quip { font-size: 18px; margin: 0 0 20px; }

.boxed {
  border: 3px solid var(--ink); padding: 14px 16px; background: var(--card); margin-bottom: 14px;
}
.boxed .kicker { display: block; margin-bottom: 8px; color: var(--ink); }
.boxed blockquote { margin: 0; font: 14px/1.55 var(--mono); }
.boxed .src { margin-top: 10px; font-size: 12px; color: var(--muted); }
.boxed .src a { color: inherit; }

.stat { display: flex; gap: 16px; align-items: baseline; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.stat b { font: 400 44px/1 var(--serif); flex: none; }
.stat p { margin: 0; font-size: 15px; }
.stat p .small { display: block; margin-top: 4px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

/* End screen */
.score { font: 400 clamp(90px, 26vw, 150px)/.85 var(--serif); margin: 10px 0 4px; }
.score span { color: var(--muted); font-size: .45em; }
.rank { font: 700 22px/1.2 var(--sans); text-transform: uppercase; letter-spacing: -.01em; margin: 0 0 8px; }
.recap { list-style: none; padding: 0; margin: 26px 0; border-top: 1.5px solid var(--ink); }
.recap li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.recap .m { font: 600 13px var(--mono); flex: none; width: 18px; }
.recap .m.good { color: var(--good); }
.recap .m.bad { color: var(--bad); }

.foot { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.foot a { color: inherit; }

.hidden { display: none !important; }

/* Index picker */
.pick { display: grid; gap: 14px; margin-top: 10px; }
.pick a {
  display: block; text-decoration: none; color: inherit; background: var(--card);
  border: 1.5px solid var(--ink); padding: 20px 20px 18px; transition: transform .1s, box-shadow .1s;
}
.pick a:hover { transform: translate(-3px, -3px); box-shadow: 3px 3px 0 var(--ink); }
.pick h3 { font: 400 34px/1 var(--serif); margin: 10px 0 8px; }
.pick p { margin: 0; font-size: 15px; color: var(--muted); }

/* Narrator: TV screen */
.tv {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #000;
  border: 1.5px solid var(--ink); margin-bottom: 22px;
}
.scene {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 78% 24%, #fff6c9 0 7%, #ffd66b 8% 13%, transparent 14%),
    linear-gradient(180deg, #8fd0ff 0%, #bfe6ff 48%, #f4d9a4 49%, #e9c27f 100%);
}
.scene .hill { position: absolute; left: -10%; right: -10%; bottom: -30%; height: 62%; background: #7cbf6a; border-radius: 50% 50% 0 0; }
.scene .hill.b { left: 30%; right: -40%; bottom: -36%; background: #5fa653; }
.brand-mark {
  position: absolute; left: 6%; top: 12%; color: #fff;
  font: 800 clamp(30px, 8vw, 54px)/1 var(--sans); letter-spacing: -.03em;
  text-shadow: 0 2px 18px rgba(0,0,0,.18);
}
.tagline { position: absolute; left: 6%; top: calc(12% + clamp(36px, 9.5vw, 62px)); color: #fff; font: italic 400 clamp(17px, 4vw, 24px)/1.2 var(--serif); text-shadow: 0 1px 10px rgba(0,0,0,.2); max-width: 70%; }
.fineprint {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 7px 10px 8px;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.55) 22%);
  color: #fff; font: 9.5px/1.35 var(--sans); padding-top: 22px;
}
@media (min-width: 560px) { .fineprint { font-size: 11px; } }
.fineprint span { opacity: 0; transition: opacity .2s; }
.fineprint span.on { opacity: 1; }
.timer { position: absolute; left: 0; top: 0; height: 4px; background: var(--accent); width: 0; }
.onair { position: absolute; right: 10px; top: 12px; font: 600 11px var(--mono); color: #fff; background: rgba(0,0,0,.35); padding: 4px 7px; letter-spacing: .08em; }
.tv.off .scene, .tv.off .fineprint, .tv.off .brand-mark, .tv.off .tagline { visibility: hidden; }
.tv.off { aspect-ratio: auto; height: 64px; }
.tv.off::after {
  content: "The ad is over."; position: absolute; inset: 0; display: grid; place-items: center;
  color: #888; font: 400 22px var(--serif);
  background: repeating-linear-gradient(0deg, #0c0c0c 0 2px, #111 2px 4px);
}
.clock { font: 600 14px var(--mono); color: var(--bad); float: right; }
.fulllist { margin: 0; padding-left: 18px; font: 14px/1.6 var(--mono); }
.fulllist li.hit { background: var(--hit-bg); font-weight: 600; }
.toggle { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); margin-left: 6px; }

/* Daily quiz */
.watch { border-left: 4px solid var(--accent); background: var(--card); padding: 12px 14px; margin-bottom: 14px; }
.watch .kicker { display: block; margin-bottom: 6px; color: var(--accent); }
.watch p { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.4; }
.subhead { font: 400 28px/1.1 var(--serif); margin: 34px 0 12px; }
.next { font: 500 14px var(--mono); color: var(--muted); margin: 0 0 8px; }
.next b { color: var(--ink); font-weight: 600; font-size: 18px; margin-left: 6px; }
.statgrid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1.5px solid var(--ink); background: var(--card); }
.statgrid div { padding: 12px 6px 10px; text-align: center; border-left: 1px solid var(--line); }
.statgrid div:first-child { border-left: 0; }
.statgrid b { display: block; font: 400 34px/1 var(--serif); }
.statgrid span { font: 500 10px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.statgrid.slim { grid-template-columns: repeat(3, 1fr); margin-top: 22px; }
.dist { margin-top: 12px; display: grid; gap: 4px; }
.dist .bar { display: flex; align-items: center; gap: 8px; font: 500 12px var(--mono); }
.dist .bar span { width: 10px; color: var(--muted); }
.dist .bar i { font-style: normal; background: var(--line); color: var(--ink); padding: 2px 6px; text-align: right; min-width: 22px; }
.dist .bar.me i { background: var(--accent); color: #fff; }
.archive { list-style: none; padding: 0; margin: 0; border-top: 1.5px solid var(--ink); }
.archive a { display: flex; justify-content: space-between; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; font-size: 15px; }
.archive a:hover span { text-decoration: underline; }
.archive b { font: 500 13px var(--mono); color: var(--muted); }
.bonus { margin-top: 26px; }
.bonus a { color: var(--ink); }
@media (max-width: 380px) { .statgrid b { font-size: 28px; } .statgrid span { font-size: 9px; } }
@media (max-width: 480px) { .rx-row span + span { display: none; } }
.sharebox { width: 100%; font: 14px/1.4 var(--mono); padding: 10px; border: 1.5px solid var(--ink); background: var(--card); color: var(--ink); resize: none; }

/* About and awareness copy */
.how { font-size: 16px; color: var(--muted); max-width: 40ch; margin: -14px 0 26px; }
.pagehead { font: 400 clamp(38px, 10vw, 56px)/.98 var(--serif); letter-spacing: -.01em; margin: 10px 0 18px; text-wrap: balance; }
.pagehead em { color: var(--accent); }
#about > p { max-width: 60ch; }
.aware { border-top: 1.5px solid var(--ink); padding-top: 14px; margin: 8px 0 26px; }
.aware .kicker { display: block; margin-bottom: 8px; color: var(--accent); }
.aware p { margin: 0; font-size: 16px; line-height: 1.5; max-width: 60ch; }
.aware a { color: var(--ink); }
.pillars { display: grid; margin: 0 0 28px; border-top: 1px solid var(--line); }
.pillars div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.pillars dt { font: 700 13px/1.2 var(--sans); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.pillars dd { margin: 0; font-size: 15px; color: var(--muted); max-width: 60ch; }
.foot a[href="#about"], .foot a[href$=".html"], .foot a[href^="mailto:"] { color: var(--ink); font-weight: 600; }
#end .next { margin-top: 22px; }
#end .recap { margin-top: 0; }
.aware-line { margin: 30px 0 0; padding-top: 14px; border-top: 1.5px solid var(--ink); font-size: 15px; }
.aware-line a { color: var(--ink); font-weight: 600; white-space: nowrap; }

/* Pill mascot */
.pill { display: block; overflow: visible; }
.pill .hi { fill: var(--accent); stroke: var(--ink); stroke-width: 3.5; stroke-linejoin: round; }
.pill .lo { fill: var(--card); stroke: var(--ink); stroke-width: 3.5; stroke-linejoin: round; }
.pill .shine { stroke: var(--line); stroke-width: 3; stroke-linecap: round; fill: none; }
.pill .eye { fill: #fffdf8; stroke: var(--ink); stroke-width: 1.6; }
.pill .ink { fill: #17150f; }
.pill .line { fill: none; stroke: #17150f; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pill .line.thin { stroke-width: 1.8; }
.pill .spin { stroke: var(--ink); }
.pill .spark { fill: var(--accent); stroke: var(--ink); stroke-width: 1; }
.pill .drop { fill: #cfe3ef; stroke: var(--ink); stroke-width: 1.4; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.brand .pill { width: 26px; height: 26px; margin: -6px 0 -6px -4px; }
.brand b { font: 400 17px/1 var(--serif); letter-spacing: 0; text-transform: none; }
.h1pill { display: inline-block; width: .85em; height: .85em; vertical-align: -.08em; margin-left: .06em; }
.h1pill .pill { width: 100%; height: 100%; }
.verdict { display: flex; align-items: center; gap: 10px; }
.verdict .pill { width: 52px; height: 52px; flex: none; margin: -6px 0 -6px -6px; }
.scorerow { display: flex; align-items: center; gap: 8px; }
.scorerow .pill { width: clamp(96px, 26vw, 140px); height: auto; aspect-ratio: 1; max-width: 100%; }
@media (prefers-reduced-motion: no-preference) {
  .reveal .pill, .scorerow .pill { animation: bob .6s cubic-bezier(.3,1.6,.5,1) both; }
  @keyframes bob { from { transform: scale(.6) rotate(-12deg); opacity: 0; } }
}
