:root {
  --desk: #e7e5df;
  --paper: #fbfbf8;
  --ink: #17160f;
  --muted: #6b6960;
  --line: #d3d0c6;
  --stamp: #c2321f;
  --st-court: #f3d33f;
  --st-press: #9cc3e6;
  --st-company: #b9d8a6;
  --st-sec: #e9b7c4;
  --st-book: #d9c7ef;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 8px 24px -12px rgba(0, 0, 0, 0.22);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --desk: #121210;
    --paper: #1b1b18;
    --ink: #ecebe4;
    --muted: #9a978c;
    --line: #34332e;
    --stamp: #ff6a4d;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 28px -12px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font: 400 17px/1.55 var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a:hover { color: var(--stamp); }
:focus-visible { outline: 2px solid var(--stamp); outline-offset: 2px; }
button { font: inherit; color: inherit; touch-action: manipulation; cursor: pointer; }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* top bar */
.top { border-bottom: 1px solid var(--ink); display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-top: 26px; padding-bottom: 18px; }
.mark { font: italic 500 26px/1 var(--serif); text-decoration: none; letter-spacing: -0.01em; }
.top nav { display: flex; gap: 22px; font: 500 12.5px/1 var(--mono); }
.top nav a { text-decoration: none; }

/* hero */
.hero { padding-top: 48px; padding-bottom: 28px; }
.hero h1 {
  font: 400 clamp(44px, 7vw, 100px)/0.96 var(--serif);
  letter-spacing: -0.035em;
  margin: 0 0 30px;
  max-width: 20ch;
  text-wrap: balance;
}
.sub { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: end; }
.sub p { margin: 0; max-width: 54ch; font-size: 20px; line-height: 1.45; color: var(--ink); }
.sub .stat { font: 400 12.5px/1.9 var(--mono); color: var(--muted); text-align: right; text-transform: uppercase; letter-spacing: 0.04em; }
.sub .stat span { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* featured sheets */
.sheets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px; padding-top: 30px; padding-bottom: 70px; }
.sheet {
  position: relative;
  display: block;
  background: var(--paper);
  box-shadow: var(--shadow);
  border-radius: 2px;
  padding: 44px 18px 40px;
  min-height: 330px;
  text-decoration: none;
  color: var(--ink);
  transform: rotate(var(--r));
  transition: transform 160ms ease;
  animation: drop 380ms cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: var(--d);
}
.sheet:hover { color: var(--ink); transform: rotate(0deg) translateY(-3px); }
.sheet .sticker { position: absolute; top: 12px; right: -6px; transform: rotate(3deg); }
@keyframes drop { from { opacity: 0; transform: translateY(8px) rotate(var(--r)); } }
.hdr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; margin: 0 0 14px; font: 400 11px/1.45 var(--mono); }
.hdr dt { font-weight: 600; }
.hdr dd { margin: 0; overflow-wrap: anywhere; }
.sheet .hdr { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.sheet .txt { font-size: 14.5px; line-height: 1.45; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.bates { position: absolute; right: 14px; bottom: 12px; font: 500 10.5px/1 var(--mono); letter-spacing: 0.08em; color: var(--muted); }

/* stickers: real exhibit labels */
.sticker {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 74px; padding: 6px 10px 5px;
  border-radius: 4px;
  font: 600 10px/1.1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em;
  color: #17160f;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.sticker b { font-weight: 600; }
.sticker i { font: 600 17px/1.1 var(--serif); font-style: normal; letter-spacing: 0; margin-top: 2px; border-top: 1px solid rgba(0, 0, 0, 0.35); padding-top: 2px; min-width: 46px; text-align: center; }
.sticker.big { min-width: 96px; padding: 9px 14px 7px; font-size: 11px; }
.sticker.big i { font-size: 24px; }
.st-court { background: var(--st-court); }
.st-press { background: var(--st-press); }
.st-company { background: var(--st-company); }
.st-sec { background: var(--st-sec); }
.st-book { background: var(--st-book); }

/* index */
.index { padding-top: 10px; padding-bottom: 60px; }
.index h2, .mcp h2 { font: 400 clamp(32px, 4.4vw, 52px)/1 var(--serif); letter-spacing: -0.025em; margin: 0 0 22px; text-wrap: balance; }
.filters {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center;
  padding: 14px 0; margin-bottom: 12px;
  background: var(--desk);
  border-bottom: 1px solid var(--ink);
}
#q {
  flex: 1 1 320px; min-width: 0;
  font: 400 16px/1 var(--mono);
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 2px;
  background: var(--paper); color: var(--ink);
}
#q:focus { border-color: var(--ink); outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 12px/1 var(--mono); padding: 8px 10px; min-height: 32px;
  border: 1px solid var(--line); border-radius: 2px; background: transparent;
}
.chip i { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.on { background: var(--ink); color: var(--desk); border-color: var(--ink); }
.chip.on i { color: var(--desk); opacity: 0.7; }
.tog { font: 500 12px/1 var(--mono); display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.tog input { width: 16px; height: 16px; accent-color: var(--ink); }
.none { font: 400 14px/1.5 var(--mono); color: var(--muted); padding: 30px 0; }
.none button { border: 0; background: none; text-decoration: underline; padding: 0; font: inherit; }

.yr { display: grid; grid-template-columns: 110px minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.tab { margin: 0; padding: 18px 0; font: 400 34px/1 var(--serif); letter-spacing: -0.02em; position: sticky; top: 140px; align-self: start; }
.rows { list-style: none; margin: 0; padding: 0; }
.row a {
  display: grid; grid-template-columns: 96px minmax(0, 200px) minmax(0, 1fr) 118px; gap: 18px; align-items: baseline;
  padding: 15px 10px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: background-color 120ms;
}
.row:first-child a { border-top: 0; }
.row a:hover { background: var(--paper); color: var(--ink); }
.row .d { font: 400 12px/1.4 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.row .who { font: 500 12.5px/1.4 var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .arrow { color: var(--muted); font-weight: 400; }
.row .s { font-size: 16.5px; line-height: 1.4; }
.row .s b { font-weight: 600; }
.row .sn { color: var(--muted); }
.row .meta { display: flex; justify-content: flex-end; align-items: center; gap: 8px; font: 400 11.5px/1 var(--mono); color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.row .ex { border: 1px solid var(--line); padding: 3px 5px; border-radius: 2px; }
.row.to-him .s b { font-weight: 500; }
.row.to-him .who { color: var(--muted); }
.row[hidden], .yr[hidden] { display: none; }

/* mcp */
.mcp { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; padding-top: 56px; padding-bottom: 80px; border-top: 1px solid var(--ink); }
.mcp-l > p { font-size: 19px; max-width: 52ch; margin: 0 0 22px; }
.code { position: relative; background: var(--ink); color: var(--desk); border-radius: 2px; }
.tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
.tabs button { background: none; border: 0; color: inherit; opacity: 0.6; font: 500 12px/1 var(--mono); padding: 13px 14px; min-height: 40px; }
.tabs button.on { opacity: 1; box-shadow: inset 0 -2px 0 var(--st-court); }
.code pre { margin: 0; padding: 18px 16px 20px; overflow-x: auto; font: 400 13.5px/1.6 var(--mono); }
.copy { position: absolute; right: 10px; bottom: 10px; font: 600 11.5px/1 var(--mono); padding: 8px 12px; min-height: 32px; border: 0; border-radius: 2px; background: var(--st-court); color: #17160f; }
.try { font-size: 17px; color: var(--muted); }
.try q { color: var(--ink); font-style: italic; }
.tools { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: t; }
.tools li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 2px 8px; padding: 14px 0; border-bottom: 1px solid var(--line); counter-increment: t; }
.tools li::before { content: counter(t, decimal-leading-zero); grid-row: span 2; font: 400 12px/1.6 var(--mono); color: var(--muted); }
.tools code { font: 600 14px/1.5 var(--mono); }
.tools span { color: var(--muted); font-size: 16px; }

/* reading page */
.read { max-width: 820px; padding-top: 36px; padding-bottom: 60px; }
.crumb { display: flex; justify-content: space-between; font: 500 12.5px/1 var(--mono); margin: 0 0 36px; }
.crumb a { text-decoration: none; }
.crumb span { color: var(--muted); }
.read h1 { font: 400 clamp(36px, 5.6vw, 64px)/1.02 var(--serif); letter-spacing: -0.03em; margin: 0 0 14px; text-wrap: balance; overflow-wrap: anywhere; }
.lead { font: 500 13.5px/1.5 var(--mono); margin: 0 0 18px; }
.ctx { color: var(--muted); font-size: 18px; margin: 0 0 34px; max-width: 62ch; }
.page { position: relative; background: var(--paper); box-shadow: var(--shadow); border-radius: 2px; padding: 56px 56px 64px; }
.page > .sticker { position: absolute; top: 18px; right: -10px; transform: rotate(2.5deg); }
.page .hdr { font-size: 13px; gap: 4px 16px; padding-bottom: 18px; margin-bottom: 26px; border-bottom: 1px solid var(--line); max-width: calc(100% - 80px); }
.note { font: 400 12.5px/1.5 var(--mono); background: var(--desk); padding: 10px 12px; border-left: 3px solid var(--stamp); margin: 0 0 22px; }
.body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 19px; line-height: 1.6; }
.body .q { color: var(--muted); }
.page .bates { right: 22px; bottom: 20px; font-size: 11.5px; }
.src { margin-top: 30px; font: 400 13.5px/1.6 var(--mono); }
.src h2, .thread h2 { font: 600 12px/1 var(--mono); text-transform: none; margin: 0 0 10px; }
.src p { margin: 0 0 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.src a { overflow-wrap: anywhere; }
.copy-link { border: 1px solid var(--line); background: transparent; padding: 7px 10px; font: 500 12px/1 var(--mono); border-radius: 2px; margin-top: 8px; min-height: 32px; }
.thread { margin-top: 40px; }
.thread ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.thread li a { display: grid; grid-template-columns: 96px 150px minmax(0, 1fr); gap: 12px; padding: 11px 8px; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 15px; }
.thread li .d { font: 400 12px/1.6 var(--mono); color: var(--muted); }
.thread li b { font: 600 12.5px/1.6 var(--mono); }
.thread li span:last-child { color: var(--muted); }
.thread li.cur a { background: var(--paper); box-shadow: inset 3px 0 0 var(--stamp); }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--ink); }
.pn a { text-decoration: none; font-size: 17px; line-height: 1.35; }
.pn a span { display: block; font: 500 12px/1 var(--mono); color: var(--muted); margin-bottom: 8px; }
.pn .nx { text-align: right; }

.foot { padding-top: 26px; padding-bottom: 50px; border-top: 1px solid var(--line); font: 400 12.5px/1.6 var(--mono); color: var(--muted); }
.foot p { max-width: 90ch; margin: 0 0 8px; }

@media (max-width: 1100px) {
  .sheets { grid-template-columns: repeat(5, 240px); overflow-x: auto; padding-left: 24px; padding-right: 24px; scroll-snap-type: x mandatory; scroll-padding-left: 24px; margin: 0 auto; }
  .sheet { scroll-snap-align: start; }
  .row a { grid-template-columns: 90px minmax(0, 1fr) 100px; }
  .row .who { display: none; }
}
@media (max-width: 760px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .top nav { gap: 14px; }
  .top nav a:last-child { display: none; }
  .hero { padding-top: 34px; }
  .sub { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .sub p { font-size: 18px; }
  .sub .stat { text-align: left; }
  .sheets { grid-template-columns: repeat(5, 78vw); padding-left: 16px; padding-right: 16px; scroll-padding-left: 16px; }
  .yr { grid-template-columns: 1fr; }
  .tab { position: static; padding: 18px 0 6px; font-size: 28px; }
  .row a { grid-template-columns: 1fr auto; gap: 4px 12px; padding: 13px 4px; }
  .row .d { grid-column: 1; grid-row: 1; }
  .row .meta { grid-column: 2; grid-row: 1; }
  .row .s { grid-column: 1 / -1; font-size: 16px; }
  .row .sn { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .filters { position: static; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; width: calc(100% + 32px); }
  .chip { flex: none; }
  .mcp { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .page { padding: 52px 20px 52px; }
  .page .hdr { max-width: 100%; margin-top: 18px; }
  .page > .sticker { right: -4px; top: 10px; }
  .body { font-size: 17.5px; }
  .thread li a { grid-template-columns: 1fr; gap: 2px; }
  .pn { grid-template-columns: 1fr; }
  .pn .nx { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet { animation: none; transition: none; }
}
