/* EssayKraft. The site is laid out like a paper: a title page, numbered
   sections with figures and margin notes, an index, an appendix and references. */
:root {
  --desk: #f1f0ec;
  --paper: #fbfbf9;
  --ink: #121214;
  --ink-2: #3a3a3f;
  --muted: #77777d;
  --faint: #b9b6ae;
  --rule: #e2e0da;
  --blue: #1f8bff;
  --blue-ink: #0a62d0;
  --blue-wash: rgba(31, 139, 255, .12);
  --night: #0b0b0d;
  --night-2: #151518;
  --night-rule: #2a2a2f;
  /* Sheets of paper keep their own colours, even at midnight. */
  --sheet: #fff;
  --sheet-ink: #1b1b1e;
  --sheet-muted: #85858b;
  --sheet-rule: #ebe9e4;
  --sheet-blue: #0a62d0;
  --serif: "Newsreader", "New York", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}
html[data-midnight] {
  --desk: #000;
  --paper: #000;
  --ink: #f2f2f0;
  --ink-2: #c9c9ce;
  --muted: #8a8a91;
  --faint: #45454b;
  --rule: #232327;
  --night: #000;
  --night-2: #111114;
  --blue-ink: #5aa9ff;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(31, 139, 255, .22); }

h1, h2, h3 { font-family: var(--serif); font-weight: 340; letter-spacing: -.025em; margin: 0; }
h2 { font-size: clamp(42px, 6.2vw, 86px); line-height: .98; font-variation-settings: "opsz" 72; text-wrap: balance; }
h2 em, .big em { font-style: italic; font-weight: 300; }

/* Bar */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 30; height: 58px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 var(--gutter);
  transition: background .4s var(--ease), box-shadow .4s var(--ease), color .4s var(--ease);
}
.bar.scrolled { background: color-mix(in srgb, var(--paper) 80%, transparent); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); box-shadow: 0 1px 0 var(--rule); }
.bar.on-dark { background: rgba(11, 11, 13, .74); box-shadow: 0 1px 0 var(--night-rule); color: #f2f2f0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -.01em; font-size: 16px; }
.brand img { border-radius: 7px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.bar nav { display: flex; align-items: center; gap: 24px; font-size: 15px; }
.bar nav a { text-decoration: none; opacity: .72; transition: opacity .2s; }
.bar nav a:hover { opacity: 1; }
.bar .pill { opacity: 1; background: var(--ink); color: var(--paper); padding: 7px 14px; border-radius: 99px; transition: transform .3s var(--ease); }
.bar .pill:hover { transform: translateY(-1px); }
.bar.on-dark .pill { background: #f2f2f0; color: #0b0b0d; }

/* The dock: where you are in the paper, and the lights. */
.dock {
  position: fixed; left: 50%; bottom: 18px; z-index: 30;
  display: flex; align-items: center; gap: 4px; padding: 5px 5px 5px 16px;
  background: color-mix(in srgb, var(--paper) 72%, transparent); backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px);
  border: 1px solid color-mix(in srgb, var(--ink) 9%, transparent); border-radius: 99px;
  box-shadow: 0 10px 30px -12px rgba(0,0,0,.25);
  font-size: 13px; font-variant-numeric: tabular-nums;
  transform: translate(-50%, 90px); transition: transform .6s var(--ease);
}
.dock.shown { transform: translate(-50%, 0); }
.where { min-width: 108px; color: var(--ink-2); overflow: hidden; height: 20px; line-height: 20px; }
.where span { display: block; transition: transform .35s var(--ease), opacity .35s var(--ease); }
.where span.out { transform: translateY(-100%); opacity: 0; }
.midnight {
  display: inline-flex; align-items: center; gap: 6px; font: 500 13px var(--sans); color: var(--ink);
  background: color-mix(in srgb, var(--ink) 7%, transparent); border: 0; border-radius: 99px; padding: 7px 12px 7px 10px; cursor: pointer;
  transition: background .25s;
}
.midnight:hover { background: color-mix(in srgb, var(--ink) 12%, transparent); }
.midnight svg { width: 15px; height: 15px; fill: currentColor; transition: transform .6s var(--ease); }
.midnight[aria-pressed="true"] svg { transform: rotate(-40deg); fill: var(--blue); }

/* Buttons */
.button {
  display: inline-flex; align-items: center; gap: 9px; padding: 14px 22px; border-radius: 99px; text-decoration: none;
  font-size: 16px; font-weight: 500; background: var(--ink); color: var(--paper);
  box-shadow: 0 8px 22px -10px rgba(0,0,0,.5); transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.button:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -14px rgba(0,0,0,.55); }
.glyph { width: 18px; height: 18px; fill: currentColor; margin-top: -2px; }
.sheet .button { background: #121214; color: #fff; }

/* Title page */
.desk { background: var(--desk); padding: 104px var(--gutter) 0; perspective: 1600px; transition: background .5s; }
.sheet {
  position: relative; background: var(--sheet); color: var(--sheet-ink); max-width: 920px; margin: 0 auto;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 30px 70px -40px rgba(20,20,30,.35);
}
.stack { position: relative; max-width: 920px; margin: 0 auto; animation: sheet-in 1.4s var(--ease) both; transform-origin: 50% 0; }
.title-sheet {
  z-index: 1; min-height: 150vh; padding: clamp(22px, 4vw, 40px) clamp(22px, 7vw, 92px) clamp(70px, 10vw, 120px);
  border-radius: 3px 3px 0 0;
}
/* Two more sheets underneath, slightly askew. */
.stack::before, .stack::after {
  content: ""; position: absolute; inset: 35% 0 0; transform-origin: 50% 0; background: var(--sheet); border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 20px 50px -34px rgba(20,20,30,.3);
}
.stack::before { transform: rotate(-1.1deg) translate(-4px, 10px); }
.stack::after { transform: rotate(.7deg) translate(6px, 18px); }
@keyframes sheet-in { from { transform: translateY(90px) rotateX(10deg); opacity: 0; } to { transform: none; opacity: 1; } }
.running { display: flex; justify-content: space-between; font-family: var(--serif); font-size: 14px; font-style: italic; color: var(--sheet-muted); padding-bottom: 12px; border-bottom: 1px solid var(--sheet-rule); }
.title-block { min-height: calc(100svh - 230px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 0 60px; }
.wordmark {
  font-size: clamp(56px, 11.4vw, 150px); line-height: .9; font-weight: 300; letter-spacing: -.045em; white-space: nowrap;
  font-variation-settings: "opsz" 72; display: inline-flex; align-items: flex-start; margin: 0 0 24px; color: #121214;
}
.letters { display: inline-block; }
.js .letters:not(.ready) { opacity: 0; }
.letters .ch { display: inline-block; opacity: 0; transform: translateY(.2em); filter: blur(10px); animation: rise 1.1s var(--ease) forwards; animation-delay: calc(var(--i) * 48ms + 450ms); }
.caret {
  width: .13em; height: .19em; background: var(--blue); border-radius: .025em; margin: .07em 0 0 .07em;
  box-shadow: 0 .02em .08em rgba(31,139,255,.45), inset 0 .015em 0 rgba(255,255,255,.45);
  opacity: 0; animation: caret-in .5s var(--ease) 1.05s forwards, blink 1.15s steps(1) 1.9s infinite;
}
.subtitle { font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2.8vw, 32px); font-weight: 340; margin: 0 0 30px; letter-spacing: -.01em; }
.byline { font-size: 14px; letter-spacing: .02em; color: var(--sheet-muted); margin: 0 0 40px; line-height: 1.6; }
.rise { opacity: 0; transform: translateY(14px); filter: blur(6px); animation: rise 1s var(--ease) forwards; animation-delay: calc(var(--d) * 120ms + 500ms); }
@keyframes rise { to { opacity: 1; transform: none; filter: none; } }
@keyframes caret-in { from { opacity: 0; transform: scaleY(.3); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }

.abstract { max-width: 560px; margin: 0 auto; font-family: var(--serif); font-size: clamp(18px, 1.8vw, 21px); line-height: 1.7; }
.small-head { font-size: 18px; font-weight: 600; letter-spacing: 0; text-align: center; margin-bottom: 14px; font-variation-settings: "opsz" 16; }
.abstract p { margin: 0; text-align: justify; hyphens: auto; }
.abstract .keywords { margin-top: 18px; font-size: .9em; color: var(--sheet-muted); text-align: left; }
.folio { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); font-family: var(--serif); font-style: italic; color: var(--sheet-muted); font-size: 15px; }

/* Reveals */
.reveal { opacity: 0; transform: translateY(24px); filter: blur(8px); transition: opacity 1s var(--ease), transform 1.1s var(--ease), filter 1s var(--ease); transition-delay: var(--stagger, 0s); }
.reveal.in { opacity: 1; transform: none; filter: none; }
.no-js .reveal { opacity: 1; transform: none; filter: none; }
/* Headlines rise out of their own lines, like type being set. */
.ln { display: block; overflow: hidden; padding: .06em 0 .12em; margin: -.06em 0 -.12em; }
.ln > span { display: block; transform: translateY(105%); transition: transform 1.2s var(--ease); transition-delay: calc(var(--l) * 90ms); }
.lines.in .ln > span { transform: none; }

/* Chapters: a numbered margin, a text column, notes on the right. */
.chapter {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 640px) minmax(0, 1fr);
  column-gap: clamp(20px, 4vw, 56px); padding: clamp(110px, 14vw, 190px) var(--gutter) 0;
  transition: background .5s;
}
.num {
  grid-column: 1; grid-row: 1 / span 2; justify-self: end; align-self: start;
  font-family: var(--serif); font-weight: 200; font-size: clamp(64px, 9vw, 150px); line-height: .8; color: var(--faint);
  font-variation-settings: "opsz" 72; letter-spacing: -.04em;
}
.text { grid-column: 2; }
.text p { font-size: clamp(19px, 1.8vw, 22px); color: var(--muted); margin: 24px 0 0; line-height: 1.45; max-width: 520px; }
.note-ref { font-size: .6em; color: var(--blue-ink); margin-left: 1px; font-weight: 600; }
.sidenote {
  grid-column: 3; grid-row: 1; align-self: end; max-width: 230px; font-size: 14px; line-height: 1.5; color: var(--muted);
  border-left: 1px solid var(--rule); padding-left: 14px; margin-bottom: 6px;
}
.sidenote sup { color: var(--blue-ink); font-weight: 600; margin-right: 2px; }
.wide { grid-column: 1 / -1; }
.fig { margin: clamp(48px, 6vw, 80px) 0 0; }
.fig.wide, .cite-lab.wide { max-width: 1120px; justify-self: center; width: 100%; }
.fig:not(.wide) { grid-column: 2; }
figcaption, .caption { font-size: 14px; color: var(--muted); margin-top: 18px; text-align: center; }
figcaption b, .caption b { color: var(--ink); font-weight: 600; margin-right: 3px; }

.device {
  background: #000; padding: clamp(6px, 1vw, 12px); border-radius: clamp(18px, 2.6vw, 34px);
  box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 40px 80px -30px rgba(10,10,20,.45), 0 18px 30px -18px rgba(10,10,20,.3);
}
html[data-midnight] .device { box-shadow: 0 0 0 1px #2a2a2f, 0 40px 120px -40px rgba(31,139,255,.22); }
.device img { border-radius: clamp(12px, 1.8vw, 24px); }
@supports (animation-timeline: view()) {
  .grow { animation: grow linear both; animation-timeline: view(); animation-range: entry 0% cover 42%; }
  @keyframes grow { from { transform: perspective(1400px) rotateX(14deg) scale(.88) translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
}

/* 2. The citation lab */
.cite-lab { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(30px, 5vw, 80px); align-items: start; margin-top: clamp(48px, 6vw, 80px); }
.style-index { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.style-index li { counter-increment: s; }
.style-index button {
  display: flex; align-items: baseline; gap: 14px; width: 100%; text-align: left; background: none; border: 0; padding: 3px 0; cursor: pointer;
  font-family: var(--serif); font-size: clamp(26px, 2.9vw, 40px); line-height: 1.12; font-weight: 300; letter-spacing: -.02em; color: var(--faint);
  transition: color .35s var(--ease), transform .45s var(--ease);
}
.style-index button::before { content: counter(s, decimal-leading-zero); font: 500 11px var(--sans); letter-spacing: .04em; color: var(--faint); width: 18px; flex: none; transform: translateY(-.6em); }
.style-index small { font-size: .5em; font-style: italic; letter-spacing: 0; }
.style-index button::after { content: ""; width: .14em; height: .62em; background: var(--blue); border-radius: 2px; align-self: center; opacity: 0; transform: scaleY(.2); transition: opacity .3s, transform .4s var(--ease); }
.style-index button:hover { color: var(--ink-2); }
.style-index button[aria-pressed="true"] { color: var(--ink); transform: translateX(8px); }
.style-index button[aria-pressed="true"]::after { opacity: 1; transform: none; }
.stage { position: sticky; top: 110px; }
.paper {
  background: var(--sheet); color: var(--sheet-ink); border-radius: 4px; padding: clamp(28px, 4.6vw, 60px) clamp(24px, 5.4vw, 70px);
  box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 34px 70px -36px rgba(20,20,30,.38);
  font-family: var(--serif); font-size: clamp(17px, 1.6vw, 20px); line-height: 1.9;
}
.paper .body { margin: 0; text-indent: 2.2em; }
.cite { color: var(--sheet-blue); font-style: italic; background: var(--blue-wash); padding: .06em .22em; border-radius: 3px; text-indent: 0; display: inline-block; line-height: 1.4; }
.refs-label { font-weight: 600; text-align: center; margin: 30px 0 6px; font-size: .95em; }
.ref { margin: 0; padding-left: 2.2em; text-indent: -2.2em; line-height: 1.7; min-height: 3.4em; }
[data-slot] { transition: opacity .32s var(--ease), filter .32s var(--ease), transform .32s var(--ease); }
[data-slot].swap { opacity: 0; filter: blur(5px); transform: translateY(3px); }
.caption .hint { color: var(--faint); }

/* 4. Authorship, the dark band */
.night { background: var(--night); color: #f2f2f0; padding-bottom: clamp(110px, 14vw, 190px); margin-top: clamp(110px, 14vw, 190px); }
.night .num { color: #34343a; }
.night .text p, .night .sidenote, .night figcaption { color: #8c8c94; }
.night .sidenote { border-color: var(--night-rule); }
.night figcaption b { color: #f2f2f0; }
.night .note-ref, .night .sidenote sup { color: var(--blue); }
.report {
  max-width: 720px; margin: 0 auto; background: var(--sheet); color: var(--sheet-ink); border-radius: 4px;
  padding: clamp(26px, 4vw, 48px) clamp(22px, 4.6vw, 56px); font-size: 15px;
  box-shadow: 0 50px 120px -50px rgba(31,139,255,.4);
}
.report-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 14px; border-bottom: 2px solid var(--sheet-ink); }
.report-head > span:first-child { font-family: var(--serif); font-size: clamp(24px, 2.6vw, 30px); letter-spacing: -.015em; }
.intact { display: inline-flex; align-items: center; gap: 6px; color: #128a4a; font-weight: 600; font-size: 14px; }
.intact svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset .8s var(--ease); }
.report.done .intact svg { stroke-dashoffset: 0; }
.overview { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border-bottom: 1px solid var(--sheet-rule); }
.overview div { padding: 16px 0; }
.overview dt { font-size: 12px; color: var(--sheet-muted); }
.overview dd { margin: 2px 0 0; font-family: var(--serif); font-size: clamp(24px, 2.6vw, 32px); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.report h3 { font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--sheet-muted); letter-spacing: .02em; margin: 22px 0 6px; }
.history { list-style: none; margin: 0; padding: 0; font-variant-numeric: tabular-nums; }
.history li { display: grid; grid-template-columns: 56px auto 1fr; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--sheet-rule); opacity: 0; transform: translateX(-8px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.report.play .history li { opacity: 1; transform: none; }
.history time { color: var(--sheet-muted); }
.history i { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #5aa9ff, var(--blue)); width: calc(var(--w) * 100%); justify-self: start; transform: scaleX(0); transform-origin: left; transition: transform .9s var(--ease); transition-delay: inherit; }
.report.play .history i { transform: none; }
.history .day { display: block; font-family: var(--serif); font-style: italic; color: var(--sheet-muted); padding-top: 16px; border-bottom: 0; }
.history .flag em { justify-self: start; font-style: normal; font-size: 12px; font-weight: 600; color: #a35a00; background: #fff1dc; padding: 2px 8px; border-radius: 99px; }
.history .more { display: block; color: var(--sheet-muted); border-bottom: 0; padding-top: 12px; }

/* 5. Type to fill the target */
.typer {
  background: var(--sheet); color: var(--sheet-ink); border-radius: 4px; padding: 26px clamp(22px, 4vw, 44px) 30px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 34px 70px -36px rgba(20,20,30,.38);
}
.typer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 14px; }
.due { font-weight: 500; color: var(--sheet-blue); background: var(--blue-wash); padding: 5px 11px; border-radius: 99px; }
.tally { color: var(--sheet-muted); font-variant-numeric: tabular-nums; }
.tally b { color: var(--sheet-ink); font-weight: 600; }
.meter { height: 8px; background: #f0efeb; border-radius: 99px; overflow: hidden; }
.meter b { display: block; height: 100%; background: linear-gradient(90deg, #5aa9ff, var(--blue)); border-radius: inherit; transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform .45s var(--ease), background .4s; }
.typer.done .meter b { background: linear-gradient(90deg, #2bb673, #128a4a); }
.typer textarea {
  display: block; width: 100%; margin-top: 22px; border: 0; resize: none; background: transparent; color: var(--sheet-ink);
  font: 400 clamp(19px, 1.9vw, 22px)/1.75 var(--serif); caret-color: var(--blue); outline: none; min-height: 7em;
}
.typer textarea::placeholder { color: #b7b5ae; font-style: italic; }
.done-note { margin: 6px 0 0; min-height: 1.4em; font-size: 14px; color: #128a4a; font-weight: 500; }

/* Index */
.index-page { max-width: 1060px; margin: 0 auto; padding: clamp(120px, 15vw, 200px) var(--gutter) 0; }
.index-page h2 { text-align: center; margin-bottom: clamp(40px, 6vw, 72px); }
.index-cols { columns: 3 240px; column-gap: clamp(28px, 4vw, 60px); border-top: 1px solid var(--rule); padding-top: 26px; }
.group { break-inside: avoid; margin-bottom: 22px; }
.group h3 { font-size: 26px; font-weight: 300; font-style: italic; color: var(--blue-ink); margin-bottom: 4px; }
.group p { margin: 0 0 3px; font-family: var(--serif); font-size: 18px; padding-left: 1em; text-indent: -1em; }
.group a { color: var(--blue-ink); text-decoration: none; font-variant-numeric: lining-nums; }
.group a:hover { text-decoration: underline; text-underline-offset: 3px; }
.group i { color: var(--muted); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--blue-ink); cursor: pointer; }
.linkish i { color: inherit; }
.linkish:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Epigraph */
.epigraph { padding: clamp(130px, 16vw, 220px) var(--gutter); text-align: center; }
.epigraph blockquote { margin: 0; }
.big { font-family: var(--serif); font-size: clamp(56px, 11vw, 160px); line-height: .92; font-weight: 300; letter-spacing: -.04em; margin: 0; font-variation-settings: "opsz" 72; }
.epigraph .big .ln:last-child > span { font-style: italic; }
.epigraph footer { margin-top: 34px; font-size: 15px; color: var(--muted); }
.epigraph footer::before { content: "— "; }

/* Appendix */
.appendix { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter); }
.appendix h2 { font-size: clamp(40px, 5.4vw, 64px); margin-bottom: 36px; }
details { border-top: 1px solid var(--rule); }
details:last-of-type { border-bottom: 1px solid var(--rule); }
summary { list-style: none; cursor: pointer; padding: 20px 0; font-family: var(--serif); font-size: clamp(20px, 2.2vw, 25px); letter-spacing: -.01em; display: flex; gap: 18px; align-items: baseline; }
summary span { font: 500 13px var(--sans); color: var(--blue-ink); width: 30px; flex: none; font-variant-numeric: tabular-nums; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; margin-left: auto; font-family: var(--sans); font-weight: 300; color: var(--muted); transition: transform .35s var(--ease); }
details[open] summary::after { transform: rotate(45deg); }
details p { margin: -6px 0 22px 48px; color: var(--ink-2); }
.more-help { color: var(--muted); margin-top: 24px; }

/* References */
.references { max-width: 760px; margin: 0 auto; padding: clamp(120px, 15vw, 200px) var(--gutter) clamp(100px, 12vw, 160px); }
.references h2 { font-size: clamp(40px, 5.4vw, 64px); margin-bottom: 28px; }
.biblio { list-style: none; padding: 0; margin: 0; font-family: var(--serif); font-size: clamp(18px, 1.8vw, 21px); line-height: 1.7; }
.biblio li { padding-left: 2.2em; text-indent: -2.2em; margin-bottom: 14px; }
.biblio a { color: var(--blue-ink); overflow-wrap: anywhere; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.closing { display: flex; flex-direction: column; align-items: center; text-align: center; margin-top: clamp(70px, 9vw, 110px); }
.closing img { border-radius: 20px; box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 24px 50px -20px rgba(0,0,0,.3); margin-bottom: 28px; }
.closing p { color: var(--muted); font-size: 14px; margin: 16px 0 0; }

.foot { border-top: 1px solid var(--rule); padding: 26px var(--gutter) 90px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; font-size: 14px; color: var(--muted); }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }
.foot p { margin: 0; }

/* Midnight: everything goes dark except the pages. */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html[data-midnight] .bar .pill { background: #f2f2f0; color: #000; }
html[data-midnight] .button { background: #f2f2f0; color: #000; }
html[data-midnight] .sheet .button { background: #121214; color: #fff; }
html[data-midnight] .title-sheet, html[data-midnight] .paper, html[data-midnight] .typer, html[data-midnight] .report { box-shadow: 0 0 0 1px #1d1d21, 0 40px 120px -50px rgba(31,139,255,.35); }
html[data-midnight] .stack::before, html[data-midnight] .stack::after { background: #1a1a1d; }

/* Narrow screens */
@media (max-width: 960px) {
  .chapter { grid-template-columns: minmax(0, 1fr); }
  .num { grid-row: auto; justify-self: start; font-size: 64px; margin-bottom: 10px; }
  .text, .fig:not(.wide) { grid-column: 1; }
  .sidenote { grid-column: 1; grid-row: auto; max-width: 520px; margin-top: 22px; align-self: start; }
  .cite-lab { grid-template-columns: minmax(0, 1fr); }
  .style-index { display: flex; gap: 6px 18px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .style-index::-webkit-scrollbar { display: none; }
  .style-index li { flex: none; scroll-snap-align: start; }
  .style-index button { font-size: 26px; white-space: nowrap; }
  .style-index button::before { display: none; }
  .style-index button[aria-pressed="true"] { transform: none; }
  .stage { position: static; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .bar nav a:not(.pill) { display: none; }
  .title-sheet { min-height: 0; }
  .title-block { min-height: calc(100svh - 200px); }
  .overview { grid-template-columns: repeat(2, 1fr); }
  .history li { grid-template-columns: 48px auto; }
  .history i { display: none; }
  .history .flag em { grid-column: 2; }
  details p { margin-left: 0; }
  .where { min-width: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .caret { opacity: 1; }
}
