/* Family Library: "Library Edition", an English classical look.
   Parchment and ivory, Garamond type, gold hairlines, deep green and oxblood. */

@font-face { font-family: "EB Garamond"; src: url("/fonts/garamond.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("/fonts/caveat.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/fonts/garamond-italic.woff2") format("woff2"); font-weight: 400 800; font-style: italic; font-display: swap; }

:root {
  --bg: #f4efe4;
  --surface: #fbf8f1;
  --surface-2: #ebe4d5;
  --ink: #2b2520;
  --ink-2: #5f554a;
  --ink-3: #8c8070;
  --line: rgba(84, 62, 36, .17);
  --gold: #b0915a;
  --gold-soft: rgba(176, 145, 90, .45);
  --green: #2c4a3a;
  --green-ink: #22392d;
  --green-soft: #e1e6da;
  --accent: #7b2d26;        /* oxblood: drop caps, seals, warnings */
  --accent-ink: #7b2d26;
  --accent-soft: #f1e1d6;
  --sage: #4f6b57;
  --on-dark: #f7f1e3;

  --t-photo: #efe4d2;
  --t-film: #e0e3dc;
  --t-letter: #ece4cf;
  --t-certificate: #ecdfc2;

  --shadow-sm: 0 1px 0 rgba(60, 40, 20, .05);
  --shadow: 0 1px 0 rgba(60, 40, 20, .05), 0 12px 26px -18px rgba(60, 40, 20, .45);
  --shadow-lg: 0 2px 0 rgba(60, 40, 20, .05), 0 28px 54px -26px rgba(60, 40, 20, .55);

  --serif: "EB Garamond", Garamond, "Iowan Old Style", Baskerville, Georgia, "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --display: var(--serif);
  --hand: "Caveat", "Kaiti SC", "STKaiti", "KaiTi", "Bradley Hand", cursive;
  --hand-ink: #2c3a63;
  --text: var(--serif);
  --r: 3px;
  --r-lg: 4px;
  --max: 1560px;
  --gutter: clamp(16px, 4vw, 64px);
  color-scheme: light;
}

/* The evening look (the default): deep green-black, ivory and soft green. */
:root[data-theme="dark"] {
  --bg: #171a17;
  --surface: #1f231f;
  --surface-2: #292e28;
  --ink: #ece3d0;
  --ink-2: #bcb29e;
  --ink-3: #8b8370;
  --line: rgba(236, 227, 208, .13);
  --gold: #c6a86c;
  --gold-soft: rgba(198, 168, 108, .4);
  --green: #46694f;
  --green-ink: #a9c8b0;
  --green-soft: #26332a;
  --accent: #d38a7a;
  --accent-ink: #e3a294;
  --accent-soft: #3a2724;
  --sage: #9cbaa3;
  --t-photo: #2e2a22;
  --t-film: #232a26;
  --t-letter: #2b2a21;
  --t-certificate: #312b1e;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 14px 30px -18px rgba(0, 0, 0, .8);
  --shadow-lg: 0 30px 60px -26px rgba(0, 0, 0, .85);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); min-height: 100vh;
  font: 400 18.5px/1.6 var(--serif); font-variant-numeric: oldstyle-nums proportional-nums;
  -webkit-font-smoothing: antialiased; font-kerning: normal; font-feature-settings: "liga", "kern";
  background: var(--bg);
}
a { color: inherit; }
img, video { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.12; letter-spacing: -.005em; margin: 0 0 .35em; }
.muted { color: var(--ink-2); }
.hidden { display: none !important; }
.small-caps, .eyebrow { font: 500 .74rem/1.4 var(--serif); letter-spacing: .22em; text-transform: uppercase; color: var(--ink-3); font-variant-numeric: lining-nums; }
.icon { width: 1.1em; height: 1.1em; display: inline-block; vertical-align: -.18em; flex: none; }
.icon svg { width: 100%; height: 100%; display: block; stroke-width: 1.5; }

/* a small gold rule with a diamond in the middle */
.story::before, .memory header::after, .hero-text::after, .page-head > div:first-child::after, .gate-card h1::after {
  content: ""; display: block; width: 130px; height: 9px; margin: 22px auto 0;
  background:
    linear-gradient(var(--gold), var(--gold)) left center / 44% 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right center / 44% 1px no-repeat,
    linear-gradient(45deg, transparent 40%, var(--gold) 40% 60%, transparent 60%) center / 9px 9px no-repeat,
    linear-gradient(-45deg, transparent 40%, var(--gold) 40% 60%, transparent 60%) center / 9px 9px no-repeat;
}

/* ---------- masthead ---------- */
.top { position: relative; z-index: 30; background: var(--bg); }
.top-inner { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: 20px; padding: 22px var(--gutter) 0; }
.brand { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; }
.brand .mark { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: var(--gold); font: italic 500 1.55rem/1 var(--serif);
  border: 1px solid var(--gold); box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--gold-soft); padding-bottom: 2px; }
.brand #family-name { font: 400 clamp(1.6rem, 2.6vw, 2.2rem)/1.1 var(--serif); letter-spacing: .02em; }
.top-actions { grid-column: 3; grid-row: 1; justify-self: end; display: flex; align-items: center; gap: 12px; }
.nav { grid-column: 1 / -1; grid-row: 2; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 0; margin-top: 16px; padding: 9px 0; border-top: 1px solid var(--gold-soft); border-bottom: 3px double var(--gold-soft); }
.nav a { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--ink-2); padding: 4px 18px; font: 500 .8rem/1.4 var(--serif); letter-spacing: .2em; text-transform: uppercase; white-space: nowrap; position: relative; transition: color .15s; }
.nav a + a::before { content: ""; position: absolute; left: -2px; top: 50%; width: 4px; height: 4px; background: var(--gold); transform: translateY(-50%) rotate(45deg); opacity: .8; }
.nav a .icon { display: none; }
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--green-ink); }
.nav a.active span:last-child { box-shadow: 0 1px 0 var(--gold); }
.nav a.nav-add { display: none; }
.theme-toggle { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--gold); background: transparent; border: 1px solid var(--gold-soft); padding: 0; flex: none; transition: border-color .2s, color .2s; }
.theme-toggle:hover { border-color: var(--gold); color: var(--ink); }
.theme-toggle .icon { width: 18px; height: 18px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; text-decoration: none; font: italic 500 .95rem var(--serif); color: var(--green-ink); background: var(--surface); border: 1px solid var(--gold-soft); flex: none; }

main { max-width: var(--max); margin: 0 auto; padding: 36px var(--gutter) 110px; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none; white-space: nowrap;
  font: 500 .78rem/1 var(--serif); letter-spacing: .18em; text-transform: uppercase; color: var(--on-dark); background: var(--ink); border: 1px solid transparent; border-radius: 2px; padding: 13px 22px; transition: background .2s, color .2s, border-color .2s; }
.btn:hover { background: var(--green-ink); }
.btn.accent { background: var(--green); color: var(--on-dark); }
.btn.accent:hover { background: var(--green-ink); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--gold-soft); }
.btn.ghost:hover { border-color: var(--gold); background: var(--surface); }
.btn.small { padding: 10px 16px; font-size: .72rem; }
.btn.danger { background: transparent; color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.btn:disabled { opacity: .5; cursor: default; }
/* :where() keeps these as weak as plain .btn, so accent, ghost and danger buttons still win */
:where([data-theme="dark"]) .btn { background: var(--ink); color: var(--bg); }
:where([data-theme="dark"]) .btn:hover { background: var(--on-dark); }

.stack { display: grid; gap: 22px; }
label { display: grid; gap: 7px; align-content: start; font: 500 .74rem var(--serif); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
input, textarea, select { font: 400 1.05rem var(--serif); letter-spacing: 0; text-transform: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 2px; padding: 12px 14px; width: 100%; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 200px; line-height: 1.7; resize: vertical; font-size: 1.12rem; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); }
input[type=file] { padding: 10px; }

/* ---------- hero: a mounted photograph ---------- */
.hero { position: relative; overflow: hidden; min-height: min(70vh, 740px); display: flex; align-items: flex-end; justify-content: center; isolation: isolate; color: var(--on-dark);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.hero .slide { position: absolute; inset: 12px; opacity: 0; transition: opacity 1.8s ease; z-index: -2; overflow: hidden; }
.hero .slide.on { opacity: 1; }
.hero .slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); }
.hero .slide.on img { animation: drift 16s ease-out forwards; }
@keyframes drift { from { transform: scale(1.1); } to { transform: scale(1.01); } }
.hero::before { content: ""; position: absolute; inset: 12px; z-index: -1; pointer-events: none; outline: 1px solid rgba(255, 255, 255, .35); outline-offset: -14px;
  background: linear-gradient(180deg, rgba(20, 14, 8, 0) 40%, rgba(20, 14, 8, .68) 100%); }
.hero.plain { color: var(--ink); background: var(--surface); }
.hero.plain::before { background: none; outline-color: var(--gold-soft); }
.hero-text { padding: clamp(30px, 5vw, 60px) clamp(24px, 5vw, 60px); max-width: 860px; text-align: center; }
.hero-text::after { margin-top: 24px; filter: brightness(1.25); }
.hero .eyebrow { color: currentColor; opacity: .85; }
.hero h1 { font-size: clamp(3rem, 7.5vw, 6rem); margin: 10px 0 12px; font-weight: 400; letter-spacing: .01em; }
.hero p { font: italic 400 clamp(1.1rem, 2vw, 1.4rem)/1.5 var(--serif); margin: 0 auto; max-width: 34em; opacity: .94; }
.hero .now { display: inline-flex; align-items: center; gap: 9px; margin-top: 20px; padding: 7px 16px; text-decoration: none; font: italic 400 1rem var(--serif); border-top: 1px solid rgba(255, 255, 255, .4); border-bottom: 1px solid rgba(255, 255, 255, .4); transition: border-color .2s; }
.hero .now:hover { border-color: #fff; }
.hero .now .icon { display: none; }
.hero.plain .now { border-color: var(--gold-soft); }
.hero .dots { position: absolute; right: 36px; bottom: 34px; display: flex; gap: 8px; }
.hero .dots button { width: 7px; height: 7px; padding: 0; border: 1px solid rgba(255, 255, 255, .8); background: transparent; transform: rotate(45deg); cursor: pointer; transition: background .3s; }
.hero .dots button.on { background: #fff; }

/* ---------- section heads: title, a double rule, a link ---------- */
.section { margin-top: 72px; }
.section-head { display: flex; align-items: center; gap: 22px; margin-bottom: 28px; }
.section-head::after { content: ""; order: 1; flex: 1; border-top: 3px double var(--gold-soft); }
.section-head h2 { order: 0; font-size: clamp(1.7rem, 3vw, 2.3rem); margin: 0; font-style: italic; }
.section-head a { order: 2; font: 500 .74rem var(--serif); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.section-head a:hover { color: var(--green-ink); }

/* ---------- collections: four numbered volumes ---------- */
.collections { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 30px; counter-reset: vol; }
.collection { counter-increment: vol; position: relative; display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 4 / 5; overflow: hidden; text-decoration: none; isolation: isolate;
  background: var(--surface); border: 1px solid var(--line); padding: 10px; box-shadow: var(--shadow); transition: transform .4s cubic-bezier(.2, .7, .2, 1), box-shadow .4s; }
.collection:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.collection img { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: cover; z-index: -2; transition: transform 1s cubic-bezier(.2, .7, .2, 1); }
.collection:hover img { transform: scale(1.04); }
.collection.has-cover { color: var(--on-dark); }
.collection.has-cover::after { content: ""; position: absolute; inset: 10px; z-index: -1; background: linear-gradient(180deg, transparent 38%, rgba(20, 14, 8, .72)); }
.collection .c-icon { display: none; }
.collection .c-text { padding: 22px 18px; text-align: center; position: relative; }
.collection .c-text::before { content: counter(vol, upper-roman); display: block; font: 500 .78rem var(--serif); letter-spacing: .24em; opacity: .8; margin-bottom: 8px; }
.collection h3 { font-size: 1.75rem; margin: 0 0 4px; }
.collection .c-meta { font: italic 400 .98rem var(--serif); opacity: .85; }
.collection .c-art { position: absolute; left: 50%; top: 22%; width: 34%; aspect-ratio: 1; transform: translateX(-50%); color: var(--gold); opacity: .55; z-index: -1; }
.collection .c-art .icon { width: 100%; height: 100%; }
.collection:not(.has-cover)::before { content: ""; position: absolute; inset: 10px; border: 1px solid var(--gold-soft); outline: 1px solid var(--gold-soft); outline-offset: -6px; pointer-events: none; }
.collection .c-desc { font: italic 400 1rem/1.4 var(--serif); color: var(--ink-2); margin: 2px 0 6px; }
.c-photo:not(.has-cover) { background: var(--t-photo); } .c-film:not(.has-cover) { background: var(--t-film); }
.c-letter:not(.has-cover) { background: var(--t-letter); } .c-certificate:not(.has-cover) { background: var(--t-certificate); }

/* ---------- memory grid: prints in an album ---------- */
.grid { columns: 300px; column-gap: 28px; }
.tile { break-inside: avoid; display: block; margin: 0 0 36px; text-decoration: none; color: var(--ink); }
.tile .media { position: relative; overflow: hidden; background: var(--surface); padding: 9px; border: 1px solid var(--line); box-shadow: var(--shadow); transform: translateZ(0); transition: box-shadow .4s, transform .4s cubic-bezier(.2, .7, .2, 1); }
.tile:hover .media { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.tile .media img, .tile .media video { width: 100%; height: auto; }
.tile .badge { position: absolute; top: 18px; left: 18px; display: inline-flex; align-items: center; gap: 5px; font: 500 .66rem var(--serif); letter-spacing: .18em; text-transform: uppercase; color: #2b2520; background: rgba(251, 248, 241, .9); padding: 4px 9px 3px; }
.tile .badge .icon { display: none; }
.tile .count-badge { left: auto; right: 18px; font-variant-numeric: lining-nums; }
.tile .body { padding: 14px 4px 0; text-align: center; }
.tile h3 { font-size: 1.35rem; margin: 0 0 3px; transition: color .2s; }
.tile:hover h3 { color: var(--green-ink); }
.tile .meta { font: italic 400 .95rem var(--serif); color: var(--ink-3); }
.tile .excerpt { margin: 8px 0 0; font-size: 1rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.play { position: absolute; inset: 0; display: grid; place-items: center; }
.play span { width: 58px; height: 58px; border-radius: 50%; background: rgba(251, 248, 241, .9); display: grid; place-items: center; color: #2b2520; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.play .icon { width: 20px; height: 20px; margin-left: 3px; }

/* text-first tiles: bookplates */
.panel-tile { padding: 30px 26px 24px; position: relative; overflow: hidden; text-align: center; border: 1px solid var(--line); box-shadow: var(--shadow); outline: 1px solid var(--gold-soft); outline-offset: -8px; transition: transform .4s cubic-bezier(.2, .7, .2, 1), box-shadow .4s; }
.tile:hover .panel-tile { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.panel-tile .p-icon { width: 40px; height: 40px; margin: 0 auto 16px; display: grid; place-items: center; color: var(--gold); border: 1px solid var(--gold-soft); border-radius: 50%; }
.panel-tile .p-icon .icon { width: 18px; height: 18px; }
.panel-tile h3 { font-size: 1.5rem; }
.panel-tile .quote { font: italic 400 1.1rem/1.6 var(--serif); color: var(--ink); margin: 10px 0 14px; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.panel-tile .meta { color: var(--ink-2); }
.panel-tile.letter { background: var(--t-letter); }
.panel-tile.certificate { background: var(--t-certificate); }
.panel-tile.voice, .panel-tile.film { background: var(--t-film); }
.panel-tile.photo { background: var(--t-photo); }
.panel-tile.sealed { background: var(--accent-soft); }
.notes-count { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font: italic .92rem var(--serif); color: var(--green-ink); }
.wave { display: flex; align-items: center; justify-content: center; gap: 3px; height: 34px; margin: 4px 0 14px; }
.wave i { width: 2px; background: var(--ink); opacity: .45; }
.sealed-note { font-style: italic; color: var(--accent-ink) !important; }

/* ---------- page heads ---------- */
.page-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 22px; margin: 12px 0 44px; }
.page-head h1 { font-size: clamp(2.6rem, 5vw, 3.8rem); margin: 8px 0 6px; }
.page-head .muted { max-width: 52ch; margin: 0 auto; font-style: italic; font-size: 1.1rem; }
.page-head > div:first-child::after { margin-top: 20px; }
.head-tools { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }
.search { position: relative; width: 300px; }
.search input { padding-left: 40px; background: var(--surface); }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }

/* ---------- timeline ---------- */
.year { display: grid; grid-template-columns: 170px 1fr; gap: 32px; margin-bottom: 56px; }
.year h2 { font-size: 3.4rem; font-style: italic; color: var(--gold); position: sticky; top: 24px; align-self: start; text-align: right; border-right: 1px solid var(--gold-soft); padding-right: 26px; font-variant-numeric: oldstyle-nums; }
.year .entries { display: grid; gap: 4px; }
.entry { display: grid; grid-template-columns: 80px 1fr auto; gap: 20px; align-items: center; text-decoration: none; padding: 10px; border-bottom: 1px solid var(--line); transition: background .2s; }
.entry:hover { background: var(--surface); }
.entry .thumb { width: 80px; height: 80px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; color: var(--gold); border: 4px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.entry .thumb .icon { width: 24px; height: 24px; }
.entry h3 { font-size: 1.3rem; margin: 0 0 2px; }
.entry .meta { font: italic .95rem var(--serif); color: var(--ink-3); }
.entry .when { font: italic .95rem var(--serif); color: var(--ink-3); white-space: nowrap; }

/* ---------- memory detail ---------- */
.memory { max-width: 1280px; margin: 0 auto; }
.memory header { text-align: center; margin: 18px auto 40px; max-width: 760px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font: 500 .72rem var(--serif); letter-spacing: .22em; text-transform: uppercase; color: var(--ink-3); text-decoration: none; }
.chip .icon { display: none; }
.chip:hover { color: var(--green-ink); }
.memory header h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); margin: 14px 0 10px; }
.memory header .muted { font-style: italic; font-size: 1.12rem; }
.memory .gallery { display: grid; gap: 22px; margin-bottom: 40px; justify-items: center; }
.memory .gallery > img { width: auto !important; max-width: 100%; max-height: 84vh; }
.memory .gallery.multi { display: block; columns: 2 380px; column-gap: 22px; }
.memory .gallery.multi > * { break-inside: avoid; margin: 0 0 22px; width: 100% !important; max-height: none; }
.memory .gallery.multi > :first-child { column-span: all; }
.memory .gallery img, .memory .gallery video { width: 100%; background: #000; padding: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.memory .gallery img { cursor: zoom-in; }
.memory .gallery iframe { width: 100%; height: 80vh; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.memory .gallery audio { width: 100%; }
.memory .gallery .panel-tile audio { margin-top: 6px; }
.frame { padding: clamp(20px, 4vw, 44px); background: var(--surface); border: 1px solid var(--gold-soft); outline: 1px solid var(--gold-soft); outline-offset: -10px; box-shadow: var(--shadow-lg); }
.frame > * { box-shadow: 0 0 0 1px var(--line) !important; border: 0 !important; padding: 0 !important; }

/* the photo viewer: one at a time, arrows either side */
.carousel { margin: 0 auto 44px; }
.car-stage { position: relative; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); padding: 12px; }
.car-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; background: color-mix(in srgb, var(--surface-2) 70%, var(--surface)); }
.car-track::-webkit-scrollbar { display: none; }
.car-slide { flex: 0 0 100%; height: min(76vh, 820px); margin: 0; display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; scroll-snap-align: center; scroll-snap-stop: always; }
.car-slide img, .car-slide video { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.car-slide img { cursor: zoom-in; }
.car-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  color: var(--ink); background: color-mix(in srgb, var(--surface) 90%, transparent); border: 1px solid var(--gold-soft); box-shadow: var(--shadow); transition: background .2s, border-color .2s, transform .2s; }
.car-btn:hover { border-color: var(--gold); background: var(--surface); }
.car-btn:active { transform: translateY(-50%) scale(.95); }
.car-btn .icon { width: 24px; height: 24px; }
.car-btn.prev { left: 26px; }
.car-btn.next { right: 26px; }
.car-bar { display: flex; align-items: center; gap: 20px; margin-top: 16px; }
.car-count { font: italic 400 1.05rem var(--serif); color: var(--ink-2); white-space: nowrap; min-width: 4.5em; font-variant-numeric: lining-nums; }
.car-thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; padding: 3px; flex: 1; }
.car-thumbs button { flex: none; width: 74px; height: 56px; padding: 0; border: 0; cursor: pointer; background: var(--surface-2); opacity: .55; outline: 1px solid var(--line); transition: opacity .2s, outline-color .2s; }
.car-thumbs button:hover { opacity: .85; }
.car-thumbs button.on { opacity: 1; outline: 2px solid var(--gold); outline-offset: 1px; }
.car-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.car-vid { display: grid; place-items: center; height: 100%; color: var(--ink-2); }

.paper { background: var(--surface); border: 1px solid var(--line); outline: 1px solid var(--gold-soft); outline-offset: -12px; box-shadow: var(--shadow); padding: clamp(32px, 7vw, 80px); font: 400 1.22rem/1.85 var(--serif); white-space: pre-wrap; max-width: 780px; margin: 0 auto;
  background-image: linear-gradient(180deg, transparent 0, transparent calc(100% - 1px), var(--line) 0); }
.paper::first-letter { font-size: 4.2em; float: left; line-height: .8; padding: 10px 12px 0 0; color: var(--accent); }
.story { max-width: 680px; margin: 0 auto; text-align: center; font: italic 400 clamp(1.2rem, 2.2vw, 1.5rem)/1.7 var(--serif); color: var(--ink); white-space: pre-wrap; }
.story::before { margin: 0 auto 26px; }
.byline { text-align: center; font: italic .98rem var(--serif); color: var(--ink-3); margin-top: 32px; }
.memory .actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(18, 14, 10, .95); display: grid; place-items: center; animation: fade .2s; }
.lb-stage { position: absolute; inset: 56px 84px; display: flex; align-items: center; justify-content: center; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.lb-count { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: rgba(247, 241, 227, .75); font: italic 1rem var(--serif); font-variant-numeric: lining-nums; }
.lb-btn { position: absolute; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: #f7f1e3; background: rgba(255, 255, 255, .08); border: 1px solid rgba(247, 241, 227, .3); transition: background .2s; }
.lb-btn:hover { background: rgba(255, 255, 255, .18); }
.lb-btn .icon { width: 24px; height: 24px; }
.lb-btn.prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-btn.next { right: 18px; top: 50%; transform: translateY(-50%); }
.lb-btn.close { right: 18px; top: 18px; width: 44px; height: 44px; }
@keyframes fade { from { opacity: 0; } }

/* ---------- capsules ---------- */
.capsule { text-align: center; padding: 64px 28px; background: var(--surface); border: 1px solid var(--line); outline: 1px solid var(--gold-soft); outline-offset: -10px; box-shadow: var(--shadow); margin-bottom: 32px; }
.capsule h2 { font-size: 2.1rem; font-style: italic; }
.seal { width: 78px; height: 78px; margin: 0 auto 22px; border-radius: 50%; display: grid; place-items: center; color: #f3d9c9; background: radial-gradient(circle at 35% 30%, #a2463b, #7b2d26 60%, #561d18); box-shadow: 0 0 0 4px rgba(123, 45, 38, .18), 0 10px 22px -8px rgba(86, 29, 24, .7); }
.seal .icon { width: 28px; height: 28px; }
.capsule-note { text-align: center; font-style: italic; color: var(--accent-ink); margin: -16px 0 28px; }
.capsule-option { padding: 16px 18px; background: var(--bg); border: 1px solid var(--line); }
.capsule-option summary { cursor: pointer; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; list-style: none; text-transform: none; letter-spacing: 0; }
.capsule-option summary::-webkit-details-marker { display: none; }
.capsule-option p { margin: 10px 0 14px; font-size: 1rem; text-transform: none; letter-spacing: 0; }

/* ---------- notes ---------- */
.notes { max-width: 780px; margin: 64px auto 0; }
.notes h2 { font-size: 1.8rem; font-style: italic; text-align: center; }
.note { display: grid; grid-template-columns: 40px 1fr; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.note .avatar { width: 40px; height: 40px; }
.note p { margin: 4px 0 0; white-space: pre-wrap; color: var(--ink); }
.note-head { display: flex; gap: 10px; align-items: baseline; font-size: .95rem; }
.note-head strong { font-weight: 600; }
.note-head .muted { font-style: italic; }
.linklike { margin-left: auto; background: none; border: 0; color: var(--ink-3); font: italic .92rem var(--serif); cursor: pointer; }
.linklike:hover { color: var(--accent-ink); }
.note-form { display: grid; gap: 12px; margin-top: 18px; }
.note-input { min-height: 96px; font-size: 1.05rem; background: var(--surface); }

/* ---------- forms pages ---------- */
.panel { background: var(--surface); padding: clamp(24px, 4vw, 44px); border: 1px solid var(--line); box-shadow: var(--shadow); }
.form-wrap { max-width: 820px; margin: 0 auto; }
.kinds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kinds input { position: absolute; opacity: 0; pointer-events: none; }
.kinds label { cursor: pointer; display: grid; justify-items: center; gap: 8px; text-align: center; padding: 18px 8px 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); transition: border-color .15s, background .15s; }
.kinds label .icon { width: 24px; height: 24px; color: var(--gold); }
.kinds label:hover { background: var(--surface-2); }
.kinds label:has(input:checked) { background: var(--green-soft); border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.kinds label:has(input:checked) .icon { color: var(--green-ink); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.drop { border: 1px dashed var(--gold); padding: 36px 20px; text-align: center; background: var(--bg); cursor: pointer; color: var(--ink-2); font-size: 1.05rem; font-style: italic; transition: background .15s; }
.drop .icon { width: 28px; height: 28px; display: block; margin: 0 auto 10px; color: var(--gold); }
.drop.over, .drop:hover { background: var(--surface-2); }
.files { display: grid; gap: 8px; font-size: .98rem; }
.file-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); }
.bar { grid-column: 1 / -1; height: 2px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--green); transition: width .2s; }
.error { color: var(--accent-ink); font-size: 1rem; font-style: italic; }
.btn.recording { color: #fff; background: var(--accent); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(123, 45, 38, .16); } }

/* ---------- family / keys ---------- */
.members { display: grid; gap: 14px; }
.member { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; }
.member .avatar { width: 48px; height: 48px; font-size: 1.1rem; }
.member h3 { margin: 0; font-size: 1.4rem; }
.member .role { font: 500 .66rem var(--serif); text-transform: uppercase; letter-spacing: .2em; color: var(--sage); margin-left: 10px; vertical-align: middle; }
.keys { grid-column: 1 / -1; display: grid; gap: 4px; font-size: .95rem; color: var(--ink-2); }
.key { display: flex; gap: 12px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 8px; }
.key.revoked { opacity: .45; text-decoration: line-through; }
.note-box { background: var(--t-certificate); border: 1px solid var(--gold-soft); padding: 20px 24px; margin-bottom: 24px; }

.modal { position: fixed; inset: 0; z-index: 70; background: rgba(28, 22, 16, .55); display: grid; place-items: center; padding: 20px; animation: fade .2s; }
.modal .panel { max-width: 460px; width: 100%; max-height: 92vh; overflow: auto; }
.keycard { text-align: center; overflow: hidden; background: #fbf8f1; color: #2b2520; border: 1px solid #d8ccb3; outline: 1px solid #c9b48a; outline-offset: -8px; }
.keycard .band { height: 70px; background: #2c4a3a; display: grid; place-items: center; color: #d9c08a; border-bottom: 3px double #c9b48a; }
.keycard .band .icon { width: 24px; height: 24px; }
.keycard .inner { padding: 22px 28px 32px; }
.keycard .eyebrow { color: #8c8070; }
.keycard h2 { font-size: 2rem; margin: 6px 0 2px; }
.keycard .rel { color: #5f554a; font-style: italic; }
.keycard .qr { width: 210px; height: 210px; margin: 18px auto 12px; padding: 12px; background: #fff; border: 1px solid #e3d9c4; }
.keycard .qr svg { width: 100%; height: 100%; }
.keycard .how { font: italic 400 1.05rem/1.5 var(--serif); color: #5f554a; margin: 0; }
.linkbox { font: .76rem ui-monospace, Menlo, monospace; word-break: break-all; background: var(--bg); padding: 10px 12px; border: 1px solid var(--line); color: var(--ink-2); }

/* ---------- storage ---------- */
.storage-banner { display: flex; align-items: center; gap: 12px; padding: 12px 18px; margin-bottom: 24px; font-size: 1rem; background: var(--t-certificate); border: 1px solid var(--gold-soft); color: var(--ink); }
.storage-banner.over { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.storage-banner a { margin-left: auto; white-space: nowrap; color: var(--accent-ink); font-style: italic; }
.storage-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.storage-pct { font: italic 400 2.4rem/1 var(--serif); color: var(--gold); }
.meter { height: 6px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.meter i { display: block; height: 100%; background: var(--green); transition: width .6s ease; }
.meter.warn i { background: var(--gold); }
.meter.full i { background: var(--accent); }
.switch { display: flex; gap: 12px; align-items: flex-start; font: 400 1rem var(--serif); text-transform: none; letter-spacing: 0; color: var(--ink); cursor: pointer; }
.switch input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--green); flex: none; }
.switch strong { font-weight: 600; }

/* ---------- people: oval portraits, like cameos ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 26px; }
.person-card { text-align: center; text-decoration: none; background: var(--surface); padding: 34px 16px 26px; border: 1px solid var(--line); outline: 1px solid var(--gold-soft); outline-offset: -8px; box-shadow: var(--shadow); transition: transform .4s cubic-bezier(.2, .7, .2, 1), box-shadow .4s; }
.person-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.person-card h3 { margin: 18px 0 3px; font-size: 1.45rem; }
.person-card .muted { font-style: italic; }
.portrait { width: 118px; height: 146px; border-radius: 50%; object-fit: cover; margin: 0 auto; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--gold); }
.portrait.initials { display: grid; place-items: center; background: var(--t-photo); color: var(--ink-2); font: italic 400 2.6rem var(--serif); }
.portrait.large { width: 200px; height: 250px; font-size: 4rem; }
.profile { display: grid; grid-template-columns: auto 1fr; gap: 52px; align-items: center; max-width: 1080px; margin: 30px auto 0; }
.profile h1 { font-size: clamp(2.6rem, 5vw, 3.8rem); margin: 6px 0 6px; }
.bio { white-space: pre-wrap; font: 400 1.2rem/1.7 var(--serif); max-width: 58ch; margin: 16px 0 20px; }

/* ---------- welcome gate ---------- */
.gate { display: grid; place-items: center; padding: 24px; background: var(--bg); }
.gate-card { max-width: 480px; text-align: center; background: var(--surface); padding: 56px 44px 46px; border: 1px solid var(--line); outline: 1px solid var(--gold-soft); outline-offset: -12px; box-shadow: var(--shadow-lg); }
.gate-card .crest { width: 60px; height: 60px; margin: 0 auto 24px; border-radius: 50%; display: grid; place-items: center; color: var(--gold); border: 1px solid var(--gold); box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--gold-soft); }
.gate-card .crest svg { width: 24px; height: 24px; stroke-width: 1.4; }
.gate-card h1 { font-size: 2.5rem; }
.gate-card h1::after { margin-top: 18px; }
.gate-card p { color: var(--ink-2); }
.gate-card .small-caps { margin-top: 26px; }
.gate-card form { text-align: left; margin-top: 22px; }
.gate-card code { font-size: .85em; }
.gate-card .zh-title { font: 400 1.4rem var(--serif); color: var(--ink-2); margin: -4px 0 0; letter-spacing: .2em; }
.gate-card .zh { font-size: .95em; color: var(--ink-3); }
.gate-card .zh.small { margin-top: 4px; font-size: .85rem; letter-spacing: .1em; }

.empty { text-align: center; padding: 64px 20px; color: var(--ink-2); font: italic 400 1.2rem var(--serif); }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); font: italic 1.02rem var(--serif); padding: 11px 22px; z-index: 90; box-shadow: var(--shadow-lg); animation: rise .3s; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } }


/* ---------- themes ---------- */
.theme-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.theme-chip { font: italic 400 1rem var(--serif); color: var(--green-ink); text-decoration: none; padding: 3px 14px; border: 1px solid var(--gold-soft); border-radius: 99px; background: var(--surface); transition: border-color .2s; }
.theme-chip:hover { border-color: var(--gold); }
.theme-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.theme-grid .collection { aspect-ratio: 4 / 3; }
.theme-card .c-text::before { display: none; }
.theme-card:not(.has-cover) .c-text { margin: auto 0; }
.theme-year { display: grid; grid-template-columns: 140px 1fr; gap: 32px; margin-bottom: 48px; }
.theme-year h2 { font-size: 3rem; font-style: italic; color: var(--gold); text-align: right; border-right: 1px solid var(--gold-soft); padding-right: 24px; align-self: start; position: sticky; top: 24px; }
.hint { text-align: center; font-style: italic; margin-top: 30px; }
.label-like { display: grid; gap: 7px; align-content: start; }
.label-like > span { font: 500 .74rem var(--serif); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.tag-input { display: grid; gap: 8px; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chips:empty { display: none; }
.tag { display: inline-flex; align-items: center; gap: 4px; font: italic 1rem var(--serif); padding: 2px 6px 2px 12px; background: var(--green-soft); color: var(--green-ink); border: 1px solid color-mix(in srgb, var(--green) 30%, transparent); border-radius: 99px; }
.tag button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 4px; opacity: .7; }
.tag button:hover { opacity: 1; }
.tag-suggest { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.tag-option { border: 0; background: none; padding: 0; cursor: pointer; font: italic .95rem var(--serif); color: var(--ink-3); }
.tag-option:hover { color: var(--green-ink); }

/* ---------- coming up: yearly occasions ---------- */
.events { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.event { display: grid; grid-template-columns: 74px 1fr; gap: 18px; align-items: start; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); padding: 18px; box-shadow: var(--shadow); transition: transform .3s, box-shadow .3s; }
.event:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.event-date { display: grid; justify-items: center; padding: 8px 0 10px; border: 1px solid var(--gold-soft); outline: 1px solid var(--gold-soft); outline-offset: -5px; background: var(--bg); }
.event-month { font: 500 .7rem var(--serif); letter-spacing: .2em; text-transform: uppercase; color: var(--accent-ink); }
.event-day { font: 400 2.3rem/1 var(--serif); font-variant-numeric: lining-nums; }
.event.soon .event-date { background: var(--accent-soft); }
.event-body h3 { font-size: 1.4rem; margin: 2px 0 0; }
.event-body .eyebrow { color: var(--green-ink); }
.event-body .muted { font-style: italic; }
.event-photos { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.event-photos img { width: 54px; height: 54px; object-fit: cover; border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--line); }
.event-photos span { font: italic .95rem var(--serif); color: var(--ink-3); margin-left: 4px; }
.events-list { display: grid; gap: 14px; max-width: 820px; margin: 0 auto; }
.event-row { display: grid; grid-template-columns: 1fr 64px; gap: 12px; align-items: center; }

/* ---------- journey: two paths that meet ---------- */
.journey { position: relative; max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; column-gap: 72px; row-gap: 26px; padding-bottom: 10px; }
.journey::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px solid var(--gold); transform: translateX(-.5px); }
.journey.one { grid-template-columns: 1fr; max-width: 720px; }
.journey.one::before { left: 0; }
.lanes { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; column-gap: 72px; text-align: center; position: relative; z-index: 1; }
.lanes div { font: italic 400 1.6rem var(--serif); background: var(--bg); justify-self: center; padding: 0 18px; border-bottom: 1px solid var(--gold-soft); }
.chapter { position: relative; z-index: 1; display: block; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); padding: 22px 24px 20px; box-shadow: var(--shadow); transition: transform .3s, box-shadow .3s; }
.chapter:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.chapter::after { content: ""; position: absolute; top: 30px; width: 9px; height: 9px; background: var(--bg); border: 1px solid var(--gold); transform: rotate(45deg); }
.chapter.left { grid-column: 1; }
.chapter.left::after { right: -41px; }
.chapter.right { grid-column: 2; }
.chapter.right::after { left: -41px; }
.chapter.both { grid-column: 1 / -1; justify-self: center; width: min(640px, 100%); text-align: center; outline: 1px solid var(--gold-soft); outline-offset: -7px; }
.chapter.both::after { display: none; }
.journey.one .chapter { grid-column: 1; margin-left: 36px; text-align: left; justify-self: stretch; width: auto; }
.journey.one .chapter::after { display: block; left: -41px; right: auto; }
.journey.two .chapter-who { display: none; }
.chapter .eyebrow { color: var(--gold); font-variant-numeric: lining-nums; }
.chapter h3 { font-size: 1.55rem; margin: 6px 0 2px; }
.chapter-place { font: italic 1.05rem var(--serif); color: var(--ink-2); }
.chapter p { margin: 10px 0 0; color: var(--ink-2); font-size: 1.02rem; }
.meet, .journey-end { grid-column: 1 / -1; text-align: center; position: relative; z-index: 1; margin: 10px 0; }
.meet span, .journey-end span { display: inline-block; background: var(--bg); padding: 6px 22px; font: italic 400 1.5rem var(--serif); color: var(--accent-ink); }
.meet span::before { content: ""; display: block; width: 12px; height: 12px; margin: 0 auto 8px; background: var(--accent); transform: rotate(45deg); }
.journey-end span { font-size: 1.15rem; color: var(--ink-3); }
.journey-banner { display: block; margin-top: 72px; text-align: center; text-decoration: none; color: var(--ink); background: var(--t-letter); border: 1px solid var(--line); outline: 1px solid var(--gold-soft); outline-offset: -10px; padding: clamp(36px, 6vw, 64px) 24px; box-shadow: var(--shadow); }
.journey-banner h2 { font-size: clamp(2rem, 4vw, 2.8rem); font-style: italic; margin: 8px 0; }
.journey-banner p { font-style: italic; color: var(--ink-2); margin: 0 0 20px; font-size: 1.15rem; }


/* ---------- deep green bands between the paper sections ---------- */
.band {
  --bg: #1c2a22; --surface: #23342a; --surface-2: #2c4034; --ink: #f0e9d8; --ink-2: #c8bfa9; --ink-3: #9a917c;
  --line: rgba(240, 233, 216, .14); --gold: #cdb06f; --gold-soft: rgba(205, 176, 111, .42); --green-ink: #b9d6bf;
  --accent: #e2a08f; --accent-ink: #e9ad9d; --accent-soft: #43302a; --t-letter: #1c2a22;
  background: var(--bg); color: var(--ink);
}
main > .band { margin: 72px calc(-1 * var(--gutter)) 0; padding: 8px var(--gutter) 64px; }
main > .band > .section:first-child { margin-top: 48px; }
main > .band .event { box-shadow: none; }
.journey-banner.band { outline-color: var(--gold-soft); border-color: transparent; }
.journey-banner.band .btn.ghost { color: var(--ink); }
[data-theme="dark"] .band { --bg: #22362b; --surface: #2a4033; }

/* ---------- polaroids ---------- */
.polaroid { display: block; width: 100%; text-decoration: none; color: var(--hand-ink); background: #fffdf8; padding: 12px 12px 10px; box-shadow: 0 1px 2px rgba(40, 30, 20, .12), 0 14px 28px -14px rgba(40, 30, 20, .45);
  transform: rotate(var(--tilt, 0deg)); transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s; position: relative; }
.polaroid:hover { transform: rotate(0deg) translateY(-6px) scale(1.02); box-shadow: 0 2px 4px rgba(40, 30, 20, .12), 0 24px 40px -16px rgba(40, 30, 20, .55); z-index: 2; }
.p-pic { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: #e9e4da; }
.p-pic img, .p-pic video { width: 100%; height: 100%; object-fit: cover; }
.p-pic .play span { width: 46px; height: 46px; }
.p-paper { height: 100%; display: grid; place-items: center; padding: 16px; text-align: left; color: #5f554a; background: repeating-linear-gradient(180deg, #faf5ea 0 27px, #e6ddc9 27px 28px); }
.p-paper p { margin: 0; font: italic 400 1rem/1.75 var(--serif); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.p-paper .icon { width: 36px; height: 36px; color: #b0915a; }
.p-paper.film { background: #e2e5df; }
.p-paper.certificate { background: #efe3c6; }
.p-paper.sealed { background: #f1e1d6; }
.p-caption { font: 500 1.55rem/1.15 var(--hand); padding: 12px 4px 0; min-height: 2.5em; overflow-wrap: anywhere; }
.p-date { font: italic .85rem var(--serif); color: #8c8070; padding: 2px 4px 0; }
.polaroid.small { padding: 10px 10px 8px; }
.polaroid.small .p-caption { font-size: 1.35rem; min-height: 2.4em; padding-top: 10px; }
.empty-print { display: grid; place-items: center; aspect-ratio: .82; background: transparent; box-shadow: none; border: 2px dashed var(--gold-soft); transform: rotate(1deg); }
.empty-print span { font: 500 1.5rem/1.2 var(--hand); color: var(--hand-ink); text-align: center; padding: 0 18px; }
[data-theme="dark"] .empty-print span { color: #c9d3ef; }
.empty-print:hover { border-color: var(--gold); box-shadow: none; }

/* the year line */
.rail { display: flex; overflow-x: auto; padding: 8px 4px 34px; margin: 0 0 30px; scroll-snap-type: x proximity; scrollbar-width: thin; position: relative; }
.rail-stop { flex: 0 0 236px; display: grid; justify-items: start; align-content: start; position: relative; padding-right: 36px; scroll-snap-align: start; }
.rail-stop::before { content: ""; position: absolute; left: 0; right: 0; top: 66px; border-top: 1px solid var(--gold-soft); }
.rail-year { font: 400 2.5rem/1 var(--serif); color: var(--accent); text-decoration: none; font-variant-numeric: lining-nums; height: 56px; display: flex; align-items: flex-end; padding-left: 4px; }
.rail-year.today { font-style: italic; }
.rail-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); margin: 5px 0 22px 8px; position: relative; z-index: 1; box-shadow: 0 0 0 4px var(--bg); }
.rail-stop .polaroid { width: 200px; }

/* every memory of a year, as prints */
.year-prints { margin-top: 30px; scroll-margin-top: 20px; }
.year-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 26px; }
.year-head::after { content: ""; flex: 1; border-top: 1px solid var(--gold-soft); }
.year-head h2 { font-size: 3rem; color: var(--accent); margin: 0; font-variant-numeric: lining-nums; }
.year-head span { font: italic 1.05rem var(--serif); color: var(--ink-3); order: 2; }
.prints { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 40px 34px; margin-bottom: 40px; }

/* ---------- home: recently added, shelf by shelf ---------- */
.shelf-row { margin-bottom: 40px; }
.shelf-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.shelf-row-head h3 { font-size: 1.45rem; font-style: italic; margin: 0; }
.shelf-row-head a { font: 500 .72rem var(--serif); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.shelf-row-head a:hover { color: var(--green-ink); }
.shelf-row-items { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; align-items: start; }
.shelf-row-items .tile { margin: 0; }


/* ---------- language button ---------- */
.lang-toggle { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: transparent; border: 1px solid var(--gold-soft); color: var(--ink-2); font: 500 .95rem var(--serif); padding: 0; flex: none; transition: border-color .2s, color .2s; }
.lang-toggle:hover { border-color: var(--gold); color: var(--ink); }
:lang(zh) body { letter-spacing: .01em; }
:lang(zh) .nav a, :lang(zh) .btn, :lang(zh) .eyebrow, :lang(zh) label { letter-spacing: .08em; }

/* ---------- seasons and special days ---------- */
.hero h1.special { font-size: clamp(2.4rem, 6vw, 4.8rem); }
:lang(zh) .hero h1, :lang(zh) .q-big { word-break: keep-all; }
.hero .season { font: italic 400 1.15rem var(--serif); opacity: .9; margin-bottom: 6px; }
.particles { position: absolute; inset: 12px; overflow: hidden; pointer-events: none; z-index: 0; }
.particles i { position: absolute; top: -8%; display: block; animation: fall linear infinite; opacity: .85; }
.particles.snow i { width: calc(7px * var(--s)); height: calc(7px * var(--s)); border-radius: 50%; background: #fff; filter: blur(.4px); }
.particles.petals i { width: calc(12px * var(--s)); height: calc(9px * var(--s)); border-radius: 80% 0 80% 0; background: #f4c6cf; }
.particles.leaves i { width: calc(13px * var(--s)); height: calc(9px * var(--s)); border-radius: 80% 0 80% 0; background: hsl(calc(20 + var(--h) / 12), 70%, 48%); opacity: .75; }
.particles.confetti i { width: calc(8px * var(--s)); height: calc(13px * var(--s)); background: hsl(var(--h), 75%, 62%); }
.particles.lanterns i { width: 26px; height: 32px; border-radius: 45%; background: radial-gradient(circle at 50% 40%, #ffcf7a, #d6402b 60%, #8e1f15); box-shadow: 0 0 22px rgba(255, 140, 60, .55); animation-name: rise-lantern; top: auto; bottom: -15%; opacity: .9; }
@keyframes fall { from { transform: translate(0, 0) rotate(0deg); } to { transform: translate(40px, 115vh) rotate(540deg); } }
@keyframes rise-lantern { from { transform: translate(0, 0); } to { transform: translate(-30px, -120vh); } }
.hero .hero-text { position: relative; z-index: 1; }

/* ---------- a question for the grandparents ---------- */
.question-banner { display: block; margin-top: 72px; text-align: center; text-decoration: none; color: var(--ink); padding: 44px 24px 40px; border-top: 1px solid var(--gold-soft); border-bottom: 1px solid var(--gold-soft); }
.q-big { font: italic 400 clamp(1.6rem, 3.4vw, 2.5rem)/1.3 var(--serif); max-width: 30em; margin: 14px auto 22px; }
.questions { display: grid; gap: 18px; max-width: 900px; margin: 0 auto; }
.question { display: grid; grid-template-columns: 64px 1fr; gap: 20px; background: var(--surface); border: 1px solid var(--line); padding: 24px 26px; box-shadow: var(--shadow); scroll-margin-top: 30px; }
.question.answered { border-left: 3px solid var(--gold); }
.q-num { font: italic 400 2rem/1 var(--serif); color: var(--gold); padding-top: 4px; }
.q-body h3 { font-size: 1.45rem; margin: 0 0 10px; }
.q-body > .muted { font-style: italic; margin-bottom: 12px; }
.q-body > .btn { margin-top: 6px; }
.q-answer { margin: 10px 0 14px; display: grid; gap: 8px; }
.q-answer audio, .answer-box audio { width: 100%; max-width: 520px; }
.q-answer p { margin: 0; font-style: italic; color: var(--ink-2); }
.q-answer .linklike { margin: 0; justify-self: start; }
.answer-box { display: grid; gap: 14px; margin: 8px 0 4px; padding: 18px; background: var(--bg); border: 1px dashed var(--gold-soft); }
.answer-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.question.own input { margin-bottom: 12px; }

/* ---------- the yearly book ---------- */
main > .book-cover.band { margin: -36px calc(-1 * var(--gutter)) 0; padding: 64px var(--gutter) 56px; text-align: center; }
.book-cover h2 { font: italic 400 clamp(2rem, 4vw, 3rem) var(--serif); margin: 10px 0 0; }
.book-year { font: 400 clamp(5rem, 14vw, 10rem)/1 var(--serif); color: var(--gold); font-variant-numeric: lining-nums; margin: 6px 0 4px; }
.book-line { font-style: italic; color: var(--ink-2); font-size: 1.2rem; margin: 0 0 30px; }
.book-photos { display: flex; justify-content: center; gap: 26px; margin: 0 auto 30px; flex-wrap: wrap; }
.book-photos .polaroid { width: 190px; }
.book-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 26px 0 10px; }
.book-month, .book-section { margin-top: 48px; }
.book-month h3, .book-section h3 { font: italic 400 2rem var(--serif); color: var(--accent); display: flex; align-items: center; gap: 18px; margin-bottom: 26px; }
.book-month h3::after, .book-section h3::after { content: ""; flex: 1; border-top: 1px solid var(--gold-soft); }
.year-book { order: 3; display: inline-flex; align-items: center; gap: 6px; font: 500 .72rem var(--serif); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.year-book:hover { color: var(--green-ink); }

/* yearly books on the home page, as spines on a shelf */
.shelf-books { display: flex; gap: 10px; align-items: flex-end; overflow-x: auto; padding: 0 4px 14px; border-bottom: 6px solid color-mix(in srgb, var(--gold) 55%, var(--ink)); }
.spine { flex: none; width: 74px; height: 230px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 18px 0 16px; text-decoration: none; color: #e9d9a8;
  border-radius: 3px 3px 0 0; box-shadow: inset 4px 0 0 rgba(255, 255, 255, .08), inset -4px 0 0 rgba(0, 0, 0, .18), 0 6px 14px -8px rgba(0, 0, 0, .5); transition: transform .3s; }
.spine:hover { transform: translateY(-10px); }
.spine.s0 { background: #2c4a3a; } .spine.s1 { background: #7b2d26; height: 216px; } .spine.s2 { background: #243b5c; height: 240px; } .spine.s3 { background: #5c4a2c; height: 222px; }
.spine-title { writing-mode: vertical-rl; font: italic 400 1.05rem var(--serif); letter-spacing: .06em; border-top: 1px solid rgba(233, 217, 168, .5); border-bottom: 1px solid rgba(233, 217, 168, .5); padding: 10px 0; }
.spine-year { font: 500 1.05rem var(--serif); font-variant-numeric: lining-nums; }

@media print {
  .top, .nav, .storage-banner, .no-print, .particles { display: none !important; }
  main { padding: 0; max-width: none; }
  .band { background: #fff !important; color: #2b2520 !important; }
  .polaroid, .tile, .paper { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
  .book-month { break-before: auto; }
}


/* ---------- letters: writer, recipient and signature ---------- */
.letter-pair { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; margin: 4px 0 10px; font-size: 1.12rem; }
.letter-pair em { font-style: normal; font: 500 .72rem var(--serif); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); margin-right: 6px; }
.letter-pair strong { font-weight: 500; font-style: italic; color: var(--accent-ink); }
.letter-sheet { max-width: 780px; margin: 0 auto; }
.letter-to { font: italic 400 1.35rem var(--serif); color: var(--ink-2); margin: 0 0 14px 6px; }
.letter-sign { text-align: right; font: italic 400 1.25rem var(--serif); color: var(--ink-2); margin: 16px 8px 0 0; }

/* ---------- previous / next ---------- */
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 900px; margin: 48px auto 0; }
.step { display: grid; gap: 4px; text-decoration: none; color: var(--ink); padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: border-color .2s, transform .2s; }
.step:hover { border-color: var(--gold); transform: translateY(-2px); }
.step.next { text-align: right; }
.step .eyebrow::before { content: "‹  "; }
.step.next .eyebrow::before { content: ""; }
.step.next .eyebrow::after { content: "  ›"; }
.step-title { font-size: 1.25rem; line-height: 1.25; }
.step-date { font: italic .92rem var(--serif); color: var(--ink-3); }

/* ---------- responsive ---------- */
@media (max-width: 1320px) { .nav a.nav-extra { display: none; } }
@media (max-width: 1080px) {
  .shelf-row-items { grid-template-columns: repeat(2, 1fr); }
  .nav a { padding: 4px 12px; letter-spacing: .14em; }
  .collections { grid-template-columns: repeat(2, 1fr); }
  .collection { aspect-ratio: 16 / 10; }
}
@media (max-width: 760px) {
  body { font-size: 17.5px; }
  .top-inner { grid-template-columns: auto 1fr auto; padding: 14px 16px; border-bottom: 3px double var(--gold-soft); }
  .brand { grid-column: 1 / 3; flex-direction: row; gap: 10px; }
  .brand .mark { width: 36px; height: 36px; font-size: 1.2rem; }
  .brand #family-name { font-size: 1.45rem; }
  main { padding: 22px 14px 120px; }
  /* phone: navigation becomes a bottom tab bar */
  .nav { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 40; justify-content: space-around; flex-wrap: nowrap; gap: 0; margin: 0;
    padding: 6px; background: var(--surface); border: 1px solid var(--gold-soft); box-shadow: var(--shadow-lg); }
  .nav a { flex-direction: column; gap: 3px; padding: 6px 2px; font-size: .6rem; letter-spacing: .1em; flex: 1; }
  .nav a + a::before { display: none; }
  .nav a .icon { display: block; width: 21px; height: 21px; }
  .nav a.active { color: var(--green-ink); background: var(--green-soft); }
  .nav a.active span:last-child { box-shadow: none; }
  .nav a.wide-only { display: none; }
  .nav a.nav-add { display: flex; }
  .top-actions .btn { display: none; }
  .hero { min-height: 64vh; }
  .hero .slide, .hero::before { inset: 7px; }
  .hero::before { outline-offset: -9px; }
  .hero .dots { right: 50%; transform: translateX(50%); bottom: 16px; }
  .hero-text { padding-bottom: 42px; }
  .section { margin-top: 52px; }
  .section-head { gap: 14px; }
  .collections { gap: 12px; }
  .collection { aspect-ratio: 1 / 1; padding: 6px; }
  .collection img, .collection.has-cover::after, .collection:not(.has-cover)::before { inset: 6px; }
  .collection img { width: calc(100% - 12px); height: calc(100% - 12px); }
  .collection h3 { font-size: 1.25rem; }
  .collection .c-text { padding: 14px 8px; }
  .collection .c-desc { display: none; }
  .collection .c-art { top: 16%; width: 30%; }
  .grid { columns: 2 150px; column-gap: 14px; }
  .tile { margin-bottom: 24px; }
  .tile .media { padding: 5px; }
  .tile .badge { top: 11px; left: 11px; font-size: .58rem; letter-spacing: .12em; }
  .tile .count-badge { left: auto; right: 11px; }
  .tile h3 { font-size: 1.1rem; }
  .tile .excerpt { display: none; }
  .panel-tile { padding: 22px 14px 18px; }
  .panel-tile h3 { font-size: 1.2rem; }
  .panel-tile .quote { font-size: 1rem; -webkit-line-clamp: 4; }
  .page-head { margin-bottom: 30px; }
  .year { grid-template-columns: 1fr; gap: 6px; margin-bottom: 36px; }
  .year h2 { position: static; font-size: 2.6rem; text-align: left; border: 0; padding: 0; border-bottom: 1px solid var(--gold-soft); }
  .entry { grid-template-columns: 64px 1fr; gap: 14px; padding: 8px 2px; }
  .entry .thumb { width: 64px; height: 64px; }
  .entry .when { display: none; }
  .memory .gallery.multi { columns: 1; }
  .theme-year { grid-template-columns: 1fr; gap: 8px; }
  .theme-year h2 { position: static; text-align: left; border: 0; padding: 0; font-size: 2.4rem; border-bottom: 1px solid var(--gold-soft); }
  .theme-grid { grid-template-columns: 1fr 1fr; }
  .theme-grid .collection { aspect-ratio: 1 / 1; }
  .events { grid-template-columns: 1fr; gap: 12px; }
  .event { grid-template-columns: 62px 1fr; gap: 14px; padding: 14px; }
  .event-day { font-size: 1.9rem; }
  .journey, .journey.two { grid-template-columns: 1fr; row-gap: 18px; }
  .journey::before, .journey.two::before { left: 10px; }
  .lanes { display: none; }
  .journey.two .chapter-who { display: block; }
  .chapter.left, .chapter.right, .chapter.both, .journey.one .chapter { grid-column: 1; margin-left: 32px; width: auto; justify-self: stretch; text-align: left; }
  .chapter::after, .chapter.left::after, .chapter.right::after, .chapter.both::after, .journey.one .chapter::after { display: block; left: -27px; right: auto; }
  .chapter.left { border-left: 3px solid var(--gold); }
  .chapter.right { border-left: 3px solid var(--sage); }
  .meet, .journey-end { text-align: left; margin-left: 0; }
  .journey-banner { margin-top: 52px; }
  .steps { gap: 10px; }
  .step { padding: 14px; }
  .step-title { font-size: 1.05rem; }
  .question { grid-template-columns: 1fr; gap: 6px; padding: 18px; }
  .q-num { font-size: 1.4rem; }
  .question-banner { margin-top: 52px; padding: 34px 8px; }
  .book-photos .polaroid { width: 130px; }
  .book-photos { gap: 12px; }
  main > .book-cover.band { margin-top: -22px; padding: 44px 14px 40px; margin-left: -14px; margin-right: -14px; }
  .year-head { flex-wrap: wrap; }
  .spine { width: 58px; height: 190px; }
  .lang-toggle, .theme-toggle { width: 34px; height: 34px; }
  main > .band { margin-top: 52px; padding: 4px 14px 44px; margin-left: -14px; margin-right: -14px; }
  .rail-stop { flex-basis: 168px; padding-right: 22px; }
  .rail-stop .polaroid { width: 146px; }
  .rail-year { font-size: 1.9rem; height: 46px; }
  .rail-stop::before { top: 56px; }
  .polaroid.small .p-caption { font-size: 1.15rem; }
  .prints { grid-template-columns: 1fr 1fr; gap: 26px 16px; }
  .polaroid { padding: 8px 8px 6px; }
  .p-caption { font-size: 1.25rem; padding-top: 8px; }
  .year-head h2 { font-size: 2.3rem; }
  .shelf-row-items { grid-template-columns: 1fr 1fr; gap: 14px; }
  .people { grid-template-columns: 1fr 1fr; gap: 12px; }
  .person-card { padding: 22px 8px 16px; }
  .person-card h3 { font-size: 1.2rem; margin-top: 12px; }
  .person-card .muted { font-size: .9rem; }
  .portrait { width: 84px; height: 104px; }
  .portrait.initials { font-size: 2rem; }
  .car-stage { padding: 6px; margin: 0 -6px; }
  .car-slide { height: min(60vh, 100vw); }
  .car-btn { width: 42px; height: 42px; }
  .car-btn.prev { left: 12px; }
  .car-btn.next { right: 12px; }
  .car-thumbs button { width: 58px; height: 44px; }
  .lb-stage { inset: 56px 8px 64px; }
  .lb-btn.prev, .lb-btn.next { top: auto; bottom: 10px; transform: none; width: 46px; height: 46px; }
  .lb-count { bottom: 22px; }
  .kinds { grid-template-columns: 1fr 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .profile { grid-template-columns: 1fr; text-align: center; gap: 18px; }
  .search { width: 100%; }
  .head-tools { width: 100%; }
  .member { grid-template-columns: auto 1fr; }
  .member > .btn { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  body { background: #fff; }
  body.printing > *:not(.modal) { display: none !important; }
  body.printing .modal { position: static; background: none; padding: 0; }
  body.printing .modal .panel { box-shadow: none; max-height: none; background: #fff; border: 0; }
  body.printing .no-print { display: none !important; }
}
