/* dragonlock.app v3 "Dusk editorial": reading. The parent guides (/blog/) and the comparisons (/compare/, which add
   compare.css) load this after site.css; /tools/ borrows the "Keep reading" shelf (.after, .shelf, .shelf-guide).
   A guide is a calm page of warm paper under a strip of the dusk band: the head (kicker, title, standfirst, byline),
   then a serif reading column (Alegreya 400, ~40rem) with the contents as a sticky rail beside it on wide screens and
   a folded block above the text on narrow ones (contents.js marks the section you're reading). Every component reads the
   paper tokens main.read gets from site.css; the only night on the page is the band, the tool card and the lantern.
   Design notes: docs/site-v3/README.md. The CSP forbids inline styles, so every rule lives here. */

.reading {
  --rail: 13.5rem;                 /* the contents rail */
  --rail-gap: 4.5rem;
  --text: 40rem;                   /* the reading measure */
  --guide-w: 74rem;                /* rail + gap + text + the room tables and figures bleed into (the crumbs' .wrap) */
  /* how far a wide table or a figure may reach right of the text column (0 until the rail layout) */
  --bleed: 0rem;
  --sticky-top: calc(var(--head-h) + 1.75rem);
}
main.read { background: var(--bg); color-scheme: light; padding-bottom: clamp(4rem, 8vw, 6.5rem); }
main.read ::selection { background: color-mix(in srgb, var(--lamp) 42%, transparent); color: var(--ink); }

/* ------------------------------------------------------------------ the band: a strip of the dusk under the header */
.reading .page-top { min-height: clamp(8.25rem, 13vw, 11.5rem); }
.reading .page-top::after { content: ""; position: absolute; inset: auto 0 0; z-index: -1; height: 2.5rem; pointer-events: none;
  background: linear-gradient(rgba(11,14,26,0), rgba(11,14,26,.35)); }
/* on phones the crumbs sit on the band's bright peaks: night behind them */
@media (max-width: 40em) { .reading .page-top::before { height: 100%; background: linear-gradient(rgba(11,14,26,.85), rgba(11,14,26,.55) 70%, rgba(11,14,26,.25)); } }
/* in the one-column layout the crumbs line up with the text under them */
@media (width < 68.75em) { .reading:has(.guide) .page-top .crumbs-bar { width: min(100% - 2 * var(--gutter), var(--text)); } }
@media (max-width: 40em) {
  .reading:has(.guide) .page-top .crumbs-bar li:last-child { display: none; } /* a guide's own name is the title just below */
}

/* reading progress: a thread of lamplight along the top edge (scroll-driven; absent where unsupported) */
.read-progress { display: none; }
@supports (animation-timeline: scroll()) {
  .read-progress { display: block; position: fixed; z-index: 75; inset: 0 0 auto; height: 2px; pointer-events: none; transform-origin: 0 50%;
    background: linear-gradient(90deg, var(--ember), var(--lamp) 70%, var(--lamp-hi));
    animation: read-fill linear both; animation-timeline: scroll(root); }
  @keyframes read-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* ------------------------------------------------------------------ the guide's frame */
.guide { width: min(100% - 2 * var(--gutter), var(--text)); margin-inline: auto; }

/* the head: kicker, title, standfirst, byline (and a comparison's disclosure) */
.guide-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 2.75rem); border-bottom: 1px solid var(--hair); }
.kicker { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .7rem; margin: 0 0 1.15rem;
  font: 600 1.02rem/1.3 var(--display); font-variant-caps: all-small-caps; letter-spacing: .09em; color: var(--link); }
.kicker span + span::before { content: ""; display: inline-block; width: 4px; height: 4px; margin: 0 .7rem .2em 0; border-radius: 50%; background: currentColor; opacity: .55; vertical-align: middle; }
.guide-head h1 { max-width: 21ch; font-size: clamp(2.35rem, 1.3rem + 3.6vw, 3.5rem); line-height: 1.04; letter-spacing: -.025em; color: var(--fg); }
.guide-head h1 .nobr { white-space: nowrap; }
.standfirst { max-width: 36rem; margin: 1.25rem 0 0; font: 400 clamp(1.2rem, 1.08rem + .45vw, 1.42rem)/1.5 var(--display); color: var(--fg-2); text-wrap: pretty; }
.byline { display: flex; align-items: center; gap: .9rem; margin: 1.75rem 0 0; font: 400 .98rem/1.45 var(--body); color: var(--fg-3); }
.byline p { margin: 0; min-width: 0; }
.byline a { color: var(--fg); text-decoration: none; }
.byline a:hover strong { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.byline strong { font-weight: 700; color: var(--fg); }
.byline time { white-space: nowrap; }
.byline .dot { white-space: nowrap; }
.byline .dot::before { content: ""; display: inline-block; width: 3px; height: 3px; margin: 0 .55rem .22em; border-radius: 50%; background: currentColor; vertical-align: middle; }
/* narrow phones: the reading time on its own line, without a stranded bullet */
@media (max-width: 23.75em) { .byline .dot { display: block; } .byline .dot::before { display: none; } .byline time, .byline .dot { white-space: normal; } }
/* the author's monogram: "sk" in lamplight on the night */
.seal { flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; padding-bottom: .08em;
  font: 700 1.08rem/1 var(--display); letter-spacing: -.01em; color: var(--lamp-hi);
  background: radial-gradient(120% 120% at 30% 20%, var(--night-4), var(--night) 70%); box-shadow: 0 0 0 1px rgba(27,24,34,.08), 0 6px 14px -8px rgba(11,14,26,.7); }
.seal.big { width: 4rem; height: 4rem; font-size: 1.45rem; }

/* ------------------------------------------------------------------ the body: contents, then the text */
.guide-body { padding-top: clamp(2rem, 4vw, 2.75rem); }

/* the contents. Narrow: a folded card above the text (a tap opens it). Wide: the rail, open, following you down. */
.toc { margin: 0 0 2.5rem; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--hair); }
.toc-fold > summary { display: flex; align-items: center; gap: .75rem; min-height: 3.25rem; padding: .6rem 1.15rem; border-radius: var(--r);
  cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.toc-fold > summary::-webkit-details-marker { display: none; }
/* the contents' label: the same on guides and documents (document.css) */
.toc .label { display: block; margin: 0; font: 600 1rem/1.3 var(--display); font-variant-caps: all-small-caps; letter-spacing: .09em; color: var(--fg-3); }
.toc-n { margin-left: auto; font: 400 .95rem/1.3 var(--body); color: var(--fg-3); }
.toc-fold > summary::after { content: ""; flex: none; width: .45rem; height: .45rem; margin: 0 .2rem .25rem 0; border: solid var(--fg-3);
  border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform .2s var(--settle); }
.toc-fold[open] > summary::after { margin-bottom: 0; transform: translateY(.15rem) rotate(-135deg); }
.toc-fold > summary:hover .toc-n { color: var(--fg); }
.toc ol { list-style: none; margin: 0; padding: 0 .6rem .6rem; }
.toc li { margin: 0; border-top: 1px solid var(--hair); }
.toc a { display: flex; align-items: center; min-height: 2.75rem; padding: .45rem .55rem; font: 400 1rem/1.35 var(--body); color: var(--fg-2); text-decoration: none; border-radius: var(--r-s); }
.toc a:hover { color: var(--fg); background: var(--paper-2); }
.toc a[aria-current] { color: var(--fg); font-weight: 700; }

/* ------------------------------------------------------------------ wide: the rail beside the text */
@media (min-width: 68.75em) {
  .reading { --bleed: clamp(0rem, min(100vw - 2 * var(--gutter), var(--guide-w)) - var(--rail) - var(--rail-gap) - var(--text) - 1rem, 13rem); }
  .guide { width: min(100% - 2 * var(--gutter), var(--guide-w)); }
  .guide-head, .guide-body { display: grid; grid-template-columns: [rail] var(--rail) var(--rail-gap) [text] minmax(0, var(--text)) [bleed] minmax(0, 1fr); }
  .guide-head { border-bottom: 0; padding-bottom: 0; }
  .guide-head > * { grid-column: text / -1; }
  .guide-head::after { content: ""; grid-column: text / -1; margin-top: 2.5rem; border-bottom: 1px solid var(--hair); }
  .guide-head .disclosure { grid-column: text; }
  .guide-body > * { grid-column: text; min-width: 0; }
  .guide-body > .toc { grid-column: rail; grid-row: 1 / span 8; align-self: stretch; margin: 0; border-radius: 0; background: none; box-shadow: none; }
  .toc-fold { position: sticky; top: var(--sticky-top); max-height: calc(100vh - var(--sticky-top) - 2rem); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .toc-fold > summary { min-height: 0; padding: 0 0 .9rem; }
  /* with script (contents.js keeps the rail open) the summary is a plain label; without it, a working disclosure */
  .js .toc-fold > summary { cursor: default; pointer-events: none; }
  .js .toc-n, .js .toc-fold > summary::after { display: none; }
  .toc ol { padding: 0; box-shadow: inset 1px 0 0 var(--hair); }
  .toc li { border: 0; }
  .toc a { position: relative; min-height: 0; padding: .42rem 0 .42rem 1.1rem; font-size: .95rem; line-height: 1.38; border-radius: 0; color: var(--fg-3); }
  .toc a:hover { background: none; color: var(--fg); }
  .toc a[aria-current] { font-weight: 400; color: var(--fg); }
  .toc a[aria-current]::before { content: ""; position: absolute; left: 0; top: .35rem; bottom: .35rem; width: 2px; border-radius: 2px; background: var(--accent); }
  .toc a:focus-visible { outline-offset: 0; border-radius: 4px; }
}
@media (min-width: 68.75em) and (pointer: coarse) { .toc a { min-height: 2.75rem; display: flex; align-items: center; } }
@media (min-width: 68.75em) and (max-width: 79.9375em) { .reading { --rail: 12rem; --rail-gap: 3rem; } }
/* on the rail layout, wide tables and the pet reach into the margin right of the text */
@media (min-width: 68.75em) {
  .ink-table:not(.narrow) { margin-right: calc(-1 * var(--bleed)); }
  .margin-pet { margin-right: calc(-1 * min(var(--bleed), 6rem)); }
}

/* ------------------------------------------------------------------ the text */
.prose { font: 400 1.1875rem/1.7 var(--display); font-variant-numeric: oldstyle-nums proportional-nums; color: var(--fg); text-wrap: pretty; }
.prose > * { margin-block: 0 1.15em; }
.prose strong { font-weight: 700; color: var(--fg); }
.prose h2 { margin: 2.3em 0 .65em; font-size: clamp(1.6rem, 1.25rem + 1.1vw, 2.05rem); line-height: 1.14; letter-spacing: -.018em; color: var(--fg);
  font-variant-numeric: lining-nums; scroll-margin-top: calc(var(--head-h) + 1.5rem); }
.prose h3 { margin: 2em 0 .5em; font-size: clamp(1.22rem, 1.1rem + .35vw, 1.38rem); line-height: 1.25; letter-spacing: -.008em; color: var(--fg);
  font-variant-numeric: lining-nums; scroll-margin-top: calc(var(--head-h) + 1.5rem); }
.prose h2 + h3 { margin-top: .9em; }
.prose h2 + p, .prose h3 + p, .prose h2 + .margin-pet + p { margin-top: 0; }
.prose > :first-child { margin-top: 0; }
.prose p[id] { scroll-margin-top: calc(var(--head-h) + 1.5rem); }
/* a heading you jumped to glows once, like a rune lighting */
.prose h2:target, .prose h3:target, .endmatter h2:target { animation: lit 2.2s var(--settle); }
@keyframes lit { 15% { text-shadow: 0 0 .6em color-mix(in srgb, var(--lamp) 70%, transparent); } }

/* lists */
.prose ul, .prose ol:not(.runes) { padding-left: 1.5em; }
.prose li { margin: .4em 0; padding-left: .15em; }
.prose li > ul, .prose li > ol { margin: .4em 0; }
.prose ul { list-style: none; }
.prose ul > li { position: relative; }
.prose ul > li::before { content: ""; position: absolute; left: -1.05em; top: .72em; width: .38em; height: .38em; border-radius: 50%; background: var(--accent); }
.prose ol:not(.runes) > li::marker { color: var(--link); font: 700 .95em var(--display); font-variant-numeric: lining-nums; }

/* the short answer: first, in a raised card */
.answer { margin: 0 0 2.4rem; padding: clamp(1.3rem, 3vw, 1.75rem) clamp(1.25rem, 3vw, 1.85rem); border-radius: var(--r-l); background: var(--card-2);
  box-shadow: inset 0 0 0 1px var(--hair), 0 1px 2px rgba(27,24,34,.04), 0 20px 40px -28px rgba(27,24,34,.35); }
.answer > p { font-weight: 500; }
.answer > :last-child, .try > :last-child { margin-bottom: 0; }
.label { display: block; margin: 0 0 .5rem; font: 600 1.02rem/1.3 var(--display); font-variant-caps: all-small-caps; letter-spacing: .09em; color: var(--link); }
.answer > .label { display: flex; align-items: center; gap: .55rem; }
.answer > .label::before { content: ""; flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lamp) 28%, transparent); }

/* something to try: a tinted note, the words to use */
.try { margin: 2rem 0 2.2rem; padding: 1.3rem clamp(1.2rem, 3vw, 1.6rem) 1.35rem; border-radius: var(--r); background: var(--paper-2); }
.try p { font-size: 1.12rem; line-height: 1.6; }

/* steps: numbered on small night discs, joined by a thread */
.runes { list-style: none; margin: 1.6em 0 1.8em; padding: 0; counter-reset: step; }
.runes > li { counter-increment: step; position: relative; margin: 0; padding: 0 0 1.15em 3.1rem; }
.runes > li:last-child { padding-bottom: 0; }
.runes > li::before { content: counter(step); position: absolute; left: 0; top: .1em; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; padding-bottom: .06em;
  font: 700 1.02rem/1 var(--display); font-variant-numeric: lining-nums; color: var(--lamp-hi); background: var(--night); }
.runes > li:not(:last-child)::after { content: ""; position: absolute; left: calc(1.05rem - .5px); top: 2.45em; bottom: .25em; width: 1px; background: var(--hair-2); }

/* the pull quote: the line worth carrying away (aria-hidden; it repeats the text) */
.pull { position: relative; margin: 2.6rem 0; padding: .2rem 0 0 1.6rem; box-shadow: inset 2px 0 0 var(--lamp); }
.pull p { margin: 0; font: 600 clamp(1.4rem, 1.15rem + .9vw, 1.78rem)/1.3 var(--display); letter-spacing: -.012em; color: var(--fg); text-wrap: balance; }

/* tables: a card with hairline rows; sans for the data, the serif for row names. They scroll sideways on a phone
   rather than squeeze, unless .stack (one card per row) or .narrow (no minimum width). */
.ink-table { margin: 2rem 0 2.3rem; overflow-x: auto; border-radius: var(--r); background: var(--card-2); border: 1px solid var(--hair);
  -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.ink-table table { width: 100%; min-width: 34rem; border-collapse: collapse; font: 400 1rem/1.5 var(--body); font-variant-numeric: lining-nums tabular-nums; color: var(--fg-2); }
.ink-table.narrow table { min-width: 0; }
.ink-table caption { caption-side: top; text-align: left; padding: 1rem 1.15rem .85rem; font: 700 1.05rem/1.35 var(--display); color: var(--fg); border-bottom: 1px solid var(--hair); }
.ink-table th, .ink-table td { text-align: left; vertical-align: top; padding: .8rem 1.15rem; border-bottom: 1px solid var(--hair); }
.ink-table th + td, .ink-table td + td { padding-left: .6rem; }
.ink-table thead th { padding-block: .65rem; font: 600 .98rem/1.3 var(--display); font-variant-caps: all-small-caps; letter-spacing: .07em; color: var(--fg-3); background: color-mix(in srgb, var(--paper-2) 55%, transparent); }
.ink-table thead th + th { padding-left: .6rem; }
.ink-table tbody th { font: 700 1.04rem/1.4 var(--display); color: var(--fg); }
.ink-table td strong { color: var(--fg); }
.ink-table tbody:last-child tr:last-child > * { border-bottom: 0; }
.ink-table tbody tr:not(.group):hover > * { background: color-mix(in srgb, var(--paper-2) 35%, transparent); }
/* on a phone a three-column table becomes one card per row, each cell under its own label */
@media (max-width: 35em) {
  .ink-table.stack table, .ink-table.stack tbody, .ink-table.stack tr, .ink-table.stack th, .ink-table.stack td { display: block; min-width: 0; }
  .ink-table.stack caption { display: block; }
  .ink-table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .ink-table.stack tr { padding: .95rem 1.1rem 1rem; border-bottom: 1px solid var(--hair); }
  .ink-table.stack tbody tr:last-child { border-bottom: 0; }
  .ink-table.stack tbody tr:hover > * { background: none; }
  .ink-table.stack th, .ink-table.stack td { padding: 0; border: 0; }
  .ink-table.stack td { margin-top: .5rem; }
  .ink-table.stack td::before { content: attr(data-label); display: block; font: 600 .95rem/1.3 var(--display); font-variant-caps: all-small-caps; letter-spacing: .07em; color: var(--fg-3); }
}

/* a figure in the margin: the pet, where the guide talks about the app */
.margin-pet { float: right; width: clamp(6.5rem, 22vw, 8.75rem); margin: .1rem -.25rem .75rem 1.25rem; shape-outside: margin-box; }

.prose blockquote { margin: 1.8em 0; padding: .1rem 0 .1rem 1.35rem; border-left: 2px solid var(--hair-2); color: var(--fg-2); }
.prose blockquote p { margin-bottom: .6em; }
.prose blockquote cite { display: block; font: 600 .98rem/1.3 var(--display); font-style: normal; font-variant-caps: all-small-caps; letter-spacing: .07em; color: var(--fg-3); }
.prose em { font-style: italic; }

/* ------------------------------------------------------------------ end matter: quick answers and sources */
.endmatter { margin-top: clamp(3.5rem, 7vw, 4.75rem); padding-top: clamp(2.25rem, 4vw, 3rem); border-top: 1px solid var(--hair); }
.endmatter > h2 { margin: 0 0 .5rem; font-size: clamp(1.6rem, 1.25rem + 1.1vw, 2.05rem); line-height: 1.14; letter-spacing: -.018em; scroll-margin-top: calc(var(--head-h) + 1.5rem); }
.faq-list { margin: 0 0 3rem; }
.faq-list > div { padding: 1.35rem 0 1.4rem; border-bottom: 1px solid var(--hair); }
.faq-list > div:last-child { border-bottom: 0; }
.faq-list h3 { margin: 0 0 .45rem; font-size: 1.2rem; line-height: 1.3; letter-spacing: -.006em; }
.faq-list p { margin: 0; font: 400 1.1rem/1.65 var(--display); color: var(--fg-2); }
.sources { padding: 1.5rem clamp(1.2rem, 3vw, 1.6rem) 1.4rem; border-radius: var(--r); background: var(--paper-2); font: 400 .97rem/1.55 var(--body); color: var(--fg-2); }
.sources h2 { margin: 0 0 .85rem; font: 600 1.02rem/1.3 var(--display); font-variant-caps: all-small-caps; letter-spacing: .09em; color: var(--fg); scroll-margin-top: calc(var(--head-h) + 1.5rem); }
.sources ol { margin: 0; padding-left: 1.35rem; display: grid; gap: .6rem; }
.sources li { padding-left: .2rem; }
.sources li::marker { color: var(--fg-3); font-weight: 700; font-variant-numeric: lining-nums tabular-nums; }
.sources .pub { font-weight: 700; color: var(--fg); }
.sources a { color: var(--link); overflow-wrap: anywhere; }
.sources .checked { margin: 1rem 0 0; padding-top: .9rem; border-top: 1px solid var(--line-2); font-size: .93rem; color: var(--fg-2); }

/* the author, signing off */
.author { display: grid; grid-template-columns: auto 1fr; gap: 1rem 1.4rem; align-items: start; margin-top: 3rem; padding-top: 2.25rem; border-top: 1px solid var(--hair); }
.author h2 { margin: .15rem 0 .5rem; font-size: 1.35rem; line-height: 1.2; }
.author h2 span { display: block; margin-bottom: .2rem; font: 600 .98rem/1.3 var(--display); font-variant-caps: all-small-caps; letter-spacing: .09em; color: var(--fg-3); }
.author p { margin: 0 0 .65rem; font: 400 1.02rem/1.6 var(--body); color: var(--fg-2); }
.author p:last-child { margin-bottom: 0; }
@media (max-width: 30em) { .author { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ after the guide: keep reading */
.after { width: min(100% - 2 * var(--gutter), var(--guide-w, 74rem)); margin: clamp(4rem, 8vw, 6rem) auto 0; }
.after-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1.5rem; margin-bottom: 1.5rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--hair); }
.after-head h2 { font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.3rem); letter-spacing: -.02em; }
.after-head a { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.75rem; font: 700 1rem/1.2 var(--body); color: var(--link); text-decoration: none; }
.after-head a::after { content: "→"; font-weight: 400; transition: transform .2s var(--settle); }
.after-head a:hover::after { transform: translateX(3px); }
.shelf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1.25rem; }
/* a shelf of one: the card takes the row, its words on the left and where it leads on the right */
.shelf > :only-child { grid-column: 1 / -1; }
@media (min-width: 43.75em) {
  .shelf > :only-child { display: grid; grid-template-columns: minmax(0, 38rem) 1fr; column-gap: 2rem; align-items: end; padding: 1.9rem 2.25rem 1.8rem; }
  .shelf > :only-child > * { grid-column: 1; }
  .shelf > :only-child h3 { font-size: clamp(1.5rem, 1.2rem + 1vw, 1.9rem); }
  .shelf > :only-child .meta { grid-column: 2; grid-row: 1 / span 3; justify-self: end; align-self: center; padding: 0; font-size: 1rem; }
}
@media (min-width: 68.75em) {
  /* under a guide the shelf lines up with the text column and fills it */
  .guide ~ .after { padding-left: calc(var(--rail) + var(--rail-gap)); }
  .guide ~ .after .shelf { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
}

/* a guide on the shelf: a paper card, the whole card the link */
.shelf-guide, .shelf-tool { position: relative; display: flex; flex-direction: column; padding: 1.5rem 1.5rem 1.35rem; border-radius: var(--r-l);
  transition: transform .25s var(--settle), box-shadow .25s; }
.shelf-guide { background: var(--card-2); color: var(--fg); box-shadow: inset 0 0 0 1px var(--hair), 0 1px 2px rgba(27,24,34,.04); }
.shelf-guide:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--hair-2), 0 22px 40px -26px rgba(27,24,34,.45); }
.shelf-guide .kind, .shelf-tool .kind { margin: 0 0 .6rem; font: 600 .98rem/1.3 var(--display); font-variant-caps: all-small-caps; letter-spacing: .09em; color: var(--link); }
.shelf-guide h3, .shelf-tool h3 { font-size: 1.32rem; line-height: 1.2; letter-spacing: -.01em; text-wrap: balance; }
.shelf-guide h3 a, .shelf-tool h3 a { color: inherit; text-decoration: none; }
.shelf-guide h3 a::after, .shelf-tool h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.shelf-guide p, .shelf-tool p { margin: .6rem 0 0; font: 400 1rem/1.55 var(--body); color: var(--fg-2); }
.shelf-guide .meta, .shelf-tool .meta { margin-top: auto; padding-top: 1.1rem; font: 400 .92rem/1.3 var(--body); color: var(--fg-3); }
.shelf-guide:has(a:focus-visible), .shelf-tool:has(a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.shelf-guide a:focus-visible, .shelf-tool a:focus-visible { outline: none; }

/* a tool on the shelf: a small night card in the lamplight */
.shelf-tool { --fg: var(--bone); --fg-2: var(--bone-2); --fg-3: var(--bone-3); --link: var(--lamp-hi); --accent: var(--lamp); --sub: var(--lamp);
  color: var(--fg); background: radial-gradient(90% 120% at 100% 0%, rgba(244,169,97,.16), rgba(244,169,97,0) 60%), var(--night-2);
  box-shadow: inset 0 0 0 1px rgba(214,208,255,.1), 0 18px 36px -24px rgba(11,14,26,.8); }
.shelf-tool:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(214,208,255,.18), 0 26px 44px -24px rgba(11,14,26,.85); }
.shelf-tool .meta { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; color: var(--lamp-hi); }
.shelf-tool .meta::after { content: "→"; font-weight: 400; transition: transform .2s var(--settle); }
.shelf-tool:hover .meta::after { transform: translateX(3px); }

/* the lantern (the download card) lives in site.css: guides, comparisons and tools share it */

/* ------------------------------------------------------------------ the indexes (/blog/, /compare/): the title on the band */
.page-top:has(.index-title)::after { content: ""; position: absolute; inset: 0; height: auto; z-index: -1; pointer-events: none;
  /* dark across the whole copy column (its width in rem, not a share of the window, so tablets keep the contrast), then
     feathered into the painting */
  background: linear-gradient(90deg, rgba(11,14,26,.86) 0, rgba(11,14,26,.74) calc(var(--gutter) + 40rem), rgba(11,14,26,0) calc(var(--gutter) + 56rem)), linear-gradient(rgba(11,14,26,0) 60%, rgba(11,14,26,.4)); }
@media (max-width: 40em) { .page-top:has(.index-title)::after { background: linear-gradient(rgba(11,14,26,.35), rgba(11,14,26,.72) 45%, rgba(11,14,26,.6)); } }
/* each index has its own painting: the guides the dawn trail with its waystones, the comparisons the hero's two
   halves (night on the left, the lit valley on the right) */
.page-top .band-dawn { object-position: 50% 100%; }
.page-top .band-split { object-position: 50% 88%; }
.index-title { position: relative; padding: clamp(1.5rem, 3.5vw, 2.25rem) 0 clamp(3rem, 6vw, 4.5rem); }
.shelf > .shelf-tool:only-child .meta { padding: .75rem 1.25rem; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(255,217,166,.4); }
.index-title .kicker { color: var(--lamp-hi); text-shadow: 0 1px 10px rgba(10,8,30,.6); }
.index-title h1 { max-width: 18ch; font-size: clamp(2.5rem, 1.4rem + 3.8vw, 4.1rem); line-height: 1; letter-spacing: -.028em; color: var(--bone); text-shadow: 0 4px 30px rgba(10,8,30,.55); }
.index-title .standfirst { max-width: 40rem; color: rgba(244,237,226,.88); text-shadow: 0 1px 14px rgba(10,8,30,.7); }
.shelf-nav { margin-top: 1.75rem; }
.shelf-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; }
.shelf-nav a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .5rem 1.05rem; border-radius: 999px; font: 600 .95rem/1.2 var(--body); color: var(--bone); text-decoration: none;
  background: rgba(11,14,26,.42); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgba(214,208,255,.45); transition: background-color .15s, box-shadow .15s; }
.shelf-nav a:hover { background: rgba(11,14,26,.6); box-shadow: inset 0 0 0 1px rgba(244,237,226,.45); }
.shelf-nav a:focus-visible { outline-color: var(--lamp); }
/* phones: a shorter masthead (the shelves come sooner) and the painting cropped to its sky, so the pills never sit
   on the trail's stones */
@media (max-width: 40em) {
  .index-title { padding: 1rem 0 2rem; }
  .index-title .standfirst { font-size: 1.05rem; line-height: 1.5; }
  .page-top .band-dawn { object-position: 50% 30%; }
  .shelf-nav { margin-top: 1.25rem; }
  .shelf-nav a { padding-inline: .9rem; }
}

.index-body { padding-top: clamp(2rem, 4.5vw, 3.25rem); }

/* the guide list: each shelf's name beside its guides; its newest guide first and wide */
.index-body:has(.catalogue) { display: grid; grid-template-columns: minmax(0, 1fr); }
.shelf-label { margin: 0; padding: clamp(1.75rem, 4vw, 2.5rem) 0 .5rem; border-top: 1px solid var(--hair); scroll-margin-top: calc(var(--head-h) + 1rem);
  font: 700 clamp(1.5rem, 1.25rem + .9vw, 1.9rem)/1.15 var(--display); letter-spacing: -.018em; color: var(--fg); text-wrap: balance; }
.shelf-label:first-of-type { border-top: 0; padding-top: 0; }
/* phones: the shelf's name as a small-caps label, so it can't compete with the guide title under it */
@media (max-width: 40em) { .shelf-label { font: 600 1.05rem/1.3 var(--display); font-variant-caps: all-small-caps; letter-spacing: .09em; color: var(--sub); } }
.catalogue { list-style: none; margin: 0 0 clamp(2.5rem, 5vw, 3.5rem); padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); column-gap: 2.5rem; }
.catalogue > li { position: relative; display: flex; flex-direction: column; padding: 1.4rem 0 1.5rem; border-top: 1px solid var(--hair); }
.catalogue .kind { margin: 0 0 .45rem; font: 600 .98rem/1.3 var(--display); font-variant-caps: all-small-caps; letter-spacing: .09em; color: var(--fg-3); }
.catalogue h2 { margin: 0; font-size: clamp(1.28rem, 1.15rem + .4vw, 1.45rem); line-height: 1.2; letter-spacing: -.012em; text-wrap: balance; }
.catalogue h2 a { color: var(--fg); text-decoration: none; }
.catalogue h2 a::after { content: ""; position: absolute; inset: 0; }
.catalogue > li:hover h2 a { color: var(--link); }
.catalogue p { margin: .5rem 0 0; font: 400 1.06rem/1.55 var(--display); color: var(--fg-2); }
.catalogue p a { position: relative; z-index: 1; }
.catalogue .meta { margin-top: auto; padding-top: .8rem; font: 400 .92rem/1.3 var(--body); color: var(--fg-3); }
.catalogue > li:has(a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.catalogue a:focus-visible { outline: none; }
/* the shelf's newest guide: across the row, larger */
.catalogue > li:first-child { grid-column: 1 / -1; padding-block: .6rem 1.9rem; border-top: 0; }
.catalogue > li:first-child h2 { font-size: clamp(1.7rem, 1.3rem + 1.5vw, 2.35rem); line-height: 1.1; letter-spacing: -.02em; max-width: 30ch; }
.catalogue > li:first-child p:not(.kind):not(.meta) { max-width: 40rem; font-size: clamp(1.1rem, 1.02rem + .3vw, 1.22rem); }
@media (min-width: 62.5em) {
  .index-body:has(.catalogue) { grid-template-columns: minmax(12rem, 17rem) minmax(0, 1fr); column-gap: clamp(2.5rem, 5vw, 5rem); }
  .shelf-label, .shelf-label:first-of-type { position: sticky; top: calc(var(--head-h) + 2rem); align-self: start; padding: 1.5rem 0 0; border-top: 1px solid var(--hair-2); }
  .catalogue { margin: 0 0 4rem; padding-top: 1.5rem; border-top: 1px solid var(--hair-2); }
  .catalogue > li:first-child { padding-top: 0; }
}

/* ------------------------------------------------------------------ high contrast, motion, print */
@media (forced-colors: active) {
  .read-progress { display: none; }
  .runes > li::before { border: 1px solid CanvasText; }
  .answer, .try, .toc, .ink-table, .sources, .shelf-guide, .shelf-tool, .lantern { border: 1px solid CanvasText; }
}
@media (prefers-reduced-motion: reduce) {
  .prose h2:target, .prose h3:target, .endmatter h2:target { animation: none; }
  .shelf-guide:hover, .shelf-tool:hover { transform: none; }
}
@media print {
  .read-progress, .toc, .after, .lantern, .reading .page-top, .margin-pet { display: none !important; }
  main.read { background: none; padding: 0; }
  .guide, .guide-head, .guide-body { display: block; width: auto; }
  .guide-head::after { display: none; }
  .prose { font-size: 11.5pt; color: #000; }
  .prose h2, .prose h3 { break-after: avoid; }
  .answer, .try, .pull, .ink-table, .faq-list > div { break-inside: avoid; box-shadow: none; border: 1px solid #999; }
  .prose a { color: #000; }
}
