/* faerie.land — Lamplit: the whole design system.
   faerie.land's reading room (one column, one frame, structure as ornament),
   lit by edithminalyre.com's lamp (night first, amber glow, fog, grain, the
   wisp, Cormorant italics, glyph marks). See DESIGN.md and README.md.
   Rule of the house: only transform and opacity ever animate, nothing sits
   in front of the text being read, and every motion stops for readers who
   ask for less of it. */

/* EB Garamond, self-hosted (SIL OFL 1.1; fonts/README.md, scripts/build-fonts.py).
   Static 400 and 700, roman and italic, split by script so a page downloads
   only what it uses. The roman 400 latin file carries real small capitals. */
@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/eb-garamond-400-latin.v3.woff2) format('woff2');
  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+2190-2193, U+2197, U+2206, U+2212, U+2215, U+2219, U+2248, U+25A0, U+2619, U+2766-2767, U+2E3A-2E3B, U+FEFF, U+FFFD; }
@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/eb-garamond-400-latin-ext.v3.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/eb-garamond-400-greek.v3.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF, U+1F00-1FFF; }
@font-face { font-family: 'EB Garamond'; font-style: italic; font-weight: 400; font-display: swap;
  src: url(fonts/eb-garamond-400i-latin.v3.woff2) format('woff2');
  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+2190-2193, U+2197, U+2206, U+2212, U+2215, U+2219, U+2248, U+25A0, U+2619, U+2766-2767, U+2E3A-2E3B, U+FEFF, U+FFFD; }
@font-face { font-family: 'EB Garamond'; font-style: italic; font-weight: 400; font-display: swap;
  src: url(fonts/eb-garamond-400i-latin-ext.v3.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'EB Garamond'; font-style: italic; font-weight: 400; font-display: swap;
  src: url(fonts/eb-garamond-400i-greek.v3.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF, U+1F00-1FFF; }
@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/eb-garamond-700-latin.v3.woff2) format('woff2');
  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+2190-2193, U+2197, U+2206, U+2212, U+2215, U+2219, U+2248, U+25A0, U+2619, U+2766-2767, U+2E3A-2E3B, U+FEFF, U+FFFD; }
@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/eb-garamond-700-latin-ext.v3.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/eb-garamond-700-greek.v3.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF, U+1F00-1FFF; }
@font-face { font-family: 'EB Garamond'; font-style: italic; font-weight: 700; font-display: swap;
  src: url(fonts/eb-garamond-700i-latin.v3.woff2) format('woff2');
  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+2190-2193, U+2197, U+2206, U+2212, U+2215, U+2219, U+2248, U+25A0, U+2619, U+2766-2767, U+2E3A-2E3B, U+FEFF, U+FFFD; }
@font-face { font-family: 'EB Garamond'; font-style: italic; font-weight: 700; font-display: swap;
  src: url(fonts/eb-garamond-700i-latin-ext.v3.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'EB Garamond'; font-style: italic; font-weight: 700; font-display: swap;
  src: url(fonts/eb-garamond-700i-greek.v3.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF, U+1F00-1FFF; }

/* Cormorant, the old site's display face: light italic for titles, the name,
   the motto and the doors; roman capitals for the drop cap. Cut down to what
   the site sets in it (scripts/build-display.py). The drop cap's face is
   'optional', so a slow connection keeps EB Garamond's capital rather than
   reflowing the first paragraph when Cormorant arrives. */
@font-face { font-family: 'Cormorant'; font-style: italic; font-weight: 300; font-display: swap;
  src: url(fonts/cormorant-300i-latin.v1.woff2) format('woff2');
  unicode-range: U+0020-007E, U+00A0-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+2212, U+FEFF; }
@font-face { font-family: 'Cormorant'; font-style: italic; font-weight: 300; font-display: swap;
  src: url(fonts/cormorant-300i-latin-ext.v1.woff2) format('woff2');
  unicode-range: U+0100-024F; }
@font-face { font-family: 'Cormorant Initials'; font-style: normal; font-weight: 400; font-display: optional;
  src: url(fonts/cormorant-initials.v1.woff2) format('woff2');
  unicode-range: U+0022, U+0027, U+0030-0039, U+0041-005A, U+00AB, U+00C0-00DE, U+2018, U+201C; }

/* Companions: the few characters the writing and the ornaments use that EB
   Garamond lacks (Ogham feather marks; ✶ ☉ ⏧ ⌬ ◊ ⇄ ∃ ★; ⁂ ⁝ ※ ⁕; ❡ ❀ ⌖ ✦ ✥),
   from Noto (SIL OFL 1.1). A family of their own, second in every stack, so
   the browser reaches for them only for these characters, and the marks look
   the same on every device. scripts/build-companions.py builds them. */
@font-face { font-family: 'Lyre Companions'; font-display: swap;
  src: url(fonts/companion-ogham.v2.woff2) format('woff2'); unicode-range: U+1680-169F; }
@font-face { font-family: 'Lyre Companions'; font-display: swap;
  src: url(fonts/companion-symbols.v2.woff2) format('woff2'); unicode-range: U+21C4, U+2203, U+2605, U+2736, U+2609, U+23E7, U+232C, U+25CA; }
@font-face { font-family: 'Lyre Companions'; font-display: swap;
  src: url(fonts/companion-marks.v2.woff2) format('woff2'); unicode-range: U+2042, U+205D, U+203B, U+2055; }
@font-face { font-family: 'Lyre Companions'; font-display: swap;
  src: url(fonts/companion-dingbats.v2.woff2) format('woff2'); unicode-range: U+2761, U+2740, U+2316, U+2726, U+2725; }

/* ── Tokens ─────────────────────────────────────────────── */
/* Day is the old site's bone-ashen dust; night its amber-lit void. The
   reader's system chooses; the switch in the masthead (lamp.js) overrides it
   with data-theme on <html>, and the choice is remembered. The night block
   appears twice (for the switch and for the system setting): keep them alike. */
:root {
    color-scheme: light;
    --paper: #ece6d6;
    --paper-2: #f2ede0;
    --ink: #3d3b39;
    --ink-strong: #232120;
    --ink-2: #4f4c49;
    --muted: #68645e;
    --rule: #d3cbb7;
    --rule-strong: #bcb29b;
    --accent: #8f5023;
    --gold: #805020;
    --glow: rgb(160 88 48 / 0.09);
    --glow-strong: rgb(160 88 48 / 0.22);
    --haze: rgb(80 60 100 / 0.04);
    --fog-1: rgb(200 190 170 / 0.30);
    --fog-2: rgb(180 170 150 / 0.20);
    --fog-opacity: 0.5;
    --grain: url(images/grain-day.webp);
    --pad-gleam: rgb(255 252 240 / 0.75);
    --pad-shadow: rgb(120 70 20 / 0.18);
    --pad-cast: rgb(160 90 40 / 0.07);
    --pad-cast-strong: rgb(160 90 40 / 0.13);
    --if-night: none;
    --if-day: block;
    --photo: none;

    --serif: 'EB Garamond', 'Lyre Companions', Georgia, 'Times New Roman', serif;
    --display: 'Cormorant', 'EB Garamond', 'Lyre Companions', Georgia, serif;
    --measure: 29rem;
    --gutter: 1.25rem;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="night"] {
    color-scheme: dark;
    --paper: #070709;
    --paper-2: #0e0c0a;
    --ink: #b0b0ba;
    --ink-strong: #ececf0;
    --ink-2: #9a9aa4;
    --muted: #85858f;
    --rule: #1f1f25;
    --rule-strong: #34343c;
    --accent: #c07830;
    --gold: #d89840;
    --glow: rgb(200 120 48 / 0.07);
    --glow-strong: rgb(200 120 48 / 0.30);
    --haze: rgb(100 80 120 / 0.05);
    --fog-1: rgb(20 20 25 / 0.80);
    --fog-2: rgb(15 15 20 / 0.60);
    --fog-opacity: 0.4;
    --grain: url(images/grain-night.webp);
    --pad-gleam: rgb(232 184 96 / 0.07);
    --pad-shadow: rgb(0 0 0 / 0.55);
    --pad-cast: rgb(200 120 48 / 0.045);
    --pad-cast-strong: rgb(200 120 48 / 0.10);
    --if-night: block;
    --if-day: none;
    --photo: brightness(0.82);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="day"]) {
        color-scheme: dark;
        --paper: #070709;
        --paper-2: #0e0c0a;
        --ink: #b0b0ba;
        --ink-strong: #ececf0;
        --ink-2: #9a9aa4;
        --muted: #85858f;
        --rule: #1f1f25;
        --rule-strong: #34343c;
        --accent: #c07830;
        --gold: #d89840;
        --glow: rgb(200 120 48 / 0.07);
        --glow-strong: rgb(200 120 48 / 0.30);
        --haze: rgb(100 80 120 / 0.05);
        --fog-1: rgb(20 20 25 / 0.80);
        --fog-2: rgb(15 15 20 / 0.60);
        --fog-opacity: 0.4;
        --grain: url(images/grain-night.webp);
        --pad-gleam: rgb(232 184 96 / 0.07);
        --pad-shadow: rgb(0 0 0 / 0.55);
        --pad-cast: rgb(200 120 48 / 0.045);
        --pad-cast-strong: rgb(200 120 48 / 0.10);
        --if-night: block;
        --if-day: none;
        --photo: brightness(0.82);
    }
}

/* ── Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
    font-size: clamp(1.1875rem, 1.05rem + 0.45vw, 1.3125rem);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    background: var(--paper);
    scrollbar-color: var(--rule-strong) var(--paper);
    scrollbar-width: thin;
    overflow-x: clip;
}

/* The grain is a small still tile in the page's own background: the old
   site's film texture, with nothing to repaint. */
body {
    margin: 0;
    min-height: 100vh;
    background: var(--grain) 0 0 / 128px 128px, var(--paper);
    color: var(--ink);
    font-family: var(--serif);
    font-weight: 400;
    line-height: 1.6;
    font-kerning: normal;
    font-variant-numeric: oldstyle-nums proportional-nums;
    text-rendering: optimizeLegibility;
    hanging-punctuation: first allow-end;
    overflow-x: clip;
}

::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--ink-strong); }

a {
    color: inherit;
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
    text-underline-offset: 0.2em;
    transition: color 0.3s ease, text-decoration-color 0.3s ease;
}
a:hover { color: var(--ink-strong); text-decoration-color: var(--accent); }
a, summary, button { -webkit-tap-highlight-color: color-mix(in srgb, var(--accent) 14%, transparent); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

h1, h2, h3, h4 {
    font-weight: 400;
    line-height: 1.2;
    text-wrap: balance;
    color: var(--ink-strong);
}
h1 { font-size: clamp(1.75rem, 1.35rem + 1.6vw, 2.5rem); margin: 0 0 0.5rem; letter-spacing: -0.005em; }
h2 { font-size: 1.35rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 2rem 0 0.5rem; }
h4 { font-size: 1rem; font-style: italic; margin: 1.5rem 0 0.5rem; }

/* Titles are set in Cormorant light italic, lit faintly from behind. */
h1:not([class]), .work-header h1 {
    font-family: var(--display);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(2.1rem, 1.6rem + 2vw, 3rem);
    line-height: 1.12;
    letter-spacing: 0.01em;
    text-shadow: 0 0 60px var(--glow-strong), 0 0 120px var(--glow);
}

p { margin: 0 0 1em; text-wrap: pretty; }
strong, b { font-weight: 700; }
img, svg, video { max-width: 100%; height: auto; }
hr { width: 4rem; margin: 2.5rem auto; border: 0; border-top: 1px solid var(--rule-strong); }
ul, ol { padding-left: 1.25em; }
li { margin: 0.25em 0; }
blockquote { margin: 1.5rem 0; padding-left: 1.25rem; border-left: 1px solid var(--rule-strong); color: var(--ink-2); }
sup, sub {
    position: relative;
    font-size: 0.7em;
    line-height: 0;
    vertical-align: baseline;
    font-variant-numeric: lining-nums;
}
sup { top: -0.5em; }
sub { top: 0.25em; }
table { border-collapse: collapse; font-variant-numeric: lining-nums tabular-nums; }
pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85em; }

/* Labels: real small capitals (the font carries them), figures to match. */
.label, .masthead nav a, .section-title, .colophon, .work-header .year,
.pager-label, .index .yr, .cv dt, .door-gloss {
    font-size: 1rem;
    font-weight: 400;
    font-variant-caps: all-small-caps;
    font-variant-numeric: oldstyle-nums tabular-nums;
    letter-spacing: 0.06em;
}

.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ── The cursor ─────────────────────────────────────────── */
/* The old site's iron-gold arrow, its hotspot at the tail so it points away
   from the click; over anything that can be clicked it takes a warm halo.
   Running text keeps the ordinary text cursor, so passages are easy to
   select and quote. Mouse and trackpad only. */
@media (pointer: fine) {
    html { cursor: url(cursor-32.png) 7 6, auto; }
    main :is(p, li, dd, dt, td, th, blockquote, figcaption, h1, h2, h3, h4, .line) { cursor: text; }
    a, button, summary, label[for], [role="button"] { cursor: url(cursor-glow-32.png) 7 6, pointer; }
}

/* ── Atmosphere: the lamp, the fog, the wisp ────────────── */
/* One fixed layer behind everything: an amber lamp above the page and a warm
   haze at its centre (still), with fog at the edges (drifting slowly, on
   transform alone). It bleeds past the screen so the drift never shows an
   edge. */
body::before {
    content: "";
    position: fixed;
    inset: -8%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 120% 55% at 50% -12%, var(--glow-strong) 0%, transparent 62%),
        radial-gradient(ellipse 55% 60% at 50% 42%, var(--glow) 0%, transparent 70%),
        radial-gradient(ellipse 100% 45% at 50% 112%, var(--haze) 0%, transparent 55%),
        radial-gradient(ellipse 70% 38% at 18% 82%, color-mix(in srgb, var(--fog-1) calc(var(--fog-opacity) * 100%), transparent) 0%, transparent 52%),
        radial-gradient(ellipse 55% 45% at 84% 22%, color-mix(in srgb, var(--fog-2) calc(var(--fog-opacity) * 100%), transparent) 0%, transparent 42%);
}

/* The wisp: the old site's drifting star, now pure CSS. Two slow animations
   on two axes (on the translate and transform properties, both handled by
   the compositor) trace a figure that takes minutes to repeat. It sits
   behind the text. */
body::after {
    content: "\2736";
    content: "\2736" / "";
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
    font: 22px/1 var(--serif);
    color: var(--accent);
    opacity: 0.5;
    text-shadow: 0 0 16px var(--accent), 0 0 32px var(--glow-strong);
    translate: 50vw 0;
    transform: translateY(30vh);
}
/* While reading a piece it keeps further off. */
:is(.story, .essay, .poem)::after { opacity: 0.3; }

.masthead, main, .colophon { position: relative; z-index: 1; }

/* The cursor's glow (lamp.js): a soft light that follows the pointer at a
   little distance, under the text. */
.glow {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
    width: 400px;
    height: 400px;
    margin: -200px 0 0 -200px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, var(--glow-strong) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.6s ease;
    will-change: transform;
}
.glow.on { opacity: 0.55; }

/* ── Frame: skip link, masthead, main, colophon ─────────── */
.skip {
    position: absolute; left: var(--gutter); top: 0.75rem; z-index: 10;
    padding: 0.4rem 0.75rem; background: var(--ink-strong); color: var(--paper);
    text-decoration: none; transform: translateY(-200%);
}
.skip:focus { transform: none; }

.masthead, main, .colophon {
    width: 100%;
    max-width: calc(var(--measure) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* The name, then the three writing sections, then the switch. */
.masthead {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0 1rem;
    padding-top: 1.5rem;
}
.masthead .name {
    font-family: var(--display);
    font-weight: 300;
    font-style: italic;
    font-size: 1.4rem;
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: var(--ink-strong);
    text-decoration: none;
    padding: 0.2rem 0;
    text-shadow: 0 0 24px var(--glow-strong);
}
.masthead nav { display: flex; flex-wrap: wrap; gap: 0 1.1rem; margin-left: auto; }
.masthead nav a { position: relative; color: var(--muted); text-decoration: none; padding: 0.35rem 0; }
/* The old site's underline that grows from the left, faintly glowing. */
.masthead nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.3rem;
    height: 1px;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--ease-out);
}
.masthead nav a:hover { color: var(--ink-strong); }
.masthead nav a:hover::after { transform: scaleX(1); }
.masthead nav a[aria-current="page"] { color: var(--ink-strong); }
.masthead nav a[aria-current="page"]::after { transform: scaleX(1); box-shadow: none; }
/* On a phone there's no room for all of it on one line: the name and the
   switch share the top line, and the sections run beneath, like a book's
   running head. (The home page has no name up here, so it stays one line.) */
@media (max-width: 36rem) {
    .masthead { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 0.75rem; padding-top: 1rem; }
    .masthead .name { grid-area: 1 / 1; }
    .masthead .switch { grid-area: 1 / 2; }
    .masthead nav { grid-area: 2 / 1 / 3 / 3; margin-left: 0; gap: 0 1.1rem; }
    .home .masthead nav { grid-area: 1 / 1; }
    main { padding-top: 2.25rem; }
}

/* Day or night: a small sun or moon at the end of the masthead. It works
   only with the script, so without it the button isn't drawn at all; the
   inline script in each page's head marks <html class="js"> before anything
   is painted, so nothing moves when it appears. */
.switch {
    display: none;
    place-items: center;
    width: 2rem;
    height: 2rem;
    margin: 0 -0.35rem 0 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--muted);
    transition: color 0.3s ease;
}
.js .switch { display: grid; }
.switch:hover { color: var(--accent); }
.switch svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.switch .sun { display: var(--if-night); }
.switch .moon { display: var(--if-day); fill: currentColor; stroke: none; }

/* Things drawn twice, once for each light (the Yith in ink). */
.if-day { display: var(--if-day); }
.if-night { display: var(--if-night); }
.home .masthead nav { margin-left: auto; }

main { padding-top: 3rem; }

.colophon {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    margin-top: 4rem;
    padding-top: 1.25rem;
    padding-bottom: 2.5rem;
    color: var(--muted);
    /* a hairline the width of the text column, fading at its ends */
    background: linear-gradient(90deg, transparent, var(--rule-strong) 15%, var(--rule-strong) 85%, transparent) center top / calc(100% - 2 * var(--gutter)) 1px no-repeat;
}
.colophon a { text-decoration: none; }
.colophon a + a { margin-left: 1.1rem; }
.colophon a[aria-current="page"] { color: var(--ink-strong); }
@media (max-width: 36rem) {
    .colophon { column-gap: 0.75rem; letter-spacing: 0.04em; }
    .colophon a + a { margin-left: 0.6rem; }
}
@media (max-width: 24rem) {
    .colophon { font-size: 0.9rem; letter-spacing: 0.02em; }
}
.colophon a:hover { color: var(--ink-strong); }
.colophon p { margin: 0; }
.colophon .copy { font-variant-caps: normal; font-size: 0.8em; }

/* The home page signs off in Danæam, as the old site did. */
.colophon .valediction {
    flex-basis: 100%;
    margin-bottom: 0.75rem;
    font-variant-caps: normal;
    font-style: italic;
    letter-spacing: 0;
    line-height: 1.45;
    color: var(--muted);
}
.colophon .valediction a { color: var(--accent); font-style: normal; padding: 0 0.15em; }
.colophon .valediction a:hover { color: var(--ink-strong); }
.colophon .sign { flex-basis: 100%; margin: -0.5rem 0 1rem; text-align: end; font-variant-caps: normal; letter-spacing: 0.04em; }

/* ── Home ───────────────────────────────────────────────── */
.intro h1 {
    font-family: var(--display);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(2.75rem, 1.85rem + 3.8vw, 4.5rem);
    line-height: 1.02;
    letter-spacing: 0.005em;
    margin: 0 0 0.6rem;
    width: fit-content;
    text-shadow: 0 0 60px var(--glow-strong), 0 0 140px var(--glow-strong);
}
/* The palimpsest: Faerieland written over Síonæiya, its name in Danæam. At
   rest the older word shows faintly through, set wider than the new one, so
   its ends (S… …ya) escape past Faerieland's. Pointing at it scrapes
   Faerieland back to a trace and Síonæiya comes up clean. Three layers in
   one grid cell, so only opacity and transform ever change. */
.palimpsest { display: grid; justify-items: center; }
.intro .palimpsest { margin-inline: auto; }  /* centred in the column */
.palimpsest > span { grid-area: 1 / 1; transition: opacity 0.9s ease, transform 1.1s var(--ease-out); }
.palimpsest .trace {
    /* no width of its own, so it never moves the title: it overflows both
       sides of the cell's centre equally */
    width: 0;
    display: flex;
    justify-content: center;
    white-space: nowrap;
    opacity: 0.085;
    letter-spacing: 0.21em;
    padding-left: 0.21em;
    transform: translate(0.03em, 0.05em);
    text-shadow: none;
}
.palimpsest .under { opacity: 0; text-shadow: 0 0 60px var(--glow-strong), 0 0 140px var(--glow-strong); }
@media (hover: hover) {
    .palimpsest:hover .trace { opacity: 0; transform: translate(0.03em, 0.05em) scale(0.97); }
    .palimpsest:hover .over { opacity: 0.075; transform: translate(-0.05em, -0.04em); }
    .palimpsest:hover .under { opacity: 1; }
}
/* On a touch screen, pressing the title does the same. */
@media (hover: none) {
    .palimpsest:active .trace { opacity: 0; }
    .palimpsest:active .over { opacity: 0.075; }
    .palimpsest:active .under { opacity: 1; }
}
.lede { font-size: 1.2rem; line-height: 1.4; color: var(--ink-2); margin: 0 0 1.75rem; text-wrap: balance; }
.intro .lede { margin: 0; text-align: right; text-wrap: wrap; }  /* set against the centred title, at the column's right edge; its byline on a line of its own */

/* The motto, in English and Danæam crossed. Both halves are always there;
   pointing at it trades which half is lit, as the old title did. */
.motto {
    margin: 2rem 0 0;
    font-family: var(--display);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.7rem);
    line-height: 1.25;
}
.motto .half { display: block; text-wrap: balance; transition: color 0.6s ease, text-shadow 0.6s ease; }
.motto .half:first-child { color: var(--ink-strong); text-shadow: 0 0 30px var(--glow-strong); }
.motto .half:last-child { color: var(--muted); }
@media (hover: hover) {
    .motto:hover .half:first-child { color: var(--muted); text-shadow: none; }
    .motto:hover .half:last-child { color: var(--ink-strong); text-shadow: 0 0 30px var(--glow-strong); }
}

.section { margin-top: 3.5rem; }

/* Section heads: a glyph lit in the accent, the label in small capitals, and
   a rule that fades out across the column. */
.section-title {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    color: var(--muted);
    margin: 0 0 0.35rem;
}
.section-title::after {
    content: "";
    flex: 1;
    align-self: center;
    height: 1px;
    background: linear-gradient(90deg, var(--rule-strong), transparent 92%);
}
.glyph { font-family: var(--serif); font-variant-caps: normal; font-style: normal; line-height: 1; color: var(--accent); text-shadow: 0 0 12px var(--glow-strong); }
.section-title .glyph { font-size: 1.15em; letter-spacing: 0; }

/* On a section page the first group sits closer to the title. */
.section.first { margin-top: 2rem; }

/* The old Essays page's title for its three hidden essays: one phrase cut
   into three links, Dele·ted Sc·enes, each a door to one of them. The plain
   list below carries the same links for everyone else. */
.split a { color: inherit; text-decoration: none; transition: color 0.3s ease, text-shadow 0.3s ease; }
.split a:nth-child(1) { letter-spacing: 0.15em; }
.split a:nth-child(2) { letter-spacing: 0.25em; }
.split a:hover { color: var(--accent); text-shadow: 0 0 10px var(--glow-strong); }

/* ── The index: home and section pages ──────────────────── */
.index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.section-title + .index { border-top: 0; }
.index li {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 1.25rem;
    align-items: baseline;
    margin: 0;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--rule);
    line-height: 1.35;
}
.index a {
    text-decoration: none;
    /* the old site's underline, growing from the left on hover */
    background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1px no-repeat;
    transition: background-size 0.5s var(--ease-out), color 0.3s ease;
}
.index a::after { content: ""; position: absolute; inset: 0; }  /* the whole row is the link */
.index li:hover a { color: var(--ink-strong); background-size: 100% 1px; }
.index .yr { color: var(--muted); letter-spacing: 0.02em; }
.index .note { grid-column: 1 / -1; color: var(--muted); font-size: 0.875rem; font-style: italic; margin-top: 0.2rem; }
.ext { color: var(--muted); font-size: 0.8em; margin-left: 0.2em; }

.about-links { margin-top: 2rem; }
/* The old About page's last line: her name, quietly, as a search. */
.whisper { margin-top: 1.5rem; font-size: 0.9rem; }
.whisper a { color: var(--muted); text-decoration-color: transparent; }
.whisper a:hover { color: var(--accent); }

/* ── Doors: the Faerish pages, entered like alcoves ─────── */
.doors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
    gap: 1rem;
    margin-top: 0.85rem;
}
.door {
    display: block;
    padding: 1.4rem 0.9rem 1.15rem;
    border: 1px solid var(--rule);
    border-radius: 2px;
    background: var(--paper-2);
    text-align: center;
    text-decoration: none;
    transition: border-color 0.4s ease;
}
.door:hover { border-color: color-mix(in srgb, var(--accent) 65%, transparent); }
.door .glyph { display: block; font-size: 1.7rem; margin-bottom: 0.65rem; transition: transform 0.6s ease; }
.door:hover .glyph { transform: rotate(180deg); }
.door-title { display: block; font-family: var(--display); font-weight: 300; font-style: italic; font-size: 1.3rem; line-height: 1.2; color: var(--ink-strong); }
.door-gloss { display: block; margin-top: 0.2rem; color: var(--muted); }

/* ── From Faerieland: a ticker of procedurals in Danæam ─── */
/* Without the script, or for readers who ask for less motion, three of
   them stand as cards (pads: stone risen from dust). lamp.js deals a fresh
   hand of eleven from the pool and sets them drifting across the full width
   of the screen; pointing at them, focusing them or the pause button stops
   them. The track holds the hand twice, so it loops without a seam. */
.facts { display: grid; gap: 1rem; margin-top: 0.85rem; }
.fact {
    padding: 1.25rem 1.3rem 1.15rem;
    border-radius: 2px;
    background: var(--paper-2);
    box-shadow: inset 0 1px 0 var(--pad-gleam), 0 1px 0 var(--pad-shadow), 0 3px 14px var(--pad-cast);
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--ink-2);
    transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}
.fact:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 var(--pad-gleam), 0 2px 0 var(--pad-shadow), 0 7px 24px var(--pad-cast-strong); }
.fact .glyph { display: block; font-size: 1.4rem; margin-bottom: 0.55rem; }
.fact em { color: var(--ink-strong); }

.fact .aside { font-style: italic; color: var(--muted); }
.ticker-head { display: flex; align-items: baseline; gap: 0.75rem; }
.ticker-head .section-title { flex: 1; }

.facts.rolling {
    display: block;
    width: 100vw;
    margin-inline: calc(50% - 50vw);
    padding: 0.6rem 0 1.2rem;
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.facts-track {
    display: flex;
    width: max-content;
    animation: tick calc(var(--n) * 16s) linear infinite;
}
.facts-track .fact { flex: 0 0 20rem; margin-right: 1.25rem; }
@keyframes tick { to { transform: translateX(calc(var(--n) * -21.25rem)); } }
.facts.rolling:is(:hover, :focus-within, .paused) .facts-track { animation-play-state: paused; }
@media (max-width: 36rem) {
    .facts-track .fact { flex-basis: 16rem; }
    @keyframes tick { to { transform: translateX(calc(var(--n) * -17.25rem)); } }
}
.pause {
    flex: none;
    padding: 0.1rem 0.2rem;
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    font-variant-caps: all-small-caps;
    letter-spacing: 0.06em;
}
.pause:hover { color: var(--accent); }

/* ── The constellation: the old home page's hidden doors ── */
/* Six marks scattered on one line (> ^ ` c. and two that show nothing at
   all; only the cursor's halo finds them). Every piece they open is in the
   index above, so they are ornament: out of the tab order and silent to
   screen readers. */
.constellation {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0;
    margin: 0.6rem 0 0;
    color: var(--muted);
    line-height: 1.6;
}
.constellation a { text-decoration: none; color: var(--muted); transition: color 0.3s ease, text-shadow 0.3s ease; }
.constellation a:hover { color: var(--accent); text-shadow: 0 0 10px var(--glow-strong); }
.constellation .hush { display: inline-block; width: 3ch; }
.constellation .gap-1 { margin-left: 5ch; }
.constellation .gap-2 { margin-left: 7ch; }
.constellation .gap-3 { margin-left: 3ch; }
/* ── A piece of writing ─────────────────────────────────── */
.work-header { position: relative; margin: 0 0 2.5rem; padding: 0 0 1.4rem; border: 0; }
/* A short amber rule under every title, fading out. */
.work-header::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 4rem;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), transparent);
}
.work-header h1 { margin-bottom: 0.5rem; }
.work-header .subtitle { font-size: 1.15rem; font-style: italic; line-height: 1.35; color: var(--ink-2); margin: 0 0 0.6rem; }
.work-header .year { display: block; margin: 0; color: var(--muted); }
.work-header .year { letter-spacing: 0.02em; }

.work-body p { text-align: start; }
@media (max-width: 36rem) {
    .work-body p { hyphens: auto; hyphenate-limit-chars: 8 4 3; }
}

/* Stories are set like a book: indented paragraphs, no gaps, the first
   paragraph and the one after a break set flush. */
.story .work-body p:not(.section-break) { margin: 0; }
.story .work-body p + p:not(.section-break) { text-indent: 1.4em; }
.story .work-body p.section-break + p, .story .work-body hr + p, .story .work-body p.dateline + p { text-indent: 0; }
.story .work-body p.dateline { margin-bottom: 1.25rem; }

/* A story or an essay ends with a small fleuron after its last word. */
.story .work-body > p:last-child::after,
.essay .work-body > p:last-child::after {
    content: "\2009\2766";
    content: "\2009\2766" / "";
    color: var(--accent);
}

/* A story or an essay opens with a gold drop cap in Cormorant (the old
   site's), and the rest of its first line in small capitals. */
.story .work-body > p:first-child:not(.dateline)::first-line,
.story .work-body > p.dateline:first-child + p::first-line,
.essay .work-body > p:first-child::first-line,
.essay .work-body > .epigraph:first-child + p::first-line {
    font-variant-caps: small-caps;
    letter-spacing: 0.04em;
}
.story .work-body > p:first-child:not(.dateline)::first-letter,
.story .work-body > p.dateline:first-child + p::first-letter,
.essay .work-body > p:first-child::first-letter,
.essay .work-body > .epigraph:first-child + p::first-letter {
    float: left;
    margin: 0.07em 0.09em 0 0;
    font-family: 'Cormorant Initials', var(--serif);
    font-size: 3.55em;
    font-style: normal;
    font-variant-caps: normal;
    line-height: 0.8;
    letter-spacing: 0;
    color: var(--gold);
    text-shadow: 0 0 30px var(--glow-strong);
}
.work-body h2 { font-size: 1.25rem; margin: 2.75rem 0 1rem; }
.work-body h3 { font-size: 1.05rem; font-style: italic; margin: 2rem 0 0.6rem; }
/* A section number set above its heading: <h2><span class="num">§ 1</span>…</h2> */
h2 .num {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--muted);
    font-size: 1rem;
    font-style: normal;
    font-variant-caps: all-small-caps;
    letter-spacing: 0.06em;
}

/* Contents of a long piece, set like the index. */
.contents { margin: 0 0 3rem; }
.contents .label { color: var(--muted); margin: 0 0 0.5rem; }
.contents ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.contents li { margin: 0; border-bottom: 1px solid var(--rule); }
.contents a { display: grid; grid-template-columns: 3.5rem 1fr; gap: 0.5rem; padding: 0.45rem 0; line-height: 1.35; text-decoration: none; }
.contents a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.contents .num { color: var(--muted); font-variant-caps: all-small-caps; letter-spacing: 0.06em; }
h2[id], h3[id] { scroll-margin-top: 1.5rem; }

/* Tables of figures: hairlines, labels in small capitals, numbers aligned. */
.work-body table { width: 100%; margin: 1.25rem 0 1.75rem; font-size: 0.875rem; line-height: 1.4; }
.work-body th, .work-body td { padding: 0.45rem 0.9rem 0.45rem 0; text-align: start; vertical-align: top; border-bottom: 1px solid var(--rule); }
.work-body th:last-child, .work-body td:last-child { padding-right: 0; }
.work-body thead th, .work-body tr.group th {
    color: var(--muted);
    font-weight: 400;
    font-size: 1rem;
    font-variant-caps: all-small-caps;
    letter-spacing: 0.06em;
}
.work-body thead th { border-bottom-color: var(--muted); }
.work-body tr.group th { padding-top: 1.1rem; }
.work-body tr.subtotal td { color: var(--muted); font-style: italic; }
.work-body .num-col { text-align: end; white-space: nowrap; }

/* A section break: a paragraph holding only a mark (•, ■, $), or an empty
   rule standing for a blank line. */
.section-break, .work-body .section-break { text-align: center; color: var(--muted); margin: 2rem 0; line-height: 1; }
hr.space { border: 0; margin: 1.6em 0; }
.dateline { font-style: italic; color: var(--ink-2); line-height: 1.35; }

.poem-body { margin-bottom: 2.5rem; }
.stanza { margin: 0 0 1.4em; }
.line { display: block; padding-left: 1.5em; text-indent: -1.5em; }
.indent { margin-left: 2em; }
.poem-note { color: var(--ink-2); font-size: 0.94rem; margin-bottom: 2.5rem; }
.poem-body h3 { font-size: 1rem; font-style: normal; font-variant-caps: all-small-caps; letter-spacing: 0.06em; margin: 2.25rem 0 0.75rem; }

/* Shaped poems keep their exact spacing. Each poem page sets --shape-em to its
   widest line in ems, and the text scales down just enough for the whole shape
   to fit the column; it never grows past normal size. */
main .shaped-poem {
    max-width: 100%;
    overflow-x: auto;
    font-size: min(1rem, calc(min(100vw - 2 * var(--gutter), var(--measure)) / var(--shape-em, 1)));
}

.epigraph { margin: 0 0 2.5rem 1.5rem; padding: 0; border: 0; font-style: italic; color: var(--ink-2); font-size: 0.95rem; }
.epigraph p { margin: 0 0 0.4rem; }
.epigraph cite { display: block; margin-top: 0.6rem; font-style: normal; font-size: 0.85em; color: var(--muted); }

.prose-quote, .verse-quote { margin: 1.5rem 0; padding-left: 1.25rem; border-left: 1px solid var(--rule); }
.prose-quote p, .verse-quote p { margin: 0 0 0.5em; }
.sc { font-variant-caps: all-small-caps; letter-spacing: 0.04em; }


.float-right { float: right; width: 42%; margin: 0.3rem 0 1rem 1.5rem; }
.float-right img { width: 100%; }
.float-right img:not(.if-day, .if-night) { display: block; }
.float-right .img-caption { margin: 0.4rem 0 0; }
/* Photographs are dimmed a little at night. Ink drawings (img.ink) are not: they come as two
   images, the ink in each theme's colour on a clear ground (.if-day, .if-night), and only
   the one for the current light is shown, or fetched. */
.work-body img:not(.ink) { filter: var(--photo); }
@media (max-width: 34rem) { .float-right { float: none; width: auto; max-width: 17.5rem; margin: 1.75rem auto; } }

/* Related pieces (the Cassandra cycle): a small list before the pager. */
.related { margin-top: 3.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.related h2 { margin: 0 0 0.6rem; color: var(--muted); font-size: 1rem; font-variant-caps: all-small-caps; letter-spacing: 0.06em; }
.related-list { display: flex; flex-direction: column; gap: 0.35rem; }
.related-list .type { color: var(--muted); font-style: italic; margin-left: 0.5em; font-size: 0.9em; }
.related + .pager { margin-top: 2.5rem; }

/* Notes: a superscript number in the text links to the note; the note links back. */
.fn-ref a, a.footnote-ref { color: var(--accent); text-decoration: none; padding: 0 0.1em; }
.fn-ref a:hover, a.footnote-ref:hover { text-decoration: underline; }
.footnote { font-size: 0.875rem; line-height: 1.5; color: var(--muted); padding-left: 1.1em; text-indent: -1.1em; }
.footnote > sup:first-child { top: 0; font-size: 1em; margin-right: 0.35em; }
.endnotes { margin-top: 3.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule-strong); font-size: 0.9rem; line-height: 1.5; color: var(--ink-2); }
.endnotes .label { color: var(--muted); margin: 0 0 0.75rem; }
.endnotes ol { margin: 0; padding-left: 1.4em; }
.endnotes li { margin: 0 0 0.75em; padding-left: 0.2em; }
.endnotes li::marker { color: var(--muted); font-variant-numeric: lining-nums; }
.endnotes li:target { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.fn-back { margin-left: 0.25em; color: var(--muted); text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.fn-back:hover { color: var(--accent); }
/* A wide table scrolls inside its own box; soft shadows at the edges show
   there is more to see, and disappear at either end. */
.table-scroll {
    overflow-x: auto;
    background:
        linear-gradient(to right, var(--paper) 40%, transparent) left / 2rem 100% no-repeat local,
        linear-gradient(to left, var(--paper) 40%, transparent) right / 2rem 100% no-repeat local,
        radial-gradient(farthest-side at 0 50%, color-mix(in srgb, var(--ink) 22%, transparent), transparent) left / 0.75rem 100% no-repeat scroll,
        radial-gradient(farthest-side at 100% 50%, color-mix(in srgb, var(--ink) 22%, transparent), transparent) right / 0.75rem 100% no-repeat scroll;
}
.table-scroll table { margin: 0; }
.table-scroll { margin: 1.25rem 0 1.75rem; }
@media (max-width: 36rem) {
    .work-body table { font-size: 0.8125rem; }
    .work-body th, .work-body td { padding-right: 0.6rem; }
    /* A table marked .stack sets each row in two lines rather than scrolling:
       the first cell beside the row, the second and fourth on its first line,
       the third beneath them. One grid holds every row, so the columns still
       line up. (Its ARIA roles keep it a table to screen readers.) */
    .work-body table.stack { display: grid; grid-template-columns: auto minmax(0, 1fr) fit-content(42%); column-gap: 0.75rem; }
    .work-body table.stack :is(thead, tbody) { display: contents; }
    .work-body table.stack tr { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; row-gap: 0.1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
    .work-body table.stack thead tr { border-bottom-color: var(--muted); }
    .work-body table.stack thead th { font-size: 0.875rem; letter-spacing: 0.03em; }
    .work-body table.stack :is(th, td) { padding: 0; border: 0; }
    .work-body table.stack :is(th, td):nth-child(1) { grid-area: 1 / 1 / 3 / 2; }
    .work-body table.stack :is(th, td):nth-child(2) { grid-area: 1 / 2; }
    .work-body table.stack :is(th, td):nth-child(3) { grid-area: 2 / 2 / 3 / 4; }
    .work-body table.stack :is(th, td):nth-child(4) { grid-area: 1 / 3; text-align: end; }
    .work-body table.stack td:nth-child(3) { color: var(--muted); font-style: italic; }
}
.img-caption { color: var(--muted); font-size: 0.875rem; font-style: italic; }

/* Previous and next, at the end of a piece. */
.pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 4.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule);
}
.pager a { display: block; text-decoration: none; line-height: 1.3; }
.pager a[rel="next"] { grid-column: 2; text-align: end; }
.pager:has(a[rel="up"]) { grid-template-columns: 1fr auto 1fr; }
.pager a[rel="up"] { grid-column: 2; text-align: center; }
.pager:has(a[rel="up"]) a[rel="next"] { grid-column: 3; }
.pager-label { display: block; color: var(--muted); margin-bottom: 0.2rem; }
.pager-label [aria-hidden] { display: inline-block; color: var(--accent); transition: transform 0.3s ease; }
.pager a[rel="prev"]:hover .pager-label [aria-hidden] { transform: translateX(-4px); }
.pager a[rel="next"]:hover .pager-label [aria-hidden] { transform: translateX(4px); }
.pager a:hover .pager-title { color: var(--ink-strong); text-decoration: underline; text-decoration-color: var(--accent); }
@media (max-width: 30rem) {
    .pager, .pager:has(a[rel="up"]) { grid-template-columns: 1fr; gap: 1.1rem; }
    .pager a[rel], .pager:has(a[rel="up"]) a[rel="next"] { grid-column: 1; text-align: start; }
}

/* ── About and CV ───────────────────────────────────────── */

.cv-header .label { color: var(--muted); margin: 0 0 0.35rem; }
.cv-header .lede { margin: 0 0 0.75rem; }
.cv-header p:last-child { margin: 0; }
.cv { margin-top: 2.5rem; }
.cv h2 { margin: 2.5rem 0 0.5rem; }
.cv dl { margin: 0; border-top: 1px solid var(--rule); }
.cv dt, .cv dd { margin: 0; padding: 0.65rem 0; }
.cv .entry { display: grid; grid-template-columns: 7.5rem 1fr; column-gap: 1.25rem; border-bottom: 1px solid var(--rule); }
.cv dt { color: var(--muted); }
.cv dd p { margin: 0.2rem 0 0; color: var(--ink-2); font-size: 0.95rem; }
.cv .where { color: var(--muted); font-style: italic; font-size: 0.95rem; }
@media (max-width: 30rem) { .cv .entry { grid-template-columns: 1fr; } .cv dt { padding-bottom: 0; } }
.cv .nb { margin-top: 2rem; color: var(--ink-2); }


/* ── The 404 page ───────────────────────────────────────── */
.code { color: var(--muted); font-variant-caps: all-small-caps; letter-spacing: 0.06em; margin: 0 0 0.5rem; }
.way-home { display: flex; gap: 1.5rem; margin-top: 2rem; }
.way-home a { text-decoration: none; color: var(--muted); }
.way-home a:hover { color: var(--ink-strong); }
.way-home .back::before { content: "\2190\2002"; color: var(--accent); }

/* ── Motion ─────────────────────────────────────────────── */
/* Everything here is transform or opacity, so it runs on the compositor and
   never re-lays-out or repaints the page. None of it runs for readers who
   ask their system for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }

    /* The fog drifts. */
    body::before { animation: fog 40s ease-in-out infinite alternate; }
    @keyframes fog {
        from { transform: translate3d(-2%, 0, 0); }
        to { transform: translate3d(2%, -1.5%, 0) scale(1.03); }
    }

    /* The wisp wanders: across in 53 s, up and down in 37 s, from a different
       point on each page (--phase, set by the snippet in the head). */
    body::after {
        animation: wisp-x 53s ease-in-out infinite alternate, wisp-y 37s ease-in-out infinite alternate;
        animation-delay: var(--phase, -20s), calc(var(--phase, -20s) * 1.37);
    }
    @keyframes wisp-x { from { translate: 6vw 0; } to { translate: 92vw 0; } }
    @keyframes wisp-y { from { transform: translateY(8vh); } to { transform: translateY(88vh); } }

    /* The name on the home page breathes. (One animation on the name alone:
       sharing an element with the entrance would keep it off the compositor.) */
    .intro h1 { animation: breathe 8s ease-in-out 1s infinite; }
    @keyframes breathe { 50% { opacity: 0.8; } }

    /* Page headers rise out of the fog: briefly, and from 35% rather than
       from nothing, so the words are there to read at once. */
    .work-header, main > h1:first-child, .intro { animation: emerge 0.8s var(--ease-out) both; }
    .home .section { animation: emerge 0.9s var(--ease-out) both; }
    .home .section:nth-of-type(2) { animation-delay: 60ms; }
    .home .section:nth-of-type(3) { animation-delay: 120ms; }
    .home .section:nth-of-type(4) { animation-delay: 180ms; }
    .home .section:nth-of-type(5) { animation-delay: 240ms; }
    .home .section:nth-of-type(n+6) { animation-delay: 300ms; }
    @keyframes emerge { from { opacity: 0.35; transform: translateY(10px); } }
}
@media (prefers-reduced-motion: reduce) {
    body::after { display: none; }
    .glow { display: none; }
    .door .glyph, .fact, .masthead nav a::after, .pager-label [aria-hidden] { transition: none; }
}

/* ── Contrast preferences ───────────────────────────────── */
@media (prefers-contrast: more) {
    :root { --muted: var(--ink-2); --rule: color-mix(in srgb, var(--ink) 35%, var(--paper)); --rule-strong: var(--rule); }
    body::before { display: none; }
    body { background: var(--paper); }
}
/* Forced colours (Windows high contrast): the atmosphere steps aside. */
@media (forced-colors: active) {
    body::before, body::after, .glow { display: none; }
    body { background: Canvas; }
    .facts.rolling { mask-image: none; }
}

/* ── Print ──────────────────────────────────────────────── */
@page { margin: 2cm 2.2cm; }
@media print {
    :root, :root[data-theme] {
        --paper: #fff; --paper-2: #fff; --ink: #000; --ink-strong: #000; --ink-2: #222; --muted: #555;
        --rule: #bbb; --rule-strong: #999; --accent: #000; --gold: #000; --photo: none;
        --if-day: block; --if-night: none;
    }
    html { font-size: 11pt; }
    body { background: #fff; }
    body::before, body::after, .glow { display: none; }
    * { text-shadow: none !important; }
    .masthead nav, .switch, .skip, .colophon, .pager, .related, .contents, .facts, .constellation { display: none; }
    .masthead, main { max-width: 34rem; padding: 0; }
    .masthead { color: var(--muted); }
    .masthead .name { font-size: 1.1rem; }
    main { padding-top: 1.5rem; }
    a { text-decoration: none; }
    h1, h2, h3, .work-header { break-after: avoid; }
    p, li, .line { orphans: 2; widows: 2; }
    img, table, .stanza, blockquote { break-inside: avoid; }
    /* Ink drawings print black, whichever theme's image the screen had loaded. */
    img.ink { filter: brightness(0); }
    /* The CV fits one page. */
    .cv-header { margin-bottom: 1rem; }
    .cv-header .lede { font-size: 1.05rem; margin-bottom: 0.3rem; }
    .cv { margin-top: 1rem; font-size: 0.92rem; }
    .cv h2 { font-size: 1.1rem; margin: 1.1rem 0 0.3rem; }
    .cv dt, .cv dd { padding: 0.28rem 0; }
    .cv .entry { break-inside: avoid; }
    .cv .nb { margin-top: 1rem; }
}
