/*
Theme Name: Folio & Spine
Theme URI: https://example.com/
Author: Daniel Davis Wood
Description: Single-page author site with snap-scrolling sections, turning book covers, reader sheets, a manuscript-assessment drawer with PayPal, and a contact form. Content lives in ordinary WordPress pages.
Version: 3.0.7
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: folio-spine
*/

/* ---------- tokens ---------- */
:root {
  --vh: 100svh; /* replaced by the measured visible height (site.js) */
  --ink: #16202B;
  --ink-soft: #4A5866;
  --paper: #F5F7F9;
  --card: #FFFFFF;
  --line: #D3DAE2;
  --edge: #9AA8B6;
  --cover: #E4E9EF;
  --accent: #2E5A86;
  --bubble: #E7EEF5;
  --veil: rgba(245, 247, 249, 0.72);
  --serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --display: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --sans: 'Jost', 'Helvetica Neue', Arial, sans-serif;
  --label-col: 150px;
  --nav-col: 72px;
  --bar: 64px;
  --navy: #1C2F4A;
  --navy-ink: #EEF2F6;
  --gap: 24px;
  --big-h: clamp(260px, calc(var(--vh) - var(--bar) - 170px), 430px);
  --big-w: calc(var(--big-h) * 2 / 3);
  --sm-h: calc((var(--big-h) - var(--gap)) / 2);
  --sm-w: calc(var(--sm-h) * 2 / 3);
  --ease: cubic-bezier(0.3, 0.1, 0.2, 1);
  --t: 0.5s;
}
@media (prefers-reduced-motion: reduce) { :root { --t: 0.01s; } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-snap-type: y mandatory; scroll-behavior: smooth; scroll-padding-top: var(--bar); scrollbar-gutter: stable; }
/* WordPress's toolbar stylesheet (logged-in only) sets its own scroll padding; keep the theme's. */
html:root { scroll-padding-top: var(--bar) !important; }
html.is-locked { overflow: hidden; }
body.folio { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 19px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: rgba(46, 90, 134, 0.3); transition: text-decoration-color 0.2s ease, color 0.2s ease; }
a:hover { color: var(--ink); text-decoration-color: currentColor; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.05; margin: 0; }
p { margin: 0 0 1em; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0.2em 20px 0; border: 1px solid var(--ink); background: transparent; color: var(--ink); font: 400 13px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--ink); color: #fff; }
.btn--fill { background: var(--ink); color: #fff; }
.btn--fill:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.small-label { font: 400 12px/1.3 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); margin: 0; }

/* ---------- sections ---------- */
.section { position: relative; min-height: calc(var(--vh) - var(--bar)); display: grid; grid-template-columns: var(--label-col) minmax(0, 1fr) var(--label-col); scroll-snap-align: start; scroll-snap-stop: always; }
.section__label { position: relative; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 72px; }
.section__label::before { content: ''; position: absolute; top: 72px; bottom: 72px; left: calc(50% + var(--spine-size) * 0.62); width: 1px; background: var(--edge); }
.section__label h2 { writing-mode: vertical-rl; transform: rotate(180deg); font: 200 var(--spine-size)/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; white-space: nowrap; }
.section__stage { grid-column: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(24px, 5svh, 48px); padding: 24px 5vw; min-width: 0; }
.section-intro { width: calc(var(--big-w) + 2 * var(--sm-w) + 3 * var(--gap)); max-width: 100%; font-size: 19px; line-height: 1.55; color: var(--ink-soft); }
.section-intro > :last-child { margin-bottom: 0; }
.section--editing-and-publishing .section-intro { width: calc(var(--big-w) + 2 * var(--sm-w) + 3 * var(--gap)); }

/* ---------- cluster: big slot + 2x2 small slots ---------- */
.cluster { display: grid; grid-template-columns: var(--big-w) var(--sm-w) var(--sm-w); grid-template-rows: var(--sm-h) var(--sm-h); gap: var(--gap); }
.cluster > .slot--big { grid-row: 1 / span 2; margin-right: var(--gap); width: var(--big-w); height: var(--big-h); }
.cluster .slot--small { width: var(--sm-w); height: var(--sm-h); }
.cluster .slot--wide { grid-column: span 2; height: var(--sm-h); }
.cluster--pair .slot--small { grid-row: 1 / span 2; align-self: center; }

.cover { position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; padding: 14px; width: 100%; height: 100%; border: 1px solid var(--edge); background: var(--cover); color: var(--ink); text-align: left; cursor: pointer; font: inherit; overflow: hidden; transition: opacity 0.35s var(--ease); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.cover * { pointer-events: none; }
.cover--forthcoming { border-style: dashed; }
.slot .cover, .shelf__cover { transition: opacity 0.35s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s ease; }
.slot .cover:hover, .shelf__cover:hover { transform: scale(1.03); box-shadow: 0 10px 24px rgba(22, 32, 43, 0.14); }
body.is-flipping .cover { transform: none; box-shadow: none; }
.cover__tag { position: relative; font: 400 11px/1.2 var(--sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); }
.cover__title { position: relative; font: 400 22px/1.1 var(--display); }
.slot--big .cover__title { font-size: 34px; }
.cover:has(img) .cover__title, .cover:has(img) .cover__tag { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }
.cover:has(img) .cover__flag { position: absolute; top: 10px; left: 10px; z-index: 1; background: var(--card); padding: 4px 8px; font: 400 11px/1.2 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; }
body.is-flipping .cover { opacity: 0.2; }
body.is-flipping .cover.is-source { opacity: 0; }

/* panel used for big slots that are not covers */
.panel { width: 100%; height: 100%; padding: 24px 28px; background: var(--card); border: 1px solid var(--edge); display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.panel__title { font: 400 30px/1 var(--display); }

/* recent work list */
.recent { overflow-y: auto; overscroll-behavior: contain; }
.recent ul, .recent ol { list-style: none; margin: 0; padding: 0; }
.recent li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 19px; line-height: 1.3; }
.recent a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;; text-decoration-color: rgba(46, 90, 134, 0.3); }
.recent a:hover { color: var(--ink); }

/* about */
.about { display: flex; gap: 72px; align-items: flex-start; max-width: 1080px; width: auto; }
.about__text { flex: 0 1 560px; min-width: 0; max-width: 560px; }
.about__text .lede { font-size: 21px; color: var(--ink-soft); }
.about__text .lede p:last-child { margin-bottom: 0; }
.about__side { width: min(340px, calc(var(--vh) - 360px)); min-width: 240px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }
.about__portrait { width: 100%; aspect-ratio: 1 / 1; background: var(--cover); overflow: hidden; border-radius: 14px; }
.about__portrait img { width: 100%; height: 100%; object-fit: cover; }
.support { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.support__btn { display: flex; align-items: center; justify-content: center; min-height: 44px; white-space: nowrap; padding: 0.2em 8px 0; border: 1px solid var(--edge); border-radius: 999px; font: 400 12px/1.2 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; text-align: center; color: var(--ink); text-decoration: none; }
.support__btn:hover { background: var(--navy); border-color: var(--navy); color: var(--navy-ink); }

/* manuscript demo */
.field { display: flex; flex-direction: column; gap: 6px; }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--edge); border-radius: 0; background: var(--card); font: 18px/1.4 var(--serif); color: var(--ink); }
.field textarea { padding: 10px 12px; resize: vertical; }
.field input[type=file] { border: 0; padding: 0; min-height: 0; font-size: 16px; }
.field__note { font-size: 14px; line-height: 1.4; color: var(--ink-soft); }
.price { display: flex; flex-direction: column; gap: 6px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.price__amount { font: 400 40px/1 var(--display); }
.price__detail { font-size: 16px; line-height: 1.45; color: var(--ink-soft); }
.panel .btn { width: 100%; margin-top: auto; }
[hidden] { display: none !important; }

/* personal notes window */
.window { width: 90%; height: min(90svh, 820px); background: var(--card); border: 1px solid var(--edge); display: flex; flex-direction: column; }
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); justify-items: center; padding: 84px 24px 28px; border-bottom: 1px solid var(--line); }
.tab { position: relative; }
.tab button { height: 52px; min-width: 88px; padding: 0 26px; border-radius: 999px; border: 1px solid transparent; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-soft); transition: background 0.2s ease, border-color 0.2s ease; }
.tab button:hover { background: var(--paper); }
.tab button[aria-selected=true] { background: var(--bubble); border-color: var(--edge); color: var(--ink); }
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.bubble { position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 9px 16px; background: var(--bubble); color: var(--ink); border: 1px solid var(--edge); font: 400 15px/1.2 var(--sans); letter-spacing: 0.04em; pointer-events: none; opacity: 0; transition: opacity 0.2s ease; }
.bubble::before, .bubble::after { content: ''; position: absolute; top: 100%; left: 50%; border: solid transparent; }
.bubble::before { margin-left: -8px; border-width: 8px; border-top-color: var(--edge); }
.bubble::after { margin-left: -7px; border-width: 7px; border-top-color: var(--bubble); }
.tab.is-active .bubble, .tab:hover .bubble, .tab:focus-within .bubble { opacity: 1; }
.tab:first-child .bubble { left: 0; transform: none; }
.tab:first-child .bubble::before, .tab:first-child .bubble::after { left: var(--tab-mid, 44px); }
.tab:last-child .bubble { left: auto; right: 0; transform: none; }
.tab:last-child .bubble::before, .tab:last-child .bubble::after { left: auto; right: var(--tab-mid, 44px); }
.tab:last-child .bubble::before { margin: 0 -8px 0 0; }
.tab:last-child .bubble::after { margin: 0 -7px 0 0; }
.tabs:hover .tab.is-active:not(:hover) .bubble { opacity: 0; }
.tabpanes { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 40px 64px; }
.tabpane .entry { max-width: 72ch; }
.tabpane { transition: opacity 0.22s ease; }
.tabpane.is-fading { opacity: 0; }
.intro-strip { padding-bottom: 24px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.intro-strip > :last-child { margin-bottom: 0; }
/* Intellectual Index: a horizontal A–Z strip fixed under the pills; only the entries beneath it scroll */
.tabpane--index:not([hidden]) { margin: -40px -64px; flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.az { flex: none; display: flex; flex-wrap: nowrap; justify-content: center; gap: 0; padding: 8px 16px; background: var(--card); border-bottom: 1px solid var(--line); overflow: hidden; }
.az .az__letter { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 22px; height: 32px; margin: 0; padding: 0.2em 5px 0; background: none; border: 0; border-bottom: 1px solid transparent; box-shadow: none; text-align: center; font: 400 13px/1 var(--sans); letter-spacing: 0.04em; color: var(--ink-soft); }
.az button.az__letter { cursor: pointer; }
.az button.az__letter:hover { color: var(--ink); }
.az button.az__letter[aria-current=true] { color: var(--ink); border-bottom-color: var(--ink); padding-left: 5px; box-shadow: none; }
.az button.az__letter:focus-visible { outline-offset: -2px; }
.az .az__letter.is-empty { color: var(--line); }
.az__panes { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 40px 64px 48px; }
.tabpane .az__panes .entry { max-width: none; }
.split { display: grid; grid-template-columns: minmax(160px, 20%) minmax(0, 1fr); gap: 40px; align-items: start; }
.submenu { position: sticky; top: 0; }
.submenu ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.submenu li { border-bottom: 1px solid var(--line); }
.sub-item { display: block; width: 100%; padding: 12px 0; background: none; border: 0; text-align: left; cursor: pointer; font: 400 15px/1.35 var(--sans); color: var(--ink-soft); }
.sub-item:hover { color: var(--ink); }
.sub-item[aria-current=true] { color: var(--ink); box-shadow: inset 2px 0 0 var(--ink); padding-left: 12px; }

.tabpane .entry { max-width: 70ch; }

/* contact */
.contact { width: min(736px, 100%); display: flex; flex-direction: column; gap: 24px; }
.contact h2 { font-size: 56px; }
.contact__intro { font-size: 20px; color: var(--ink-soft); }
.contact form { display: flex; flex-direction: column; gap: 16px; }
.contact .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.contact textarea { min-height: 200px; }
.notice { display: flex; flex-direction: column; gap: 20px; }
.notice h3 { font-size: 44px; }
.notice__body { padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 18px; }
.notice__body p:last-child { margin: 0; }
.notice__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.form-error { margin: 0; padding: 10px 14px; background: var(--paper); border: 1px solid var(--edge); font-size: 16px; }
.hp { position: absolute; left: -9999px; }



/* covers: large cover with adjoining text panel */
.flip-cover { position: fixed; z-index: 51; transition: left var(--t) var(--ease), top var(--t) var(--ease), width var(--t) var(--ease), height var(--t) var(--ease); }
.flip-cover__inner { position: absolute; inset: 0; transform-style: preserve-3d; transform: perspective(1600px) rotateY(0deg); transition: transform var(--t) var(--ease); }
.flip-cover.is-turned .flip-cover__inner { transform: perspective(1600px) rotateY(360deg); }
.flip-cover__face { position: absolute; inset: 0; border: 1px solid var(--edge); overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--cover); display: flex; align-items: flex-end; padding: 14px; font: 400 26px/1.1 var(--display); }
.flip-cover__face--back { transform: rotateY(180deg); background: #DCE3EA; }
.flip-cover__face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.flip-text { position: fixed; z-index: 50; background: var(--card); border: 1px solid var(--edge); border-right: 0; padding: 40px 36px 32px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; overscroll-behavior: contain; opacity: 0; transition: transform var(--t) var(--ease), opacity var(--t) ease; outline: none; }
.flip-text.is-open { opacity: 1; }
@media (max-width: 759px) { .flip-text { border-right: 1px solid var(--edge); border-top: 0; padding: 24px 22px; } }

/* Editing and publishing cards */
.card { display: flex; flex-direction: column; width: 100%; height: 100%; border: 1px solid var(--edge); background: var(--card); color: var(--ink); overflow: hidden; }
.card__logo { display: flex; align-items: center; justify-content: center; height: 40%; flex-shrink: 0; padding: 12px 18px 4px; }
.card__logo img { width: 100%; height: 100%; object-fit: contain; }
.card__name { font: 400 30px/1 var(--display); }
.card__logo { transition: opacity 0.2s ease; }
.card__logo:hover { opacity: 0.8; }
.card__text { flex: 1; min-height: 0; padding: 8px 18px 14px; font-size: 15px; line-height: 1.45; color: var(--ink-soft); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.card__text p { margin: 0 0 0.5em; }
.card__text p:last-child { margin-bottom: 0; }
.card__text a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px;; text-decoration-color: rgba(46, 90, 134, 0.3); }
.card__text a:hover { color: var(--ink); }
.panel__text { font-size: 15px; line-height: 1.45; color: var(--ink-soft); }
.panel__text p { margin: 0; }

/* ---------- Personal notes: special tabs ---------- */
.tab-intro { max-width: none !important; }
.tab-intro > :last-child { margin-bottom: 0; }
.tabpane .tab-intro + * { margin-top: 36px; }
.shelf { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 28px var(--gap); }
.shelf__cover { width: var(--sm-w); height: var(--sm-h); }
.slot-item { margin: 0; width: var(--sm-w); display: flex; flex-direction: column; gap: 10px; }
.slot-item figcaption { font-size: 15px; line-height: 1.45; color: var(--ink-soft); }
.slot-item figcaption strong { display: block; font-weight: 500; color: var(--ink); }
.slot-item--podcast { width: min(320px, 100%); }
.spotify { width: 100%; height: 152px; border: 0; border-radius: 12px; }
.subscribe { display: flex; flex-wrap: wrap; gap: 8px; }
.subscribe a { display: inline-flex; align-items: center; min-height: 36px; padding: 0.2em 14px 0; border: 1px solid var(--edge); border-radius: 999px; font: 400 12px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); text-decoration: none; }
.subscribe a:hover { background: var(--navy); border-color: var(--navy); color: var(--navy-ink); }

.hikemap { height: 420px; border: 1px solid var(--line); background: var(--paper); display: flex; align-items: center; justify-content: center; }
.hikemap.is-ready { display: block; }
.hikemap, .hikemap.maplibregl-map { border: 1px solid var(--line); box-sizing: border-box; }
.folio-pop .maplibregl-popup-content { border-radius: 10px; background: var(--card); color: var(--ink); box-shadow: 0 6px 24px rgba(22, 32, 43, 0.14); border: 1px solid var(--line); padding: 14px 16px; font: 15px/1.45 var(--serif); }
.folio-pop .maplibregl-popup-tip { border-top-color: var(--card); border-bottom-color: var(--card); }
.folio-pop .maplibregl-popup-close-button { font-size: 20px; width: 32px; height: 32px; color: var(--ink-soft); }
.folio-pop strong { font: 400 22px/1.1 var(--display); display: block; margin: 0 24px 4px 0; }
.folio-pop .meta { font: 400 11px/1.3 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.folio-pop p { margin: 8px 0 0; }
.folio-pop { animation: pop-in 0.2s ease; }
.folio-pop.is-leaving { opacity: 0; transition: opacity 0.2s ease; }
@keyframes pop-in { from { opacity: 0; } to { opacity: 1; } }
.maplibregl-popup { z-index: 3; }
.folio-pop--pinned .maplibregl-popup-content { width: 360px; max-width: 80vw; box-sizing: border-box; padding: 16px 18px 12px; }
.folio-pop--pinned strong { font-size: 19px; line-height: 1.15; }
/* the view is exactly nine lines of summary text; photos and the replay fill the same frame */
.pop-view { position: relative; margin-top: 10px; width: 100%; height: calc(9 * 15px * 1.5); overflow: hidden; }
.pop-view > * { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 0.25s ease; }
.pop-view .is-off { opacity: 0; pointer-events: none; }
.pop-view .pop-summary { overflow-y: auto; overscroll-behavior: contain; font-size: 15px; line-height: 1.5; padding-right: 4px; }
.pop-view .carousel { background: var(--paper); }
.pop-view .pop-summary p { margin: 0; }
.pop-view iframe { border: 0; }
.pop-close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; }
.pop-close svg { width: 12px; height: 12px; }
.pop-media { position: relative; margin-top: 12px; width: 100%; aspect-ratio: 16 / 9; background: var(--paper); overflow: hidden; }
.pop-media > * { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 0.25s ease; }
.pop-media .is-off { opacity: 0; pointer-events: none; }
.pop-media iframe { border: 0; }
.carousel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.35s ease; }
.carousel img.is-on { opacity: 1; }
.carousel button { position: absolute; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.85); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.carousel button svg { width: 14px; height: 14px; fill: none; stroke: var(--ink); stroke-width: 1.5; }
.carousel .prev { left: 8px; }
.carousel .next { right: 8px; }
.carousel .count { position: absolute; right: 8px; bottom: 6px; font: 400 11px/1 var(--sans); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.pop-links { display: flex; gap: 16px; margin-top: 8px; }
.pop-links button { background: none; border: 0; padding: 4px 0; font: 400 11px/1.2 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.pop-links button[disabled] { color: var(--ink-soft); text-decoration: none; cursor: default; }

/* in-window panel (Translations, Tarot book) */
.window { position: relative; overflow: hidden; }
.section--personal-notes { height: calc(var(--vh) - var(--bar)); }
.section--personal-notes .section__stage { padding-top: 24px; padding-bottom: 0; justify-content: flex-end; }
.section--personal-notes .window { height: calc(var(--vh) - var(--bar) - 24px); flex-shrink: 0; border-bottom: 1px solid var(--edge); }
.tabpanes { display: flex; flex-direction: column; }
.tabpane--hiking:not([hidden]) { display: flex; flex-direction: column; flex: 1 0 auto; min-height: 0; }
.tabpane--hiking .hikemap { flex: 1 1 auto; height: auto; min-height: 260px; }
.inpanel { position: absolute; left: 0; right: 0; bottom: 0; top: 0; z-index: 5; background: var(--card); border-top: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain; transform: translateY(100%); transition: transform var(--t) var(--ease); outline: none; }
.inpanel.is-open { transform: none; }
.inpanel-close { position: sticky; top: 8px; float: right; margin: 8px 8px 0 0; z-index: 2; background: var(--card); border-radius: 50%; }
.inpanel__body { padding: 40px 64px 72px; }
.annot { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 48px; }
body.folio .annot h3 { font-size: 44px; margin: 0 0 20px; }
.annot__notes { position: relative; }
.annot--book .annot__notes { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.annot__cover { width: 100%; max-width: 240px; height: auto; border: 1px solid var(--edge); }
.note { position: absolute; left: 0; right: 0; padding: 1px 6px 1px 12px; border-left: 2px solid var(--line); font: 400 14px/1.45 var(--sans); color: #8B98A6; transition: color 0.25s ease, border-color 0.25s ease; isolation: isolate; }
.note::before { content: ''; position: absolute; inset: 0; z-index: -1; background: #DCE6F0; transform: scaleX(0); transform-origin: left center; opacity: 0; transition: opacity 0.3s ease, transform 0s linear 0.3s; }
.note.is-hot { color: var(--ink); border-left-color: var(--edge); }
.note.is-hot::before { transform: scaleX(1); opacity: 1; transition: transform 0.35s var(--ease), opacity 0.1s ease; }
.annot mark, .annot .has-note { background: #EAF0F6; color: inherit; padding: 0 2px; border-radius: 2px; cursor: default; transition: background 0.3s ease; }
.annot mark.is-hot, .annot .has-note.is-hot { background: #DCE6F0; }
.note-bubble { position: absolute; z-index: 3; max-width: min(320px, 80vw); padding: 10px 14px; background: var(--bubble); border: 1px solid var(--edge); border-radius: 8px; font: 400 14px/1.45 var(--sans); color: var(--ink); box-shadow: 0 6px 18px rgba(22, 32, 43, 0.12); }


/* ---------- drawers and readers ---------- */
.sheet .entry h2 { font-size: 28px; }
.sheet .entry h3 { font-size: 23px; }
.sheet .entry h4 { font-size: 20px; }
.sheet .entry h2, .sheet .entry h3, .sheet .entry h4 { line-height: 1.2; margin: 1.1em 0 0.75em; }
.sheet .entry > :first-child { margin-top: 0; }

/* collapsible responses (details / summary) */
.entry details { margin: 0 0 1em; }
.entry summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.entry summary::-webkit-details-marker { display: none; }
.entry summary::before { content: ''; flex-shrink: 0; width: 0; height: 0; border-left: 9px solid var(--ink); border-top: 6px solid transparent; border-bottom: 6px solid transparent; transition: transform 0.3s var(--ease); }
.entry details[open]:not(.is-closing) > summary::before { transform: rotate(90deg); }
.entry details > :not(summary) { transition: opacity 0.3s ease; }
.entry details.is-closing > :not(summary), .entry details.is-opening > :not(summary) { opacity: 0; }
.entry details > summary + * { margin-top: 0.8em; }
.entry details > :not(summary) { font-size: 0.86em; margin-left: 2.2em; margin-right: 2.2em; }

/* Splice / 3:AM drawer: logo, website beside it, text full width beneath */
.reader.reader--brand { display: block; padding: 40px 96px 96px; }
.sheet__head.has-brand { height: auto; min-height: 64px; max-height: 128px; padding: 14px 16px 14px 96px; justify-content: flex-start; gap: 32px; }
.sheet__head .brand-head { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 32px; margin-right: 48px; }
.brand-logo { display: block; width: auto; height: auto; max-width: 45%; max-height: 96px; border: 0; }
.brand-url { font: 400 28px/1.1 var(--display); color: var(--accent); text-align: right; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.brand-url:hover { color: var(--ink); }
.reader--brand .entry { max-width: none; }

/* book reader card: the cover runs the full height on the left, only the text is padded */
.sheet--float .sheet__body { overflow: hidden; display: flex; }
.sheet--float .reader.reader--book { display: flex; align-items: stretch; gap: 0; padding: 0; width: 100%; height: 100%; }
.reader__cover { height: 100%; aspect-ratio: 2 / 3; flex-shrink: 0; overflow: hidden; background: var(--cover); }
.reader__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
body.folio .reader--book .reader__main h1 { font-size: 42px; line-height: 1.1; margin: 0 0 14px; }
/* the text fades out over the bottom of the card, as deep as the space above the title */
.reader--book .reader__main { flex: 1; min-width: 0; max-width: none; overflow-y: auto; overscroll-behavior: contain; padding: 44px 92px 88px 48px; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 44px), transparent); }
.reader--book .reader__main .entry { max-width: 68ch; }
.reader--book .reader__main > p:has(.btn) { margin: 0 0 24px; }
.sheet .reader--book .entry :is(h2, h3, h4, h5, h6) { margin: 0.25em 0 0; }
.sheet .reader--book .entry > :is(h2, h3, h4, h5, h6):first-child { margin-top: 0; }
.sheet .reader--book .entry :is(h2, h3, h4, h5, h6) + :not(h2):not(h3):not(h4):not(h5):not(h6) { margin-top: 1.4em; }

/* Hiking: map fills the window beneath the pills; a collapsible list panel on the left */
.tabpane--hiking:not([hidden]) { margin: -40px -64px; }
.hikewrap { position: relative; flex: 1 1 auto; min-height: 320px; overflow: hidden; }
.hikewrap .hikemap, .hikewrap .hikemap.maplibregl-map { position: absolute; inset: 0; height: auto; min-height: 0; border: 0; }
.hikepanel { position: absolute; z-index: 4; left: 0; top: 0; bottom: 0; width: 40%; display: flex; flex-direction: column; padding: 72px 28px 0; background: rgba(255, 255, 255, 0.97); border-right: 1px solid var(--line); transform: translateX(-100%); transition: transform 0.4s var(--ease); }
.hikewrap.is-panel-open .hikepanel { transform: none; }
.hikepanel .tab-intro { font-size: 17px; line-height: 1.55; padding-right: 44px; }
.hikepanel .tab-intro + * { margin-top: 20px; }
.hikelist { list-style: none; margin: 20px -28px 0; padding: 0; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); }
.hikelist li { border-bottom: 1px solid var(--line); }
.hikelist button { display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 12px 28px; background: none; border: 0; text-align: left; cursor: pointer; color: var(--ink); }
.hikelist button:hover, .hikelist button:focus-visible { background: var(--paper); }
.hikelist__title { font: 400 17px/1.3 var(--serif); }
.hikelist__meta { font: 400 11px/1.3 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.hikepanel-toggle { position: absolute; z-index: 5; top: 14px; left: calc(40% - 54px); width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--card); border: 1px solid var(--edge); border-radius: 50%; cursor: pointer; transition: left 0.4s var(--ease), background 0.2s ease; }
.hikewrap:not(.is-panel-open) .hikepanel-toggle { left: 14px; }
.hikepanel-toggle:hover { background: var(--paper); }
.hikepanel-toggle svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }

/* "About My …" button and its drop-down drawer */
.intro-toggle { display: inline-block; max-width: 100%; text-align: center; line-height: 1.5; padding: 0.25em 4px 0; min-height: 40px; background: none; border: 0; border-bottom: 1px solid var(--edge); font: 400 13px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); cursor: pointer; }
.intro-toggle:hover { border-bottom-color: var(--ink); }
.intro-toggle svg { display: inline-block; vertical-align: -1px; margin-left: 10px; }
.intro-toggle svg, .introdrawer__close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.introdrawer { position: fixed; z-index: 41; top: var(--bar); left: 0; right: 0; bottom: 0; overflow: hidden; pointer-events: none; }
.introdrawer__panel { position: absolute; top: 0; left: 50%; width: min(860px, calc(100vw - 2 * (var(--label-col) + 40px))); height: calc(100% - max(28px, (var(--vh) - var(--bar)) * 0.07)); display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--edge); border-top: 0; transform: translate(-50%, -102%); transition: transform var(--t) var(--ease); pointer-events: auto; }
.introdrawer.is-open .introdrawer__panel { transform: translate(-50%, 0); }
.introdrawer__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 44px 56px 56px; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 44px), transparent); }
.introdrawer__body > :first-child { margin-top: 0; }
.introdrawer__close { flex-shrink: 0; display: flex; align-items: center; justify-content: center; gap: 10px; height: 56px; background: none; border: 0; border-top: 1px solid var(--line); font: 400 13px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); cursor: pointer; padding-top: 0.2em; }
.introdrawer__close:hover { background: var(--paper); }
@media (max-width: 820px) { .introdrawer__panel { width: 100vw; height: 100%; border-left: 0; border-right: 0; border-bottom: 0; } .introdrawer__body { padding: 28px 20px 48px; } }

/* ---------- dot navigation ---------- */
.dots { position: fixed; right: 0; top: var(--bar); width: var(--label-col); pointer-events: none; height: calc(var(--vh) - var(--bar)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; z-index: 20; }
.dots a, .dots button { pointer-events: auto; display: flex; align-items: center; justify-content: center; width: 44px; height: 26px; background: none; border: 0; cursor: pointer; padding: 0; }
.dots .caret { height: 44px; }
.dots .caret svg { width: 28px; height: 16px; fill: none; stroke: var(--ink); stroke-width: 1.2; }
.dots .dot span { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--ink); }
.dots .dot[aria-current=true] span { background: var(--ink); }


/* ---------- header bar ---------- */
.bar { position: fixed; z-index: 30; top: 0; left: 0; right: 0; height: var(--bar); background: var(--navy); color: var(--navy-ink); display: flex; align-items: center; gap: 32px; padding: 0 28px; }
.bar a { color: var(--navy-ink); text-decoration: none; }
.bar__name { font: 400 24px/1 var(--display); white-space: nowrap; }
.bar__nav { position: absolute; left: 50%; transform: translateX(-50%); display: flex; justify-content: center; gap: 28px; }
.bar__nav a { font: 400 12px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; padding: 8px 0; border-bottom: 1px solid transparent; opacity: 0.78; white-space: nowrap; }
.bar__nav a:hover, .bar__nav a[aria-current=true] { opacity: 1; border-bottom-color: currentColor; }
.bar__social { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.bar__social--right { margin-left: auto; }
.bar__social a { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; opacity: 0.85; }
.bar__social a:hover { opacity: 1; }
.bar__social svg { width: 17px; height: 17px; fill: currentColor; }
.bar :focus-visible { outline-color: var(--navy-ink); }
.sections { padding-top: var(--bar); }
.bar__toggle { display: none; }
@media (max-width: 1180px) {
  .bar { flex-wrap: nowrap; justify-content: space-between; }
  .bar__social--left { order: 1; }
  .bar__toggle { order: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; position: relative; z-index: 1; width: 44px; height: 44px; padding: 0; margin: 0 auto; background: none; border: 0; cursor: pointer; }
  .bar__social--right { order: 3; margin-left: 0; }
  .bar__toggle span { display: block; width: 22px; height: 1px; background: var(--navy-ink); transition: transform 0.25s ease, opacity 0.25s ease; }
  .bar__toggle[aria-expanded=true] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .bar__toggle[aria-expanded=true] span:nth-child(2) { opacity: 0; }
  .bar__toggle[aria-expanded=true] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .bar__nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; transform: translateY(-6px); align-items: center; gap: 0; padding: 8px 0 16px; background: var(--navy); border-top: 1px solid rgba(238, 242, 246, 0.15); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s; }
  .bar__nav.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity 0.2s ease, transform 0.2s ease; }
  .bar__nav a { padding: 12px 0; }
}

/* ---------- headings: keep the theme's type even if other styles load ---------- */
body.folio h1, body.folio h2, body.folio h3 { font-family: var(--display); font-weight: 400; line-height: 1.05; letter-spacing: 0; text-transform: none; color: var(--ink); }
body.folio .about__text h1 { font-size: 64px; margin: 0 0 24px; }
body.folio .reader__main h1 { font-size: 56px; margin: 0 0 16px; }
body.folio .subpane h3 { font-size: 40px; margin: 0 0 20px; }
body.folio .contact h2 { font-size: 56px; }
body.folio .notice h3, body.folio .drawer__body h3 { font-size: 40px; }
body.folio { --spine-size: min(64px, calc((var(--vh) - var(--bar) - 112px) / (var(--spine-chars, 11) * 0.84))); }
body.folio .section__label h2 { font: 200 var(--spine-size)/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; }
body.folio .entry, body.folio .lede, body.folio .recent { font-family: var(--serif); }

/* ---------- overlays ---------- */
.veil { position: fixed; inset: 0; z-index: 40; background: var(--veil); opacity: 0; pointer-events: none; transition: opacity 0.4s ease; border: 0; padding: 0; width: 100%; }
.veil.is-on { opacity: 1; pointer-events: auto; cursor: pointer; }

.flip { position: fixed; z-index: 50; transform-style: preserve-3d; transition: left var(--t) var(--ease), top var(--t) var(--ease), width var(--t) var(--ease), height var(--t) var(--ease), transform var(--t) var(--ease); }
.flip__face { position: absolute; inset: 0; border: 1px solid var(--edge); backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.flip__front { background: var(--cover); display: flex; align-items: flex-end; padding: 14px; font: 400 26px/1.1 var(--display); }
.flip__front img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.flip__back { background: var(--card); transform: rotateY(180deg); padding: 40px 36px 32px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.flip.is-open { transform: rotateY(180deg); }
.back__quote { font-size: 19px; line-height: 1.55; margin: 0; }
.back__source { font-style: italic; font-size: 16px; color: var(--ink-soft); margin: 0; }
.back__actions { margin-top: auto; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.sheet { position: fixed; z-index: 45; left: 0; right: 0; margin: 0 auto; width: min(1232px, calc(100vw - 2 * (var(--label-col) + 40px))); top: calc(var(--bar) + 16px); bottom: 0; outline: none; background: var(--card); border: 1px solid var(--line); border-bottom: 0; display: flex; flex-direction: column; transform: translateY(105%); transition: transform var(--t) var(--ease); }
.sheet.is-open { transform: none; }
/* floating reader card (books) */
.sheet--float { --m: max(16px, calc((var(--vh) - var(--bar)) * 0.05)); top: calc(var(--bar) + var(--m)); bottom: var(--m); width: min(1160px, calc(100vw - 2 * (var(--label-col) + 40px))); border: 1px solid var(--edge); transform: perspective(2400px) translateY(calc(100vh + 40px)); }
.sheet--float.is-open { transform: perspective(2400px) rotateY(0deg); }
.sheet--float.is-turning { transition: transform calc(var(--t) * 0.5) ease-out; transform: perspective(2400px) rotateY(90deg); }
.sheet--float .sheet__head { position: absolute; top: 16px; right: 26px; height: auto; padding: 0; border: 0; z-index: 2; background: none; }

.sheet__head { height: 64px; flex-shrink: 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; padding: 0 16px; }
.close, .pop-close { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--card); border: 1px solid var(--edge); border-radius: 50%; cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease; }
.close:hover, .pop-close:hover { background: var(--paper); border-color: var(--ink); }
.close svg, .pop-close svg { width: 14px; height: 14px; fill: none; stroke: var(--ink); stroke-width: 1.4; }
.sheet__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 48px), transparent); }
.sheet--float .sheet__body { -webkit-mask-image: none; mask-image: none; }
.reader { display: flex; gap: 80px; padding: 56px 96px 96px; align-items: flex-start; }
.reader__aside { width: 280px; flex-shrink: 0; display: flex; flex-direction: column; gap: 20px; }
.reader__aside img { width: 100%; height: auto; border: 1px solid var(--edge); }
.reader__aside .btn { width: 100%; }
.reader__main { flex: 1; min-width: 0; max-width: 680px; }
.reader__main h1 { font-size: 56px; margin-bottom: 16px; }
.reader__main .small-label { margin-bottom: 28px; }
.entry { font-size: 21px; line-height: 1.65; }
.entry img { height: auto; }

.drawer { position: fixed; z-index: 45; left: 0; right: 0; margin: 0 auto; width: min(1232px, calc(100vw - 2 * (var(--label-col) + 40px))); top: calc(var(--bar) + 16px); bottom: 0; background: var(--card); border: 1px solid var(--line); border-bottom: 0; display: flex; flex-direction: column; transform: translateY(105%); transition: transform var(--t) var(--ease); }
.drawer.is-open { transform: none; }
.drawer__head { min-height: 64px; max-height: 128px; flex-shrink: 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 14px 16px 14px 96px; }
.drawer__head .brand-logo { max-height: 96px; max-width: 45%; }
.drawer__title { font: 400 28px/1.1 var(--display); }
.drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 40px 96px 96px; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 48px), transparent); }
.drawer__body > * { max-width: 680px; }
.drawer__body form { display: flex; flex-direction: column; gap: 16px; }
.drawer__body h3 { font-size: 40px; }
.summary { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.summary strong { font: 400 28px/1 var(--display); }
.pay-note { font-size: 15px; color: var(--ink-soft); margin: 0; }

/* ---------- standalone pages (not part of the one-page site) ---------- */
.standalone { max-width: 760px; margin: 0 auto; padding: 72px 24px 120px; }
.standalone h1 { font-size: 56px; margin: 24px 0; }
html.no-snap { scroll-snap-type: none; }

/* =====================================================================
   3.0 — desktop layout: no spine labels, a bottom strip of dots, cover
   rows with a reader card and dock, the masthead, the Lab, the Notebook
   ===================================================================== */
:root { --stage-x: max(4.5vw, 48px); }

/* ---------- sections use the full width ---------- */
.section { grid-template-columns: minmax(0, 1fr); }
.section__label { display: none; }
.section__stage { grid-column: 1; }
.section--fiction, .section--non-fiction, .section--editing-and-publishing, .section--lab, .section--personal-notes, .section--contact-me { height: calc(var(--vh) - var(--bar)); }
.section--editing-and-publishing .section__stage, .section--lab .section__stage, .section--personal-notes .section__stage, .section--contact-me .section__stage { justify-content: stretch; align-items: center; gap: 0; padding: 32px var(--stage-x) 58px; min-height: 0; }

/* ---------- menu: the active item's underline carries a caret ---------- */
.bar__nav a[aria-current=true] { border-bottom-color: transparent; }
.bar__nav a:hover { border-bottom-color: transparent; }
.bar__mark { position: absolute; top: calc(100% - 4px); left: 0; width: 0; height: 1px; background: var(--navy-ink); transition: transform 0.25s var(--ease); pointer-events: none; }
.bar__caret { position: absolute; top: calc(100% - 3px); left: 0; width: 0; height: 0; margin-left: -5px; border: 5px solid transparent; border-top: 6px solid var(--navy-ink); border-bottom: 0; transition: left 0.45s var(--ease); pointer-events: none; }
.bar__mark.is-off, .bar__caret.is-off { opacity: 0; }

/* ---------- dots: a strip along the bottom ---------- */
.dots { top: auto; right: auto; bottom: 0; left: 50%; width: auto; height: 52px; transform: translateX(-50%); flex-direction: row; gap: 0; transition: opacity 0.3s ease, transform 0.4s var(--ease); }
.dots a { width: 22px; height: 40px; }
body.is-carded .dots { opacity: 0; transform: translate(-50%, 24px); pointer-events: none; }
body.is-carded .dots a { pointer-events: none; }

/* ---------- "About My …": now at the foot of the section, arrow up ---------- */
.section--fiction .section__stage, .section--non-fiction .section__stage { justify-content: stretch; gap: 0; padding: 0 0 50px; min-height: 0; }
.section--fiction .intro-toggle, .section--non-fiction .intro-toggle { flex: none; margin: 0 0 6px; transition: opacity 0.3s ease, visibility 0.3s; }
body.is-carded .intro-toggle { opacity: 0; visibility: hidden; }

/* ---------- a row of covers, magnified like the Dock ---------- */
.crow { position: relative; flex: 1; min-height: 0; width: 100%; display: flex; }
.crow__scroller { flex: 1; display: flex; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.crow__scroller::-webkit-scrollbar { display: none; }
.crow__track { display: flex; align-items: center; gap: var(--g, 40px); min-width: 100%; width: max-content; padding: 0 var(--pad, 80px); }
.crow__track > .cv:first-of-type { margin-left: auto; }
.crow__track > .cv:last-of-type { margin-right: auto; }
.cv { position: relative; flex: none; width: 200px; height: 300px; padding: 0; border: 1px solid var(--edge); background: var(--cover); color: var(--ink); cursor: pointer; overflow: hidden; font: inherit; text-align: left; transition: opacity 0.35s ease; }
.cv img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.cv > * { pointer-events: none; }
.cv--forthcoming { border-style: dashed; }
.cv__title { position: absolute; inset: 0; padding: 10% 9%; display: flex; align-items: flex-end; font: 400 calc(var(--fs, 22px) * 1.1)/1.08 var(--display); }
.cv--panel { background: var(--card); }
.cv:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
body.is-carded .crow .cv { opacity: 0; }
.crow .cv.is-src { opacity: 0; transition: none; }
.crow__arr { position: absolute; top: 50%; z-index: 5; width: 44px; height: 64px; margin-top: -32px; padding: 0; background: none; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: opacity 0.3s ease; }
.crow__arr svg { width: 18px; height: 34px; fill: none; stroke: var(--ink); stroke-width: 1.2; }
.crow__arr--prev { left: 20px; }
.crow__arr--next { right: 20px; }
.crow__arr[hidden] { display: flex !important; opacity: 0; pointer-events: none; }

/* the panels: Non-Fiction archive and Podcasts (sized by --fs) */
.parch { position: absolute; inset: 0; display: flex; flex-direction: column; gap: calc(var(--fs, 26px) * 0.55); padding: 9% 8%; background: var(--card); color: var(--ink); border-top: calc(var(--fs, 26px) * 0.22) solid var(--navy); text-align: left; overflow: hidden; }
.parch__title { font: 300 calc(var(--fs, 26px) * 1.05)/1.02 var(--sans); letter-spacing: 0.01em; }
.parch__menu { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.mi { display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 0; padding: calc(var(--fs, 26px) * 0.22) 0 calc(var(--fs, 26px) * 0.18); background: none; border: 0; border-top: 1px solid var(--line); font: 400 calc(var(--fs, 26px) * 0.34)/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); text-align: left; }
button.mi { cursor: pointer; }
.mi svg { flex: none; width: calc(var(--fs, 26px) * 0.46); height: calc(var(--fs, 26px) * 0.3); fill: none; stroke: currentColor; stroke-width: 1.3; transition: transform 0.25s var(--ease); }
button.mi:hover, .mi.is-on { color: var(--ink); }
button.mi:hover svg { transform: translateX(4px); }
.mi.is-on svg, button.mi.is-on:hover svg { transform: translateX(10px); }
.azp { display: flex; flex-wrap: wrap; margin-top: calc(var(--fs, 26px) * -0.15); }
.azp button { width: calc(100% / 13); height: calc(var(--fs, 26px) * 0.66); padding: 0; background: none; border: 0; font: 400 calc(var(--fs, 26px) * 0.32)/1 var(--sans); color: var(--ink); text-align: left; cursor: pointer; }
.azp button:hover { color: var(--accent); }
.azp button:disabled { color: var(--line); cursor: default; }
.parch__foot { margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; gap: calc(var(--fs, 26px) * 0.14); }
.parch__foot small { font: 400 calc(var(--fs, 26px) * 0.26)/1.3 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: calc(var(--fs, 26px) * 0.1); }
.parch__pubs { display: flex; flex-wrap: wrap; align-items: center; gap: calc(var(--fs, 26px) * 0.2) calc(var(--fs, 26px) * 0.45); }
.vn { padding: 0; background: none; border: 0; color: #7A8794; font: 400 calc(var(--fs, 26px) * 0.46)/1.3 var(--serif); text-align: left; transition: color 0.2s ease, opacity 0.2s ease; }
.vn img { display: block; height: calc(var(--fs, 26px) * 0.62); width: auto; max-width: calc(var(--fs, 26px) * 5); object-fit: contain; filter: grayscale(1); opacity: 0.75; transition: opacity 0.2s ease, filter 0.2s ease; }
button.vn { cursor: pointer; }
button.vn:hover, .vn.is-on { color: var(--ink); }
button.vn:hover img, .vn.is-on img { opacity: 1; filter: none; }
.vn.is-dim { opacity: 0.4; }
.pis { display: flex; flex-wrap: wrap; gap: calc(var(--fs, 26px) * 0.28); }
.pi { width: calc(var(--fs, 26px) * 1.05); height: calc(var(--fs, 26px) * 1.05); flex: none; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--edge); border-radius: 50%; font: 500 calc(var(--fs, 26px) * 0.32)/1 var(--sans); color: var(--ink-soft); text-decoration: none; transition: color 0.2s ease, border-color 0.2s ease; }
.pi img { width: 62%; height: 62%; object-fit: contain; }
a.pi:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- the reader card and the dock beneath it ---------- */
.fcard { position: fixed; z-index: 45; display: flex; visibility: hidden; background: var(--card); border: 1px solid var(--edge); outline: none; clip-path: inset(0 var(--clip, 100%) 0 0); transition: clip-path var(--t) var(--ease); transform: perspective(2400px) rotateY(0deg); }
.fcard.is-shown { visibility: visible; }
.fcard__slot { position: relative; height: 100%; aspect-ratio: 2 / 3; flex: none; overflow: hidden; border-right: 1px solid var(--line); background: var(--cover); }
.fcard__slot > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fcard__slot .parch { --fs: var(--sfs, 44px); }
.fcard__main { flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: 44px 92px 72px 48px; transition: opacity 0.25s ease; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 44px), transparent); }
.fcard__main > .reader__main { max-width: none; padding: 0; overflow: visible; -webkit-mask-image: none; mask-image: none; }
.fcard .reader__main > h1, .fcard .reader__main > .small-label { display: none; }
.fcard .reader__main .entry { max-width: none; }
.fcard .reader__main > p:has(.btn) { margin: 0 0 24px; }
.fcard .entry :is(h2, h3, h4) { line-height: 1.2; margin: 1.1em 0 0.6em; }
.fcard__close { position: absolute; top: 16px; right: 26px; z-index: 3; }
.fcard--panel .fcard__slot { background: var(--card); }
.fflyer { position: fixed; z-index: 50; overflow: hidden; border: 1px solid var(--edge); background: var(--cover); transform: perspective(1600px) rotateY(0deg); transition: left var(--t) var(--ease), top var(--t) var(--ease), width var(--t) var(--ease), height var(--t) var(--ease), transform var(--t) var(--ease); }
.fflyer > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fflyer--panel { background: var(--card); }
.fflyer--tile { border: 0; background: none; overflow: visible; }
.fdock { position: fixed; z-index: 46; left: 50%; bottom: 18px; display: flex; align-items: flex-end; gap: 20px; transform: translate(-50%, calc(100% + 40px)); transition: transform 0.45s var(--ease); }
body.is-docked .fdock { transform: translate(-50%, 0); }
.fdock .cv { border-radius: 2px; transition: opacity 0.6s ease; }
.fdock .cv.is-cur { opacity: 0.32; cursor: default; pointer-events: none; }
.fdock .parch__menu, .fdock .parch__foot, .fdock .azp { display: none; }

/* the wall of covers (archive) and of episodes (podcasts) */
.wall { display: grid; grid-template-columns: repeat(var(--cols, 6), var(--tw, 140px)); gap: var(--rg, 28px) var(--cg, 24px); justify-content: space-between; }
.tile { align-self: start; will-change: transform; }
.tile__btn { display: block; width: 100%; padding: 0; background: none; border: 0; cursor: pointer; }
.pic { position: relative; display: block; aspect-ratio: 2 / 3; }
.pic--sq { aspect-ratio: 1; }
.pic .c { position: absolute; inset: 0; overflow: hidden; border: 1px solid var(--edge); background: var(--card); transition: transform 0.3s var(--ease); }
.pic .c img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile__btn:hover .pic .c { transform: translateY(-4px); }
.pic--pair .c { inset: auto; width: 86%; height: 86%; }
.pic--pair .c1 { left: 0; bottom: 0; z-index: 2; }
.pic--pair .c2 { right: 0; top: 0; }
.tile__btn:hover .pic--pair .c1 { transform: translate(-5%, 4%); }
.tile__btn:hover .pic--pair .c2 { transform: translate(5%, -4%); }
.ptext { position: absolute; inset: 0; padding: 10% 9%; display: flex; align-items: flex-end; font: 500 calc(var(--tw, 140px) * 0.1)/1.08 var(--display); color: var(--ink); text-align: left; }
.ep { position: absolute; inset: 0; padding: 9% 8%; display: flex; flex-direction: column; gap: 4%; background: var(--sc, #24395A); color: #F3ECDE; text-align: left; font-family: var(--display); }
.ep__series { font: 400 calc(var(--tw, 140px) * 0.034)/1.3 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; max-width: 62%; }
.ep__no { margin-top: auto; font: 400 calc(var(--tw, 140px) * 0.2)/1 var(--display); }
.ep__title { font: 400 calc(var(--tw, 140px) * 0.068)/1.25 var(--serif); }
.ep__pt { position: absolute; top: 7%; right: 7%; padding: 0.45em 0.8em 0.35em; border: 1px solid currentColor; border-radius: 999px; font: 400 calc(var(--tw, 140px) * 0.03)/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; }
.fcard__slot .pic, .fflyer .pic { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.fcard__slot .ep, .fflyer .ep { --tw: var(--slotw, 300px); }
.fcard__slot .ptext { font-size: 34px; }
.wall__empty { color: var(--ink-soft); }

/* reading a piece, or listening to an episode */
.rbar { position: sticky; top: -44px; z-index: 2; margin: -44px -92px 40px -48px; padding: 30px 30px 29px; background: var(--paper); border-bottom: 1px solid var(--line); }
.rback { margin: 0; padding: 0; background: none; border: 0; font: 400 12px/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); cursor: pointer; }
.rback:hover { color: var(--ink); }
body.folio .read h2 { font: 400 44px/1.08 var(--display); margin: 0 0 8px; }
.read__sub { font: italic 400 23px/1.35 var(--serif); color: var(--ink-soft); margin: 0 0 12px; }
.read__meta { font: 400 12px/1.5 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 30px; }
.read__links { display: flex; flex-wrap: wrap; gap: 10px 30px; margin: -12px 0 32px; }
.out { display: inline-block; font: 400 12px/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--edge); padding-bottom: 4px; }
.out:hover { border-color: var(--ink); }
.read .entry { max-width: 72ch; }
.read__wait { color: var(--ink-soft); }
.player { display: flex; align-items: center; gap: 18px; max-width: 680px; margin: 0 0 30px; padding: 14px 20px; border: 1px solid var(--line); }
.player audio { width: 100%; }
.listen { --fs: 38px; display: flex; align-items: center; gap: 18px; margin: -10px 0 32px; }
.listen small { font: 400 12px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.paidbox { display: flex; align-items: center; justify-content: space-between; gap: 24px; max-width: 680px; margin: 0 0 30px; padding: 16px 20px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft); }
.fcard__slot .slotpic { position: absolute; inset: 0; }

/* ---------- Editing and publishing: the masthead ---------- */
.mast { flex: 1; min-height: 0; width: 100%; max-width: 1760px; display: flex; flex-direction: column; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.mrow { display: flex; flex-direction: column; min-height: 0; }
.mrow + .mrow { border-top: 1px solid var(--line); }
.mrow.is-open { flex: 1; }
.mhead, .mbody { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: 56px; }
.mhead { align-items: center; padding: 22px 4px; cursor: pointer; outline-offset: -2px; }
.mhead__name { justify-self: stretch; text-align: center; display: flex; align-items: center; justify-content: center; }
.mhead__name img { display: block; width: 40%; height: auto; }
.mhead__title { font: 300 26px/1.15 var(--sans); }
.mhead__rt { display: flex; align-items: center; gap: 24px; }
.mhead__mid { flex: 1; display: grid; }
.mhead__mid > * { grid-area: 1 / 1; align-self: center; }
.mhead__blurb { font-size: 18px; line-height: 1.45; color: #2B3744; transition: opacity 0.3s ease, color 0.2s ease; }
.mrow.is-open .mhead__blurb { opacity: 0; pointer-events: none; }
.mrow:not(.is-open) .mhead:hover .mhead__blurb { color: var(--ink); }
.mhead__site { justify-self: start; font: 400 16px/1 var(--sans); letter-spacing: 0.02em; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--edge); padding-bottom: 3px; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.mrow.is-open .mhead__site { opacity: 1; pointer-events: auto; }
.mhead__site:hover { color: var(--ink); border-color: var(--ink); }
.mhead__arrow { flex: none; width: 16px; height: 10px; fill: none; stroke: var(--ink); stroke-width: 1.3; transition: transform 0.35s var(--ease); }
.mrow.is-open .mhead__arrow { transform: rotate(90deg); }
.mbody { flex: 1; min-height: 0; padding: 6px 4px 40px; animation: mbody-in 0.45s ease both; }
@keyframes mbody-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.mbody__side { min-height: 0; display: flex; flex-direction: column; }
.mbody__text { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 16px; font-size: 19px; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent); }
.mbody__text > :first-child { margin-top: 0; }
.mbody .ms-demo { align-self: start; height: auto; padding: 30px 32px; gap: 0; border-color: var(--edge); overflow: visible; }
.mbody .ms-demo .field { gap: 10px; }
.mbody .ms-demo .ms-words-field { margin-top: 14px; }
.mbody .ms-demo .price { margin: 22px 0; padding: 22px 0; gap: 10px; }
.mbody .ms-demo .price__amount { font-size: 46px; }
.mbody .ms-demo .btn { margin: 0; min-height: 52px; }
/* 3.0.7 desktop: the assessment box is sized like a Splice cover (2:3, never taller than the open row).
   Everything inside scales with the row's height, so a tall screen gets larger type rather than empty space. */
@media (min-width: 761px) and (orientation: landscape), (min-width: 1101px) {
  .mbody__side:has(> .ms-demo) { container-type: size; align-items: center; justify-content: center; }
  .mbody .ms-demo { flex: none; align-self: center; height: min(100cqh, 150cqw); width: auto; min-width: min(230px, 100cqw); max-width: 100cqw; aspect-ratio: 2 / 3; padding: clamp(14px, 6cqh, 40px) clamp(14px, 6cqh, 40px); justify-content: space-between; gap: clamp(8px, 2.5cqh, 20px); overflow: hidden; }
  .mbody .ms-demo .small-label { font-size: clamp(10px, 2.3cqh, 15px); letter-spacing: 0.12em; }
  .mbody .ms-demo .field { gap: clamp(4px, 1.2cqh, 10px); }
  .mbody .ms-demo .field select, .mbody .ms-demo .field input { min-height: clamp(30px, 8cqh, 60px); font-size: clamp(14px, 3.9cqh, 26px); padding: 0 clamp(6px, 1.6cqh, 14px); }
  .mbody .ms-demo .ms-words-field { margin-top: 0; }
  .mbody .ms-demo .field__note { font-size: clamp(11.5px, 3cqh, 18px); line-height: 1.3; }
  .mbody .ms-demo .price { margin: 0; padding: 0; border: 0; gap: clamp(4px, 1.4cqh, 12px); }
  .mbody .ms-demo .price__amount { font-size: clamp(28px, 12.5cqh, 88px); }
  .mbody .ms-demo .price__detail { font-size: clamp(12.5px, 4.3cqh, 27px); line-height: 1.35; }
  .mbody .ms-demo .btn { min-height: clamp(34px, 9.5cqh, 68px); font-size: clamp(11px, 2.6cqh, 17px); line-height: 1.2; letter-spacing: 0.12em; padding-inline: 10px; }
}
@container (max-height: 330px) {
  .mbody .ms-demo:has(.ms-words-field:not([hidden])) { gap: 6px; padding-block: 10px; }
  .mbody .ms-demo:has(.ms-words-field:not([hidden])) .field { gap: 3px; }
  .mbody .ms-demo:has(.ms-words-field:not([hidden])) .field select, .mbody .ms-demo:has(.ms-words-field:not([hidden])) .field input { min-height: 27px; }
  .mbody .ms-demo:has(.ms-words-field:not([hidden])) .price__amount { font-size: 24px; }
  .mbody .ms-demo:has(.ms-words-field:not([hidden])) .btn { min-height: 32px; }
  .mbody .ms-demo:has(.ms-words-field:not([hidden])) .field__note { display: none; }
}

/* Splice: covers fill the height, one centred with its neighbours peeking in */
.strip { position: relative; flex: 1; min-height: 0; display: flex; }
.lane { flex: 1; display: flex; align-items: center; gap: 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; scroll-snap-type: x mandatory; padding-inline: var(--inset, 0); -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
.lane::-webkit-scrollbar { display: none; }
.bk { position: relative; flex: none; width: var(--cw, 240px); height: var(--ch, 360px); scroll-snap-align: center; overflow: hidden; border: 1px solid var(--edge); background: var(--cover); color: var(--ink); text-decoration: none; transition: transform 0.25s var(--ease); }
.bk img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bk:hover { transform: translateY(-4px); }
.bk__title { position: absolute; inset: 0; padding: 10% 9%; display: flex; flex-direction: column; justify-content: space-between; font: 500 calc(var(--cw, 240px) * 0.075)/1.08 var(--display); text-transform: uppercase; }
.bk__title small { font: 400 10px/1.3 var(--sans); letter-spacing: 0.16em; }
.rib { position: absolute; z-index: 1; top: 26px; right: -46px; width: 180px; padding: 7px 0 6px; transform: rotate(45deg); background: var(--paper); color: var(--ink); font: 500 10px/1 var(--sans); font-style: normal; letter-spacing: 0.16em; text-transform: uppercase; text-align: center; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08); }
.sa, .va, .ca { position: absolute; z-index: 2; width: 36px; height: 36px; padding: 0; display: grid; place-items: center; background: var(--card); border: 1px solid var(--edge); border-radius: 50%; cursor: pointer; transition: opacity 0.25s ease; }
.sa svg, .ca svg { width: 9px; height: 14px; fill: none; stroke: var(--ink); stroke-width: 1.4; }
.va svg { width: 14px; height: 9px; fill: none; stroke: var(--ink); stroke-width: 1.4; }
.sa, .ca { top: 50%; margin-top: -18px; }
.sa--l { left: -18px; } .sa--r { right: -18px; }
.sa[hidden], .va[hidden], .ca[hidden] { display: grid !important; opacity: 0; pointer-events: none; }
.empty { color: var(--ink-soft); margin: 0; padding: 12px 2px; }
/* 3:AM: authors by surname, first name first; filter by year */
.years { display: flex; gap: 6px; flex: none; }
.years button { flex: 1 1 0; min-width: 0; white-space: nowrap; padding: 7px 4px 0.5em; background: var(--card); border: 1px solid var(--edge); border-radius: 999px; font: 400 12px/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); cursor: pointer; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease; }
.years button:hover { color: var(--ink); border-color: var(--ink); }
.years button[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.vwrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 36px; }
.va { left: 50%; margin-left: -18px; }
.va--u { top: -18px; } .va--d { bottom: -18px; }
.alist { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding-bottom: 30px; border-top: 1px solid var(--line); -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); }
.alist::-webkit-scrollbar { display: none; }
.ag { padding: 12px 2px; border-bottom: 1px solid var(--line); }
.ag__name { display: block; margin-bottom: 4px; font: 400 13px/1.5 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.st { display: grid; grid-template-columns: 52px 1fr; gap: 6px; padding: 2px 0; color: var(--ink); text-decoration: none; }
.alist.is-year .st { grid-template-columns: 1fr; }
.alist.is-year .st__yr { display: none; }
.st__yr { font: 400 12px/2.1 var(--sans); letter-spacing: 0.06em; color: var(--ink-soft); }
.st__ti { font: 400 17px/1.5 var(--serif); }
.st:hover .st__ti { text-decoration: underline; text-decoration-color: var(--edge); text-underline-offset: 3px; }
.st__ti::after { content: ' ↗'; font: 400 12px var(--sans); color: var(--ink-soft); }

/* ---------- Lab ---------- */
.lab { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; }
.lab__media { flex: 0 1 auto; min-height: 0; max-width: 100%; display: flex; justify-content: center; }
.lab__media video, .lab__media img { display: block; max-width: 100%; max-height: calc(var(--vh) - var(--bar) - 32px - 58px - 70px); width: auto; height: auto; background: var(--navy); border: 1px solid var(--edge); }
.lab__enter { flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0.25em 4px 0; border-bottom: 1px solid var(--edge); font: 400 13px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); text-decoration: none; }
.lab__enter:hover { color: var(--ink); border-bottom-color: var(--ink); }
.lab--bare .lab__enter { font-size: 15px; }
.labwin { position: fixed; z-index: 45; left: 0; right: 0; margin: 0 auto; top: calc(var(--bar) + 32px); bottom: 58px; width: min(1760px, calc(100vw - 2 * var(--stage-x))); display: flex; background: var(--card); border: 1px solid var(--edge); outline: none; transform: translateY(calc(100vh)); transition: transform var(--t) var(--ease); }
.labwin.is-open { transform: none; }
.labwin iframe { flex: 1; width: 100%; height: 100%; border: 0; }
.labwin__close { position: absolute; top: 16px; right: 26px; z-index: 2; }

/* ---------- Notebook ---------- */
.section--personal-notes .window { flex: 1; min-height: 0; width: 100%; max-width: 1760px; height: auto; border-bottom: 1px solid var(--edge); }
.tabs { display: flex; justify-content: center; align-items: center; gap: 48px; padding: 16px 24px; flex: none; }
.tab button { height: 50px; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.tab button:hover { color: var(--ink); }
.tab svg { flex: none; }
.tab__label { display: block; max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; font: 400 15px/1 var(--sans); letter-spacing: 0.04em; transition: max-width 0.4s var(--ease), margin 0.4s var(--ease), opacity 0.3s ease; }
.tab button[aria-selected=true] .tab__label { max-width: 220px; margin-left: 12px; opacity: 1; }
.tabs .bubble, .tabs .tab:first-child .bubble, .tabs .tab:last-child .bubble { top: calc(100% + 9px); bottom: auto; left: 50%; right: auto; transform: translate(-50%, -4px); padding: 6px 11px 5px; background: var(--paper); border: 0; border-radius: 8px; font: 400 12px/1.2 var(--sans); letter-spacing: 0.06em; z-index: 20; transition: opacity 0.2s ease, transform 0.2s ease; }
.tabs .bubble::before { display: none; }
.tabs .bubble::after, .tabs .tab:first-child .bubble::after, .tabs .tab:last-child .bubble::after { top: auto; bottom: 100%; left: 50%; right: auto; margin: 0 0 0 -6px; border-width: 6px; border-top-color: transparent; border-bottom-color: var(--paper); }
.tabs .tab.is-active .bubble, .tabs .tab:hover .bubble, .tabs .tab:focus-within .bubble { opacity: 0; }
.tabs .tab:not(.is-active):hover .bubble, .tabs .tab:not(.is-active):focus-within .bubble { opacity: 1; transform: translate(-50%, 0); }
.tabpane--intro .entry { max-width: 76ch; margin: auto; }
.tabpane--intro:not([hidden]) { flex: 1 0 auto; display: flex; }
.tabpane--intro .entry > p:first-child { font: 400 26px/1.4 var(--display); color: var(--ink); }
/* Translations: covers (25%) | text (75%) */
.tabpane--translations:not([hidden]), .tabpane--tarot:not([hidden]) { margin: -40px -64px; flex: 1 1 0; min-height: 0; display: flex; }
.trx { flex: 1; min-height: 0; display: grid; grid-template-columns: 25% 75%; }
.trx__covers { container-type: inline-size; position: relative; min-height: 0; display: flex; border-right: 1px solid var(--line); }
.covers { flex: 1; display: grid; grid-template-columns: minmax(0, 220px); justify-content: center; align-content: start; gap: 26px; overflow-y: auto; scrollbar-width: none; padding: 28px 28px 40px; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent); }
.covers::-webkit-scrollbar { display: none; }
.cov { display: block; padding: 0; background: none; border: 0; cursor: pointer; }
.cov__pic { position: relative; display: block; aspect-ratio: 2 / 3; overflow: hidden; border: 1px solid var(--edge); background: var(--cover); opacity: 0.6; transition: opacity 0.2s ease, transform 0.25s var(--ease); }
.cov__pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cov__title { position: absolute; inset: 0; padding: 9%; display: flex; align-items: flex-end; font: 500 15px/1.05 var(--display); text-transform: uppercase; }
.cov:hover .cov__pic { opacity: 0.9; transform: translateY(-3px); }
.cov[aria-pressed=true] .cov__pic { opacity: 1; outline: 1px solid var(--ink); outline-offset: 3px; }
.trx__covers .ca { display: none; }
/* a wide covers column: a sideways carousel, the chosen cover centred, its neighbours fading at the edges */
@container (min-width: 400px) {
  .covers { display: flex; align-items: center; gap: 18px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; padding: 0 calc((100cqw - 62cqw) / 2); -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
  .cov { flex: none; width: 62cqw; scroll-snap-align: center; }
  .cov__title { font-size: 22px; }
  .trx__covers .ca { display: grid; }
  .ca--l { left: 10px; } .ca--r { right: 10px; }
}
.trx__text { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 40px 20px 48px 48px; transition: opacity 0.22s ease; }
.trx__text.is-fading { opacity: 0; }
.trx__lead, .trx__lead .entry, .trtext .annot__text { max-width: none; }
.trtext.annot { display: block; }
.trtext .entry { max-width: none; }
.annot .has-note { background: var(--bubble); border-bottom: 1px dotted var(--edge); cursor: help; }
/* 3.0.7 Notes switch on each translation: it sits in its own gutter to the right of the text */
.trtext { padding-right: 64px; }
.trtog { position: sticky; top: 0; z-index: 2; float: right; width: 48px; margin: 0 -64px 0 16px; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 8px 0; border: 0; border-radius: 10px; background: var(--paper); color: var(--ink-soft); font: 400 10px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; }
.trtog:hover { color: var(--ink); }
.trtog__sw { position: relative; width: 36px; height: 16px; border-radius: 8px; background: var(--edge); transition: background 0.2s ease; }
.trtog__sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform 0.2s var(--ease); }
.trtog[aria-checked="true"] .trtog__sw { background: var(--ink); }
.trtog[aria-checked="true"] .trtog__sw::after { transform: translateX(20px); }
/* Off: only the colour goes, so no line rewraps */
.trtext.notes-off mark, .trtext.notes-off .has-note { background: transparent; border-bottom-color: transparent; cursor: inherit; }
.notetip { position: fixed; z-index: 70; left: 0; top: 0; width: max-content; max-width: 340px; padding: 12px 16px; background: var(--bubble); color: var(--ink); border: 1px solid var(--edge); font: 400 15px/1.45 var(--serif); pointer-events: none; opacity: 0; transform: translateY(calc(-100% - 12px)); transition: opacity 0.2s ease; }
.notetip.is-on { opacity: 1; }
.notetip::before, .notetip::after { content: ''; position: absolute; top: 100%; left: var(--ax, 50%); border: solid transparent; }
.notetip::before { margin-left: -8px; border-width: 8px; border-top-color: var(--edge); }
.notetip::after { margin-left: -7px; border-width: 7px; border-top-color: var(--bubble); }
/* Tarot: chapbook over podcast (25%) | text */
.tt { flex: 1; min-height: 0; display: grid; grid-template-columns: 25% minmax(0, 1fr); }
.tt__side { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.tt__item { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 22px 28px; }
.tt__item + .tt__item { border-top: 1px solid var(--line); }
.tt__cvr { display: block; width: min(100%, 200px, calc((var(--vh) - 480px) * 0.44)); height: auto; aspect-ratio: 2 / 3; object-fit: cover; border: 1px solid var(--edge); }
.tt__cvr--sq { aspect-ratio: 1; width: min(100%, 150px, calc((var(--vh) - 480px) * 0.28)); }
.tt__cvr--blank { display: flex; align-items: flex-end; padding: 9px; background: var(--cover); font: 500 14px/1.05 var(--display); text-transform: uppercase; }
.tt__buy { font: 400 12px/1.3 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--edge); padding-bottom: 3px; }
.tt__buy:hover { color: var(--ink); border-color: var(--ink); }
.tt .pis { --fs: 38px; justify-content: center; }
.tt__text { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 34px 40px; border-left: 1px solid var(--line); max-width: none !important; }
.tt__text > * { max-width: 76ch; }
.tt__text h3 { font-size: 30px; line-height: 1.1; margin: 0 0 14px; }
/* Hiking: the list panel takes a quarter; its text stays inside it and fades as it closes */
.hikepanel { width: 25%; transition: transform 0.4s var(--ease), opacity 0.3s ease; }
.hikewrap:not(.is-panel-open) .hikepanel { opacity: 0; }
.hikepanel-toggle { left: calc(25% - 54px); }
.hikelist__title, .hikelist__meta { overflow-wrap: anywhere; }
.pop-links { justify-content: center; gap: 16px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.pop-links button { width: 38px; height: 34px; padding: 0; display: grid; place-items: center; border-radius: 8px; text-decoration: none; color: var(--ink-soft); transition: background 0.2s ease, color 0.2s ease; }
.pop-links button:hover, .pop-links button:focus-visible { background: var(--paper); color: var(--ink); }
.pop-links button[disabled] { color: var(--ink); }
.pop-links svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }

/* ---------- Contact: the same form, larger ---------- */
.contact { flex: 1; min-height: 0; width: min(1100px, 100%); }
.contact form { flex: 1; min-height: 0; gap: 22px; }
.contact .row { grid-template-columns: minmax(0, 1fr); gap: 22px; }
.contact .field .small-label { font-size: 13px; }
.contact .field input, .contact .field textarea { font-size: 21px; padding: 14px 18px; }
.contact form > .field:has(textarea) { flex: 1; min-height: 0; }
.contact textarea { flex: 1; min-height: 140px; resize: none; }
.contact .btn { min-height: 56px; padding: 0.2em 56px 0; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  .bar__mark, .bar__caret, .fdock, .dots, .mbody { transition: none; animation: none; }
}

/* ---------- phones and portrait tablets: one stacked column, ordinary scrolling ---------- */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1100px) {
  html { scroll-snap-type: none; }
  :root { --gap: 16px; --nav-col: 0px; }
  .dots { display: none; }
  .section { min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; scroll-snap-align: none; scroll-snap-stop: normal; }
  .section__label { border-right: 0; border-bottom: 1px solid var(--line); justify-content: flex-start; padding: 40px 32px 16px; }
  .section__label::before { display: none; }
  body.folio .section__label h2 { writing-mode: horizontal-tb; transform: none; font-size: 40px; white-space: normal; }
  .section__stage { grid-column: auto; justify-content: flex-start; padding: 32px 32px 56px; }

  /* about */
  .about { flex-direction: column; align-items: stretch; gap: 32px; width: 100%; }
  .about__text { max-width: none; flex: none; }
  .about__side { width: 100%; max-width: 420px; min-width: 0; }

  /* covers: all the same size, in a grid */
  .cluster { --cols: 3; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); width: 100%; max-width: 680px; }
  .cluster > .slot, .cluster > .slot--big, .cluster .slot--small, .cluster--pair .slot--small { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); grid-row: auto; grid-column: auto; align-self: start; width: auto; height: auto; margin: 0; aspect-ratio: 2 / 3; }
  .cluster .cover { height: 100%; }
  /* Non-fiction: the Recent work panel runs full width above the books */
  .cluster--pair > .slot--big { flex-basis: 100%; aspect-ratio: auto; }
  .cluster--pair > .slot--big .panel { height: auto; }
  /* Editing and publishing: one column of panels */
  .cluster--editing { max-width: 560px; }
  .cluster--editing > .slot, .cluster--editing > .slot--big, .cluster--editing .slot--wide { flex-basis: 100%; aspect-ratio: auto; width: 100%; height: auto; }
  .cluster--editing > .slot--big .panel { height: auto; }
  .cluster--editing .card { height: auto; }
  .cluster--editing .card__logo { height: 96px; }
  .cluster--editing .card__text { overflow: visible; }
  .cluster--single > .slot--big { margin: 0; }

  /* personal notes: a full-height window, five pills on one row */
  .section--personal-notes { height: auto; }
  .section--personal-notes .section__stage { padding: 24px 16px 32px; justify-content: flex-start; }
  .section--personal-notes .window { width: 100%; height: calc(var(--vh) - var(--bar) - 48px); min-height: 480px; border-bottom: 1px solid var(--edge); }
  .tabs { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: minmax(0, 1fr); gap: 0; padding: 60px 8px 16px; --tab-mid: 28px; }
  .tab button { min-width: 0; width: 56px; padding: 0; height: 44px; }
  .bubble { font-size: 13px; padding: 7px 12px; bottom: calc(100% + 10px); }
  .tabpanes { padding: 28px 24px; }
  .tabpane--index:not([hidden]) { margin: -28px -24px; }
  .tabpane--hiking:not([hidden]) { margin: -28px -24px; }
  .az__panes { padding: 28px 24px 40px; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .submenu { position: static; }
  .submenu ul { display: flex; gap: 8px 18px; flex-wrap: wrap; border: 0; }
  .submenu li { border: 0; }
  .sub-item { padding: 6px 0; }
  .sub-item[aria-current=true] { box-shadow: inset 0 -1px 0 var(--ink); padding-left: 0; }
  .annot { grid-template-columns: minmax(0, 1fr); }
  .annot__notes .note { display: none; }
  .inpanel__body { padding: 28px 24px 56px; }
  .hikepanel { width: 70%; }
  .hikepanel-toggle { left: calc(70% - 54px); }

  /* contact */
  .contact { width: 100%; }

  /* drawers and readers use the full width */
  .sheet, .drawer, .sheet--float { width: 100vw; left: 0; right: 0; top: calc(var(--bar) + 8px); bottom: 0; }
  .reader { flex-direction: column; gap: 28px; padding: 32px 28px 72px; }
  .reader.reader--brand { padding: 28px 28px 56px; }
  .sheet__head.has-brand, .drawer__head { padding-left: 28px; }
  .sheet--float .reader.reader--book { flex-direction: column; overflow-y: auto; }
  .sheet--float .sheet__body { overflow-y: auto; }
  .reader__cover { height: 46vh; aspect-ratio: auto; width: 100%; }
  .reader--book .reader__main { overflow: visible; padding: 28px 28px 48px; -webkit-mask-image: none; mask-image: none; }
  .drawer__body { padding: 28px 28px 56px; }
}

/* ---------- phones ---------- */
@media (max-width: 520px) {
  .section__label { padding: 32px 20px 14px; }
  body.folio .section__label h2 { font-size: 32px; }
  .section__stage { padding: 24px 20px 48px; }
  body.folio .about__text h1 { font-size: 44px; }
  body.folio .reader__main h1 { font-size: 34px; }
  body.folio .subpane h3 { font-size: 30px; }
  body.folio .annot h3 { font-size: 30px; }
  .cluster { --cols: 2; }
  .intro-toggle { font-size: 12px; letter-spacing: 0.1em; }
  .section--personal-notes .section__stage { padding: 16px 8px 24px; }
  .tabs { padding: 54px 4px 12px; --tab-mid: 22px; }
  .tab button { width: 44px; height: 40px; }
  .tab svg { width: 20px; height: 20px; }
  .tabpanes { padding: 24px 18px; }
  .tabpane--index:not([hidden]), .tabpane--hiking:not([hidden]) { margin: -24px -18px; }
  .az { flex-wrap: wrap; padding: 6px 8px; }
  .az .az__letter { min-width: 24px; height: 30px; padding: 0.2em 3px 0; }
  .az__panes { padding: 24px 18px 40px; }
  .hikepanel { width: 86%; }
  .hikepanel-toggle { left: calc(86% - 54px); }
  .contact .row { grid-template-columns: minmax(0, 1fr); }
  body.folio .contact h2 { font-size: 40px; }
  .entry { font-size: 19px; }
  .reader, .reader.reader--brand { padding: 24px 20px 64px; }
  .reader--book .reader__main, .drawer__body { padding: 24px 20px 48px; }
  .sheet__head.has-brand, .drawer__head { padding-left: 20px; }
  .sheet__head .brand-head { gap: 12px; margin-right: 12px; }
  .brand-logo, .drawer__head .brand-logo { max-height: 56px; }
  .brand-url { font-size: 18px; }
  .flip__back { padding: 28px 24px; }
}

/* ---------- 3.0 on phones and portrait tablets: not redesigned yet, so everything stacks ---------- */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1100px) {
  .section__label { display: flex; }
  .section--fiction, .section--non-fiction, .section--editing-and-publishing, .section--lab, .section--personal-notes, .section--contact-me { height: auto; }
  .section--fiction .section__stage, .section--non-fiction .section__stage, .section--editing-and-publishing .section__stage, .section--lab .section__stage, .section--contact-me .section__stage { padding: 32px 32px 56px; gap: 28px; justify-content: flex-start; align-items: center; }
  .section--personal-notes .section__stage { padding: 24px 16px 32px; }
  .bar__mark, .bar__caret { display: none; }
  .bar__nav a[aria-current=true] { border-bottom-color: currentColor; }
  /* covers: a grid, as before; books turn to their short card */
  .crow { flex: none; }
  .crow__scroller { overflow: visible; }
  .crow__track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); width: 100%; min-width: 0; max-width: 680px; margin: 0 auto; padding: 0; }
  .crow__track > .cv:first-of-type, .crow__track > .cv:last-of-type { margin: 0; }
  .crow .cv { width: auto !important; height: auto !important; aspect-ratio: 2 / 3; --fs: 15px !important; }
  .crow__arr { display: none !important; }
  .section--fiction .intro-toggle, .section--non-fiction .intro-toggle { order: -1; }
  .fcard { inset: calc(var(--bar) + 8px) 0 0 0 !important; width: auto !important; height: auto !important; flex-direction: column; overflow-y: auto; }
  .fcard__slot { height: 46vh; width: 100%; aspect-ratio: auto; flex: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .fcard__main { overflow: visible; padding: 28px 24px 48px; -webkit-mask-image: none; mask-image: none; }
  .rbar { margin: -28px -24px 28px; padding: 20px 24px; top: 0; }
  .fdock { display: none; }
  /* masthead: one column */
  .mast { width: 100%; }
  .mhead, .mbody { grid-template-columns: minmax(0, 1fr); row-gap: 14px; }
  .mhead__name { justify-self: start; }
  .mbody__text { overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .strip { min-height: 360px; }
  .alist { max-height: 60vh; }
  /* Lab */
  .lab__media video, .lab__media img { max-height: 60vh; }
  .labwin { top: calc(var(--bar) + 8px); bottom: 0; width: 100vw; }
  /* Notebook */
  .section--personal-notes .window { height: calc(var(--vh) - var(--bar) - 48px); flex: none; }
  .tabs { gap: 8px; padding: 12px 8px; }
  .tab button[aria-selected=true] .tab__label { display: none; }
  .tabpane--translations:not([hidden]), .tabpane--tarot:not([hidden]) { margin: -28px -24px; }
  .trx, .tt { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .trx__covers { border-right: 0; border-bottom: 1px solid var(--line); }
  .covers { display: flex; overflow-x: auto; padding: 16px; gap: 14px; -webkit-mask-image: none; mask-image: none; }
  .cov { flex: none; width: 90px; }
  .trx__text, .tt__text { padding: 24px; border-left: 0; }
  .trtext { padding-right: 0; }
  .trtog { display: none; }
  .tt__side { flex-direction: row; justify-content: center; border-bottom: 1px solid var(--line); }
  .tt__item + .tt__item { border-top: 0; }
  .tt__cvr { width: 110px; } .tt__cvr--sq { width: 110px; }
  .hikepanel { width: 70%; } .hikepanel-toggle { left: calc(70% - 54px); }
  /* contact */
  .contact { flex: none; }
  .contact .field input, .contact .field textarea { font-size: 18px; padding: 10px 12px; }
}
@media (max-width: 520px) {
  .crow__track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hikepanel { width: 86%; } .hikepanel-toggle { left: calc(86% - 54px); }
}
@media (max-width: 1180px) {
  .bar__mark, .bar__caret { display: none; }
  .bar__nav a[aria-current=true] { border-bottom-color: currentColor; }
}
