/* ==========================================================
   Memorial site
   Direction: dark, cinematic and modern. One typeface (Satoshi),
   colours from the family's programme: deep wine, burnt orange.

   Shape rule: interactive controls are full pills; tiles,
   cards and photos use 22px; small inner chips use 12px.
   One accent: burnt orange (--accent).
   ========================================================== */
:root {
  /* light theme (default) */
  --bg: #FBF6EF;            --bg-rgb: 251 246 239;
  --bg-2: #FFFFFF;          /* cards, tiles */
  --bg-3: #F3EAE0;          --bg3-rgb: 243 234 224;
  --fg-rgb: 36 18 14;
  --line: rgb(var(--fg-rgb) / .10);
  --line-2: rgb(var(--fg-rgb) / .18);
  --text: #24120E;          /* ~16:1 on bg */
  --text-2: #5B463C;        /* ~8:1 */
  --muted: #76604F;         /* ~5.4:1 */
  --accent: #B0501B;        --accent-rgb: 176 80 27;   /* 5:1 with white text */
  --accent-hover: #984313;
  --accent-ink: #FFFFFF;
  --feature: linear-gradient(140deg, #F7E2D0, #FFFFFF 72%);
  --danger-bg: #FBE4DA; --danger: #8E2E12;
  --grain: .03;
  --shadow: 0 1px 2px rgb(var(--fg-rgb) / .05), 0 14px 34px rgb(var(--fg-rgb) / .08);

  --font: "Satoshi", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 22px;
  --r-sm: 12px;
  --ease: cubic-bezier(.16, 1, .3, 1);

  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabs-h: 68px;
  --dock-h: 60px;
  --top-h: 64px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #120707;            --bg-rgb: 18 7 7;
  --bg-2: #1B0C0A;
  --bg-3: #261310;          --bg3-rgb: 38 19 16;
  --fg-rgb: 246 234 222;
  --text: #F6EDE4;
  --text-2: #D2BFB1;
  --muted: #A48E80;
  --accent: #EE8A3C;        --accent-rgb: 238 138 60;
  --accent-hover: #F49A52;
  --accent-ink: #1A0806;
  --feature: linear-gradient(140deg, #4A1311, #1B0C0A 70%);
  --danger-bg: rgba(238, 90, 60, .14); --danger: #FFB49B;
  --grain: .05;
  --shadow: 0 16px 40px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

html { font-size: 100%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html[data-size="1"] { font-size: 112.5%; }
html[data-size="2"] { font-size: 125%; }
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--font); font-size: 1.125rem; font-weight: 400; line-height: 1.65; letter-spacing: -.003em;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
/* film grain, fixed so it never repaints while scrolling */
body::after { content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: var(--grain); 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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; font-weight: 700; letter-spacing: -.025em; }
p { margin: 0 0 1em; }
.ph, .ph-fill { font-size: 1.3em; line-height: 1; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.skip-link:focus { top: 12px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.wrap-mid, .wrap-wide { max-width: 1180px; }
.h2 { font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 700; letter-spacing: -.035em; }
.section-title { font-size: 1.8rem; font-weight: 700; letter-spacing: -.03em; }
.section-title-sm { font-size: 1.35rem; }
.count { font-size: 1rem; font-weight: 500; color: var(--muted); }
.link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0; border: 0; background: none; font-weight: 700; color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 5px; }
.link .ph { font-size: 1.1em; transition: transform .3s var(--ease); }
.link:hover .ph { transform: translateX(3px); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease) var(--d, 0ms), transform .9s var(--ease) var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px 0 20px; background: rgb(var(--bg-rgb) / .72); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; text-decoration: none; color: var(--text); }
.brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-dates { font-size: .88rem; color: var(--muted); white-space: nowrap; }
.topbar-actions { display: flex; gap: 6px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text); transition: background-color .2s; }
.icon-btn:hover { background: var(--bg-3); }
.icon-btn[data-active="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- Tabs (bottom on phones) ---------- */
.tabs { position: fixed; inset: auto 0 0 0; z-index: 40; height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b); display: grid; grid-template-columns: repeat(5, 1fr); background: rgb(var(--bg-rgb) / .9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: .8rem; font-weight: 500; transition: color .2s; }
.tab .ph { font-size: 1.5rem; }
.tab[aria-current="page"] { color: var(--accent); font-weight: 700; }
main { padding-bottom: calc(var(--tabs-h) + var(--dock-h) + var(--safe-b) + 36px); outline: none; }

/* ---------- Dock ---------- */
.dock { position: fixed; z-index: 35; left: 10px; right: 10px; bottom: calc(var(--tabs-h) + var(--safe-b) + 10px); display: flex; gap: 8px; }
.hymn-pill, .dock-tribute { height: 54px; border-radius: 999px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow); }
.hymn-pill { flex: 1; min-width: 0; padding: 0 18px 0 7px; border: 1px solid var(--line-2); background: rgb(var(--bg3-rgb) / .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: var(--text); text-align: left; }
.hymn-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 999px; background: rgb(var(--fg-rgb) / .08); }
.hymn-icon .i-off { display: none; }
.hymn-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.hymn-state { font-weight: 700; font-size: .98rem; }
.hymn-title { font-size: .84rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eq { display: none; align-items: flex-end; gap: 3px; height: 16px; flex: none; color: var(--accent); }
.eq i { width: 3px; border-radius: 2px; background: currentColor; animation: eq 1.2s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.4s; } .eq i:nth-child(3) { animation-delay: -.8s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }
.hymn-pill.is-playing .hymn-icon { background: var(--accent); color: var(--accent-ink); }
.hymn-pill.is-playing .eq { display: flex; }
.hymn-pill.is-muted .i-on { display: none; }
.hymn-pill.is-muted .i-off { display: inline; }
.dock-tribute { flex: none; padding: 0 20px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.hymn-pill:active, .dock-tribute:active { transform: scale(.98); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 26px; border-radius: 999px; border: 1px solid transparent; font-weight: 700; font-size: 1.04rem; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; transition: transform .25s var(--ease), background-color .25s, border-color .25s, color .25s; }
.btn:active { transform: scale(.98); }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary .ph { transition: transform .3s var(--ease); }
.btn-primary:hover .ph { transform: translateX(3px); }
.btn-ghost, .btn-secondary { background: rgb(var(--fg-rgb) / .04); color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover, .btn-secondary:hover { background: rgb(var(--fg-rgb) / .1); }
.btn[disabled] { opacity: .6; cursor: wait; }

.panel { animation: enter .6s var(--ease) both; }
@keyframes enter { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Hero ---------- */
.hero { position: relative; display: grid; overflow: hidden; }
.hero-media { position: relative; height: min(48vh, 460px); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; filter: contrast(1.08) brightness(.94) saturate(1.05); animation: settle 2.4s var(--ease) both; }
.hero-rays { position: absolute; left: 50%; top: 36%; width: 260%; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; mix-blend-mode: screen;
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 160, .34) 0deg 3deg, rgba(255, 214, 160, 0) 3deg 11deg);
  -webkit-mask-image: radial-gradient(circle, transparent 0 13%, #000 21%, rgba(0, 0, 0, .5) 32%, transparent 50%); mask-image: radial-gradient(circle, transparent 0 13%, #000 21%, rgba(0, 0, 0, .5) 32%, transparent 50%);
  animation: rays 140s linear infinite; }
.hero-rays-wrap { position: absolute; inset: 0; overflow: hidden; pointer-events: none; -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 38%, transparent 60%); mask-image: linear-gradient(180deg, #000 0%, #000 38%, transparent 60%); }
@keyframes rays { to { transform: translate(-50%, -50%) rotate(360deg); } }
/* deepen the studio backdrop so the rays read against rich darkness */
.hero-media::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; mix-blend-mode: multiply; background: radial-gradient(75% 65% at 50% 38%, rgba(10, 4, 4, 0) 28%, rgba(10, 4, 4, .62) 100%); }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(var(--bg-rgb) / 0) 40%, rgb(var(--bg-rgb) / .75) 72%, var(--bg) 94%); bottom: -2px; }
@keyframes settle { from { transform: scale(1.08); opacity: .4; } to { transform: none; opacity: 1; } }
.hero-copy { position: relative; z-index: 1; margin-top: -72px; padding: 0 20px 40px; }
.hero-copy > * { animation: rise 1s var(--ease) both; }
.hero-copy > :nth-child(2) { animation-delay: .12s; } .hero-copy > :nth-child(3) { animation-delay: .24s; } .hero-copy > :nth-child(4) { animation-delay: .36s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.hero-kicker { margin: 0 0 12px; font-size: 1rem; font-weight: 500; color: var(--accent); }
.hero-name { font-size: clamp(2.8rem, 12vw, 6.4rem); line-height: .95; letter-spacing: -.05em; }
.hero-first { display: block; font-weight: 300; }
.hero-last { display: block; font-weight: 900; }
.hero-dates { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 22px 0 0; font-size: 1.08rem; color: var(--text-2); }
.hero-line { width: 36px; height: 1px; background: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

/* ---------- Bento: service details ---------- */
.bento { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-top: 8px; }
.tile { box-shadow: var(--shadow); position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px; padding: 22px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-2); color: var(--text); text-decoration: none; text-align: left; transition: border-color .3s, transform .4s var(--ease), background-color .3s; }
a.tile:hover, button.tile:hover { border-color: var(--line-2); transform: translateY(-3px); }
.tile-date { grid-column: 1 / -1; background: var(--feature); }
.tile-label { margin: 0 0 18px; font-weight: 500; color: var(--accent); }
.tile-big { margin: 0; display: flex; flex-direction: column; }
.tile-big span { font-size: 1.15rem; color: var(--text-2); }
.tile-big strong { font-size: clamp(2.1rem, 8vw, 3.2rem); font-weight: 900; letter-spacing: -.04em; line-height: 1.05; }
.tile-count { margin: 22px 0 0; display: inline-flex; align-items: baseline; gap: 6px; color: var(--text-2); }
.tile-count strong { font-size: 1.6rem; font-weight: 900; color: var(--accent); }
.tile-ico { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 999px; background: rgb(var(--accent-rgb) / .14); color: var(--accent); }
.tile-t { font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; }
.tile-s { font-size: .98rem; color: var(--text-2); line-height: 1.5; }
.tile-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 16px; font-weight: 700; color: var(--accent); }
.tile-place { grid-column: 1 / -1; }
.tile-programme { grid-column: 1 / -1; min-height: 210px; justify-content: flex-end; border: 0; }
.tile-programme img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; transition: transform 1.2s var(--ease); }
.tile-programme::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 6, 6, 0) 20%, rgba(20, 6, 6, .88)); }
.tile-programme .tile-t { color: #FBF1E7; } .tile-programme .tile-s { color: #E5D2C3; }
.tile-programme > span { position: relative; z-index: 1; }
.tile-programme .tile-t { font-size: 1.45rem; }
.tile-programme:hover img { transform: scale(1.05); }
.tile-cal { grid-column: 1 / -1; border: 1px solid var(--line); font: inherit; }

/* ---------- Life ---------- */
.life { display: grid; gap: 36px; margin-top: 110px; }
.life-lead { margin: 18px 0 24px; font-size: 1.15rem; line-height: 1.75; color: var(--text-2); max-width: 52ch; }
.life-photo { margin: 0 0 24px; max-width: 260px; border-radius: var(--r); overflow: hidden; }
.life-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: grayscale(.35) sepia(.25); transition: filter .8s var(--ease); }
.life-photo:hover img { filter: none; }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line-2); }
.timeline li { position: relative; display: grid; gap: 4px; padding: 0 0 30px 26px; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.tl-year { font-size: 1.9rem; font-weight: 900; letter-spacing: -.04em; line-height: 1.1; color: var(--text); }
.tl-text { color: var(--text-2); line-height: 1.55; max-width: 44ch; }

/* ---------- Quote band ---------- */
.quote-band { margin-top: 110px; padding: 72px 0 40px; background: radial-gradient(120% 90% at 0% 0%, rgb(var(--accent-rgb) / .14), transparent 55%), var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quote-inner { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.quote-inner.is-in { opacity: 1; transform: none; }
.quote-text { margin: 0; max-width: 24ch; font-size: clamp(1.8rem, 6.4vw, 3.6rem); font-weight: 500; line-height: 1.15; letter-spacing: -.035em; }
.quote-by { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 26px 0 6px; }
.quote-by strong { font-weight: 700; }
.quote-by span { color: var(--muted); }
.quote-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.quote-controls .link { margin-left: auto; }
.round-btn { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text); transition: background-color .2s; }
.round-btn:hover { background: var(--bg-3); }
.quote-dots { display: flex; gap: 6px; }
.quote-dots i { width: 6px; height: 6px; border-radius: 999px; background: var(--line-2); transition: width .4s var(--ease), background-color .4s; }
.quote-dots i.on { width: 22px; background: var(--accent); }

/* ---------- Moments marquee ---------- */
.moments { margin-top: 110px; }
.moments-head { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; margin-bottom: 26px; }
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee-track { display: flex; gap: 12px; width: max-content; animation: marquee 70s linear infinite; }
.marquee:hover .marquee-track, .marquee:focus-within .marquee-track { animation-play-state: paused; }
.marquee-track button { flex: none; width: 220px; padding: 0; border: 0; border-radius: var(--r); overflow: hidden; background: var(--bg-3); }
.marquee-track button:nth-child(odd) { width: 260px; }
.marquee-track img { width: 100%; height: 300px; object-fit: cover; transition: transform .8s var(--ease); }
.marquee-track button:hover img { transform: scale(1.05); }
@keyframes marquee { to { transform: translateX(calc(-50% - 6px)); } }

/* ---------- Appreciation ---------- */
.appreciation { position: relative; margin-top: 110px; overflow: hidden; }
.appreciation-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; opacity: .5; }
.appreciation::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--bg) 0%, rgb(var(--bg-rgb) / .55) 30%, rgb(var(--bg-rgb) / .9) 75%, var(--bg) 100%); }
.appreciation-body { position: relative; z-index: 1; padding-top: 200px; padding-bottom: 60px; }
.appreciation-cols { margin-top: 26px; }
.appreciation p { color: var(--text-2); line-height: 1.8; max-width: 62ch; }
.appreciation .sig { margin-top: 26px; font-weight: 700; color: var(--text); }

/* ---------- Inner page heads ---------- */
.page-head { padding: 44px 0 24px; }
.page-title { font-size: clamp(2.6rem, 10vw, 4.6rem); font-weight: 900; letter-spacing: -.05em; line-height: 1; }
.page-lead { margin: 16px 0 0; max-width: 52ch; color: var(--text-2); font-size: 1.1rem; }

/* ---------- Language switch ---------- */
.lang-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 24px; }
.lang-label { font-size: .95rem; color: var(--muted); }
.seg { display: inline-grid; grid-template-columns: repeat(3, auto); gap: 2px; padding: 4px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { min-height: 42px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; font-weight: 700; color: var(--text-2); transition: background-color .25s, color .25s; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

/* ---------- Rows (service + hymns) ---------- */
.part { margin-bottom: 40px; }
.part-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 14px; }
.part-head h2 { font-size: 1.5rem; letter-spacing: -.03em; }
.part-head span { color: var(--muted); }
.rows { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.row { width: 100%; display: grid; grid-template-columns: 3rem 1fr auto; gap: 14px; align-items: center; padding: 18px 18px 18px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); color: var(--text); text-align: left; transition: border-color .3s, background-color .3s, transform .3s var(--ease); }
.row:hover { border-color: var(--line-2); background: var(--bg-3); }
.row:active { transform: scale(.995); }
.row-num { font-size: 1.7rem; font-weight: 900; letter-spacing: -.04em; color: var(--muted); text-align: center; line-height: 1; }
.row-t { display: block; font-weight: 700; font-size: 1.12rem; letter-spacing: -.015em; line-height: 1.3; }
.row-yo { display: block; font-size: .98rem; color: var(--muted); }
.row-detail { display: block; margin-top: 4px; font-size: .98rem; font-weight: 700; color: var(--accent); }
.row-first { display: block; margin-top: 6px; font-size: .98rem; color: var(--text-2); }
.row .ph { color: var(--muted); font-size: 1.2rem; transition: transform .3s var(--ease), color .3s; }
.row:hover .ph { color: var(--accent); transform: translateX(3px); }
.row.is-hymn .row-num { color: var(--accent); }

.info-grid { display: grid; gap: 14px; margin-top: 10px; }
.info-grid > section { padding: 24px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-2); }
.people { display: grid; gap: 14px; margin: 18px 0 0; }
.people div { display: flex; flex-direction: column; }
.people dt { font-weight: 700; }
.people dd { margin: 0; font-size: .95rem; color: var(--muted); }
.needs-box p { margin-top: 12px; color: var(--text-2); }
.needs { margin: 0; padding-left: 1.2em; color: var(--text); }
.needs li { padding: 3px 0; }

/* ---------- Tributes ---------- */
.share-memory { display: grid; gap: 16px; align-items: center; padding: 24px; border-radius: var(--r); background: var(--feature); border: 1px solid var(--line); }
.share-memory p { margin: 0; color: var(--text-2); }
.share-memory strong { color: var(--text); }
.filter-bar { display: grid; gap: 10px; margin: 30px 0 18px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; font-weight: 700; color: var(--text); white-space: nowrap; transition: background-color .25s, color .25s; }
.chip span { margin-left: 6px; color: var(--muted); font-weight: 500; }
.chip[aria-selected="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip[aria-selected="true"] span { color: var(--bg); opacity: .7; }
.search { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted); }
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1.05rem; color: var(--text); }
.search input::placeholder { color: var(--muted); }
.tribute-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.tcard { display: flex; flex-direction: column; gap: 10px; width: 100%; margin: 0; padding: 18px 20px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-2); color: var(--text); text-align: left; transition: border-color .3s, background-color .3s; }
.tcard:hover { border-color: var(--line-2); background: var(--bg-3); }
.tcard-name { display: block; font-weight: 700; font-size: 1.08rem; letter-spacing: -.015em; }
.tcard-meta { display: block; font-size: .94rem; color: var(--accent); }
.tcard-title { display: block; margin-top: 14px; font-weight: 700; font-size: 1.2rem; line-height: 1.3; letter-spacing: -.02em; }
.tcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tcard-go { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 999px; background: var(--bg-3); color: var(--accent); transition: transform .3s var(--ease); }
.tcard:hover .tcard-go { transform: translateX(3px); }
.tcard-excerpt { display: -webkit-box; color: var(--text-2); line-height: 1.55; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-weight: 700; color: var(--accent); }
.no-results { color: var(--muted); }
.tribute-more { display: flex; margin: 18px auto 0; gap: 10px; }
.tribute-more .count { font-size: .92rem; }
.card { margin: 0 !important; }
.visitors-title { margin: 48px 0 16px; }

/* guest tributes (tributes.js) */
.card { display: block; break-inside: avoid; margin: 0 0 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-2); }
.tribute { padding: 22px; }
.tribute-head { margin-bottom: 10px; }
.tribute-head .avatar { display: none; }
.tribute-name { font-weight: 700; font-size: 1.08rem; }
.tribute-meta { font-size: .94rem; color: var(--muted); }
.tribute-text { margin: 0; white-space: pre-line; line-height: 1.7; color: var(--text-2); }
.tribute.is-new { animation: flash 2s ease; }
@keyframes flash { from { border-color: var(--accent); } }
.badge-local { display: inline-block; margin-left: 6px; padding: 0 10px; border-radius: 999px; background: var(--bg-3); font-size: .8rem; color: var(--text-2); }
.empty { padding: 22px; border-radius: var(--r); border: 1px dashed var(--line-2); color: var(--text-2); }
.empty .ph { display: none; }
.empty strong { display: block; color: var(--text); }
.empty p { margin: 4px 0 0; }

/* ---------- Gallery ---------- */
.gallery { columns: 2; column-gap: 10px; }
.gallery button { display: block; width: 100%; margin: 0 0 10px; padding: 0; border: 0; border-radius: var(--r-sm); overflow: hidden; background: var(--bg-3); break-inside: avoid; }
.gallery img { width: 100%; height: auto; transition: transform .8s var(--ease), opacity .3s; }
.gallery button:hover img { transform: scale(1.04); }

/* ---------- Footer ---------- */
.footer { padding-top: 64px; color: var(--muted); font-size: .95rem; }
.footer p { margin: 0; }
.footer-name { font-weight: 700; color: var(--text); }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 60; }
body.modal-open { overflow: hidden; }

/* Welcome */
.welcome { display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.welcome-bg { position: fixed; inset: 0; background: rgba(10, 3, 3, .78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade .5s ease both; }
.welcome-card { position: relative; width: 100%; max-width: 440px; overflow: hidden; border-radius: 28px; border: 1px solid var(--line-2); background: var(--bg-2); box-shadow: 0 40px 100px rgba(0, 0, 0, .6); animation: pop .7s var(--ease) both .05s; }
.welcome-photo { width: 100%; aspect-ratio: 16 / 11; object-fit: cover; object-position: 50% 20%; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.welcome-body { margin-top: -60px; position: relative; padding: 0 24px 22px; }
.welcome-small { margin: 0; color: var(--accent); font-weight: 500; }
.welcome-title { margin: 4px 0 14px; font-size: 1.9rem; font-weight: 900; letter-spacing: -.04em; line-height: 1.05; }
.welcome-text { color: var(--text-2); margin-bottom: 20px; }
.welcome-text strong { color: var(--text); }
.welcome-actions { display: grid; gap: 8px; }
.welcome-note { margin: 14px 0 0; font-size: .92rem; color: var(--muted); }
.welcome.is-leaving .welcome-bg { animation: fade .3s ease reverse both; }
.welcome.is-leaving .welcome-card { animation: pop .3s ease reverse both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

/* Reader */
.reader { background: rgba(10, 3, 3, .6); animation: fade .25s ease both; }
.reader-shell { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); animation: pop .45s var(--ease) both; }
.reader-top { flex: none; display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 10px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.reader-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 16px 0 10px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; font-weight: 700; color: var(--text); }
.reader-crumb { flex: 1; min-width: 0; margin: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-progress { flex: none; padding: 4px 12px; border-radius: 999px; background: var(--bg-3); font-size: .9rem; font-weight: 700; color: var(--text-2); }
.reader-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.reader-body { max-width: 740px; margin: 0 auto; padding: 30px 20px 48px; }
.reader-kicker { margin: 0 0 8px; color: var(--accent); font-weight: 500; }
.reader-title { font-size: clamp(2rem, 7vw, 3rem); font-weight: 900; letter-spacing: -.045em; line-height: 1.02; }
.reader-sub { margin: 10px 0 0; color: var(--muted); font-size: 1.08rem; }
.lang-bar-reader { margin: 24px 0 4px; }
.reader-content { margin-top: 26px; }
.reader-nav { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 10px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--bg-2); }
.reader-step { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 58px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; color: var(--text); text-align: left; }
.reader-step span { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.reader-step small { font-size: .8rem; color: var(--muted); }
.reader-step b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-step-next { justify-content: flex-end; text-align: right; border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.reader-step-next small { color: inherit; opacity: .8; }
.reader-step[disabled] { opacity: .3; cursor: default; }

/* Reader text */
.lang-cols { display: grid; gap: 32px; }
.lang-col h3 { margin-bottom: 14px; font-size: .95rem; font-weight: 700; color: var(--accent); letter-spacing: 0; }
.r-p { margin: 0 0 1em; font-size: 1.2rem; line-height: 1.8; color: var(--text); }
.r-rubric { margin: 0 0 1em; font-style: italic; color: var(--muted); }
.r-line { margin: 0 0 1em; font-size: 1.2rem; line-height: 1.7; }
.r-who { display: block; font-size: .88rem; font-weight: 700; color: var(--accent); }
.r-line.is-people { font-weight: 700; }
.r-verse { display: grid; grid-template-columns: 2.2rem 1fr; gap: 4px; margin: 0 0 .8em; font-size: 1.2rem; line-height: 1.75; }
.r-verse b { padding-top: 4px; font-size: .9rem; color: var(--accent); }
.r-ref { margin: -.4em 0 1.6em; font-weight: 700; color: var(--accent); }
.r-h { margin: 1.6em 0 .7em; font-size: 1.3rem; letter-spacing: -.02em; }
.r-note { padding: 22px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); color: var(--text-2); font-size: 1.12rem; }
.r-note .ph { display: none; }
.stanza { display: grid; grid-template-columns: 2.4rem 1fr; margin: 0 0 26px; }
.stanza-n { font-size: 1.5rem; font-weight: 900; color: var(--accent); line-height: 1.3; letter-spacing: -.04em; }
.stanza-lines p { margin: 0; font-size: 1.28rem; line-height: 1.6; padding-left: 1em; text-indent: -1em; }
.refrain { margin: 0 0 26px 2.4rem; padding: 18px 20px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); }
.refrain small { display: block; margin-bottom: 8px; font-size: .92rem; font-weight: 700; color: var(--accent); }
.refrain p { margin: 0; font-size: 1.24rem; font-weight: 700; line-height: 1.6; }
.also { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.t-author { margin: 4px 0 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.t-author .avatar { display: none; }
.t-author b { display: block; font-size: 1.12rem; }
.t-author span { color: var(--accent); }
.chapter { margin: 0 0 36px; }
.chapter h3 { margin-bottom: 12px; font-size: 1.6rem; letter-spacing: -.03em; }
.chapter img { width: 100%; max-height: 440px; object-fit: cover; margin: 8px 0 18px; border-radius: var(--r); }

/* Tribute form */
.sheet { display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10, 3, 3, .7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .25s ease both; }
.sheet-card { position: relative; width: 100%; max-width: 560px; max-height: 94vh; overflow-y: auto; padding: 26px 20px calc(24px + var(--safe-b)); border: 1px solid var(--line-2); border-bottom: 0; border-radius: 28px 28px 0 0; background: var(--bg-2); animation: slideup .45s var(--ease) both; }
@keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }
.sheet-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; color: var(--text); }
.sheet-title { font-size: 2rem; font-weight: 900; letter-spacing: -.04em; padding-right: 50px; }
.sheet-lead { margin: 6px 0 22px; color: var(--muted); }
.field { display: block; margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.field-label { display: block; margin-bottom: 8px; padding: 0; font-weight: 700; color: var(--text); }
.field input, .field textarea { width: 100%; padding: 15px 18px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg); font: inherit; font-size: 1.08rem; color: var(--text); }
.field textarea { min-height: 160px; resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .2); }
.field-hint { display: block; margin-top: 6px; font-size: .9rem; color: var(--muted); }
.relation-options { display: flex; flex-wrap: wrap; gap: 6px; }
.relation-options label { position: relative; }
.relation-options input { position: absolute; opacity: 0; pointer-events: none; }
.relation-options span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--line-2); border-radius: 999px; font-weight: 700; cursor: pointer; transition: background-color .2s, color .2s; }
.relation-options input:checked + span { background: var(--text); border-color: var(--text); color: var(--bg); }
.relation-options input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { padding: 12px 16px; border-radius: var(--r-sm); background: var(--danger-bg); color: var(--danger); font-weight: 700; }

/* Lightbox */
.lightbox { display: grid; place-items: center; background: rgba(8, 2, 2, .96); animation: fade .25s ease both; }
.lb-figure { margin: 0; max-width: 100%; padding: 70px 12px 24px; touch-action: pan-y; }
.lb-figure img { max-width: 100%; max-height: calc(100vh - 160px); margin: 0 auto; border-radius: var(--r-sm); }
.lb-figure figcaption { margin-top: 12px; text-align: center; color: #D9C8BB; }
.lb-btn { position: absolute; z-index: 2; width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px; background: rgba(255, 255, 255, .08); color: #fff; }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }

/* Toast */
.toast { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h) + var(--dock-h) + var(--safe-b) + 22px); width: max-content; max-width: calc(100% - 32px); padding: 13px 22px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 700; text-align: center; animation: pop .35s var(--ease) both; }

/* ---------- Small phones ---------- */
@media (max-width: 420px) {
  .brand-dates { display: none; }
  .hymn-pill.is-playing .eq { display: none; }
  .dock-tribute { padding: 0 16px; }
  .seg button { padding: 0 13px; }
}

/* ---------- Tablets ---------- */
@media (min-width: 720px) {
  .hero-media { height: min(64vh, 640px); } .hero-copy { padding: 0 40px 56px; }
  .bento { grid-template-columns: repeat(3, 1fr); }
  .tile-date { grid-column: span 2; grid-row: span 2; justify-content: space-between; padding: 30px; }
  .tile-place { grid-column: span 1; }
  .tile-cal { grid-column: span 1; }
  .tile-programme { grid-column: 1 / -1; min-height: 260px; }
  .life { grid-template-columns: 5fr 6fr; gap: 64px; align-items: start; }
  .life-aside { position: sticky; top: calc(var(--top-h) + 32px); }
  .quote-band { padding: 96px 0 56px; }
  .marquee-track button { width: 280px; } .marquee-track button:nth-child(odd) { width: 330px; }
  .marquee-track img { height: 380px; }
  .appreciation-cols { columns: 2; column-gap: 40px; }
  .appreciation-cols p { break-inside: avoid; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .people { grid-template-columns: 1fr 1fr; }
  .share-memory { grid-template-columns: 1fr auto; }
  .filter-bar { grid-template-columns: 1fr 300px; align-items: center; }
  .tribute-grid { grid-template-columns: 1fr 1fr; }
  .gallery { columns: 3; column-gap: 12px; }
  .gallery button { margin-bottom: 12px; }
  .sheet { align-items: center; padding: 16px; }
  .sheet-card { border-radius: 28px; border-bottom: 1px solid var(--line-2); }
  .dock { left: 50%; right: auto; transform: translateX(-50%); width: min(540px, calc(100% - 32px)); }
  .reader-shell { inset: 20px; border-radius: 28px; border: 1px solid var(--line-2); overflow: hidden; }
}

/* ---------- Desktop ---------- */
@media (min-width: 1080px) {
  :root { --top-h: 72px; --tabs-h: 0px; }
  .topbar { padding: 0 32px; }
  .tabs { inset: 0 auto auto 50%; transform: translateX(-50%); height: var(--top-h); display: flex; align-items: center; gap: 4px; padding: 0; background: transparent; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tab { flex-direction: row; gap: 8px; height: 42px; padding: 0 16px; border-radius: 999px; font-size: .98rem; }
  .tab .ph { font-size: 1.15rem; }
  .tab:hover { color: var(--text); }
  .tab[aria-current="page"] { background: rgb(var(--accent-rgb) / .14); }
  .dock { bottom: 22px; }
  main { padding-bottom: 130px; }
  .toast { bottom: 100px; }

  /* split hero: copy left, photo right */
  .hero { grid-template-columns: 1fr 1fr; min-height: calc(100dvh - var(--top-h)); }
  .hero-media { height: auto; }
  .hero-media { position: relative; inset: auto; grid-column: 2; grid-row: 1; margin: 28px 32px 28px 0; border-radius: 28px; overflow: hidden; }
  .hero-media::after { background: linear-gradient(0deg, rgba(12, 5, 5, .3), transparent 30%); }
  .hero-copy { grid-column: 1; grid-row: 1; align-self: center; margin-top: 0; padding: 0 40px 0 max(32px, calc(50vw - 560px)); }
  .hero-name { font-size: clamp(3.8rem, 4.7vw, 5.4rem); }
  .hero-last { white-space: nowrap; }
  .bento { margin-top: 24px; grid-template-columns: repeat(4, 1fr); }
  .tile-date { grid-column: span 2; grid-row: span 2; }
  .tile-place { grid-column: span 2; }
  .tile-cal { grid-column: span 1; }
  .tile-programme { grid-column: span 1; min-height: 0; }
  .tile-programme .tile-t { font-size: 1.2rem; }
  .page-head { padding-top: 64px; }
  .tribute-grid { grid-template-columns: repeat(3, 1fr); }
  .gallery { columns: 4; }
  .lang-cols.is-both { grid-template-columns: 1fr 1fr; gap: 48px; }
  .reader-shell { inset: 28px max(28px, calc(50% - 580px)); }
  .reader-body { max-width: 1000px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .marquee { overflow-x: auto; }
}
