/* AI-generated proofs commentary: site stylesheet */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(vendor/fonts/source-serif-4-latin-opsz-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(vendor/fonts/source-serif-4-latin-ext-opsz-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4"; font-style: italic; font-weight: 200 900; font-display: swap;
  src: url(vendor/fonts/source-serif-4-latin-opsz-italic.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Source Serif 4"; font-style: italic; font-weight: 200 900; font-display: swap;
  src: url(vendor/fonts/source-serif-4-latin-ext-opsz-italic.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(vendor/fonts/inter-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(vendor/fonts/inter-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* ---------- Palette: ink blue and sea green ---------- */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #172033;
  --ink-soft: #3a4357;
  --muted: #5d667a;
  --line: #e1e5ec;
  --line-strong: #cdd3de;
  --primary: #23397e;        /* deep ink blue */
  --primary-strong: #182a61;
  --primary-soft: #e9edf8;
  --accent: #0b7a70;         /* sea green */
  --accent-soft: #e2f2ef;
  --hero-1: #121d40;
  --hero-2: #23397e;
  --hero-ink: #f2f5fc;
  --hero-muted: #b9c4e4;
  --shadow: 0 1px 2px rgba(18, 29, 64, .06), 0 4px 18px rgba(18, 29, 64, .06);
  --shadow-hover: 0 2px 4px rgba(18, 29, 64, .08), 0 10px 30px rgba(18, 29, 64, .12);
  --serif: "Source Serif 4", "Iowan Old Style", Charter, Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 44rem;
  --radius: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1220;
    --surface: #141b2c;
    --ink: #e5e9f2;
    --ink-soft: #c9cfdc;
    --muted: #98a1b4;
    --line: #232c42;
    --line-strong: #2f3a55;
    --primary: #93a9ff;
    --primary-strong: #b4c3ff;
    --primary-soft: #1c2645;
    --accent: #52c3b6;
    --accent-soft: #11302d;
    --hero-1: #0a1024;
    --hero-2: #1a2a5e;
    --hero-ink: #eef2fb;
    --hero-muted: #a8b4d8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 18px rgba(0, 0, 0, .25);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 10px 30px rgba(0, 0, 0, .35);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.68;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: .18em; text-decoration-color: color-mix(in srgb, var(--primary) 40%, transparent); }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
p { margin: 0 0 1.05em; hyphens: auto; }
em { font-style: italic; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; letter-spacing: -.01em; color: var(--ink); }
.katex { font-size: 1.04em; }
.katex-display { margin: .9em 0; overflow-x: auto; overflow-y: hidden; padding: .1em 0; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.skip-link:focus { left: 1rem; top: 1rem; }

.wrap { width: min(100% - 2.5rem, var(--measure)); margin-inline: auto; }
.wrap-wide { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }

/* ---------- Top bar ---------- */
.topbar {
  font-family: var(--sans); font-size: .875rem;
  background: var(--hero-1); color: var(--hero-muted);
}
.topbar .wrap-wide { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 0; }
.topbar a { color: var(--hero-ink); text-decoration: none; font-weight: 600; letter-spacing: .01em; }
.topbar a:hover { color: #9fe3da; }
.topbar .brand { display: inline-flex; align-items: center; gap: .55rem; }
.topbar nav { display: flex; gap: 1.1rem; }
.topbar nav a { font-weight: 500; color: var(--hero-muted); }

/* ---------- Hero with a triangular lattice ---------- */
.hero {
  position: relative; overflow: hidden;
  color: var(--hero-ink);
  background:
    radial-gradient(circle, rgba(255,255,255,.16) 1.15px, transparent 1.6px) 0 0 / 30px 51.96px,
    radial-gradient(circle, rgba(255,255,255,.16) 1.15px, transparent 1.6px) 15px 25.98px / 30px 51.96px,
    linear-gradient(135deg, var(--hero-1) 0%, var(--hero-2) 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 80% 0%, rgba(82, 195, 182, .22), transparent 55%),
              linear-gradient(to bottom, transparent 60%, rgba(10, 16, 36, .35));
}
.hero .wrap, .hero .wrap-wide { position: relative; z-index: 1; }
.hero-home { padding: 4.2rem 0 3.6rem; }
.hero-page { padding: 2.6rem 0 2.4rem; }
.kicker {
  font-family: var(--sans); font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: #9fe3da; margin: 0 0 .9rem;
}
.hero h1 { color: var(--hero-ink); margin: 0 0 .9rem; font-weight: 600; }
.hero-home h1 { font-size: clamp(2.2rem, 5.2vw, 3.5rem); max-width: 18ch; }
.hero-page h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.hero .lede { font-size: 1.2rem; color: var(--hero-muted); max-width: 38rem; margin: 0 0 1.6rem; }
.hero .byline { font-family: var(--sans); font-size: 1rem; color: var(--hero-muted); margin: 0; }
.hero .byline a { color: var(--hero-ink); font-weight: 600; text-decoration-color: rgba(255,255,255,.35); }
.hero .byline a:hover { color: #9fe3da; }
.hero .affil { color: var(--hero-muted); }
.button {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans); font-size: .95rem; font-weight: 600; text-decoration: none;
  padding: .7rem 1.15rem; border-radius: 999px;
  background: #e9fbf8; color: #0b3f3a;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
  transition: transform .15s ease, background .15s ease;
}
.button:hover { background: #ffffff; color: #0b3f3a; transform: translateY(-1px); }
.button.secondary { background: transparent; color: var(--hero-ink); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.45); }
.button.secondary:hover { background: rgba(255,255,255,.1); color: #ffffff; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; align-items: center; }
.hero-actions .meta { font-family: var(--sans); font-size: .9rem; color: var(--hero-muted); }

/* ---------- Main ---------- */
main { padding: 3rem 0 4rem; }
.section-title {
  font-family: var(--sans); font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 1rem; display: flex; align-items: center; gap: .75rem;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.intro p:first-of-type { font-size: 1.22rem; line-height: 1.6; color: var(--ink); }
.intro { margin-bottom: 2.8rem; }

.takeaways {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.8rem 1.9rem 1.4rem; margin: 0 0 3.4rem;
}
.takeaways > p { color: var(--muted); font-style: italic; margin-bottom: 1.2rem; }
.takeaways ul, .takeaways ol { margin: 0; padding: 0; }
.takeaways ul { list-style: none; }
.takeaways ul > li { position: relative; padding: .1rem 0 .85rem 1.6rem; margin: 0; }
.takeaways ul > li::before {
  content: ""; position: absolute; left: .2rem; top: .68em;
  width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent);
}
.takeaways ol { padding-left: 1.6rem; }
.takeaways ol > li { padding: .1rem 0 .85rem .3rem; }

/* ---------- Table of contents ---------- */
.toc { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }
.toc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); gap: 1.1rem; list-style: none; padding: 0; margin: 0; }
.toc-card {
  position: relative; height: 100%;
  display: flex; flex-direction: column; gap: .45rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.35rem 1.2rem; box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.toc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--line-strong); }
.toc-card .num { font-family: var(--sans); font-size: .78rem; font-weight: 700; color: var(--accent); letter-spacing: .08em; }
.toc-card .who { font-family: var(--sans); font-size: .92rem; font-weight: 600; color: var(--ink-soft); }
.toc-card h3 { font-size: 1.3rem; margin: 0; font-weight: 600; }
.toc-card h3 a { color: var(--ink); text-decoration: none; }
.toc-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.toc-card:hover h3 a { color: var(--primary); }
.toc-card .headline { font-size: .98rem; line-height: 1.5; color: var(--muted); margin: 0; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; }
.tag {
  font-family: var(--sans); font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  padding: .22rem .55rem; border-radius: 999px;
  color: var(--primary); background: var(--primary-soft);
}
.tag.alt { color: var(--accent); background: var(--accent-soft); }

/* ---------- Commentary page ---------- */
.crumbs { font-family: var(--sans); font-size: .88rem; margin: 0 0 1.2rem; }
.crumbs a { color: var(--hero-muted); text-decoration: none; }
.crumbs a:hover { color: #9fe3da; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.35rem 1.5rem; margin: 0 0 2.2rem;
}
.panel h2 {
  font-family: var(--sans); font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 .8rem;
}
.note { border-left: 4px solid var(--accent); }
.note p { font-style: italic; color: var(--ink-soft); margin: 0 0 .6em; }
.note p:last-child { margin-bottom: 0; }

.links { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.links li { display: grid; grid-template-columns: 8.2rem 1fr; gap: .8rem; align-items: baseline; line-height: 1.45; }
.links li:not(:has(.kind)) { grid-template-columns: 1fr; }
.links .kind {
  font-family: var(--sans); font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
}
.links a { font-weight: 500; }
.links .ln { font-family: var(--sans); font-size: .82rem; color: var(--muted); }
.jump { margin: 1rem 0 0; font-family: var(--sans); font-size: .9rem; }
.jump a { font-weight: 600; text-decoration: none; }
.jump a:hover { text-decoration: underline; }

.commentary { margin: 0 0 3rem; }
.commentary > p:first-child::first-letter {
  float: left; font-size: 3.6em; line-height: .86; padding: .06em .09em 0 0; font-weight: 600; color: var(--primary);
}
.commentary ul, .commentary ol, .intro ul { padding-left: 1.4rem; }
.commentary li, .intro li { margin-bottom: .45em; }

.results { margin: 0 0 2.6rem; }
.result {
  background: linear-gradient(180deg, var(--primary-soft), transparent 9rem), var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.5rem 1.6rem 1.2rem; margin: 0 0 1.2rem;
}
.result h3 { font-size: 1.3rem; margin: 0 0 .55rem; font-weight: 600; }
.result .headline { font-weight: 600; color: var(--ink); }
.result .statement { padding: .2rem 0 .1rem 1rem; border-left: 3px solid var(--primary); margin: 0 0 1rem; }
.result .statement p:last-child { margin-bottom: .4rem; }
.result .context { font-size: 1rem; color: var(--muted); }
.result .context p:last-child { margin-bottom: 0; }
.fineprint { font-family: var(--sans); font-size: .8rem; color: var(--muted); margin: .4rem 0 0; }

details.original {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.4rem; margin: 0 0 2.6rem;
}
details.original summary { cursor: pointer; font-family: var(--sans); font-weight: 600; font-size: .95rem; color: var(--primary); }
details.original[open] summary { margin-bottom: 1rem; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.pager a {
  display: block; text-decoration: none; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); transition: box-shadow .15s ease, transform .15s ease;
}
.pager a:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.pager .dir { display: block; font-family: var(--sans); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.pager .t { display: block; color: var(--ink); font-weight: 600; margin-top: .2rem; line-height: 1.3; }
.pager .w { display: block; font-family: var(--sans); font-size: .85rem; color: var(--muted); margin-top: .15rem; }
.pager .next { text-align: right; grid-column: 2; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line); background: var(--surface);
  font-family: var(--sans); font-size: .875rem; color: var(--muted);
  padding: 2rem 0 2.4rem;
}
footer p { margin: 0 0 .5rem; hyphens: manual; }
footer a { color: var(--ink-soft); }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  body { font-size: 1.06rem; }
  .hero-home { padding: 3rem 0 2.6rem; }
  .takeaways { padding: 1.3rem 1.2rem 1rem; }
  .panel, .result { padding: 1.15rem 1.15rem; }
  .links li { grid-template-columns: 1fr; gap: .1rem; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .topbar nav { display: none; }
}

/* ---------- Print ---------- */
@media print {
  .topbar, .pager, .jump, .button, .skip-link { display: none !important; }
  .hero { background: none !important; color: #000; }
  .hero::after { display: none; }
  .hero h1, .hero .byline, .hero .byline a, .kicker, .crumbs a { color: #000 !important; }
  body { background: #fff; font-size: 11pt; }
  .panel, .result, .toc-card, .takeaways { box-shadow: none; break-inside: avoid; }
  a { color: #000; }
}
