/* SEIZE theses: the long-form essay template. Shared by every essay in /theses/<slug>/.
   Same world as the home page: snow paper, ink, the SEIZE sky for the moments that matter, Anton for the
   wordmark and figures, Instrument Serif for display, Instrument Sans for small caps. One addition for
   reading: Newsreader, a text serif, for the body. Plates are old engravings printed in one ink on the
   page colour (tools/derive/theses/plates.py); the cover and the coda are cyanotypes on the sky. */

@font-face { font-family: "Anton"; src: url("../fonts/anton-latin.woff2") format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin.woff2") format("woff2"); font-style: normal; font-weight: 400; font-display: block; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-italic-latin.woff2") format("woff2"); font-style: italic; font-weight: 400; font-display: block; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin.woff2") format("woff2"); font-style: normal; font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-italic-latin.woff2") format("woff2"); font-style: italic; font-weight: 200 800; font-display: swap; }

:root {
  --snow: #f3f3f0;
  --ink: #0e0f11;
  --text: #1b1c1f;
  --ink-2: #5c5e62;
  --rule: rgba(14, 15, 17, .13);
  --sky: #3a5287;
  --m: clamp(20px, 4.2vw, 72px);
  --measure: 680px;
  --display: "Anton", "Impact", "Haettenschweiler", sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --book: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--snow); scroll-behavior: smooth; }
body { margin: 0; background: var(--snow); color: var(--text); font: 400 clamp(18px, .52vw + 12.6px, 20.5px)/1.66 var(--book); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-kerning: normal; font-variant-numeric: oldstyle-nums proportional-nums; }
h1, h2, h3, p, figure, ol, ul, blockquote { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
::selection { background: var(--ink); color: var(--snow); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.cap { font: 500 11px/1.3 var(--sans); letter-spacing: .18em; text-transform: uppercase; font-variant-numeric: lining-nums; }
cite { font-style: italic; }
figcaption cite, em cite { font-style: normal; }
strong { font-weight: 640; color: var(--ink); }

/* film grain, as on the hero */
.grain { position: absolute; inset: -100px; pointer-events: none; opacity: .1; mix-blend-mode: overlay; z-index: 1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 2.2 -.6'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E"); }
@media (prefers-reduced-motion: no-preference) { .grain { animation: grain 1.2s steps(6) infinite; } }
@keyframes grain { 0% { transform: translate(0, 0); } 17% { transform: translate(-37px, 21px); } 33% { transform: translate(18px, -44px); } 50% { transform: translate(-12px, 33px); } 67% { transform: translate(41px, 9px); } 83% { transform: translate(-25px, -17px); } }

/* the sky: the colours of the hero photograph's own extended sky (sampled), for the cover and the coda.
   A gradient, not an image: compressed images of smooth sky go blocky when stretched over a tall section. */
.sky { position: relative; overflow: hidden; color: #fff; background: linear-gradient(#32487a, #364d81 22%, #3c5489 48%, #445e95 76%, #506da4); isolation: isolate; }
/* cyanotype: white linework on black, screened onto the sky (black drops out, lines stay white).
   Blending only reaches the sky if nothing between them makes a stacking context: no z-index, opacity or
   transform on the wrappers. Entrance and reveal animations therefore run on the image itself. */
.cyan img { mix-blend-mode: screen; }
.sky .grain { z-index: 1; }

/* reading progress */
.progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 50; background: var(--sky); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }

/* ============================== cover ============================== */
.cover { min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: auto 1fr; padding: 0 var(--m) clamp(36px, 6vh, 64px); }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 22px; }
.bar__mark { font: 400 28px/1 var(--display); letter-spacing: .01em; text-decoration: none; text-transform: uppercase; padding-block: 4px; }
.bar nav { display: flex; gap: clamp(20px, 3vw, 44px); }
.bar nav a, .bar__mark { opacity: .94; transition: opacity .3s; }
.bar nav a { text-decoration: none; padding-block: 6px; }
.bar a:hover { opacity: .62; }
.cover__grid { align-self: center; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: center; padding-top: clamp(32px, 6vh, 72px); }
.cover__text { grid-column: 1 / 6; }
.kicker { opacity: .82; }
.title { font: 400 clamp(54px, 7.2vw, 132px)/.9 var(--serif); letter-spacing: -.012em; margin: .28em 0 0 -.04em; text-wrap: balance; }
.dek { font: italic 400 clamp(26px, 2.5vw, 40px)/1.1 var(--serif); margin-top: .62em; opacity: .94; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: clamp(26px, 4vh, 44px); opacity: .8; }
.cover__plate { grid-column: 6 / 13; justify-self: end; width: min(100%, 860px); }
.cover__plate figcaption { margin-top: 14px; font: italic 400 14.5px/1.45 var(--book); opacity: .78; }

/* ============================== essay grid ============================== */
/* The text track is a fixed length so it is sized first; the breakout tracks (wide) only get what is left. */
.essay { display: grid; grid-template-columns: [full-start] minmax(var(--m), 1fr) [wide-start] minmax(0, 170px) [text-start] min(var(--measure), 100% - 2 * var(--m)) [text-end] minmax(0, 170px) [wide-end] minmax(var(--m), 1fr) [full-end]; padding-top: clamp(84px, 13vh, 150px); }
.essay > * { grid-column: text; }
.essay > .wide { grid-column: wide; }
.essay > .full { grid-column: full; }
.essay p + p, .essay p + .ledger, .essay p + .count, .essay .ledger + p, .essay .count + p { margin-top: 1.05em; }

.epigraph { font: italic 400 clamp(30px, 3vw, 44px)/1.12 var(--serif); color: var(--ink); text-align: center; margin-bottom: clamp(54px, 8vh, 88px) !important; }
.epigraph::after { content: ""; display: block; width: 46px; height: 1px; background: var(--ink); opacity: .35; margin: clamp(30px, 5vh, 48px) auto 0; }
.lede { font-size: 1.32em; line-height: 1.38; color: var(--ink); letter-spacing: -.004em; }

/* part openers */
.part { margin-top: clamp(110px, 17vh, 190px); margin-bottom: clamp(30px, 4.5vh, 50px); }
.part__n { display: flex; align-items: center; gap: 16px; font: italic 400 clamp(22px, 1.9vw, 28px)/1 var(--serif); color: var(--ink-2); }
.part__n::after { content: ""; flex: 0 0 56px; height: 1px; background: currentColor; opacity: .45; }
.part__t { font: 400 clamp(44px, 5vw, 80px)/.96 var(--serif); color: var(--ink); letter-spacing: -.012em; margin: .32em 0 0 -.03em; text-wrap: balance; }
.essay h3 { font: 400 clamp(30px, 2.6vw, 40px)/1.05 var(--serif); color: var(--ink); margin: 1.9em 0 .6em; }

/* a sentence that stands alone in the original */
.statement { font: italic 400 clamp(31px, 3.2vw, 48px)/1.1 var(--serif); color: var(--ink); letter-spacing: -.006em; margin: 1.45em 0 !important; padding-left: clamp(18px, 2vw, 28px); border-left: 1px solid var(--ink); }

/* plates */
.plate { margin: clamp(10px, 2vh, 20px) 0 clamp(44px, 7vh, 72px) !important; }
.plate--port { justify-self: center; width: min(100%, 500px); }
.plate--land { justify-self: center; width: min(100%, 980px); }
.plate__btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.plate figcaption { margin-top: 16px; font: italic 400 15px/1.5 var(--book); color: var(--ink-2); max-width: 36em; }
.plate--port figcaption { text-align: center; margin-inline: auto; }
.plate__n { display: block; margin-bottom: 6px; font: 500 10.5px/1.3 var(--sans); letter-spacing: .2em; text-transform: uppercase; font-style: normal; color: var(--ink); }

/* three things that are one thing */
.triad { display: grid; grid-template-columns: repeat(3, 1fr); margin: 1.6em 0 1.9em !important; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); list-style: none; padding: 0; }
.triad li { padding: 26px clamp(18px, 2vw, 30px) 30px; border-left: 1px solid var(--rule); font-size: .86em; line-height: 1.55; }
.triad li:first-child { border-left: 0; padding-left: 0; }
.triad b { display: block; font: italic 400 clamp(26px, 2.2vw, 34px)/1.05 var(--serif); color: var(--ink); margin-bottom: .55em; }

/* numbered: the hanging numeral in the margin */
.count { list-style: none; padding: 0; counter-reset: c; }
.count li { counter-increment: c; position: relative; padding-left: 0; }
.count li + li { margin-top: .85em; }
.count li::before { content: counter(c); position: absolute; right: calc(100% + 22px); top: -.18em; font: italic 400 1.9em/1 var(--serif); color: var(--ink-2); }
.count--rules li + li { margin-top: 1.25em; }
.count--rules li::before { font: 400 2.5em/1 var(--display); color: var(--ink); top: -.06em; font-style: normal; }

/* ledger: lists with bold leads, hairlines between */
.ledger { list-style: none; padding: 0; border-top: 1px solid var(--rule); }
.ledger li { padding: .82em 0 .9em; border-bottom: 1px solid var(--rule); }

/* figures */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; padding: 0; margin: 1.5em 0 1.8em !important; border-top: 1px solid var(--ink); }
.stats li { padding: 22px clamp(14px, 1.6vw, 24px) 6px 0; }
.stats li + li { padding-left: clamp(14px, 1.6vw, 24px); border-left: 1px solid var(--rule); }
.stat__fig { display: block; font: 400 clamp(46px, 4.6vw, 74px)/.92 var(--display); color: var(--ink); letter-spacing: .005em; margin-bottom: 14px; font-variant-numeric: lining-nums; }
.stats p { font-size: .8em; line-height: 1.5; color: var(--text); }

/* the bottleneck map */
.map { margin: 1.6em 0 2em !important; }
.map table { width: 100%; border-collapse: collapse; font-size: .78em; line-height: 1.45; }
.map caption { caption-side: top; text-align: left; padding-bottom: 14px; }
.map th { font: 500 10.5px/1.3 var(--sans); letter-spacing: .18em; text-transform: uppercase; text-align: left; color: var(--ink-2); padding: 0 16px 12px 0; border-bottom: 1px solid var(--ink); vertical-align: bottom; }
.map td { padding: 16px 16px 17px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.map td:first-child { font: italic 400 1.42em/1.12 var(--serif); color: var(--ink); width: 21%; padding-right: 22px; }
.map td:nth-child(2) { width: 22%; }
.map td:nth-child(3) { width: 30%; }

/* ============================== coda: the sky again ============================== */
.coda { margin-top: clamp(110px, 17vh, 190px); padding: clamp(84px, 13vh, 150px) 0 clamp(90px, 14vh, 160px); display: grid; grid-template-columns: inherit; }
/* (not the grain: an absolutely positioned grid child with a grid column takes that column as its box) */
.coda > :not(.grain) { grid-column: text; }
.coda > .wide { grid-column: wide; }
.coda .part { margin-top: 0; }
.coda .part__n, .coda .part__t { color: #fff; }
.coda .part__n { color: rgba(255, 255, 255, .8); }
.coda p { color: rgba(255, 255, 255, .93); }
.coda .plate figcaption { color: rgba(255, 255, 255, .78); }
.coda .plate__n { color: #fff; }
.seize-it { font: 400 clamp(88px, 13vw, 210px)/.86 var(--display) !important; text-transform: uppercase; color: #fff !important; margin-top: .42em !important; letter-spacing: .005em; }

/* notes */
.notes { margin-top: clamp(84px, 13vh, 140px); display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(28px, 4vw, 64px); font-size: .8em; line-height: 1.55; }
.notes > h2 { grid-column: 1 / -1; font: 400 clamp(38px, 3.6vw, 56px)/1 var(--serif); color: var(--ink); margin-bottom: .5em; }
.notes > .notes__lead { grid-column: 1 / -1; font-size: 1.12em; margin-bottom: 1.8em; color: var(--text); }
.notes h3 { font: 500 10.5px/1.3 var(--sans) !important; letter-spacing: .2em; text-transform: uppercase; color: var(--ink) !important; margin: 0 0 14px !important; }
.notes ul { list-style: none; padding: 0; border-top: 1px solid var(--rule); }
.notes li { padding: 9px 0 10px; border-bottom: 1px solid var(--rule); }
.notes a { text-decoration-thickness: 1px; text-underline-offset: .18em; text-decoration-color: rgba(14, 15, 17, .35); transition: text-decoration-color .3s; }
.notes a:hover { text-decoration-color: currentColor; }
.notes .notes__src { margin-top: 1.2em; color: var(--ink-2); }

/* end: the way back in */
.close { margin-top: clamp(90px, 14vh, 150px); padding-top: 34px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: baseline; gap: 18px 32px; flex-wrap: wrap; }
.close p { font: italic 400 clamp(26px, 2.4vw, 36px)/1.15 var(--serif); color: var(--ink); }
.btn { display: inline-flex; align-items: center; gap: 14px; padding: 18px 28px 17px; background: var(--ink); color: var(--snow); text-decoration: none; transition: background .35s var(--ease); }
.btn svg { width: 16px; height: 10px; transition: transform .45s var(--ease); }
.btn:hover { background: #26282c; }
.btn:hover svg { transform: translateX(5px); }

/* footer: as on the home page */
.foot { padding: clamp(90px, 15vh, 170px) var(--m) 28px; container-type: inline-size; overflow: hidden; }
.foot__mark { display: block; font: 400 calc(100cqw / 1.8823)/.86 var(--display); text-transform: uppercase; margin-left: -.0205em; white-space: nowrap; color: var(--ink); text-decoration: none; }
.foot__line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px 24px; flex-wrap: wrap; margin-top: 2cqw; padding-top: 18px; border-top: 1px solid var(--rule); }
.foot__line i { font: italic 400 22px/1 var(--serif); color: var(--ink); }
.foot__line .cap { color: var(--ink-2); }

/* contents, in the left margin on wide screens */
.toc { display: none; }
@media (min-width: 1640px) {
  .toc { display: block; position: fixed; left: var(--m); top: 50%; transform: translateY(-50%); z-index: 20; width: 200px; opacity: 0; pointer-events: none; transition: opacity .5s var(--ease); }
  .toc.on { opacity: 1; pointer-events: auto; }
  .toc ol { list-style: none; padding: 0; }
  .toc a { display: flex; gap: 10px; padding: 5px 0; text-decoration: none; font: 500 10px/1.35 var(--sans); letter-spacing: .12em; white-space: nowrap; text-transform: uppercase; color: var(--ink-2); transition: color .3s; }
  .toc a span { flex: 0 0 22px; font: italic 400 15px/1 var(--serif); letter-spacing: 0; text-transform: none; }
  .toc a:hover, .toc a[aria-current="true"] { color: var(--ink); }
  .toc a[aria-current="true"]::after { content: ""; flex: 1; align-self: center; height: 1px; background: currentColor; opacity: .5; }
}

/* enlarge a plate */
.zoom { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(243, 243, 240, .97); }
.zoom::backdrop { background: rgba(243, 243, 240, .6); }
.zoom[open] { display: grid; place-items: center; }
.zoom img { max-width: calc(100vw - 48px); max-height: calc(100vh - 48px); width: auto; height: auto; object-fit: contain; cursor: zoom-out; }
.zoom__x { position: fixed; top: 18px; right: 22px; border: 0; background: none; padding: 8px; cursor: pointer; color: var(--ink); }

/* reveal plates as they arrive (text stays put: nothing moves under the reader) */
.js :is(.plate:not(.cyan), .triad, .stats, .map), .js .plate.cyan img { opacity: 0; transform: translateY(18px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.js .in, .js .plate.cyan.in img { opacity: 1 !important; transform: none !important; }
.js .cover :is(.title, .dek, .meta, .kicker, .cover__plate img, figcaption) { animation: up 1.4s var(--ease) both; }
.js .cover .kicker { animation-delay: .1s; } .js .cover .title { animation-delay: .2s; } .js .cover .dek { animation-delay: .35s; }
.js .cover .meta { animation-delay: .5s; } .js .cover__plate img { animation-delay: .25s; animation-duration: 2s; } .js .cover figcaption { animation-delay: .8s; }
@keyframes up { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

@media (max-width: 1100px) {
  .cover__text { grid-column: 1 / 7; }
  .cover__plate { grid-column: 7 / 13; }
}
@media (max-width: 860px) {
  .cover__grid { grid-template-columns: 1fr; row-gap: clamp(36px, 6vh, 56px); padding-top: 28px; }
  .cover__text, .cover__plate { grid-column: 1 / -1; }
  .cover__plate { justify-self: stretch; width: 100%; }
  .bar nav { gap: 20px; }
  .triad { grid-template-columns: 1fr; }
  .triad li { border-left: 0; padding: 22px 0 24px; }
  .triad li + li { border-top: 1px solid var(--rule); }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats li:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats li:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .count li { padding-left: 2.1em; }
  .count li::before { right: auto; left: 0; }
  .count--rules li { padding-left: 1.7em; }
  .notes { grid-template-columns: 1fr; row-gap: 32px; }
  /* the map as cards */
  .map thead { display: none; }
  .map table, .map tbody, .map tr, .map td { display: block; width: auto !important; }
  .map tr { padding: 16px 0 14px; border-bottom: 1px solid var(--rule); }
  .map tr:first-child { border-top: 1px solid var(--ink); }
  .map td { border: 0; padding: 3px 0; }
  .map td:first-child { font-size: 1.5em; padding-bottom: 8px; }
  .map td:not(:first-child)::before { content: attr(data-label); display: block; font: 500 9.5px/1.4 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); margin-top: 6px; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  .stats li, .stats li + li { padding-left: 0; border-left: 0; }
  .stats li + li { border-top: 1px solid var(--rule); }
  .bar nav a:not(:last-child) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js :is(.plate, .triad, .stats, .map), .js .plate img { opacity: 1; transform: none; transition: none; }
  .js .cover * { animation: none !important; }
}
@media print {
  .progress, .toc, .grain, .bar nav, .zoom { display: none !important; }
  .js :is(.plate, .triad, .stats, .map), .js .plate img { opacity: 1; transform: none; }
  .sky { background: #fff; color: #000; }
  .cyan img { mix-blend-mode: normal; filter: invert(1); }
}
