/* ==========================================================================
   Memorial site - misty forest, roses, wolves
   ========================================================================== */

:root {
  --bg: #f4f2ec;
  --bg-2: #e9ece5;
  --card: #ffffff;
  --ink: #1e2b26;
  --ink-soft: #46554f;
  --muted: #71807a;
  --forest: #1f3a2e;
  --forest-2: #2e5040;
  --moss: #5f8a6b;
  --mist: #b9c6c6;
  --rose: #b3213a;
  --rose-bright: #d23c55;
  --rose-soft: #f6dfe3;
  --line: rgba(31, 58, 46, 0.14);
  --line-rose: rgba(179, 33, 58, 0.45);
  --shadow: 0 20px 50px -25px rgba(31, 58, 46, 0.35);
  --btn-bg: #1f3a2e;
  --btn-ink: #ffffff;
  --nav-bg: rgba(244, 242, 236, 0.9);
  --chip-bg: rgba(255, 255, 255, 0.35);
  --hero-gradient: radial-gradient(ellipse 80% 60% at 70% 15%, rgba(255,255,255,0.55), transparent 60%), linear-gradient(180deg, #8ea3ae 0%, #b7c6c9 38%, #dfe5e1 70%, #f4f2ec 100%);
  --hero-base: #dfe5e2;
  --mist-glow: radial-gradient(ellipse 60% 50% at 50% 36%, rgba(244, 242, 236, 0.82), rgba(244, 242, 236, 0.45) 45%, transparent 75%);
  --name-shadow: 0 2px 30px rgba(244, 242, 236, 0.9);
  --portrait-bg: linear-gradient(145deg, #e6ebe6, #c9d4d0);
  --him-bg: linear-gradient(160deg, #ffffff, #f6dfe3);
  --footer-bg: #1f3a2e;
  --input-bg: #f4f2ec;
  --serif: 'Cormorant Garamond', 'Georgia', 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 16px;
  --container: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-weight: 300; line-height: 1.65;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; margin: 0; color: var(--forest); }
p { margin: 0; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--rose); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter); padding-top: max(14px, env(safe-area-inset-top));
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
  color: var(--forest);
}
.hero--photo ~ .nav:not(.is-solid), body.hero-photo .nav:not(.is-solid) { color: #fff; }
.nav.is-solid { background: var(--nav-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--line); color: var(--forest); }
.nav__brand { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; letter-spacing: 0.02em; text-decoration: none; opacity: 0; transition: opacity 0.4s; }
.nav.is-solid .nav__brand { opacity: 1; }
.nav__links { display: flex; align-items: center; gap: clamp(14px, 2.5vw, 28px); }
.nav__links a { text-decoration: none; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 500; padding: 6px 0; position: relative; opacity: 0.85; }
.nav__links a::after { content: ''; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px; background: var(--rose); transition: right 0.3s var(--ease); }
.nav__links a:hover::after, .nav__links a:focus-visible::after { right: 0; }
.nav__share {
  display: inline-flex; align-items: center; gap: 6px; background: var(--chip-bg); border: 1px solid currentColor; border-radius: 999px;
  padding: 6px 14px; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; transition: 0.25s;
}
.nav__share:hover { background: var(--rose); border-color: var(--rose); color: #fff; }
.nav__theme { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid currentColor; background: var(--chip-bg); opacity: 0.85; transition: 0.25s; }
.nav__theme:hover { opacity: 1; background: var(--card); }
.nav__theme .ico-moon { display: none; }
[data-theme="dark"] .nav__theme .ico-moon { display: block; }
[data-theme="dark"] .nav__theme .ico-sun { display: none; }
.nav__toggle { display: none; background: none; border: 0; width: 44px; height: 44px; padding: 10px; flex-direction: column; justify-content: center; gap: 5px; }
.nav__toggle span { display: block; height: 2px; background: currentColor; border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
.nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav__toggle { display: flex; }
  .nav__brand { opacity: 1; }
  .nav__links {
    position: fixed; inset: 0; height: 100dvh; padding: calc(96px + env(safe-area-inset-top)) var(--gutter) 40px; flex-direction: column; align-items: stretch; gap: 6px;
    background: var(--bg); color: var(--forest); transform: translateX(100%); transition: transform 0.35s var(--ease); z-index: 1;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .nav__brand, .nav__toggle { position: relative; z-index: 2; }
  .nav__links a { font-size: 1.1rem; padding: 14px 0; border-bottom: 1px solid var(--line); opacity: 1; }
  .nav__share { margin-top: 20px; align-self: flex-start; padding: 12px 22px; font-size: 0.85rem; }
  .nav__theme { margin-top: 14px; align-self: flex-start; width: 44px; height: 44px; }
  .nav.is-open .nav__links { transform: none; }
  .nav.is-open { background: var(--bg); color: var(--forest); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
  .nav.is-open .nav__brand { opacity: 1; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative; min-height: 100svh; display: grid; place-items: start center; text-align: center; overflow: hidden; isolation: isolate;
  padding: calc(96px + env(safe-area-inset-top)) var(--gutter) clamp(80px, 12vh, 140px);
}
.hero--photo { place-items: center; padding-bottom: clamp(120px, 18vh, 200px); }
.hero__scene {
  position: absolute; inset: 0; z-index: -2; background-color: var(--hero-base);
  background-image: var(--hero-gradient);
  background-size: cover; background-position: center;
}
.hero__scene::after { content: ''; position: absolute; inset: auto 0 0 0; height: 120px; background: linear-gradient(180deg, transparent, var(--bg)); }
.hero__mist {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--mist-glow);
}
.hero__inner { max-width: 780px; display: grid; justify-items: center; gap: 12px; position: relative; }

.portrait {
  --size: clamp(220px, 38vw, 330px);
  --frame: 10px;
  width: var(--size); height: calc(var(--size) * 1.28); border-radius: 50%; position: relative; display: grid; place-items: center;
  margin: 24px 0 34px; padding: var(--frame); box-sizing: border-box;
  background: linear-gradient(160deg, #fbfaf6 0%, #dfe3dc 45%, #f3f1ea 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 24px 60px -18px rgba(31, 58, 46, 0.55), 0 0 0 1px rgba(31, 58, 46, 0.12);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; border-radius: 50%; box-shadow: 0 0 0 1px rgba(31, 58, 46, 0.25) inset; }
/* a soft sheen across the top, like glass in a mirror frame */
.portrait::before { content: ''; position: absolute; inset: var(--frame); border-radius: 50%; pointer-events: none; z-index: 1;
  background: linear-gradient(165deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.05) 30%, transparent 45%); }
.portrait__mono { font-family: var(--serif); font-size: calc(var(--size) * 0.34); font-weight: 600; color: var(--forest); letter-spacing: 0.04em; }
.portrait.has-photo .portrait__mono { display: none; }
.portrait__mono { position: relative; z-index: 0; }
.portrait:not(.has-photo) { background: linear-gradient(160deg, #fbfaf6 0%, #dfe3dc 45%, #f3f1ea 100%); }
.portrait:not(.has-photo)::after { content: ''; position: absolute; inset: var(--frame); border-radius: 50%; background: var(--portrait-bg); z-index: -1; }

.hero__lead { font-size: 0.76rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--rose); font-weight: 600; }
.hero__name { font-size: clamp(2.8rem, 8.5vw, 5.6rem); font-weight: 500; letter-spacing: 0.01em; color: var(--forest); text-shadow: var(--name-shadow); }
.hero__dates {
  font-family: var(--serif); font-size: clamp(1.25rem, 3vw, 1.65rem); font-weight: 500; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center;
}
.hero__dates .dash { display: inline-block; width: 34px; height: 1px; background: var(--rose); }
.hero__age { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-top: -4px; font-weight: 500; }
.hero__since { font-family: var(--serif); font-size: clamp(1rem, 2vw, 1.2rem); color: var(--muted); margin-top: 2px; }
.hero__since strong { font-weight: 600; color: var(--rose); }
.hero--photo .hero__since { color: #c3cdc8; }
.hero--photo .hero__since strong { color: #f3b7c2; }
.hero__epitaph { font-family: var(--serif); font-style: italic; font-size: clamp(1.15rem, 2.4vw, 1.5rem); color: var(--ink-soft); max-width: 34ch; margin-top: 8px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 20px; }
.scroll-cue { margin-top: 26px; width: 26px; height: 42px; border: 1px solid rgba(31, 58, 46, 0.35); border-radius: 14px; display: grid; justify-content: center; padding-top: 8px; text-decoration: none; }
.scroll-cue span { width: 3px; height: 8px; border-radius: 2px; background: var(--rose); animation: cue 2s infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

/* Hero text on the left or right, leaving the photo's subject clear */
.hero--left, .hero--right { place-items: center stretch; }
.hero--left .hero__inner, .hero--right .hero__inner {
  width: auto; max-width: min(var(--container), 64%); margin-inline: max(0px, calc((100% - var(--container)) / 2)) auto; justify-items: start; text-align: left;
  grid-template-columns: auto minmax(0, 520px); column-gap: clamp(24px, 4vw, 56px); align-content: center; row-gap: 10px;
}
.hero--right .hero__inner { margin-inline: auto max(0px, calc((100% - var(--container)) / 2)); grid-template-columns: minmax(0, 520px) auto; justify-items: end; text-align: right; }
.hero--left .hero__name, .hero--right .hero__name { font-size: clamp(2.6rem, 5vw, 4.6rem); }
.hero--left .portrait { grid-column: 1; grid-row: 1 / span 7; align-self: center; margin: 0; }
.hero--right .portrait { grid-column: 2; grid-row: 1 / span 7; align-self: center; margin: 0; }
.hero--left .hero__inner > :not(.portrait):not(.scroll-cue) { grid-column: 2; }
.hero--right .hero__inner > :not(.portrait):not(.scroll-cue) { grid-column: 1; }
.hero--left .scroll-cue, .hero--right .scroll-cue { grid-column: 1 / -1; margin-top: 40px; }
.hero--right .hero__inner > .portrait { order: 1; }
.hero--left .hero__dates, .hero--right .hero__dates { justify-content: flex-start; }
.hero--right .hero__dates { justify-content: flex-end; }
.hero--left .hero__actions { justify-content: flex-start; }
.hero--right .hero__actions { justify-content: flex-end; }
.hero--left .scroll-cue, .hero--right .scroll-cue { justify-self: center; }
.hero--left .hero__mist { background: radial-gradient(ellipse 50% 60% at 22% 45%, rgba(244, 242, 236, 0.85), rgba(244, 242, 236, 0.45) 45%, transparent 75%); }
.hero--right .hero__mist { background: radial-gradient(ellipse 50% 60% at 78% 45%, rgba(244, 242, 236, 0.85), rgba(244, 242, 236, 0.45) 45%, transparent 75%); }
.hero--photo.hero--left .hero__mist { background: radial-gradient(ellipse 55% 70% at 20% 50%, rgba(8, 14, 16, 0.55), rgba(8, 14, 16, 0.25) 50%, transparent 78%); }
.hero--photo.hero--right .hero__mist { background: radial-gradient(ellipse 55% 70% at 80% 50%, rgba(8, 14, 16, 0.55), rgba(8, 14, 16, 0.25) 50%, transparent 78%); }
.hero--photo.hero--left .hero__scene::before { background: linear-gradient(90deg, rgba(8, 14, 16, 0.55), rgba(8, 14, 16, 0.2) 55%, rgba(8, 14, 16, 0.15)), linear-gradient(180deg, rgba(8,14,16,0.2), rgba(8,14,16,0.6)); }
.hero--photo.hero--right .hero__scene::before { background: linear-gradient(270deg, rgba(8, 14, 16, 0.55), rgba(8, 14, 16, 0.2) 55%, rgba(8, 14, 16, 0.15)), linear-gradient(180deg, rgba(8,14,16,0.2), rgba(8,14,16,0.6)); }
@media (max-width: 860px) {
  .hero--left .hero__inner, .hero--right .hero__inner { grid-template-columns: 1fr; justify-items: center; text-align: center; max-width: 100%; margin-inline: auto; }
  .hero--left .hero__name, .hero--right .hero__name { font-size: clamp(2.8rem, 8.5vw, 5.6rem); }
  .hero--left .portrait, .hero--right .portrait { grid-column: 1; grid-row: auto; margin: 24px 0 24px; }
  .hero--left .hero__inner > :not(.portrait):not(.scroll-cue), .hero--right .hero__inner > :not(.portrait):not(.scroll-cue) { grid-column: 1; }
  .hero--left .hero__dates, .hero--right .hero__dates, .hero--left .hero__actions, .hero--right .hero__actions { justify-content: center; }
}

/* Hero with an uploaded photo behind it (e.g. a wolf under the moon) */
.hero--photo .hero__scene { background-size: cover; background-position: center; }
.hero--photo .hero__scene::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12, 22, 26, 0.35), rgba(12, 22, 26, 0.5) 60%, rgba(12, 22, 26, 0.75)); }
.hero--photo .hero__scene::after { background: linear-gradient(180deg, transparent, var(--bg)); height: 90px; }
.hero--photo .hero__mist { background: radial-gradient(ellipse 60% 50% at 50% 40%, rgba(12, 22, 26, 0.35), transparent 75%); }
.hero--photo .hero__name { color: #fff; text-shadow: 0 6px 40px rgba(0, 0, 0, 0.6); }
.hero--photo .hero__dates, .hero--photo .hero__epitaph { color: #e6ebe8; }
.hero--photo .hero__age { color: #c3cdc8; }
.hero--photo .hero__lead { color: #f3b7c2; }
.hero--photo .scroll-cue { border-color: rgba(255,255,255,0.4); }
.hero--photo .portrait { background: linear-gradient(160deg, #ffffff 0%, #d9dfda 45%, #f6f4ee 100%); box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 30px 80px -20px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.35); }
.hero--photo .portrait img { box-shadow: 0 0 0 1px rgba(0,0,0,0.35) inset; }
.hero--photo .btn--outline { border-color: rgba(255,255,255,0.5); color: #fff; }
.hero--photo .btn--outline:hover { border-color: #fff; background: rgba(255,255,255,0.12); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: transparent;
  padding: 12px 22px; border-radius: 999px; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
  transition: 0.25s; text-decoration: none; color: var(--forest);
}
.btn--primary { background: var(--rose); border-color: var(--rose); color: #fff; }
.btn--primary:hover { background: var(--rose-bright); border-color: var(--rose-bright); box-shadow: 0 10px 30px -10px rgba(179, 33, 58, 0.6); }
.btn--ghost { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }
.btn--ghost:hover { background: var(--forest-2); border-color: var(--forest-2); box-shadow: 0 10px 30px -10px rgba(31, 58, 46, 0.6); }
.btn--outline { border-color: rgba(127, 150, 140, 0.5); color: var(--forest); background: var(--chip-bg); }
.btn--outline:hover { border-color: var(--forest); background: var(--card); }
.btn:disabled { opacity: 0.6; cursor: wait; }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section { padding: clamp(64px, 10vw, 110px) 0; position: relative; }
.section:nth-of-type(odd) { background: var(--bg); }
.section:nth-of-type(even) { background: var(--bg-2); }
.section + .section::before {
  content: '\2766'; position: absolute; top: -18px; left: 50%; transform: translateX(-50%); width: 36px; height: 36px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line-rose); color: var(--rose); display: grid; place-items: center; font-size: 1.1rem; z-index: 1;
  box-shadow: 0 6px 20px -8px rgba(31, 58, 46, 0.3);
}
.section__head { text-align: center; max-width: 640px; margin: 0 auto clamp(36px, 6vw, 60px); }
.section__title { font-size: clamp(2.1rem, 5.5vw, 3.2rem); position: relative; display: inline-block; padding-bottom: 16px; }
.section__title::after { content: ''; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 46px; height: 2px; background: var(--rose); }
.story .section__title::after { left: 0; transform: none; }
.section__intro { color: var(--muted); margin-top: 16px; font-size: 1.05rem; }
.prose p { margin: 0 0 1.2em; font-size: 1.08rem; color: var(--ink-soft); }
.prose p:last-child { margin-bottom: 0; }
.prose p:first-child::first-letter { font-family: var(--serif); font-size: 3.2em; line-height: 0.8; float: left; margin: 0.08em 0.12em 0 0; color: var(--rose); font-weight: 600; }
.empty { text-align: center; color: var(--muted); font-style: italic; font-family: var(--serif); font-size: 1.2rem; }

/* Story */
.story__grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.story__text .section__title { margin-bottom: 28px; }
.quote { position: sticky; top: 110px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(28px, 4vw, 44px); box-shadow: var(--shadow); }
.quote::before { content: '\201C'; font-family: var(--serif); font-size: 7rem; line-height: 0.6; color: var(--rose); display: block; margin-bottom: 12px; opacity: 0.8; }
.quote blockquote { margin: 0; }
.quote__text { font-family: var(--serif); font-size: clamp(1.3rem, 2.2vw, 1.55rem); font-style: italic; line-height: 1.45; color: var(--forest); }
.quote__by { display: block; margin-top: 18px; font-style: normal; font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.quote__by:empty { display: none; }
@media (max-width: 860px) { .story__grid { grid-template-columns: 1fr; } .quote { position: static; } }

/* Timeline */
.journey__play { margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.journey__play span { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.timeline { list-style: none; margin: 0 auto; padding: 0; position: relative; max-width: 760px; }
.timeline::before { content: ''; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 1px; background: linear-gradient(180deg, var(--moss), rgba(95, 138, 107, 0.15)); }
.timeline li { position: relative; padding: 0 0 38px 44px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: 6px; top: 8px; width: 11px; height: 11px; border-radius: 50%; background: var(--rose); border: 2px solid var(--card); box-shadow: 0 0 0 5px rgba(179, 33, 58, 0.15); }
.timeline__date { font-size: 0.75rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--rose); font-weight: 600; }
.timeline__title { font-family: var(--serif); font-size: 1.6rem; margin: 4px 0 6px; }
.timeline__text { color: var(--ink-soft); }
.timeline__media { display: flex; flex-wrap: wrap; gap: 12px 8px; margin-top: 18px; padding: 6px 0; }
.thumb {
  position: relative; width: 102px; padding: 6px 6px 20px; border: 0; border-radius: 3px; background: #fbf9f4; cursor: pointer; text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12), 0 10px 22px -12px rgba(31, 58, 46, 0.45); transform: rotate(var(--tilt, 0deg));
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease); font-family: var(--serif); color: #4a4a44;
}
.thumb::after { content: attr(data-cap); position: absolute; left: 6px; right: 6px; bottom: 5px; font-size: 0.68rem; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #6b6a62; }
.thumb img, .thumb video { width: 100%; height: 90px; object-fit: cover; display: block; background: #d9dcd6; }
.thumb:nth-child(3n+1) { --tilt: -2.5deg; } .thumb:nth-child(3n+2) { --tilt: 1.5deg; } .thumb:nth-child(3n) { --tilt: -0.5deg; } .thumb:nth-child(5n) { --tilt: 2.5deg; }
.thumb:hover, .thumb:focus-visible { transform: rotate(0deg) translateY(-4px) scale(1.04); box-shadow: 0 2px 4px rgba(0,0,0,0.15), 0 20px 34px -16px rgba(31, 58, 46, 0.55); z-index: 1; }
.thumb__poster { display: block; width: 100%; height: 90px; background: radial-gradient(circle at 50% 40%, #6f8c85, #2e4a40); }
.thumb__play { position: absolute; left: 6px; right: 6px; top: 6px; height: 90px; display: grid; place-items: center; }
.thumb__play svg { width: 28px; height: 28px; fill: #fff; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5)); }
@media (max-width: 520px) { .thumb { width: 96px; padding: 5px 5px 18px; } .thumb img, .thumb video, .thumb__poster, .thumb__play { height: 84px; } }
.thumb--more { background: var(--btn-bg); color: var(--btn-ink); }
.thumb--more::after { content: none; }
.thumb--more span { display: grid; place-items: center; height: 90px; font-size: 1.7rem; line-height: 1; }
.thumb--more small { position: absolute; left: 0; right: 0; bottom: 6px; font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase; font-family: var(--sans); opacity: 0.85; }
@media (max-width: 520px) { .thumb--more span { height: 84px; } }
.timeline__mediacount { margin-top: 8px; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.thumb__poster { display: block; width: 100%; height: 100%; background: radial-gradient(circle at 50% 40%, #6f8c85, #2e4a40); }
.thumb__play { position: absolute; inset: 0; display: grid; place-items: center; }
.thumb__play svg { width: 28px; height: 28px; fill: #fff; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5)); }
@media (max-width: 520px) { .thumb { width: 72px; height: 72px; } }
@media (min-width: 720px) {
  .timeline::before { left: 50%; }
  .timeline li { width: 50%; padding: 0 0 48px 48px; margin-left: 50%; }
  .timeline li:nth-child(even) { margin-left: 0; padding: 0 48px 48px 0; text-align: right; }
  .timeline li::before { left: -6px; }
  .timeline li:nth-child(even)::before { left: auto; right: -6px; }
  .timeline li:nth-child(even) .timeline__media { justify-content: flex-end; }
}

/* Gallery */
.filters { display: flex; justify-content: center; gap: 8px; margin-bottom: 32px; flex-wrap: wrap; }
.filter { background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 8px 18px; font-size: 0.76rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; color: var(--ink-soft); transition: 0.25s; }
.filter:hover { border-color: var(--forest); color: var(--forest); }
.filter.is-active { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }
.filter--select { appearance: none; -webkit-appearance: none; padding-right: 34px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2371807a' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") right 10px center / 16px no-repeat; color: var(--ink); max-width: 260px; text-overflow: ellipsis; }
.gallery__more { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 28px; flex-wrap: wrap; }
.gallery__count { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; grid-auto-flow: dense; }
.tile {
  position: relative; border: 0; padding: 0; background: var(--mist); border-radius: 12px; overflow: hidden; aspect-ratio: 1; text-align: left; color: inherit;
  isolation: isolate; box-shadow: 0 0 0 1px var(--line); transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.tile--wide { grid-column: span 2; aspect-ratio: 2 / 1; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; } .tile--wide { aspect-ratio: 1; grid-column: span 1; } }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.tile:hover img, .tile:focus-visible img { transform: scale(1.06); }
.tile:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(18, 32, 27, 0.82)); }
.tile__meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 14px; z-index: 1; display: grid; gap: 2px; }
.tile__title { font-family: var(--serif); font-size: 1.15rem; color: #fff; line-height: 1.2; }
.tile__when { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: #f3b7c2; font-weight: 600; }
.tile__play { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; pointer-events: none; }
.tile__play span { width: 54px; height: 54px; border-radius: 50%; background: rgba(179, 33, 58, 0.9); display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0,0,0,0.35); }
.tile__play svg { width: 20px; height: 20px; fill: #fff; margin-left: 3px; }
.tile__poster { width: 100%; height: 100%; background: radial-gradient(circle at 50% 40%, #6f8c85, #2e4a40); }

/* Share dialog */
.share { position: fixed; inset: 0; z-index: 90; background: rgba(18, 32, 27, 0.6); backdrop-filter: blur(4px); display: grid; place-items: center; padding: var(--gutter); animation: fade 0.25s var(--ease); }
.share__card { position: relative; width: min(100%, 480px); background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: clamp(24px, 5vw, 36px); box-shadow: 0 40px 100px -30px rgba(0,0,0,0.5); }
.share__close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: transparent; font-size: 1.6rem; line-height: 1; color: var(--forest); }
.share__close:hover { background: var(--rose); border-color: var(--rose); color: #fff; }
.share__title { font-size: 2rem; }
.share__sub { color: var(--muted); margin: 6px 0 20px; }
.share__link { display: flex; gap: 8px; margin-bottom: 18px; }
.share__link input { flex: 1; min-width: 0; font: inherit; font-size: 0.9rem; color: var(--ink-soft); background: var(--input-bg); border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; }
.share__link .btn { padding-inline: 18px; }
.share__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.share__opt { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--input-bg); color: var(--ink-soft); text-decoration: none; font-size: 0.85rem; font-weight: 500; transition: 0.2s; }
.share__opt:hover { border-color: var(--forest); color: var(--forest); background: var(--card); }
.share__opt svg { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(14, 24, 20, 0.96); display: grid; place-items: center; padding: 60px var(--gutter) 24px; animation: fade 0.25s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.lightbox__figure { margin: 0; width: min(100%, 1100px); display: grid; gap: 14px; justify-items: center; }
.lightbox__media { width: 100%; display: grid; place-items: center; }
.lightbox__media img, .lightbox__media video { max-height: calc(100svh - 170px); max-width: 100%; width: auto; border-radius: 8px; box-shadow: 0 40px 100px -30px rgba(0,0,0,0.9); }
.lightbox__media iframe, .lightbox__media video.is-embed { width: 100%; aspect-ratio: 16 / 9; max-height: calc(100svh - 170px); border: 0; border-radius: 8px; background: #000; }
.lightbox__caption { text-align: center; color: #d7ded9; display: grid; gap: 4px; max-width: 70ch; }
.lightbox__caption .when { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: #f3b7c2; font-weight: 600; }
.lightbox__caption .title { font-family: var(--serif); font-size: 1.4rem; color: #fff; }
.lightbox__caption .cap { font-size: 0.95rem; }
.lightbox__count { position: absolute; top: max(24px, calc(env(safe-area-inset-top) + 10px)); left: 50%; transform: translateX(-50%); color: #c9d3ce; font-size: 0.78rem; letter-spacing: 0.18em; }
.lightbox__close, .lightbox__nav { position: absolute; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); color: #fff; border-radius: 50%; width: 46px; height: 46px; font-size: 1.8rem; line-height: 1; display: grid; place-items: center; transition: 0.2s; }
.lightbox__close:hover, .lightbox__nav:hover { background: var(--rose); border-color: var(--rose); }
.lightbox__close { top: max(14px, env(safe-area-inset-top)); right: 16px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }
@media (max-width: 640px) {
  .lightbox { padding: 64px 8px 16px; }
  .lightbox__nav { top: auto; bottom: 14px; transform: none; width: 44px; height: 44px; }
  .lightbox__nav--prev { left: 14px; } .lightbox__nav--next { right: 14px; }
  .lightbox__caption { padding: 0 60px 44px; }
}
body.no-scroll { overflow: hidden; }

/* Playlist theater */
.theater { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 18px; background: #0b1214; border-radius: 20px; padding: 14px; box-shadow: 0 40px 90px -40px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.05); color: #e9eeea; }
.theater__screen { display: grid; gap: 10px; align-content: start; }
.theater__frame { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; box-shadow: 0 20px 50px -20px rgba(0,0,0,0.9); }
.theater__frame iframe, .theater__frame > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.theater__now { min-height: 1.4em; font-family: var(--serif); font-size: 1.15rem; color: #fff; padding: 0 4px; display: flex; align-items: center; gap: 10px; }
.theater__now .eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.theater__now .eq i { width: 3px; background: var(--rose-bright); animation: eq 0.9s ease-in-out infinite; border-radius: 1px; }
.theater__now .eq i:nth-child(2) { animation-delay: 0.2s; } .theater__now .eq i:nth-child(3) { animation-delay: 0.4s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }
.theater__side { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px; min-height: 0; }
.theater__tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.theater .btn--outline { border-color: rgba(255,255,255,0.3); color: #fff; background: rgba(255,255,255,0.06); }
.theater .btn--outline:hover { background: rgba(255,255,255,0.14); border-color: #fff; }
.theater__count { margin-left: auto; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: #8a9a93; }
.rail { list-style: none; margin: 0; padding: 0 4px 0 0; overflow-y: auto; max-height: clamp(320px, 52vh, 560px); display: grid; gap: 6px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.2) transparent; }
.rail__item { display: grid; grid-template-columns: 24px 112px 1fr; gap: 10px; align-items: center; padding: 6px; border-radius: 10px; border: 0; background: transparent; color: inherit; text-align: left; width: 100%; transition: background 0.2s; }
.rail__item:hover { background: rgba(255,255,255,0.06); }
.rail__item.is-now { background: rgba(214, 75, 98, 0.16); box-shadow: inset 3px 0 0 var(--rose-bright); }
.rail__n { font-size: 0.72rem; color: #8a9a93; text-align: center; font-variant-numeric: tabular-nums; }
.rail__thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #1a2529; }
.rail__thumb img { width: 100%; height: 100%; object-fit: cover; }
.rail__dur { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,0.8); color: #fff; font-size: 0.65rem; padding: 1px 5px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.rail__title { font-size: 0.9rem; line-height: 1.3; color: #e9eeea; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rail__by { font-size: 0.72rem; color: #8a9a93; margin-top: 2px; }
.rail__empty { color: #8a9a93; font-size: 0.9rem; padding: 10px 6px; line-height: 1.5; }
.rail__item--ext { text-decoration: none; opacity: 0.85; }
.rail__item--ext:hover { opacity: 1; }
.rail__by b { font-weight: 500; color: var(--rose-bright); }
.theater__note { font-size: 0.75rem; color: #8a9a93; margin: 0; padding: 0 4px; line-height: 1.4; }
.theater__poster { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; background: #000; cursor: pointer; display: grid; place-items: center; overflow: hidden; }
.theater__poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.75; transition: transform 0.6s var(--ease), opacity 0.3s; }
.theater__poster:hover img { transform: scale(1.04); opacity: 0.9; }
.theater__poster-play { position: relative; width: 84px; height: 84px; border-radius: 50%; background: var(--rose); display: grid; place-items: center; box-shadow: 0 20px 50px -10px rgba(0,0,0,0.8), 0 0 0 10px rgba(255,255,255,0.12); transition: transform 0.25s; }
.theater__poster:hover .theater__poster-play { transform: scale(1.08); }
.theater__poster-play svg { width: 36px; height: 36px; fill: #fff; margin-left: 4px; }
.theater__poster-text { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #fff; font-family: var(--serif); font-size: 1.2rem; text-shadow: 0 2px 12px rgba(0,0,0,0.8); }
.theater__blocked { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding: 20px; color: #c9d3ce; font-family: var(--serif); font-size: 1.2rem; }
.theater__open { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: #a7b3ad; text-decoration: none; }
.theater__open:hover { color: var(--rose-bright); }
@media (max-width: 860px) { .theater { grid-template-columns: 1fr; } .rail { max-height: 380px; } }
@media (max-width: 520px) { .rail__item { grid-template-columns: 20px 96px 1fr; } }

/* Family tree */
.tree-scroll { overflow-x: auto; padding: 8px var(--gutter) 24px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--moss) transparent; display: flex; }
.tree { position: relative; display: grid; gap: 76px; padding: 10px 12px; min-width: max-content; margin-inline: auto; }
.tree__lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.tree__lines path { fill: none; stroke: var(--moss); stroke-width: 1.5; }
.tree__row { display: flex; justify-content: center; align-items: flex-start; gap: 36px; position: relative; }
.tree__row--extra { padding-top: 28px; border-top: 1px dashed var(--line); }
.unit { display: flex; align-items: stretch; }
.unit .heart { align-self: center; width: 28px; display: grid; place-items: center; color: var(--rose); position: relative; font-size: 0.85rem; }
.unit .heart::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--moss); z-index: -1; }
.person { width: 168px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 14px 14px; text-align: center; position: relative; box-shadow: 0 10px 30px -20px rgba(31, 58, 46, 0.4); transition: border-color 0.3s, transform 0.3s var(--ease); }
.person:hover { border-color: var(--moss); transform: translateY(-2px); }
.person__avatar { width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center; background: var(--bg-2); color: var(--forest); font-family: var(--serif); font-weight: 600; font-size: 1.1rem; border: 1px solid var(--line); }
.person__name { font-family: var(--serif); font-size: 1.15rem; color: var(--forest); line-height: 1.15; }
.person__rel { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 6px; font-weight: 600; }
.person__years { font-size: 0.8rem; color: var(--ink-soft); margin-top: 4px; font-family: var(--serif); }
.person__note { font-size: 0.76rem; color: var(--muted); margin-top: 6px; font-style: italic; }
.person.is-him { border-color: var(--rose); background: var(--him-bg); box-shadow: 0 0 0 1px var(--rose), 0 20px 50px -20px rgba(179, 33, 58, 0.45); }
.person.is-him .person__avatar { background: var(--rose); color: #fff; border-color: var(--rose-bright); }
.person.is-him::after { content: '\2665'; position: absolute; top: -10px; right: -8px; width: 22px; height: 22px; border-radius: 50%; background: var(--rose); color: #fff; font-size: 0.7rem; display: grid; place-items: center; box-shadow: 0 4px 10px rgba(0,0,0,0.25); }
.person--group { width: 250px; }
.person--md { width: 190px; padding: 20px 16px 16px; }
.person--md .person__name { font-size: 1.3rem; }
.person--md .person__avatar { width: 52px; height: 52px; font-size: 1.25rem; }
.person--lg { width: 210px; padding: 24px 16px 18px; border-color: rgba(95, 138, 107, 0.5); }
.person--lg .person__name { font-size: 1.45rem; }
.person--lg .person__avatar { width: 60px; height: 60px; font-size: 1.4rem; background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }
.person--xl { width: 260px; padding: 30px 20px 24px; }
.person--xl .person__name { font-size: 1.8rem; }
.person--xl .person__avatar { width: 76px; height: 76px; font-size: 1.8rem; margin-bottom: 14px; }
.person--xl .person__rel { font-size: 0.74rem; }
.person--xl .person__years { font-size: 0.95rem; }
.person--xl .person__note { font-size: 0.85rem; }
.person__members { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); text-align: left; font-family: var(--serif); font-size: 0.98rem; color: var(--ink); line-height: 1.5; }
.person__members.is-cols { columns: 2; column-gap: 14px; }
.person__members li { break-inside: avoid; padding-left: 12px; position: relative; }
.person__members li::before { content: ''; position: absolute; left: 0; top: 0.65em; width: 5px; height: 5px; border-radius: 50%; background: var(--rose); }
@media (max-width: 520px) { .person { width: 140px; padding: 12px 10px; } .person--group { width: 220px; } .person--md { width: 156px; } .person--lg { width: 170px; } .person--xl { width: 210px; padding: 22px 14px 18px; } .tree__row { gap: 20px; } .tree { gap: 64px; } }
.tree-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px; margin: 4px auto 10px; font-size: 0.78rem; color: var(--muted); }
.tree-legend__item { display: inline-flex; align-items: center; gap: 7px; }
.tree-legend__item i { display: inline-block; width: 22px; height: 3px; border-radius: 2px; }
/* hover lineage highlight (toggle in the admin) */
.tree--hoverable .person { cursor: default; }
.tree.is-hover .person:not(.is-lit) { opacity: 0.28; }
.tree.is-hover .unit .heart { opacity: 0.28; }
.tree.is-hover .tree__lines path { opacity: 0.18; }
.tree.is-hover .tree__lines path.is-lit { opacity: 1; stroke: var(--rose); stroke-width: 2.5; }
.person, .tree__lines path, .unit .heart { transition: opacity 0.25s, border-color 0.25s, stroke 0.25s, stroke-width 0.25s; }
.tree .person.is-lit, [data-theme] .tree .person.is-lit, .tree .person.is-lit:hover { border-color: var(--rose); box-shadow: 0 0 0 1px var(--rose), 0 14px 34px -18px rgba(179, 33, 58, 0.5); }
.tree-hint { text-align: center; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; display: none; margin-top: 4px; }
.tree-hint.is-visible { display: block; }

/* Service */
.service__card {
  max-width: 760px; margin: 0 auto; text-align: center; padding: clamp(32px, 6vw, 60px); border: 1px solid var(--line-rose); border-radius: var(--radius);
  background: radial-gradient(ellipse 80% 100% at 50% 0%, rgba(179, 33, 58, 0.08), transparent 70%), var(--card); box-shadow: var(--shadow);
}
.service__card .section__title { margin-bottom: 20px; }
.service__card .prose p::first-letter { all: unset; }
.service__card .prose p { white-space: pre-line; }
.service__actions { margin-top: 26px; }

/* Memories */
.memory-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 760px; margin: 0 auto 48px; padding: clamp(20px, 4vw, 32px); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.field { display: grid; gap: 6px; }
.field--wide { grid-column: 1 / -1; }
.field span { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.field input, .field textarea { font: inherit; color: var(--ink); background: var(--input-bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; width: 100%; resize: vertical; transition: border-color 0.2s, box-shadow 0.2s; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--moss); box-shadow: 0 0 0 3px rgba(95, 138, 107, 0.2); }
.field input::placeholder, .field textarea::placeholder { color: #9aa6a1; }
.hp { position: absolute; left: -9999px; }
.memory-form__actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.memory-form__note { color: var(--muted); font-size: 0.9rem; }
.memory-form__note.is-ok { color: var(--moss); }
.memory-form__note.is-err { color: var(--rose); }
@media (max-width: 560px) { .memory-form { grid-template-columns: 1fr; } }
.memory-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; max-width: 1000px; margin: 0 auto; }
.memory { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; position: relative; border-top: 3px solid var(--rose); box-shadow: 0 10px 30px -20px rgba(31, 58, 46, 0.3); }
.memory__text { color: var(--ink-soft); white-space: pre-line; font-size: 1rem; }
.memory__by { margin-top: 16px; font-family: var(--serif); font-size: 1.1rem; color: var(--forest); }
.memory__date { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }

/* Footer */
.footer { padding: 70px 0 calc(40px + env(safe-area-inset-bottom)); text-align: center; background: var(--footer-bg); color: #d8e2dc; position: relative; }
.footer::before { content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 6px; background: linear-gradient(90deg, var(--rose), var(--moss), var(--rose)); }
.footer__heart { color: var(--moss); margin-bottom: 14px; display: grid; place-items: center; }
.footer__heart svg { width: 60px; height: 60px; }
.footer__name { font-family: var(--serif); font-size: 1.6rem; color: #fff; }
.footer__years { color: #a7b8ae; font-size: 1.1rem; margin-left: 8px; }
.footer__text { color: #a7b8ae; margin-top: 8px; max-width: 50ch; margin-inline: auto; }
.footer__share { margin-top: 26px; }
.footer .btn--outline { border-color: rgba(255,255,255,0.35); color: #fff; background: transparent; }
.footer .btn--outline:hover { background: var(--rose); border-color: var(--rose); }
.footer__admin { margin-top: 28px; font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; }
.footer__admin a { color: #7f9a8b; text-decoration: none; }
.footer__admin a:hover { color: #fff; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue span { animation: none; }
  * { transition-duration: 0.01ms !important; }
}

/* --------------------------------------------------------------------------
   Dark theme: a still night in the forest. Chosen with the toggle in the top
   bar, or automatically from the visitor's system setting.
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
  --bg: #0f1719;
  --bg-2: #131d20;
  --card: #1a2529;
  --ink: #e9eeea;
  --ink-soft: #bcc8c2;
  --muted: #8a9a93;
  --forest: #e3ece6;
  --forest-2: #9dc1aa;
  --moss: #7fae8c;
  --mist: #2a3a3f;
  --rose: #d64b62;
  --rose-bright: #e8657a;
  --rose-soft: #3a1f26;
  --line: rgba(233, 238, 234, 0.12);
  --line-rose: rgba(214, 75, 98, 0.5);
  --shadow: 0 20px 50px -25px rgba(0, 0, 0, 0.7);
  --btn-bg: #2e5040;
  --btn-ink: #ffffff;
  --nav-bg: rgba(15, 23, 25, 0.88);
  --chip-bg: rgba(255, 255, 255, 0.06);
  --hero-gradient: radial-gradient(ellipse 60% 50% at 72% 18%, rgba(190, 210, 220, 0.22), transparent 60%), linear-gradient(180deg, #1c2b33 0%, #16232a 40%, #101a1d 75%, #0f1719 100%);
  --hero-base: #16232a;
  --mist-glow: radial-gradient(ellipse 60% 50% at 50% 36%, rgba(15, 23, 25, 0.55), rgba(15, 23, 25, 0.3) 45%, transparent 75%);
  --name-shadow: 0 4px 40px rgba(0, 0, 0, 0.7);
  --portrait-bg: linear-gradient(145deg, #2a3a3f, #1a2529);
  --him-bg: linear-gradient(160deg, #2a1c21, #3a1f26);
  --footer-bg: #0a1113;
  --input-bg: #0f1719;
  color-scheme: dark;
}
[data-theme="dark"] .hero__glow { display: none; }
[data-theme="dark"] .tile::after { background: linear-gradient(180deg, transparent 50%, rgba(5, 10, 12, 0.85)); }
[data-theme="dark"] .quote__text, [data-theme="dark"] .memory__by, [data-theme="dark"] .person__name, [data-theme="dark"] .timeline__title { color: #f2f6f3; }
[data-theme="dark"] .person--lg { border-color: rgba(127, 174, 140, 0.45); }
[data-theme="dark"] .person.is-him .person__avatar { background: var(--rose); }
[data-theme="dark"] .hero--photo .hero__scene::before { background: linear-gradient(180deg, rgba(8, 14, 16, 0.4), rgba(8, 14, 16, 0.55) 60%, rgba(8, 14, 16, 0.85)); }
[data-theme="dark"] .footer::before { background: linear-gradient(90deg, var(--rose), var(--moss), var(--rose)); }

/* --------------------------------------------------------------------------
   /share-memory page
   -------------------------------------------------------------------------- */
.sharepage { background: var(--bg); }
.sharepage__main { width: min(100% - 2 * var(--gutter), 760px); margin: 0 auto; padding: 24px 0 80px; }
.sharepage__back { display: inline-block; text-decoration: none; color: var(--muted); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 30px; }
.sharepage__back:hover { color: var(--rose); }
.sharepage__head { text-align: center; display: grid; justify-items: center; gap: 10px; margin-bottom: 36px; }
.sharepage__portrait { --size: 150px; margin: 0 0 14px; }
.sharepage__portrait .portrait__mono { font-size: 2.2rem; }
.sharepage__title { font-size: clamp(2.2rem, 6vw, 3.4rem); }
.sharepage__intro { color: var(--ink-soft); font-size: 1.08rem; max-width: 56ch; }
.sharepage__form { margin-bottom: 0; }
.dropzone-box { display: block; border: 2px dashed rgba(95, 138, 107, 0.6); border-radius: 12px; padding: 22px 16px; text-align: center; color: var(--ink-soft); cursor: pointer; background: var(--input-bg); transition: 0.2s; font-size: 0.95rem; }
.dropzone-box strong { color: var(--forest); }
.sharepage__dropzone.is-over .dropzone-box { background: rgba(95, 138, 107, 0.15); border-color: var(--forest); }
.filelist { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.filechip { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 0.8rem; color: var(--ink); max-width: 100%; }
.filechip em { color: var(--muted); font-style: normal; }
.filechip button { border: 0; background: var(--bg-2); color: var(--ink); width: 22px; height: 22px; border-radius: 50%; line-height: 1; }
.filechip button:hover { background: var(--rose); color: #fff; }
.sharepage__note { grid-column: 1 / -1; font-size: 0.88rem; color: var(--muted); }
.sharepage__progress { grid-column: 1 / -1; height: 6px; background: var(--bg-2); border-radius: 3px; overflow: hidden; }
.sharepage__progress span { display: block; height: 100%; width: 0; background: var(--rose); transition: width 0.2s; }
.sharepage__thanks { text-align: center; padding: 40px 20px; background: var(--card); border: 1px solid var(--line-rose); border-radius: var(--radius); box-shadow: var(--shadow); }
.sharepage__heart { color: var(--rose); font-size: 2rem; margin-bottom: 6px; }
.sharepage__thanks h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 18px; }
.sharepage__thanks p { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.memories__sharelink { text-align: center; margin: -24px auto 40px; color: var(--muted); }
.memories__sharelink a { color: var(--rose); font-weight: 500; }
.share__memlink { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
.share__memlink a { color: var(--rose); font-weight: 500; }
