:root {
  --paper: #f7f2e9;
  --paper-2: #efe7d9;
  --card: #fffdf8;
  --ink: #2a2420;
  --ink-soft: #4a4039;
  --muted: #8a7d70;
  --gold: #a7814a;
  --gold-soft: #c9a977;
  --line: #e2d7c4;
  --serif-display: "Cormorant Garamond", Georgia, serif;
  --serif: "EB Garamond", Georgia, serif;
  --sans: "Jost", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* subtle paper texture */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .48 0 0 0 0 .4 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: 15px; }

/* ---------- HERO ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  padding: 72px 24px 96px;
  position: relative;
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, #fffaf1 0%, transparent 70%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  text-align: center;
}
.hero-inner { max-width: 720px; }
.eyebrow {
  font-family: var(--sans); font-weight: 400; letter-spacing: .32em; text-transform: uppercase;
  font-size: 12px; color: var(--muted); margin: 0 0 32px;
}
.portrait { display: flex; justify-content: center; margin-bottom: 36px; }
.portrait-frame {
  width: min(270px, 62vw); aspect-ratio: 4 / 5;
  border-radius: 999px 999px 18px 18px;
  overflow: hidden; position: relative;
  background: linear-gradient(160deg, #e9dfcd, #d8cab2);
  box-shadow: 0 0 0 1px var(--gold-soft), 0 0 0 10px var(--paper), 0 0 0 11px var(--line), 0 30px 60px -25px rgba(60,40,20,.45);
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85) contrast(1.02); }
.monogram {
  position: absolute; inset: 0; display: none; place-items: center;
  font-family: var(--serif-display); font-size: 92px; font-weight: 300; color: #fff8ea;
  text-shadow: 0 2px 20px rgba(80,55,25,.3);
}
.portrait-frame.no-photo img { display: none; }
.portrait-frame.no-photo .monogram { display: grid; }

.name {
  font-family: var(--serif-display); font-weight: 300;
  font-size: clamp(44px, 8vw, 84px); line-height: 1.05; margin: 0 0 18px; letter-spacing: -.01em;
}
.dates {
  font-family: var(--sans); font-weight: 300; letter-spacing: .25em; font-size: 15px; color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center; gap: 18px; margin: 0 0 40px;
}
.dates .dash { width: 44px; height: 1px; background: var(--gold); }
.epigraph { margin: 0 auto 44px; max-width: 520px; }
.epigraph p {
  font-family: var(--serif-display); font-style: italic; font-size: clamp(21px, 3vw, 26px);
  line-height: 1.45; margin: 0 0 10px; color: var(--ink-soft);
}
.epigraph cite {
  font-style: normal; font-family: var(--sans); font-size: 12px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--muted);
}
.epigraph cite:not(:empty)::before { content: "— "; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* programme-cover layout: photo beside the name on wider screens */
@media (min-width: 900px) {
  .hero { padding: 96px 56px; }
  .hero::before {
    content: ""; position: absolute; inset: 22px; pointer-events: none;
    border: 1px solid rgba(201,169,119,.45); outline: 1px solid rgba(201,169,119,.22); outline-offset: 5px;
  }
  .hero-inner {
    max-width: 1120px; width: 100%;
    display: grid; grid-template-columns: auto 1fr; align-items: center; gap: clamp(48px, 6vw, 96px);
    text-align: left;
  }
  .hero .portrait { margin: 0; }
  .hero .portrait-frame { width: clamp(300px, 30vw, 400px); }
  .hero .eyebrow { margin-bottom: 22px; }
  .hero .name { font-size: clamp(52px, 5.6vw, 80px); }
  .hero .dates { justify-content: flex-start; margin-bottom: 34px; }
  .hero .epigraph {
    margin: 0 0 40px; max-width: 480px; padding-left: 22px; border-left: 1px solid var(--gold-soft);
  }
  .hero-actions { justify-content: flex-start; }
}

.photo-cue {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; margin-top: 22px;
  padding: 9px 18px 9px 14px; border-radius: 999px;
  border: 1px solid var(--gold-soft); background: rgba(255,253,248,.55);
  font-family: var(--sans); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold); text-decoration: none; transition: all .3s ease;
}
.photo-cue svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; animation: cue-pulse 2.6s ease-in-out infinite; }
.photo-cue:hover { border-color: var(--gold); background: var(--gold); color: var(--paper); }
@keyframes cue-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* ---------- TOP NAV (appears after the hero) ---------- */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 28px; background: rgba(247,242,233,.88);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%); transition: transform .4s ease;
}
.topnav.show { transform: none; }
.topnav-name {
  font-family: var(--serif-display); font-size: 22px; text-decoration: none; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.topnav-links { display: flex; align-items: center; gap: 26px; flex-shrink: 0; }
.topnav-links a {
  font-family: var(--sans); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none; transition: color .2s;
}
.topnav-links a:hover { color: var(--gold); }
.topnav-links .topnav-cta { border: 1px solid var(--ink); border-radius: 999px; padding: 8px 16px; color: var(--ink); }
.topnav-links .topnav-cta:hover { background: var(--ink); color: var(--paper); }
section[id], header[id] { scroll-margin-top: 64px; }

/* ---------- BUTTONS ---------- */
.btn {
  font-family: var(--sans); font-size: 13px; font-weight: 400; letter-spacing: .18em; text-transform: uppercase;
  padding: 15px 28px; border-radius: 999px; border: 1px solid var(--ink); cursor: pointer;
  text-decoration: none; transition: all .3s ease; display: inline-block; background: none; color: var(--ink);
}
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: #3d342e; transform: translateY(-1px); box-shadow: 0 10px 24px -12px rgba(40,30,20,.6); }
.btn-ghost:hover { background: rgba(42,36,32,.05); }
.btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.btn-wide { width: 100%; padding: 18px; }
.link-btn {
  background: none; border: 0; color: var(--muted); font-family: var(--sans); font-size: 13px;
  text-decoration: underline; cursor: pointer; padding: 6px 0;
}

/* ---------- SECTIONS ---------- */
section { padding: 110px 24px; }
.section-title {
  font-family: var(--serif-display); font-weight: 400; font-size: clamp(34px, 5vw, 48px);
  text-align: center; margin: 0 0 14px; line-height: 1.15;
}
.ornament { display: flex; justify-content: center; margin-bottom: 26px; }
.ornament svg { width: 120px; height: 20px; fill: none; stroke: var(--gold); stroke-width: 1; }
.ornament svg path:last-child { fill: var(--gold-soft); stroke: none; }

.story { max-width: 680px; margin: 0 auto; }
.story-text { margin-top: 40px; color: var(--ink-soft); }
.story-text p { margin: 0 0 1.25em; }
.story-text p:first-child::first-letter {
  font-family: var(--serif-display); float: left; font-size: 78px; line-height: .78;
  padding: 7px 6px 0 0; margin-left: -2px; color: var(--gold);
}

/* ---------- CANDLE ---------- */
.candle-section {
  background: linear-gradient(180deg, #2a2420 0%, #1d1916 100%);
  color: #f3eadb; padding: 100px 24px;
  position: relative; overflow: hidden; isolation: isolate;
}
/* warm light that spreads through the room once your candle is lit */
.candle-section::before {
  content: ""; position: absolute; inset: -20%; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 55% 50% at 50% 55%, rgba(255,176,80,.22) 0%, rgba(255,150,60,.08) 45%, transparent 75%);
  opacity: 0; transform: scale(.6); transition: opacity 2.8s ease, transform 3.2s ease;
}
.candle-section.glowing::before { opacity: 1; transform: scale(1); }
.candle-wrap { position: relative; z-index: 1; }

/* a field of small flames: one for every candle lit */
.candle-field { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.mini {
  position: absolute; width: 10px; height: 26px; margin: -13px 0 0 -5px;
  transform: scale(var(--s, 1)); opacity: var(--o, .6); transition: opacity 1.6s ease;
}
.mini i {
  position: absolute; left: 50%; bottom: 8px; width: 6px; height: 13px; margin-left: -3px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 50% 85%, #fff 0%, #ffe3a0 30%, #ffae45 62%, rgba(255,120,40,0) 80%);
  transform-origin: 50% 90%; animation: flicker var(--d, 3s) ease-in-out var(--delay, 0s) infinite;
}
.mini::before {
  content: ""; position: absolute; left: 50%; bottom: 0; width: 46px; height: 46px; margin: 0 0 -14px -23px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,180,80,.28) 0%, rgba(255,160,60,.08) 40%, transparent 70%);
}
.mini::after {
  content: ""; position: absolute; left: 50%; bottom: 0; width: 6px; height: 8px; margin-left: -3px; border-radius: 1px 1px 2px 2px;
  background: linear-gradient(90deg, #a8987e, #e9dcc4 50%, #a8987e);
}
.mini.new { animation: miniIn 2.2s ease-out both; --o: 1; }
@keyframes miniIn { 0% { opacity: 0; transform: scale(.2); } 40% { opacity: 1; transform: scale(calc(var(--s, 1) * 1.6)); } 100% { opacity: 1; transform: scale(var(--s, 1)); } }

/* the flame catching when you light it */
.candle.igniting .flame { animation: ignite 1.4s ease-out, flicker 3s ease-in-out 1.4s infinite; }
@keyframes ignite {
  0% { opacity: 0; transform: scale(.1, .1); }
  25% { opacity: 1; transform: scale(1.25, 1.55) rotate(-3deg); }
  55% { transform: scale(.9, .95) rotate(2deg); }
  100% { transform: scale(1, 1) rotate(-1deg); }
}
.candle-section .muted { color: #b6a893; }
.candle-section .btn { border-color: #f3eadb; }
.candle-section .btn-solid { background: #f3eadb; color: #2a2420; }
.candle-section .btn-solid:hover { background: #fff; }
.candle-wrap {
  max-width: 760px; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: 70px; flex-wrap: wrap;
}
.candle-copy { text-align: center; max-width: 340px; }
.candle-copy .section-title { margin-bottom: 8px; }
.candle-copy p { margin: 0 0 26px; }
.candle-count { font-family: var(--sans); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: #b6a893; margin-top: 22px !important; }

.candle { position: relative; width: 90px; height: 230px; }
.wax {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 62px; height: 150px; border-radius: 6px 6px 4px 4px;
  background: linear-gradient(90deg, #d9cbb3 0%, #f8efdf 35%, #fffaf0 50%, #efe3cd 70%, #cdbd9f 100%);
  box-shadow: inset 0 10px 14px -8px rgba(255,190,90,.5);
}
.wax::before {
  content: ""; position: absolute; top: -5px; left: 0; right: 0; height: 12px; border-radius: 50%;
  background: radial-gradient(ellipse at center, #fff4dc 0%, #e8dac0 70%);
}
.wick { position: absolute; bottom: 148px; left: 50%; width: 2px; height: 14px; margin-left: -1px; background: #6b5a48; border-radius: 1px; }
.candle.lit .wick { background: #2b2018; }
.flame {
  position: absolute; bottom: 158px; left: 50%; width: 22px; height: 52px; margin-left: -11px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 50% 85%, #fff 0%, #ffe9a8 25%, #ffb74a 55%, rgba(255,120,40,.0) 75%);
  transform-origin: 50% 90%; animation: flicker 3s ease-in-out infinite; opacity: 0; transition: opacity 1.2s ease;
  filter: blur(.4px);
}
.flame-inner {
  position: absolute; bottom: 6px; left: 50%; width: 8px; height: 16px; margin-left: -4px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 80%, rgba(90,140,255,.7), transparent 70%);
}
.glow {
  position: absolute; bottom: 120px; left: 50%; width: 260px; height: 260px; margin-left: -130px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,190,90,.35) 0%, rgba(255,160,60,.1) 35%, transparent 65%);
  opacity: 0; transition: opacity 1.6s ease; animation: breathe 4s ease-in-out infinite;
}
.candle.lit .flame, .candle.lit .glow { opacity: 1; }
@keyframes flicker {
  0%, 100% { transform: scale(1, 1) rotate(-1deg); }
  20% { transform: scale(.96, 1.04) rotate(1.5deg); }
  45% { transform: scale(1.03, .97) rotate(-2deg); }
  70% { transform: scale(.98, 1.06) rotate(1deg); }
}
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* ---------- TRIBUTES ---------- */
.memories { max-width: 1160px; margin: 0 auto; }
/* keep a few tributes centred instead of hugging the left */
.tributes[data-count="1"] { columns: 1; max-width: 560px; margin-left: auto; margin-right: auto; }
.tributes[data-count="2"] { columns: 2 320px; max-width: 800px; margin-left: auto; margin-right: auto; }

.tributes { columns: 3 320px; column-gap: 26px; margin-top: 54px; }
.tribute {
  break-inside: avoid; margin: 0 0 26px; background: var(--card);
  border: 1px solid var(--line); border-radius: 4px; padding: 52px 32px 26px; position: relative;
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 18px 40px -30px rgba(60,40,20,.35);
  animation: rise .8s ease both; cursor: pointer;
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}
.tribute:hover, .tribute:focus-visible {
  transform: translateY(-4px); border-color: var(--gold-soft); outline: none;
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 28px 50px -30px rgba(60,40,20,.5);
}
.tribute.tint { background: #f4ecdd; }
.tribute::before {
  content: "\201C"; position: absolute; top: 8px; left: 26px;
  font-family: var(--serif-display); font-size: 76px; line-height: 1; color: var(--gold); opacity: .55;
}
.tribute.has-photo { padding-top: 0; }
.tribute.has-photo::before { display: none; }
.tribute-photo { margin: 0 -32px 24px; overflow: hidden; border-radius: 4px 4px 0 0; }
.tribute-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 22%; transition: transform .8s ease; }
.tribute:hover .tribute-photo img { transform: scale(1.04); }
.tribute-quote {
  margin: 0 0 24px; font-family: var(--serif-display); font-style: italic; font-weight: 400;
  font-size: 23px; line-height: 1.4; color: var(--ink);
}
.tribute:not(.has-photo) .tribute-quote { font-size: 26px; }
.tribute-quote.short { font-size: 30px !important; line-height: 1.3; }
.tribute-foot { border-top: 1px solid var(--line); padding-top: 16px; }
.tribute-name { font-family: var(--serif-display); font-size: 22px; font-weight: 500; line-height: 1.2; }
.tribute-meta { font-family: var(--sans); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.read-link {
  display: inline-block; margin-top: 14px; font-family: var(--sans); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold); transition: letter-spacing .3s ease;
}
.tribute:hover .read-link { letter-spacing: .2em; }

/* full-tribute reader */
.reader {
  border: 0; padding: 0; background: none; color: inherit;
  width: min(760px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px); overflow: hidden;
}
.reader[open] { animation: dialog-in .35s cubic-bezier(.2,.8,.3,1) both; display: flex; }
.reader::backdrop { background: rgba(29,25,22,.6); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .3s ease both; }
.reader-card {
  position: relative; display: flex; flex-direction: column; width: 100%; max-height: calc(100dvh - 32px);
  background: var(--card); border-radius: 6px; overflow: hidden; box-shadow: 0 40px 90px -30px rgba(20,14,10,.6);
}
.reader-card .dialog-close { z-index: 2; background: rgba(255,253,248,.85); }
.reader-photo { width: 100%; height: 46vh; object-fit: contain; background: var(--paper-2); flex-shrink: 0; }
.reader-body { overflow-y: auto; padding: clamp(28px, 5vw, 56px) clamp(24px, 6vw, 64px) 32px; overscroll-behavior: contain; }
.reader-msg { white-space: pre-line; font-size: 19px; line-height: 1.75; color: var(--ink-soft); }
.reader-photo[hidden] + .reader-body { padding-top: clamp(56px, 7vw, 72px); }
.reader-photo[hidden] + .reader-body .reader-msg::before {
  content: "\201C"; display: block; font-family: var(--serif-display); font-size: 80px; line-height: .6; height: 34px; color: var(--gold); opacity: .55;
}
.reader-foot { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); }
.reader-nav {
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
  padding: 14px 20px; border-top: 1px solid var(--line); background: var(--paper);
  font-family: var(--sans); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.reader-nav[hidden] { display: none; }
.reader-nav button {
  background: none; border: 0; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit;
  color: var(--ink); padding: 8px 10px; border-radius: 999px;
}
.reader-nav button:hover { background: var(--paper-2); }
.tribute-del {
  position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(255,255,255,.9); border: 1px solid #d9b0a6;
  color: #9b3d2c; font-family: var(--sans); font-size: 11px; border-radius: 999px; padding: 4px 10px; cursor: pointer;
}
.empty { text-align: center; margin-top: 50px; font-size: 20px; }
.empty p { margin: 0 0 4px; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- FORM ---------- */
/* ---------- SHARE A MEMORY (pop-up) ---------- */
.share-dialog {
  border: 0; padding: 0; background: none; color: inherit;
  width: min(720px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px);
  overflow: auto; overscroll-behavior: contain;
}
.share-dialog[open] { animation: dialog-in .35s cubic-bezier(.2,.8,.3,1) both; }
.share-dialog::backdrop { background: rgba(29,25,22,.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .3s ease both; }
.share-dialog .share-card { position: relative; margin: 0; box-shadow: 0 40px 90px -30px rgba(20,14,10,.6); }
.share-dialog .share-card > p { margin-bottom: 32px; }
.dialog-close {
  position: absolute; top: 14px; right: 16px; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: none; color: var(--muted); font-size: 30px; line-height: 1; cursor: pointer; transition: all .2s;
}
.dialog-close:hover { background: var(--paper-2); color: var(--ink); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(18px) scale(.98); } }
body.dialog-open { overflow: hidden; }
.share-card {
  max-width: 720px; margin: 0 auto; background: var(--card); border: 1px solid var(--line);
  border-radius: 6px; padding: clamp(32px, 6vw, 64px); box-shadow: 0 30px 70px -45px rgba(60,40,20,.5);
}
.share-card > p { margin: 0 auto 40px; max-width: 480px; }
form label { display: block; margin-bottom: 22px; }
form label > span {
  display: block; font-family: var(--sans); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 8px;
}
form label em { text-transform: none; letter-spacing: 0; color: var(--muted); font-style: normal; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
input, textarea {
  width: 100%; font: inherit; font-size: 18px; color: var(--ink); background: #fffefb;
  border: 1px solid var(--line); border-radius: 4px; padding: 13px 15px; transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 160px; line-height: 1.6; }
input:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(167,129,74,.12); }
input::placeholder { color: #b9ad9e; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.photo-field { margin-bottom: 24px; }
.photo-drop {
  display: grid; place-items: center; min-height: 92px; border: 1px dashed var(--gold-soft); border-radius: 4px;
  cursor: pointer; margin: 0; transition: background .2s; overflow: hidden; position: relative;
}
.photo-drop:hover { background: rgba(167,129,74,.05); }
.photo-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.photo-prompt { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-family: var(--sans); font-size: 14px; letter-spacing: .04em; }
.photo-prompt em { color: var(--muted); font-style: normal; }
.photo-prompt svg { width: 22px; height: 22px; fill: none; stroke: var(--gold); stroke-width: 1.4; }
#photoPreview { max-height: 260px; width: auto; margin: 10px auto; border-radius: 3px; }
.form-msg { min-height: 1.4em; text-align: center; font-family: var(--sans); font-size: 14px; margin: 0 0 14px; }
.form-msg.error { color: #9b3d2c; }
.form-msg.ok { color: #4f6b46; }

/* ---------- FOOTER ---------- */
.footer { text-align: center; padding: 80px 24px 70px; background: var(--paper-2); }
.closing { font-family: var(--serif-display); font-style: italic; font-size: 30px; margin: 0 0 10px; }

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(20,16,13,.92);
  display: grid; place-items: center; padding: 30px; animation: fade .3s ease;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 3px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.lightbox-close {
  position: absolute; top: 18px; right: 24px; background: none; border: 0; color: #f3eadb; font-size: 44px; cursor: pointer; line-height: 1;
}
@keyframes fade { from { opacity: 0; } }

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

@media (max-width: 640px) {
  body { font-size: 18px; }
  section { padding: 64px 20px; }
  .candle-section { padding: 70px 20px; }
  .footer { padding: 56px 20px 50px; }
  .topnav { padding: 10px 16px; }
  .topnav-name { font-size: 18px; }
  .topnav-links { gap: 14px; }
  .topnav-links a { font-size: 11px; letter-spacing: .1em; }
  .topnav-links .topnav-cta { padding: 7px 12px; }
  .hide-sm { display: none; }
  .topnav-name .given { display: none; }
  .tributes[data-count="2"] { columns: 1; }
  .row { grid-template-columns: 1fr; }
  .share-dialog { width: 100%; max-height: 100dvh; height: 100dvh; margin: 0; }
  .share-dialog .share-card { min-height: 100%; border-radius: 0; border: 0; padding: 56px 22px 32px; }
  .candle-wrap { gap: 30px; }
  .tribute { padding: 48px 24px 22px; }
  .tribute.has-photo { padding-top: 0; }
  .tribute-photo { margin: 0 -24px 20px; }
  .tribute-quote { font-size: 21px; }
  .tribute:not(.has-photo) .tribute-quote { font-size: 23px; }
  .reader { width: 100%; max-height: 100dvh; height: 100dvh; margin: 0; }
  .reader-card { max-height: none; height: 100%; border-radius: 0; }
  .reader-msg { font-size: 18px; }
}
@media (max-width: 380px) {
  .topnav-name { display: none; }
  .topnav { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .candle.lit .flame, .candle.lit .glow { opacity: 1; }
  .mini { transform: scale(var(--s, 1)); }
}

.surname { text-transform: uppercase; }
