/* Hallmark · shape: kept · genre: atmospheric · theme: brand · redesign: restyle
 * paper: oklch(16% 0.005 50) · accent: none · display: Host Grotesk · body: Host Grotesk · hero: Plate · nav: kept · footer: mast · signature: the ancient library in halftone
 * axes: dark/grotesk-sans/neutral · posture: restrained · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R3 V5 · weakest: repetition of rows, broken with a band, a grid and a big-type goal list */
/* InnerVault, library first (2026-11-06). Direction from Hallmark's Rim material: warm black paper,
   warm off-white ink, square hairline surfaces, one quiet brass signal. Host Grotesk everywhere;
   a mono face only for commands and prompts you copy. Depth comes from steps of paper, not shadows. */
@font-face { font-family: "Host Grotesk"; src: url("/assets/fonts/host-grotesk.woff2") format("woff2"); font-weight: 300 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Host Grotesk"; src: url("/assets/fonts/host-grotesk-ext.woff2") format("woff2"); font-weight: 300 800; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Mono"; src: url("/assets/fonts/dm-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --paper: #0f0d0c; --paper-2: #171513; --paper-3: #201d1a; --line: #24221f; --line-2: #3a3733; --line-3: #5b5751;
  --ink: #efece6; --ink-hi: #f8f6f1; --ink-2: #c9c5bd; --ink-3: #a09c94; --on-ink: #0f0d0c; --ink-dim: #8a857d; --ink-mast: #6f6a63;
  --brass: #cdb07a; --warn: #eda06f; --ok: #a9c9ae; --err: #eba592;
  --sans: "Host Grotesk", "Helvetica Neue", Arial, sans-serif; --mono: "DM Mono", ui-monospace, Menlo, monospace;
  --wrap: min(1160px, 100% - 2 * clamp(20px, 5vw, 72px));
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --sp-sec: clamp(64px, 9vw, 128px);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1px; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }
code, pre, kbd { font-family: var(--mono); }
::selection { background: var(--ink); color: var(--on-ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: 12px; z-index: 100; padding: 8px 16px; background: var(--ink); color: var(--on-ink); font-weight: 500; text-decoration: none; transform: translateY(-160%); }
.skip:focus { transform: none; }
.wrap { width: var(--wrap); margin-inline: auto; }
main { outline: none; }

/* type */
h1, h2, h3, h4 { margin: 0; font-weight: 400; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; overflow-wrap: break-word; min-width: 0; }
.h1, .sv-h1 { font-size: clamp(38px, 5.2vw, 72px); font-weight: 500; line-height: 1.04; letter-spacing: -0.04em; }
.h1 span { display: block; }
.h2, .sv-h2 { font-size: clamp(28px, 3.2vw, 44px); font-weight: 500; line-height: 1.08; letter-spacing: -0.03em; }
.h3, .sv-h3 { font-size: 19px; line-height: 1.3; letter-spacing: -0.01em; }
.lede, .sv-lede { margin-top: 16px; max-width: 54ch; font-size: clamp(17px, 1.4vw, 19px); line-height: 1.5; color: var(--ink-3); text-wrap: pretty; }
.body, .sv-p { max-width: 62ch; margin-bottom: 16px; color: var(--ink-2); text-wrap: pretty; }
.sv-p { color: var(--ink-3); }
.dim, .sv-fine { color: var(--ink-3); font-size: 14px; }
.link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-3); }
.link:hover { text-decoration-color: var(--ink); }
.warn { color: var(--warn); }

/* buttons */
.btn, .sv-cta { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid transparent; font: 500 15px/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .14s var(--ease); }
.btn:active { transform: scale(.98); }
.btn-light, .btn-gold, .sv-cta { background: var(--ink); color: var(--on-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { background: var(--paper-3); border-color: var(--line); color: var(--ink-3); cursor: progress; }
@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover { border-color: var(--ink-3); }   /* the fill itself is the sweep: see MOTION PRIMITIVES */
}
@media (pointer: coarse) { .btn-sm { min-height: 44px; } }
.copy[data-state="done"], .btn[data-state="done"] { color: var(--ok); }
.btn[data-state="fail"], .copy[data-state="fail"] { color: var(--err); }

/* header */
.hdr { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid var(--line); }
.hdr-row { display: flex; align-items: center; gap: 24px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; }
.brand img { width: auto; height: 24px; }
.brand span { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--ink-3); text-decoration: none; font-size: 15px; transition: color .2s ease; }
.nav a[aria-current="page"], .nav a:hover { color: var(--ink); }
.menu-btn { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--line-2); background: transparent; color: var(--ink); cursor: pointer; }
.menu-btn svg { width: 20px; height: 20px; margin: auto; display: block; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
@media (max-width: 700px) {
  .js .menu-btn { display: block; }
  .js .nav { display: none; position: absolute; left: 0; right: 0; top: 60px; flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 4px clamp(20px, 5vw, 72px) 16px; background: var(--paper); border-bottom: 1px solid var(--line); }
  .js .nav.open { display: flex; }
  .js .nav a { min-height: 52px; padding: 0; border-bottom: 1px solid var(--line); font-size: 17px; }
}

/* sections */
.sec { padding: var(--sp-sec) 0; border-top: 1px solid var(--line); }
.sec-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px clamp(32px, 6vw, 88px); align-items: end; margin-bottom: clamp(28px, 4vw, 48px); }
.sec-head .lede { margin: 0; }
@media (max-width: 800px) { .sec-head { grid-template-columns: minmax(0, 1fr); } }
.page-head { padding: clamp(56px, 8vw, 104px) 0 clamp(32px, 4vw, 48px); }
.lib-head { padding-bottom: clamp(20px, 3vw, 32px); }

/* home: the library is the first thing here */
.home-top { padding: clamp(56px, 9vh, 112px) 0 clamp(40px, 6vh, 64px); }
.home-top .finder { margin-top: clamp(28px, 4vh, 44px); max-width: none; }
.lib-index { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: clamp(28px, 4vh, 40px); border-top: 1px solid var(--line); }
.lib-index a { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 60px; padding: 16px 16px 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 17px; transition: color .2s ease; }
.lib-index span { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) { .lib-index a:hover { color: var(--brass); } }
@media (max-width: 760px) { .lib-index { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; } .lib-index a { font-size: 16px; padding-right: 0; } }
.home-sec { padding: clamp(48px, 7vw, 88px) 0; border-top: 1px solid var(--line); }
.home-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.lib-rows { border-top: 1px solid var(--line); }
.lib-rows a { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr) minmax(0, 2fr); gap: 4px 24px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; transition: background-color .2s ease; }
.lr-name { font-size: 17px; overflow-wrap: anywhere; }
.lr-what { color: var(--ink-3); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lr-kind { color: var(--ink-3); font-size: 13px; text-align: right; }
@media (hover: hover) and (pointer: fine) { .lib-rows a:hover .lr-name { color: var(--brass); } }
@media (max-width: 760px) { .lib-rows a { grid-template-columns: minmax(0, 1fr) auto; } .lr-what { grid-column: 1 / -1; grid-row: 2; } }
.orb-wait { display: flex; align-items: center; gap: 12px; padding: 20px 0; color: var(--ink-3); font-size: 14px; }

/* search */
.finder { max-width: 820px; }
.field { position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 0 8px 0 20px; border: 1px solid var(--line-2); background: var(--paper-2); transition: border-color .15s ease; }
.field:focus-within { outline: 2px solid var(--ink-3); outline-offset: -1px; }
.field svg.lens { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--ink-3); stroke-width: 1.5; }
.field input { flex: 1; min-width: 0; height: 60px; border: 0; background: transparent; color: var(--ink); font: 400 clamp(16px, 1.5vw, 20px)/1.3 var(--sans); outline: none; }
.field input::placeholder { color: var(--ink-3); opacity: 1; }
.field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.field kbd { flex: none; padding: 4px 8px; border: 1px solid var(--line-2); font-size: 12px; line-height: 1; color: var(--ink-3); }
.field:focus-within kbd { display: none; }
.field .btn { flex: none; }
.orb-slot { flex: none; width: 20px; height: 20px; }
.orb-slot:empty { display: none; }
.orb-slot canvas { display: block; }
.peek { margin-top: -1px; border: 1px solid var(--line-2); background: var(--paper-2); }
.peek li a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 12px 20px; text-decoration: none; }
.peek li a:hover, .peek li a:focus-visible { background: var(--paper-3); }
.pk-name { font-weight: 500; overflow-wrap: anywhere; }
.pk-type { font-size: 13px; color: var(--ink-3); text-align: right; }
.pk-why { grid-column: 1 / -1; font-size: 14px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peek-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-3); }
.peek-foot:first-child { border-top: 0; }
.peek-foot .link, .shelf-all { color: var(--ink); }

/* chips and goals */
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-3); font: 400 14px/1.2 var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer; transition: color .15s ease, border-color .15s ease; }
.chip .n { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chip[aria-current="true"], .chip[aria-pressed="true"] { color: var(--on-ink); background: var(--ink); border-color: var(--ink); }
.chip[aria-current="true"] .n, .chip[aria-pressed="true"] .n { color: var(--on-ink); }
@media (hover: hover) and (pointer: fine) { .chip:hover { color: var(--ink); border-color: var(--line-3); } .chip[aria-current="true"]:hover { color: var(--on-ink); } }
@media (pointer: coarse) { .chip { min-height: 44px; } }
.goals-label { margin-bottom: 12px; font-size: 19px; line-height: 1.3; letter-spacing: -0.01em; }
.goals-mini { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: clamp(32px, 4vw, 48px); }
.goals-mini a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-2); color: var(--ink-2); font-size: 14px; text-decoration: none; transition: border-color .15s ease, color .15s ease; }
.goals-mini a:hover { border-color: var(--ink-3); color: var(--ink); }
.goals-mini a[aria-current="true"] { background: var(--ink); color: var(--on-ink); }
.home-sec .goals-mini { margin-bottom: 0; }
@media (pointer: coarse) { .goals-mini a { min-height: 44px; } }

/* library bar */
.lib-bar { position: sticky; top: 61px; z-index: 40; padding: 12px 0; background: var(--paper); border-bottom: 1px solid var(--line); }
.lib-bar .finder { max-width: none; }
.lib-bar .field { min-height: 52px; }
.lib-bar .field input { height: 50px; font-size: 17px; }
.cats-wrap { margin-top: 8px; }
.cats-bar, .chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 8px; margin: -5px -6px; }
.cats-bar::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.filters { margin-top: 8px; display: grid; gap: 8px; }
.lib-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 8px; }
.select { position: relative; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-3); }
.select select { min-height: 36px; max-width: 100%; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 0; background: var(--paper-2); color: var(--ink); font: 400 14px var(--sans); cursor: pointer; }
.select svg { display: none; }
@media (pointer: coarse) { .select select { min-height: 44px; } }
.selects { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.more-filters summary { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; color: var(--ink-3); cursor: pointer; }
.more-filters summary:hover { color: var(--ink); }
.more-filters .n { color: var(--ink); }
.more-filters .selects { margin-top: 8px; }
@media (max-width: 700px) { .lib-bar { position: static; } .select { width: 100%; justify-content: space-between; } .select select { flex: 1; min-width: 0; } .more-filters { width: 100%; } .sort-vis { width: 100%; } }
.lib-body { padding-top: clamp(28px, 4vw, 48px); padding-bottom: var(--sp-sec); }
.lib-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 0; font-size: 14px; color: var(--ink-3); }
.lib-status .clear, #lib-clear { color: var(--ink); background: none; border: 0; font: inherit; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; padding: 0; }
.all-h { margin-top: clamp(32px, 4vw, 48px); }
[aria-busy="true"] #results { opacity: .55; }
#results { transition: opacity .15s ease; }
.lib-foot { max-width: 72ch; margin-top: 32px; font-size: 14px; color: var(--ink-3); text-wrap: pretty; }
.lib-foot b { font-weight: 500; color: var(--ink-2); }
.empty { padding: 32px 0; color: var(--ink-2); }
.empty b { font-weight: 500; color: var(--ink); }
.empty p { margin-bottom: 12px; }
.load-error { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 12px 0; padding: 16px 16px; border: 1px solid var(--line-2); color: var(--err); }
.load-more { display: flex; margin: 0 auto; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 20px; padding: 28px 0 0; font-size: 14px; color: var(--ink-3); }
.path-banner { margin: 8px 0 20px; padding: 20px; background: var(--paper-2); }
.path-banner h2 { margin-bottom: 8px; font-size: 19px; }
.path-banner p { margin-bottom: 12px; color: var(--ink-2); }
.path-banner p:last-child { margin-bottom: 0; }
.suggest { margin: 4px 0 16px; font-size: 14px; color: var(--ink-3); }

/* shelves and result rows */
.shelf { margin-bottom: clamp(36px, 5vw, 56px); }
.shelf-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 16px; }
.shelf-head h2 { font-size: 19px; letter-spacing: -0.01em; }
.shelf-head p { font-size: 14px; color: var(--ink-3); }
.shelf-all { margin-left: auto; font-size: 14px; text-decoration: underline; text-decoration-color: var(--line-3); }
.shelf-empty { color: var(--ink-3); font-size: 14px; }
.rcs { border-top: 1px solid var(--line); }
.rc { padding: 16px 0; border-bottom: 1px solid var(--line); }
.rc-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; }
.rc h3 { font-size: 17px; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.rc h3 a { text-decoration: none; }
.rc h3 a:hover { color: var(--brass); }
.rc-cat { font-size: 13px; color: var(--ink-3); }
.rc-desc { margin-top: 4px; max-width: 80ch; color: var(--ink-2); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.rc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 8px; font-size: 13px; color: var(--ink-3); overflow-wrap: anywhere; }
.rc-meta .w { color: var(--warn); }
.rc-act { margin-top: 8px; }
.rcs.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; border-top: 0; }
.rcs.grid .rc { border-top: 1px solid var(--line); border-bottom: 0; }
@media (max-width: 900px) { .rcs.grid { grid-template-columns: minmax(0, 1fr); } .rcs.grid .rc:nth-child(n+4) { display: none; } }
.vb { color: var(--ink-3); }
.vb.ok { color: var(--ok); }
.vb.warn { color: var(--warn); }

/* static fallback list */
.res { padding: 20px 0; border-bottom: 1px solid var(--line); }
.res-list { border-top: 1px solid var(--line); }
.res-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; }
.res-title h3 { font-size: 17px; }
.res-title a { text-decoration: none; }
.res-src, .res-type, .res-meta { font-size: 13px; color: var(--ink-3); }
.res-purpose { margin-top: 8px; max-width: 80ch; color: var(--ink-2); }
.res-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; }
.res-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.orig { font-size: 13px; color: var(--brass); }
.ext { color: var(--ink-3); }
.more-btn svg { width: 10px; height: 6px; fill: none; stroke: currentColor; stroke-width: 1.4; transition: transform .2s var(--ease); }
.more-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.res-more { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 40px; margin-top: 16px; padding: 20px; background: var(--paper-2); }
.lib-ready .res-more:not(.open) { display: none; }
.res-more h4 { margin-bottom: 8px; font-size: 14px; color: var(--ink-3); letter-spacing: 0; }
.res-more ul, .res-more ol { padding-left: 16px; color: var(--ink-2); }
.res-more ul { list-style: disc; } .res-more ol { list-style: decimal; }
.res-more p { color: var(--ink-2); overflow-wrap: anywhere; }
.res-more .wide { grid-column: 1 / -1; }
.res-more .warn { color: var(--warn); }
@media (max-width: 760px) { .res-more { grid-template-columns: minmax(0, 1fr); } }

/* copy blocks */
.code { display: flex; align-items: flex-start; gap: 12px; padding: 12px 12px 12px 16px; background: var(--paper-2); }
.code code, .code pre { flex: 1; min-width: 0; margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow-y: auto; }
.copy { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 8px; border: 1px solid var(--line-2); background: transparent; color: var(--ink); font: 400 13px var(--sans); cursor: pointer; }
.copy svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.5; }
@media (pointer: coarse) { .copy { min-height: 44px; } }

/* resource page */
.det { padding: clamp(28px, 4vw, 48px) 0 var(--sp-sec); }
.crumbs { margin-bottom: 24px; font-size: 14px; color: var(--ink-3); }
.crumbs a { text-decoration: none; display: inline-block; padding: 8px 0; } .crumbs a:hover { color: var(--ink); }
.det-head { padding-bottom: 28px; }
.det-head h1 { font-size: clamp(30px, 4vw, 52px); font-weight: 500; line-height: 1.06; letter-spacing: -0.035em; overflow-wrap: anywhere; }
.det-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; font-size: 14px; color: var(--ink-3); }
.det-head .lede { overflow-wrap: anywhere; }
.det-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.det-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: clamp(32px, 6vw, 72px); border-top: 1px solid var(--line); padding-top: 32px; }
@media (max-width: 860px) { .det-grid { grid-template-columns: minmax(0, 1fr); } }
.det-sec { margin-bottom: 36px; color: var(--ink-2); overflow-wrap: anywhere; }
.det-sec h2 { margin-bottom: 12px; font-size: 19px; letter-spacing: -0.01em; }
.det-sec ul { list-style: disc; padding-left: 16px; } .det-sec ol:not(.rcs) { list-style: decimal; padding-left: 20px; }
.det-sec .rcs { margin-top: 4px; }
.det-sec p { margin-bottom: 8px; }
.h-sub { margin: 16px 0 8px; font-size: 15px; color: var(--ink-3); letter-spacing: 0; }
.src-note { margin-top: 8px; }
.env { margin-top: 8px; } .env li { margin-bottom: 8px; }
.ph { padding: 1px 4px; background: var(--paper-3); font-size: 13px; }
.warnbox { padding: 16px 16px; background: var(--paper-2); color: var(--warn); }
.warnbox h2 { color: var(--warn); }
.det-side dl { margin: 0; }
.det-side dt { font-size: 13px; color: var(--ink-3); margin-top: 16px; }
.det-side dt:first-child { margin-top: 0; }
.det-side dd { margin: 2px 0 0; color: var(--ink-2); font-size: 15px; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.tags a { font-size: 13px; color: var(--ink-3); } .tags a:hover { color: var(--ink); }
.attrib-note { margin-top: 20px; }

/* learn */
.courses { border-top: 1px solid var(--line); }
.courses a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 20px; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.courses a:hover .c-title { color: var(--brass); }
.c-title { font-size: 17px; }
.c-for { font-size: 13px; color: var(--ink-3); text-align: right; }
.c-sum { grid-column: 1 / -1; color: var(--ink-3); font-size: 15px; max-width: 80ch; }
@media (max-width: 640px) { .courses a { grid-template-columns: minmax(0, 1fr); } .c-for { text-align: left; grid-row: 2; } }
.more-list { border-top: 1px solid var(--line); }
.more-list a { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr) minmax(0, 2fr); gap: 2px 24px; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; align-items: baseline; }
.more-list a:hover .ml-name { color: var(--brass); }
.ml-what { color: var(--ink-3); font-size: 15px; }
.ml-src { color: var(--ink-3); font-size: 13px; }
@media (max-width: 760px) { .more-list a { grid-template-columns: minmax(0, 1fr); } }

/* prose, 404 */
.prose .h3 { margin: 32px 0 8px; }
.prose .h3:first-child { margin-top: 0; }
.lost { padding: clamp(80px, 14vw, 180px) 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }

/* footer */
.ftr { border-top: 1px solid var(--line); padding: 32px 0 40px; font-size: 14px; color: var(--ink-3); }
.ftr-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; }
.ftr-links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.ftr a { display: inline-flex; align-items: center; min-height: 32px; text-decoration: none; }
.ftr a:hover { color: var(--ink); }
.ftr-note { margin-top: 16px; max-width: 76ch; font-size: 13px; }
@media (pointer: coarse) { .ftr a { min-height: 44px; } }

/* School: same paper as everything else, quieter than the library */
.sv-hero { padding: clamp(64px, 9vw, 120px) 0 clamp(40px, 6vw, 72px); }
.sv-sec { padding: var(--sp-sec) 0; border-top: 1px solid var(--line); }
.sv-sec > .wrap > .sv-h2 { margin-bottom: 12px; }
.sv-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 88px); }
.sv-side .sv-h2 { margin-bottom: 16px; }
@media (max-width: 860px) { .sv-split { grid-template-columns: minmax(0, 1fr); } }
.sv-course { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(28px, 5vw, 72px); margin-top: 32px; }
@media (max-width: 860px) { .sv-course { grid-template-columns: minmax(0, 1fr); } }
.sv-path { align-self: start; position: sticky; top: 84px; }
@media (max-width: 860px) { .sv-path { position: static; } }
.sv-steps { margin-top: 12px; border-top: 1px solid var(--line); }
.sv-steps button { width: 100%; min-height: 44px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink-3); font: 400 15px/1.35 var(--sans); text-align: left; cursor: pointer; transition: color .15s ease; }
.sv-steps button:hover, .sv-steps button[aria-pressed="true"] { color: var(--ink); }
.sv-step-s { display: none; }
.sv-all { margin-top: 12px; min-height: 36px; padding: 0; border: 0; background: none; color: var(--ink); font: 400 14px var(--sans); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.sv-note { margin-top: 12px; font-size: 14px; color: var(--ink-3); }
.sv-contents { border-top: 1px solid var(--line); }
.sv-contents li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 20px; padding: 16px 0; border-bottom: 1px solid var(--line); transition: opacity .2s ease; }
.sv-contents h3 { font-size: 17px; letter-spacing: -0.01em; }
.sv-contents b { font-weight: 400; font-size: 13px; color: var(--ink-3); text-align: right; }
.sv-contents p { grid-column: 1 / -1; font-size: 15px; color: var(--ink-3); }
.sv-contents .is-off, .sv-contents li.is-off { opacity: .35; }
.sv-for summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; color: var(--ink); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; list-style: none; }
.sv-for summary::-webkit-details-marker, .sv-faq summary::-webkit-details-marker, .faq summary::-webkit-details-marker { display: none; }
.sv-for li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.sv-for h3 { font-size: 15px; letter-spacing: 0; }
.sv-for p { font-size: 14px; color: var(--ink-3); }
.sv-chat { margin-top: 20px; font-size: 14px; }
.sv-chat a, .sv-p a { color: var(--ink); }
.sv-vault h3 { margin-bottom: 12px; font-size: 19px; letter-spacing: -0.01em; }
.sv-files { border-top: 1px solid var(--line); }
.sv-files li { padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 15px; }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 28px; background: var(--line); border: 1px solid var(--line); }
@media (max-width: 760px) { .plans { grid-template-columns: minmax(0, 1fr); } }
.plan { display: flex; flex-direction: column; padding: clamp(20px, 3vw, 32px); background: var(--paper); }
.plan-top { display: flex; justify-content: space-between; gap: 12px; }
.plan-name { font-size: 17px; }
.plan-term, .price-note, .plan-for { color: var(--ink-3); font-size: 14px; }
.price { margin-top: 16px; font-size: clamp(36px, 4vw, 52px); font-weight: 500; line-height: 1; letter-spacing: -0.03em; }
.price small { margin-left: 8px; font-size: 14px; letter-spacing: 0; color: var(--ink-3); }
.price-note { margin-top: 8px; }
.plan-for { margin-top: 16px; color: var(--ink-2); }
.ticks { display: grid; gap: 8px; margin: 16px 0 24px; flex: 1; color: var(--ink-2); font-size: 15px; }
.ticks li { padding-left: 16px; border-left: 1px solid var(--line-2); }
.plan .btn { align-self: flex-start; }
.disclaimer { margin-top: 16px; max-width: 72ch; font-size: 13px; color: var(--ink-3); }
.sv-quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 28px clamp(28px, 4vw, 48px); margin-top: clamp(40px, 6vw, 64px); }
.quote { margin: 0; }
.quote blockquote { margin: 0; color: var(--ink-2); font-size: 15px; text-wrap: pretty; }
.quote figcaption { margin-top: 8px; display: grid; font-size: 13px; color: var(--ink-3); }
.quote b { font-weight: 500; color: var(--ink); } .quote b span { font-weight: 400; color: var(--ink-3); }
.sv-faq details, .faq details { border-bottom: 1px solid var(--line); }
.sv-faq { border-top: 1px solid var(--line); }
.sv-faq summary, .faq summary { display: flex; align-items: center; min-height: 52px; padding: 12px 0; cursor: pointer; list-style: none; font-size: 16px; }
.sv-faq summary:hover { color: var(--brass); }
.sv-faq p, .faq p { padding-bottom: 16px; max-width: 62ch; color: var(--ink-3); }
.sv-hub { border-top: 1px solid var(--line); }
.comm-links a { display: flex; justify-content: space-between; gap: 20px; align-items: baseline; padding: 20px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-size: clamp(24px, 3vw, 40px); font-weight: 500; letter-spacing: -0.03em; }
.comm-links a span { font-size: 14px; font-weight: 400; color: var(--ink-3); }
.comm-links a:hover { color: var(--brass); }
.comm-links { border-top: 1px solid var(--line); margin-bottom: var(--sp-sec); }
.quiet-link { margin-bottom: var(--sp-sec); margin-top: calc(var(--sp-sec) * -1 + 24px); font-size: 14px; color: var(--ink-3); }

/* admin */
.adm { padding: 40px 0; } .adm-table { overflow-x: auto; margin: 16px 0; } .adm-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-table th, .adm-table td { padding: 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sub-h { margin: 32px 0 12px; font-size: 19px; }
.adm-cats { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--ink-3); font-size: 14px; }
.notice { padding: 8px 16px; background: var(--paper-2); } .err { color: var(--err); } .ok { color: var(--ok); }

/* motion: one short entrance on the library's first screen */
@media (prefers-reduced-motion: no-preference) {
  .home-top h1 { animation: rise .5s var(--ease) both; }
  .home-top .lede, .home-top .finder { animation: rise .55s var(--ease) .08s both; }
  @keyframes rise { from { opacity: .01; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; } }

/* review fixes */
.price { font-variant-numeric: tabular-nums; }
.lib-head .h1 { font-size: clamp(32px, 3.6vw, 44px); }
.lib-head { padding-top: clamp(32px, 4vw, 48px); padding-bottom: 20px; }
.lib-head .lede { margin-top: 8px; font-size: 16px; }
@media (max-width: 700px) { .field kbd { display: none; } .field { padding-left: 16px; gap: 8px; } }
@media (max-height: 900px) { .lib-bar { position: static; } }
.more-filters summary::after, .sv-for summary::after, .sv-faq summary::after { content: "+"; margin-left: auto; padding-left: 12px; color: var(--ink-3); }
.more-filters summary::after { margin-left: 2px; padding-left: 2px; }
details[open] > summary::after { content: "\2212"; }
.sv-faq summary { justify-content: space-between; }
.more-filters summary { list-style: none; } .more-filters summary::-webkit-details-marker { display: none; }
@media (pointer: coarse) {
  .more-filters summary, .shelf-all, .lib-status .clear, .tags a { min-height: 44px; display: inline-flex; align-items: center; }
  .rc h3 a { display: inline-block; padding: 8px 0; }
  .crumbs a { padding: 12px 0; }
}
html:not(.js) .nav a { padding: 0 8px; }

/* ---------- cinematic layer: the library plate (scripts/make_halftone.py) ---------- */
.plate { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.plate img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
.h1 .dim, .h1 .now { display: block; font-size: inherit; }
.h1 .dim { color: var(--ink-dim); }
.hero-cine { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; min-height: calc(100svh - 61px); max-height: 1040px; padding: 0 0 40px; }
.hero-cine .plate { bottom: 26%; -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 100%); mask-image: linear-gradient(to bottom, #000 62%, transparent 100%); }
.hero-cine .lede { margin-top: 12px; }
.hero-cine .finder { margin-top: 24px; max-width: 880px; }
.hero-cine .field { min-height: 64px; padding: 0; gap: 12px; border: 0; border-bottom: 1px solid var(--line-3); background: transparent; }
.hero-cine .field:focus-within { outline: 0; border-bottom-color: var(--ink); box-shadow: 0 1px 0 var(--ink); }
.hero-cine .field input { font-size: clamp(20px, 2.2vw, 28px); letter-spacing: -0.015em; }
.hero-cine .peek { position: absolute; z-index: 5; width: min(880px, var(--wrap)); margin-top: 4px; }
.hero-cine .finder { position: relative; }
.index-sec { padding: 0 0 clamp(48px, 7vw, 88px); }
.index-sec .lib-index { margin-top: 0; }
.home-sec.band { background: var(--paper-2); border-top: 0; }
.lib-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.lib-grid a { display: grid; gap: 8px; align-content: start; height: 100%; padding-top: 16px; border-top: 1px solid var(--line-2); text-decoration: none; }
.lib-grid .lr-name { font-size: 20px; letter-spacing: -0.015em; }
.lib-grid .lr-kind { order: -1; text-align: left; }
@media (hover: hover) and (pointer: fine) { .lib-grid a:hover .lr-name { color: var(--brass); } }
@media (max-width: 860px) { .lib-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; } }
.goal-list a { display: flex; align-items: baseline; min-height: 64px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: clamp(24px, 3.6vw, 44px); font-weight: 500; line-height: 1.1; letter-spacing: -0.03em; color: var(--ink-dim); text-decoration: none; transition: color .2s ease; }
.goal-list a:hover, .goal-list a:focus-visible { color: var(--ink); }
.goal-list { border-top: 1px solid var(--line); margin-top: 24px; }
.page-head, .sv-hero { position: relative; isolation: isolate; }
.page-head .plate, .sv-hero .plate { -webkit-mask-image: linear-gradient(to right, transparent 38%, #000 88%); mask-image: linear-gradient(to right, transparent 38%, #000 88%); }
.page-head .plate img, .sv-hero .plate img { opacity: .72; object-position: 50% 44%; }
.sv-hero { padding: clamp(96px, 16vw, 200px) 0 clamp(40px, 6vw, 72px); }
@media (max-width: 700px) { .page-head .plate, .sv-hero .plate { display: none; } }
.ftr-mast { margin: 0 0 32px; font-size: clamp(56px, 15.4vw, 200px); font-weight: 500; line-height: .9; letter-spacing: -0.055em; color: var(--ink-mast); white-space: nowrap; }
@media (min-width: 1300px) { .ftr-mast { font-size: 190px; } }
@media (prefers-reduced-motion: no-preference) {
  .hero-cine .plate img { animation: settle 1.1s var(--ease) both; }
  @keyframes settle { from { opacity: 0; transform: scale(1.035); } to { opacity: 1; transform: none; } }
  .home-top h1, .hero-cine h1 { animation: rise .5s var(--ease) both; }
  .hero-cine .lede, .hero-cine .finder { animation: rise .55s var(--ease) .08s both; }
}
@media (max-width: 700px) { .hero-cine { min-height: 620px; } .hero-cine .plate { bottom: 40%; } .hero-cine .plate img { object-position: 50% 40%; } }

/* ==========================================================================================
   MOTION PRIMITIVES (2026-11-07). One voice, one place. The behaviour lives in site.js.
   Rules for this block: animate transform and opacity only; hover only behind
   (hover: hover) and (pointer: fine); focus rings stay instant; everything that moves sits under
   prefers-reduced-motion: no-preference (the global reduce rule above flattens the rest to instant).
     1  lit line      links: a hairline wipes in from the left and leaves to the right
     2  sweep         buttons and chips: a fill sweeps across behind the label
     3  nudge         row titles: drawn 3px out, like a card pulled from a catalogue drawer
     4  lamp          rows: a candle-warm light under the pointer, clipped to the row's hairlines
     5  search        instant focus line, then one brass pass along it; peek and result entrances
     6  reveal        short stagger for rows that just arrived (only ever added by script)
     7  page changes  cross-document view transitions: nav stays put, title and row name carry over
     8  swap          same-document view transition for category and sort changes
     9  vault         the School footer link: two halves of the library plate shut, then part
   ========================================================================================== */
:root { --t-fast: 120ms; --t-hover: 200ms; --t-move: 320ms; --ease-door: cubic-bezier(.76, 0, .24, 1); }

/* 1 lit line. `bottom` is measured from the box centre so it sits under one line of text at any height. */
:is(.nav a, .ftr-links a, .crumbs a, .tags a, .shelf-all, .home-sec-h .link, .peek-foot .link, .lib-status .clear, .sv-all) { position: relative; text-decoration: none; }
:is(.nav a, .ftr-links a, .crumbs a, .tags a, .shelf-all, .home-sec-h .link, .peek-foot .link, .lib-status .clear, .sv-all, .brand span)::after {
  content: ""; position: absolute; left: var(--lx, 0); right: var(--lx, 0); bottom: calc(50% - .95em); height: 1px; background: currentColor; pointer-events: none;
  transform: scaleX(0); transform-origin: right; transition: transform var(--t-hover) var(--ease);
}
:is(.tags a, .shelf-all, .home-sec-h .link, .peek-foot .link, .lib-status .clear, .sv-all)::before {   /* these keep their resting underline */
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(50% - .95em); height: 1px; background: var(--line-3); pointer-events: none;
}
.nav a { --lx: 12px; }
html:not(.js) .nav a { --lx: 8px; }
.nav a[aria-current="page"]::after { transform: scaleX(1); background: var(--line-3); }
@media (max-width: 700px) { .js .nav a { --lx: 0px; } }
.brand span { position: relative; }
.brand img { opacity: .78; transition: opacity var(--t-hover) ease; }
.brand:focus-visible img { opacity: 1; }
.ftr-links a[data-vault]::after { transform-origin: center; }                 /* a seam, not a wipe */
.ftr-links a[data-vault]:focus-visible::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) {
  :is(.nav a, .ftr-links a, .crumbs a, .tags a, .shelf-all, .home-sec-h .link, .peek-foot .link, .lib-status .clear, .sv-all):hover::after,
  .brand:hover span::after { transform: scaleX(1); transform-origin: left; }
  .nav a[aria-current="page"]:hover::after { background: currentColor; }
  .ftr-links a[data-vault]:hover::after { transform-origin: center; }
  .brand:hover img { opacity: 1; }
  .shelf-all:hover, .home-sec-h .link:hover, .peek-foot .link:hover, .lib-status .clear:hover, .sv-all:hover { color: var(--ink-hi); }
  .sv-chat a:hover, .sv-p a:hover { color: var(--brass); }
  .select select:hover { border-color: var(--line-3); }
  .menu-btn:hover { border-color: var(--ink-3); }
  .copy:hover { border-color: var(--ink-3); }
}
@media (forced-colors: active) { :is(.tags a, .shelf-all, .home-sec-h .link, .peek-foot .link, .lib-status .clear, .sv-all) { text-decoration: underline; } }

/* 2 sweep. Light buttons fill with brass, ghost buttons and chips with the next step of paper. */
.btn, .copy, .chip, .goals-mini a { position: relative; isolation: isolate; }
:is(.btn, .copy, .chip, .goals-mini a)::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--sweep, var(--paper-3)); pointer-events: none;
  transform: scaleX(0); transform-origin: right; transition: transform var(--t-hover) var(--ease);
}
.btn-light, .btn-gold, .sv-cta { --sweep: var(--brass); }
:is(.btn-light, .btn-gold, .sv-cta)::before { inset: -1px; }   /* over their transparent border too, or the ivory shows as a rim */
.chip { transition: color .15s ease, border-color .15s ease, transform .14s var(--ease); }
.chip:active, .goals-mini a:active, .copy:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) {
  :is(.btn:not([disabled]), .copy, .chip:not([aria-current="true"]), .goals-mini a:not([aria-current="true"])):hover::before { transform: scaleX(1); transform-origin: left; }
}

/* 3 nudge. `.nudge` wraps a row label whose link has no other inner element. */
.rc h3 a { display: inline-block; }
.nudge { display: inline-block; font: inherit; color: inherit; letter-spacing: inherit; }
.lib-index .nudge, .comm-links a .nudge { font-size: inherit; font-weight: inherit; color: inherit; }
.sv-step-l { display: inline-block; }
:is(.lr-name, .rc h3 a, .c-title, .ml-name, .pk-name, .nudge, .sv-step-l) { transition: transform var(--t-hover) var(--ease), color .2s ease; }
@media (hover: hover) and (pointer: fine) {
  :is(.lib-rows a, .lib-grid a):hover .lr-name, .rc h3 a:hover, .courses a:hover .c-title, .more-list a:hover .ml-name,
  .peek li a:hover .pk-name, :is(.goal-list a, .comm-links a, .lib-index a):hover .nudge, .sv-steps button:hover .sv-step-l { transform: translateX(3px); }
  .peek li a:hover .pk-name { color: var(--brass); }
}
:is(.lib-rows a, .lib-grid a):active .lr-name, .rc h3 a:active, .courses a:active .c-title, .more-list a:active .ml-name, .peek li a:active .pk-name, :is(.goal-list a, .comm-links a):active { color: var(--brass); }
.more-filters summary::after, .sv-for summary::after, .sv-faq summary::after { display: inline-block; transition: transform var(--t-hover) var(--ease); }
@media (hover: hover) and (pointer: fine) { :is(.more-filters, .sv-for, .sv-faq details):not([open]) > summary:hover::after { transform: rotate(90deg); } }

/* 4 lamp. site.js moves one of two <span class="lamp"> into the row under a fine pointer and only ever
   writes transforms, so tracking costs no paint. Rows gain no box: it is clipped to the existing hairlines. */
:is(.rc, .lib-rows a, .lib-grid a, .courses a, .more-list a, .goal-list a, .comm-links a, .lib-index a, .peek li a) { position: relative; isolation: isolate; }
.hero-cine { z-index: 1; }   /* the rows below are stacking contexts now; the search panel must stay above them */
.lamp { position: absolute; inset: -1px 0; z-index: -1; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .24s ease; }
.lamp.on { opacity: 1; transition-duration: .14s; }
.lamp-glow { position: absolute; left: 0; top: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px; background: radial-gradient(closest-side, rgb(205 176 122 / .09), rgb(205 176 122 / 0)); will-change: transform; }
.lamp-edge { position: absolute; left: 0; bottom: 0; width: 360px; height: 1px; margin-left: -180px; background: linear-gradient(to right, rgb(205 176 122 / 0), rgb(205 176 122 / .8), rgb(205 176 122 / 0)); will-change: transform; }
:is(.lib-grid, .rcs.grid) .lamp-edge { top: 0; bottom: auto; }
.peek .lamp-edge { display: none; }

/* 5 search. The line is there the instant focus lands; the brass pass only decorates it. The input's own
   transparent outline shows up in forced-colors mode, where box-shadows vanish. */
.field input:focus-visible { outline: 2px solid transparent; outline-offset: 2px; }
.field:focus-within { outline-color: var(--ink); }
.field:focus-within svg.lens { stroke: var(--ink); }
.field input:focus::placeholder { color: var(--ink-dim); }
.field::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brass); pointer-events: none; opacity: 0; transform: scaleX(0); transform-origin: left; }

/* reveal, peek, results, menu: entrances only, and only when motion is welcome */
@media (prefers-reduced-motion: no-preference) {
  .field:focus-within::after { animation: field-lit .62s var(--ease) both; }
  @keyframes field-lit { 0% { opacity: 1; transform: scaleX(0); } 55% { opacity: 1; transform: scaleX(1); } 100% { opacity: 0; transform: scaleX(1); } }
  .peek:not([hidden]) { animation: peek-in .18s var(--ease) backwards; }
  @keyframes peek-in { from { opacity: 0; transform: translateY(-4px); } }
  .peek li { animation: fade-up .16s linear backwards; }
  @keyframes fade-up { from { opacity: .35; } }
  .results-in { animation: results-in .22s var(--ease) backwards; }
  @keyframes results-in { from { opacity: .55; transform: translateY(4px); } }
  /* 6 reveal: site.js adds this to at most eight new rows, then removes it */
  .row-in { animation: row-in .32s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 30ms); }
  @keyframes row-in { from { opacity: 0; transform: translateY(8px); } }
  @media (max-width: 700px) { .js .nav.open { animation: peek-in .18s var(--ease) backwards; } }
}
#lib-count:focus { outline: none; }   /* only ever focused by script, to keep a keyboard user's place */

/* 7 page changes and 8 swap. No @view-transition under reduced motion, so those users get a plain navigation. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .hdr { view-transition-name: hdr; }
  .page-head .h1, .sv-hero .sv-h1 { view-transition-name: page-title; width: fit-content; max-width: 100%; }
  .det-head h1 { view-transition-name: res-name; width: fit-content; max-width: 100%; }
  ::view-transition-group(hdr) { animation: none; z-index: 5; }
  ::view-transition-old(root) { animation: vt-out var(--t-fast) linear both; }
  ::view-transition-new(root) { animation: vt-in var(--t-move) var(--ease) both; }
  @keyframes vt-out { to { opacity: 0; } }
  @keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
  /* a title that keeps its place: old word out first, new word in, so they never overprint */
  ::view-transition-group(page-title) { animation-duration: var(--t-move); animation-timing-function: var(--ease); }
  ::view-transition-old(page-title) { animation: vt-out var(--t-fast) linear both; mix-blend-mode: normal; }
  ::view-transition-new(page-title) { animation: vt-title-in .2s linear .06s both; mix-blend-mode: normal; }
  @keyframes vt-title-in { from { opacity: 0; } }
  /* the row's name travels to the resource page's heading: scale with the box, never stretch it */
  ::view-transition-group(res-name) { animation-duration: .36s; animation-timing-function: var(--ease); }
  ::view-transition-old(res-name), ::view-transition-new(res-name) { width: auto; height: 100%; animation-duration: .24s; }

  /* 8 swap: only the results change. Whatever a view transition captures can't be clicked until it ends (Chromium sends
     the click to whatever is behind it), so the page itself and the search bar are left out of the capture and stay live.
     The header is still captured, or results scrolled beneath it would paint over it; the lit chip already has its click. */
  html.vt-swap { view-transition-name: none; }
  html.vt-swap::view-transition { pointer-events: none; }
  html.vt-swap .lib-body { view-transition-name: lib-results; }
  html.vt-swap .cats-bar .chip[aria-current="true"] { view-transition-name: chip-on; }
  html.vt-swap .page-head .h1 { view-transition-name: none; }
  html.vt-swap::view-transition-group(lib-results) { animation: none; }
  html.vt-swap::view-transition-old(lib-results) { animation: vt-out var(--t-fast) linear both; }
  html.vt-swap::view-transition-new(lib-results) { animation: vt-in .24s var(--ease) both; }
  html.vt-swap.vt-jump::view-transition-old(lib-results) { display: none; }  /* the page scrolled: old rows would sit at the wrong height */
  /* the lit chip slides to its new place. Fill the box, so a narrow chip's snapshot never towers over the row. */
  html.vt-swap::view-transition-group(chip-on) { animation-duration: var(--t-move); animation-timing-function: var(--ease); z-index: 4; }
  html.vt-swap::view-transition-old(chip-on), html.vt-swap::view-transition-new(chip-on) { width: 100%; height: 100%; }
  html.vt-swap::view-transition-old(chip-on) { animation: none; }   /* stays solid under the new label, so the pill never thins out */
  html.vt-swap::view-transition-new(chip-on) { animation: vt-title-in .2s linear both; mix-blend-mode: normal; }

  /* 9 vault. site.js adds two fixed halves of the library plate and navigates once they meet; the new page
     then receives them as old-only view-transition groups and slides them apart. Both moves are transforms. */
  .vault-leaf { position: fixed; top: 0; bottom: 0; z-index: 200; width: 50vw; pointer-events: none; --plate-w: max(100vw, 192vh); background: var(--paper) url("/assets/img/library-halftone.svg") no-repeat; background-size: var(--plate-w) auto; }
  .vault-leaf.l { left: 0; background-position: calc(50vw - var(--plate-w) / 2) 42%; box-shadow: inset -1px 0 0 var(--brass); view-transition-name: door-l; animation: door-shut-l .3s cubic-bezier(.3, 0, .1, 1) both; }
  .vault-leaf.r { left: 50vw; background-position: calc(var(--plate-w) / -2) 42%; box-shadow: inset 1px 0 0 var(--brass); view-transition-name: door-r; animation: door-shut-r .3s cubic-bezier(.3, 0, .1, 1) both; }
  @keyframes door-shut-l { from { transform: translateX(-100%); } }
  @keyframes door-shut-r { from { transform: translateX(100%); } }
  ::view-transition-group(door-l), ::view-transition-group(door-r) { animation: none; z-index: 10; }
  ::view-transition-old(door-l) { animation: door-part-l .74s var(--ease-door) .05s both; mix-blend-mode: normal; }
  ::view-transition-old(door-r) { animation: door-part-r .74s var(--ease-door) .05s both; mix-blend-mode: normal; }
  @keyframes door-part-l { to { transform: translateX(-100%); } }
  @keyframes door-part-r { to { transform: translateX(100%); } }
}
/* the leaves are decoration: if one ever slips through under reduced motion it must not cover the page */
@media (prefers-reduced-motion: reduce) { .vault-leaf { display: none; } }

/* interaction fixes from the jury review that sit with the above */
.cats-wrap { position: relative; }
.cats-wrap::after { content: ""; position: absolute; top: 0; bottom: 0; right: -6px; width: 56px; background: linear-gradient(to right, rgb(15 13 12 / 0), var(--paper)); pointer-events: none; transition: opacity var(--t-hover) ease; }
.cats-wrap.at-end::after { opacity: 0; }
@media (pointer: coarse) {
  .rc h3 a { min-width: 24px; }
  .sv-chat a, .sv-p a, .det-side dd a, .lede .link { display: inline-block; padding-block: 3px; }
}
