/*
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: 2.7.1
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: folio-spine
*/

/* ---------- tokens ---------- */
:root {
  --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(300px, calc(100svh - 360px), 480px);
  --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; }
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); }
a:hover { color: var(--ink); }
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(100svh - var(--bar)); display: grid; grid-template-columns: var(--label-col) minmax(0, 1fr) var(--nav-col); scroll-snap-align: start; }
.section__label { border-right: 1px solid var(--line); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 72px; }
.section__label h2 { writing-mode: vertical-rl; transform: rotate(180deg); font: 200 var(--label-size, 64px)/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; white-space: nowrap; }
.section__stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 48px 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; }
.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; }
.recent a:hover { color: var(--ink); }

/* about */
.about { display: flex; gap: 72px; align-items: flex-start; max-width: 1080px; width: 100%; }
.about__text { flex: 1; 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(100svh - 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; padding: 0.2em 12px 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; }
.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; }
.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); }
.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: 52%; padding: 14px 18px 6px; }
.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; padding: 6px 18px 14px; font-size: 16px; line-height: 1.45; color: var(--ink-soft); overflow: hidden; }
.card__text p { margin: 0; }
.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: min(62svh, 560px); border: 1px solid var(--line); background: var(--paper); display: flex; align-items: center; justify-content: center; }
.hikemap.is-ready { display: block; }
.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; } }
.folio-pop--pinned .maplibregl-popup-content { width: 360px; max-width: 80vw; box-sizing: border-box; padding: 16px 18px 14px; }
.pop-close { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; }
.pop-close svg { width: 14px; height: 14px; fill: none; stroke: var(--ink); stroke-width: 1.4; }
.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; }
.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); }

/* ---------- dot navigation ---------- */
.dots { position: fixed; right: 0; top: var(--bar); width: var(--nav-col); height: calc(100svh - var(--bar)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; z-index: 20; }
.dots a, .dots button { 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 { flex: 1; 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 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: 1100px) {
  .bar { flex-wrap: nowrap; justify-content: space-between; }
  .bar__toggle { display: flex; flex-direction: column; justify-content: center; gap: 5px; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; padding: 0 11px; background: none; border: 0; cursor: pointer; }
  .bar__toggle span { display: block; 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; 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 .section__label h2 { font: 200 var(--label-size, 64px)/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; gap: 12px; flex-wrap: wrap; }

.sheet { position: fixed; z-index: 45; left: 0; right: 0; margin: 0 auto; width: min(1232px, calc(100vw - 48px)); 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; }
.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 { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; }
.close svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.2; }
.sheet__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.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; top: 0; right: 0; width: min(620px, 100vw); height: 100svh; background: var(--card); border-left: 1px solid var(--line); display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.45s var(--ease); }
.drawer.is-open { transform: none; }
.drawer__head { height: 72px; flex-shrink: 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 16px 0 40px; }
.drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 32px 40px 48px; }
.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; }

/* ---------- small screens ---------- */
@media (max-width: 820px), (max-height: 620px) {
  html { scroll-snap-type: y proximity; }
}
@media (max-width: 820px) {
  .bar { padding: 0 8px 0 20px; }
  .bar__name { font-size: 21px; }
}
@media (max-width: 520px) {
  .bar__name { font-size: 17px; }
  body.folio .about__text h1 { font-size: 44px; }
  body.folio .reader__main h1 { font-size: 40px; }
  body.folio .subpane h3 { font-size: 30px; }
  .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; }
  body.folio .contact h2 { font-size: 40px; }
  body.folio .section__label h2 { font-size: 34px; }
  :root { --gap: 12px; --big-w: 42vw; --big-h: calc(var(--big-w) * 4 / 3); --nav-col: 0px; }
  .section { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .section__label { border-right: 0; border-bottom: 1px solid var(--line); justify-content: flex-start; padding: calc(env(safe-area-inset-top, 0px) + 40px) 20px 16px; }
  .section__label h2 { writing-mode: horizontal-tb; transform: none; font-size: 34px !important; white-space: normal; }
  .section__stage { padding: 24px 20px 72px; }
  .dots { top: auto; bottom: 0; height: 56px; width: 100%; flex-direction: row; gap: 0; background: var(--paper); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .dots > div { flex-direction: row !important; }
  .dots .dot { width: 28px; }
  .about { flex-direction: column; align-items: stretch; gap: 28px; }
  .about__side { width: 100%; min-width: 0; }
  .about__portrait { max-width: 320px; }
  .section-intro { width: 100%; }
  .annot { grid-template-columns: minmax(0, 1fr); }
  .annot__notes .note { display: none; }
  .inpanel__body { padding: 28px 20px 56px; }
  body.folio .annot h3 { font-size: 32px; }
  .hikemap { height: 60svh; }
  .about__text h1 { font-size: 44px; }
  .cluster--editing { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .cluster--editing > .slot--big { grid-row: auto; width: 100%; height: auto; margin: 0; }
  .cluster--editing .slot--wide { grid-column: auto; height: 120px; }
  .cluster--single > .slot--big { margin: 0; }
  .window { width: 100%; height: auto; min-height: 70svh; }
  .tabs { padding: 64px 8px 20px; }
  .tabs { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 60px 4px; }
  .tab button { min-width: 0; width: 64px; padding: 0; height: 46px; }
  .tabpanes { padding: 28px 20px; }
  .contact h2 { font-size: 40px; }
  .contact .row { grid-template-columns: minmax(0, 1fr); }
  .sheet { width: 100vw; top: calc(var(--bar) + 8px); }
  .reader { flex-direction: column; gap: 28px; padding: 28px 20px 72px; }
  .reader__aside { width: min(240px, 100%); }
  .reader__main h1 { font-size: 40px; }
  .entry { font-size: 19px; }
  .drawer__body { padding: 24px 20px 48px; }
  .flip__back { padding: 28px 24px; }
}
