/* ---------- tokens ---------- */
:root {
  --bg: #0b0a09;
  --bg-2: #15130f;
  --ink: #f4efe6;
  --ink-2: #b9b0a2;
  --ink-3: #7d7569;
  --gold: #d9b779;
  --gold-2: #f0d9a8;
  --line: rgba(244, 239, 230, 0.12);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
img { display: block; max-width: 100%; }

/* ---------- chrome ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  background: linear-gradient(to bottom, rgba(11,10,9,.85), rgba(11,10,9,0));
  backdrop-filter: blur(6px);
}
.brand { font-family: var(--serif); font-size: 1.35rem; letter-spacing: .04em; text-decoration: none; }
.pill {
  font-size: .82rem; font-weight: 500; text-decoration: none; letter-spacing: .02em;
  padding: 9px 16px; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  transition: transform .3s var(--ease), background .3s;
}
.pill:hover { transform: translateY(-1px); background: var(--gold-2); }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; }
.progress span { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--page, 0)); background: var(--gold); }

.years {
  position: fixed; right: clamp(10px, 2vw, 28px); top: 50%; transform: translateY(-50%);
  z-index: 40; display: flex; flex-direction: column; gap: 14px;
  opacity: 0; transition: opacity .5s;
}
.years.show { opacity: 1; }
.years a {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  font-size: .72rem; letter-spacing: .08em; color: var(--ink-3); text-decoration: none;
  transition: color .3s;
}
.years a::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; transition: transform .3s; }
.years a span { opacity: 0; transform: translateX(6px); transition: all .3s var(--ease); }
.years a:hover span, .years a.active span { opacity: 1; transform: none; }
.years a.active { color: var(--gold); }
.years a.active::after { transform: scale(1.6); }
@media (max-width: 700px) { .years { display: none; } }

/* ---------- scroll scenes ---------- */
.scene { position: relative; --p: 0; }
.sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }

/* hero */
.hero { height: 190vh; }
.hero .sticky { display: grid; place-items: center; text-align: center; }
.hero-photo {
  position: absolute; inset: 0;
  background-size: cover; background-position: center 30%;
  transform: scale(calc(1.15 - var(--p) * .15));
  opacity: calc(.55 - var(--p) * .35);
  filter: grayscale(.25);
}
.hero-photo.empty { background: radial-gradient(ellipse at 50% 40%, #2a2219 0%, var(--bg) 70%); opacity: 1; }
.hero-photo::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 30%, var(--bg) 85%); }
.hero-inner {
  position: relative; padding: 0 16px;
  transform: translateY(calc(var(--p) * -12vh)) scale(calc(1 - var(--p) * .12));
  opacity: calc(1 - var(--p) * 1.8);
}
.eyebrow { font-size: .78rem; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); margin: 0 0 22px; }
.hero h1 {
  font-family: var(--serif); font-weight: 400; margin: 0;
  font-size: clamp(3.2rem, 11vw, 9.5rem); line-height: .92; letter-spacing: -.01em;
}
.hero h1 em { font-style: italic; color: var(--gold-2); }
.dates { margin-top: 26px; font-size: clamp(.9rem, 1.6vw, 1.1rem); color: var(--ink-2); letter-spacing: .12em; }
.dates i { display: inline-block; width: 40px; height: 1px; background: var(--ink-3); vertical-align: middle; margin: 0 14px; }
.scroll-cue {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-3);
  opacity: calc(1 - var(--p) * 6);
}
.scroll-cue::after {
  content: ""; display: block; width: 1px; height: 46px; margin: 12px auto 0;
  background: linear-gradient(var(--ink-3), transparent);
  animation: cue 2.2s infinite var(--ease);
}
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* word-by-word lighting text */
.words { height: 260vh; }
.words .sticky { display: grid; place-items: center; padding: 0 clamp(16px, 8vw, 120px); }
.words p {
  font-family: var(--serif); font-size: clamp(1.9rem, 4.6vw, 4rem); line-height: 1.18;
  max-width: 1100px; margin: 0; text-align: center;
}
.words p span { color: rgba(244,239,230,.14); transition: color .35s; }
.words p span.lit { color: var(--ink); }
.words.quote p span.lit { color: var(--gold-2); }
.words cite { display: block; margin-top: 28px; text-align: center; font-family: var(--sans); font-style: normal; font-size: .85rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); }

/* chapters */
.chapter { height: 320vh; }
.chapter .sticky { display: grid; align-items: center; }
.big-year {
  position: absolute; top: 50%; left: 0; white-space: nowrap; pointer-events: none;
  font-family: var(--serif); font-weight: 500; line-height: 1;
  font-size: clamp(10rem, 34vw, 32rem);
  color: transparent; -webkit-text-stroke: 1px rgba(217,183,121,.22);
  transform: translate(calc(60vw - var(--p) * 120vw), -50%);
}
.chapter-inner {
  position: relative; width: 100%; max-width: 1280px; margin: 0 auto;
  padding: 0 clamp(16px, 5vw, 64px);
  display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(24px, 5vw, 80px); align-items: center;
}
.chapter.flip .chapter-inner { grid-template-columns: 1.15fr 1fr; }
.chapter.flip .chapter-text { order: 2; }

.chapter-text {
  --in: clamp(0, (var(--p) - .06) * 7, 1);
  --out: clamp(0, (1 - var(--p) - .04) * 7, 1);
  opacity: min(var(--in), var(--out));
  transform: translateY(calc((1 - var(--in)) * 60px - (1 - var(--out)) * 60px));
}
.chapter-num { font-size: .75rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin-bottom: 18px; }
.chapter h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 6vw, 5.4rem); line-height: .98; margin: 0 0 24px; }
.chapter-year { font-family: var(--serif); font-style: italic; font-size: 1.4rem; color: var(--ink-2); margin-bottom: 8px; }
.chapter p.body { font-size: clamp(1rem, 1.35vw, 1.18rem); line-height: 1.75; color: var(--ink-2); max-width: 36ch; margin: 0; }

.photos { position: relative; height: min(72vh, 680px); }
.ph {
  position: absolute; overflow: hidden; border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  --in: clamp(0, (var(--p) - var(--d, .1)) * 5, 1);
  --out: clamp(0, (1 - var(--p) - .03) * 6, 1);
  opacity: min(var(--in), var(--out));
  transform:
    translateY(calc((.5 - var(--p)) * var(--s, 1) * 40vh))
    scale(calc(.86 + var(--in) * .14))
    rotate(var(--r, 0deg));
}
.ph img { width: 100%; height: 100%; object-fit: cover; transform: scale(calc(1.18 - var(--p) * .18)); }
.ph:nth-child(1) { width: 66%; height: 74%; left: 0; top: 6%; --s: .5; --d: .08; --r: -1.5deg; z-index: 2; }
.ph:nth-child(2) { width: 46%; height: 50%; right: 0; top: 0; --s: 1.2; --d: .16; --r: 2deg; z-index: 1; }
.ph:nth-child(3) { width: 44%; height: 44%; right: 6%; bottom: 0; --s: 1.8; --d: .24; --r: -1deg; z-index: 3; }
.ph:only-child { width: 88%; height: 88%; left: 6%; top: 6%; --r: 0deg; }
.ph.placeholder {
  background:
    radial-gradient(circle at 30% 25%, rgba(217,183,121,.18), transparent 60%),
    linear-gradient(135deg, #221d16, #12100c);
  border: 1px solid var(--line);
  display: grid; place-items: center;
}
.ph.placeholder span { font-family: var(--serif); font-style: italic; color: var(--ink-3); font-size: 1.1rem; }

@media (max-width: 820px) {
  .chapter { height: 260vh; }
  .chapter-inner, .chapter.flip .chapter-inner { grid-template-columns: 1fr; gap: 26px; align-content: center; height: 100%; padding-top: 70px; }
  .chapter.flip .chapter-text { order: 0; }
  .photos { height: 44vh; }
  .chapter h2 { margin-bottom: 14px; }
}

/* photo river (horizontal scroll driven by vertical scroll) */
.river { height: 420vh; }
.river .sticky { display: flex; flex-direction: column; justify-content: center; }
.river h3 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 5vw, 4rem);
  margin: 0 0 4vh; padding: 0 clamp(16px, 5vw, 64px);
  opacity: clamp(0, var(--p) * 8, 1);
}
.river-track {
  display: flex; gap: 2vw; padding: 0 clamp(16px, 5vw, 64px); width: max-content;
  transform: translateX(calc(var(--p) * var(--dist, 0px) * -1));
  will-change: transform;
}
.river-track { align-items: center; }
.river-track figure {
  margin: 0; height: 58vh; border-radius: 6px; overflow: hidden; flex: none;
  background: #1b1712; box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.river-track figure:nth-child(3n+2) { height: 48vh; margin-top: 8vh; }
.river-track figure:nth-child(3n) { height: 52vh; margin-top: -6vh; }
.river-track img { height: 100%; width: auto; max-width: 80vw; object-fit: cover; }
@media (max-width: 700px) {
  .river-track figure { height: 46vh; }
  .river-track figure:nth-child(3n+2) { height: 38vh; }
  .river-track figure:nth-child(3n) { height: 42vh; }
}

/* closing */
.closing { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 120px 16px 80px; }
.closing .candle { width: 2px; height: 70px; margin: 0 auto 40px; background: linear-gradient(var(--gold), transparent); box-shadow: 0 0 30px 6px rgba(217,183,121,.35); border-radius: 2px; }
.closing h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 7vw, 5.6rem); margin: 0 0 16px; line-height: 1; }
.closing .sub { color: var(--ink-2); font-size: 1.05rem; max-width: 46ch; margin: 0 auto 50px; line-height: 1.7; }
.service-card {
  max-width: 520px; margin: 0 auto 50px; padding: 34px 28px; border: 1px solid var(--line); border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent);
}
.service-card h3 { font-family: var(--serif); font-weight: 500; font-size: 1.8rem; margin: 0 0 18px; color: var(--gold-2); }
.service-card p { margin: 6px 0; color: var(--ink-2); line-height: 1.6; }
.service-card .when { color: var(--ink); font-size: 1.1rem; }
.btn {
  display: inline-block; padding: 16px 30px; border-radius: 999px; text-decoration: none;
  background: var(--gold); color: #1a1408; font-weight: 500; letter-spacing: .02em;
  transition: transform .3s var(--ease), box-shadow .3s; border: 0; cursor: pointer; font: inherit; font-weight: 500;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(217,183,121,.25); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
footer.foot { text-align: center; color: var(--ink-3); font-size: .78rem; padding: 30px 16px 40px; letter-spacing: .08em; }

/* reveal-on-enter */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .hero, .words, .chapter, .river { height: auto !important; }
  .sticky { position: relative; height: auto; min-height: 100vh; padding: 80px 0; }
  .scene { --p: .5 !important; }
  .chapter-text, .ph, .hero-inner, .words p span { opacity: 1 !important; transform: none !important; color: var(--ink) !important; }
  .big-year { display: none; }
  .river-track { width: auto; flex-wrap: wrap; transform: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- form pages (share / admin) ---------- */
.page { max-width: 760px; margin: 0 auto; padding: 120px clamp(16px, 4vw, 32px) 60px; }
.page h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 6vw, 4.2rem); margin: 0 0 14px; line-height: 1; }
.page .lead { color: var(--ink-2); line-height: 1.7; font-size: 1.05rem; margin: 0 0 40px; }
label.field { display: block; margin-bottom: 18px; }
label.field span { display: block; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
input[type=text], input[type=password], textarea {
  width: 100%; padding: 14px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--ink); font: inherit; font-weight: 400; font-size: 1rem;
}
input:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 90px; resize: vertical; }
.drop {
  border: 1.5px dashed rgba(217,183,121,.45); border-radius: 12px; padding: 48px 20px; text-align: center;
  background: rgba(217,183,121,.04); cursor: pointer; transition: background .3s, border-color .3s; margin: 8px 0 22px;
}
.drop.over { background: rgba(217,183,121,.12); border-color: var(--gold); }
.drop strong { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.6rem; margin-bottom: 6px; }
.drop small { color: var(--ink-3); }
.files { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 10px; }
.files li { display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.files .thumb { width: 52px; height: 52px; border-radius: 6px; object-fit: cover; background: #221d16; display: grid; place-items: center; font-size: .65rem; color: var(--ink-3); overflow: hidden; }
.files .thumb img, .files .thumb video { width: 100%; height: 100%; object-fit: cover; }
.files .meta { min-width: 0; }
.files .fname { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.files .fsize { font-size: .75rem; color: var(--ink-3); margin-top: 3px; }
.bar { height: 4px; background: var(--line); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .25s; }
.files .status { font-size: .78rem; color: var(--ink-3); white-space: nowrap; }
.files .status.ok { color: #9fd49a; }
.files .status.err { color: #f08f7f; }
.files button.x { background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: 1.2rem; }
.notice { padding: 16px 18px; border-radius: 10px; border: 1px solid rgba(159,212,154,.35); background: rgba(159,212,154,.07); color: #cfe8cc; margin-top: 22px; line-height: 1.6; display: none; }
.notice.show { display: block; }
.notice.err { border-color: rgba(240,143,127,.35); background: rgba(240,143,127,.07); color: #f6c9c1; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* admin grid */
.admin-wrap { max-width: 1200px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 24px; }
.toolbar .count { color: var(--ink-2); margin-right: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg-2); display: flex; flex-direction: column; }
.card .media { aspect-ratio: 4 / 3; background: #1b1712; display: grid; place-items: center; color: var(--ink-3); font-size: .8rem; }
.card .media img, .card .media video { width: 100%; height: 100%; object-fit: cover; }
.card .info { padding: 12px 14px; font-size: .82rem; color: var(--ink-2); line-height: 1.5; flex: 1; }
.card .info b { color: var(--ink); font-weight: 500; }
.card .info .note { font-style: italic; margin-top: 4px; }
.card .actions { display: flex; border-top: 1px solid var(--line); }
.card .actions a, .card .actions button { flex: 1; text-align: center; padding: 10px; font: inherit; font-size: .8rem; background: none; border: 0; color: var(--ink); text-decoration: none; cursor: pointer; }
.card .actions button { color: #f08f7f; border-left: 1px solid var(--line); }
.small-btn { padding: 10px 16px; font-size: .85rem; }

/* ---------- shared gallery ---------- */
.sec-head { text-align: center; max-width: 720px; margin: 0 auto 50px; }
.sec-head h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 1; margin: 0 0 18px; }
.sec-sub { color: var(--ink-2); line-height: 1.7; margin: 0; }
.gallery-sec, .memories-sec { padding: 120px clamp(16px, 5vw, 64px) 40px; max-width: 1280px; margin: 0 auto; }
.gallery-grid { columns: 4 240px; column-gap: 14px; }
.g-item {
  position: relative; display: block; width: 100%; margin: 0 0 14px; padding: 0; border: 0; cursor: zoom-in;
  border-radius: 6px; overflow: hidden; background: #1b1712; break-inside: avoid;
}
.g-item img { width: 100%; height: auto; transition: transform .8s var(--ease), filter .5s; filter: saturate(.9); }
.g-item:hover img { transform: scale(1.04); filter: none; }
.g-ph { display: block; aspect-ratio: 4 / 3; }
.g-item .play {
  position: absolute; top: 50%; left: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  background: rgba(11,10,9,.55); backdrop-filter: blur(4px); border: 1px solid rgba(244,239,230,.5);
}
.g-item .play::after { content: ""; position: absolute; left: 22px; top: 17px; border-left: 16px solid var(--ink); border-top: 11px solid transparent; border-bottom: 11px solid transparent; }
.g-by {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px; text-align: left;
  font-size: .75rem; color: var(--ink); background: linear-gradient(transparent, rgba(0,0,0,.7));
  opacity: 0; transition: opacity .3s;
}
.g-item:hover .g-by, .g-item:focus-visible .g-by { opacity: 1; }

.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(8,7,6,.96);
  display: grid; grid-template-columns: 60px 1fr 60px; grid-template-rows: 1fr auto; align-items: center;
}
.lightbox[hidden] { display: none; }
.lb-stage { grid-column: 2; grid-row: 1; height: 100%; display: grid; place-items: center; padding: 50px 0 10px; min-height: 0; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: calc(100vh - 150px); border-radius: 4px; }
.lb-cap { grid-column: 1 / -1; text-align: center; padding: 10px 16px 26px; color: var(--ink-2); font-size: .9rem; line-height: 1.6; }
.lb-cap em { display: block; font-family: var(--serif); font-size: 1.2rem; color: var(--ink); }
.lightbox button { background: none; border: 0; color: var(--ink); font-size: 2.6rem; cursor: pointer; opacity: .7; }
.lightbox button:hover { opacity: 1; }
.lb-close { position: absolute; top: 10px; right: 18px; }
.lb-prev { grid-column: 1; grid-row: 1; }
.lb-next { grid-column: 3; grid-row: 1; }
@media (max-width: 600px) { .lightbox { grid-template-columns: 36px 1fr 36px; } }

/* ---------- memory wall ---------- */
.memory-wall { columns: 3 300px; column-gap: 18px; margin-bottom: 60px; }
.memory {
  break-inside: avoid; margin: 0 0 18px; padding: 28px 26px 22px; border-radius: 10px;
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01));
}
.memory blockquote { margin: 0 0 18px; font-family: var(--serif); font-size: 1.28rem; line-height: 1.5; color: var(--ink); }
.memory blockquote::before { content: "“"; display: block; font-size: 3rem; line-height: .6; color: var(--gold); margin-bottom: 6px; }
.memory figcaption { font-size: .82rem; letter-spacing: .04em; color: var(--ink-2); }
.memory figcaption span { display: block; color: var(--ink-3); margin-top: 2px; }
.memory-form { max-width: 720px; margin: 0 auto; padding: 32px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.memory-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 600px) { .memory-form .two { grid-template-columns: 1fr; } .memory-form { padding: 22px 18px; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- in lieu of flowers ---------- */
.flowers p { margin-bottom: 18px !important; }
.flower-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.flower-name { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); }

/* ---------- admin: memories + gallery controls ---------- */
.adm-h { font-family: var(--serif); font-weight: 500; font-size: 2rem; margin: 40px 0 6px; }
.adm-sub { color: var(--ink-2); margin: 0 0 18px; line-height: 1.6; }
.mem-list { display: grid; gap: 12px; margin-bottom: 16px; }
.mem-row { padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.mem-text { font-family: var(--serif); font-size: 1.15rem; line-height: 1.5; margin-bottom: 10px; }
.mem-by { font-size: .8rem; color: var(--ink-3); margin-bottom: 14px; }
.adm-details { margin-bottom: 10px; }
.adm-details summary { cursor: pointer; color: var(--ink-2); padding: 8px 0 14px; }
.card .actions button.gal, .card .actions button.on { color: var(--gold); }
.card .actions button.on { color: #9fd49a; }

/* ---------- admin: life in pictures strip ---------- */
.life-strip { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 14px; margin-bottom: 10px; }
.life-tile { position: relative; flex: none; width: 150px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg-2); }
.life-tile img { width: 100%; height: 150px; object-fit: cover; }
.life-n { position: absolute; top: 6px; left: 6px; min-width: 24px; padding: 2px 7px; border-radius: 99px; background: rgba(11,10,9,.75); font-size: .75rem; text-align: center; }
.life-ctl { display: flex; border-top: 1px solid var(--line); }
.life-ctl button { flex: 1; padding: 9px 0; background: none; border: 0; color: var(--ink); font: inherit; cursor: pointer; }
.life-ctl button + button { border-left: 1px solid var(--line); }
.life-ctl button:disabled { opacity: .25; cursor: default; }
.life-ctl button[data-move="x"] { color: #f08f7f; }
.card .actions { flex-wrap: wrap; }
.card .actions > * { flex: 1 1 50%; border-bottom: 1px solid var(--line); }
.card .actions button { border-left: 0 !important; }
.card .actions > *:nth-child(even) { border-left: 1px solid var(--line) !important; }

/* ---------- hero with a featured photo ---------- */
.hero.has-photo .sticky { place-items: center start; text-align: left; }
.hero.has-photo .hero-photo {
  background-position: 62% 8%;
  transform: scale(calc(1.04 - var(--p) * .04));
  transform-origin: 62% 0;
  opacity: calc(1 - var(--p) * .7);
  filter: none;
}
.hero.has-photo .hero-photo::after {
  background:
    linear-gradient(90deg, rgba(11,10,9,.9) 0%, rgba(11,10,9,.62) 30%, rgba(11,10,9,.12) 55%, rgba(11,10,9,0) 70%),
    linear-gradient(0deg, var(--bg) 0%, rgba(11,10,9,0) 28%);
}
.hero.has-photo .hero-inner { padding: 0 0 0 clamp(20px, 7vw, 110px); max-width: 52vw; transform-origin: left center; }
.hero.has-photo h1 { font-size: clamp(3rem, 8vw, 7.8rem); text-shadow: 0 2px 30px rgba(0,0,0,.45); }
.hero.has-photo .dates { text-shadow: 0 1px 12px rgba(0,0,0,.6); color: var(--ink); }
.hero.has-photo .scroll-cue { color: var(--ink-2); }

@media (max-width: 760px) {
  .hero.has-photo .sticky { place-items: end start; }
  .hero.has-photo .hero-photo { background-position: 64% 22%; }
  .hero.has-photo .hero-photo::after {
    background: linear-gradient(0deg, var(--bg) 0%, rgba(11,10,9,.82) 30%, rgba(11,10,9,.15) 58%, rgba(11,10,9,0) 75%);
  }
  .hero.has-photo .hero-inner { max-width: none; padding: 0 20px 150px; }
}

/* ---------- service details at the top ---------- */
.hero-service {
  display: inline-flex; flex-direction: column; gap: 4px; margin-top: 30px;
  padding: 14px 20px; border-radius: 10px; text-decoration: none;
  background: rgba(11,10,9,.55); border: 1px solid rgba(217,183,121,.4); backdrop-filter: blur(6px);
  transition: border-color .3s, background .3s;
}
.hero-service:hover { border-color: var(--gold); background: rgba(11,10,9,.7); }
.hs-title { font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
.hs-when { font-size: clamp(.92rem, 1.4vw, 1.05rem); color: var(--ink); }
.service-sec { padding: 90px 16px 40px; text-align: center; scroll-margin-top: 40px; }
.service-sec .service-card { margin: 0 auto; padding: 40px 28px 34px; }
.service-sec .eyebrow { margin-bottom: 14px; }
.service-sec .service-card h3 { font-size: clamp(2rem, 4vw, 2.6rem); margin-bottom: 20px; }
.service-sec .when { font-size: 1.2rem; }
.service-sec .place { color: var(--ink); font-size: 1.05rem; margin-top: 14px; }
.service-sec .btn { margin-top: 22px; }
@media (max-width: 760px) {
  .hero-service { margin-top: 22px; padding: 12px 16px; }
  .hero.has-photo .hero-inner { padding-bottom: 120px; }
}
@media (max-width: 760px) {
  .dates { font-size: .88rem; letter-spacing: .04em; white-space: nowrap; }
  .dates i { width: 18px; margin: 0 8px; }
}

/* ---------- meal sign-up ---------- */
.hero-meal {
  display: block; width: fit-content; margin-top: 14px; font-size: .9rem; font-weight: 500;
  color: var(--gold-2); text-decoration: none; border-bottom: 1px solid rgba(240,217,168,.45); padding-bottom: 2px;
  text-shadow: 0 1px 10px rgba(0,0,0,.6);
}
.hero-meal:hover { color: var(--ink); border-color: var(--ink); }
.service-sec { display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch; gap: 20px; }
.service-sec .service-card { flex: 1 1 340px; max-width: 520px; margin: 0; display: flex; flex-direction: column; align-items: center; }
.service-sec .service-card .btn { margin-top: auto; }
.service-sec .service-card > p:last-of-type { margin-bottom: 22px; }
.meal-card p:not(.eyebrow) { max-width: 34ch; margin-left: auto; margin-right: auto; }

/* ---------- shared moments: denser grid on small screens ---------- */
@media (max-width: 900px) {
  .gallery-grid { columns: 3; column-gap: 10px; }
  .g-item { margin-bottom: 10px; }
}
@media (max-width: 600px) {
  .gallery-sec { padding-left: 10px; padding-right: 10px; }
  .gallery-grid { columns: 2; column-gap: 6px; }
  .g-item { margin-bottom: 6px; border-radius: 4px; }
  .g-item .play { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
  .g-item .play::after { left: 15px; top: 11px; border-left-width: 13px; border-top-width: 9px; border-bottom-width: 9px; }
  .g-by { display: none; }
}

/* ---------- top bar: two actions ---------- */
.top-actions { display: flex; gap: 8px; align-items: center; }
.pill.ghost { background: rgba(11,10,9,.35); color: var(--ink); border: 1px solid rgba(244,239,230,.5); padding: 8px 15px; }
.pill.ghost:hover { background: rgba(244,239,230,.12); border-color: var(--ink); }
.pill .short { display: none; }
@media (max-width: 520px) {
  .pill .long { display: none; }
  .pill .short { display: inline; }
  .top-actions { gap: 6px; }
  .pill { padding: 8px 13px; }
  .pill.ghost { padding: 7px 12px; }
}
.memories-sec { scroll-margin-top: 30px; }
@media (max-width: 520px) and (min-width: 360px) {
  .mem-pill .long { display: inline; }
  .mem-pill .short { display: none; }
}

/* ---------- upload confirmation toast ---------- */
.toast {
  position: fixed; z-index: 90; left: 50%; bottom: 24px; width: min(460px, calc(100vw - 24px));
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start;
  padding: 18px 16px 18px 18px; border-radius: 14px;
  background: rgba(24,21,17,.96); border: 1px solid rgba(217,183,121,.45);
  box-shadow: 0 20px 60px rgba(0,0,0,.6); backdrop-filter: blur(8px);
  transform: translate(-50%, 30px); opacity: 0; transition: transform .5s var(--ease), opacity .5s var(--ease);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast-check { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #9fd49a; color: #0f1a0e; font-weight: 600; }
.toast-body { display: flex; flex-direction: column; gap: 4px; line-height: 1.5; }
.toast-body strong { font-family: var(--serif); font-weight: 500; font-size: 1.35rem; }
.toast-body span { color: var(--ink-2); font-size: .92rem; }
.toast-body a { color: var(--gold-2); font-size: .88rem; margin-top: 4px; width: fit-content; }
.toast-x { background: none; border: 0; color: var(--ink-3); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 2px; }
.toast-x:hover { color: var(--ink); }

/* ---------- stable photo layout (no jumping while images load) ---------- */
/* Each tile's box is sized from the photo's stored shape before it loads;
   the image then fades in inside that fixed box. */
.g-item { aspect-ratio: 1 / 1; contain: layout paint; }
.g-item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s ease, transform .8s var(--ease), filter .5s; }
.g-item img.ok { opacity: 1; }
.g-item .g-ph { position: absolute; inset: 0; aspect-ratio: auto; }
.g-item.fade { opacity: 1; }
.river-track figure { aspect-ratio: 4 / 5; }
.river-track figure img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.river-track figure { max-width: 80vw; }

/* ---------- obituary ---------- */
.obit-sec { padding: 110px clamp(18px, 6vw, 40px) 30px; }
.obit { max-width: 680px; margin: 0 auto; }
.obit .eyebrow { text-align: center; margin-bottom: 18px; }
.obit h2 {
  font-family: var(--serif); font-weight: 400; text-align: center; margin: 0;
  font-size: clamp(2.2rem, 5.4vw, 3.8rem); line-height: 1.05;
}
.obit-rule { width: 60px; height: 1px; background: var(--gold); margin: 34px auto 40px; opacity: .7; }
.obit-p {
  font-family: var(--serif); font-size: clamp(1.18rem, 2.1vw, 1.36rem); line-height: 1.75;
  color: rgba(244,239,230,.88); margin: 0 0 1.35em; text-wrap: pretty;
}
.obit-p.first::first-letter {
  float: left; font-size: 4.4em; line-height: .82; padding: .06em .1em 0 0; color: var(--gold-2);
}
.obit-p.last {
  margin-top: 2.2em; padding-top: 1.6em; border-top: 1px solid var(--line);
  font-style: italic; color: var(--ink); text-align: center;
}
/* text reveals fade only (no slide) so long reading never shifts */
.obit .reveal { transform: none; transition: opacity 1s var(--ease); }
@media (max-width: 600px) {
  .obit-sec { padding-top: 80px; }
  .obit-p { line-height: 1.7; }
}
/* tighter gap now that the obituary sits above the service details */
.obit-sec + .service-sec { padding-top: 50px; }
.obit h2 { text-wrap: balance; max-width: 21ch; margin-left: auto; margin-right: auto; }

/* ---------- robot check (only visible when Cloudflare asks) ---------- */
.ts-box { position: fixed; z-index: 120; left: 50%; bottom: 24px; transform: translateX(-50%); display: none;
  padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.ts-box.show { display: block; }

/* ---------- shared moments: JS-placed columns + show more ---------- */
.gallery-grid { columns: auto !important; display: flex; gap: 14px; align-items: flex-start; }
.g-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.g-col .g-item { margin: 0 !important; }
.more-wrap { text-align: center; margin-top: 30px; }
@media (max-width: 900px) { .gallery-grid, .g-col { gap: 10px; } }
@media (max-width: 600px) { .gallery-grid, .g-col { gap: 6px; } }

/* ---------- section menu ---------- */
.site-nav { display: none; gap: 26px; margin: 0 auto 0 48px; }
.site-nav a { font-size: .85rem; letter-spacing: .03em; color: var(--ink-2); text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; transition: color .3s, border-color .3s; }
.site-nav a:hover { color: var(--ink); }
.site-nav a.active { color: var(--gold-2); border-bottom-color: rgba(240,217,168,.5); }
@media (min-width: 1100px) { .site-nav { display: flex; } }

.menu-btn {
  width: 38px; height: 34px; border-radius: 10px; border: 1px solid rgba(244,239,230,.35); background: rgba(11,10,9,.35);
  display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; cursor: pointer; padding: 0; flex: none;
}
.menu-btn span { display: block; width: 16px; height: 1.5px; background: var(--ink); transition: transform .3s, opacity .3s; }
.menu-btn.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
@media (min-width: 1100px) { .menu-btn { display: none; } }
.menu-panel {
  position: fixed; z-index: 60; top: 62px; right: clamp(10px, 4vw, 40px); width: min(300px, calc(100vw - 20px));
  display: flex; flex-direction: column; padding: 10px; border-radius: 14px;
  background: rgba(21,19,15,.97); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0,0,0,.6); backdrop-filter: blur(10px);
}
.menu-panel[hidden] { display: none; }
.menu-panel a { padding: 12px 14px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 1rem; }
.menu-panel a:hover, .menu-panel a.active { background: rgba(244,239,230,.07); color: var(--gold-2); }
.menu-panel a[hidden] { display: none; }
.menu-panel hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
@media (max-width: 400px) {
  .topbar { padding-left: 12px; padding-right: 12px; }
  .top-actions { gap: 5px; }
  .pill { padding: 8px 11px; font-size: .78rem; }
  .pill.ghost { padding: 7px 10px; }
}

/* ---------- back to top ---------- */
.to-top {
  position: fixed; z-index: 55; right: clamp(14px, 3vw, 30px); bottom: clamp(14px, 3vw, 30px);
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(217,183,121,.5);
  background: rgba(21,19,15,.9); color: var(--gold-2); font-size: 1.2rem; cursor: pointer;
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .35s, transform .35s;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: rgba(217,183,121,.18); }

/* ---------- footer ---------- */
.site-foot { text-align: center; padding: 50px 16px 60px; border-top: 1px solid var(--line); margin-top: 20px; }
.foot-name { font-family: var(--serif); font-size: 1.6rem; }
.foot-dates { color: var(--ink-3); font-size: .85rem; letter-spacing: .08em; margin-top: 6px; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin: 26px auto 22px; max-width: 640px; }
.foot-links a { color: var(--ink-2); font-size: .88rem; text-decoration: none; }
.foot-links a:hover { color: var(--gold-2); }
.foot-links a[hidden] { display: none; }
.foot-note { color: var(--ink-3); font-size: .78rem; letter-spacing: .06em; }

/* ---------- admin: alerts panel ---------- */
.alert-panel { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); margin: 10px 0 10px; }
.alert-panel b { display: block; font-weight: 500; margin-bottom: 3px; }
.alert-panel span { color: var(--ink-2); font-size: .88rem; }

/* ---------- admin: alerts panel ---------- */
.alert-panel { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); margin: 10px 0 10px; }
.alert-panel b { display: block; font-weight: 500; margin-bottom: 3px; }
.alert-panel span { color: var(--ink-2); font-size: .88rem; }
.ts-msg { margin: 0 0 10px; font-size: .88rem; color: var(--ink-2); text-align: center; max-width: 300px; }

/* ---------- admin: list tabs + badges ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.tabs button {
  font: inherit; font-size: .88rem; padding: 9px 16px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--ink-2); border: 1px solid var(--line);
}
.tabs button span { color: var(--ink-3); margin-left: 4px; }
.tabs button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tabs button.on span { color: rgba(11,10,9,.6); }
.card .media { position: relative; }
.badge { position: absolute; top: 8px; padding: 3px 9px; border-radius: 999px; font-size: .7rem; font-weight: 500; letter-spacing: .04em; }
.badge.vid { left: 8px; background: rgba(11,10,9,.75); color: var(--ink); border: 1px solid rgba(244,239,230,.4); }
.badge.new { right: 8px; background: var(--gold); color: #1a1408; }

/* ---------- admin: select, edit, bulk bar ---------- */
.pick { position: absolute; top: 8px; left: 8px; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(11,10,9,.7); border: 1px solid rgba(244,239,230,.4); cursor: pointer; z-index: 2; }
.pick input { width: 18px; height: 18px; accent-color: var(--gold); cursor: pointer; margin: 0; }
.badge.vid { left: auto; right: 8px; top: auto; bottom: 8px; }
.card.picked { outline: 2px solid var(--gold); outline-offset: -2px; }
.card .actions button.edit { color: var(--ink); }
.edit-form { margin-top: 10px; display: grid; gap: 8px; }
.edit-form label { display: grid; gap: 4px; font-size: .75rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.edit-form input, .edit-form textarea { padding: 8px 10px; font-size: .9rem; min-height: 0; text-transform: none; letter-spacing: 0; }
.select-all { font: inherit; font-size: .85rem; padding: 9px 14px; border-radius: 999px; background: none; color: var(--gold-2); border: 1px dashed rgba(217,183,121,.5); cursor: pointer; margin-left: auto; }
.bulk-bar { position: fixed; z-index: 70; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(760px, calc(100vw - 20px));
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; border-radius: 14px;
  background: rgba(21,19,15,.97); border: 1px solid rgba(217,183,121,.45); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.bulk-bar[hidden] { display: none; }
.bulk-count { margin-right: auto; color: var(--ink); font-size: .92rem; }
.btn.danger { color: #f08f7f; border-color: rgba(240,143,127,.4); }
.mem-photo { display: block; max-width: 260px; max-height: 260px; border-radius: 8px; margin: 4px 0 10px; object-fit: cover; }

/* ---------- memory photos ---------- */
.mem-photo-field { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.mem-photo-label { width: 100%; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.mem-photo-pick { cursor: pointer; }
.mem-photo-preview { position: relative; }
.mem-photo-preview img { display: block; width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.mem-photo-preview button { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); cursor: pointer; line-height: 1; }
.memory-photo { display: block; margin: -10px -8px 20px; border-radius: 8px; overflow: hidden; background: #1b1712; }
.memory-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- light a candle ---------- */
.candle-block { margin: 0 auto 46px; display: flex; flex-direction: column; align-items: center; gap: 14px; scroll-margin-top: 80px; }
.candle-art { position: relative; width: 70px; height: 150px; }
.candle-art .wax { position: absolute; left: 21px; bottom: 0; width: 28px; height: 88px; border-radius: 4px 4px 3px 3px; background: linear-gradient(90deg, #d8cdb9, #f4efe6 45%, #cfc4b2); }
.candle-art .wick { position: absolute; left: 34px; bottom: 88px; width: 2px; height: 9px; background: #3a3128; border-radius: 1px; }
.candle-art .flame { position: absolute; left: 26px; bottom: 95px; width: 18px; height: 34px; border-radius: 50% 50% 45% 45% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 50% 72%, #fffbe8 0%, #ffe39a 30%, #f2b84b 62%, rgba(242,140,40,0) 100%);
  transform-origin: 50% 95%; animation: flicker 3s ease-in-out infinite; filter: blur(.3px); }
.candle-art .glow { position: absolute; left: -25px; top: -10px; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(240,217,168,.28), rgba(240,217,168,0) 70%); animation: glow 3s ease-in-out infinite; }
@keyframes flicker { 0%,100% { transform: scale(1) rotate(-1deg); } 25% { transform: scale(1.04,.96) rotate(1.5deg); } 50% { transform: scale(.97,1.05) rotate(-.5deg); } 75% { transform: scale(1.02,.98) rotate(1deg); } }
@keyframes glow { 0%,100% { opacity: .85; } 50% { opacity: 1; } }
.candle-block.just-lit .glow { animation: burst 1.6s ease-out 1, glow 3s ease-in-out 1.6s infinite; }
@keyframes burst { 0% { transform: scale(.6); opacity: .3; } 40% { transform: scale(1.5); opacity: 1; } 100% { transform: scale(1); opacity: .9; } }
.candle-count { margin: 0; color: var(--ink-2); font-size: 1.02rem; min-height: 1.5em; }
.candle-block.lit #candleBtn { border-color: rgba(217,183,121,.5); color: var(--gold-2); opacity: 1; }
@media (prefers-reduced-motion: reduce) { .candle-art .flame, .candle-art .glow { animation: none; } }
