/* Assistabyte, chaptered editorial. Theme by tokens; the engine stays untouched.
   Brand from the live assistabyte.com logo: navy #0955ac to #083d8b, orange #e8642c.
   The page hard-cuts between paper and navy grounds, so the accent is one hue at
   two lightnesses, redefined per ground (taste.md, Colour). */
:root {
  --sc-canvas:     #eef0ec;   /* cool paper, not cream */
  --sc-surface:    #fbfcfa;
  --sc-ink:        #131d33;   /* navy off-black, never #000 */
  --sc-ink-soft:   #47546b;   /* tinted toward the ink */
  --sc-accent:     #b13f0c;   /* brand orange, darkened to clear 4.5:1 on paper */
  --sc-accent-ink: #ffffff;
  --sc-font-display: "Poppins", system-ui, sans-serif;
  --sc-font-text:    "Geist", system-ui, sans-serif;
  --sc-shadow-color: 222 40% 18%;

  --navy: #0a3a7e;
  --navy-deep: #082f68;
  --orange: #e8642c;          /* decorative shapes only */
  --paper-2: #e4e8e2;
  --hand: #1f4fa3;            /* the slip's "pen" */
  --folio-w: 84px;
}

/* ground families */
.on-navy, .intertitle, .peak, .chapter--ink {
  --sc-ink: #f3f5f8; --sc-ink-soft: #c2cbdb; --sc-accent: #ff9a66; --sc-accent-ink: #131d33;
  --sc-hairline: color-mix(in oklab, #f3f5f8 16%, transparent);
  color: var(--sc-ink);
}
.chapter--paper, .title, .colophon, .chapter--ledger { color: var(--sc-ink); }

body { background: var(--sc-canvas); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 200; background: var(--sc-ink); color: var(--sc-canvas); padding: 10px 16px; border-radius: var(--sc-r-sm); }
.skip:focus { top: 12px; }
main { padding-left: var(--folio-w); }
h1, h2, h3 { font-family: var(--sc-font-display); text-wrap: balance; margin: 0; }
p { text-wrap: pretty; }
.wm-accent { color: var(--sc-accent); }

/* buttons: one radius scale, md (12px) */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 var(--sc-5); border: 1.5px solid transparent; border-radius: var(--sc-r-md); background: var(--navy); color: #fff; font-weight: 600; font-family: var(--sc-font-text); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color var(--sc-d-fast) var(--sc-ease-out), transform 120ms var(--sc-ease-out); }
.btn:hover { background: var(--navy-deep); }
.btn:active { transform: translateY(1px); }
.btn--quiet { background: transparent; color: var(--sc-ink); border-color: var(--sc-hairline-strong); }
.btn--quiet:hover { background: color-mix(in oklab, var(--sc-ink) 6%, transparent); }
.link-btn { background: none; border: 0; padding: 0; color: var(--sc-accent); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: .22em; cursor: pointer; min-height: 44px; }
.chip, .tab { min-height: 40px; padding: 0 var(--sc-4); border-radius: var(--sc-r-md); border: 1px solid var(--sc-hairline-strong); background: transparent; color: var(--sc-ink); cursor: pointer; font-size: var(--sc-t-sm); transition: background-color var(--sc-d-fast) var(--sc-ease-out), border-color var(--sc-d-fast); }
.chip:hover, .tab:hover { border-color: var(--sc-ink-soft); }
.tab.is-on { background: var(--sc-ink); color: var(--sc-canvas); border-color: var(--sc-ink); }

/* ------------------------------------------------------------- folio -- */
.folio { position: fixed; z-index: var(--sc-z-chrome); left: 0; top: 0; bottom: 0; width: var(--folio-w); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: var(--sc-5) 0; border-right: 1px solid var(--sc-hairline); background: color-mix(in oklab, var(--sc-canvas) 92%, transparent); transition: background-color 240ms var(--sc-ease-out), color 240ms; color: var(--sc-ink); }
.folio.is-dark { background: color-mix(in oklab, var(--navy-deep) 94%, transparent); color: #f3f5f8; border-color: rgba(255,255,255,.14); }
.folio__mark img { width: 34px; height: auto; }
.folio.is-dark .folio__mark img { background: #fff; border-radius: 6px; padding: 3px; }
.folio__now { margin: 0; writing-mode: vertical-rl; transform: rotate(180deg); display: flex; gap: var(--sc-3); align-items: center; font-size: var(--sc-t-sm); letter-spacing: .02em; white-space: nowrap; }
.folio__num { font-family: var(--sc-font-display); font-weight: 700; }
.folio__title { opacity: .82; }
.folio__toc { writing-mode: vertical-rl; transform: rotate(180deg); background: none; border: 1px solid currentColor; border-radius: var(--sc-r-md); color: inherit; padding: var(--sc-4) var(--sc-2); cursor: pointer; font-size: var(--sc-t-sm); font-weight: 600; min-width: 44px; }
.folio__toc:hover { background: color-mix(in oklab, currentColor 10%, transparent); }

.toc, .demo { border: 0; padding: 0; border-radius: var(--sc-r-lg); background: var(--sc-surface); color: #131d33; box-shadow: var(--sc-e3); }
.toc::backdrop, .demo::backdrop { background: rgba(10, 24, 52, .55); }
.toc { width: min(440px, calc(100% - 24px)); }
.toc__inner { padding: var(--sc-6); display: grid; gap: var(--sc-5); }
.toc__head { display: flex; justify-content: space-between; align-items: center; }
.toc__head h2 { font-size: var(--sc-t-xl); }
.toc__x { width: 44px; height: 44px; border-radius: var(--sc-r-md); border: 1px solid #c9d0db; background: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; color: #131d33; }
.toc__list { list-style: none; margin: 0; padding: 0; display: grid; }
.toc__list a { display: flex; gap: var(--sc-4); align-items: baseline; padding: var(--sc-3) 0; border-bottom: 1px solid #dde2e8; text-decoration: none; font-weight: 500; min-height: 44px; }
.toc__list a:hover { color: #b13f0c; }
.toc__list span { width: 2.2em; font-family: var(--sc-font-display); font-weight: 700; color: #b13f0c; }

/* ------------------------------------------------------- title page -- */
.title { min-height: 100svh; display: grid; align-items: center; padding: var(--sc-6) var(--sc-gutter); }
.title__grid { width: 100%; max-width: 76rem; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: var(--sc-8); align-items: center; }
.masthead { display: flex; align-items: center; gap: var(--sc-4); margin: 0 0 var(--sc-5); font-size: var(--sc-t-sm); color: var(--sc-ink-soft); font-weight: 500; }
.masthead__name { font-family: var(--sc-font-display); font-weight: 700; font-size: 1.35rem; color: var(--sc-ink); letter-spacing: -0.02em; }
.masthead__rule { width: 48px; height: 1px; background: var(--sc-hairline-strong); }
.title__h { font-size: clamp(2.1rem, 1.2rem + 2.6vw, 3.6rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.035em; max-width: 18ch; }
.title__sub { margin: var(--sc-4) 0 0; font-size: var(--sc-t-lg); line-height: 1.5; color: var(--sc-ink-soft); max-width: 34ch; }
.ask { margin-top: var(--sc-6); max-width: 40rem; }
.ask__label { display: block; font-weight: 600; margin-bottom: var(--sc-2); }
.ask__field { display: flex; gap: var(--sc-2); align-items: flex-end; background: var(--sc-surface); border: 1.5px solid var(--sc-hairline-strong); border-radius: var(--sc-r-lg); padding: var(--sc-2) var(--sc-2) var(--sc-2) var(--sc-4); box-shadow: var(--sc-e2), var(--sc-edge); transition: border-color var(--sc-d-fast); }
.ask__field .btn { flex: 0 0 auto; white-space: nowrap; align-self: stretch; }
.ask__field:focus-within { border-color: var(--navy); }
.ask__field textarea { flex: 1; border: 0; background: transparent; resize: none; padding: var(--sc-3) 0; min-height: 52px; line-height: 1.45; font-size: 1.05rem; color: #131d33; }
.ask__field textarea:focus { outline: none; }
.ask__field textarea::placeholder { color: #66728a; }
.ask__hint { min-height: 1.3em; margin: var(--sc-2) 0; font-size: var(--sc-t-sm); color: var(--sc-accent); }
.ask__chips { display: flex; flex-wrap: wrap; gap: var(--sc-2); margin-top: var(--sc-3); }
.chip.is-live { border-color: var(--navy); background: color-mix(in oklab, var(--navy) 9%, transparent); color: var(--navy); }
.ask__next { margin: var(--sc-4) 0 0; font-size: var(--sc-t-sm); color: var(--sc-ink-soft); }

/* The scene: three planes. A ruled sheet far back, the slip, two brand squares near. */
.title__scene { position: relative; margin: 0; height: min(460px, 56svh); }
.scene__sheet { position: absolute; inset: 6% 4% 10% 12%; border-radius: var(--sc-r-md); background: repeating-linear-gradient(to bottom, transparent 0 31px, color-mix(in oklab, var(--navy) 10%, transparent) 31px 32px), var(--paper-2); filter: blur(.4px); opacity: .85; transform-origin: center; box-shadow: var(--sc-e1); }
.scene__slip { position: absolute; left: 0; right: 10%; top: 18%; display: grid; justify-items: center; }
.scene__bytes { position: absolute; right: 2%; top: 4%; width: 96px; height: 96px; pointer-events: none; }
.scene__bytes i { position: absolute; background: var(--orange); border-radius: 6px; box-shadow: 0 10px 24px -10px rgba(120, 40, 8, .5); }
.scene__bytes i:first-child { width: 58px; height: 60px; left: 0; bottom: 0; }
.scene__bytes i:last-child { width: 32px; height: 32px; right: 0; top: 0; border-radius: 4px; }

.slip { width: min(320px, 100%); background: #fffdf6; color: #131d33; border-radius: var(--sc-r-sm); padding: var(--sc-5) var(--sc-5) var(--sc-4); box-shadow: var(--sc-e3), inset 0 1px 0 #fff; position: relative; }
.slip::before { content: ""; position: absolute; top: -10px; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--orange); box-shadow: 0 4px 8px -2px rgba(120, 40, 8, .5); }
.slip__head { margin: 0 0 var(--sc-3); font-size: var(--sc-t-xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #8a4a2a; border-bottom: 1px solid #ead9c8; padding-bottom: var(--sc-2); }
.slip__line { margin: 0; padding: 6px 0; font-family: var(--sc-font-display); font-style: italic; font-weight: 500; font-size: 1.28rem; color: var(--hand); border-bottom: 1px dashed #e7dccb; line-height: 1.25; }
.slip__foot { margin: var(--sc-3) 0 0; font-size: var(--sc-t-xs); color: #6c5a4a; }
.slip--hero { transform: rotate(-4deg); }

/* ------------------------------------------------------- intertitle -- */
.intertitle { background: var(--navy); min-height: 100svh; display: grid; place-items: center; padding: var(--sc-8) var(--sc-gutter); }
.intertitle__inner { text-align: center; padding: var(--sc-4) 0 var(--sc-5); }
.intertitle__num { margin: 0 0 var(--sc-4); font-size: var(--sc-t-sm); letter-spacing: .14em; text-transform: uppercase; color: var(--sc-accent); font-weight: 600; }
.intertitle__h { font-size: var(--sc-t-3xl); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; color: var(--sc-ink); }

/* --------------------------------------------------------- the peak -- */
.peak { background: var(--navy); }
.peak__stage { display: grid; align-items: center; padding: var(--sc-6) var(--sc-gutter); }
.peak__grid { width: 100%; max-width: 76rem; margin: 0 auto; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: var(--sc-8); align-items: center; }
.peak__lede { font-family: var(--sc-font-display); font-weight: 600; font-size: var(--sc-t-2xl); line-height: 1.12; letter-spacing: -0.025em; margin: 0; max-width: 16ch; }
.peak__caption { margin: var(--sc-5) 0 0; font-size: var(--sc-t-lg); line-height: 1.55; color: var(--sc-ink-soft); max-width: 34ch; min-height: 4.7em; }
.peak__steps { list-style: none; margin: var(--sc-6) 0 0; padding: 0; display: flex; gap: var(--sc-2); flex-wrap: wrap; }
.peak__steps button { min-height: 44px; padding: 0 var(--sc-4); border-radius: var(--sc-r-md); border: 1px solid rgba(255,255,255,.28); background: transparent; color: var(--sc-ink); cursor: pointer; font-size: var(--sc-t-sm); font-weight: 500; }
.peak__steps button:hover { background: rgba(255,255,255,.08); }
.peak__steps button[aria-current="step"] { background: #f3f5f8; color: #0a3a7e; border-color: #f3f5f8; font-weight: 600; }

.surface { position: relative; background: #f6f8fb; color: #131d33; border-radius: var(--sc-r-lg); box-shadow: 0 30px 60px -20px rgba(2, 12, 34, .6), 0 6px 14px rgba(2, 12, 34, .3), inset 0 1px 0 #fff; }
.surface__bar { display: flex; justify-content: space-between; align-items: center; gap: var(--sc-3); padding: var(--sc-3) var(--sc-5); border-bottom: 1px solid #dbe1ea; font-weight: 600; font-size: var(--sc-t-sm); }
.sample { font-size: var(--sc-t-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #9a3a0e; background: #fde9dd; padding: 3px 8px; border-radius: var(--sc-r-sm); white-space: nowrap; }
.surface__body { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "inbox record" "cal record"; gap: var(--sc-4); padding: var(--sc-5); }
.pane__label { margin: 0 0 var(--sc-2); font-size: var(--sc-t-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #5a6680; }
.pane--inbox { grid-area: inbox; display: grid; gap: var(--sc-2); align-content: start; }
.pane--record { grid-area: record; background: #fff; border: 1px solid #dbe1ea; border-radius: var(--sc-r-md); padding: var(--sc-4); }
.pane--cal { grid-area: cal; }
.bubble { padding: var(--sc-2) var(--sc-3); border-radius: var(--sc-r-md); background: #fff; border: 1px solid #dbe1ea; font-size: var(--sc-t-sm); line-height: 1.4; max-width: 95%; }
.bubble b { display: block; font-size: var(--sc-t-xs); color: #5a6680; font-weight: 600; }
.bubble--out { justify-self: end; background: var(--navy); color: #fff; border-color: var(--navy); }
.bubble--out b { color: #c9d8f0; }
.record { margin: 0 0 var(--sc-4); display: grid; gap: var(--sc-2); }
.record div { display: grid; grid-template-columns: 7.5em 1fr; align-items: baseline; gap: var(--sc-2); padding-bottom: var(--sc-2); border-bottom: 1px solid #edf0f4; }
.record dt { font-size: var(--sc-t-xs); color: #5a6680; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.record dd { margin: 0; font-weight: 600; min-height: 1.4em; }
.follow { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sc-2); font-size: var(--sc-t-sm); }
.follow li { display: flex; gap: var(--sc-2); align-items: center; }
.follow .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #9aa6ba; flex: none; }
.follow li.is-on .dot { background: #1d7a4e; border-color: #1d7a4e; }
.cal { display: grid; border: 1px solid #dbe1ea; border-radius: var(--sc-r-md); overflow: hidden; background: #fff; }
.cal__slot { display: flex; gap: var(--sc-3); padding: var(--sc-2) var(--sc-3); font-size: var(--sc-t-sm); border-bottom: 1px solid #edf0f4; color: #47546b; }
.cal__slot:last-child { border-bottom: 0; }
.cal__slot b { color: #131d33; font-variant-numeric: tabular-nums; width: 3.2em; }
.cal__slot--target { min-height: 2.6em; align-items: center; }
.cal__fill { font-weight: 600; color: #0a3a7e; }
.cal__slot--target.is-booked { background: #e6eef9; }

.slip--live { position: absolute; z-index: 5; width: 250px; top: -28px; left: -56px; padding: var(--sc-4) var(--sc-4) var(--sc-3); transform-origin: 50% 50%; will-change: transform, opacity; }
.slip--live .slip__line { font-size: 1.1rem; }

/* State driven by page.js from the act's --sc-p. Only transform and opacity move. */
.peak [data-from] { opacity: 0; }
.bubble--out, .bubble--late { opacity: 0; transform: translateY(8px); transition: opacity 240ms var(--sc-ease-out), transform 240ms var(--sc-ease-out); }
.bubble--out.is-on, .bubble--late.is-on { opacity: 1; transform: none; }
.follow li { opacity: .35; transition: opacity 200ms var(--sc-ease-out); }
.follow li.is-on { opacity: 1; }
.cal__fill { opacity: 0; transition: opacity 240ms var(--sc-ease-out); }
.cal__slot--target.is-booked .cal__fill { opacity: 1; }

/* ---------------------------------------------------------- chapters -- */
.chapter { padding: var(--sc-section) var(--sc-gutter); }
.chapter--paper { background: var(--sc-canvas); }
.chapter--ledger { background: var(--paper-2); }
.chapter--ink { background: #131d33; --sc-accent: #ff9a66; }
.spread { max-width: 76rem; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--sc-7) var(--sc-8); align-items: start; }
.chapter__head { grid-column: 1; position: sticky; top: var(--sc-8); }
.chapter__num { margin: 0 0 var(--sc-3); font-size: var(--sc-t-sm); letter-spacing: .14em; text-transform: uppercase; color: var(--sc-accent); font-weight: 600; }
.chapter__h { font-size: var(--sc-t-3xl); line-height: 1.02; letter-spacing: -0.035em; font-weight: 700; }
.chapter__dek { margin: var(--sc-4) 0 0; font-size: var(--sc-t-lg); line-height: 1.5; color: var(--sc-ink-soft); max-width: 32ch; }

/* II glossary */
.glossary { grid-column: 2; margin: 0; display: grid; }
.term { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: var(--sc-5); padding: var(--sc-6) 0; border-top: 1px solid var(--sc-hairline-strong); }
.term:last-child { border-bottom: 1px solid var(--sc-hairline-strong); }
.term dt { display: grid; gap: var(--sc-1); }
.term__word { font-family: var(--sc-font-display); font-weight: 700; font-size: var(--sc-t-xl); letter-spacing: -0.02em; line-height: 1.1; }
.term__who { font-size: var(--sc-t-sm); color: var(--sc-accent); font-weight: 600; }
.term dd { margin: 0; color: var(--sc-ink-soft); max-width: 48ch; line-height: 1.6; }
.term--person .term__word { color: var(--navy); }
.margin-note { grid-column: 2; background: var(--sc-surface); border-radius: var(--sc-r-lg); padding: var(--sc-6); box-shadow: var(--sc-e1), var(--sc-edge); border: 1px solid var(--sc-hairline); }
.margin-note h3 { font-size: var(--sc-t-lg); margin-bottom: var(--sc-3); }
.margin-note p { margin: 0 0 var(--sc-3); color: var(--sc-ink-soft); max-width: 60ch; }
.margin-note ul { margin: 0; padding-left: 1.1em; display: grid; gap: var(--sc-2); color: var(--sc-ink); max-width: 60ch; }
.margin-note li::marker { color: var(--orange); }

/* III ledger */
.chapter--ledger .chapter__head { position: static; grid-column: 1 / -1; max-width: 46rem; }
.ledger { grid-column: 1 / -1; background: var(--sc-surface); border-radius: var(--sc-r-lg); box-shadow: var(--sc-e2), var(--sc-edge); border: 1px solid var(--sc-hairline); overflow: clip; }
.ledger__tools { display: flex; justify-content: space-between; align-items: center; gap: var(--sc-3); flex-wrap: wrap; padding: var(--sc-4) var(--sc-5); border-bottom: 1px solid var(--sc-hairline); }
.ledger__filters { display: flex; gap: var(--sc-2); flex-wrap: wrap; }
.ledger__search input { min-height: 44px; width: min(280px, 100%); border: 1px solid var(--sc-hairline-strong); border-radius: var(--sc-r-md); padding: 0 var(--sc-4); background: #fff; color: #131d33; }
.ledger__search input:focus { outline: 2px solid var(--sc-accent); outline-offset: 2px; }
.ledger__rows { border: 0; margin: 0; padding: 0 var(--sc-5); display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--sc-7); max-height: 30rem; overflow: auto; }
.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--sc-3); align-items: start; padding: var(--sc-3) 0; border-bottom: 1px solid var(--sc-hairline); cursor: pointer; }
/* .row sets display:grid, which beats the browser's own [hidden] rule, so filtered rows stayed visible. Restore it. */
.row[hidden], .ledger__empty[hidden] { display: none; }
.row input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--navy); }
.row b { display: block; font-weight: 600; }
.row small { display: block; color: var(--sc-ink-soft); font-size: var(--sc-t-sm); line-height: 1.35; }
.row .amt { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.row .amt small { display: inline; }
.row:has(input:checked) b { color: var(--navy); }
.row:has(input:checked) .amt { color: var(--navy); }
.row:has(input:focus-visible) { outline: 2px solid var(--sc-accent); outline-offset: 2px; border-radius: var(--sc-r-sm); }
.ledger__empty { grid-column: 1 / -1; padding: var(--sc-5) 0; color: var(--sc-ink-soft); }
.ledger__foot { display: grid; grid-template-columns: auto 1fr auto; gap: var(--sc-2) var(--sc-6); align-items: end; padding: var(--sc-5); border-top: 2px solid var(--sc-ink); background: color-mix(in oklab, var(--sc-surface) 60%, var(--paper-2)); }
.ledger__sum { margin: 0; display: grid; }
.ledger__label { font-size: var(--sc-t-xs); letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--sc-ink-soft); }
.ledger__total { font-family: var(--sc-font-display); font-weight: 700; font-size: var(--sc-t-2xl); letter-spacing: -0.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.ledger__per { font-size: var(--sc-t-sm); color: var(--sc-ink-soft); }
.ledger__sub { margin: 0 0 4px; color: var(--sc-ink-soft); font-variant-numeric: tabular-nums; }
.ledger__actions { display: flex; gap: var(--sc-4); align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.footnote { grid-column: 1 / -1; margin: 0; font-size: var(--sc-t-sm); color: var(--sc-ink-soft); max-width: 78ch; line-height: 1.55; }
.keeps { grid-column: 1 / -1; display: grid; gap: var(--sc-3); margin-top: var(--sc-6); max-width: 60rem; }
.keeps__h { font-size: var(--sc-t-xl); }
.keeps__p { margin: 0; color: var(--sc-ink-soft); max-width: 62ch; }
.keeps__list { list-style: none; margin: var(--sc-2) 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sc-2) var(--sc-5); }
.keeps__list li { display: inline-flex; align-items: center; gap: var(--sc-2); font-weight: 500; }
.keeps__list img { width: 20px; height: 20px; object-fit: contain; }

/* IV index */
.spread--media .chapter__head { position: static; grid-column: 1 / -1; max-width: 40rem; }
.index { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--sc-7); align-items: start; }
.index__list { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--sc-hairline-strong); }
.index__list button { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--sc-hairline-strong); padding: var(--sc-4) 0; font-family: var(--sc-font-display); font-weight: 600; font-size: var(--sc-t-lg); color: var(--sc-ink-soft); cursor: pointer; display: flex; justify-content: space-between; align-items: center; min-height: 52px; transition: color var(--sc-d-fast); }
.index__list button::after { content: "→"; opacity: 0; transform: translateX(-6px); transition: opacity var(--sc-d-fast), transform var(--sc-d-fast) var(--sc-ease-out); color: var(--sc-accent); }
.index__list button:hover { color: var(--sc-ink); }
.index__list button[aria-selected="true"] { color: var(--sc-ink); }
.index__list button[aria-selected="true"]::after { opacity: 1; transform: none; }
.index__panel { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--sc-6); align-items: start; }
.plate { margin: 0; }
.plate__frame { border-radius: var(--sc-r-md); overflow: hidden; aspect-ratio: 600 / 440; box-shadow: var(--sc-e2); }
.plate__frame img { width: 100%; height: 112%; max-width: none; object-fit: cover; margin-top: -6%; transition: opacity 200ms var(--sc-ease-out); }
.plate__frame img.swap { opacity: 0; }
.plate figcaption { margin-top: var(--sc-2); font-size: var(--sc-t-xs); color: var(--sc-ink-soft); }
.index__text h3 { font-size: var(--sc-t-xl); line-height: 1.15; margin-bottom: var(--sc-4); }
.index__text ul { margin: 0; padding-left: 1.1em; display: grid; gap: var(--sc-3); color: var(--sc-ink-soft); }
.index__text li::marker { color: var(--orange); }

/* V plates */
.chapter--ink .chapter__head { position: static; grid-column: 1 / -1; max-width: 44rem; }
.plates { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sc-6) var(--sc-5); align-items: start; }
.plates .plate:nth-child(3n+2) { margin-top: var(--sc-7); }
.plate--work img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; border-radius: var(--sc-r-md); box-shadow: 0 24px 48px -20px rgba(0,0,0,.6); }
.plate--work figcaption { margin-top: var(--sc-3); font-size: var(--sc-t-sm); color: var(--sc-ink-soft); }
.plate--work figcaption b { color: var(--sc-ink); }
.plate--work a { color: var(--sc-accent); font-weight: 600; }

.voices { grid-column: 1 / -1; margin-top: var(--sc-9); display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--sc-5) var(--sc-8); }
.voices__h { grid-column: 1 / -1; font-size: var(--sc-t-2xl); letter-spacing: -0.025em; }
.voices__dek { grid-column: 1 / -1; margin: 0 0 var(--sc-4); color: var(--sc-ink-soft); max-width: 60ch; }
.voices__dek a { color: var(--sc-accent); font-weight: 600; }
.voice { margin: 0; display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: var(--sc-2) var(--sc-5); align-items: start; padding: var(--sc-5) 0; border-top: 1px solid var(--sc-hairline); }
.voice img { grid-row: span 2; width: 88px; height: 120px; object-fit: cover; object-position: 50% 25%; border-radius: var(--sc-r-md); }
.voice blockquote { margin: 0; font-size: var(--sc-t-lg); line-height: 1.45; color: var(--sc-ink); max-width: 46ch; }
.voice figcaption { font-size: var(--sc-t-sm); color: var(--sc-ink-soft); }
.voice figcaption b { display: block; color: var(--sc-ink); }
.voice--lead { grid-row: span 2; grid-template-columns: 1fr; border-top: 0; padding-top: 0; }
.voice--lead img { grid-row: auto; width: min(220px, 60%); height: auto; aspect-ratio: 3 / 4; }
.voice--lead blockquote { font-family: var(--sc-font-display); font-weight: 600; font-size: var(--sc-t-2xl); line-height: 1.18; letter-spacing: -0.02em; }

/* VI FAQ and price */
.spread--faq .chapter__head { grid-column: 1; }
.faq { grid-column: 2; display: grid; border-top: 1px solid var(--sc-hairline-strong); }
.faq details { border-bottom: 1px solid var(--sc-hairline-strong); }
.faq summary { cursor: pointer; list-style: none; padding: var(--sc-4) var(--sc-8) var(--sc-4) 0; font-weight: 600; position: relative; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; font-weight: 400; color: var(--sc-accent); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 var(--sc-4); color: var(--sc-ink-soft); max-width: 62ch; }
.price { grid-column: 2; margin-top: var(--sc-8); }
.price__h { font-size: var(--sc-t-xl); margin-bottom: var(--sc-3); }
.price__p { margin: 0 0 var(--sc-4); color: var(--sc-ink-soft); max-width: 62ch; }
.price__steps { margin: 0 0 var(--sc-4); padding-left: 1.4em; display: grid; gap: var(--sc-3); max-width: 62ch; }
.price__steps li::marker { font-family: var(--sc-font-display); font-weight: 700; color: var(--sc-accent); }
.price__steps b { color: var(--sc-ink); }

/* ------------------------------------------------------- colophon -- */
.colophon { background: var(--sc-canvas); padding: var(--sc-10) var(--sc-gutter) var(--sc-7); border-top: 1px solid var(--sc-hairline-strong); }
.colophon__inner { max-width: 52rem; margin: 0 auto; }
.sentence__p { margin: 0; font-family: var(--sc-font-display); font-weight: 600; font-size: var(--sc-t-2xl); line-height: 1.3; letter-spacing: -0.02em; }
.sentence__p label { display: block; }
/* The answer box keeps a fixed height (three lines) so the rotating examples
   and long answers never resize the section. Text wraps; extra lines scroll. */
.sentence__box { margin-top: var(--sc-4); background: var(--sc-surface); border: 1.5px solid var(--sc-hairline-strong); border-radius: var(--sc-r-lg); padding: var(--sc-3) var(--sc-4); box-shadow: var(--sc-e2), var(--sc-edge); transition: border-color var(--sc-d-fast); }
.sentence__box:focus-within { border-color: var(--navy); }
.sentence__box textarea { display: block; width: 100%; box-sizing: border-box; border: 0; background: transparent; resize: none; padding: 0; margin: 0; font-family: var(--sc-font-display); font-weight: 500; font-size: clamp(1.15rem, 0.95rem + 1vw, 1.6rem); line-height: 1.4; height: 4.2em; overflow-y: auto; color: var(--navy); overflow-wrap: break-word; }
.sentence__box textarea:focus { outline: none; }
.sentence__box textarea::placeholder { color: #5f6e86; font-style: italic; opacity: 1; }
.sentence__act { margin: var(--sc-6) 0 0; display: flex; gap: var(--sc-4); align-items: center; flex-wrap: wrap; }
.sentence__note { font-size: var(--sc-t-sm); color: var(--sc-ink-soft); }
.colophon__plate { margin-top: var(--sc-10); padding-top: var(--sc-5); border-top: 1px solid var(--sc-hairline-strong); display: grid; gap: var(--sc-4); font-size: var(--sc-t-sm); }
.colophon__mark { margin: 0; display: flex; align-items: center; gap: var(--sc-2); font-family: var(--sc-font-display); font-weight: 700; font-size: 1.1rem; }
.colophon__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sc-2) var(--sc-5); }
.colophon__links a { display: inline-flex; align-items: center; min-height: 44px; }
.colophon__small { margin: 0; color: var(--sc-ink-soft); font-size: var(--sc-t-xs); max-width: 70ch; }

/* ----------------------------------------------------------- dialog -- */
.demo { width: min(640px, calc(100% - 24px)); max-height: calc(100dvh - 24px); }
.demo__form { padding: var(--sc-6); display: grid; gap: var(--sc-4); }
.demo__head { display: flex; justify-content: space-between; align-items: center; gap: var(--sc-3); }
.demo__head h2 { font-size: var(--sc-t-xl); }
.demo__sub { margin: 0; color: #47546b; font-size: var(--sc-t-sm); }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: var(--sc-t-sm); }
.field input, .field select, .field textarea { min-height: 46px; width: 100%; border: 1.5px solid #c9d0db; border-radius: var(--sc-r-md); padding: var(--sc-2) var(--sc-3); background: #fff; color: #131d33; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid #b13f0c; outline-offset: 1px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sc-3); }
.demo__preview { background: #eef0ec; border-radius: var(--sc-r-md); padding: var(--sc-3) var(--sc-4); }
.demo__plabel { margin: 0 0 var(--sc-1); font-size: var(--sc-t-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #47546b; }
.demo__preview pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: var(--sc-t-xs)/1.5 var(--sc-font-mono); color: #2b3650; max-height: 150px; overflow: auto; }
.demo__actions { display: flex; gap: var(--sc-3); align-items: center; flex-wrap: wrap; }
.demo .btn--quiet { color: #131d33; border-color: #c9d0db; }
.demo__status { font-size: var(--sc-t-sm); color: #1d7a4e; }

/* ----------------------------------------------------------- mobile -- */
@media (max-width: 960px) {
  :root { --folio-w: 0px; }
  main { padding-left: 0; padding-bottom: 64px; }
  .folio { top: auto; bottom: 0; right: 0; left: 0; width: auto; height: 60px; flex-direction: row; padding: 0 var(--sc-4) env(safe-area-inset-bottom); border-right: 0; border-top: 1px solid var(--sc-hairline); gap: var(--sc-3); background: var(--sc-canvas); }
  .folio.is-dark { background: var(--navy-deep); }
  .folio__now, .folio__toc { writing-mode: horizontal-tb; transform: none; }
  .folio__now { flex: 1; min-width: 0; overflow: hidden; }
  .folio__title { overflow: hidden; text-overflow: ellipsis; }
  .folio__toc { padding: 0 var(--sc-4); min-height: 44px; }
  .title__grid, .spread, .peak__grid, .index, .index__panel { grid-template-columns: 1fr; }
  .chapter__head, .glossary, .margin-note, .faq, .price, .spread--faq .chapter__head { grid-column: 1; position: static; }
  .title { padding-top: var(--sc-7); min-height: auto; }
  .title__scene { height: 300px; max-width: 420px; }
  .scene__slip { top: 14%; }
  .plates { grid-template-columns: 1fr 1fr; }
  .plates .plate:nth-child(3n+2) { margin-top: 0; }
  .plates .plate:nth-child(even) { margin-top: var(--sc-6); }
  .voices { grid-template-columns: 1fr; }
  .voice--lead { grid-row: auto; }
  .peak__grid { gap: var(--sc-4); }
  .peak__caption { min-height: 0; }
}
@media (max-width: 700px) {
  .title__h { font-size: var(--sc-t-2xl); line-height: 1.02; }
  .ask__field { flex-direction: column; align-items: stretch; padding: var(--sc-2); }
  /* three lines, so every cycling example fits on phones without the box resizing */
  .ask__field textarea { padding: var(--sc-2); min-height: calc(3 * 1.45 * 1.05rem + 2 * var(--sc-2)); }
  .ask__field .btn { width: 100%; }
  .masthead { margin-bottom: var(--sc-5); }
  .term { grid-template-columns: 1fr; gap: var(--sc-2); padding: var(--sc-5) 0; }
  .ledger__rows { grid-template-columns: 1fr; max-height: 26rem; padding: 0 var(--sc-4); }
  .ledger__tools { padding: var(--sc-3) var(--sc-4); }
  .ledger__filters { flex-wrap: wrap; width: 100%; }
  .ledger__filters .tab { flex: none; }
  .ledger__search, .ledger__search input { width: 100%; }
  .ledger__foot { grid-template-columns: 1fr; padding: var(--sc-4); }
  .ledger__actions { justify-content: flex-start; }
  .plates { grid-template-columns: 1fr 1fr; gap: var(--sc-4); }
  .plates .plate:nth-child(even) { margin-top: var(--sc-5); }
  .plate--work figcaption { font-size: var(--sc-t-xs); }
  .voice { grid-template-columns: 64px minmax(0, 1fr); }
  .voice img { width: 64px; height: 88px; }
  .voice--lead { grid-template-columns: 1fr; }
  .voice--lead img { width: 160px; height: auto; }
  .field-row { grid-template-columns: 1fr; }

  /* the peak, art-directed for a phone: caption above, a compact surface below */
  .peak__stage { padding: var(--sc-4) var(--sc-4) 76px; align-items: start; }
  .peak__lede { font-size: var(--sc-t-lg); max-width: none; }
  .peak__caption { font-size: var(--sc-t-sm); margin-top: var(--sc-2); line-height: 1.45; }
  .peak__steps { margin-top: var(--sc-3); flex-wrap: nowrap; }
  .peak__steps button { padding: 0 var(--sc-3); flex: 1; }
  .surface__body { grid-template-columns: 1fr; grid-template-areas: "inbox" "record" "cal"; gap: var(--sc-3); padding: var(--sc-3); }
  .surface__bar { padding: var(--sc-2) var(--sc-3); }
  .bubble--in.bubble--late { display: none; }
  .pane--record { padding: var(--sc-3); }
  .record { margin-bottom: var(--sc-2); gap: 2px; }
  .record div { grid-template-columns: 6.5em 1fr; padding-bottom: 4px; }
  .follow { gap: 2px; }
  .cal__slot { padding: 6px var(--sc-3); }
  .cal__slot:not(.cal__slot--target) { display: none; }
  .slip--live { width: 190px; top: auto; bottom: 86px; left: auto; right: -6px; padding: var(--sc-3); }
  .slip--live .slip__line { font-size: .98rem; padding: 3px 0; }
  .slip--live .slip__foot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bubble--out, .bubble--late, .follow li, .cal__fill, .plate__frame img { transition-duration: 1ms; }
  .slip--hero { transform: rotate(-4deg) !important; }
}

/* grid items must be allowed to shrink, or a nowrap filter row widens the whole layout viewport on phones */
.spread > *, .index > *, .index__panel > *, .ledger, .ledger__tools, .ledger__filters { min-width: 0; }
.peak__stage { overflow: clip; }

/* Chapter II: visitor intelligence, one card that unmasks a visitor */
.vi { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sc-6); align-items: center; }
.vi__copy h3 { font-size: var(--sc-t-lg); margin-bottom: var(--sc-3); }
.vi__live { background: #131d33; border-radius: var(--sc-r-lg); padding: var(--sc-7) var(--sc-6); display: grid; place-items: center; box-shadow: var(--sc-e2); }
.vi__card { position: relative; width: min(100%, 26rem); background: #1a2642; color: #f3f5f8; border: 1px solid rgba(255,255,255,.12); border-radius: var(--sc-r-md); padding: var(--sc-5) var(--sc-5) var(--sc-5) var(--sc-6); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.vi__card::before { content: ""; position: absolute; left: 12px; top: 18%; bottom: 18%; width: 3px; border-radius: 3px; background: #ff9a66; transition: background-color 300ms var(--sc-ease-out); }
.vi__card.is-found::before { background: #3ccf7e; }
.vi__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sc-4); }
.vi__status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-size: var(--sc-t-xs); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #dbe3f0; }
.vi__seal { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.3); display: grid; place-items: center; transition: border-color 300ms, background-color 300ms; }
.vi__card.is-found .vi__seal { border-color: #3ccf7e; background: rgba(60,207,126,.15); }
.vi__card.is-found .vi__seal::after, .vi__tick::after { content: ""; width: 5px; height: 9px; border: solid #3ccf7e; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.vi__card dl { container-type: inline-size; margin: 0; display: grid; gap: var(--sc-4); }
.vi__card dl > div { display: grid; grid-template-columns: minmax(0, 1fr) 20px; align-items: end; }
.vi__card dt { grid-column: 1; font-size: var(--sc-t-xs); color: #9fb0c8; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
/* One line, fixed height: the scrambled text changes width every frame, and letting it wrap made the card (and every section below it) jump. Safari has no scroll anchoring, so phones saw the page shift. */
.vi__card dd { grid-column: 1; margin: 2px 0 0; font-size: min(var(--sc-t-lg), 6.8cqi); line-height: 1.62; height: 1.62em; color: #ffb48c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.vi__card dl > div.is-done dd { color: #f3f5f8; }
.vi__tick { grid-column: 2; grid-row: 1 / span 2; align-self: center; display: grid; place-items: center; opacity: 0; transform: scale(.95); transition: opacity 200ms var(--sc-ease-out), transform 200ms var(--sc-ease-out); }
.vi__card dl > div.is-done .vi__tick { opacity: 1; transform: none; }
@media (max-width: 1180px) { .vi { grid-template-columns: 1fr; } }
.margin-note.vi { grid-column: 1 / -1; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--sc-8); padding: var(--sc-7); }
@media (max-width: 960px) { .margin-note.vi { grid-template-columns: 1fr; gap: var(--sc-5); padding: var(--sc-5); } }
.vi-wrap { max-width: 76rem; margin: var(--sc-8) auto 0; }

/* Phones: give the visitor card more room so the status and the longest example email fit on one line. */
@media (max-width: 480px) {
  .vi__live { padding: var(--sc-5) var(--sc-3); }
  .vi__card { padding: var(--sc-4) var(--sc-4) var(--sc-4) var(--sc-5); }
  .vi__status { letter-spacing: .06em; }
}

/* Demo link placeholder: plain text until the demo site is ready. */
.plate__soon { color: var(--sc-ink-soft); font-style: italic; cursor: default; }

/* Sticky "Book a call": top-right on desktop, beside Contents in the phone bar. */
:root { --start-w: 172px; }
.folio__start { position: fixed; top: var(--sc-4); right: var(--sc-5); z-index: var(--sc-z-chrome); min-height: 44px; min-width: var(--start-w); justify-content: center; box-shadow: var(--sc-e2); }
.folio.is-dark .folio__start { background: #fff; color: var(--navy-deep); }
.folio.is-dark .folio__start:hover { background: #e6ebf3; }
/* Docs link: beside Book a call on desktop (as votel.ai's header), in Contents on phones. */
.folio__docs { position: fixed; top: var(--sc-4); right: calc(var(--sc-5) + var(--start-w) + var(--sc-3)); z-index: var(--sc-z-chrome); min-height: 44px; display: inline-flex; align-items: center; padding: 0 var(--sc-4); border-radius: var(--sc-r-md); background: transparent; border: 0; color: var(--sc-ink); font-size: var(--sc-t-sm); font-weight: 600; text-decoration: none; }
.folio__docs:hover { background: var(--sc-canvas); color: var(--navy); }
.folio.is-dark .folio__docs { color: #f3f5f8; }
/* Let the home-page actions size together when the booking label grows. */
.folio__actions { position: fixed; top: var(--sc-4); right: var(--sc-5); z-index: var(--sc-z-chrome); display: flex; align-items: center; gap: var(--sc-3); }
.folio__actions > a { position: static; flex: none; }
.toc__docs { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: calc(-1 * var(--sc-4)); color: var(--sc-ink-soft); font-size: var(--sc-t-sm); }
@media (max-width: 960px) {
  .folio__actions { display: contents; }
  .folio__docs { display: none; }
  .folio__start { position: static; min-width: 0; box-shadow: none; padding: 0 var(--sc-4); flex: none; }
  .folio__toc { flex: none; }
}
@media (max-width: 420px) {
  .folio { gap: var(--sc-2); padding-left: var(--sc-3); padding-right: var(--sc-3); }
  .folio__toc, .folio__start { padding: 0 var(--sc-3); font-size: var(--sc-t-sm); }
}

/* Hero chips: compact on phones so six fit in about three rows. */
@media (max-width: 700px) {
  .ask__chips { gap: 6px; }
  .ask__chips .chip { min-height: 36px; padding: 0 10px; font-size: .84rem; }
}

/* An early testimonial band, right after chapter I. */
.band { background: var(--sc-canvas); padding: var(--sc-9) var(--sc-gutter) var(--sc-6); }
.band__voice { max-width: 60rem; margin: 0 auto; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--sc-6); align-items: center; }
.band__voice img { width: 120px; height: 160px; object-fit: cover; object-position: 50% 25%; border-radius: var(--sc-r-md); }
.band__voice blockquote { margin: 0 0 var(--sc-3); font-family: var(--sc-font-display); font-weight: 600; font-size: var(--sc-t-xl); line-height: 1.25; letter-spacing: -0.015em; color: var(--sc-ink); max-width: 44ch; }
.band__voice figcaption { font-size: var(--sc-t-sm); color: var(--sc-ink-soft); }
.band__voice figcaption b { color: var(--sc-ink); margin-right: .35em; }
.band__voice figcaption a { color: var(--sc-accent); font-weight: 600; margin-left: .25em; }
@media (max-width: 700px) {
  .band { padding: var(--sc-7) var(--sc-gutter) var(--sc-4); }
  .band__voice { grid-template-columns: 72px minmax(0, 1fr); gap: var(--sc-4); align-items: start; }
  .band__voice img { width: 72px; height: 96px; }
  .band__voice blockquote { font-size: var(--sc-t-lg); }
}

/* Chapter IV: the plain list of industries under the heading. */
.index__also { margin: var(--sc-4) 0 0; font-size: var(--sc-t-sm); line-height: 1.6; color: var(--sc-ink-soft); max-width: 70ch; }

/* Two voices left in chapter V once the lead quote moved up. */
.voices .voice { border-top: 1px solid var(--sc-hairline); }

.index__eg { margin-top: var(--sc-2); font-style: italic; }
.toc__talk { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: calc(-1 * var(--sc-3)); font-weight: 600; color: var(--navy); }

/* Chapter I: the inbox never shows an empty slot. Dots hold the reply's place until it lands. */
.pane--inbox .bubble--out, .pane--inbox .bubble--typing { grid-row: 3; grid-column: 1; }
.pane--inbox .bubble--late { grid-row: 4; }
.bubble--typing { justify-self: end; align-self: start; display: inline-flex; gap: 5px; padding: 12px 14px; background: var(--navy); border-color: var(--navy); transition: opacity 200ms var(--sc-ease-out); }
.bubble--typing span { width: 7px; height: 7px; border-radius: 50%; background: #c9d8f0; animation: ab-typing 1.1s infinite ease-in-out; }
.bubble--typing span:nth-child(2) { animation-delay: .15s; } .bubble--typing span:nth-child(3) { animation-delay: .3s; }
.bubble--out.is-on + .bubble--typing { opacity: 0; }
@keyframes ab-typing { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .bubble--typing span { animation: none; opacity: .8; } }
.peak__steps button { white-space: nowrap; }

/* Chapter I on phones: the stage fits the visible screen above the bar. One panel per step,
   cross-faded in place, and the note hangs below the card so it never covers a field. */
@media (max-width: 700px) {
  .peak__stage { padding: var(--sc-3) var(--sc-4) calc(60px + env(safe-area-inset-bottom) + var(--sc-3)); align-items: center; }
  .peak__grid { gap: var(--sc-3); }
  .peak__caption { min-height: calc(2 * 1.45em); }
  .peak__steps { gap: 6px; }
  .peak__steps li { flex: 1 1 0; min-width: 0; display: flex; }
  .peak__steps button { flex: 1; min-width: 0; padding: 0 6px; }
  .pane--cal { align-self: center; }
  .surface { margin-bottom: 104px; }
  .surface__body { grid-template-areas: "pane"; }
  .pane--inbox, .pane--record, .pane--cal { grid-area: pane; opacity: 0; transition: opacity 260ms var(--sc-ease-out); }
  .surface[data-pane="0"] .pane--inbox, .surface[data-pane="1"] .pane--record, .surface[data-pane="2"] .pane--cal { opacity: 1; }
  .cal__slot:not(.cal__slot--target) { display: flex; }
  .slip--live { width: auto; left: 6px; right: 6px; top: calc(100% + 16px); bottom: auto; padding: var(--sc-3) var(--sc-3) var(--sc-2); }
  .slip--live { display: flex; flex-wrap: wrap; column-gap: var(--sc-4); }
  .slip--live .slip__head { flex-basis: 100%; margin-bottom: 4px; padding-bottom: 4px; }
}
@media (max-width: 400px) { .peak__steps button { font-size: .8125rem; } }

/* ---- booking form (closing, #book): first name, email, phone,
   an optional hand-off note and an optional, unticked text consent box. ---- */
.steps { list-style: none; margin: var(--sc-5) 0 0; padding: 0; max-width: 40rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sc-3); font-size: var(--sc-t-sm); font-weight: 600; line-height: 1.35; color: var(--sc-ink); }
.steps li { position: relative; display: grid; grid-template-columns: auto 1fr; gap: var(--sc-2); align-items: start; padding-top: var(--sc-3); border-top: 2px solid var(--sc-hairline-strong); }
.steps li:first-child { border-top-color: var(--orange); }
.steps span { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--navy); color: #fff; font-size: .78rem; }
.lead { display: grid; gap: var(--sc-3); }
.ask.lead { margin-top: var(--sc-5); }
.lead__h { margin: 0; font-family: var(--sc-font-display); font-weight: 700; font-size: var(--sc-t-lg); letter-spacing: -0.01em; }
.lead__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sc-3); }
.lead__field { display: grid; gap: 6px; align-content: start; }
.lead__field label { font-weight: 600; font-size: var(--sc-t-sm); }
.lead__field input { width: 100%; box-sizing: border-box; min-height: 46px; padding: 0 var(--sc-3); border: 1.5px solid var(--sc-hairline-strong); border-radius: var(--sc-r-md); background: var(--sc-surface); color: #131d33; font: inherit; font-size: 1rem; box-shadow: var(--sc-edge); }
.lead__field input:focus { outline: 2px solid var(--navy); outline-offset: 1px; border-color: var(--navy); }
.lead__field input[aria-invalid="true"] { border-color: #b3261e; }
.lead__err { margin: 0; font-size: .8rem; color: #b3261e; font-weight: 600; }
.lead__err:empty { display: none; }
.lead .ask__label { margin: var(--sc-1, 4px) 0 0; }
.lead__optional { font-weight: 400; color: var(--sc-ink-soft); }
.lead__note { padding: var(--sc-1, 4px) var(--sc-4); }
.lead__note textarea { min-height: 48px; }
.lead .ask__chips { margin-top: 0; }
.lead__consent { display: grid; grid-template-columns: auto 1fr; gap: var(--sc-3); align-items: start; padding: var(--sc-3) var(--sc-4); border: 1px solid var(--sc-hairline); border-radius: var(--sc-r-md); background: color-mix(in oklab, var(--navy) 4%, transparent); }
.lead__consent input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--navy); cursor: pointer; }
.lead__consent label { line-height: 1.5; font-size: .82rem; color: var(--sc-ink-soft); cursor: pointer; }
.lead__consent a { color: var(--navy); font-weight: 600; }
.lead__opt { display: block; margin-top: 4px; }
.lead__act { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sc-3) var(--sc-4); }
.lead__act .btn { min-width: 12rem; }
.lead__help { flex: 1 1 16rem; margin: 0; font-size: .82rem; line-height: 1.45; color: var(--sc-ink-soft); }
.lead__help a, .lead__status a { color: var(--navy); font-weight: 600; }
.lead__status { margin: 0; font-size: var(--sc-t-sm); line-height: 1.5; }
.lead__status:empty { display: none; }
.lead__status.is-on { padding: var(--sc-3) var(--sc-4); border-left: 3px solid var(--orange); background: color-mix(in oklab, var(--orange) 8%, transparent); border-radius: 0 var(--sc-r-md) var(--sc-r-md) 0; }
.lead--end { gap: var(--sc-4); }
.lead--end .sentence__note { margin: calc(-1 * var(--sc-2)) 0 0; }
.lead--end .ask__hint:empty { display: none; }
@media (max-width: 700px) {
  .lead__row { grid-template-columns: 1fr; }
  .lead__act .btn { width: 100%; }
  .steps { grid-template-columns: 1fr; gap: 6px; }
  .steps li { padding-top: 0; border-top: 0; align-items: center; }
}
.steps--end { margin: 0 0 var(--sc-6); max-width: none; }
#book { scroll-margin-top: var(--sc-6); }
/* Leave the pricing heading below the fixed desktop navigation on anchor jumps. */
#pricing { scroll-margin-top: 96px; }

/* closing scene: a quiet photo strip above the steps; hidden on phones to keep the close simple */
.close-scene { margin: 0 0 var(--sc-7); border-radius: var(--sc-r-lg); overflow: hidden; aspect-ratio: 21 / 8; box-shadow: var(--sc-e2); }
.close-scene img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
@media (max-width: 700px) { .close-scene { display: none; } }

/* Chapter I on desktop and tablet: the note rests on the card's empty top bar, hanging off its
   left edge, as one wide row, so it never covers Mark's chat or the contact fields.
   The bar's label moves right to make room. Under Contact, page.js files it into the record. */
@media (min-width: 701px) {
  .surface__bar { justify-content: flex-end; }
  .slip--live { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--sc-4); width: 380px; max-width: calc(100% - 96px); top: -58px; left: -36px; padding: var(--sc-3) var(--sc-4) var(--sc-2); }
  .slip--live .slip__head { flex-basis: 100%; margin-bottom: 4px; padding-bottom: 4px; }
  .slip--live .slip__line { font-size: 1.02rem; padding: 2px 0; }
  .slip--live .slip__foot { flex-basis: 100%; margin-top: 4px; }
}

/* Redesign: local Ryan hero + founder + handoff below fold */
.title__eyebrow { margin: 0 0 var(--sc-3); font-size: var(--sc-t-sm); letter-spacing: .08em; text-transform: uppercase; color: var(--sc-ink-soft); font-weight: 600; }
.title__h { max-width: 18ch; }
.title__do-label { margin: var(--sc-5) 0 var(--sc-2); font-size: var(--sc-t-sm); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sc-ink); }
.title__do { list-style: none; margin: 0; padding: 0; font-size: var(--sc-t-sm); color: var(--sc-ink); max-width: 42ch; }
.title__do li { padding: 0.28em 0 0.28em 1.15em; position: relative; line-height: 1.4; }
.title__do li::before { content: ""; position: absolute; left: 0; top: 0.75em; width: 0.45em; height: 0.45em; background: var(--sc-accent, #e8692e); border-radius: 50%; }
.title__who { margin: var(--sc-4) 0 0; font-size: var(--sc-t-sm); color: var(--sc-ink-soft); max-width: 42ch; line-height: 1.5; }
.title__cta { margin-top: var(--sc-5); display: flex; flex-direction: column; align-items: flex-start; gap: var(--sc-3); }
.title__sms { font-size: var(--sc-t-sm); color: var(--sc-accent); font-weight: 600; text-decoration: none; }
.title__sms:hover { text-decoration: underline; }
.title__portrait { margin: 0; justify-self: center; max-width: 320px; width: 100%; }
.title__portrait img { display: block; width: 100%; height: auto; aspect-ratio: 4/5; object-fit: cover; border-radius: 12px; box-shadow: 0 14px 36px rgba(20,30,50,.2); }
.title__portrait figcaption { margin-top: var(--sc-3); text-align: center; font-size: var(--sc-t-sm); color: var(--sc-ink-soft); }
.band--early { padding: clamp(2rem, 4vw, 3.5rem) var(--sc-gutter); }
.handoff { padding: clamp(1.5rem, 3vw, 3rem) var(--sc-gutter) clamp(2.5rem, 5vw, 4rem); }
.handoff .ask { max-width: 40rem; margin: 0 auto; }
.founder { padding: clamp(3rem, 6vw, 6rem) clamp(1.25rem, 5vw, 5rem); }
.founder__inner { display: grid; grid-template-columns: 200px 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; max-width: 960px; margin: 0 auto; }
.founder__inner--copy { grid-template-columns: 1fr; max-width: 42rem; }
.founder__kicker { font-size: var(--sc-t-sm); text-transform: uppercase; letter-spacing: 0.12em; color: var(--sc-ink-soft); margin: 0; }
.founder__h { font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.6rem); line-height: 1.08; letter-spacing: -0.025em; margin: 0.4em 0; max-width: 22ch; }
.founder__copy p { max-width: 52ch; line-height: 1.55; }
.colophon__head { text-align: center; margin: 0 0 var(--sc-6); }
.colophon__h { font-size: clamp(1.8rem, 1.2rem + 2vw, 3rem); line-height: 1.08; letter-spacing: -0.03em; margin: 0; max-width: 18ch; margin-inline: auto; }
/* Peak no longer pins — normal scroll, keep a readable stage */
.peak[data-sc-act="flow"] .peak__stage { min-height: auto; padding-block: clamp(3rem, 8vw, 6rem); }
.folio__start { white-space: nowrap; }
@media (max-width: 960px) {
  .title__portrait { max-width: 220px; order: -1; }
  .title__grid { justify-items: center; text-align: left; }
}
@media (max-width: 700px) {
  .title { min-height: 100svh; min-height: 100dvh; padding: 8px var(--sc-4) 72px; align-items: start; padding-top: 56px; box-sizing: border-box; }
  .title__grid { gap: 10px; }
  .title__eyebrow { margin-bottom: 6px; font-size: .72rem; }
  .title__h { font-size: clamp(1.35rem, 5.6vw, 1.75rem); max-width: none; line-height: 1.08; }
  .title__sub { font-size: .88rem; margin-top: 8px; line-height: 1.4; }
  .title__do-label { margin-top: 10px; margin-bottom: 2px; font-size: .72rem; }
  .title__do li { padding-top: 0.1em; padding-bottom: 0.1em; font-size: .82rem; }
  .title__who { margin-top: 8px; font-size: .78rem; line-height: 1.35; }
  .title__cta { margin-top: 12px; width: 100%; gap: 8px; }
  .title__cta .btn { width: 100%; text-align: center; }
  .title__sms { font-size: .82rem; }
  .title__portrait { max-width: 180px; }
  #pricing { scroll-margin-top: 24px; }
  .title__portrait figcaption { font-size: .7rem; margin-top: 4px; }
  .masthead { display: none; }
  .ask__field { flex-direction: column; align-items: stretch; }
  .ask__field .btn { width: 100%; white-space: normal; }
  .folio__start { font-size: .72rem; padding-inline: 8px; }
}
@media (max-width: 640px) { .founder__inner { grid-template-columns: 1fr; } }

#ix-cap:empty { display: none; }
