/* Large Language Mind: journal styles. Tokens follow DESIGN_SYSTEM.md. */

:root {
  /* 1 design pixel. The design is drawn at 1440 wide; wider screens scale it up instead of opening gaps. */
  --u: clamp(1px, calc(100vw / 1440), 1.6px);
  /* hero unit: follows the window height so the whole hero fits on the first screen */
  --hs: clamp(0.6px, min(calc(100vh / 1065), calc(100vw / 1180)), 1.6px);
  --bg: #EDE3CC;
  --ink: #1C1712;
  --text: #2A241D;
  --muted: #5E554A;
  --line: rgba(28, 23, 18, 0.18);
  --accent: #A8432A;
  --halo: 0 0 3px #EDE3CC, 0 0 6px #EDE3CC, 0 0 12px #EDE3CC;
  --scrim: radial-gradient(ellipse 36% 46% at 20% 50%, rgba(237, 227, 204, 0.92) 40%, rgba(237, 227, 204, 0) 100%);
  --plate-bg: transparent;
  --fig-paper: transparent;
  --fig-pad: 0;
  /* handmade-paper grain (generated, seamless 512px tile) */
  --paper-img: url("../img/paper/paper.webp?v=3");
  --gutter: calc(48 * var(--u));
  --serif: 'EB Garamond', Georgia, serif;
  --display: 'Instrument Serif', Georgia, serif;
  --hand: 'Homemade Apple', cursive;
  color-scheme: light;
}
[data-theme="night"] {
  --bg: #0A0B0D;
  --ink: #E8E4DC;
  --text: #D9D5CD;
  --muted: #A39F97;
  --line: rgba(232, 228, 220, 0.16);
  --accent: #E2A65A;
  --halo: 0 0 3px #0A0B0D, 0 0 6px #0A0B0D, 0 0 12px #0A0B0D;
  --scrim: radial-gradient(ellipse 36% 46% at 20% 50%, rgba(10, 11, 13, 0.9) 40%, rgba(10, 11, 13, 0) 100%);
  --plate-bg: #000;
  --fig-paper: transparent;
  --fig-pad: 0;
  --paper-img: url("../img/paper/night.webp?v=3");
  color-scheme: dark;
}

html, body { margin: 0; }
/* no visible scrollbars anywhere; wheel, touchpad, touch and keys still scroll */
html, * { scrollbar-width: none; -ms-overflow-style: none; }
::-webkit-scrollbar { display: none; width: 0; height: 0; }
html { background: var(--paper-img) 0 0 / 512px 512px repeat, var(--bg); }
body {
  background: var(--paper-img) 0 0 / 512px 512px repeat, var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: calc(3 * var(--u)); }
.hand { font-family: var(--hand); font-weight: 400; }
.smallcaps { font-variant: small-caps; letter-spacing: 0.06em; font-size: calc(17 * var(--u)); color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- page shell ---------- */
.page { position: relative; z-index: 0; min-height: 100vh; overflow-x: clip; }
/* Page background: spans the full page and scrolls with it. neural-engine.js fills it
   with window-sized tiles, drawn only near the viewport (see mountField). */
.field {
  position: absolute; inset: 0; overflow: hidden;
  z-index: -1; pointer-events: none; opacity: 0; transition: opacity 2s ease;
}
.theme-toggle {
  background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap;
  font-family: var(--hand); font-size: calc(14 * var(--u)); line-height: 1.8; color: var(--accent);
}
.theme-toggle:hover { color: var(--ink); }

/* ---------- home header ---------- */
.home-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: calc(14 * var(--u)) calc(40 * var(--u)); padding: calc(22 * var(--u)) var(--gutter) 0 calc(46 * var(--u));
}
.home-header .logo-link { display: block; }
.home-header .logo { display: block; width: calc(40 * var(--u)); height: calc(40 * var(--u)); }
.home-nav { display: flex; flex-wrap: wrap; align-items: baseline; gap: calc(8 * var(--u)) calc(24 * var(--u)); font-size: calc(19 * var(--u)); white-space: nowrap; }
.home-nav a { color: var(--ink); }
.home-nav a:hover { color: var(--accent); }
.home-nav sup { font-style: italic; font-size: calc(13 * var(--u)); color: var(--accent); margin-right: calc(3 * var(--u)); }
.home-nav .theme-toggle { padding-left: calc(8 * var(--u)); }

/* ---------- hero ---------- */
.hero { position: relative; height: max(calc(900 * var(--hs)), 100vh); overflow: hidden; }
.hero-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent max(24%, calc(380 * var(--hs))), #000 max(42%, calc(520 * var(--hs))), #000 92%, transparent 100%),
                      linear-gradient(180deg, transparent 0, #000 16%, #000 82%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent max(24%, calc(380 * var(--hs))), #000 max(42%, calc(520 * var(--hs))), #000 92%, transparent 100%),
              linear-gradient(180deg, transparent 0, #000 16%, #000 82%, transparent 100%);
  mask-composite: intersect;
}
.hero-scrim { position: absolute; inset: 0; background: var(--scrim); pointer-events: none; }
.hero-text {
  position: absolute; left: var(--gutter); top: calc(96 * var(--u)); z-index: 2;
  display: flex; flex-direction: column; gap: calc(40 * var(--hs));
}
.hero-title {
  margin: 0; font-family: var(--display); font-weight: 400;
  font-size: clamp(calc(68 * var(--hs)), 8.6vw, calc(148 * var(--hs))); line-height: 0.86; letter-spacing: -0.025em;
  color: var(--ink); pointer-events: none;
}
.hero-title em { font-style: italic; }
.hero-intro { width: min(max(340px, calc(400 * var(--hs))), calc(100vw - 2 * var(--gutter))); }
.hero-intro p { margin: 0 0 calc(14 * var(--hs)); font-size: max(17px, calc(21 * var(--hs))); line-height: 1.5; color: var(--ink); text-wrap: pretty; }
.hero-intro .smallcaps { margin-top: calc(28 * var(--hs)); }
.beats { list-style: none; margin: calc(10 * var(--hs)) 0 0; padding: 0; display: flex; flex-direction: column; gap: calc(10 * var(--hs)); }
.beats li { display: flex; gap: calc(14 * var(--hs)); align-items: baseline; transition: opacity .8s; }
.beats .beat-n { flex: none; width: calc(30 * var(--hs)); font-family: var(--hand); font-size: calc(14 * var(--hs)); line-height: 1.8; color: var(--accent); }
.beats .beat-t { font-size: max(16px, calc(19 * var(--hs))); line-height: 1.4; }
.beats em { color: var(--muted); }
.beats[data-phase="0"] li:not(:nth-child(1)),
.beats[data-phase="1"] li:not(:nth-child(2)),
.beats[data-phase="2"] li:not(:nth-child(3)) { opacity: 0.42; }

/* ---------- sections ---------- */
.band { position: relative; padding: calc(110 * var(--u)) var(--gutter) calc(100 * var(--u)); }
.band-notes { padding: calc(120 * var(--u)) var(--gutter) calc(140 * var(--u)); }
.band-inner { position: relative; max-width: calc(1080 * var(--u)); margin: 0 auto; }
.band-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: calc(12 * var(--u)) calc(64 * var(--u)); margin-bottom: calc(44 * var(--u));
}
.band-head h2 { margin: 0; font-weight: 400; font-size: calc(52 * var(--u)); line-height: 1.05; }
.band-head > p { margin: 0; max-width: calc(440 * var(--u)); font-style: italic; font-size: calc(19 * var(--u)); line-height: 1.5; color: var(--muted); text-wrap: pretty; }

/* atlas */
.lenses { display: flex; flex-wrap: wrap; gap: calc(40 * var(--u)); }
.lens { flex: 1 1 calc(260 * var(--u)); min-width: 0; display: flex; flex-direction: column; gap: calc(16 * var(--u)); }
.lens-plate { position: relative; aspect-ratio: 1 / 1; max-height: calc(280 * var(--u)); background: var(--plate-bg); overflow: hidden; }
.lens-plate canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.6s ease; }
.lens-title { display: flex; justify-content: space-between; align-items: baseline; gap: calc(12 * var(--u)); }
.lens-title > span:first-child { display: flex; gap: calc(12 * var(--u)); align-items: baseline; }
.lens-letter { flex: none; font-family: var(--hand); font-size: calc(14 * var(--u)); line-height: 1.8; color: var(--accent); }
.lens-name { font-size: calc(28 * var(--u)); line-height: 1.1; }
.lens-count { font-style: italic; font-size: calc(16 * var(--u)); color: var(--muted); white-space: nowrap; }
.lens-sub { margin: -8px 0 0; font-style: italic; font-size: calc(17 * var(--u)); line-height: 1.45; color: var(--muted); text-wrap: pretty; }
.lens-list { border-top: 1px solid var(--line); }
.lens-list a {
  display: grid; grid-template-columns: calc(28 * var(--u)) minmax(0, 1fr); column-gap: calc(10 * var(--u));
  padding: calc(10 * var(--u)) 0; border-bottom: 1px solid var(--line); font-size: calc(18 * var(--u)); line-height: 1.4; color: var(--ink);
}
.lens-list a:hover { opacity: 0.8; color: var(--ink); }
.lens-list em { color: var(--accent); }
.lens-empty { padding: calc(10 * var(--u)) 0; border-bottom: 1px solid var(--line); font-style: italic; font-size: calc(17 * var(--u)); color: var(--muted); }
.lens-more { font-style: italic; font-size: calc(17 * var(--u)); color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: calc(4 * var(--u)); }

/* notes */
.filters { display: flex; flex-wrap: wrap; align-items: baseline; gap: calc(4 * var(--u)) calc(18 * var(--u)); font-size: calc(18 * var(--u)); }
.filters .count { font-style: italic; color: var(--muted); white-space: nowrap; }
.filters button {
  background: none; border: 0; padding: 0; cursor: pointer; font-size: calc(18 * var(--u)); color: var(--muted);
  text-decoration-color: var(--accent); text-underline-offset: calc(5 * var(--u)); text-decoration-thickness: 1.5px;
}
.filters button[aria-pressed="true"] { color: var(--ink); text-decoration-line: underline; }
.note-row {
  display: flex; flex-wrap: wrap; gap: calc(20 * var(--u)) calc(36 * var(--u)); padding: calc(32 * var(--u)) 0;
  border-top: 1px solid var(--line); color: var(--ink); transition: opacity .2s;
}
.note-row:hover { opacity: 0.8; color: var(--ink); }
.note-row[hidden] { display: none; }
.note-row canvas { width: calc(96 * var(--u)); height: calc(124 * var(--u)); flex: none; }
.note-body { flex: 1 1 calc(420 * var(--u)); min-width: 0; display: flex; flex-direction: column; gap: calc(10 * var(--u)); }
.note-head { display: flex; flex-direction: column; gap: calc(4 * var(--u)); }
.note-title { font-size: clamp(calc(28 * var(--u)), 3vw, calc(36 * var(--u))); line-height: 1.15; text-wrap: balance; }
.note-title em { color: var(--accent); margin-right: calc(10 * var(--u)); }
.note-date { font-style: italic; font-size: calc(17 * var(--u)); color: var(--muted); font-variant-numeric: oldstyle-nums; white-space: nowrap; }
.note-summary { font-size: calc(19 * var(--u)); line-height: 1.5; color: var(--muted); max-width: 62ch; text-wrap: pretty; }
.note-filed { font-style: italic; font-size: calc(16 * var(--u)); color: var(--muted); }
.ghost-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: calc(20 * var(--u)) calc(36 * var(--u)); padding: calc(32 * var(--u)) 0;
  border-top: 1px dashed var(--line); border-bottom: 1px solid var(--line);
}
.ghost-row canvas { width: calc(96 * var(--u)); height: calc(124 * var(--u)); flex: none; }
.ghost-row span { font-family: var(--hand); font-size: calc(17 * var(--u)); line-height: 1.8; color: var(--muted); }
.no-match { padding: calc(32 * var(--u)) 0; border-top: 1px solid var(--line); font-style: italic; font-size: calc(19 * var(--u)); color: var(--muted); }

.site-footer {
  position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; gap: calc(12 * var(--u)) calc(32 * var(--u));
  padding: calc(28 * var(--u)) var(--gutter) calc(40 * var(--u)); font-style: italic; font-size: calc(17 * var(--u)); color: var(--muted);
}
.site-footer a { text-decoration: underline; text-underline-offset: calc(3 * var(--u)); }

/* ---------- article ---------- */
/* fixed, not sticky: Safari drags a sticky bar that sits inside a clipping container while
   the address bar animates. The page reserves the bar's height (measured by journal.js). */
.note-header { position: fixed; top: 0; left: 0; right: 0; z-index: 10; background: var(--paper-img) 0 0 / 512px 512px repeat, var(--bg); border-bottom: 1px solid var(--line); }
.note-page { padding-top: var(--note-hdr, calc(55 * var(--u))); }
.note-header-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: calc(8 * var(--u)) calc(32 * var(--u)); padding: calc(10 * var(--u)) var(--gutter); }
.wordmark { display: flex; align-items: center; gap: calc(10 * var(--u)); white-space: nowrap; color: var(--ink); }
.wordmark canvas { display: block; width: calc(34 * var(--u)); height: calc(34 * var(--u)); }
.wordmark span { font-family: var(--display); font-size: calc(30 * var(--u)); line-height: 1.2; letter-spacing: -0.01em; }
.note-header-links { display: flex; gap: calc(28 * var(--u)); align-items: baseline; white-space: nowrap; }
.note-header-links > a { font-style: italic; font-size: calc(18 * var(--u)); color: var(--muted); }
.note-header .theme-toggle, .note-header .read-toggle { font-size: calc(13 * var(--u)); }
.read-toggle { background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap; font-family: var(--hand); line-height: 1.8; color: var(--muted); }
.read-toggle:hover { color: var(--accent); }
.progress { height: 2px; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }

.note-page { --u: clamp(1px, calc(100vw / 1700), 1.12px); }
.note-grid { display: flex; flex-wrap: wrap; gap: calc(48 * var(--u)) calc(64 * var(--u)); max-width: calc(1240 * var(--u)); margin: 0 auto; padding: 0 var(--gutter) calc(140 * var(--u)); }
.toc { flex: 0 0 calc(230 * var(--u)); position: sticky; top: calc(90 * var(--u)); align-self: flex-start; padding-top: calc(90 * var(--u)); max-height: calc(100vh - 110 * var(--u)); overflow-y: auto; }
.toc .smallcaps { margin-bottom: calc(12 * var(--u)); }
.toc button {
  display: grid; grid-template-columns: calc(22 * var(--u)) minmax(0, 1fr); column-gap: calc(12 * var(--u)); align-items: baseline;
  width: 100%; padding: calc(10 * var(--u)) 0; background: none; border: 0; cursor: pointer; text-align: left;
}
.toc em { font-size: calc(16 * var(--u)); color: var(--muted); }
.toc span { display: block; min-width: 0; font-size: calc(17 * var(--u)); line-height: 1.4; color: var(--muted); }
.toc button:hover span { color: var(--ink); }
.toc button[aria-current="true"] em { color: var(--accent); }
.toc button[aria-current="true"] span { color: var(--ink); }

.article { flex: 1 1 calc(520 * var(--u)); min-width: 0; max-width: calc(700 * var(--u)); position: relative; }
.article-hero { position: relative; padding: calc(80 * var(--u)) 0 calc(44 * var(--u)); }
.specimen {
  position: absolute; right: -160px; top: -40px; width: calc(540 * var(--u)); height: calc(640 * var(--u)); margin: 0;
  pointer-events: none; z-index: 0; opacity: 0.85;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.2) 32%, #000 66%), linear-gradient(180deg, #000 36%, rgba(0,0,0,0.3) 46%, transparent 54%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.2) 32%, #000 66%), linear-gradient(180deg, #000 36%, rgba(0,0,0,0.3) 46%, transparent 54%);
  mask-composite: intersect;
}
.specimen canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.article-hero-text { position: relative; z-index: 1; }
.article-meta { display: flex; flex-wrap: wrap; gap: calc(6 * var(--u)) calc(20 * var(--u)); align-items: baseline; margin-bottom: calc(22 * var(--u)); }
.article-meta .plate { display: inline-block; white-space: nowrap; transform: rotate(-2deg); font-family: var(--hand); font-size: calc(20 * var(--u)); line-height: 1.7; color: var(--accent); }
.article-meta .date { font-style: italic; font-size: calc(18 * var(--u)); color: var(--muted); font-variant-numeric: oldstyle-nums; white-space: nowrap; }
.article-meta .cell { font-family: var(--hand); font-size: calc(13 * var(--u)); line-height: 1.8; color: var(--muted); white-space: nowrap; }
.article-title { margin: 0 0 calc(24 * var(--u)); font-weight: 400; font-size: clamp(calc(40 * var(--u)), 4.6vw, calc(64 * var(--u))); line-height: 1.04; letter-spacing: -0.01em; text-wrap: balance; }
.standfirst { margin: 0; font-style: italic; font-size: calc(20 * var(--u)); line-height: 1.5; color: var(--muted); text-wrap: pretty; text-shadow: var(--halo); }
.standfirst cite, .standfirst .roman { font-style: normal; }

/* prose: what Markdown turns into */
.prose { position: relative; z-index: 1; color: var(--text); font-size: calc(19.5 * var(--u)); line-height: 1.6; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 calc(20 * var(--u)); text-wrap: pretty; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: calc(4 * var(--u)); text-decoration-thickness: 1px; }
.prose a:hover { color: var(--accent); }
.prose h1, .prose h2 { margin: 0 0 calc(22 * var(--u)); padding-top: calc(52 * var(--u)); font-weight: 400; font-size: calc(32 * var(--u)); line-height: 1.15; color: var(--ink); scroll-margin-top: calc(80 * var(--u)); }
.prose > h2:first-child, .prose > h1:first-child { padding-top: calc(8 * var(--u)); }
.prose h2 .num, .prose h1 .num { color: var(--accent); }
.prose h3 { margin: calc(36 * var(--u)) 0 calc(12 * var(--u)); font-weight: 400; font-style: italic; font-size: calc(26 * var(--u)); line-height: 1.25; color: var(--ink); }
.prose h3 strong { font-weight: 400; }
.prose h4 { margin: calc(28 * var(--u)) 0 calc(10 * var(--u)); font-weight: 400; font-size: calc(22 * var(--u)); color: var(--ink); }
.prose ul, .prose ol { margin: 0 0 calc(26 * var(--u)); padding-left: calc(24 * var(--u)); line-height: 1.6; }
.prose li { margin: calc(4 * var(--u)) 0; }
.prose li::marker { color: var(--accent); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: calc(48 * var(--u)) 0; }
.prose img { display: block; max-width: 100%; height: auto; mix-blend-mode: multiply; }
.prose code { font-family: var(--serif); font-style: italic; color: var(--ink); }
.prose pre { overflow-x: auto; padding: calc(16 * var(--u)) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: calc(16 * var(--u)); line-height: 1.5; }
.prose pre code { font-family: ui-monospace, Consolas, monospace; font-style: normal; }

/* pull quote: any Markdown blockquote; optional label with {: data-label="the question"} */
.prose blockquote { margin: calc(44 * var(--u)) 0; padding: 0; font-style: italic; font-size: clamp(calc(28 * var(--u)), 3vw, calc(34 * var(--u))); line-height: 1.25; color: var(--ink); text-wrap: balance; }
.prose blockquote p { margin: 0 0 calc(12 * var(--u)); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote[data-label]::before {
  content: attr(data-label); display: block; width: max-content; margin-bottom: calc(6 * var(--u)); transform: rotate(-3deg);
  font-family: var(--hand); font-style: normal; font-size: calc(16 * var(--u)); line-height: 1.8; color: var(--accent);
}

/* figure: an image paragraph followed by an italic caption becomes a plate figure (journal.js) */
.prose figure { margin: calc(8 * var(--u)) 0 calc(36 * var(--u)); }
.prose figure .fig-paper { background: var(--fig-paper); padding: var(--fig-pad); display: flex; justify-content: center; isolation: isolate; }
:root:not([data-theme="night"]) .prose figure .fig-paper { background: var(--paper-img) 0 0 / 512px 512px repeat, var(--bg); }
.prose figcaption { display: flex; gap: calc(14 * var(--u)); align-items: baseline; padding-top: calc(12 * var(--u)); }
.prose figcaption .fig-n { flex: none; font-family: var(--hand); font-size: calc(13 * var(--u)); line-height: 1.8; color: var(--accent); }
.prose figcaption .fig-t { font-style: italic; font-size: calc(17 * var(--u)); line-height: 1.45; color: var(--muted); }

/* definition list: term / note rows */
.prose dl { margin: 0 0 calc(30 * var(--u)); border-top: 1px solid var(--line); }
.prose dt { padding-top: calc(12 * var(--u)); font-size: calc(22 * var(--u)); line-height: 1.35; color: var(--ink); }
.prose dd { margin: 2px 0 0; padding-bottom: calc(12 * var(--u)); border-bottom: 1px solid var(--line); font-style: italic; font-size: calc(18 * var(--u)); line-height: 1.45; color: var(--muted); }

/* tables */
.prose .table-wrap { overflow-x: auto; margin: 0 0 calc(32 * var(--u)); }
.prose table { width: 100%; border-collapse: collapse; font-size: calc(17 * var(--u)); line-height: 1.45; }
.prose th { text-align: left; font-weight: 400; font-variant: small-caps; letter-spacing: 0.04em; color: var(--muted); padding: calc(10 * var(--u)) calc(14 * var(--u)) calc(10 * var(--u)) 0; border-bottom: 1px solid var(--ink); }
.prose td { padding: calc(12 * var(--u)) calc(14 * var(--u)) calc(12 * var(--u)) 0; border-bottom: 1px solid var(--line); vertical-align: top; }

.note-end { margin: calc(56 * var(--u)) 0 0; padding-top: calc(24 * var(--u)); border-top: 1px solid var(--line); font-style: italic; font-size: calc(19 * var(--u)); line-height: 1.55; color: var(--muted); }
.note-end a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: calc(4 * var(--u)); }

[data-theme="night"] .prose img { mix-blend-mode: normal; }

/* ---------- newspaper view (toggle on article pages, remembered per visitor) ----------
   journal.js groups the text between headings, figures, tables and quotes into
   .chunk blocks. Short blocks stay one readable column; longer ones become two
   balanced columns, cut at paragraph boundaries so no block is taller than about
   three quarters of the screen: read left column, then right, then the next block. */
[data-read="columns"] .note-grid { max-width: calc(1480 * var(--u)); gap: calc(40 * var(--u)) calc(56 * var(--u)); }
[data-read="columns"] .toc { flex-basis: calc(210 * var(--u)); }
[data-read="columns"] .article { max-width: none; flex: 1 1 calc(760 * var(--u)); }
[data-read="columns"] .article-hero { padding-bottom: calc(26 * var(--u)); margin-bottom: calc(10 * var(--u)); border-bottom: 3px double var(--ink); }
[data-read="columns"] .article-title { font-size: clamp(calc(44 * var(--u)), 5vw, calc(76 * var(--u))); max-width: 18em; }
[data-read="columns"] .standfirst { max-width: 46em; }
[data-read="columns"] .specimen { right: 0; }
[data-read="columns"] .prose { font-size: calc(18 * var(--u)); line-height: 1.6; font-variant-numeric: oldstyle-nums; }

[data-read="columns"] .prose .chunk { margin: 0 0 calc(22 * var(--u)); }
[data-read="columns"] .prose .chunk-single { max-width: 40em; }
[data-read="columns"] .prose .chunk-cols {
  columns: 2 21em; column-gap: calc(56 * var(--u)); column-rule: 1px solid var(--line); column-fill: balance;
  text-align: justify; hyphens: auto; -webkit-hyphens: auto;
}
/* a long passage continues in the next block: a faint rule says "start again at the left" */
[data-read="columns"] .prose .chunk-cont { padding-top: calc(20 * var(--u)); border-top: 1px dotted var(--line); }
[data-read="columns"] .prose .chunk p { margin: 0 0 0.75em; text-wrap: wrap; orphans: 3; widows: 3; }
[data-read="columns"] .prose .chunk-cols p:last-child { margin-bottom: 0; }
[data-read="columns"] .prose .chunk ul,
[data-read="columns"] .prose .chunk ol,
[data-read="columns"] .prose .chunk dl { break-inside: avoid; margin: 0 0 0.9em; text-align: left; }
[data-read="columns"] .prose .chunk li { margin: 0.25em 0; }
[data-read="columns"] .prose .chunk h4 { break-after: avoid; text-align: left; margin: 0.4em 0 0.3em; font-variant: small-caps; letter-spacing: 0.04em; font-size: 1em; }

[data-read="columns"] .prose h1,
[data-read="columns"] .prose h2 { margin: calc(40 * var(--u)) 0 calc(18 * var(--u)); padding-top: calc(16 * var(--u)); border-top: 1px solid var(--ink); font-size: calc(32 * var(--u)); }
[data-read="columns"] .prose > h2:first-child, [data-read="columns"] .prose > h1:first-child { margin-top: calc(16 * var(--u)); padding-top: 0; border-top: 0; }
[data-read="columns"] .prose h3 { margin: calc(26 * var(--u)) 0 calc(12 * var(--u)); font-size: calc(23 * var(--u)); }
[data-read="columns"] .prose hr { margin: calc(26 * var(--u)) 0; }
[data-read="columns"] .prose blockquote { text-align: center; max-width: 30em; margin: calc(34 * var(--u)) auto; padding: calc(22 * var(--u)) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
[data-read="columns"] .prose blockquote[data-label]::before { margin-left: auto; margin-right: auto; }
[data-read="columns"] .prose figure { max-width: calc(980 * var(--u)); margin: calc(26 * var(--u)) auto; }
[data-read="columns"] .prose figure .fig-paper img { max-height: 70vh; width: auto; }

/* drop cap at the start of each section, set with initial-letter so it can never come
   loose from its word; browsers without initial-letter simply show a normal letter */
@supports (initial-letter: 2) or (-webkit-initial-letter: 2) {
  [data-read="columns"] .prose > .chunk:first-child > p:first-child::first-letter,
  [data-read="columns"] .prose h1 + .chunk > p:first-child::first-letter,
  [data-read="columns"] .prose h2 + .chunk > p:first-child::first-letter {
    -webkit-initial-letter: 2; initial-letter: 2; font-family: var(--display); color: var(--ink); margin-right: 0.08em;
  }
}

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  /* the reading-progress bar stays; the sidebar would push the title a screen down */
  .toc { display: none; }
  .article-hero { padding-top: calc(48 * var(--u)); }
  .specimen { right: -220px; opacity: 0.5; }
}
@media (max-width: 640px) {
  :root { --gutter: 20px; --u: 1px; --hs: 1px; }
  .home-header { position: relative; padding: calc(20 * var(--u)) var(--gutter) 0; align-items: center; }
  .home-header .logo-link, .home-nav { padding-top: 0; }
  .home-header { flex-wrap: nowrap; gap: 12px; padding-left: 16px; padding-right: 16px; }
  .home-header .logo { width: 32px; height: 32px; }
  .home-nav { flex-wrap: nowrap; gap: 12px; font-size: 16px; }
  .home-nav sup { font-size: 11px; margin-right: 1px; }
  .home-nav .theme-toggle { padding-left: 0; font-size: 13px; }
  /* the text flows normally; the figure stays beside the title on the right, behind the
     words, and fades out toward the left so it never sits over the lettering */
  .hero { height: auto; }
  .hero-scrim { display: none; }
  .hero-text { position: relative; left: auto; top: auto; padding: calc(40 * var(--hs)) var(--gutter) calc(48 * var(--hs)); }
  .hero-canvas {
    top: 0; bottom: auto; height: 400px;
    -webkit-mask-image: linear-gradient(90deg, transparent 22%, rgba(0,0,0,0.35) 48%, #000 72%), linear-gradient(180deg, #000 52%, transparent 66%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent 22%, rgba(0,0,0,0.35) 48%, #000 72%), linear-gradient(180deg, #000 52%, transparent 66%);
    mask-composite: intersect;
  }
  .hero-intro { width: auto; }
  .band, .band-notes { padding-top: calc(72 * var(--u)); padding-bottom: calc(72 * var(--u)); }
  .band-head h2 { font-size: calc(42 * var(--u)); }
  .note-header-row { padding: 6px var(--gutter) 5px; row-gap: 0; }
  .note-page { padding-top: var(--note-hdr, 78px); }
  .wordmark span { font-size: calc(24 * var(--u)); }
  .prose { font-size: calc(19 * var(--u)); }
  [data-read="columns"] .prose .chunk-cols { text-align: left; hyphens: manual; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
