/* Safe and Sound. Copyright (C) 2026 B7 Collective LLC.
   Painted storybook moments in a dusk-blue room: glass for the story, warm paper for the "why", one amber accent.
   Layouts: phone, phone sideways, foldable (cover, wide inner, square inner, tabletop and book), tablet, desktop. */

@font-face { font-family: "Literata"; src: url("/assets/fonts/literata-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/assets/fonts/literata-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/assets/fonts/literata-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/assets/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/assets/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ink: #18212B; --ink-2: #3B4450; --night: #0F161C; --dusk: #16222A;
  --paper: #F5F0E6; --paper-2: #EBE3D4; --paper-line: #D9CDB8;
  --amber: #F2B544; --amber-lip: #C88D21; --amber-ink: #7A5410;
  --sage: #9DBDB3;
  --glass: rgba(14, 21, 28, .5); --glass-2: rgba(14, 21, 28, .68); --glass-line: rgba(255, 255, 255, .16); --glass-hi: rgba(255, 255, 255, .07);
  --on: #F3F1EC; --on-2: rgba(243, 241, 236, .8);
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --bar: 68px; --pad: clamp(16px, 4vw, 40px);
  /* one type scale */
  --fs-xs: 14px; --fs-s: 16px; --fs-m: 18px; --fs-l: 20px; --fs-xl: 22px; --fs-2xl: clamp(26px, 2.8vw, 32px); --fs-3xl: clamp(32px, 4vw, 48px);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 16px); }
body { margin: 0; min-height: 100svh; background: var(--night); color: var(--on); font-family: var(--sans); font-size: 18px; line-height: 1.55; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.12; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1.5px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 50; padding: 12px 16px; background: var(--paper); color: var(--ink); border-radius: 10px; font-weight: 700; }
.skip:focus { top: 12px; }
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus { outline: none; } /* headings take focus only so screen readers start in the right place */

/* ---- the painted room behind everything ---- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--night); }
.paint, .paint img { position: absolute; inset: 0; width: 100%; height: 100%; }
.paint img { object-fit: cover; object-position: var(--fx) var(--fy); opacity: 0; transition: opacity .9s var(--ease); }
@media (max-aspect-ratio: 4 / 5) { .paint img { object-position: var(--px) var(--py); } }
.paint img.in { opacity: 1; }
.veil { position: absolute; inset: 0; transition: background .6s; }
[data-paint="hero"] .veil { background: linear-gradient(180deg, rgba(10, 16, 22, .62) 0%, rgba(10, 16, 22, .18) 30%, rgba(10, 16, 22, .35) 62%, rgba(10, 16, 22, .86) 100%), linear-gradient(90deg, rgba(10, 16, 22, .55) 0%, rgba(10, 16, 22, 0) 55%); }
[data-paint="theme"] .veil { background: linear-gradient(180deg, rgba(10, 16, 22, .66), rgba(10, 16, 22, .5) 40%, rgba(10, 16, 22, .88)); }
[data-paint="moment"] .paint img.soft { transform: scale(1.08); image-rendering: auto; }
[data-paint="moment"] .veil { background: rgba(10, 16, 22, .62); }

/* ---- the bar ---- */
.bar { position: sticky; top: 0; z-index: 20; height: var(--bar); display: flex; align-items: center; gap: 16px; padding: 0 var(--pad); padding-left: max(var(--pad), env(safe-area-inset-left)); padding-right: max(var(--pad), env(safe-area-inset-right));
  background: rgba(12, 18, 24, .55); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); box-shadow: 0 1px 0 var(--glass-line); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; min-height: 44px; }
.brand span { display: grid; line-height: 1.15; }
.brand b { font-family: var(--serif); font-weight: 600; font-size: 20px; white-space: nowrap; }
.brand small { font-size: 13px; color: var(--on-2); white-space: nowrap; }
.bar-nav { display: flex; gap: 2px; margin-left: auto; padding: 4px; border-radius: 999px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line); }
.bar-nav a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 16px; white-space: nowrap; }
.bar-nav a:hover { background: var(--glass-hi); }
.bar-nav a[aria-current="page"] { background: var(--paper); color: var(--ink); }
.bar-base { flex: none; width: 216px; height: 1px; } /* the shared Who's here chip sits fixed at the top right; this keeps room for it and puts it early in the tab order */
@media (max-width: 1100px) { .brand small { display: none; } }
/* compact two-line wordmark wherever the bar is busy (phones, folds, tablets) */
@media (max-width: 1000px) {
  .brand { gap: 9px; }
  .brand svg { width: 34px; height: 34px; }
  .brand b { font-size: 16px; line-height: 1.02; white-space: normal; max-width: 4.6em; letter-spacing: -0.005em; }
}

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 22px; border-radius: 16px; border: 0; font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer; transition: transform .15s var(--ease), background .2s; text-align: center; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn.amber { background: var(--amber); color: var(--ink); box-shadow: 0 3px 0 var(--amber-lip); }
.btn.amber:focus-visible { outline: 3px solid var(--on); outline-offset: 3px; box-shadow: 0 3px 0 var(--amber-lip), 0 0 0 7px rgba(242, 181, 68, .45); }
.btn.glass { background: rgba(12, 18, 24, .72); color: var(--on); box-shadow: inset 0 0 0 1px var(--glass-line); }
.btn.glass:hover { background: var(--glass-2); }
.textbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 4px; background: none; border: 0; font-weight: 700; font-size: 16px; text-decoration: underline; text-decoration-color: rgba(243, 241, 236, .4); text-underline-offset: .25em; cursor: pointer; color: var(--on); }
.textbtn:hover { text-decoration-color: currentColor; }
.kicker { font-size: var(--fs-s); color: var(--on-2); }
.kicker a { text-decoration: none; } .kicker a:hover { text-decoration: underline; }
.sub-h { font-family: var(--serif); font-size: var(--fs-xl); color: #fff; margin-bottom: 12px; }
.back a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; color: var(--on-2); text-decoration: none; }
.back a:hover { color: var(--on); text-decoration: underline; }

.quiet { color: var(--on-2); font-size: 16px; }

.view { padding: 0 var(--pad) 72px; padding-left: max(var(--pad), env(safe-area-inset-left)); padding-right: max(var(--pad), env(safe-area-inset-right)); }

/* ---- age band picker ---- */
.seg-wrap { border: 0; margin: 22px 0 0; padding: 0; min-width: 0; }
.seg-wrap legend { padding: 0; font-weight: 700; font-size: 16px; color: var(--on-2); margin-bottom: 10px; }
.seg { display: inline-grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 5px; border-radius: 22px; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--glass-line); max-width: 100%; }
.seg-o { position: relative; display: block; cursor: pointer; }
.seg-o input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg-o span { display: grid; gap: 1px; min-height: 52px; padding: 9px 18px; border-radius: 17px; transition: background .2s, color .2s; }
.seg-o b { font-size: 17px; white-space: nowrap; }
.seg-o small { font-size: 13px; color: var(--on-2); white-space: nowrap; }
.seg-o:hover span { background: var(--glass-hi); }
.seg-o input:checked + span { background: var(--paper); color: var(--ink); box-shadow: 0 2px 0 var(--paper-line); }
.seg-o input:checked + span small { color: var(--ink-2); }
.seg-o input:focus-visible + span { outline: 3px solid var(--amber); outline-offset: 2px; }
.seg-o.off { cursor: default; opacity: .45; }

/* ---- home ---- */
.home { max-width: 1240px; margin: 0 auto; }
.hello { position: relative; padding: clamp(36px, 9vh, 110px) 0 clamp(26px, 5vh, 52px); max-width: 720px; }
.hello::before { content: ""; position: absolute; z-index: -1; inset: 8% -12% 0 -40%; background: radial-gradient(60% 70% at 35% 55%, rgba(10, 16, 22, .62), rgba(10, 16, 22, 0) 100%); pointer-events: none; }
.hello { isolation: isolate; }
/* the scrim reaches past the text on purpose; clip it so the page never scrolls sideways */
html, body { overflow-x: clip; }
.info-line { margin-top: 10px; font-size: var(--fs-s); }
.info-line a { display: inline-flex; align-items: center; min-height: 44px; color: var(--on); text-decoration-color: rgba(243, 241, 236, .5); text-shadow: 0 1px 10px rgba(0, 0, 0, .6); }
.hello h1 { font-size: clamp(48px, 8.4vw, 104px); line-height: .98; color: #fff; text-shadow: 0 2px 30px rgba(0, 0, 0, .4); }
.hello h1 em { font-style: italic; color: var(--amber); font-size: .78em; }
.hello .sub { margin-top: 16px; font-family: var(--serif); font-size: clamp(19px, 2.1vw, 25px); line-height: 1.4; color: var(--on); text-shadow: 0 1px 16px rgba(0, 0, 0, .5); max-width: 30em; }
.home-grid { display: grid; gap: 22px; }
.lead-card { display: grid; gap: 16px; }
.lead-pic { display: block; position: relative; aspect-ratio: 16 / 9; padding: 7px; background: var(--paper); border-radius: 6px; box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .8); transform: rotate(-.6deg); transition: transform .4s var(--ease); }
.lead-pic img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.lead-card:hover .lead-pic { transform: rotate(0deg) translateY(-3px); }
.lead-body { display: grid; gap: 8px; justify-items: start; padding: 0 4px; }
.lead-k { font-size: var(--fs-s); color: var(--on-2); }
.lead-body h2 { font-size: clamp(30px, 3.4vw, 42px); color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, .45); }
.hook { font-family: var(--serif); font-size: var(--fs-l); font-style: italic; color: var(--on); }
.lead-body .btn { margin-top: 8px; }
.also { margin-top: 22px; padding: 14px 10px 8px; border-radius: 16px; background: rgba(10, 16, 22, .6); }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.row { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 10px 12px 10px 8px; border-radius: 12px; text-decoration: none; transition: background .2s; }
.row:hover { background: rgba(255, 255, 255, .07); }
.row:hover .row-end { color: var(--on); transform: translateX(3px); }
.thumb { display: block; width: 104px; aspect-ratio: 4 / 3; overflow: hidden; position: relative; padding: 4px; background: var(--paper); border-radius: 4px; box-shadow: 0 10px 20px -12px rgba(0, 0, 0, .8); }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 1px; object-position: var(--tx) var(--ty) !important; transform: scale(1.9); transform-origin: var(--tx) var(--ty); }
.row-text { display: grid; gap: 3px; min-width: 0; }
.row-t { font-family: var(--serif); font-size: var(--fs-xl); line-height: 1.2; color: #fff; }
.row-h { font-size: var(--fs-s); color: var(--on-2); }
.row-n { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--on-2); }
.row-n svg { width: 16px; height: 16px; color: #E9C77F; }
.row-end { display: flex; align-items: center; color: var(--on-2); transition: transform .2s var(--ease), color .2s; }
.rooms { padding: 16px; align-self: start; border-radius: 16px; background: rgba(12, 18, 24, .62); backdrop-filter: blur(16px) saturate(1.1); -webkit-backdrop-filter: blur(16px) saturate(1.1); } /* frosted only here: the list sits on the busiest part of the painting */
.rooms ul { list-style: none; margin: 0; padding: 0; }
.rooms ul { display: grid; gap: 2px; }
.rooms a { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 8px; border-radius: 16px; text-decoration: none; transition: background .2s; }
.rooms a:hover { background: rgba(255, 255, 255, .07); }
.dot { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; position: relative; display: block; box-shadow: 0 0 0 3px var(--paper), 0 8px 16px -8px rgba(0, 0, 0, .8); }
.dot img { width: 100%; height: 100%; object-fit: cover; }
.room-t { display: grid; gap: 1px; min-width: 0; }
.room-t b { font-family: var(--serif); font-weight: 400; font-size: 20px; color: #fff; }
.room-t small { font-size: 15px; color: var(--on-2); line-height: 1.35; }
.room-n { font-size: 14px; color: var(--on-2); white-space: nowrap; text-align: right; }
.journal-link { margin-top: 10px; padding: 0 8px; }
@media (min-width: 900px) {
  .home-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; gap: 28px; }
}
@media (min-width: 1200px) {
  .lead-card { grid-template-columns: 1fr; }
}

/* ---- theme pages, journal, grown-ups ---- */
.theme { max-width: 900px; margin: 0 auto; }
.theme-head { padding: clamp(28px, 7vh, 80px) 0 24px; }
.theme-head h1 { font-size: clamp(40px, 6vw, 72px); color: #fff; text-shadow: 0 2px 26px rgba(0, 0, 0, .4); margin-top: 6px; }
.theme-head .sub { margin-top: 12px; font-family: var(--serif); font-size: clamp(18px, 2vw, 23px); color: var(--on); max-width: 34em; }
.list-panel { padding: 0; }
.list-panel .quiet { padding: 14px 12px; }
.empty { padding: 8px 0 0; display: grid; gap: 14px; justify-items: start; margin-top: 12px; max-width: 40em; }
.empty h1, .empty h2 { font-size: clamp(28px, 3.4vw, 38px); color: #fff; }
.empty p { max-width: 36em; color: var(--on); }
.prose { padding: clamp(22px, 3.4vw, 38px); margin-top: 18px; display: grid; gap: 12px; background: var(--paper); color: var(--ink); border-radius: 6px; box-shadow: 0 24px 50px -28px rgba(0, 0, 0, .8); }
.prose h2 { font-size: var(--fs-2xl); color: var(--ink); }
.prose .quiet { color: var(--ink-2); }
.prose a { color: var(--ink); }
.prose :focus-visible { outline: 3px solid var(--ink); box-shadow: 0 0 0 7px rgba(242, 181, 68, .55); }
.prose p { max-width: 42em; }
.numbers, .notes, .srcs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.numbers li { display: grid; grid-template-columns: auto 1fr; gap: 2px 18px; align-items: baseline; }
.numbers .num-src { grid-column: 2; display: grid; justify-items: start; }
.numbers .cite-t { font-size: var(--fs-s); color: var(--ink-2); padding: 6px 0; }
@media (max-width: 520px) { .numbers li { grid-template-columns: 1fr; } .numbers b { grid-row: auto; } .numbers .num-src { grid-column: 1; } }
.numbers b { font-family: var(--serif); font-weight: 600; font-size: 28px; color: var(--amber-ink); grid-row: span 2; }
.numbers a, .srcs a { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-s); color: var(--ink-2); min-height: 44px; }
.notes li { padding-left: 18px; position: relative; }
.notes li::before { content: ""; position: absolute; left: 0; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--sage); }
.srcs li { display: grid; gap: 4px; }
.srcs b { font-size: 16px; }
.srcs a { color: var(--ink); text-decoration-color: rgba(24, 33, 43, .35); }

/* wide screens: theme pages and the grown-ups page use the width */
@media (min-width: 1100px) {
  .theme:not(.journal):not(.grown-page) { max-width: 1240px; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 48px; align-items: start; }
  .theme:not(.journal):not(.grown-page) > .theme-head { position: sticky; top: calc(var(--bar) + 12px); }
  .theme:not(.journal):not(.grown-page) > .list-panel { margin-top: clamp(28px, 7vh, 80px); }
  .grown-page { max-width: 1240px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; align-items: start; }
  .grown-page > .theme-head { grid-column: 1 / -1; }
  .grown-page > .prose:last-child, .grown-page > .prose:nth-last-child(2) { grid-column: 1 / -1; }
  /* the source list reads top to bottom in one column, so a long organization never leaves a hole beside it */
  .sources-page { max-width: 880px; grid-template-columns: minmax(0, 1fr); }
}
/* ---- the journal: a keepsake of moments practiced, as small painted stamps ---- */
.journal { max-width: 1240px; }
.keep-top { display: grid; gap: 16px; }
.tally { padding: 4px 0; display: grid; gap: 4px; align-content: center; }
.tally b { font-family: var(--serif); font-weight: 400; font-size: clamp(48px, 6vw, 72px); line-height: 1; color: var(--amber); }
.tally span { font-family: var(--serif); font-size: var(--fs-l); }
.tally small { font-size: var(--fs-s); color: var(--on-2); }
.next-up { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 18px; align-items: center; padding: 10px; border-radius: 12px; text-decoration: none; transition: background .2s; }
.next-up:hover { background: rgba(255, 255, 255, .07); }
.next-up .thumb { width: 132px; }
.stamps-sec { margin-top: 26px; }
.stamps-sec h2 { font-size: var(--fs-2xl); color: #fff; margin-bottom: 14px; display: flex; align-items: baseline; gap: 12px; }
.stamps-sec h2 small { font-family: var(--sans); font-size: var(--fs-s); color: var(--on-2); }
.stamps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.stamp { display: block; text-decoration: none; color: var(--ink); padding: 7px; border-radius: 4px; transition: transform .25s var(--ease);
  background: radial-gradient(circle at center, transparent 3.6px, var(--paper) 4.2px) -6px -6px / 12px 12px; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .45)); }
.stamps li:nth-child(3n+1) .stamp { transform: rotate(-1.4deg); }
.stamps li:nth-child(3n+2) .stamp { transform: rotate(1deg); }
.stamp:hover { transform: translateY(-3px) rotate(0deg); }
.stamp-in { display: grid; gap: 6px; background: var(--paper); padding: 6px 6px 10px; }
.stamp .thumb { width: 100%; aspect-ratio: 4 / 3; border-radius: 2px; }
.stamp .thumb::after { box-shadow: inset 0 0 0 1px rgba(24, 33, 43, .12); border-radius: 2px; }
.stamp-t { font-family: var(--serif); font-size: var(--fs-s); line-height: 1.25; }
.stamp-m { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.stamp-m svg { width: 15px; height: 15px; fill: #3D6B5E; }
@media (min-width: 900px) { .keep-top { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); } }

/* ---- a moment: you step into the painting; the scene's words sit on the art, the choices sit beside or below ---- */
.moment { display: grid; gap: 0; max-width: 1640px; margin: 0 auto; }
.stage { position: relative; margin: 0 calc(-1 * var(--pad)); min-height: min(76svh, 720px); display: flex; flex-direction: column; justify-content: flex-end; padding: 0 var(--pad) 8px; }
.frame { position: absolute; inset: 0 0 auto 0; height: min(64svh, 600px); overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 100%); mask-image: linear-gradient(180deg, #000 62%, transparent 100%); }
.frame img { width: 100%; height: 100%; object-fit: cover; animation: drift 40s ease-in-out infinite alternate; transform-origin: var(--tx) var(--ty); }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.08) translate(-1%, -.6%); } }
.scene-cap { position: relative; display: grid; gap: 10px; padding: 20px 22px 12px; border-radius: 14px; background: rgba(12, 18, 24, .62); box-shadow: inset 0 0 0 1px var(--glass-line), 0 30px 60px -30px rgba(0, 0, 0, .8);
  backdrop-filter: blur(18px) saturate(1.15); -webkit-backdrop-filter: blur(18px) saturate(1.15); max-width: 720px; width: 100%; margin: 0 auto; }
.scene-cap h1 { font-size: var(--fs-3xl); color: #fff; }
.where { font-size: var(--fs-s); color: var(--on-2); }
.where a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; } .where a:hover { text-decoration: underline; }
.story-text { font-family: var(--serif); font-size: var(--fs-xl); line-height: 1.5; color: var(--on); }
.little .story-text { font-size: 25px; line-height: 1.48; }
.read { justify-self: start; color: var(--on-2); font-size: var(--fs-s); min-height: 44px; }
.story { max-width: 720px; width: 100%; margin: 0 auto; position: relative; display: grid; gap: 22px; padding: 18px 0 24px; }
.band-switch { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.band-switch a, .band-switch span { padding: 8px 16px; border-radius: 999px; font-size: var(--fs-s); font-weight: 700; text-decoration: none; box-shadow: inset 0 0 0 1px var(--glass-line); min-height: 44px; display: inline-flex; align-items: center; }
.band-switch a { color: var(--on-2); }
.band-switch a:hover { background: var(--glass-hi); color: var(--on); }
.band-switch span.on { background: var(--paper); color: var(--ink); box-shadow: none; }
.beat { display: grid; gap: 14px; scroll-margin-top: calc(var(--bar) + 16px); }
.beat.ask h2 { font-size: var(--fs-2xl); color: #fff; }
.beat.ask .story-text { font-size: var(--fs-l); }
.choices { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.choice { width: 100%; display: grid; gap: 8px; text-align: left; padding: 18px 22px; min-height: 64px; border: 0; border-radius: 8px; cursor: pointer; font-size: var(--fs-m); line-height: 1.45;
  background: #EFE8DA; color: var(--ink); box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 8px 18px -12px rgba(0, 0, 0, .8);
  transition: background .2s, box-shadow .25s, transform .25s var(--ease), opacity .2s; }
.little .choice { font-size: var(--fs-l); }
.choice:hover { background: var(--paper); transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 16px 28px -16px rgba(0, 0, 0, .85); }
.choice:active { transform: scale(.985); transition-duration: .08s; }
.choice:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.choice.on { background: #FBF8F1; transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 1px 0 #fff inset, 0 22px 36px -18px rgba(0, 0, 0, .9); }
.choice.was { opacity: .72; }
.choice.just { animation: lift .45s var(--ease) both; }
@keyframes lift { 0% { transform: scale(.98); } 60% { transform: translateY(-6px) rotate(-.4deg); } 100% { transform: translateY(-4px) rotate(-.4deg); } }
.verdict { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-s); font-weight: 700; color: var(--ink-2); }
.k2 .verdict { color: var(--amber-ink); }
.k1 .verdict { color: #2F5D50; }
.mk { flex: none; }
.mk.best { fill: #A8741A; color: #A8741A; }
.reply .mk.best { fill: var(--amber); color: var(--amber); }
.mk.ok { fill: #4F8173; }
.reply .mk.ok { fill: var(--sage); }
.mk.think { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; margin: 0 4px; }
.reply { padding: 4px 4px 0; display: grid; gap: 8px; animation: slidein .55s .18s var(--ease) both; }
.reply p { display: flex; gap: 12px; align-items: flex-start; font-family: var(--serif); font-size: var(--fs-l); line-height: 1.55; color: var(--on); }
.reply p .mk { margin-top: 4px; }
.reply .nudge { font-family: var(--sans); font-size: var(--fs-s); font-weight: 700; color: var(--on-2); padding-left: 34px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slidein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.go { display: flex; }
.beat.reveal { padding-top: 6px; gap: 18px; animation: rise .65s var(--ease) both; }
/* stepping in: the painting comes into focus, then the words, then the question */
.moment.enter .frame { animation: scenein 1.1s var(--ease) both; }
.moment.enter .scene-cap { animation: rise .7s .35s var(--ease) both; }
.moment.enter .story > * { animation: rise .6s var(--ease) both; }
.moment.enter .story > :nth-child(1) { animation-delay: .55s; }
.moment.enter .story > :nth-child(2) { animation-delay: .7s; }
.moment.enter .story > :nth-child(3) { animation-delay: .85s; }
@keyframes scenein { from { opacity: 0; transform: scale(1.06); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }

.paper { background: var(--paper); color: var(--ink); border-radius: 8px; padding: clamp(24px, 3.2vw, 36px); display: grid; gap: 16px;
  background-image: radial-gradient(120% 80% at 0% 0%, rgba(255, 255, 255, .7), transparent 60%), radial-gradient(90% 70% at 100% 100%, rgba(217, 205, 184, .45), transparent 70%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 30px 60px -30px rgba(0, 0, 0, .7); }
.paper h2 { font-size: var(--fs-2xl); color: var(--ink); }
.paper .why { font-family: var(--serif); font-size: var(--fs-l); line-height: 1.7; }
.story-text.bridge { font-style: italic; }
.little .paper .why { font-size: 22px; }
.paper .read, .paper .textbtn { color: var(--ink-2); text-decoration-color: rgba(24, 33, 43, .35); }
.paper :focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 7px rgba(242, 181, 68, .55); }
.home-try { position: relative; padding: 15px 22px 15px 26px; margin: 6px 4px; display: grid; gap: 0; transform: rotate(-.7deg); border-radius: 3px;
  background: #FFFDF7 repeating-linear-gradient(180deg, transparent 0 29px, rgba(96, 140, 170, .22) 29px 30px); background-position: 0 11px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .15), 0 14px 26px -16px rgba(0, 0, 0, .55); }
.home-try h3 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: var(--fs-xl); line-height: 30px; color: var(--ink); }
.home-try .tick { margin-top: 15px; }
.home-try p { font-family: var(--serif); font-size: var(--fs-m); line-height: 30px; color: var(--ink); }
.tick { position: relative; display: inline-flex; align-items: center; gap: 12px; font-weight: 700; cursor: pointer; justify-self: start; min-height: 48px; padding: 6px 16px 6px 8px; border-radius: 14px; transition: background .2s; }
.tick:hover { background: rgba(200, 141, 33, .14); }
.tick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.tick .box { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--paper); box-shadow: inset 0 0 0 2px var(--amber-lip); display: grid; place-items: center; transition: background .2s; }
.tick .box svg { opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s var(--ease); color: var(--ink); }
.tick input:checked + .box { background: var(--amber); box-shadow: inset 0 0 0 2px var(--amber-lip), 0 2px 0 var(--amber-lip); }
.tick input:checked + .box svg { opacity: 1; transform: none; }
.tick input:focus-visible + .box { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: inset 0 0 0 2px var(--amber-lip), 0 0 0 7px rgba(242, 181, 68, .55); }
.from { font-size: var(--fs-s); color: var(--ink-2); }
.grown { padding-top: 4px; }
.grown summary { cursor: pointer; font-weight: 700; font-size: var(--fs-m); min-height: 44px; display: flex; align-items: center; gap: 8px; list-style: none; border-radius: 10px; }
.grown summary:hover { color: var(--amber-ink); }
.grown summary::-webkit-details-marker { display: none; }
.grown summary::before { content: ""; width: 9px; height: 9px; border-right: 2.4px solid currentColor; border-bottom: 2.4px solid currentColor; transform: rotate(-45deg); transition: transform .2s; margin: 0 6px 0 2px; }
.grown[open] summary::before { transform: rotate(45deg); }
.grown p { font-size: var(--fs-m); line-height: 1.6; margin-top: 8px; color: var(--ink-2); }
.grown .talk { color: var(--ink); }
.cite { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; font-size: var(--fs-s); color: var(--ink-2); margin-top: 12px; }
.cite > span { font-weight: 700; }
.cite .checked { font-weight: 400; }
.cite a { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); text-decoration-color: rgba(24, 33, 43, .35); min-height: 44px; }
.cite a:hover { text-decoration-color: currentColor; }
.kept { display: flex; align-items: center; gap: 8px; font-size: var(--fs-s); font-weight: 700; color: #2F5D50; }
.kept:empty { display: none; }
.after { display: flex; flex-wrap: wrap; gap: 10px; }
.after .btn.amber { white-space: normal; text-align: left; }

/* wide screens and open foldables: the painting stays beside the story, with the scene's words on it */
@media (min-width: 760px) and (min-aspect-ratio: 1 / 1) and (min-height: 501px) {
  .moment { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(24px, 3.4vw, 56px); align-items: start; padding-top: 22px; }
  .stage { position: sticky; top: calc(var(--bar) + 18px); margin: 0; min-height: 0; height: calc(100svh - var(--bar) - 40px); max-height: 860px; padding: 18px; border-radius: 30px; overflow: hidden; }
  .frame { inset: 0; height: auto; border-radius: 30px; -webkit-mask-image: none; mask-image: none; }
  .frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 16, 22, 0) 35%, rgba(10, 16, 22, .55) 100%); box-shadow: inset 0 0 80px rgba(10, 16, 22, .5); }
  .scene-cap { margin: 0; max-width: none; }
  .story { margin: 0; max-width: 640px; padding-top: 4px; }
}
@media (min-width: 760px) and (max-width: 999px) and (min-aspect-ratio: 1 / 1) and (min-height: 501px) {
  .moment { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .scene-cap { padding: 16px 18px 8px; }
  .scene-cap .story-text { font-size: var(--fs-l); }
  .home-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
}
/* tablets held upright: a wide painting band with the words on it, then a centered column */
@media (min-width: 700px) and (max-aspect-ratio: 1 / 1) {
  .stage { min-height: min(62svh, 760px); }
  .frame { height: min(52svh, 640px); }
}
/* phones held sideways: the scene fills the screen first, the story follows below */
@media (max-height: 500px) and (min-aspect-ratio: 3 / 2) {
  :root { --bar: 56px; }
  .moment { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; padding-top: 10px; }
  .stage { position: sticky; top: calc(var(--bar) + 8px); margin: 0; min-height: 0; height: calc(100svh - var(--bar) - 16px); padding: 10px; border-radius: 18px; overflow: hidden; }
  .frame { inset: 0; height: auto; border-radius: 18px; -webkit-mask-image: none; mask-image: none; }
  .scene-cap { max-width: none; margin: 0; padding: 12px 14px 4px; gap: 4px; }
  .scene-cap .read { min-height: 44px; }
  .story { margin: 0; padding-top: 0; }
  .scene-cap h1 { font-size: 26px; }
  .scene-cap .story-text { font-size: var(--fs-s); line-height: 1.5; }
  .hello { padding: 20px 0 16px; }
  .hello h1 { font-size: 44px; }
  .home-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
}
/* phones */
@media (max-width: 720px) {
  :root { --bar: 62px; }
  .bar-nav { display: none; }
  .bar-base { width: 0; }
  .seg { display: grid; width: 100%; }
  .seg-o span { padding: 8px 10px; }
  .seg-o b { font-size: var(--fs-s); }
  .seg-o small { font-size: 12px; white-space: normal; line-height: 1.2; }
  .row { grid-template-columns: 76px minmax(0, 1fr); }
  .thumb { width: 76px; }
  .row-end { grid-column: 2; justify-content: flex-start; }
  .row-end svg { display: none; }
  .rooms { padding: 12px; }
  .room-n { grid-column: 2; text-align: left; }
  .rooms a { grid-template-columns: 48px minmax(0, 1fr); }
  .dot { width: 48px; height: 48px; grid-row: span 2; }
  .scene-cap { padding: 18px 18px 8px; border-radius: 22px; }
  .story-text { font-size: var(--fs-l); }
  .little .story-text { font-size: 22px; }
  .choice { font-size: 17px; padding: 16px 18px; }
  .little .choice { font-size: var(--fs-m); }
  .after .btn { width: 100%; }
  .tabbar { display: flex; }
  .view { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}
/* the small phone tab bar (phones only; the top bar has room for links everywhere else) */
.tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; justify-content: space-around; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(12, 18, 24, .78); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 -1px 0 var(--glass-line); }
.tabbar a { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border-radius: 14px; text-decoration: none; font-size: 13px; font-weight: 700; color: var(--on-2); min-height: 52px; }
.tabbar a[aria-current="page"] { color: var(--on); background: var(--glass-hi); }
.tabbar a[aria-current="page"] svg { color: var(--amber); }

/* tabletop posture (a foldable bent like a laptop): the scene on the top half, the choices on the bottom half */
@media (vertical-viewport-segments: 2) {
  .moment { display: block; }
  .stage { position: fixed; top: 0; left: 0; right: 0; height: env(viewport-segment-height 0 0); min-height: 0; margin: 0; padding: calc(var(--bar) + 8px) 18px 14px; z-index: 0; }
  .frame { inset: 0; height: auto; -webkit-mask-image: none; mask-image: none; }
  .scene-cap { max-width: 760px; }
  body[data-view="moment"] .bar { position: fixed; left: 0; right: 0; top: 0; background: rgba(12, 18, 24, .35); }
  body[data-view="moment"] main { position: fixed; left: 0; right: 0; top: env(viewport-segment-top 0 1); bottom: 0; overflow-y: auto; padding-top: 8px; z-index: 1; }
  body[data-view="moment"] .beat { scroll-margin-top: 8px; }
  body[data-view="moment"] .story { margin: 0 auto; }
}
/* book posture (a foldable held like a book): the scene on the left page, the choices on the right */
@media (horizontal-viewport-segments: 2) {
  .moment { grid-template-columns: env(viewport-segment-width 0 0) 1fr; gap: 0; padding-top: 0; }
  .stage { position: sticky; top: var(--bar); height: calc(100svh - var(--bar)); margin: 0; border-radius: 0; min-height: 0; max-height: none; padding: 16px; }
  .frame { inset: 0; height: auto; border-radius: 0; -webkit-mask-image: none; mask-image: none; }
  .story { padding: 20px calc(env(viewport-segment-left 0 1) - env(viewport-segment-right 0 0) + 24px); }
}

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; max-width: min(92vw, 520px); padding: 14px 20px; border-radius: 16px; background: var(--paper); color: var(--ink); font-weight: 700; box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .6); }
@media (max-width: 720px) { .toast { bottom: calc(90px + env(safe-area-inset-bottom)); } }
.noscript { max-width: 560px; margin: 60px auto; padding: 28px; border-radius: 24px; background: var(--glass-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .paint img { opacity: 1; }
}
@media (forced-colors: active) {
  .choice, .row, .btn { border: 1px solid CanvasText; }
}

/* the grown-up gate: press and hold a source link for two seconds; a quiet fill shows the hold */
a[data-gate] { position: relative; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; background-image: linear-gradient(rgba(242, 181, 68, .45), rgba(242, 181, 68, .45)); background-repeat: no-repeat; background-size: 0% 100%; border-radius: 4px; }
a[data-gate].holding { background-size: 100% 100%; transition: background-size var(--hold, 2000ms) linear; }
.cite-t { display: inline-block; padding: 10px 0; color: var(--ink); }
.cite-t small { color: var(--ink-2); font-size: 14px; margin-left: 4px; }
.prose .cite-t { color: var(--ink); }
.disclaimer { background: #FBF3E1; box-shadow: inset 0 0 0 1px rgba(200, 141, 33, .35), 0 24px 50px -28px rgba(0, 0, 0, .8); }
.disclaimer p { font-size: var(--fs-m); line-height: 1.6; }
.srclist { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.srclist li { display: grid; gap: 2px; }
.src-t { font-family: var(--serif); font-size: var(--fs-m); }
.src-t a { color: var(--ink); text-decoration-color: rgba(24, 33, 43, .35); display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.src-u, .src-c { font-size: 15px; color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { a[data-gate].holding { background-size: 100% 100%; } }

/* tablets held upright (and other tall screens wider than a phone): a smaller lead painting beside the start of the list, themes in two columns */
@media (min-width: 700px) and (max-width: 1099px) and (max-aspect-ratio: 4 / 5) {
  .hello { padding-top: 40px; padding-bottom: 24px; }
  .home-grid { grid-template-columns: 1fr; }
  .next { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
  .also { margin-top: 0; }
  .rooms ul { grid-template-columns: 1fr 1fr; gap: 4px 18px; }
  .rooms li + li { border-top: 0; }
}
