/* Essay pages and their PDFs. Screen: the site's screening-room dark. Print/PDF: a dark title page,
   then white A4 pages with a running head. Shared by every essay so they all match. */
:root {
  --night: #0F0E0C;
  --bar: #070706;
  --screen: #EEE8DC;
  --soft: #CFC8BA;
  --dim: #948D80;
  --line: #2A2722;
  --brass: #C7A35E;
  --display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --name: "Jost", "Futura", "Century Gothic", "Avenir", sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--night); color: var(--soft); font-family: var(--body); font-weight: 300; font-size: 1.125rem; line-height: 1.9; -webkit-font-smoothing: antialiased; }
::selection { background: var(--brass); color: var(--night); }
a { color: inherit; }
a:focus-visible { outline: 1px solid var(--brass); outline-offset: 3px; }
img { max-width: 100%; }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.meta { font-family: var(--display); font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); font-variant-numeric: tabular-nums; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: rgb(15 14 12 / 0.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .in { max-width: 72rem; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 0.9rem; }
.topbar a { text-decoration: none; color: var(--screen); transition: color 0.2s ease; }
.topbar a:hover { color: var(--brass); }
.topbar .name { font-family: var(--name); font-weight: 600; font-size: 0.875rem; letter-spacing: 0.2em; text-transform: uppercase; }
.topbar .pdf { border: 1px solid var(--brass); color: var(--brass); padding: 0.45rem 0.9rem; border-radius: 999px; }
.topbar .pdf:hover { background: var(--brass); color: var(--night); }

/* Title block (screen) / title page (print) */
.cover { background: var(--bar); border-bottom: 1px solid var(--line); }
.cover .in { max-width: 72rem; margin: 0 auto; padding-block: 6rem 4.5rem; display: grid; gap: 1.6rem; }
.cover .kicker { color: var(--brass); }
.cover h1 { margin: 0; font-family: var(--display); font-weight: 300; text-transform: uppercase; font-size: clamp(3rem, 9vw, 7.5rem); line-height: 0.9; letter-spacing: 0.01em; color: var(--screen); text-wrap: balance; }
.cover .subtitle { margin: 0; font-style: italic; font-size: clamp(1.25rem, 2.4vw, 1.75rem); line-height: 1.35; color: var(--soft); max-width: 40rem; text-wrap: balance; }
.cover .question { margin: 0; max-width: 40rem; padding-left: 1rem; border-left: 2px solid var(--brass); color: var(--soft); font-size: 1rem; }
.cover .question span { display: block; }
.cover .byline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 2rem; margin-top: 1rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.cover .author { font-family: var(--name); font-weight: 600; font-size: 1rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--screen); }
.cover .film { color: var(--brass); text-decoration: none; border-bottom: 1px solid var(--brass); }

/* Text */
article { max-width: 42rem; margin: 0 auto; padding-block: 4.5rem 3rem; }
article p { margin: 0 0 1.35em; hyphens: auto; }
article p.first::first-letter { float: left; font-family: var(--display); font-weight: 500; font-size: 4.6em; line-height: 0.82; margin: 0.06em 0.12em 0 0; color: var(--brass); }
article em { font-style: italic; }
article h2 { margin: 3.4rem 0 1.4rem; font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(1.7rem, 3.4vw, 2.3rem); line-height: 1.05; letter-spacing: 0.02em; color: var(--screen); text-wrap: balance; }
article h2::before { content: ""; display: block; width: 2.5rem; height: 2px; background: var(--brass); margin-bottom: 0.9rem; }
article h3 { margin: -0.6rem 0 1.4rem; font-family: var(--body); font-style: italic; font-weight: 400; font-size: 1.3rem; line-height: 1.3; color: var(--soft); }

/* Figures break out of the text column */
figure { margin: 2.6rem calc(50% - min(50vw - 16px, 30rem)); }
figure .imgs { display: grid; gap: 0.6rem; grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr)); }
figure img { display: block; width: 100%; height: auto; background: var(--bar); }
figure figcaption { margin: 0.75rem auto 0; max-width: 42rem; font-size: 0.75rem; line-height: 1.5; color: var(--dim); }
figure figcaption b { font-family: var(--display); font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.6875rem; color: var(--brass); margin-right: 0.5rem; }
figure.dropped { margin: 2.2rem 0; padding: 1.1rem 1.25rem; border: 1px dashed var(--line); }
figure.dropped figcaption { margin: 0; }
figure.dropped .note { display: block; margin-top: 0.4rem; font-style: italic; }

/* References */
ol.refs { list-style: none; margin: 0; padding: 0; font-size: 0.875rem; line-height: 1.55; color: var(--dim); }
ol.refs li { padding-left: 1.6rem; text-indent: -1.6rem; margin-bottom: 0.7rem; overflow-wrap: anywhere; }
ol.refs a { color: var(--soft); text-decoration-color: var(--line); }

.endnote { max-width: 42rem; margin: 0 auto; padding-block: 2rem 4rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; }
.endnote a { color: var(--screen); text-decoration: none; }
.endnote a:hover { color: var(--brass); }

@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .cover .in { padding-block: 4rem 3rem; }
  figure .imgs { grid-template-columns: minmax(0, 1fr); }
  article p.first::first-letter { font-size: 3.8em; }
}

/* ---------- Print / PDF ---------- */
@page { size: A4; margin: 24mm 22mm 22mm;
  @top-left { content: "KEVIN BREFO"; font-family: "Jost", sans-serif; font-size: 7.5pt; letter-spacing: 2pt; color: #8A8478; }
  @bottom-right { content: counter(page); font-family: "Barlow Condensed", sans-serif; font-size: 9pt; color: #8A8478; }
}
@page :first { margin: 0; @top-left { content: none; } @top-right { content: none; } @bottom-right { content: none; } }
@media print {
  :root { color-scheme: light; }
  html, body { background: #fff; color: #23201C; font-size: 10.5pt; line-height: 1.75; }
  .topbar, .endnote .back { display: none; }
  .cover { -webkit-print-color-adjust: exact; print-color-adjust: exact; background: #0F0E0C; border: 0; width: 210mm; height: 297mm; break-after: page; display: flex; align-items: flex-end; padding: 0 !important; }
  .cover .in { padding: 0 20mm 26mm; width: 100%; gap: 7mm; }
  .cover h1 { font-size: 46pt; line-height: 0.92; color: #EEE8DC; }
  .cover .subtitle { font-size: 16pt; color: #CFC8BA; }
  .cover .question { font-size: 10.5pt; color: #CFC8BA; }
  .cover .byline { border-color: #3A362F; }
  .cover .meta { font-size: 8.5pt; }
  .cover .film { display: none; }
  .gutter { padding: 0 !important; }
  article { max-width: none; padding: 0; }
  article p { margin-bottom: 0.85em; orphans: 3; widows: 3; text-align: justify; }
  article p.first::first-letter { color: #A8843F; font-size: 4.2em; }
  article h2 { color: #14120F; font-size: 17pt; margin: 9mm 0 4mm; break-after: avoid; break-inside: avoid; }
  article h2::before { background: #A8843F; }
  article h3 { color: #4A4640; font-size: 12pt; break-after: avoid; }
  figure { margin: 6mm 0; break-inside: avoid; }
  figure img { max-height: 82mm; width: auto; max-width: 100%; margin: 0 auto; background: none; }
  figure .imgs { justify-items: center; }
  figure figcaption { font-size: 7.5pt; line-height: 1.45; color: #6B655B; max-width: none; text-align: left; }
  figure figcaption b { color: #A8843F; font-size: 7pt; }
  figure.dropped { border-color: #CFC9BD; }
  ol.refs { font-size: 8.5pt; color: #4A4640; }
  ol.refs a { color: #4A4640; text-decoration: none; }
  .endnote { border-color: #E2DED5; color: #6B655B; padding: 6mm 0 0; }
  .endnote a { color: #23201C; }
  .meta { color: #6B655B; }
}
