/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* ═══════════════════════════════════════════════════════════════════════════════════════════════
   DESIGN SYSTEM — "Jasmine's portfolio, read in Apple Books"
   Two layers: LAYER 1 is the Apple Books app chrome (toolbar, popovers, page bar — system font,
   translucent materials, quiet fills). LAYER 2 is the book itself (the pages — book typography).
   ═══════════════════════════════════════════════════════════════════════════════════════════════ */
:root {
  /* ── Colour · Layer 2, the page (Calm theme; other themes override below) ── */
  --bg: #F4E1C6;               /* the page — in Apple Books the reading canvas IS the page */
  --surface: #FBEFD9;          /* a slightly lifted area on the page */
  --border: #E4D2B4;           /* hairline separators on the page */
  --text-primary: #2A2620;     /* body ink */
  --text-secondary: #6B6353;   /* secondary ink — ≥4.5:1 on the page */
  --text-muted: #8C8474;       /* tertiary: page numbers, metadata — ≥3:1 on the page */
  --tag-bg: #EFE7D5;
  --tag-text: #6B6353;
  --accent-pink: #E9B8B0;
  --accent-green: #A8BCA1;
  --accent-purple: #C9BFE3;
  --wip-bg: #FBEFD9;
  --wip-text: #B9772C;

  /* ── Colour · Layer 1, the app chrome ── */
  --chrome-bg: #FBF6EC;                        /* toolbar control groups */
  --chrome-line: rgba(60, 48, 20, 0.07);       /* hairline rim on floating chrome */
  --popover-bg: rgba(255, 242, 226, 0.8);     /* Contents / Themes — translucent material (#FFF2E0 look) */
  --chrome-text: #262524;
  --chrome-text-2: #7C7872;
  --fill-hover: rgba(60, 48, 20, 0.07);        /* quiet hover wash on controls & rows */
  --fill-pressed: rgba(60, 48, 20, 0.13);
  --fill-selected: #DAD2C7;                    /* current row / open control */
  --focus-ring: #2A2620;
  --hud-bg: rgba(38, 34, 29, 0.92);            /* dark tooltip / HUD */
  --hud-text: #F7F1E6;

  /* ── Typography ── */
  --font-ui: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --ui-caption: 11px;     /* page bar, overline labels */
  --ui-meta: 12px;        /* metadata, chips, tags */
  --ui-control: 13px;     /* toolbar title, menus, controls — Apple's standard control size */
  --ui-body: 15px;

  /* ── Spacing (4pt grid) ── */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px;
  --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

  /* ── Radius: four deliberate steps, nested concentrically ── */
  --r-sm: 6px;              /* tags, tiny chips, inline marks */
  --r-md: 12px;             /* media, figures, theme tiles, content blocks */
  --r-control: 16px;        /* controls & menu rows (~32px tall → capsule ends) */
  --r-surface: 21px;        /* floating chrome: toolbar groups, popovers (= control 16 + 5px inset) */
  --radius: var(--r-md);    /* legacy alias */
  --nav-radius: var(--r-control);

  /* ── Motion ── */
  --dur-micro: 140ms;       /* hover, press, colour, icon state */
  --dur-short: 200ms;       /* small state changes, dropdown rows */
  --dur-ui: 360ms;          /* popovers, panels, contextual controls */
  --dur-major: 480ms;       /* page turns, opening a chapter */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);        /* settles gently — default for things arriving */
  --ease-in: cubic-bezier(0.4, 0, 1, 1);             /* for things leaving */
  --ease-in-out: cubic-bezier(0.42, 0, 0.58, 1);
  /* critically-damped-ish spring (response .38s, damping .82 → ~1% overshoot): Apple's popover feel */
  --ease-spring: linear(0, 0.0398, 0.1345, 0.2553, 0.3831, 0.5056, 0.616, 0.711, 0.7896, 0.8526, 0.9015, 0.9383, 0.965, 0.9838, 0.9963, 1.0042, 1.0086, 1.0106, 1.0111, 1.0106, 1.0094, 1.0081, 1.0067, 1.0053, 1.0041, 1.0031, 1.0022, 1.0016, 1);
  --transition: var(--dur-short) var(--ease-out);    /* legacy alias used by content-layer rules */

  /* ── Elevation: contextual, never one generic shadow ── */
  --elev-chrome: 0 0 0 0.5px var(--chrome-line), 0 1px 2px rgba(60, 48, 20, 0.05), 0 4px 14px rgba(60, 48, 20, 0.08);
  --elev-popover: 0 0 0 0.5px rgba(60, 48, 20, 0.09), 0 2px 6px rgba(60, 48, 20, 0.06), 0 14px 36px rgba(60, 48, 20, 0.14);
  --elev-media: 0 1px 2px rgba(60, 48, 20, 0.06), 0 6px 18px rgba(60, 48, 20, 0.10);
}
@supports not (transition-timing-function: linear(0, 1)) {
  :root { --ease-spring: cubic-bezier(0.25, 1.02, 0.36, 1); }
}
html { scroll-behavior: smooth; }
/* reader display-settings defaults + Apple Books–style background themes */
:root { --reading-scale: 1; --reading-font: Gelasio, Georgia, 'Times New Roman', serif; --reading-weight: 400; }
html[data-theme="white"] { --bg:#FFFFFF; --surface:#FFFFFF; --border:#E9E7E2; --text-primary:#1B1A17; --text-secondary:#575249; --text-muted:#A7A192; --tag-bg:#F2F0EA; }
html[data-theme="sepia"] { --bg:#F3E7CE; --surface:#F8EFD8; --border:#E0D1AE; --text-primary:#4A3924; --text-secondary:#6E5A3C; --text-muted:#A78E67; --tag-bg:#EADFC3; }
html[data-theme="night"] { --bg:#1D1B18; --surface:#262320; --border:#39342E; --text-primary:#ECE6DA; --text-secondary:#B6AD9D; --tag-bg:#2D2925; }
html[data-theme="gray"] { --bg:#E6E5E0; --surface:#EFEEE9; --border:#D3D1CA; --text-primary:#2E2D2A; --text-secondary:#605E58; --text-muted:#9B9990; --tag-bg:#DCDBD4; }
html[data-theme="focus"] { --bg:#FBFAF6; --surface:#FFFFFF; --border:#ECEAE3; --text-primary:#24231F; --text-secondary:#5E5B52; --text-muted:#A6A399; --tag-bg:#F1EFE8; }
html[data-theme="quiet"] { --bg:#3A3936; --surface:#454340; --border:#575450; --text-primary:#E7E4DD; --text-secondary:#B1AEA5; --text-muted:#948F86; --tag-bg:#4A4844; }
/* Layer-1 chrome per theme — the app surfaces follow the page like Apple Books does */
html[data-theme="white"], html[data-theme="focus"] {
  --chrome-bg: #FFFFFF; --chrome-line: rgba(0,0,0,0.08); --popover-bg: rgba(255,255,255,0.8);
  --chrome-text: #1D1D1F; --chrome-text-2: #6E6E73; --fill-hover: rgba(0,0,0,0.05); --fill-pressed: rgba(0,0,0,0.1);
  --fill-selected: rgba(0,0,0,0.09); --focus-ring: #1D1D1F; --tag-text: #575249;
}
html[data-theme="gray"] {
  --chrome-bg: #F5F4F0; --chrome-line: rgba(0,0,0,0.08); --popover-bg: rgba(245,244,240,0.8);
  --chrome-text: #242422; --chrome-text-2: #6B6A64; --fill-hover: rgba(0,0,0,0.055); --fill-pressed: rgba(0,0,0,0.1);
  --fill-selected: rgba(0,0,0,0.09); --focus-ring: #242422;
}
html[data-theme="sepia"] { --chrome-bg: #FBF3E1; --popover-bg: rgba(251,243,225,0.8); }
html[data-theme="quiet"], html[data-theme="night"] {
  --chrome-line: rgba(255,255,255,0.09);
  --chrome-text: #EDEAE3; --chrome-text-2: #A8A49B; --fill-hover: rgba(255,255,255,0.08); --fill-pressed: rgba(255,255,255,0.14);
  --fill-selected: rgba(255,255,255,0.15); --focus-ring: #EDEAE3; --hud-bg: rgba(250,246,238,0.94); --hud-text: #26221D;
  --elev-chrome: 0 0 0 0.5px var(--chrome-line), 0 1px 2px rgba(0,0,0,0.2), 0 4px 14px rgba(0,0,0,0.28);
  --elev-popover: 0 0 0 0.5px rgba(255,255,255,0.1), 0 2px 6px rgba(0,0,0,0.22), 0 14px 36px rgba(0,0,0,0.4);
  --elev-media: 0 1px 2px rgba(0,0,0,0.2), 0 6px 18px rgba(0,0,0,0.3);
}
html[data-theme="quiet"] { --chrome-bg: #4A4845; --popover-bg: rgba(66,64,60,0.84); }
html[data-theme="night"] { --chrome-bg: #2F2C28; --popover-bg: rgba(44,41,37,0.86); --text-muted: #8E8577; }
/* Bold preset: heavier reading text */
.hero-blurb, .about-lead, .about-prose p, .placeholder-lead, .case-sub, .case-section p { font-weight: var(--reading-weight, 400); }
body { background-color: var(--bg); /* solid cream canvas on every page */
  color: var(--text-primary); line-height: 1.65; font-size: 15.5px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
/* ─── HOME: skinny left column + dotted-grid canvas ─────────── */
html { scroll-padding-top: 24px; }
.home-layout {
  --side-w: 232px;
  --stage-top: 0px;
  display: grid;
  grid-template-columns: 1fr;               /* single full-width column — the side nav is gone */
  margin: 0;
}
/* the side nav column has been removed; navigation lives in the top toolbar */
.side-col { display: none; }
.canvas-col { grid-column: 1; }
.side-inner { display: flex; flex-direction: column; height: 100%; }
.side-logo { font-family: Gelasio, Georgia, 'Times New Roman', serif; font-weight: 600; font-size: 20px; letter-spacing: 0; margin-bottom: 40px; }
.side-nav { flex-direction: column; gap: 12px; }
.side-link {
  font-family: Gelasio, Georgia, 'Times New Roman', serif; font-size: 18px; font-weight: 400; color: var(--text-muted);
  width: fit-content; position: relative; transition: color var(--transition);
}
.side-link:hover { color: var(--text-secondary); }
.side-link.active { color: var(--text-primary); }
.side-link.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: var(--text-primary);
}
/* nav dropdowns: work + bookshelf expand to a numbered (i. ii. iii.) list */
.nav-group { display: flex; flex-direction: column; }
.nav-parent {
  display: inline-flex; align-items: center; gap: 7px; width: fit-content;
  background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: left;
  font-family: Gelasio, Georgia, 'Times New Roman', serif; font-size: 18px; font-weight: 400;
  color: var(--text-muted); transition: color var(--transition);
}
.nav-parent:hover { color: var(--text-secondary); }
.nav-group.active .nav-parent { color: var(--text-primary); }
.nav-caret { font-size: 13px; line-height: 1; color: var(--text-muted); transition: transform var(--transition); }
.nav-group.open .nav-caret { transform: rotate(90deg); }
.nav-sub {
  list-style: lower-roman inside; margin: 0; padding: 0;
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height var(--transition), opacity var(--transition), margin var(--transition);
}
.nav-group.open .nav-sub { max-height: 360px; opacity: 1; margin: 8px 0 2px 20px; }
.nav-sub li { margin: 7px 0; font-family: Gelasio, Georgia, 'Times New Roman', serif; font-size: 14px; color: var(--text-muted); }
.nav-sub li::marker { color: var(--text-muted); }
.nav-sub a { color: var(--text-secondary); transition: color var(--transition); }
.nav-sub a:hover { color: var(--text-primary); }
.side-foot { margin-top: 30px; display: flex; flex-direction: column; gap: 14px; }
.side-icons { display: flex; gap: 14px; }
.side-icons a { color: var(--text-muted); display: inline-flex; transition: color var(--transition), transform var(--transition); }
.side-icons a:hover { color: var(--text-primary); transform: translateY(-2px); }
.side-icons svg { width: 18px; height: 18px; }
.side-clock { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
/* the tracker + icons/clock sit flush at the very bottom of the fixed column;
   the flower art sits just above them (order:-1) rather than pushing them up */
.side-bottom { margin-top: auto; display: flex; flex-direction: column; }
.side-bottom .about-flowers { order: -1; }
/* Flowers, undistorted, drawing with scroll */
.about-flowers { margin: 0 -14px 16px; width: calc(100% + 28px); max-width: none; }
.about-flowers svg { display: block; width: 100% !important; height: auto !important; }
/* ─── Redesigned home: normal scroll, cream editorial ──────────── */
.content-col { min-height: 100vh; padding: 88px clamp(24px, 5vw, 72px) 120px; max-width: 1120px; margin: 0 auto; width: 100%; }
.content-col > section { max-width: none; }
@media (max-width: 820px) {
}
.hero { padding: 40px 0 88px; }
.hero-blurb {
  font-family: var(--reading-font);
  font-size: calc(18.5px * var(--reading-scale));
  line-height: 1.66;
  color: var(--text-primary);
  text-align: justify;
  -webkit-hyphens: auto; hyphens: auto;
  text-indent: 1.5em;                 /* book-style paragraphs, like the case studies */
  margin: 0;
}
.hero-blurb:first-child { text-indent: 0; }
.hero-blurb em { font-style: italic; }
/* Home spread: big serif cover title on the left page, "About the author" chapter on the right */
html.page-mode .hero-cover { break-after: column; break-inside: avoid; }
/* title alone on the left page, never split */
html.page-mode .hero-cover-title { margin-top: max(0px, calc(50vh - 260px)); text-wrap: balance; }
/* roughly centered, even line lengths */
.hero-cover-title {
  font-family: Gelasio, Georgia, 'Times New Roman', serif;
  font-weight: 600;
  font-size: calc(54px * var(--reading-scale));
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0;
  text-align: center;   /* centred on its page, like a book's title page */
}
.hero-chapter-title {
  font-family: Gelasio, Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 700;                       /* bold italic, like the reference */
  font-size: calc(31px * var(--reading-scale));
  line-height: 1.2;
  color: var(--text-primary);
  margin: 0 0 18px;
}
.hero-chapter-title + .hero-blurb { text-indent: 0; }
/* work cards */
.work { padding-bottom: 96px; }
/* gallery wall of hand-drawn framed thumbnails; blurb reveals on hover */
.frame-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.frame {
  position: relative;
  display: block;
  aspect-ratio: 354 / 378;
  transform-origin: 49.56% 1.69%;   /* pivot at the hang-tag, so it swings like a hung picture */
  will-change: transform;
}
/* home footer */
/* footer at the bottom of every page — the live "currently tracking" status */
.page-foot { padding: 36px 0 0; margin-top: 48px; border-top: 1px solid var(--border); text-align: center; }
.case-panel .page-foot { margin-top: 40px; }
/* live "currently tracking" status — hidden until data arrives */
.now-status { display: none; font-family: var(--reading-font); font-size: 15px; line-height: 1.6; color: var(--text-secondary); }
.now-status.is-live { display: block; }
.now-text { display: block; }
.now-text b, .now-activity { font-weight: 600; color: var(--text-primary); }
.now-elapsed { font-variant-numeric: tabular-nums; color: var(--text-primary); }
.now-cta { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; color: var(--text-muted); }
.now-cta:hover { color: var(--text-primary); }
/* ─── Bookshelf (Goodreads) ─────────────────────────────────── */
.shelf-head { padding: 60px 0 40px; }
.shelf-gr { color: var(--text-primary); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--text-muted); }
.shelf-gr:hover { text-decoration-color: var(--text-primary); }
.shelf { padding-bottom: 52px; scroll-margin-top: 40px; }
/* genre filter */
.shelf-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 34px; }
.filter-btn { cursor: pointer; }
.filter-btn:hover { border-color: var(--text-muted); }
.filter-btn.is-active { border-color: var(--text-primary); }
/* list view — stacked rows (title / author / tags); cover fills the row height on the right, faded on its left edge */
.book-list { display: flex; flex-direction: column; max-width: 680px; }
.book-row {
  position: relative; display: flex; align-items: center;
  min-height: 108px; padding: 18px 120px 18px 0;
  border-top: 1px solid var(--border);
}
.book-row:last-child { border-bottom: 1px solid var(--border); }
.book-row-meta { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.book-row-title { font-family: var(--reading-font); font-size: 19px; line-height: 1.25; color: var(--text-primary); }
.book-row-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 1px; }
/* cover: full row height, pinned right, appears on hover only */
.book-row-cover { position: absolute; right: 0; top: 0; bottom: 0; z-index: 5; pointer-events: none; opacity: 0; transform: translateX(10px); }
.book-row-cover img { height: 100%; width: auto; display: block; }
.book-row:hover .book-row-cover { opacity: 1; transform: translateX(0); }
/* ─── About page ────────────────────────────────────────────── */
.about-intro { display: flex; }
.about-portrait { display: block; }
.about-hello { font-family: var(--reading-font); line-height: 1.12; color: var(--text-primary); }
.about-lead { font-family: var(--reading-font); font-size: calc(clamp(18px, 2vw, 22px) * var(--reading-scale)); line-height: 1.4; margin-top: 12px; }
.about-prose { max-width: 660px; padding-bottom: 8px; }
.about-prose p { font-family: var(--reading-font); font-size: calc(18px * var(--reading-scale)); line-height: 1.62; color: var(--text-primary); margin-bottom: 18px; }
.about-prose strong { font-weight: 600; }
.about-fig { margin: 22px 0; }
/* transparent collages carry their own shadows */
.about-fig img { width: 100%; display: block; }
.about-exp { padding: 48px 0 8px; max-width: 660px; }
.exp-list { display: flex; flex-direction: column; }
.exp-row { display: flex; align-items: baseline; justify-content: space-between; border-top: 1px solid var(--border); }
.exp-row:last-child { border-bottom: 1px solid var(--border); }
.exp-main { display: flex; flex-direction: column; }
.exp-role { color: var(--text-primary); }
.exp-org { margin-top: 1px; }
.about-moments { padding: 52px 0 24px; }
.moments-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 26px 20px; }
.moment { margin: 0; }
.moment img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
@media (max-width: 680px) {
  .about-intro { flex-direction: column; align-items: flex-start; gap: 20px; }
}
/* live tracker moved onto the About page */
/* placeholder pages (quotes) */
.placeholder { padding: 60px 0 96px; }
.placeholder-title {
  font-family: var(--reading-font);
  font-size: calc(clamp(40px, 6vw, 64px) * var(--reading-scale)); font-weight: 500; letter-spacing: -0.5px;
  color: var(--text-primary); margin-bottom: 22px;
}
.placeholder-lead {
  font-family: var(--reading-font);
  font-size: calc(clamp(20px, 2.3vw, 26px) * var(--reading-scale)); line-height: 1.5; color: var(--text-secondary); margin-bottom: 28px;
}
.placeholder-soon {
  font-family: var(--font-ui);
  font-size: 13px; letter-spacing: 0.04em; color: var(--text-muted);
  display: inline-block; padding: 8px 16px; border: 1px dashed var(--border); border-radius: var(--r-control);
}
/* RIGHT: pinned dotted-grid canvas stage.
   The tall .pin-wrap provides scroll distance; the .stage sticks to the
   viewport while slides cross-fade/translate in the same space. */
.canvas-col { position: relative; }
/* the stage is truly fixed to the viewport — nothing here ever moves,
   only the slides inside cross-fade. dots stay perfectly still. */
.stage {
  position: fixed;
  top: var(--stage-top, 0px);
  left: var(--side-w, 232px);
  right: 0;
  bottom: 0;
  overflow: hidden;
  --dot: #dcdad2;
  background-color: var(--bg);
  background-image: radial-gradient(circle, var(--dot) 1.2px, transparent 1.3px);
  background-size: 24px 24px;
  background-position: -1px -1px;
  z-index: 1;
}
.scroll-hint {
  position: absolute; left: 64px; bottom: 40px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted);
}
.workflow { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 40px; margin-bottom: 48px; }
.statement {
  font-size: 34px;
  line-height: 1.34;
  font-weight: 500;
  letter-spacing: -0.5px;
  max-width: 700px;
  color: var(--text-primary);
}
.statement { margin: 0 auto; }
.statement strong { font-weight: 600; }
.statement em { font-style: normal; background: linear-gradient(transparent 60%, var(--accent-green) 60%); }
.statement .word {
  display: inline-block;
  opacity: 0;
  transform: translateX(-0.3em);
  will-change: opacity, transform;
}
.pop {
  position: absolute; width: 208px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 13px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 14px 38px rgba(0,0,0,0.13);
  z-index: 2;
}
.pop p { font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); }
.pop p strong { color: var(--text-primary); font-weight: 600; }
/* Scroll-scrubbed reveals — opacity/transform driven directly by scroll in JS,
   so everything appears as a result of scrolling (and reverses on scroll up). */
.reveal { opacity: 0; transform: translateY(30px) scale(0.965); will-change: opacity, transform; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  .statement .word { opacity: 1 !important; transform: none !important; }
}
/* Chronological timeline */
.timeline { margin-top: 40px; }
.footer-made { margin-top: 20px; font-size: 13px; color: var(--text-muted); }
/* ─── CASE STUDY PAGES ──────────────────────────────────────── */
/* two nav columns: fixed site-nav (.side-col) on the far left, then the section nav */
.case-layout {
  display: grid;
  grid-template-columns: 1fr;      /* section nav removed — global toolbar is the only nav */
  margin-left: 0;
  max-width: 1240px;
}
.case-sidenav { display: none; }
/* the old per-case section nav is gone on every page */
.case-sidenav {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 52px 24px 40px 40px;
  scrollbar-width: none;
}
.case-sidenav::-webkit-scrollbar { display: none; }
.sidenav-back {
  display: inline-block;
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 24px;
  transition: color var(--transition);
}
.sidenav-back:hover { color: var(--text-primary); }
.sidenav-title { font-family: var(--reading-font); font-size: calc(17px * var(--reading-scale)); font-weight: 600; margin-bottom: 16px; line-height: 1.3; }
.sidenav-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.sidenav-list a {
  display: block;
  font-size: 13.5px;
  color: var(--text-muted);
  padding: 6px 10px;
  border-left: 2px solid var(--border);
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.sidenav-list a:hover { color: var(--text-primary); }
.sidenav-list a.active {
  color: var(--text-primary);
  font-weight: 500;
  border-left-color: var(--text-primary);
  background: var(--tag-bg);
}
.nav-toggle {
  display: flex; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: transform var(--transition), opacity var(--transition); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 250; backdrop-filter: blur(2px); }
.nav-overlay.active { display: block; }
/* Case content */
.case-content { padding: 48px 56px 100px; min-width: 0; }
.case-hero { margin-bottom: 48px; }
.case-hero h1 { font-family: var(--reading-font); font-size: calc(46px * var(--reading-scale)); font-weight: 600; letter-spacing: -0.5px; line-height: 1.12; margin-bottom: 12px; }
.case-hero .case-sub { font-family: var(--reading-font); font-size: calc(20px * var(--reading-scale)); max-width: 620px; }
.case-hero-img { margin-top: 32px; }
.case-hero-img img { display: block; width: 100%; }
/* round all four corners of the image itself */
.case-overview-bar { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 56px; }
.case-section { margin-bottom: 64px; scroll-margin-top: 130px; }
.case-section > h2 { font-family: var(--reading-font); font-size: calc(30px * var(--reading-scale)); font-weight: 600; letter-spacing: -0.3px; margin-bottom: 18px; }
.case-section h4 { margin: 24px 0 10px; }
/* book-style reading body: larger serif, justified, first-line indents, no paragraph gaps */
.case-section p {
  font-family: var(--reading-font);
  font-size: calc(18.5px * var(--reading-scale));
  line-height: 1.66;
  color: var(--text-primary);
  text-align: justify;
  -webkit-hyphens: auto; hyphens: auto;
  text-indent: 1.5em;
  margin: 0;
}
/* first paragraph of a section (and special blocks) start flush, like a book chapter */
.case-section > h2 + p,
.case-section h3 + p,
.case-section h4 + p,
.case-section > p:first-child,
.case-section .callout p,
.case-section figcaption { text-indent: 0; }
.case-section p + h3, .case-section p + h4 { margin-top: 28px; }
.case-section p + ul, .case-section p + ol, .case-section p + .case-fig, .case-section p + .callout { margin-top: 14px; }
.case-section .case-fig + p, .case-section ul + p, .case-section ol + p, .case-section .callout + p { margin-top: 16px; }
.case-section p strong { color: var(--text-primary); font-weight: 600; }
.case-section ul, .case-section ol { margin: 0 0 16px 24px; color: var(--text-primary); }
.case-section li { margin-bottom: 8px; font-size: calc(17px * var(--reading-scale)); }
/* ── Case studies open in the main content area (where the intro sits), not a floating panel.
      Expand/minimize toggles between the content column and the full viewport. ── */
.case-panel { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 400; /* full-width reading view */
  background: var(--bg); display: flex; flex-direction: column; opacity: 0; visibility: hidden; }
.case-panel.open { opacity: 1; visibility: visible; }
.case-panel.expanded { left: 0; }
/* nav hidden → reclaim its space */
/* floating expand + close controls, top-right of the content area */
.cp-controls { display: none; }
/* replaced by the universal top nav bar */
.cp-btn {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text-secondary);
  cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.cp-btn:hover { color: var(--text-primary); border-color: var(--text-muted); }
.cp-btn svg { width: 16px; height: 16px; }
.case-panel-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.cp-loading, .cp-error { padding: 64px 40px; color: var(--text-muted); font-size: 14px; }
/* the injected case layout: single column, Apple-Books style — no left nav, a bottom progress bar instead */
.case-panel .case-layout { margin-left: 0; max-width: none; grid-template-columns: 1fr; }
.case-panel .case-sidenav { display: none; }
.case-panel .case-content { max-width: 900px; margin: 0 auto; padding: 52px clamp(24px, 4vw, 56px) 132px; transition: max-width var(--dur-ui) var(--ease-out); }
.case-panel.expanded .case-content { max-width: 1200px; }
.case-panel .case-section { scroll-margin-top: 20px; }
.case-panel .site-footer { display: none; }
/* paginated (book-spread) reading: two columns per screen, turned with the arrows */
.case-panel.paginated #cpScroll { overflow: hidden; position: relative; }
/* the outgoing page during an Apple-Books-style turn */
.page-ghost { position: absolute; inset: 0; overflow: hidden; z-index: 4; background: var(--bg); pointer-events: none; will-change: transform; }
.case-panel.paginated .case-content { will-change: transform; }
.case-panel.paginated #cpToggle { display: none; }
/* expand is meaningless in paged mode */
.case-panel.paginated .case-content h2,
.case-panel.paginated .case-content h3,
.case-panel.paginated .case-content h4 { break-inside: avoid; break-after: avoid; }
.case-panel.paginated .case-content .case-hero,
.case-panel.paginated .case-content .case-hero-img,
.case-panel.paginated .case-content .case-overview-bar,
.case-panel.paginated .case-content .case-fig,
.case-panel.paginated .case-content .callout,
.case-panel.paginated .case-content ul,
.case-panel.paginated .case-content ol,
.case-panel.paginated .case-content .page-foot { break-inside: avoid; }
.case-panel.paginated .case-content img { max-width: 100%; max-height: 42vh; width: auto; height: auto; object-fit: contain; display: block; margin-left: auto; margin-right: auto; }
@media (max-width: 1210px) {
  .case-panel { left: 0; }
}
/* paged mode for the regular pages (home / about / bookshelf) */
html.page-mode, html.page-mode body { height: 100%; overflow: hidden; }
html.page-mode .pager-vp { position: fixed; inset: 0; width: 100%; max-width: none; margin: 0; padding: 0; overflow: hidden; }
html.page-mode .pager-cols { will-change: transform; }
html.page-mode .pager-cols h1,
html.page-mode .pager-cols h2,
html.page-mode .pager-cols h3 { break-inside: avoid; break-after: avoid; }
html.page-mode .pager-cols .about-portrait,
html.page-mode .pager-cols .about-intro,
html.page-mode .pager-cols .moments-grid,
html.page-mode .pager-cols .exp-list,
html.page-mode .pager-cols .shelf-filter,
html.page-mode .pager-cols .book-row,
html.page-mode .pager-cols .shelf,
html.page-mode .pager-cols .page-foot,
html.page-mode .pager-cols img { break-inside: avoid; }
html.page-mode .pager-cols img { max-width: 100%; max-height: 44vh; width: auto; height: auto; object-fit: contain; display: block; margin-left: auto; margin-right: auto; }
.case-fig { margin: 26px 0; }
.case-fig img, .case-fig video { width: 100%; }
/* transparent images: no frame so they blend into the tan background */
.case-fig img.img-transparent { border: none; border-radius: 0; }
.case-hero-img.has-transparent { border: none; border-radius: 0; overflow: visible; background: none; }
.case-content img.img-transparent { border: none; }
.case-fig figcaption { font-size: 13px; color: var(--text-muted); margin-top: 10px; font-style: italic; }
.fig-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.callout p { color: var(--text-primary); margin: 0; }
.psst { background: var(--wip-bg); padding: 16px 20px; margin: 22px 0; }
.psst .psst-label { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.psst p { font-size: 14px; color: var(--text-secondary); margin: 0; }
.psst a { text-decoration: underline; }
.process-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 20px 0; }
.process-col { background: var(--tag-bg); padding: 16px; }
.process-col h5 { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; margin-bottom: 8px; }
.process-col ul { margin: 0 0 0 16px; }
.process-col li { font-size: 13px; margin-bottom: 4px; color: var(--text-secondary); }
/* Footer */
.site-footer { display: none; }
/* replaced by the live tracker footer on every page */
.site-footer h3 { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.site-footer p { font-size: 14.5px; color: var(--text-secondary); }
.site-footer .footer-links { display: flex; gap: 20px; justify-content: center; margin-top: 16px; }
.site-footer .footer-links a { font-size: 14px; border-bottom: 1px solid var(--border); }
.site-footer .footer-links a:hover { border-color: var(--text-primary); }
.site-footer .footer-made { margin-top: 24px; font-size: 13px; color: var(--text-muted); }
/* ─── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .home-layout { --side-w: 210px; }
  .pop { width: 188px; }
  .case-content { padding: 40px 40px 80px; }
}
@media (max-width: 820px) {
  .home-layout { grid-template-columns: 1fr; }
  .canvas-col { grid-column: auto; }
  .side-col {
    position: sticky; top: 0;
    width: auto;
    height: auto;
    padding: 12px 20px;
    border-right: none; border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.92); backdrop-filter: blur(10px);
    z-index: 100;
  }
  .side-inner { flex-direction: row; align-items: center; gap: 16px; flex-wrap: wrap; }
  .side-logo { margin-bottom: 0; margin-right: auto; }
  .side-nav { flex-direction: row; gap: 14px; }
  .side-foot { flex-direction: row; align-items: center; gap: 12px; margin-top: 0; }
  .side-clock { display: none; }
  .about-flowers { display: none; }
  .side-bottom { margin-top: 0; }
  .now-status, .now-status.is-live { display: none; }
  /* tracker only in the full side nav */
  /* fixed stage spans full width, sits just below the sticky top bar */
  .home-layout { --side-w: 0px; --stage-top: 54px; }
  .statement { font-size: 24px; }
  .pop { position: static; width: auto; margin-top: 12px; box-shadow: 0 6px 20px rgba(0,0,0,0.07); }
  .about-portrait { max-width: 260px; }
  .case-layout { grid-template-columns: 1fr; margin-left: 0; }
  .case-sidenav {
    position: static;
    width: auto;
    height: auto;
    transform: none;
    box-shadow: none;
    background: transparent;
    padding: 18px 24px 22px;
    border-bottom: 1px solid var(--border);
  }
  .case-content { padding: 32px 24px 64px; }
  .case-hero h1 { font-size: calc(34px * var(--reading-scale)); }
  .case-hero .case-sub { font-size: calc(17px * var(--reading-scale)); }
  .case-section > h2 { font-size: calc(25px * var(--reading-scale)); }
  .case-section { scroll-margin-top: 120px; }
  .fig-row { grid-template-columns: 1fr; }
}
/* ═══════════════════════════════════════════════════════════════════════════════════════════════
   LAYER 1 — APPLE BOOKS CHROME
   Quiet, system-font controls that sit around the book. Floating groups use the chrome material;
   popovers use the translucent material. Every control: hover → wash, press → deeper wash + a
   small spring squeeze, release → settle. Radii nest: control 16 → group/popover 21.
   ═══════════════════════════════════════════════════════════════════════════════════════════════ */
/* ── Toolbar control groups (left: Contents · Bookshelf · About, right: Themes "AA") ── */
.book-toolbar, .reader-group {
  box-sizing: border-box; height: 44px; padding: 5px;
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--chrome-bg); border: 0; border-radius: var(--r-surface);
  box-shadow: var(--elev-chrome);
  transition: opacity var(--dur-ui) var(--ease-out), transform var(--dur-ui) var(--ease-out), background-color var(--dur-short) var(--ease-out);
}
.book-toolbar { position: fixed; top: 14px; left: 20px; z-index: 520; }
.reader-ui { position: fixed; top: 14px; right: 20px; z-index: 520; }
.side-nav { display: none; }
/* the old side nav lives in the Contents popover now */
/* the control itself — small visual, generous invisible hit area */
.tb-btn, .reader-btn-aa {
  position: relative; width: 36px; height: 32px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; padding: 0; border-radius: var(--r-control);
  color: var(--chrome-text); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-micro) var(--ease-out), transform var(--dur-ui) var(--ease-spring), opacity var(--dur-micro) var(--ease-out);
}
.tb-btn svg { width: 19px; height: 19px; flex: none; }
.tb-btn:hover, .reader-btn:hover .reader-btn-aa { background: var(--fill-hover); }
.tb-btn.active { background: var(--fill-hover); }
/* the page you're on */
.tb-btn[aria-expanded="true"], .reader-btn[aria-expanded="true"] .reader-btn-aa { background: var(--fill-selected); }
/* its popover is open */
.tb-btn:active, .reader-btn:active .reader-btn-aa {
  background: var(--fill-pressed); transform: scale(0.95);
  transition: background-color 60ms linear, transform 90ms var(--ease-out);        /* press is instant; release springs back */
}
.reader-group { display: inline-flex; }
.reader-btn { display: inline-flex; height: auto; padding: 0; border: 0; background: none; box-shadow: none; border-radius: var(--r-control); cursor: pointer; color: var(--chrome-text); font-family: var(--font-ui); line-height: 1; }
.reader-btn-aa { gap: 1px; align-items: baseline; }
.reader-btn-aa > span { line-height: 32px; }
.reader-btn-sm { font-size: 12px; font-weight: 500; }
.reader-btn-lg { font-size: 18px; font-weight: 500; }
/* keyboard focus — visible, Apple-style ring that follows the control's shape */
.tb-btn:focus-visible,
.reader-btn:focus-visible .reader-btn-aa,
.book-arrow:focus-visible,
.toc-item:focus-visible,
.toc-section:focus-visible,
.toc-caret:focus-visible,
.contents-foot a:focus-visible,
.reader-panel button:focus-visible,
.filter-btn:focus-visible {
  outline: 2px solid var(--focus-ring); outline-offset: 2px;
}
.reader-btn:focus-visible { outline: none; }
/* links and other focusable things on the page share the same ring */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; border-radius: 3px; }
/* centred running title — the chapter you're in, like Apple Books' window title */
.book-title {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 515;
  height: 44px; line-height: 44px; max-width: 44vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: center; pointer-events: none;
  font-family: var(--font-ui); font-weight: 600; font-size: var(--ui-control); letter-spacing: -0.005em;
  color: var(--chrome-text);
  transition: opacity var(--dur-ui) var(--ease-out);
}
/* ── Popovers: shared translucent material that UNFOLDS FROM ITS BUTTON ──
   Open  : the surface grows out of the button (transform-origin = button centre), from roughly button-size
           to full size on the spring (strong ease-out, ~1% settle); elevation deepens as it arrives; the
           contents follow ~100ms later, each row fading/rising 8px/un-blurring a hair after the one above.
   Close : the reverse — contents dissolve first, then the surface contracts back into the button and its
           shadow drops, so it feels like it returned to where it came from. */
.contents-pop, .reader-panel, .search-panel {
  background: var(--popover-bg);
  -webkit-backdrop-filter: blur(24px) saturate(1.35); backdrop-filter: blur(24px) saturate(1.35);
  border: 0; border-radius: var(--r-surface);
  opacity: 0; visibility: hidden;
  transform: scale(0.22, 0.14);                      /* folded down to about the size of its button */
  box-shadow: var(--elev-chrome);                    /* starts at the toolbar's elevation… */
  transition:                                        /* close: wait for the contents, then contract */
    transform 240ms var(--ease-in) 70ms,
    box-shadow 240ms var(--ease-in) 70ms,
    opacity 150ms linear 160ms,
    visibility 0s linear 320ms;
}
.contents-pop.open, .reader-panel.open, .search-panel.open {
  opacity: 1; visibility: visible; transform: none;
  box-shadow: var(--elev-popover);                   /* …and settles into its own */
  transition:
    transform 440ms var(--ease-spring),
    box-shadow 420ms var(--ease-out) 40ms,
    opacity 160ms linear,
    visibility 0s;
}
/* contents choreography — --i is each row's order (set in JS / below), capped so long lists stay quick */
.contents-pop .contents-head, .contents-pop .contents-list > *, .contents-pop .contents-foot, .reader-panel > *, .search-panel > * {
  opacity: 0; transform: translateY(-3px); filter: blur(2px);
  transition: opacity 100ms linear, transform 120ms var(--ease-in), filter 100ms linear;   /* close: first to go */
}
.contents-pop.open .contents-head, .contents-pop.open .contents-list > *, .contents-pop.open .contents-foot, .reader-panel.open > *, .search-panel.open > * {
  opacity: 1; transform: none; filter: none;
  --d: calc(100ms + min(var(--i, 0), 12) * 18ms);
  transition: opacity 260ms var(--ease-out) var(--d), transform 380ms var(--ease-out) var(--d), filter 260ms var(--ease-out) var(--d);
}
/* rows rise into place from 8px below while opening (set as the start value only when opening) */
.contents-pop.opening .contents-head, .contents-pop.opening .contents-list > *, .contents-pop.opening .contents-foot, .reader-panel.opening > *, .search-panel.opening > * { transform: translateY(8px); transition: none; }
.reader-panel > :nth-child(1) { --i: 0; } .reader-panel > :nth-child(2) { --i: 1; } .reader-panel > :nth-child(3) { --i: 2; }
.reader-panel > :nth-child(4) { --i: 3; } .reader-panel > :nth-child(5) { --i: 4; } .reader-panel > :nth-child(6) { --i: 5; }
.reader-panel > :nth-child(7) { --i: 6; }
/* Contents popover — unfolds from the Contents button (its centre sits 30px above the panel's top edge) */
.contents-pop {
  position: fixed; top: 66px; left: 20px; z-index: 530; width: 312px; max-height: min(76vh, 640px);
  overflow-y: auto; overscroll-behavior: contain; padding: 5px 5px 8px;
  transform-origin: 23px -30px; scrollbar-width: thin;
}
.contents-head {
  text-align: center; font-family: var(--font-ui); font-size: var(--ui-meta); font-weight: 600; letter-spacing: 0.01em;
  color: var(--chrome-text-2); padding: 9px 0 8px; margin: 0 9px 3px; border-bottom: 0.5px solid var(--chrome-line);
}
/* Contents list — Apple Books TOC: SF 13px throughout; parts bold & flush-left, chapters medium &
   indented, gray page numbers, even row rhythm; dropdown sections: same style, regular weight. */
.contents-list { display: flex; flex-direction: column; }
.contents-pop .toc-header,
.contents-pop .toc-label,
.contents-pop .toc-page,
.contents-pop .toc-section,
.contents-pop .toc-desc { font-family: var(--font-ui); font-style: normal; letter-spacing: 0; }
.toc-header { font-size: var(--ui-control); line-height: 1.25; font-weight: 700; color: var(--chrome-text); padding: 7px 14px; margin: 1px 0; }
.toc-item {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; padding: 7px 14px; margin: 1px 0;
  border-radius: var(--r-control); outline-offset: -2px;
  transition: background-color var(--dur-micro) var(--ease-out);
}
.toc-item:hover { background: var(--fill-hover); }
.toc-item:active { background: var(--fill-pressed); transition-duration: 60ms; }
.toc-item.current { background: var(--fill-selected); }
/* selection = background only */
.contents-pop .toc-label { flex: 1; font-size: var(--ui-control); line-height: 1.25; color: var(--chrome-text); font-weight: 700; }
/* parts */
.contents-pop .toc-sub .toc-label { font-weight: 500; }
/* chapters */
.contents-pop .toc-page { font-size: var(--ui-control); line-height: 1.25; color: var(--chrome-text-2); font-variant-numeric: tabular-nums; font-weight: 400; }
.contents-pop .toc-desc { flex-basis: 100%; margin-top: 1px; font-size: var(--ui-meta); line-height: 1.35; color: var(--chrome-text-2); font-weight: 400; }
.toc-sub { padding-left: 30px; }
.toc-item.toc-has-sec { padding-left: 0; }
/* the disclosure caret sits in the indent */
.toc-caret {
  width: 20px; height: 20px; margin: -2px 0; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--chrome-text-2); border-radius: 50%;
  align-self: center; transition: transform var(--dur-short) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.toc-caret svg { width: 10px; height: 10px; }
.toc-caret:hover { color: var(--chrome-text); }
.toc-group.open > .toc-item .toc-caret { transform: rotate(90deg); }
.toc-sections {
  list-style: none; margin: 0; padding: 0; overflow: hidden; max-height: 0; opacity: 0;
  transition: max-height 220ms var(--ease-in), opacity 120ms linear;               /* collapse quickly */
}
.toc-group.open .toc-sections { max-height: 520px; opacity: 1; transition: max-height var(--dur-ui) var(--ease-out), opacity var(--dur-short) var(--ease-out) 40ms; }
.contents-pop .toc-section {
  display: block; padding: 7px 14px 7px 52px; margin: 1px 0; border-radius: var(--r-control); outline-offset: -2px;
  font-size: var(--ui-control); line-height: 1.25; color: var(--chrome-text); font-weight: 400;
  transition: background-color var(--dur-micro) var(--ease-out);
}
.contents-pop .toc-section:hover { background: var(--fill-hover); }
.contents-pop .toc-section:active { background: var(--fill-pressed); transition-duration: 60ms; }
/* contact row at the foot of Contents: small icons, full-size hit areas */
.contents-foot { display: flex; gap: 2px; align-items: center; padding: 8px 6px 0; margin: 6px 9px 0; border-top: 0.5px solid var(--chrome-line); }
.contents-foot a {
  width: 34px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-control);
  color: var(--chrome-text-2); transition: color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.contents-foot a:hover { color: var(--chrome-text); background: var(--fill-hover); }
.contents-foot a:active { background: var(--fill-pressed); }
.contents-foot svg { width: 17px; height: 17px; }
/* ── Themes & Settings popover — grows from the AA button ── */
.reader-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 296px; padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
  transform-origin: calc(100% - 61px) -30px;   /* the AA button's centre (AA sits left of Search in the group) */
  font-family: var(--font-ui); color: var(--chrome-text);
}
.reader-head { text-align: center; font-family: var(--font-ui); font-size: var(--ui-control); font-weight: 600; color: var(--chrome-text); padding-bottom: 2px; }
/* text size: two filled buttons with a stepped meter between */
.reader-seg { display: flex; align-items: center; gap: 10px; }
.reader-a {
  flex: none; height: 34px; min-width: 44px; padding: 0 12px; border: 0; border-radius: var(--r-control);
  background: var(--fill-hover); color: var(--chrome-text); cursor: pointer; font-family: var(--font-ui); line-height: 1;
  transition: background-color var(--dur-micro) var(--ease-out), transform var(--dur-ui) var(--ease-spring);
}
.reader-a.small { font-size: 13px; }
.reader-a.large { font-size: 20px; }
.reader-a:hover { background: var(--fill-pressed); }
.reader-a:active { transform: scale(0.94); transition-duration: 80ms; }
.reader-dots { flex: 1; display: flex; align-items: center; gap: 3px; }
.reader-dots i { flex: 1; height: 4px; border-radius: 2px; background: var(--fill-pressed); transition: background-color var(--dur-short) var(--ease-out); }
.reader-dots i.on { background: var(--chrome-text); }
/* Light / Dark / Auto — a segmented control (one track, the selected segment raised) */
.reader-appear { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2px; padding: 2px; background: var(--fill-hover); border-radius: var(--r-control); }
.reader-appear-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px;
  background: transparent; border: 0; border-radius: calc(var(--r-control) - 2px); padding: 0 6px;   /* concentric inside the 2px track inset */
  cursor: pointer; color: var(--chrome-text-2); font-family: var(--font-ui); font-size: var(--ui-meta); font-weight: 500;
  transition: color var(--dur-micro) var(--ease-out), background-color var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out);
}
.reader-appear-btn:hover { color: var(--chrome-text); }
.reader-appear-btn.is-active { color: var(--chrome-text); background: var(--chrome-bg); box-shadow: 0 0 0 0.5px var(--chrome-line), 0 1px 3px rgba(0, 0, 0, 0.1); }
.ap-ico { width: 12px; height: 12px; border-radius: 50%; flex: none; position: relative; box-shadow: 0 0 0 1.4px currentColor inset; }
.ap-light::after { content: ""; position: absolute; inset: 3.5px; border-radius: 50%; background: currentColor; }
.ap-dark { box-shadow: none; border: 1.4px solid currentColor; overflow: hidden; }
.ap-dark::after { content: ""; position: absolute; right: -3px; top: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--chrome-bg); }
.ap-auto::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; right: 0; background: currentColor; }
/* theme tiles */
.reader-presets { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.reader-preset {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 0; border-radius: var(--r-md); padding: 12px 6px 8px; cursor: pointer;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.1);
  transition: box-shadow var(--dur-short) var(--ease-out), transform var(--dur-ui) var(--ease-spring);
}
.reader-preset:active { transform: scale(0.96); transition-duration: 80ms; }
.reader-preset.is-active { box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 0 0 2px var(--popover-bg), 0 0 0 3.5px var(--chrome-text); }
.rp-aa { font-size: 22px; line-height: 1; }
.rp-label { font-family: var(--font-ui); font-size: 11px; font-weight: 500; }
.reader-preset[data-pv="cream"] { background: #F4E1C6; color: #2A2620; }
.reader-preset[data-pv="white"] { background: #FFFFFF; color: #1B1A17; }
.reader-preset[data-pv="sepia"] { background: #F3E7CE; color: #4A3924; }
.reader-preset[data-pv="gray"] { background: #E6E5E0; color: #2E2D2A; }
.reader-preset[data-pv="focus"] { background: #FBFAF6; color: #24231F; }
.reader-preset[data-pv="quiet"] { background: #3A3936; color: #E7E4DD; }
.reader-preset[data-pv="night"] { background: #1D1B18; color: #ECE6DA; }
/* Customize font — a filled text button that discloses a list */
.reader-customize {
  display: flex; align-items: center; justify-content: center; gap: 6px; height: 34px;
  background: var(--fill-hover); border: 0; border-radius: var(--r-control); padding: 0 12px;
  cursor: pointer; color: var(--chrome-text); font-family: var(--font-ui); font-size: var(--ui-control); font-weight: 500;
  transition: background-color var(--dur-micro) var(--ease-out);
}
.reader-customize:hover { background: var(--fill-pressed); }
.rc-caret { font-size: 14px; line-height: 1; color: var(--chrome-text-2); transition: transform var(--dur-short) var(--ease-out); }
.reader-customize[aria-expanded="true"] .rc-caret { transform: rotate(90deg); }
.reader-fonts { display: flex; flex-direction: column; gap: 1px; margin-top: -4px; }
.reader-fonts[hidden] { display: none; }
.reader-font {
  display: flex; align-items: center; justify-content: space-between; text-align: left;
  background: transparent; border: 0; border-radius: var(--r-control); padding: 8px 12px;
  cursor: pointer; color: var(--chrome-text); font-size: 15px; line-height: 1.2;
  transition: background-color var(--dur-micro) var(--ease-out);
}
.reader-font:hover { background: var(--fill-hover); }
.reader-font:active { background: var(--fill-pressed); }
.reader-font.is-active::after { content: "✓"; font-family: var(--font-ui); font-size: 13px; font-weight: 600; color: var(--chrome-text); }
/* Vertical Scrolling — the system switch */
.reader-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; background: none; border: 0; padding: 6px 2px 0; cursor: pointer; border-top: 0.5px solid var(--chrome-line); padding-top: 12px; }
.rs-label { font-family: var(--font-ui); font-size: var(--ui-control); color: var(--chrome-text); }
.rs-track { flex: none; width: 38px; height: 22px; border-radius: 11px; background: var(--fill-pressed); position: relative; transition: background-color var(--dur-short) var(--ease-out); }
.reader-switch.is-on .rs-track { background: #34C759; }
.rs-thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.2), 0 2px 5px rgba(0,0,0,0.1); transition: transform var(--dur-ui) var(--ease-spring); }
.reader-switch.is-on .rs-thumb { transform: translateX(16px); }
/* one-time hint pointing at the AA button — a dark HUD, like a macOS tooltip */
.reader-hint {
  position: fixed; top: 66px; right: 20px; z-index: 540; width: 216px; text-align: left;
  background: var(--hud-bg); color: var(--hud-text);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  font-family: var(--font-ui); font-size: var(--ui-meta); line-height: 1.42; font-weight: 500;
  padding: 10px 12px; border-radius: var(--r-md); box-shadow: var(--elev-popover);
  opacity: 0; transform: translateY(-4px) scale(0.97); transform-origin: calc(100% - 24px) 0;
  transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-ui) var(--ease-spring);
}
.reader-hint.show { opacity: 1; transform: none; }
.reader-hint b { font-weight: 700; }
@keyframes hintPulse {
  0%, 100% { box-shadow: var(--elev-chrome), 0 0 0 0 rgba(180, 130, 90, 0.45); }
  50%      { box-shadow: var(--elev-chrome), 0 0 0 6px rgba(180, 130, 90, 0); }
}
.reader-btn.hint-glow { animation: hintPulse 1.6s var(--ease-out) infinite; }
/* ── Page bar: folio centred, "pages left" on the right, whole-book progress along the edge ── */
.page-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 500; pointer-events: none;
  padding: 0 clamp(22px, 4vw, 60px);
  background: linear-gradient(to top, var(--bg) 58%, transparent);
  transition: opacity var(--dur-ui) var(--ease-out);
}
.page-bar-row { position: relative; height: 52px; }
.page-bar-num {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  font-family: var(--font-ui); font-size: var(--ui-meta); color: var(--text-muted); font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}
.page-bar-left {
  position: absolute; right: 0; bottom: 10px;
  font-family: var(--font-ui); font-size: var(--ui-caption); color: var(--text-muted); white-space: nowrap;
}
.page-bar-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--border); opacity: 0; transition: opacity var(--dur-ui) var(--ease-out); }
.page-bar.reading .page-bar-progress { opacity: 1; }
.page-bar-progress > i { display: block; height: 100%; width: 0; background: var(--text-secondary); transition: width var(--dur-major) var(--ease-out); }
@media (max-width: 560px) {
  .page-bar-left { display: none; }
}
/* ── Page-turn arrows in the margins: appear with the pointer, rest when it's still ── */
.book-arrow {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 460;
  width: 44px; height: 88px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: var(--r-control); cursor: pointer; color: var(--text-muted);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-ui) var(--ease-out), color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.book-arrow.left { left: 6px; }
.book-arrow.right { right: 6px; }
.book-arrow svg { width: 24px; height: 24px; transition: transform var(--dur-ui) var(--ease-spring); }
.book-arrow:hover { color: var(--text-primary); }
.book-arrow.left:active svg { transform: translateX(-3px); transition-duration: 90ms; }
.book-arrow.right:active svg { transform: translateX(3px); transition-duration: 90ms; }
html.arrows-on .book-arrow, .book-arrow:focus-visible { opacity: 1; pointer-events: auto; }
@media (max-width: 820px) {
  .book-arrow { display: none; }
}
/* ── Immersive reading on touch: tap the page centre to hide / show the chrome (as in Books on iPhone) ── */
html.chrome-hidden .book-toolbar, html.chrome-hidden .reader-ui, html.chrome-hidden .book-title { opacity: 0; transform: translateY(-6px); pointer-events: none; }
html.chrome-hidden .page-bar { opacity: 0; }
html.chrome-hidden .book-title { transform: translate(-50%, -6px); }
/* ── Touch sizing: bigger targets where fingers are the pointer ── */
@media (pointer: coarse) {
  .book-toolbar, .reader-group { height: 48px; padding: 5px; }
  .tb-btn, .reader-btn-aa { width: 40px; height: 38px; border-radius: 19px; }
  .book-toolbar, .reader-group { border-radius: 24px; }
  .reader-panel { transform-origin: calc(100% - 67px) -30px; }
  .search-panel { transform-origin: calc(100% - 25px) -30px; }
  .reader-btn-aa > span { line-height: 38px; }
  .contents-pop { top: 70px; }
  .toc-item, .contents-pop .toc-section { padding-top: 10px; padding-bottom: 10px; }
}
@media (max-width: 820px) {
  .book-toolbar { top: 10px; left: 12px; }
  .reader-ui { top: 10px; right: 12px; }
  .book-title { display: none; }
  .contents-pop { left: 12px; right: 12px; width: auto; max-width: 360px; }
  .reader-hint { right: 12px; }
}
/* ═══════════════════════════════════════════════════════════════════════════════════════════════
   LAYER 2 — THE BOOK
   The pages speak in book typography (the reader's chosen serif). Web-isms — monospace eyebrows,
   shouting caps, boxed stat cards, hover-lifting photos — become typographic devices a well-set
   book would use: chapter numbers, drop caps, run-in subheads, italic captions, hairline rules.
   ═══════════════════════════════════════════════════════════════════════════════════════════════ */
/* ── Chapter openers ── */
.case-hero[data-chapter]::before {
  content: "Chapter " attr(data-chapter);
  display: block; margin-bottom: var(--s-4);
  font-family: var(--reading-font); font-size: calc(12.5px * var(--reading-scale)); font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-secondary);
}
html.page-mode .case-hero, .case-panel.paginated .case-hero { padding-top: 5vh; }
.case-hero .case-sub { color: var(--text-secondary); }
/* drop cap on a chapter's first paragraph (Home's "About the author", each case's opening section) */
.hero-chapter-title + .hero-blurb::first-letter,
.case-section:first-of-type > h2 + p::first-letter {
  -webkit-initial-letter: 3; initial-letter: 3;
  font-weight: 600; color: var(--text-primary); margin-right: 0.08em;
  margin-left: 6px;                /* the raised cap's box overhangs its column by ~5px; keep it on its own page */
}
/* ── Run-in subheads: set in the book face, sentence as authored — not shouting caps ── */
.case-section h3 {
  font-family: var(--reading-font); font-size: calc(18.5px * var(--reading-scale)); font-weight: 600;
  text-transform: none; letter-spacing: 0; line-height: 1.35; color: var(--text-primary); margin: 30px 0 8px;
}
.case-section h4 { font-family: var(--reading-font); font-size: calc(17px * var(--reading-scale)); font-weight: 600; font-style: italic; }
.section-label {
  font-family: var(--reading-font); font-size: calc(24px * var(--reading-scale)); font-weight: 600;
  text-transform: none; letter-spacing: -0.2px; line-height: 1.25; color: var(--text-primary); margin-bottom: var(--s-4);
}
/* ── The case "book info" strip — like Apple Books' book details: caps label over value, hairline dividers ── */
.case-overview-bar {
  display: flex; flex-wrap: wrap; gap: var(--s-3) 0; background: none; border: 0; border-radius: 0; overflow: visible;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: var(--s-4) 0; margin: var(--s-6) 0 var(--s-12);
}
.overview-item { flex: 1 1 0; min-width: 118px; background: none; padding: 2px var(--s-4); border-left: 1px solid var(--border); }
.overview-item:first-child { border-left: 0; padding-left: 0; }
.overview-label {
  font-family: var(--font-ui); font-size: var(--ui-caption); font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 5px;
}
.overview-value { font-family: var(--reading-font); font-size: calc(15px * var(--reading-scale)); font-weight: 400; line-height: 1.4; color: var(--text-primary); }
/* ── Pull quotes, notes, figures ── */
.callout { border-left: 2px solid var(--text-primary); background: none; border-radius: 0; padding: 2px 0 2px var(--s-5); margin: var(--s-6) 0; }
.callout .callout-label {
  font-family: var(--font-ui); font-size: var(--ui-caption); font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--s-2);
}
.callout p { font-family: var(--reading-font); font-size: calc(18px * var(--reading-scale)); font-style: italic; line-height: 1.55; text-align: left; }
.psst { border-radius: var(--r-md); }
.process-col { border-radius: var(--r-md); }
.case-fig img, .case-fig video { border-radius: var(--r-md); }
.case-hero-img img { border-radius: var(--r-md); }
.case-fig figcaption, .moment figcaption {
  font-family: var(--reading-font); font-style: italic; font-size: calc(14px * var(--reading-scale));
  letter-spacing: 0; line-height: 1.45; color: var(--text-secondary); margin-top: var(--s-2);
}
.case-fig figcaption { text-align: center; }
/* ── Links inside the prose: a quiet underline that firms up on hover ── */
.case-section p a, .case-section li a, .about-prose a, .placeholder-lead a, .hero-blurb a, .psst a {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  transition: text-decoration-color var(--dur-micro) var(--ease-out);
}
.case-section p a:hover, .case-section li a:hover, .about-prose a:hover, .placeholder-lead a:hover, .hero-blurb a:hover, .psst a:hover { text-decoration-color: currentColor; }
/* ── About: a frontispiece portrait above the greeting (it used to be squeezed side-by-side) ── */
.about-intro { flex-direction: column; align-items: flex-start; gap: var(--s-5); padding: var(--s-10) 0 var(--s-8); }
.about-portrait { width: 150px; max-width: 45%; height: auto; border-radius: var(--r-md); box-shadow: var(--elev-media); flex: none; }
.about-hello { font-size: calc(clamp(30px, 3.4vw, 42px) * var(--reading-scale)); font-weight: 600; letter-spacing: -0.4px; }
.about-lead { color: var(--text-secondary); }
.exp-row { padding: var(--s-3) 0; gap: var(--s-4); }
.exp-role { font-family: var(--reading-font); font-size: calc(17px * var(--reading-scale)); font-weight: 600; }
.exp-org { font-family: var(--reading-font); font-size: calc(15px * var(--reading-scale)); color: var(--text-secondary); }
.exp-year { font-family: var(--font-ui); font-size: var(--ui-meta); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.moment img { border-radius: var(--r-md); box-shadow: var(--elev-media); transition: none; }
.moment:hover img { transform: none; box-shadow: var(--elev-media); }
/* printed photos don't jump off the page */
/* ── Bookshelf: the library shelves ── */
.shelf-status { font-family: var(--font-ui); font-size: var(--ui-meta); color: var(--text-muted); }
.filter-btn {
  font-family: var(--font-ui); font-size: var(--ui-meta); font-weight: 500; letter-spacing: 0;
  color: var(--text-secondary); background: var(--fill-hover); border: 0; border-radius: var(--r-control); padding: 6px 12px;
  transition: color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out), transform var(--dur-ui) var(--ease-spring);
}
.filter-btn:hover { color: var(--text-primary); background: var(--fill-pressed); }
.filter-btn:active { transform: scale(0.95); transition-duration: 80ms; }
.filter-btn.is-active { color: var(--bg); background: var(--text-primary); }
.book-row-author { font-family: var(--font-ui); font-size: var(--ui-control); color: var(--text-secondary); }
.book-tag {
  font-family: var(--font-ui); font-size: var(--ui-caption); letter-spacing: 0; color: var(--text-secondary);
  background: var(--fill-hover); border: 0; border-radius: var(--r-sm); padding: 2px 7px;
}
.book-row-cover { transition: opacity var(--dur-ui) var(--ease-out), transform var(--dur-ui) var(--ease-out); }
.book-row-cover img { border-radius: 3px; box-shadow: var(--elev-media); }
/* ── End-of-page colophon (live tracker) ── */
.now-cta { font-family: var(--font-ui); font-size: var(--ui-meta); transition: color var(--dur-micro) var(--ease-out); }
.now-arrow { transition: transform var(--dur-short) var(--ease-out); }
.now-cta:hover .now-arrow { transform: translateX(2px); }
/* ═══ MOTION — moving through the book ═══ */
/* opening a chapter: the page settles into place rather than sliding in like a web modal */
.case-panel {
  transform: scale(0.992);
  transition: opacity 200ms var(--ease-in), transform 200ms var(--ease-in), visibility 0s linear 200ms;
}
.case-panel.open {
  transform: none;
  transition: opacity var(--dur-major) var(--ease-out), transform var(--dur-major) var(--ease-out), visibility 0s;
}
/* the outgoing page's leading-edge shadow during a turn */
.page-ghost.fwd { box-shadow: -16px 0 24px -12px rgba(40, 30, 10, 0.22); }
.page-ghost.back { box-shadow:  16px 0 24px -12px rgba(40, 30, 10, 0.22); }
/* going between the book's pages (Home · About · Bookshelf are separate documents): a soft
   cross-fade with the app chrome held perfectly still, so it reads as one app, not page loads */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 180ms var(--ease-in) both vt-fade-out; }
::view-transition-new(root) { animation: 320ms var(--ease-out) both vt-fade-in; }
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }
.book-toolbar { view-transition-name: book-toolbar; }
.reader-group { view-transition-name: book-reader-group; }   /* on the group, not .reader-ui — a named ANCESTOR of the panels would stop their blur from seeing the page */
.book-title { view-transition-name: book-title; }
.page-bar { view-transition-name: book-page-bar; }
/* ═══ REDUCED MOTION — keep hierarchy & feedback, drop the movement ═══ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .contents-pop,
.reader-panel,
.search-panel,
.reader-hint,
.case-panel,
.book-toolbar,
.reader-ui,
.tb-btn,
.reader-btn-aa,
.reader-a,
.reader-preset,
.filter-btn,
.rs-thumb,
.toc-caret,
.book-arrow svg,
html.chrome-hidden .book-toolbar,
html.chrome-hidden .reader-ui { transform: none !important; }
  html.chrome-hidden .book-title { transform: translateX(-50%) !important; }
  .reader-switch.is-on .rs-thumb { transform: translateX(16px) !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
/* Layer 2 default: anything on the page that isn't explicitly styled is set in the reader's book face
   (so lists, notes and small content blocks follow Themes & Settings → font, like Apple Books). The
   chrome always declares --font-ui itself. */
body { font-family: var(--reading-font); }
.case-section li { line-height: 1.6; }
@media (prefers-reduced-motion: reduce) {
  .contents-pop .contents-head, .contents-pop .contents-list > *, .contents-pop .contents-foot, .reader-panel > *, .search-panel > * { transform: none !important; filter: none !important; }
}

/* ── Search popover — "In this book", grows from the magnifier; Recent Searches, then results ── */
.search-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 1; width: 344px; padding: 12px 8px 8px;
  display: flex; flex-direction: column; gap: 6px;
  transform-origin: calc(100% - 23px) -30px;          /* the magnifier's centre */
  font-family: var(--font-ui); color: var(--chrome-text);
}
.search-panel > :nth-child(1) { --i: 0; } .search-panel > :nth-child(2) { --i: 1; } .search-panel > :nth-child(3) { --i: 2; }
.sr-field {
  position: relative; display: flex; align-items: center; height: 38px; margin: 0 4px 4px;
  background: rgba(255, 255, 255, 0.5); border-radius: 19px;
  box-shadow: inset 0 0 0 0.5px var(--chrome-line);
  transition: box-shadow var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out);
}
html[data-theme="quiet"] .sr-field, html[data-theme="night"] .sr-field { background: rgba(255, 255, 255, 0.08); }
.sr-field:focus-within { box-shadow: inset 0 0 0 0.5px var(--chrome-line), 0 0 0 3.5px var(--fill-pressed); }   /* Apple's soft field ring */
.sr-field > svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--chrome-text-2); pointer-events: none; }
.sr-input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; padding: 0 34px 0 36px;
  font: 400 15px/1 var(--font-ui); color: var(--chrome-text); caret-color: #E0A100;   /* Books' warm caret */
}
.sr-input::placeholder { color: var(--chrome-text-2); opacity: 1; }
.sr-input::-webkit-search-cancel-button { display: none; }
.sr-clear-q {
  position: absolute; right: 8px; width: 20px; height: 20px; border: 0; border-radius: 50%; padding: 0; cursor: pointer;
  display: none; align-items: center; justify-content: center; background: var(--chrome-text-2); color: var(--chrome-bg);
  opacity: 0.7; transition: opacity var(--dur-micro) var(--ease-out);
}
.sr-clear-q:hover { opacity: 1; }
.sr-clear-q svg { width: 9px; height: 9px; }
.sr-field.has-q .sr-clear-q { display: inline-flex; }
.sr-head { display: flex; align-items: baseline; justify-content: space-between; padding: 6px 14px 2px; font-size: var(--ui-control); color: var(--chrome-text-2); }
.sr-head button {
  border: 0; background: none; padding: 2px 4px; margin: -2px -4px; border-radius: 6px; cursor: pointer;
  font: 400 var(--ui-control) var(--font-ui); color: var(--chrome-text); transition: opacity var(--dur-micro) var(--ease-out);
}
.sr-head button:hover { opacity: 0.65; }
.sr-list { display: flex; flex-direction: column; max-height: min(58vh, 440px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.sr-row {
  display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
  padding: 8px 14px; margin: 1px 0; border-radius: var(--r-control); color: var(--chrome-text); font-family: var(--font-ui);
  transition: background-color var(--dur-micro) var(--ease-out);
}
.sr-row:hover { background: var(--fill-hover); }
.sr-row:active { background: var(--fill-pressed); transition-duration: 60ms; }
.sr-row:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.sr-recent { flex-direction: row; align-items: center; gap: 9px; padding-top: 7px; padding-bottom: 7px; font-size: 15px; font-weight: 600; }
.sr-recent svg { width: 15px; height: 15px; flex: none; color: var(--chrome-text-2); }
.sr-where { font-size: var(--ui-caption); font-weight: 600; letter-spacing: 0.02em; color: var(--chrome-text-2); }
.sr-text { font-size: var(--ui-control); line-height: 1.4; color: var(--chrome-text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sr-text b { font-weight: 700; }
.sr-empty { padding: 14px; font-size: var(--ui-control); color: var(--chrome-text-2); text-align: center; }
@media (max-width: 820px) { .search-panel { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; } }

/* the passage a search result lands on glows briefly, like Books' found-text highlight */
@keyframes searchFlash {
  0%, 55% { background-color: rgba(255, 204, 51, 0.42); box-shadow: 0 0 0 4px rgba(255, 204, 51, 0.42); }
  100% { background-color: rgba(255, 204, 51, 0); box-shadow: 0 0 0 4px rgba(255, 204, 51, 0); }
}
.search-flash { animation: searchFlash 2.6s var(--ease-out) both; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { .search-flash { animation-duration: 2.6s !important; } }

/* ── "Ask this book" — the search popover as a quiet conversation ── */
.search-panel .sr-list { max-height: min(62vh, 520px); scroll-behavior: smooth; }
.sr-ex { padding: 8px 14px 12px; }
.sr-ex + .sr-ex { border-top: 0.5px solid var(--chrome-line); padding-top: 12px; }
.sr-q { font: 600 15px/1.35 var(--font-ui); color: var(--chrome-text); margin-bottom: 6px; }
.sr-a { font: 400 13.5px/1.5 var(--font-ui); color: var(--chrome-text); }
.sr-a p { margin: 0 0 8px; }
.sr-a ul { margin: 0 0 8px 18px; padding: 0; }
.sr-a li { margin: 0 0 3px; }
.sr-a b { font-weight: 650; }
.sr-thinking {                                     /* shimmering placeholder while the answer is composed */
  display: inline-block; font: 500 13px var(--font-ui);
  background: linear-gradient(90deg, var(--chrome-text-2) 0%, var(--chrome-text-2) 40%, var(--chrome-text) 50%, var(--chrome-text-2) 60%, var(--chrome-text-2) 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: srShimmer 1.6s linear infinite;
}
@keyframes srShimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.sr-caret { display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -0.15em; background: #E0A100; border-radius: 1px; animation: srCaret 1s steps(1) infinite; }
@keyframes srCaret { 50% { opacity: 0; } }
.sr-sources { margin: 6px -10px 0; }
.sr-sources-label { padding: 0 10px 2px; font: 600 var(--ui-caption) var(--font-ui); letter-spacing: 0.02em; color: var(--chrome-text-2); }
.sr-source { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; font-size: var(--ui-control); font-weight: 500; }
.sr-source svg { width: 11px; height: 11px; flex: none; color: var(--chrome-text-2); }
.sr-note { font: 400 12.5px/1.45 var(--font-ui); color: var(--chrome-text-2); margin: 2px 0 6px; }
.sr-a > .sr-row { margin-left: -14px; margin-right: -14px; width: calc(100% + 28px); }   /* fallback passage rows, full-bleed */
@media (prefers-reduced-motion: reduce) { .sr-thinking { animation: none; color: var(--chrome-text-2); background: none; } .sr-caret { animation: none; } }
