/* =====================================================================
   Diginotes — scrapbook themes
   One set of page components, three visual languages.
   Pages size themselves with container queries (cqi/cqb) so the same
   markup works full-screen on a phone, on a desktop, and in previews.
   ===================================================================== */

.sb {
  --ease: cubic-bezier(.2, .7, .15, 1);
  --ui-space: 0px;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  background: var(--sb-bg);
  color: var(--sb-ink);
  font-family: var(--sb-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.sb *, .sb *::before, .sb *::after { box-sizing: border-box; }
.sb-stage { position: absolute; inset: 0; touch-action: pan-y; outline: none; user-select: none; -webkit-user-select: none; }
.sb-stage:focus-visible { box-shadow: inset 0 0 0 2px var(--sb-accent); }

.pg {
  position: absolute; inset: 0;
  container: pg / size;
  overflow-x: hidden; overflow-y: auto;
  scrollbar-width: none;
  background: var(--sb-bg);
  visibility: hidden; opacity: 0;
  transition: transform .75s var(--ease), opacity .75s var(--ease), visibility 0s linear .75s;
}
.pg::-webkit-scrollbar { display: none; }
.pg.is-active { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; z-index: 2; }
.pg-in { position: relative; min-height: 100%; }
.pg p, .pg h1, .pg h2, .pg ul, .pg ol, .pg blockquote, .pg figure { margin: 0; }
.pg ul, .pg ol { list-style: none; padding: 0; }
.pg h1, .pg h2 { font-weight: 400; text-wrap: balance; }
.pg p { text-wrap: pretty; }

/* photos */
.ph { position: relative; --ar: 1.3333; }
.ph[data-o="portrait"] { --ar: .8; }
.ph[data-o="square"] { --ar: 1; }
.ph-img { display: block; position: relative; width: 100%; aspect-ratio: var(--ar); overflow: hidden; background: var(--sb-ph, rgba(0,0,0,.08)); }
.ph-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; opacity: 1; transition: opacity .6s ease; }
.ph-img img[data-src] { opacity: 0; }
.ph-empty { position: absolute; inset: 0; background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(0,0,0,.04) 10px 11px); }

/* reveal on page entry */
.pg.is-active .rv { animation: sb-rise 1s var(--ease) both; animation-delay: calc(.15s + var(--k, 0) * .09s); }
@keyframes sb-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.no-anim .rv, .no-anim .doodle path, .no-anim .ph img { animation: none !important; }

.doodle { position: absolute; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; overflow: visible; pointer-events: none; }
.doodle path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.pg.is-active .doodle path { animation: sb-draw 1.4s .5s var(--ease) both; }
@keyframes sb-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* viewer chrome */
.vw-ui { position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; pointer-events: none; color: var(--sb-ui); transition: opacity .5s ease; }
.vw-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: color-mix(in srgb, var(--sb-ui) 14%, transparent); }
.viewer-full .vw-bar { position: fixed; top: env(safe-area-inset-top, 0px); bottom: auto; }
.vw-bar-fill { display: block; height: 100%; background: var(--sb-ui); transform-origin: left; transition: transform .6s var(--ease); }
.vw-row { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
.vw-btn {
  pointer-events: auto; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  color: inherit; background: color-mix(in srgb, var(--sb-bg) 55%, transparent);
  border: 1px solid color-mix(in srgb, var(--sb-ui) 28%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: transform .25s var(--ease), border-color .25s, opacity .25s;
}
.vw-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.vw-btn:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--sb-ui); }
.vw-btn:disabled { opacity: .25; cursor: default; }
.vw-btn:focus-visible { outline: 2px solid var(--sb-ui); outline-offset: 2px; }
.vw-count { font: 500 12px/1 var(--sb-mono); letter-spacing: .14em; min-width: 7.5em; text-align: center; font-variant-numeric: tabular-nums; }
.viewer-full.ui-idle .vw-row { opacity: 0; }
.viewer-full.ui-idle .vw-row:focus-within { opacity: 1; }
.sb.viewer { --ui-space: 76px; }
.sb.viewer-embed { --ui-space: 64px; }
.viewer-embed .vw-row { padding: 10px 12px 12px; gap: 12px; }
.viewer-embed .vw-btn { width: 38px; height: 38px; }
.vw-more { position: absolute; left: 50%; bottom: calc(var(--ui-space) + 4px); z-index: 11; transform: translateX(-50%); font: 11px/1 var(--sb-mono); letter-spacing: .14em; text-transform: uppercase; padding: 8px 12px; border-radius: 999px; color: var(--sb-ui); background: color-mix(in srgb, var(--sb-bg) 80%, transparent); border: 1px solid color-mix(in srgb, var(--sb-ui) 20%, transparent); pointer-events: none; opacity: 0; transition: opacity .4s; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sb.can-scroll .vw-more { opacity: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* end card */
.pg-end .pg-in { display: grid; place-content: center; justify-items: center; text-align: center; gap: 18px; padding: 10cqmin 8cqi var(--ui-space); }
.end-mark { font-family: var(--sb-display); font-size: clamp(2.6rem, 14cqi, 7rem); line-height: 1; }
.end-by { font: 12px/1.4 var(--sb-mono); letter-spacing: .16em; text-transform: uppercase; opacity: .7; }
.end-replay { font: inherit; font-size: 15px; background: none; border: 0; color: inherit; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; padding: 10px; }
.end-cta { margin-top: 5cqb; padding-top: 28px; border-top: 1px solid color-mix(in srgb, var(--sb-ink) 18%, transparent); display: grid; gap: 14px; justify-items: center; max-width: 30em; }
.end-cta p { font-family: var(--sb-display); font-size: clamp(1.3rem, 5cqi, 2rem); line-height: 1.15; }
.end-link { color: inherit; font-family: var(--sb-ui-font, var(--sb-body)); font-size: 15px; font-weight: 700; text-decoration: none; padding: 14px 22px; border: 1px solid currentColor; border-radius: 4px; transition: background .25s, color .25s; }
.end-link:hover { background: var(--sb-ink); color: var(--sb-bg); }

/* scaled previews */
.mini-holder { position: relative; width: 100%; overflow: hidden; }
.sb.mini { position: absolute; top: 0; left: 0; transform-origin: 0 0; pointer-events: none; }
.sb.mini .pg { transition: none; }

/* =====================================================================
   THEME 01 — CLASSIC SCRAPBOOK
   ===================================================================== */
.sb[data-theme="classic"] {
  --sb-bg: #F2EAD8;
  --sb-ink: #2C2115;
  --sb-soft: #5C4E3A;
  --sb-faint: #8A7A5E;
  --sb-accent: #7C2F2F;
  --sb-gold: #AB8446;
  --sb-sage: #52603F;
  --sb-card: #FBF7EC;
  --sb-line: #D9C9A3;
  --sb-ui: #5C4E3A;
  --sb-ph: #E2D5B8;
  --sb-display: "Fraunces", "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sb-body: "Fraunces", "Crimson Pro", "Iowan Old Style", Georgia, serif;
  --sb-hand: "Caveat", "Nothing You Could Do", "Segoe Print", "Bradley Hand", cursive;
  --sb-script: "Homemade Apple", "Nothing You Could Do", "Caveat", cursive;
  --sb-sans: "Work Sans", "Instrument Sans", system-ui, sans-serif;
  --sb-mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sb-ui-font: "Work Sans", "Instrument Sans", system-ui, sans-serif;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .32 0 0 0 0 .25 0 0 0 0 .16 0 0 0 .11 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.sb[data-theme="classic"] .pg {
  background:
    radial-gradient(120% 90% at 50% 35%, rgba(255, 251, 242, .7), rgba(255, 251, 242, 0) 65%),
    linear-gradient(90deg, rgba(60, 40, 20, .10), rgba(60, 40, 20, 0) 5%),
    var(--grain),
    var(--sb-bg);
}
.sb[data-theme="classic"] .pg.is-next { transform: translateX(7%) rotate(1.2deg); opacity: 0; }
.sb[data-theme="classic"] .pg.is-prev { transform: translateX(-5%) rotate(-1deg); opacity: 0; }
.sb[data-theme="classic"] .pg-in { display: grid; align-content: center; gap: 4.2cqmin; padding: 9cqmin 8cqi calc(9cqmin + var(--ui-space, 0px)); }
.sb[data-theme="classic"] .doodle { color: var(--sb-accent); }
.sb[data-theme="classic"] .kicker, .sb[data-theme="classic"] .eyebrow { font: 600 clamp(1.1rem, 4.6cqi, 1.45rem)/1.2 var(--sb-hand); color: var(--sb-gold); text-transform: lowercase; }
.sb[data-theme="classic"] .hand, .sb[data-theme="classic"] .polaroid figcaption { font-family: var(--sb-hand); }

.sb[data-theme="classic"] .polaroid { background: var(--sb-card); padding: 4.2% 4.2% 15%; transform: rotate(var(--r, 0deg)); box-shadow: 0 1px 1px rgba(50, 35, 20, .14), 0 14px 28px -12px rgba(50, 35, 20, .45); }
.sb[data-theme="classic"] .polaroid .ph-img { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.sb[data-theme="classic"] .polaroid figcaption { position: absolute; left: 6%; right: 6%; bottom: 2.5%; height: 11%; display: flex; align-items: center; justify-content: center; font-size: clamp(.8rem, 4.4cqmin, 1.6rem); color: var(--sb-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb[data-theme="classic"] .tape { position: absolute; z-index: 2; width: 36%; height: max(18px, 9%); background: linear-gradient(180deg, rgba(240, 226, 186, .82), rgba(228, 212, 170, .78)); box-shadow: 0 1px 2px rgba(60, 40, 10, .12);
  clip-path: polygon(0 8%, 6% 0, 12% 10%, 18% 0, 24% 8%, 30% 0, 36% 10%, 42% 0, 48% 8%, 54% 0, 60% 10%, 66% 0, 72% 8%, 78% 0, 84% 10%, 90% 0, 96% 8%, 100% 0, 100% 92%, 94% 100%, 88% 90%, 82% 100%, 76% 92%, 70% 100%, 64% 90%, 58% 100%, 52% 92%, 46% 100%, 40% 90%, 34% 100%, 28% 92%, 22% 100%, 16% 90%, 10% 100%, 4% 92%, 0 100%); }
.sb[data-theme="classic"] .tape-a { top: -3.5%; left: 32%; transform: rotate(-3deg); }
.sb[data-theme="classic"] .tape-b { top: 2%; right: -9%; width: 30%; transform: rotate(38deg); background: linear-gradient(180deg, rgba(214, 198, 214, .8), rgba(200, 186, 206, .76)); }
.sb[data-theme="classic"] .tape-c { bottom: 4%; left: -8%; width: 28%; transform: rotate(-40deg); }
.sb[data-theme="classic"] .stamp { position: absolute; z-index: 3; top: 5cqmin; right: 6cqi; font: 11px/1 var(--sb-mono); letter-spacing: .12em; color: var(--sb-accent); border: 1px solid currentColor; padding: 6px 8px 5px; transform: rotate(4deg); opacity: .75; }

/* cover */
.sb[data-theme="classic"] .pg-cover .pg-in { justify-items: center; text-align: center; }
.sb[data-theme="classic"] .cover-ph { width: min(70cqi, calc(42cqb * var(--ar))); }
.sb[data-theme="classic"] .cover-txt { display: grid; justify-items: center; gap: 1.4cqmin; position: relative; }
.sb[data-theme="classic"] .cover-title { font-family: var(--sb-display); font-weight: 500; font-size: clamp(2.1rem, 11.5cqi, 6.4rem); line-height: 1; letter-spacing: -.015em; max-width: 12ch; }
.sb[data-theme="classic"] :is(.mem-h, .col-h, .tl-h, .ls-h, .qz-h) { font-weight: 500; letter-spacing: -.01em; }
.sb[data-theme="classic"] .cover-txt .doodle-squiggle { position: relative; width: min(34cqi, 220px); height: auto; margin-top: -.4cqmin; }
.sb[data-theme="classic"] .cover-names { font-family: var(--sb-script); font-size: clamp(1.1rem, 5.4cqi, 2.3rem); color: var(--sb-accent); line-height: 1.2; }
.sb[data-theme="classic"] .d-cover { width: 9cqmin; top: 7cqmin; left: 8cqi; transform: rotate(-12deg); }
@container pg (orientation: landscape) {
  .sb[data-theme="classic"] .pg-cover .pg-in { grid-template-columns: 1fr 1fr; align-items: center; justify-items: start; text-align: left; column-gap: 8cqi; padding-inline: 10cqi; }
  .sb[data-theme="classic"] .pg-cover .cover-ph { width: min(36cqi, calc(66cqb * var(--ar))); justify-self: end; }
  .sb[data-theme="classic"] .cover-txt { justify-items: start; }
  .sb[data-theme="classic"] .cover-title { font-size: clamp(2.2rem, 7.2cqi, 8rem); }
  .sb[data-theme="classic"] .cover-names { font-size: clamp(1.2rem, 3cqi, 3rem); }
}

/* hero */
.sb[data-theme="classic"] .pg-hero .pg-in { justify-items: center; text-align: center; }
.sb[data-theme="classic"] .hero-ph { width: min(80cqi, calc(48cqb * var(--ar))); }
.sb[data-theme="classic"] .hero-txt { position: relative; }
.sb[data-theme="classic"] .hero-text { font-family: var(--sb-display); font-size: clamp(1.6rem, 7.6cqi, 4.2rem); line-height: 1.08; max-width: 16ch; margin-inline: auto; }
.sb[data-theme="classic"] .d-hero { width: 16cqmin; right: -6cqmin; top: -9cqmin; transform: rotate(160deg) scaleY(-1); }
@container pg (orientation: landscape) {
  .sb[data-theme="classic"] .pg-hero .pg-in { grid-template-columns: 1fr 1.1fr; align-items: center; text-align: left; justify-items: start; padding-inline: 10cqi; column-gap: 7cqi; }
  .sb[data-theme="classic"] .pg-hero .hero-ph { order: 2; width: min(44cqi, calc(66cqb * var(--ar))); justify-self: center; }
  .sb[data-theme="classic"] .hero-text { font-size: clamp(1.6rem, 4.2cqi, 4.8rem); margin-inline: 0; }
}

/* memory */
.sb[data-theme="classic"] .mem-ph { width: min(50cqi, calc(30cqb * var(--ar))); justify-self: end; margin-right: 2cqi; }
.sb[data-theme="classic"] .mem-txt { display: grid; gap: 2.4cqmin; max-width: 60ch; }
.sb[data-theme="classic"] .mem-h { font-family: var(--sb-display); font-size: clamp(1.8rem, 8.4cqi, 3.6rem); line-height: 1; }
.sb[data-theme="classic"] .mem-body { display: grid; gap: .8em; font-size: clamp(1.05rem, 4.4cqi, 1.3rem); line-height: 1.55; color: var(--sb-ink); }
.sb[data-theme="classic"] .d-mem { width: 7cqmin; left: 7cqi; top: 10cqmin; }
@container pg (orientation: landscape) {
  .sb[data-theme="classic"] .pg-memory .pg-in { grid-template-columns: 1.2fr 1fr; align-items: center; column-gap: 8cqi; padding-inline: 10cqi; }
  .sb[data-theme="classic"] .pg-memory .mem-ph { order: 2; width: min(34cqi, calc(62cqb * var(--ar))); justify-self: center; margin: 0; }
  .sb[data-theme="classic"] .mem-h { font-size: clamp(1.8rem, 4.4cqi, 4.4rem); }
  .sb[data-theme="classic"] .mem-body { font-size: clamp(1.05rem, 1.6cqi, 1.45rem); }
}

/* collage */
.sb[data-theme="classic"] .col-head { text-align: center; display: grid; gap: 1.6cqmin; }
.sb[data-theme="classic"] .col-h { font-family: var(--sb-display); font-size: clamp(1.8rem, 8.4cqi, 4rem); line-height: 1; }
.sb[data-theme="classic"] .col-grid { position: relative; height: 58cqb; width: 100%; }
.sb[data-theme="classic"] .col-grid .ph { position: absolute; }
.sb[data-theme="classic"] .col-grid[data-n="1"] .col-ph-1 { left: 50%; top: 50%; width: min(78%, calc(48cqb * var(--ar))); translate: -50% -50%; }
.sb[data-theme="classic"] .col-grid[data-n="2"] .col-ph-1 { left: 0; top: 0; width: min(64%, calc(34cqb * var(--ar))); }
.sb[data-theme="classic"] .col-grid[data-n="2"] .col-ph-2 { right: 0; bottom: 0; width: min(60%, calc(32cqb * var(--ar))); }
.sb[data-theme="classic"] .col-grid[data-n="3"] .col-ph-1 { left: 0; top: 0; width: min(60%, calc(28cqb * var(--ar))); }
.sb[data-theme="classic"] .col-grid[data-n="3"] .col-ph-2 { right: 0; top: 24%; width: min(52%, calc(25cqb * var(--ar))); z-index: 2; }
.sb[data-theme="classic"] .col-grid[data-n="3"] .col-ph-3 { left: 8%; bottom: 0; width: min(54%, calc(24cqb * var(--ar))); z-index: 1; }
.sb[data-theme="classic"] .col-grid[data-n="4"] .ph { width: min(47%, calc(24cqb * var(--ar))); }
.sb[data-theme="classic"] .col-grid[data-n="4"] .col-ph-1 { left: 0; top: 0; }
.sb[data-theme="classic"] .col-grid[data-n="4"] .col-ph-2 { right: 0; top: 4%; }
.sb[data-theme="classic"] .col-grid[data-n="4"] .col-ph-3 { left: 3%; bottom: 0; }
.sb[data-theme="classic"] .col-grid[data-n="4"] .col-ph-4 { right: 2%; bottom: 3%; }
.sb[data-theme="classic"] .col-cap { font-family: var(--sb-hand); font-size: clamp(1.05rem, 4.8cqi, 1.8rem); text-align: center; color: var(--sb-accent); line-height: 1.35; }
@container pg (orientation: landscape) {
  .sb[data-theme="classic"] .col-grid { height: 54cqb; max-width: 1400px; justify-self: center; }
  .sb[data-theme="classic"] .col-h { font-size: clamp(1.8rem, 4.4cqi, 4.4rem); }
  .sb[data-theme="classic"] .col-grid[data-n="2"] .col-ph-1 { left: 12%; width: min(38%, calc(44cqb * var(--ar))); }
  .sb[data-theme="classic"] .col-grid[data-n="2"] .col-ph-2 { right: 12%; width: min(36%, calc(42cqb * var(--ar))); }
  .sb[data-theme="classic"] .col-grid[data-n="3"] .col-ph-1 { left: 4%; top: 2%; width: min(34%, calc(44cqb * var(--ar))); }
  .sb[data-theme="classic"] .col-grid[data-n="3"] .col-ph-2 { left: 35%; right: auto; top: 16%; width: min(31%, calc(40cqb * var(--ar))); }
  .sb[data-theme="classic"] .col-grid[data-n="3"] .col-ph-3 { left: auto; right: 4%; bottom: auto; top: 0; width: min(30%, calc(42cqb * var(--ar))); }
  .sb[data-theme="classic"] .col-grid[data-n="4"] .ph { width: min(24%, calc(36cqb * var(--ar))); }
  .sb[data-theme="classic"] .col-grid[data-n="4"] .col-ph-1 { left: 2%; top: 6%; }
  .sb[data-theme="classic"] .col-grid[data-n="4"] .col-ph-2 { left: 26%; right: auto; top: 20%; }
  .sb[data-theme="classic"] .col-grid[data-n="4"] .col-ph-3 { left: 51%; bottom: auto; top: 2%; }
  .sb[data-theme="classic"] .col-grid[data-n="4"] .col-ph-4 { right: 2%; bottom: auto; top: 18%; }
}

/* timeline */
.sb[data-theme="classic"] .tl-head { display: grid; gap: 1.6cqmin; }
.sb[data-theme="classic"] .tl-h { font-family: var(--sb-display); font-size: clamp(1.8rem, 8.4cqi, 4rem); line-height: 1; }
.sb[data-theme="classic"] .tl { display: grid; gap: 4.2cqmin; position: relative; padding-left: 7cqi; }
.sb[data-theme="classic"] .tl::before { content: ""; position: absolute; left: 1.2cqi; top: .4em; bottom: .4em; border-left: 2px dashed color-mix(in srgb, var(--sb-accent) 55%, transparent); }
.sb[data-theme="classic"] .tl-item { display: grid; grid-template-columns: 24cqi 1fr; gap: 5cqi; align-items: center; position: relative; }
.sb[data-theme="classic"] .tl-item::before { content: ""; position: absolute; left: calc(-5.8cqi - 5px); top: 50%; width: 10px; height: 10px; border-radius: 50%; background: var(--sb-accent); translate: 0 -50%; }
.sb[data-theme="classic"] .tl-item:not(:has(.tl-ph)) { grid-template-columns: 1fr; }
.sb[data-theme="classic"] .tl-ph { width: 100%; }
.sb[data-theme="classic"] .tl-ph .ph-img { aspect-ratio: 1; }
.sb[data-theme="classic"] .tl-label { display: block; font-family: var(--sb-hand); color: var(--sb-accent); font-size: clamp(1.05rem, 5cqi, 1.7rem); line-height: 1.2; }
.sb[data-theme="classic"] .tl-text { font-size: clamp(1rem, 4.2cqi, 1.25rem); line-height: 1.45; }
@container pg (orientation: landscape) {
  .sb[data-theme="classic"] .pg-timeline .pg-in { padding-inline: 8cqi; }
  .sb[data-theme="classic"] .tl-h { font-size: clamp(1.8rem, 4.4cqi, 4.4rem); }
  .sb[data-theme="classic"] .tl { grid-template-columns: repeat(var(--n), 1fr); padding: 5cqmin 0 0; gap: 4cqi; }
  .sb[data-theme="classic"] .tl::before { left: 0; right: 0; top: 0; bottom: auto; border-left: 0; border-top: 2px dashed color-mix(in srgb, var(--sb-accent) 55%, transparent); }
  .sb[data-theme="classic"] .tl-item { grid-template-columns: 1fr; align-content: start; align-items: start; gap: 2.4cqmin; }
  .sb[data-theme="classic"] .tl-item::before { left: 0; top: calc(-5cqmin - 5px); translate: 0 0; }
  .sb[data-theme="classic"] .tl-ph { width: min(78%, 28cqb); }
  .sb[data-theme="classic"] .tl-label { font-size: clamp(1.05rem, 2.2cqi, 2rem); }
  .sb[data-theme="classic"] .tl-text { font-size: clamp(1rem, 1.5cqi, 1.3rem); }
}

/* list: little-things note cards */
.sb[data-theme="classic"] .ls-wrap { display: grid; gap: 1.2cqmin; }
.sb[data-theme="classic"] .ls-h { font-family: var(--sb-display); font-size: clamp(1.7rem, 7.6cqi, 3.4rem); line-height: 1.05; margin-bottom: 3cqmin; }
.sb[data-theme="classic"] .ls.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 3.4cqmin 3cqi; }
.sb[data-theme="classic"] .ls.cards .card { position: relative; width: 100%; min-height: 26cqmin; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 3.6cqmin 3.4cqi; text-align: left; background: var(--sb-card); border: 1px solid var(--sb-line); box-shadow: 0 6px 16px rgba(44, 33, 21, .1); color: var(--sb-ink); font: inherit; cursor: default; transition: transform .25s var(--ease), box-shadow .25s; }
.sb[data-theme="classic"] .ls.cards li:nth-child(odd) .card { transform: rotate(-1.6deg); }
.sb[data-theme="classic"] .ls.cards li:nth-child(even) .card { transform: rotate(1.4deg); }
.sb[data-theme="classic"] .ls.cards button.card { cursor: pointer; }
.sb[data-theme="classic"] .ls.cards button.card:hover { transform: rotate(0) translateY(-3px); box-shadow: 0 12px 24px rgba(44, 33, 21, .16); }
.sb[data-theme="classic"] .card-t { font: 600 clamp(1.15rem, 5.4cqi, 1.6rem)/1.1 var(--sb-hand); color: var(--sb-accent); }
.sb[data-theme="classic"] .card-d { font: 400 clamp(.78rem, 3.3cqi, .95rem)/1.4 var(--sb-sans); color: var(--sb-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sb[data-theme="classic"] .ls-mark { position: absolute; top: 8px; right: 8px; width: 14px; stroke-width: 1.8; opacity: .6; }
.sb[data-theme="classic"] .ls-hint { font: 500 1.1rem var(--sb-hand); color: var(--sb-faint); text-align: center; margin-top: 2cqmin; }
@container pg (orientation: landscape) {
  .sb[data-theme="classic"] .pg-list .pg-in { padding-inline: 12cqi; }
  .sb[data-theme="classic"] .ls.cards { grid-template-columns: repeat(3, 1fr); gap: 3cqmin 2.4cqi; }
  .sb[data-theme="classic"] .ls.cards[data-n="4"] { grid-template-columns: repeat(4, 1fr); }
  .sb[data-theme="classic"] .ls.cards .card { min-height: 18cqmin; padding: 2.6cqmin 1.8cqi; }
  .sb[data-theme="classic"] .ls-h { font-size: clamp(1.7rem, 3.8cqi, 3.8rem); }
  .sb[data-theme="classic"] .card-t { font-size: clamp(1.15rem, 2cqi, 1.9rem); }
  .sb[data-theme="classic"] .card-d { font-size: clamp(.8rem, 1.05cqi, 1rem); }
}

/* letter */
.sb[data-theme="classic"] .pg-letter .pg-in { justify-items: center; }
.sb[data-theme="classic"] .lt-paper { width: 100%; max-width: 34em; background: var(--sb-card); padding: 8cqmin 7cqi; box-shadow: 0 1px 1px rgba(50, 35, 20, .1), 0 16px 34px -16px rgba(50, 35, 20, .45); transform: rotate(-.5deg); display: grid; gap: 1em; }
.sb[data-theme="classic"] .lt-sal, .sb[data-theme="classic"] .lt-sig { font-family: var(--sb-script); color: var(--sb-ink); font-size: clamp(1rem, 4.4cqi, 1.35rem); line-height: 1.8; }
.sb[data-theme="classic"] .lt-sig { color: var(--sb-accent); }
.sb[data-theme="classic"] .lt-body { display: grid; gap: .9em; font-family: var(--sb-script); font-size: clamp(.95rem, 4.1cqi, 1.2rem); line-height: 1.95; }
.sb[data-theme="classic"] .lt-off { font-family: var(--sb-script); font-size: .95rem; color: var(--sb-soft); margin-top: .4em; }
.sb[data-theme="classic"] .lt-close { font-family: var(--sb-display); font-style: italic; font-size: clamp(2rem, 10cqi, 5rem); line-height: 1; text-align: center; margin-top: 3cqmin; }
.sb[data-theme="classic"] .d-close { position: relative; width: min(30cqi, 180px); }
@container pg (orientation: landscape) {
  .sb[data-theme="classic"] .pg-letter .pg-in:has(.lt-close) { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; column-gap: 6cqi; padding-inline: 8cqi; }
  .sb[data-theme="classic"] .pg-letter .lt-close { text-align: left; margin: 0; }
  .sb[data-theme="classic"] .pg-letter .d-close { display: none; }
  .sb[data-theme="classic"] .lt-paper { padding: 6cqmin 5cqi; }
  .sb[data-theme="classic"] .lt-body { font-size: clamp(.95rem, 1.3cqi, 1.25rem); }
  .sb[data-theme="classic"] .lt-close { font-size: clamp(2rem, 5.6cqi, 5.6rem); }
}

/* quote */
.sb[data-theme="classic"] .pg-quote .pg-in { justify-items: center; text-align: center; }
.sb[data-theme="classic"] .q-ph { width: min(66cqi, calc(40cqb * var(--ar))); }
.sb[data-theme="classic"] .q-txt { display: grid; gap: 2cqmin; }
.sb[data-theme="classic"] .q-text { font-family: var(--sb-display); font-style: italic; font-size: clamp(1.8rem, 9cqi, 4.8rem); line-height: 1.02; max-width: 14ch; }
.sb[data-theme="classic"] .q-cite { font: 12px var(--sb-mono); letter-spacing: .16em; text-transform: uppercase; font-style: normal; color: var(--sb-soft); }
@container pg (orientation: landscape) {
  .sb[data-theme="classic"] .pg-quote .pg-in { grid-template-columns: 1fr 1fr; align-items: center; text-align: left; justify-items: start; padding-inline: 10cqi; column-gap: 7cqi; }
  .sb[data-theme="classic"] .q-ph { width: min(38cqi, calc(62cqb * var(--ar))); justify-self: center; }
  .sb[data-theme="classic"] .q-text { font-size: clamp(1.8rem, 5cqi, 5rem); }
}
.sb[data-theme="classic"] .pg-end { color: var(--sb-ink); }
.sb[data-theme="classic"] .end-mark { font-style: italic; }

/* =====================================================================
   THEME 02 — CINEMATIC
   ===================================================================== */
.sb[data-theme="cinematic"] {
  --sb-bg: #0D0C0B;
  --sb-ink: #F2ECE3;
  --sb-soft: rgba(242, 236, 227, .66);
  --sb-accent: #E6C79C;
  --sb-ui: #F2ECE3;
  --sb-ph: #1B1916;
  --sb-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sb-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sb-mono: "DM Mono", ui-monospace, Menlo, monospace;
  --sb-ui-font: "Instrument Sans", system-ui, sans-serif;
  color-scheme: dark;
}
.sb[data-theme="cinematic"] .pg { transition: opacity 1.1s ease, visibility 0s linear 1.1s; }
.sb[data-theme="cinematic"] .pg.is-active { transition: opacity 1.1s ease; }
.sb[data-theme="cinematic"] .pg-in { padding: 0; min-height: 100%; display: grid; }
.sb[data-theme="cinematic"] .kicker, .sb[data-theme="cinematic"] .eyebrow { font: 700 11px/1.3 var(--sb-body); letter-spacing: .32em; text-transform: uppercase; color: var(--sb-accent); }
.sb[data-theme="cinematic"] .cine-meta { position: absolute; z-index: 5; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: max(18px, 4.5cqmin) 6cqi; font: 11px/1 var(--sb-mono); letter-spacing: .18em; color: rgba(242, 236, 227, .55); pointer-events: none; }
.sb[data-theme="cinematic"] .ph-img { aspect-ratio: auto; height: 100%; }
.sb[data-theme="cinematic"] .pg.is-active .ph img { animation: cine-kb 16s cubic-bezier(.25, .1, .25, 1) both; }
@keyframes cine-kb { from { transform: scale(1.1); filter: brightness(.6); } 12% { filter: brightness(1); } to { transform: scale(1.0); filter: brightness(1); } }
.sb[data-theme="cinematic"] .full { position: absolute; inset: 0; }
.sb[data-theme="cinematic"] .bar { position: absolute; left: 0; right: 0; height: 7cqb; background: #000; z-index: 4; transform-origin: top; }
.sb[data-theme="cinematic"] .bar-b { bottom: 0; transform-origin: bottom; }
.sb[data-theme="cinematic"] .bar-t { top: 0; }
.sb[data-theme="cinematic"] .pg.is-active .bar { animation: cine-bar 1.6s .2s var(--ease) both; }
@keyframes cine-bar { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.sb[data-theme="cinematic"] .scrim::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 7, 6, .35) 0%, rgba(8, 7, 6, 0) 28%, rgba(8, 7, 6, 0) 45%, rgba(8, 7, 6, .88) 100%); }

/* cover + hero + quote share the full-bleed layout */
.sb[data-theme="cinematic"] :is(.cover-ph, .hero-ph, .q-ph) { position: absolute; inset: 0; }
.sb[data-theme="cinematic"] :is(.cover-ph, .hero-ph, .q-ph) .ph-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 7, 6, .45) 0%, rgba(8, 7, 6, 0) 24%, rgba(8, 7, 6, .15) 40%, rgba(8, 7, 6, .72) 64%, rgba(8, 7, 6, .94) 100%); }
.sb[data-theme="cinematic"] :is(.cover-txt, .hero-txt, .q-txt) { text-shadow: 0 1px 18px rgba(0, 0, 0, .35); }
.sb[data-theme="cinematic"] :is(.cover-txt, .hero-txt, .q-txt) { position: relative; z-index: 3; align-self: end; display: grid; gap: 2.4cqmin; padding: 0 7cqi calc(12cqb + var(--ui-space, 0px) * .4); }
.sb[data-theme="cinematic"] .cover-title { font-family: var(--sb-display); font-style: italic; font-size: clamp(3rem, 16cqi, 12rem); line-height: .86; letter-spacing: -.02em; max-width: 9ch; }
.sb[data-theme="cinematic"] .cover-names { font: 700 12px/1.4 var(--sb-body); letter-spacing: .34em; text-transform: uppercase; }
.sb[data-theme="cinematic"] .cover-date { font: 12px/1 var(--sb-mono); letter-spacing: .14em; color: var(--sb-soft); }
.sb[data-theme="cinematic"] .hero-text { font-family: var(--sb-display); font-size: clamp(1.9rem, 8.4cqi, 5.6rem); line-height: 1.02; max-width: 17ch; }
.sb[data-theme="cinematic"] .q-txt { align-self: center; justify-items: center; text-align: center; padding-bottom: 0; }
.sb[data-theme="cinematic"] .q-ph .ph-img::after { background: rgba(8, 7, 6, .55); }
.sb[data-theme="cinematic"] .q-text { font-family: var(--sb-display); font-style: italic; font-size: clamp(2.2rem, 11cqi, 7rem); line-height: .98; max-width: 13ch; }
.sb[data-theme="cinematic"] .q-cite { font: 700 11px var(--sb-body); letter-spacing: .3em; text-transform: uppercase; font-style: normal; color: var(--sb-soft); }
@container pg (orientation: landscape) {
  .sb[data-theme="cinematic"] :is(.cover-ph, .hero-ph) .ph-img::after { background: linear-gradient(90deg, rgba(8, 7, 6, .72) 0%, rgba(8, 7, 6, .35) 38%, rgba(8, 7, 6, 0) 62%), linear-gradient(180deg, rgba(8, 7, 6, .4) 0%, rgba(8, 7, 6, 0) 25%, rgba(8, 7, 6, 0) 55%, rgba(8, 7, 6, .85) 100%); }
  .sb[data-theme="cinematic"] .cover-title { font-size: clamp(3rem, 10cqi, 13rem); }
  .sb[data-theme="cinematic"] .hero-text { font-size: clamp(1.9rem, 4.6cqi, 5.8rem); }
  .sb[data-theme="cinematic"] :is(.cover-txt, .hero-txt) { padding-left: 8cqi; }
  .sb[data-theme="cinematic"] .q-text { font-size: clamp(2.2rem, 6.4cqi, 8rem); }
}

/* memory */
.sb[data-theme="cinematic"] .mem-ph { position: absolute; top: 0; left: 0; right: 0; height: 56cqb; }
.sb[data-theme="cinematic"] .mem-ph .ph-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13, 12, 11, .3), rgba(13, 12, 11, 0) 30%, rgba(13, 12, 11, 0) 55%, var(--sb-bg) 100%); }
.sb[data-theme="cinematic"] .mem-txt { position: relative; z-index: 2; display: grid; gap: 2.6cqmin; align-content: start; padding: 46cqb 7cqi calc(8cqmin + var(--ui-space, 0px)); }
.sb[data-theme="cinematic"] .mem-h { font-family: var(--sb-display); font-style: italic; font-size: clamp(2rem, 10cqi, 5rem); line-height: .98; }
.sb[data-theme="cinematic"] .mem-body { display: grid; gap: .9em; font-size: clamp(1rem, 4.2cqi, 1.2rem); line-height: 1.7; color: var(--sb-soft); max-width: 36em; }
@container pg (orientation: landscape) {
  .sb[data-theme="cinematic"] .mem-ph { left: 40%; height: 100%; }
  .sb[data-theme="cinematic"] .mem-ph .ph-img::after { background: linear-gradient(90deg, var(--sb-bg) 0%, rgba(13, 12, 11, .6) 22%, rgba(13, 12, 11, 0) 55%); }
  .sb[data-theme="cinematic"] .mem-txt { align-content: center; width: 50%; padding: 12cqb 0 calc(10cqb + var(--ui-space, 0px) * .5) 8cqi; }
  .sb[data-theme="cinematic"] .mem-h { font-size: clamp(2rem, 5cqi, 6rem); }
  .sb[data-theme="cinematic"] .mem-body { font-size: clamp(1rem, 1.35cqi, 1.3rem); }
}

/* collage: frames on a strip */
.sb[data-theme="cinematic"] .pg-collage .pg-in { align-content: center; gap: 3.6cqmin; padding: 13cqmin 6cqi calc(8cqmin + var(--ui-space, 0px)); }
.sb[data-theme="cinematic"] .col-head { display: grid; gap: 1.8cqmin; }
.sb[data-theme="cinematic"] .col-h { font-family: var(--sb-display); font-style: italic; font-size: clamp(1.9rem, 9cqi, 5rem); line-height: 1; }
.sb[data-theme="cinematic"] .col-grid { display: grid; gap: 1.6cqmin; height: 52cqb; grid-auto-rows: 1fr; }
.sb[data-theme="cinematic"] .col-grid .ph { min-height: 0; }
.sb[data-theme="cinematic"] .frame-no { position: absolute; left: 10px; bottom: 8px; font: 10px var(--sb-mono); letter-spacing: .16em; color: rgba(242, 236, 227, .75); text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.sb[data-theme="cinematic"] .col-cap { font-family: var(--sb-display); font-style: italic; font-size: clamp(1.1rem, 4.6cqi, 1.8rem); color: var(--sb-soft); max-width: 30ch; }
@container pg (orientation: landscape) {
  .sb[data-theme="cinematic"] .pg-collage .pg-in { padding-inline: 7cqi; }
  .sb[data-theme="cinematic"] .col-grid { grid-auto-flow: column; grid-auto-columns: 1fr; grid-auto-rows: auto; height: 50cqb; }
  .sb[data-theme="cinematic"] .col-grid[data-n="3"] { grid-template-columns: 1.4fr 1fr 1fr; }
  .sb[data-theme="cinematic"] .col-h { font-size: clamp(1.9rem, 4.6cqi, 5.4rem); }
}

/* timeline */
.sb[data-theme="cinematic"] .tl-bg { position: absolute; inset: 0; }
.sb[data-theme="cinematic"] .tl-bg .ph-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13, 12, 11, .82), rgba(13, 12, 11, .92)); }
.sb[data-theme="cinematic"] .pg-timeline .pg-in { align-content: center; gap: 5cqmin; padding: 14cqmin 7cqi calc(8cqmin + var(--ui-space, 0px)); }
.sb[data-theme="cinematic"] .tl-head { position: relative; display: grid; gap: 1.8cqmin; }
.sb[data-theme="cinematic"] .tl-h { font-family: var(--sb-display); font-style: italic; font-size: clamp(2rem, 10cqi, 5.4rem); line-height: 1; }
.sb[data-theme="cinematic"] .tl { position: relative; display: grid; gap: 4cqmin; }
.sb[data-theme="cinematic"] .tl-item { padding-top: 2.6cqmin; border-top: 1px solid rgba(242, 236, 227, .18); }
.sb[data-theme="cinematic"] .tl-copy { display: grid; grid-template-columns: auto 1fr; column-gap: 4cqi; row-gap: .5em; }
.sb[data-theme="cinematic"] .tl-tc { grid-row: span 2; font: 11px/1.8 var(--sb-mono); letter-spacing: .14em; color: var(--sb-accent); }
.sb[data-theme="cinematic"] .tl-label { font: 700 11px/1.6 var(--sb-body); letter-spacing: .28em; text-transform: uppercase; }
.sb[data-theme="cinematic"] .tl-text { font-family: var(--sb-display); font-size: clamp(1.2rem, 5.2cqi, 2rem); line-height: 1.2; color: var(--sb-ink); }
@container pg (orientation: landscape) {
  .sb[data-theme="cinematic"] .tl { grid-template-columns: repeat(var(--n), 1fr); gap: 3.6cqi; }
  .sb[data-theme="cinematic"] .tl-h { font-size: clamp(2rem, 5cqi, 6rem); }
  .sb[data-theme="cinematic"] .tl-text { font-size: clamp(1.1rem, 1.9cqi, 2.1rem); }
}

/* list: rolling credits */
.sb[data-theme="cinematic"] .ls-ph { position: absolute; inset: 0; }
.sb[data-theme="cinematic"] .ls-ph .ph-img::after { content: ""; position: absolute; inset: 0; background: rgba(13, 12, 11, .8); }
.sb[data-theme="cinematic"] .ls-wrap { position: relative; z-index: 2; align-self: center; display: grid; justify-items: center; text-align: center; gap: 2.4cqmin; padding: 14cqmin 7cqi calc(8cqmin + var(--ui-space, 0px)); }
.sb[data-theme="cinematic"] .ls-h { font-family: var(--sb-display); font-style: italic; font-size: clamp(2rem, 9.6cqi, 5.4rem); line-height: 1; max-width: 12ch; margin-bottom: 2cqmin; }
.sb[data-theme="cinematic"] .ls { display: grid; gap: 2.6cqmin; max-width: 26em; }
.sb[data-theme="cinematic"] .ls li { font-family: var(--sb-display); font-size: clamp(1.15rem, 5cqi, 2rem); line-height: 1.25; color: var(--sb-ink); }
.sb[data-theme="cinematic"] .ls li:nth-child(even) { color: var(--sb-soft); }
.sb[data-theme="cinematic"] .pg.is-active .ls .rv { animation-delay: calc(.35s + var(--i, 0) * .22s); }
@container pg (orientation: landscape) {
  .sb[data-theme="cinematic"] .ls-h { font-size: clamp(2rem, 4.8cqi, 5.4rem); }
  .sb[data-theme="cinematic"] .ls li { font-size: clamp(1.15rem, 2.2cqi, 2.3rem); }
  .sb[data-theme="cinematic"] .ls { max-width: 34em; }
}

/* letter */
.sb[data-theme="cinematic"] .pg-letter .pg-in { align-content: center; justify-items: center; gap: 6cqmin; padding: 15cqmin 8cqi calc(8cqmin + var(--ui-space, 0px)); }
.sb[data-theme="cinematic"] .lt-paper { display: grid; gap: 1.1em; max-width: 32em; }
.sb[data-theme="cinematic"] .lt-sal { font-family: var(--sb-display); font-style: italic; font-size: clamp(1.7rem, 7.6cqi, 3rem); line-height: 1.05; }
.sb[data-theme="cinematic"] .lt-body { display: grid; gap: 1em; font-size: clamp(1rem, 4.2cqi, 1.18rem); line-height: 1.75; color: var(--sb-soft); }
.sb[data-theme="cinematic"] .lt-off { color: var(--sb-soft); margin-top: .6em; }
.sb[data-theme="cinematic"] .lt-sig { font: 700 12px var(--sb-body); letter-spacing: .32em; text-transform: uppercase; }
.sb[data-theme="cinematic"] .lt-close { font-family: var(--sb-display); font-style: italic; font-size: clamp(2.4rem, 13cqi, 8.6rem); line-height: .95; text-align: center; color: var(--sb-accent); max-width: 11ch; }
@container pg (orientation: landscape) {
  .sb[data-theme="cinematic"] .pg-letter .pg-in:has(.lt-close) { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; column-gap: 7cqi; justify-items: start; padding-inline: 9cqi; }
  .sb[data-theme="cinematic"] .pg-letter .lt-close { text-align: left; }
  .sb[data-theme="cinematic"] .lt-body { font-size: clamp(1rem, 1.35cqi, 1.3rem); }
  .sb[data-theme="cinematic"] .lt-close { font-size: clamp(2.4rem, 6.6cqi, 8.6rem); }
}
.sb[data-theme="cinematic"] .end-mark { font-style: italic; }

/* =====================================================================
   THEME 03 — ELEGANT
   ===================================================================== */
.sb[data-theme="elegant"] {
  --sb-bg: #FAF8F4;
  --sb-ink: #1D1C1A;
  --sb-soft: #6E6960;
  --sb-rule: #CFC8BB;
  --sb-accent: #7B5B3A;
  --sb-ui: #1D1C1A;
  --sb-ph: #ECE7DE;
  --sb-display: "Italiana", "Didot", "Bodoni 72", Georgia, serif;
  --sb-body: "Crimson Pro", "Iowan Old Style", Georgia, serif;
  --sb-mono: "Instrument Sans", system-ui, sans-serif;
  --sb-caps: "Instrument Sans", system-ui, sans-serif;
  --sb-ui-font: "Instrument Sans", system-ui, sans-serif;
}
.sb[data-theme="elegant"] .pg.is-next { transform: translateX(3%); opacity: 0; }
.sb[data-theme="elegant"] .pg.is-prev { transform: translateX(-3%); opacity: 0; }
.sb[data-theme="elegant"] .pg-in { display: grid; align-content: center; gap: 4.6cqmin; padding: max(64px, 15cqmin) 8cqi calc(max(56px, 12cqmin) + var(--ui-space, 0px)); }
.sb[data-theme="elegant"] .el-head { position: absolute; z-index: 3; top: 0; left: 8cqi; right: 8cqi; display: flex; justify-content: space-between; gap: 16px; padding: max(18px, 5cqmin) 0 12px; border-bottom: 1px solid var(--sb-rule); font: 700 10px/1.3 var(--sb-caps); letter-spacing: .24em; text-transform: uppercase; color: var(--sb-soft); }
.sb[data-theme="elegant"] .el-head span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb[data-theme="elegant"] .el-folio { position: absolute; z-index: 3; left: 0; right: 0; bottom: calc(max(18px, 4cqmin) + var(--ui-space, 0px)); text-align: center; font: italic 14px var(--sb-body); color: var(--sb-soft); }
.sb.viewer[data-theme="elegant"] .el-folio { display: none; }
.sb.viewer[data-theme="elegant"] .pg-in { padding-bottom: calc(max(24px, 5cqmin) + var(--ui-space)); }
.sb[data-theme="elegant"] .kicker, .sb[data-theme="elegant"] .eyebrow { font: 700 10.5px/1.4 var(--sb-caps); letter-spacing: .28em; text-transform: uppercase; color: var(--sb-accent); }
.sb[data-theme="elegant"] .pg.is-active .ph-img { animation: el-reveal 1.3s .1s var(--ease) both; }
@keyframes el-reveal { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.sb[data-theme="elegant"] .ecap { margin-top: 10px; font: italic 14px var(--sb-body); color: var(--sb-soft); }
.sb[data-theme="elegant"] .el-rule { display: block; width: 44px; height: 1px; background: var(--sb-ink); }

/* cover */
.sb[data-theme="elegant"] .pg-cover .pg-in { justify-items: center; text-align: center; gap: 5.4cqmin; }
.sb[data-theme="elegant"] .cover-ph { width: 100%; }
.sb[data-theme="elegant"] .cover-ph .ph-img { aspect-ratio: auto; height: 44cqb; outline: 1px solid var(--sb-rule); outline-offset: 8px; }
.sb[data-theme="elegant"] .cover-txt { display: grid; justify-items: center; gap: 2.2cqmin; }
.sb[data-theme="elegant"] .cover-title { font-family: var(--sb-display); font-size: clamp(2.2rem, 11.5cqi, 8rem); line-height: 1; text-transform: uppercase; letter-spacing: .02em; max-width: 12ch; }
.sb[data-theme="elegant"] .cover-names { font-style: italic; font-size: clamp(1.15rem, 5.2cqi, 2rem); }
.sb[data-theme="elegant"] .cover-date { font: 700 10.5px var(--sb-caps); letter-spacing: .28em; text-transform: uppercase; color: var(--sb-soft); }
@container pg (orientation: landscape) {
  .sb[data-theme="elegant"] .pg-cover .pg-in { grid-template-columns: 1.15fr 1fr; align-items: center; column-gap: 7cqi; padding-inline: 8cqi; }
  .sb[data-theme="elegant"] .cover-ph .ph-img { height: 64cqb; }
  .sb[data-theme="elegant"] .cover-title { font-size: clamp(2.2rem, 6.2cqi, 8.6rem); }
}

/* hero */
.sb[data-theme="elegant"] .hero-ph { width: 100%; }
.sb[data-theme="elegant"] .hero-ph .ph-img { aspect-ratio: auto; height: 46cqb; }
.sb[data-theme="elegant"] .hero-txt { display: grid; gap: 2cqmin; border-top: 1px solid var(--sb-rule); padding-top: 3.4cqmin; }
.sb[data-theme="elegant"] .hero-text { font-style: italic; font-size: clamp(1.4rem, 6.6cqi, 3.2rem); line-height: 1.18; max-width: 24ch; }
@container pg (orientation: landscape) {
  .sb[data-theme="elegant"] .pg-hero .pg-in { grid-template-columns: 7fr 5fr; align-items: end; column-gap: 5cqi; }
  .sb[data-theme="elegant"] .hero-ph .ph-img { height: 62cqb; }
  .sb[data-theme="elegant"] .hero-text { font-size: clamp(1.4rem, 3cqi, 3.4rem); }
}

/* memory */
.sb[data-theme="elegant"] .pg-memory .pg-in { align-content: start; }
.sb[data-theme="elegant"] .mem-ph { width: 62%; justify-self: end; }
.sb[data-theme="elegant"] .mem-txt { display: grid; gap: 2.6cqmin; }
.sb[data-theme="elegant"] .mem-h { font-family: var(--sb-display); font-size: clamp(2rem, 9.4cqi, 5rem); line-height: 1.02; }
.sb[data-theme="elegant"] .mem-body { display: grid; gap: .8em; font-size: clamp(1.08rem, 4.5cqi, 1.3rem); line-height: 1.6; max-width: 36em; }
.sb[data-theme="elegant"] .mem-body p:first-child::first-letter { font-family: var(--sb-display); float: left; font-size: 3.6em; line-height: .82; padding: .06em .1em 0 0; color: var(--sb-accent); }
@container pg (orientation: landscape) {
  .sb[data-theme="elegant"] .pg-memory .pg-in { grid-template-columns: 5fr 7fr; align-content: center; align-items: center; column-gap: 6cqi; }
  .sb[data-theme="elegant"] .mem-ph { width: 100%; }
  .sb[data-theme="elegant"] .mem-ph .ph-img { aspect-ratio: auto; height: 60cqb; }
  .sb[data-theme="elegant"] .mem-h { font-size: clamp(2rem, 4.6cqi, 5.6rem); }
  .sb[data-theme="elegant"] .mem-body { font-size: clamp(1.05rem, 1.45cqi, 1.4rem); }
}

/* collage: editorial grid */
.sb[data-theme="elegant"] .col-head { display: grid; gap: 1.6cqmin; }
.sb[data-theme="elegant"] .col-h { font-family: var(--sb-display); font-size: clamp(1.9rem, 8.6cqi, 4.6rem); line-height: 1.02; }
.sb[data-theme="elegant"] .col-grid { display: grid; gap: 2cqmin; height: 50cqb; }
.sb[data-theme="elegant"] .col-grid .ph, .sb[data-theme="elegant"] .col-grid .ph-img { min-height: 0; height: 100%; aspect-ratio: auto; }
.sb[data-theme="elegant"] .col-grid[data-n="2"] { grid-template-rows: 1fr 1fr; }
.sb[data-theme="elegant"] .col-grid[data-n="3"] { grid-template: "a a" 1.25fr "b c" 1fr / 1fr 1fr; }
.sb[data-theme="elegant"] .col-grid[data-n="3"] .col-ph-1 { grid-area: a; }
.sb[data-theme="elegant"] .col-grid[data-n="4"] { grid-template: 1fr 1fr / 1fr 1fr; }
.sb[data-theme="elegant"] .col-cap { font-style: italic; font-size: clamp(1rem, 4.2cqi, 1.3rem); color: var(--sb-soft); border-top: 1px solid var(--sb-rule); padding-top: 2cqmin; }
@container pg (orientation: landscape) {
  .sb[data-theme="elegant"] .col-grid { height: 52cqb; }
  .sb[data-theme="elegant"] .col-grid[data-n="2"] { grid-template: 1fr / 1fr 1fr; }
  .sb[data-theme="elegant"] .col-grid[data-n="3"] { grid-template: "a b" 1fr "a c" 1fr / 1.6fr 1fr; }
  .sb[data-theme="elegant"] .col-grid[data-n="4"] { grid-template: 1fr / repeat(4, 1fr); }
  .sb[data-theme="elegant"] .col-h { font-size: clamp(1.9rem, 4.4cqi, 5rem); }
}

/* timeline */
.sb[data-theme="elegant"] .tl-head { display: grid; gap: 1.6cqmin; }
.sb[data-theme="elegant"] .tl-h { font-family: var(--sb-display); font-size: clamp(1.9rem, 8.6cqi, 4.6rem); line-height: 1.02; }
.sb[data-theme="elegant"] .tl { display: grid; border-top: 1px solid var(--sb-ink); }
.sb[data-theme="elegant"] .tl-item { display: grid; grid-template-columns: 1fr 18cqi; gap: 4cqi; align-items: center; padding: 3cqmin 0; border-bottom: 1px solid var(--sb-rule); }
.sb[data-theme="elegant"] .tl-ph { order: 2; }
.sb[data-theme="elegant"] .tl-ph .ph-img { aspect-ratio: 1; }
.sb[data-theme="elegant"] .tl-item:not(:has(.tl-ph)) { grid-template-columns: 1fr; }
.sb[data-theme="elegant"] .tl-copy { display: grid; gap: .5em; }
.sb[data-theme="elegant"] .tl-label { font: 700 10.5px var(--sb-caps); letter-spacing: .26em; text-transform: uppercase; color: var(--sb-accent); }
.sb[data-theme="elegant"] .tl-text { font-style: italic; font-size: clamp(1.05rem, 4.6cqi, 1.5rem); line-height: 1.35; }
@container pg (orientation: landscape) {
  .sb[data-theme="elegant"] .tl { grid-template-columns: repeat(var(--n), 1fr); border-top: 0; column-gap: 3cqi; }
  .sb[data-theme="elegant"] .tl-item { grid-template-columns: 1fr; align-content: start; border-top: 1px solid var(--sb-ink); border-bottom: 0; padding-top: 2.6cqmin; }
  .sb[data-theme="elegant"] .tl-ph { order: 0; }
  .sb[data-theme="elegant"] .tl-ph .ph-img { aspect-ratio: 4 / 3; }
  .sb[data-theme="elegant"] .tl-h { font-size: clamp(1.9rem, 4.4cqi, 5rem); }
  .sb[data-theme="elegant"] .tl-text { font-size: clamp(1.05rem, 1.7cqi, 1.6rem); }
}

/* list */
.sb[data-theme="elegant"] .ls-ph { width: 44%; justify-self: end; }
.sb[data-theme="elegant"] .ls-wrap { display: grid; gap: 2cqmin; }
.sb[data-theme="elegant"] .ls-h { font-family: var(--sb-display); font-size: clamp(1.9rem, 8.6cqi, 4.6rem); line-height: 1.02; margin-bottom: 1cqmin; }
.sb[data-theme="elegant"] .ls { border-top: 1px solid var(--sb-ink); }
.sb[data-theme="elegant"] .ls li { font-style: italic; font-size: clamp(1.08rem, 4.8cqi, 1.6rem); line-height: 1.35; padding: 2.2cqmin 0; border-bottom: 1px solid var(--sb-rule); }
@container pg (orientation: landscape) {
  .sb[data-theme="elegant"] .pg-list .pg-in { grid-template-columns: 4fr 7fr; align-items: center; column-gap: 6cqi; }
  .sb[data-theme="elegant"] .ls-ph { width: 100%; }
  .sb[data-theme="elegant"] .ls-ph .ph-img { aspect-ratio: auto; height: 60cqb; }
  .sb[data-theme="elegant"] .ls-h { font-size: clamp(1.9rem, 4.2cqi, 5rem); }
  .sb[data-theme="elegant"] .ls li { font-size: clamp(1.05rem, 1.8cqi, 1.7rem); }
}

/* letter */
.sb[data-theme="elegant"] .pg-letter .pg-in { justify-items: center; }
.sb[data-theme="elegant"] .lt-paper { display: grid; gap: 1em; max-width: 31em; width: 100%; }
.sb[data-theme="elegant"] .lt-sal { font-style: italic; font-size: clamp(1.3rem, 5.4cqi, 1.9rem); }
.sb[data-theme="elegant"] .lt-body { display: grid; gap: .9em; font-size: clamp(1.08rem, 4.5cqi, 1.3rem); line-height: 1.65; }
.sb[data-theme="elegant"] .lt-off { font-style: italic; color: var(--sb-soft); margin-top: .6em; }
.sb[data-theme="elegant"] .lt-sig { font-family: var(--sb-display); font-size: clamp(1.6rem, 7cqi, 2.6rem); }
.sb[data-theme="elegant"] .lt-close { font-family: var(--sb-display); font-size: clamp(2rem, 9.6cqi, 5.4rem); line-height: 1.05; text-align: center; padding: 3.4cqmin 0 0; border-top: 1px solid var(--sb-rule); max-width: 14ch; }
@container pg (orientation: landscape) {
  .sb[data-theme="elegant"] .pg-letter .pg-in:has(.lt-close) { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; column-gap: 7cqi; }
  .sb[data-theme="elegant"] .pg-letter .lt-close { border-top: 0; border-left: 1px solid var(--sb-rule); padding: 0 0 0 5cqi; text-align: left; }
  .sb[data-theme="elegant"] .lt-body { font-size: clamp(1.05rem, 1.45cqi, 1.35rem); }
  .sb[data-theme="elegant"] .lt-close { font-size: clamp(2rem, 4.6cqi, 5.6rem); }
}

/* quote */
.sb[data-theme="elegant"] .pg-quote .pg-in { justify-items: center; text-align: center; }
.sb[data-theme="elegant"] .q-ph { width: 76%; }
.sb[data-theme="elegant"] .q-txt { display: grid; gap: 2.4cqmin; justify-items: center; }
.sb[data-theme="elegant"] .q-text { font-family: var(--sb-display); font-size: clamp(2rem, 9.6cqi, 5.6rem); line-height: 1.04; max-width: 14ch; }
.sb[data-theme="elegant"] .q-cite { font: 700 10.5px var(--sb-caps); letter-spacing: .28em; text-transform: uppercase; font-style: normal; color: var(--sb-soft); }
@container pg (orientation: landscape) {
  .sb[data-theme="elegant"] .pg-quote .pg-in { grid-template-columns: 1fr 1fr; align-items: center; column-gap: 6cqi; }
  .sb[data-theme="elegant"] .q-ph { width: 100%; }
  .sb[data-theme="elegant"] .q-ph .ph-img { aspect-ratio: auto; height: 62cqb; }
  .sb[data-theme="elegant"] .q-text { font-size: clamp(2rem, 4.8cqi, 6rem); }
}

@media (prefers-reduced-motion: reduce) {
  .sb .pg, .sb .pg.is-active { transition: opacity .2s linear, visibility 0s linear .2s; transform: none !important; }
  .sb .pg.is-active { transition: opacity .2s linear; }
  .sb .rv, .sb .doodle path, .sb .ph img, .sb .ph-img, .sb .bar { animation: none !important; }
}

/* =====================================================================
   Story features: secret notes, note cards, questions, envelope letter,
   text-only memories, last page, opening screen, music
   ===================================================================== */
.sb input, .sb textarea { user-select: text; -webkit-user-select: text; }

/* secret note behind a star on a photo */
.ph-star { position: absolute; z-index: 6; top: -12px; right: -12px; width: 42px; height: 42px; border-radius: 50%; border: 0; padding: 8px; cursor: pointer; background: var(--sb-card, #fff); color: var(--sb-accent); box-shadow: 0 3px 10px rgba(0, 0, 0, .22); display: grid; place-items: center; transition: transform .25s var(--ease); animation: star-hint 2.8s ease-in-out 1.2s 3; }
.ph-star svg { width: 100%; height: 100%; fill: currentColor; }
.ph-star:hover { transform: scale(1.1) rotate(12deg); }
.ph-star:focus-visible { outline: 2px solid var(--sb-accent); outline-offset: 3px; }
.has-note.note-open .ph-star { animation: none; transform: rotate(72deg); }
@keyframes star-hint { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14) rotate(10deg); } }
.ph-note { position: absolute; z-index: 5; left: 6%; right: 6%; bottom: 8%; padding: 14px 16px; background: var(--sb-card, #fff); color: var(--sb-ink); border: 1px dashed var(--sb-gold, var(--sb-accent)); border-radius: 3px; box-shadow: 0 10px 24px rgba(0, 0, 0, .2); font: 500 clamp(1rem, 4.4cqi, 1.3rem)/1.35 var(--sb-hand, var(--sb-body)); text-align: center; animation: pop-in .35s var(--ease) both; cursor: pointer; }
@keyframes pop-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.sb[data-theme="cinematic"] .ph-star { top: auto; bottom: 16px; right: 16px; background: rgba(13, 12, 11, .6); color: var(--sb-accent); border: 1px solid rgba(242, 236, 227, .3); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sb[data-theme="cinematic"] .ph-note { background: rgba(13, 12, 11, .82); color: var(--sb-ink); border: 1px solid rgba(230, 199, 156, .5); font: italic clamp(1.05rem, 4.4cqi, 1.5rem)/1.35 var(--sb-display); bottom: 76px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.sb[data-theme="elegant"] .ph-star { top: 10px; right: 10px; background: var(--sb-bg); border: 1px solid var(--sb-rule); box-shadow: none; width: 38px; height: 38px; }
.sb[data-theme="elegant"] .ph-note { background: var(--sb-bg); border: 1px solid var(--sb-ink); border-radius: 0; box-shadow: none; font: italic clamp(1.02rem, 4.2cqi, 1.3rem)/1.45 var(--sb-body); }

/* dates on memory pages */
.mem-date { margin: 0; }
.sb[data-theme="classic"] .mem-date { font: 400 clamp(1rem, 4.4cqi, 1.35rem)/1.4 var(--sb-script); color: var(--sb-accent); transform: rotate(-2deg); transform-origin: left; }
.sb[data-theme="cinematic"] .mem-date { font: 12px/1 var(--sb-mono); letter-spacing: .16em; color: var(--sb-accent); text-transform: uppercase; }
.sb[data-theme="elegant"] .mem-date { font: 700 10.5px/1.4 var(--sb-caps); letter-spacing: .26em; text-transform: uppercase; color: var(--sb-soft); }

/* memory without a photo: the words are the scene */
.pg-scene .pg-in { display: grid; align-content: center; gap: 4cqmin; }
.scene-head { display: grid; gap: 1.4cqmin; }
.scene-card { position: relative; display: grid; gap: 1.1em; width: 100%; max-width: 36em; justify-self: center; }
.scene-date { display: block; }
.pg.is-active .scene-line { animation: sb-rise .9s var(--ease) both; animation-delay: calc(.45s + var(--i, 0) * .75s); }
.no-anim .scene-line { animation: none !important; }
.sb[data-theme="classic"] .scene-card { background: var(--sb-card); border: 1px solid var(--sb-line); border-radius: 3px; padding: 8cqmin 7cqi; box-shadow: 0 10px 30px rgba(44, 33, 21, .08); }
.sb[data-theme="classic"] .scene-date { font: 400 clamp(1.3rem, 6cqi, 1.8rem)/1.4 var(--sb-script); color: var(--sb-accent); transform: rotate(-2deg); transform-origin: left; margin-bottom: .2em; }
.sb[data-theme="classic"] .scene-line { font: italic 400 clamp(1.05rem, 4.6cqi, 1.3rem)/1.7 var(--sb-body); color: var(--sb-ink); }
.sb[data-theme="classic"] .scene-line.punch { font: 600 clamp(1.35rem, 6cqi, 1.8rem)/1.3 var(--sb-hand); font-style: normal; color: var(--sb-accent); }
.sb[data-theme="classic"] .d-scene { position: absolute; width: 30px; right: 18px; bottom: 14px; color: var(--sb-gold); }
.sb[data-theme="cinematic"] .pg-scene .pg-in { padding: 16cqmin 9cqi calc(10cqmin + var(--ui-space, 0px)); }
.sb[data-theme="cinematic"] .scene-date { font: 12px/1 var(--sb-mono); letter-spacing: .18em; color: var(--sb-accent); text-transform: uppercase; margin-bottom: .6em; }
.sb[data-theme="cinematic"] .scene-line { font: clamp(1.25rem, 5.4cqi, 2.2rem)/1.35 var(--sb-display); color: var(--sb-ink); }
.sb[data-theme="cinematic"] .scene-line.punch { font-style: italic; color: var(--sb-accent); }
.sb[data-theme="elegant"] .scene-card { border-top: 1px solid var(--sb-ink); border-bottom: 1px solid var(--sb-rule); padding: 5cqmin 0; }
.sb[data-theme="elegant"] .scene-date { font: 700 10.5px/1.4 var(--sb-caps); letter-spacing: .26em; text-transform: uppercase; color: var(--sb-accent); }
.sb[data-theme="elegant"] .scene-line { font: italic clamp(1.1rem, 4.8cqi, 1.5rem)/1.6 var(--sb-body); }
.sb[data-theme="elegant"] .scene-line.punch { font: clamp(1.4rem, 6cqi, 2.2rem)/1.2 var(--sb-display); font-style: normal; }
.sb[data-theme="cinematic"] .mem-h, .sb[data-theme="elegant"] .pg-scene .mem-h { max-width: 18ch; }
@container pg (orientation: landscape) {
  .sb[data-theme="cinematic"] .scene-line { font-size: clamp(1.25rem, 2.4cqi, 2.4rem); }
  .sb[data-theme="classic"] .scene-card { padding: 6cqmin 5cqi; }
}

/* little things: cinematic credits and elegant rows */
.ls.cards { list-style: none; padding: 0; }
.ls.cards .card { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-align: inherit; width: 100%; }
.ls.cards button.card { cursor: pointer; }
.sb[data-theme="cinematic"] .ls.cards li { font: inherit; color: inherit; }
.sb[data-theme="cinematic"] .ls.cards .card { display: grid; gap: 4px; justify-items: center; padding: 6px 0; }
.sb[data-theme="cinematic"] .card-t { font: italic clamp(1.25rem, 5.6cqi, 2.2rem)/1.15 var(--sb-display); color: var(--sb-ink); }
.sb[data-theme="cinematic"] .card-d { font: 400 clamp(.85rem, 3.4cqi, 1rem)/1.45 var(--sb-body); color: var(--sb-soft); max-width: 32em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sb[data-theme="cinematic"] button.card:hover .card-t { color: var(--sb-accent); }
.sb[data-theme="cinematic"] .ls-hint { font: 11px var(--sb-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--sb-soft); }
.sb[data-theme="elegant"] .ls.cards li { padding: 0; border-bottom: 1px solid var(--sb-rule); font-style: normal; }
.sb[data-theme="elegant"] .ls.cards .card { display: grid; gap: 4px; padding: 2.2cqmin 0; }
.sb[data-theme="elegant"] .card-t { font: italic clamp(1.1rem, 4.8cqi, 1.6rem)/1.3 var(--sb-body); }
.sb[data-theme="elegant"] .card-d { font: 400 clamp(.9rem, 3.6cqi, 1.05rem)/1.5 var(--sb-body); color: var(--sb-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sb[data-theme="elegant"] button.card:hover .card-t { color: var(--sb-accent); }
.sb[data-theme="elegant"] .ls-hint { font: 700 10px var(--sb-caps); letter-spacing: .24em; text-transform: uppercase; color: var(--sb-soft); }
@container pg (orientation: landscape) {
  .sb[data-theme="elegant"] .ls.cards { display: grid; grid-template-columns: 1fr 1fr; column-gap: 4cqi; }
  .sb[data-theme="elegant"] .pg-list .pg-in { grid-template-columns: 1fr; }
}

/* note pop-up */
.sb-modal { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: rgba(20, 14, 8, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade-in .25s ease both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.sb-modal-card { position: relative; width: min(400px, 100%); max-height: 80%; overflow: auto; background: var(--sb-card, var(--sb-bg)); color: var(--sb-ink); padding: 32px 26px 28px; border-radius: 3px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); transform: rotate(-.6deg); animation: pop-in .3s var(--ease) both; }
.sb-modal-t { margin: 0 0 12px; font: italic 500 1.35rem/1.2 var(--sb-display); color: var(--sb-accent); }
.sb-modal-b { margin: 0; font: 400 1.02rem/1.65 var(--sb-sans, var(--sb-body)); white-space: pre-line; }
.sb-modal-x { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border: 0; background: none; color: var(--sb-soft); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.sb[data-theme="cinematic"] .sb-modal-card { background: #17150F; border: 1px solid rgba(242, 236, 227, .16); transform: none; }
.sb[data-theme="elegant"] .sb-modal-card { background: var(--sb-bg); border: 1px solid var(--sb-ink); transform: none; box-shadow: 0 20px 50px rgba(0, 0, 0, .18); }
.sb[data-theme="elegant"] .sb-modal-t { font-family: var(--sb-display); font-style: normal; font-size: 1.7rem; color: var(--sb-ink); }

/* questions */
.qz-head { display: grid; gap: 1.4cqmin; }
.qz { display: grid; gap: 3.4cqmin; }
.qz-card { display: grid; gap: 10px; }
.qz-q { display: block; }
.qz-in { width: 100%; font: inherit; color: inherit; background: transparent; border: 0; border-bottom: 1.5px solid currentColor; border-radius: 0; padding: 6px 2px; opacity: .9; }
.qz-in:focus { outline: none; border-bottom-color: var(--sb-accent); }
.qz-in:disabled { opacity: .55; }
.qz-btn { justify-self: start; background: none; border: 0; padding: 6px 0; cursor: pointer; color: var(--sb-accent); font: inherit; }
.qz-a { margin: 0; animation: pop-in .3s var(--ease) both; }
.qz-you { opacity: .7; }
.sb[data-theme="classic"] .qz-h { font-family: var(--sb-display); font-size: clamp(1.7rem, 7.6cqi, 3.4rem); line-height: 1.05; }
.sb[data-theme="classic"] .qz-card { background: var(--sb-card); border: 1px solid var(--sb-line); box-shadow: 0 10px 26px rgba(44, 33, 21, .1); padding: 5cqmin 5cqi; }
.sb[data-theme="classic"] .qz-q { font: italic 400 clamp(1.02rem, 4.4cqi, 1.25rem)/1.45 var(--sb-body); }
.sb[data-theme="classic"] .qz-in { font: 500 clamp(1.1rem, 4.8cqi, 1.35rem) var(--sb-hand); border-bottom-color: var(--sb-faint); }
.sb[data-theme="classic"] .qz-btn { font: 600 1.25rem var(--sb-hand); }
.sb[data-theme="classic"] .qz-a { font: 500 clamp(1.1rem, 4.8cqi, 1.35rem)/1.35 var(--sb-hand); color: var(--sb-soft); }
.sb[data-theme="cinematic"] .pg-quiz .pg-in { align-content: center; gap: 5cqmin; padding: 15cqmin 8cqi calc(8cqmin + var(--ui-space, 0px)); }
.sb[data-theme="cinematic"] .qz-h { font: italic clamp(2rem, 9.6cqi, 5.4rem)/1 var(--sb-display); }
.sb[data-theme="cinematic"] .qz-card { border-top: 1px solid rgba(242, 236, 227, .2); padding-top: 3cqmin; }
.sb[data-theme="cinematic"] .qz-q { font: clamp(1.15rem, 5cqi, 1.9rem)/1.3 var(--sb-display); }
.sb[data-theme="cinematic"] .qz-in { font: 400 1rem var(--sb-body); border-bottom-color: rgba(242, 236, 227, .35); }
.sb[data-theme="cinematic"] .qz-btn { font: 700 11px var(--sb-body); letter-spacing: .28em; text-transform: uppercase; }
.sb[data-theme="cinematic"] .qz-a { font: italic clamp(1.1rem, 4.6cqi, 1.6rem)/1.35 var(--sb-display); color: var(--sb-accent); }
.sb[data-theme="elegant"] .qz-h { font: clamp(1.9rem, 8.6cqi, 4.6rem)/1.02 var(--sb-display); }
.sb[data-theme="elegant"] .qz-card { border-top: 1px solid var(--sb-ink); padding-top: 2.6cqmin; }
.sb[data-theme="elegant"] .qz-q { font: italic clamp(1.1rem, 4.8cqi, 1.5rem)/1.35 var(--sb-body); }
.sb[data-theme="elegant"] .qz-in { font: 1.05rem var(--sb-body); border-bottom-color: var(--sb-rule); }
.sb[data-theme="elegant"] .qz-btn { font: 700 10.5px var(--sb-caps); letter-spacing: .26em; text-transform: uppercase; }
.sb[data-theme="elegant"] .qz-a { font: clamp(1.2rem, 5cqi, 1.8rem)/1.25 var(--sb-display); }
@container pg (orientation: landscape) {
  .sb .qz { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 3cqi; }
  .sb[data-theme="classic"] .qz-h, .sb[data-theme="elegant"] .qz-h { font-size: clamp(1.9rem, 4.2cqi, 4.6rem); }
  .sb[data-theme="cinematic"] .qz-h { font-size: clamp(2rem, 5cqi, 5.6rem); }
  .sb[data-theme="classic"] .qz-q { font-size: clamp(1.02rem, 1.5cqi, 1.3rem); }
  .sb[data-theme="cinematic"] .qz-q { font-size: clamp(1.1rem, 2cqi, 2rem); }
  .sb[data-theme="elegant"] .qz-q { font-size: clamp(1.05rem, 1.7cqi, 1.6rem); }
}

/* timeline "still being written" line */
.tl-more .tl-text { opacity: .75; }
.sb[data-theme="classic"] .tl-more .tl-text { font: 500 clamp(1.1rem, 4.8cqi, 1.5rem)/1.3 var(--sb-hand); color: var(--sb-faint); }
.sb[data-theme="classic"] .tl-more::before { background: var(--sb-bg); border: 2px dashed var(--sb-faint); width: 12px; height: 12px; }
.sb[data-theme="classic"] .tl-label { font-family: var(--sb-hand); font-weight: 600; color: var(--sb-gold); }
.sb[data-theme="classic"] .tl-text { font-family: var(--sb-display); font-weight: 400; }
.sb[data-theme="cinematic"] .tl-more .tl-text, .sb[data-theme="elegant"] .tl-more .tl-text { font-style: italic; }

/* sealed letter */
.env-wrap { display: grid; justify-items: center; gap: 16px; width: 100%; }
.envelope { position: relative; width: min(280px, 72cqi); aspect-ratio: 16 / 10.5; border: 0; padding: 0; background: none; cursor: pointer; perspective: 900px; transition: transform .3s var(--ease); }
.envelope:hover { transform: translateY(-3px) rotate(-1deg); }
.envelope:focus-visible { outline: 2px solid var(--sb-accent); outline-offset: 6px; }
.env-back, .env-front, .env-flap { position: absolute; inset: 0; display: block; }
.env-back { background: var(--env-paper, var(--sb-card, #fbf7ec)); border: 1px solid var(--env-line, rgba(0, 0, 0, .12)); box-shadow: 0 16px 32px rgba(0, 0, 0, .18); }
.env-front { background: var(--env-pocket, #ece0c4); clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%); z-index: 2; }
.env-flap { bottom: auto; height: 60%; background: var(--env-flap, #e4d6b6); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top; transition: transform .7s cubic-bezier(.6, -0.1, .3, 1.3); z-index: 3; }
.env-seal { position: absolute; z-index: 4; left: 50%; top: 60%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: var(--env-seal, var(--sb-accent)); display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: opacity .3s; }
.env-seal .env-heart { position: static; width: 20px; color: #F2EAD8; stroke-width: 1.8; }
.env-hint { margin: 0; font: 500 1.15rem var(--sb-hand, var(--sb-body)); opacity: .7; }
.pg-letter.env-open .env-flap { transform: rotateX(180deg); z-index: 1; }
.pg-letter.env-open .env-seal { opacity: 0; }
.pg-letter.is-sealed:not(.letter-in) :is(.lt-paper, .lt-close, .d-close) { display: none; }
.pg-letter.letter-in .env-wrap { display: none; }
.pg-letter.letter-in :is(.lt-paper, .lt-close) { animation: pop-in .6s var(--ease) both; }
.pg-letter.letter-in .lt-close { animation-delay: .5s; }
.sb[data-theme="cinematic"] { --env-paper: #1C1915; --env-pocket: #24201A; --env-flap: #2B261F; --env-line: rgba(230, 199, 156, .3); --env-seal: #9E7B4F; }
.sb[data-theme="elegant"] { --env-paper: #FFFFFF; --env-pocket: #F3EFE8; --env-flap: #EAE4DA; --env-line: #CFC8BB; --env-seal: #1D1C1A; }
.sb[data-theme="classic"] .pg-letter.is-sealed:not(.letter-in) .pg-in { align-content: center; }
.sb[data-theme="cinematic"] .env-hint { font: 11px var(--sb-mono); letter-spacing: .18em; text-transform: uppercase; }
.sb[data-theme="elegant"] .env-hint { font: 700 10px var(--sb-caps); letter-spacing: .24em; text-transform: uppercase; }

/* last page */
.pg-ending .pg-in { display: grid; align-content: center; justify-items: center; text-align: center; gap: 5cqmin; }
.end-txt { display: grid; gap: 1.6cqmin; justify-items: center; }
.end-line, .end-cap { margin: 0; }
.sb[data-theme="classic"] .end-ph { width: min(56cqi, calc(40cqb * var(--ar))); }
.sb[data-theme="classic"] .end-line { font: 400 clamp(1.2rem, 5.6cqi, 2rem)/1.7 var(--sb-script); color: var(--sb-soft); max-width: 18ch; }
.sb[data-theme="classic"] .end-cap { font: 600 1.25rem var(--sb-hand); color: var(--sb-accent); }
.sb[data-theme="classic"] .d-end { position: relative; width: 26px; color: var(--sb-accent); }
.sb[data-theme="cinematic"] .end-ph { position: absolute; inset: 0; }
.sb[data-theme="cinematic"] .end-ph .ph-img::after { content: ""; position: absolute; inset: 0; background: rgba(8, 7, 6, .6); }
.sb[data-theme="cinematic"] .end-txt { position: relative; z-index: 2; padding: 0 8cqi var(--ui-space, 0px); }
.sb[data-theme="cinematic"] .end-line { font: italic clamp(2rem, 10cqi, 6.4rem)/1 var(--sb-display); max-width: 12ch; }
.sb[data-theme="cinematic"] .end-cap { font: 700 11px var(--sb-body); letter-spacing: .3em; text-transform: uppercase; color: var(--sb-accent); }
.sb[data-theme="elegant"] .end-ph { width: 70%; }
.sb[data-theme="elegant"] .end-ph .ph-img { outline: 1px solid var(--sb-rule); outline-offset: 8px; }
.sb[data-theme="elegant"] .end-line { font: clamp(1.8rem, 8.6cqi, 4.4rem)/1.05 var(--sb-display); max-width: 14ch; }
.sb[data-theme="elegant"] .end-cap { font: italic 1.1rem var(--sb-body); color: var(--sb-soft); }
@container pg (orientation: landscape) {
  .sb[data-theme="classic"] .pg-ending .pg-in, .sb[data-theme="elegant"] .pg-ending .pg-in { grid-template-columns: auto auto; column-gap: 7cqi; text-align: left; justify-content: center; }
  .sb[data-theme="classic"] .end-ph { width: min(30cqi, calc(56cqb * var(--ar))); }
  .sb[data-theme="elegant"] .end-ph { width: min(38cqi, calc(58cqb * var(--ar))); }
  .sb[data-theme="classic"] .end-txt, .sb[data-theme="elegant"] .end-txt { justify-items: start; }
  .sb[data-theme="classic"] .d-end { display: none; }
  .sb[data-theme="classic"] .end-line { font-size: clamp(1.2rem, 2.6cqi, 2.4rem); }
  .sb[data-theme="elegant"] .end-line { font-size: clamp(1.8rem, 4.4cqi, 4.8rem); }
}

/* opening screen */
.sb-intro { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px; text-align: center; background: var(--sb-bg); transition: opacity .9s ease, transform .9s var(--ease); }
.sb-intro.is-leaving { opacity: 0; transform: translateY(-3%); pointer-events: none; }
.intro-in { display: grid; justify-items: center; gap: 22px; animation: intro-rise 1.4s var(--ease) .2s both; }
@keyframes intro-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.intro-line { margin: 0; max-width: 20em; }
.intro-name { margin: 0; font-weight: 400; line-height: 1; }
.intro-btn { margin-top: 10px; cursor: pointer; font: inherit; color: inherit; background: none; border: 1px solid currentColor; border-radius: 2px; padding: 14px 32px; transition: background .25s, color .25s; }
.intro-btn:hover { background: var(--sb-ink); color: var(--sb-bg); }
.intro-by { margin: 0; opacity: .6; }
.sb[data-theme="classic"] .sb-intro { background: radial-gradient(120% 90% at 50% 35%, rgba(255, 251, 242, .7), rgba(255, 251, 242, 0) 65%), var(--grain), var(--sb-bg); }
.sb[data-theme="classic"] .intro-line { font: 400 clamp(1.1rem, 4.6vmin, 1.7rem)/1.7 var(--sb-script); color: var(--sb-soft); max-width: 17em; }
.sb[data-theme="classic"] .intro-name { font: 500 clamp(2.6rem, 11vmin, 4.6rem)/1 var(--sb-display); letter-spacing: .01em; }
.sb[data-theme="classic"] .intro-btn { font: 400 1rem var(--sb-display); letter-spacing: .04em; border-color: var(--sb-ink); }
.sb[data-theme="classic"] .intro-by { font: 12px var(--sb-sans); letter-spacing: .15em; text-transform: uppercase; color: var(--sb-faint); }
.sb[data-theme="cinematic"] .intro-line { font: 700 11px/1.6 var(--sb-body); letter-spacing: .32em; text-transform: uppercase; color: var(--sb-accent); }
.sb[data-theme="cinematic"] .intro-name { font: italic clamp(3.2rem, 14vmin, 8rem)/.9 var(--sb-display); }
.sb[data-theme="cinematic"] .intro-btn { font: 700 11px var(--sb-body); letter-spacing: .3em; text-transform: uppercase; padding: 16px 30px; border-color: rgba(242, 236, 227, .45); }
.sb[data-theme="cinematic"] .intro-by { font: 11px var(--sb-mono); letter-spacing: .18em; text-transform: uppercase; }
.sb[data-theme="elegant"] .intro-line { font: italic clamp(1.1rem, 4vmin, 1.5rem)/1.5 var(--sb-body); color: var(--sb-soft); }
.sb[data-theme="elegant"] .intro-name { font: clamp(2.8rem, 12vmin, 6rem)/1 var(--sb-display); text-transform: uppercase; letter-spacing: .03em; }
.sb[data-theme="elegant"] .intro-btn { font: 700 10.5px var(--sb-caps); letter-spacing: .28em; text-transform: uppercase; padding: 16px 30px; border-radius: 0; }
.sb[data-theme="elegant"] .intro-by { font: 700 10px var(--sb-caps); letter-spacing: .26em; text-transform: uppercase; }
.sb.intro-on .vw-ui, .sb.intro-on .vw-more { opacity: 0; pointer-events: none; }

/* music button (sits in the page navigation) */
.vw-music { pointer-events: auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: inherit; background: color-mix(in srgb, var(--sb-bg) 55%, transparent); border: 1px solid color-mix(in srgb, var(--sb-ui) 28%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.vw-music svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.vw-music.is-playing .mute { display: none; }
.vw-music.is-playing svg { animation: music-bob 1.6s ease-in-out infinite; }
@keyframes music-bob { 50% { transform: translateY(-2px); } }

/* classic: handwritten page turns, like a real scrapbook */
.vw-lbl { display: none; }
.sb[data-theme="classic"] .vw-lbl { display: inline; }
.sb[data-theme="classic"] .vw-btn { width: auto; height: 44px; padding: 0 10px; gap: 6px; display: inline-flex; align-items: center; border: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; font: 600 1.35rem/1 var(--sb-hand); color: var(--sb-soft); }
.sb[data-theme="classic"] .vw-btn svg { width: 16px; height: 16px; }
.sb[data-theme="classic"] .vw-btn:hover:not(:disabled) { transform: translateY(-1px); color: var(--sb-accent); }
.sb[data-theme="classic"] .vw-row { justify-content: space-between; }
.sb[data-theme="classic"] .vw-count { font: 500 1.1rem var(--sb-hand); letter-spacing: .02em; min-width: 0; }
.sb.viewer-embed[data-theme="classic"] .vw-lbl { display: none; }
.sb.viewer-embed[data-theme="classic"] .vw-row { justify-content: center; }
.sb.viewer-embed[data-theme="classic"] .vw-btn { border: 1px solid color-mix(in srgb, var(--sb-ui) 28%, transparent); border-radius: 50%; width: 38px; height: 38px; padding: 0; justify-content: center; }
.vw-lbl, .vw-count { white-space: nowrap; }
@media (max-width: 420px) {
  .sb[data-theme="classic"] .vw-btn { font-size: 1.15rem; padding: 0 4px; }
  .sb[data-theme="classic"] .vw-row { gap: 6px; padding-inline: 8px; }
}
.sb .pg-letter.is-sealed:not(.letter-in) .pg-in { grid-template-columns: 1fr !important; justify-items: center; align-content: center; }
@container pg (orientation: landscape) {
  .sb .pg-ending .pg-in { align-items: center; }
}
