/* Lights of Remembrance — The Parmenter Foundation
   Black ground, gold and cream type. Brand blue marks labels and focus;
   brand green marks growth and gifts. */

:root {
  --bg: #050608;
  --surface: #0b0d11;
  --ink: #faf1cf;
  --ink-soft: rgba(227, 224, 207, 0.82);
  --muted: rgba(227, 224, 207, 0.62);
  --gold: #dec79b;
  --gold-rgb: 222, 199, 155;
  --stone: #e3e0cf;
  --blue: #7db4da;
  --green: #b0d040;
  --accent: var(--gold);
  --line: rgba(var(--gold-rgb), 0.22);
  --line-strong: rgba(var(--gold-rgb), 0.55);
  --serif: "Cormorant Garamond", Palatino, "Palatino Linotype", serif;
  --sans: "Open Sans", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* A faint warmth from above, like a room lit by candles elsewhere. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 75% 46% at 50% -8%, rgba(var(--gold-rgb), 0.1), rgba(var(--gold-rgb), 0) 72%),
    radial-gradient(ellipse 60% 40% at 50% 112%, rgba(125, 180, 218, 0.05), rgba(125, 180, 218, 0) 70%);
  pointer-events: none;
}

::selection { background: rgba(var(--gold-rgb), 0.85); color: #0a0805; }

body:has(dialog[open]) { overflow: hidden; }

button, input, textarea, select { font: inherit; color: inherit; }

button { cursor: pointer; }

a { color: inherit; text-decoration: none; }

img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4, p, figure, blockquote { margin: 0; }

h1, h2, h3, h4, legend {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.04;
  color: var(--ink);
}

h1, h2 { text-shadow: 0 0 44px rgba(var(--gold-rgb), 0.28); }

h1 em, h2 em { font-style: italic; color: var(--gold); font-weight: 500; }

p { color: var(--ink-soft); }

p a, .text-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(var(--gold-rgb), 0.6);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.2s, color 0.2s;
}

p a:hover, .text-link:hover { text-decoration-color: var(--gold); color: #fff; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 100;
  background: var(--gold);
  color: #0a0805;
  padding: 10px 14px;
}

.skip-link:focus { top: 12px; }

.kicker {
  margin-bottom: 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--blue);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 28px;
  background: var(--gold);
  color: #0a0805;
  border: 1px solid var(--gold);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: background 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.35s;
}

.button:hover {
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 0 36px rgba(var(--gold-rgb), 0.35);
}

.button-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.button-ghost:hover {
  background: rgba(var(--gold-rgb), 0.1);
  border-color: var(--gold);
  box-shadow: none;
}

/* The permanent gold double frame. Its gutter is solid so nothing shows around it. */
.site-frame {
  --frame-gap: 5px;
  position: fixed;
  z-index: 40;
  inset: 10px;
  border: 1px solid rgba(var(--gold-rgb), 0.85);
  box-shadow: 0 0 0 24px var(--bg);
  pointer-events: none;
}

.site-frame::before {
  content: "";
  position: absolute;
  inset: var(--frame-gap);
  border: 1px solid rgba(var(--gold-rgb), 0.38);
  box-shadow: 0 0 0 var(--frame-gap) var(--bg);
}

.site-frame::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 7px;
  height: 7px;
  translate: -50% 0;
  rotate: 45deg;
  background: var(--bg);
  border: 1px solid var(--gold);
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 30px;
  left: 36px;
}

.site-header { transition: opacity 0.4s ease, visibility 0.4s; }

.site-header.is-tucked { opacity: 0; visibility: hidden; }

.site-header::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -34px -64px -44px -48px;
  background: radial-gradient(closest-side, rgba(5, 6, 8, 0.94) 52%, rgba(5, 6, 8, 0));
  pointer-events: none;
}

.brand { display: block; width: fit-content; }

.brand img { width: auto; height: 148px; }

.dock {
  position: fixed;
  z-index: 30;
  right: max(40px, env(safe-area-inset-right));
  bottom: max(40px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 0 34px;
  border-radius: 999px;
  background: var(--gold);
  color: #0a0805;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 0 0 5px rgba(5, 6, 8, 0.92), 0 0 0 6px rgba(var(--gold-rgb), 0.55), 0 12px 44px rgba(var(--gold-rgb), 0.28);
  transition: background 0.25s, opacity 0.35s ease, translate 0.35s ease, visibility 0.35s;
}

.dock:hover { background: var(--ink); }

.dock:focus-visible { outline-offset: 10px; }

.dock.is-tucked {
  opacity: 0;
  visibility: hidden;
  translate: 0 24px;
}

/* A candle: wax column, wick, and a soft teardrop flame. */
.vigil {
  --delay: 0s;
  --dur: 3.2s;
  --wax-1: #cfc6b0;
  --wax-2: #faf1cf;
  --wax-3: #e3e0cf;
  --wax-4: #c9c2ae;
  --wax-top: #dec79b;
  --halo: 250, 241, 207;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 72px;
  height: 108px;
  pointer-events: none;
}

.vigil-flame {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 28px;
  margin-bottom: -2px;
  border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%;
  background:
    radial-gradient(ellipse 40% 28% at 50% 72%, #fff 0%, rgba(255, 248, 220, 0) 72%),
    linear-gradient(to top, #2f62d6 0% 7%, #fff4c8 18%, #ffd56a 46%, #ff8a2a 74%, rgba(255, 70, 16, 0.15) 100%);
  box-shadow: 0 0 10px 2px rgba(255, 150, 50, 0.35);
  transform-origin: 50% 100%;
  animation: flicker calc(var(--dur) * 0.42) ease-in-out infinite;
  animation-delay: var(--delay);
}

.vigil-flame::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 42%;
  width: 70px;
  height: 70px;
  translate: -50% -50%;
  background: radial-gradient(closest-side, rgba(var(--halo), 0.55), rgba(255, 140, 40, 0.16) 46%, rgba(var(--halo), 0) 72%);
  animation: glow calc(var(--dur) * 0.55) ease-in-out infinite;
  animation-delay: var(--delay);
}

.vigil-flame::after {
  content: "";
  position: absolute;
  left: 30%;
  right: 30%;
  bottom: 16%;
  height: 58%;
  border-radius: 50% 50% 46% 46% / 64% 64% 36% 36%;
  background: linear-gradient(to top, #fff 0%, #ffe7a2 42%, rgba(255, 176, 48, 0) 100%);
  filter: blur(0.3px);
  transform-origin: 50% 100%;
  animation: tongue calc(var(--dur) * 0.28) ease-in-out infinite;
  animation-delay: var(--delay);
}

.vigil-wax {
  position: relative;
  z-index: 2;
  width: 18px;
  height: 44px;
  border-radius: 2px 2px 3px 3px;
  background: linear-gradient(90deg, var(--wax-1) 0%, var(--wax-2) 36%, var(--wax-3) 70%, var(--wax-4) 100%);
}

.vigil-wax::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 100%;
  height: 7px;
  translate: -50% -42%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 35%, var(--wax-2), var(--wax-top) 80%);
}

.vigil-wax::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 1.5px;
  height: 11px;
  translate: -50% -100%;
  border-radius: 1px;
  background: #1a140c;
}

.tint-chip {
  --wax-1: #cfc6b0;
  --wax-2: #faf1cf;
  --wax-3: #e3e0cf;
  --wax-4: #c9c2ae;
  --halo: 250, 241, 207;
}

/* Each tint keeps a wax highlight, with a hue strong enough to read on a small candle. */
.tint-honey { --wax-1: #c4923a; --wax-2: #ffe6a6; --wax-3: #e2b15a; --wax-4: #a87528; --wax-top: #d9a44a; --halo: 245, 196, 90; }
.tint-rose { --wax-1: #c45b6e; --wax-2: #ffd0d4; --wax-3: #e48b98; --wax-4: #a34456; --wax-top: #d46b7c; --halo: 245, 160, 170; }
.tint-blue { --wax-1: #4f74aa; --wax-2: #d4e4f8; --wax-3: #7ea4d4; --wax-4: #3d5e90; --wax-top: #5d86c0; --halo: 150, 190, 245; }
.tint-lavender { --wax-1: #7d5eaa; --wax-2: #ead8ff; --wax-3: #b48ad4; --wax-4: #624890; --wax-top: #9470c4; --halo: 196, 160, 245; }
.tint-sage { --wax-1: #5e8a52; --wax-2: #dff3cc; --wax-3: #8fb87a; --wax-4: #467040; --wax-top: #6e9a60; --halo: 176, 214, 150; }

.tint-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin: 4px 0 10px;
}

.memorial-form .tint-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
}

.tint-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.tint-chip {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, var(--wax-2), var(--wax-3) 55%, var(--wax-4));
  box-shadow: 0 0 0 1px rgba(var(--gold-rgb), 0.3);
  transition: box-shadow 0.25s ease;
}

.tint-name {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.tint-option:hover .tint-chip { box-shadow: 0 0 0 1px rgba(var(--gold-rgb), 0.9); }

.tint-option input:checked + .tint-chip {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--gold), 0 0 18px 3px rgba(var(--halo), 0.5);
}

.tint-option input:checked ~ .tint-name { color: var(--ink); }

.tint-option input:focus-visible + .tint-chip { outline: 2px solid var(--blue); outline-offset: 6px; }

.vigil-md { width: 92px; height: 142px; }
.vigil-md .vigil-flame { width: 22px; height: 38px; margin-bottom: -3px; }
.vigil-md .vigil-flame::before { width: 76px; height: 76px; }
.vigil-md .vigil-flame::after { left: 5px; right: 5px; height: 17px; }
.vigil-md .vigil-wax { width: 26px; height: 58px; }
.vigil-md .vigil-wax::before { width: 100%; height: 9px; }
.vigil-md .vigil-wax::after { height: 13px; }

.vigil-lg { width: 120px; height: 196px; }
.vigil-lg .vigil-flame { width: 30px; height: 52px; margin-bottom: -4px; }
.vigil-lg .vigil-flame::before { width: 104px; height: 104px; }
.vigil-lg .vigil-flame::after { left: 7px; right: 7px; height: 22px; }
.vigil-lg .vigil-wax { width: 36px; height: 82px; }
.vigil-lg .vigil-wax::before { width: 100%; height: 11px; }
.vigil-lg .vigil-wax::after { height: 16px; width: 2px; }

/* The wall */
.wall {
  --wall-pad: max(36px, 3vw);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 104px var(--wall-pad) 112px;
  overflow-x: clip;
}

.wall-head {
  position: relative;
  isolation: isolate;
  display: grid;
  justify-items: stretch;
  gap: 28px;
  margin: 0 calc(-1 * var(--wall-pad)) 96px;
  padding: 28px var(--wall-pad) 40px;
  background: var(--bg);
}

.wall-head > :not(.hero-photo) { position: relative; z-index: 1; }

.hero-stage {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  row-gap: clamp(16px, 2.4vw, 28px);
  width: 100%;
}

.hero-stage > #wall-title {
  max-width: 18ch;
  margin: 0;
  text-align: center;
}

.hero-stage > .wall-opening,
.hero-stage > .wall-fundraiser {
  width: min(100%, 56rem);
  max-width: none;
  margin: 0;
  text-align: center;
  white-space: nowrap;
}

.hero-stage > .wall-opening {
  max-width: none;
  font-size: clamp(28px, 3.4vw, 44px);
}

.hero-stage > .wall-fundraiser {
  margin-top: -6px;
}

.hero-body {
  display: grid;
  grid-template-columns: minmax(0, 34rem) minmax(240px, 28rem);
  align-items: center;
  justify-content: center;
  column-gap: clamp(16px, 2.5vw, 36px);
  width: min(100%, 72rem);
}

.hero-copy {
  display: grid;
  justify-items: start;
  gap: 0;
  max-width: none;
  padding-left: 0;
}

.hero-stage > .wall-actions {
  justify-content: center;
  margin-top: 4px;
}

.hero-photo {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
  pointer-events: none;
}

.hero-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.08;
  object-fit: cover;
  object-position: center;
  -webkit-mask-image: radial-gradient(ellipse 90% 78% at center, #000 42%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 78% at center, #000 42%, transparent 78%);
}

.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, var(--bg) 0%, transparent 12%, transparent 88%, var(--bg) 100%),
    linear-gradient(to bottom, var(--bg) 0%, transparent 16%, transparent 78%, var(--bg) 100%);
  pointer-events: none;
}

.wall-head h1 {
  font-size: clamp(48px, 6.4vw, 88px);
  font-style: italic;
  letter-spacing: 0.005em;
  text-align: center;
  text-wrap: balance;
}

.wall-opening {
  font-size: clamp(30px, 3.8vw, 46px);
  text-align: center;
  text-wrap: balance;
}

.wall-fundraiser {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1.7;
  text-align: center;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--gold);
}

.wall-copy {
  display: grid;
  gap: 16px;
  max-width: none;
  text-align: left;
}

.wall-copy p {
  font-size: 17px;
  line-height: 1.75;
  color: #fff;
  text-wrap: pretty;
}

.wall-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 8px;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  width: min(580px, 100%);
  height: 64px;
  margin: 28px auto 0;
  padding: 0 20px 0 24px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(var(--gold-rgb), 0.04);
  transition: border-color 0.25s, box-shadow 0.35s, background 0.25s;
}

.search-field::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(var(--gold-rgb), 0.14);
  border-radius: inherit;
  pointer-events: none;
}

.search-field:hover { border-color: var(--gold); }

.search-field:focus-within {
  border-color: var(--gold);
  background: rgba(var(--gold-rgb), 0.08);
  box-shadow: 0 0 44px rgba(var(--gold-rgb), 0.18);
}

.search-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.4;
  stroke-linecap: round;
}

.wall .search-field input[type="search"] {
  flex: 1;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-style: italic;
  font-size: 25px;
  -webkit-appearance: none;
  appearance: none;
}

.wall .search-field input[type="search"]:focus { outline: none; }

.search-field input::placeholder { color: var(--muted); }

.search-field input::-webkit-search-cancel-button,
.search-field input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.search-kbd {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}

.search-field:focus-within .search-kbd,
.search-field.has-value .search-kbd { display: none; }

.search-clear {
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.search-clear:hover { color: var(--ink); }

.search-clear:focus-visible { outline-offset: 2px; }

@media (hover: none) {
  .search-kbd { display: none; }
}

.sort-field {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: -6px auto 0;
}

.sort-field label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.sort-select {
  position: relative;
  display: flex;
  align-items: center;
}

.sort-select select {
  min-width: 210px;
  min-height: 40px;
  padding: 0 34px 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(var(--gold-rgb), 0.04);
  color: var(--ink);
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s, background 0.2s;
}

.sort-select select:hover { border-color: var(--gold); }

.sort-select select:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.sort-select option {
  background: #0b0d11;
  color: var(--ink);
  font-family: var(--sans);
  font-style: normal;
}

.sort-select svg {
  position: absolute;
  right: 14px;
  width: 12px;
  height: 12px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

/* Eight tracks, two per card: it lets a short last row sit in the centre of the wall. */
.memorial-grid {
  position: relative;
  isolation: isolate;
  width: min(1120px, 100%);
  margin: 28px auto 0;
  scroll-margin-top: 28px;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  --row-space: 28px;
  gap: 42px 8px;
  align-content: start;
  align-items: start;
  justify-items: center;
  padding: 48px 28px 36px;
}

.memorial-grid::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background: #07080b;
  box-shadow: inset 0 0 0 1px rgba(var(--gold-rgb), 0.08);
  pointer-events: none;
}

.memorial {
  position: relative;
  z-index: 1;
  display: grid;
  grid-column: span 2;
  grid-row: span 4;
  grid-template-rows: subgrid;
  row-gap: 0;
  justify-items: center;
  align-content: start;
  width: 100%;
  max-width: 220px;
  padding: 0 0 var(--row-space);
  border: 0;
  background: transparent;
  text-align: center;
  color: inherit;
}

@supports not (grid-template-rows: subgrid) {
  .memorial { display: flex; flex-direction: column; align-items: center; }
}

.memorial:hover,
.memorial:focus-visible { z-index: 2; }

.memorial:focus-visible { outline: none; }

.memorial.rise {
  animation: rise 0.9s both;
  animation-delay: calc(var(--i) * 60ms);
}

.niche {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 188px);
  padding: 22px 16px 14px;
  border-radius: 999px 999px 18px 18px;
  background: #050608;
  box-shadow:
    inset 0 18px 26px rgba(0, 0, 0, 0.85),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* closest-side keeps the fade at zero before its box edge, so no seam shows. */
.niche::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 50%;
  width: 420px;
  height: 420px;
  translate: -50% -50%;
  background: radial-gradient(closest-side, rgba(var(--gold-rgb), 0.2), rgba(var(--gold-rgb), 0.07) 55%, rgba(var(--gold-rgb), 0));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

/* A plain oval in a fine gold ring. No mask, no fade. */
.portrait-wrap {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  border: 1px solid rgba(var(--gold-rgb), 0.5);
  border-radius: 50%;
  transition: border-color 0.5s ease, box-shadow 0.6s ease;
}

.portrait-wrap img {
  position: absolute;
  inset: 6px;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  border-radius: 50%;
  object-fit: cover;
  object-position: center 22%;
  filter: brightness(0.86) saturate(0.92);
  transition: filter 0.6s ease;
}

.portrait-fallback {
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 44px;
  color: var(--gold);
}

.memorial:hover .portrait-wrap,
.memorial:focus-visible .portrait-wrap {
  border-color: rgba(var(--gold-rgb), 0.8);
  box-shadow: 0 0 28px 2px rgba(var(--gold-rgb), 0.16);
}

.memorial:hover img,
.memorial:focus-visible img { filter: brightness(1.04) saturate(1); }

.memorial:hover .niche::after,
.memorial:focus-visible .niche::after { opacity: 1; }

.memorial:focus-visible .portrait-wrap { outline: 2px solid var(--blue); outline-offset: 6px; }

/* Tiers: the more candles a person has, the smaller and more burned-down each one is. */
.memorial-candle {
  --cw: 44px;
  --fw: 11px;
  --fh: 20px;
  --ww: 13px;
  --wh: 28px;
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  align-content: flex-end;
  justify-content: center;
  row-gap: 1px;
  width: 100%;
  height: 58px;
  margin-top: 12px;
}

.memorial-candle .vigil-flame {
  width: var(--fw);
  height: var(--fh);
  margin-bottom: calc(var(--fh) * -0.06);
}

.memorial-candle.tier-2 { --cw: 26px; --fw: 10px; --fh: 17px; --ww: 11px; --wh: 25px; }
.memorial-candle.tier-3 { --cw: 15px; --fw: 7px; --fh: 12px; --ww: 8px; --wh: 19px; }

.memorial-candle .vigil { width: var(--cw); height: auto; }

.memorial-candle .vigil-flame::before {
  width: calc(var(--fh) * 2.2);
  height: calc(var(--fh) * 2.2);
}

.memorial-candle .vigil-flame::after {
  left: 27%;
  right: 27%;
  bottom: 14%;
  height: 56%;
}

.memorial-candle .vigil-wax {
  width: var(--ww);
  height: calc(var(--wh) * (1 - var(--melt, 0) * 0.6));
}

.memorial-candle .vigil-wax::before { width: 100%; height: calc(var(--ww) * 0.34); }
.memorial-candle .vigil-wax::after { height: calc(var(--fh) * 0.48); }

.memorial:hover .memorial-candle .vigil-flame::before,
.memorial:focus-visible .memorial-candle .vigil-flame::before {
  width: calc(var(--fh) * 3.1);
  height: calc(var(--fh) * 3.1);
}

.vigil.melted .vigil-wax {
  background:
    linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.2)),
    linear-gradient(90deg, var(--wax-1) 0%, var(--wax-2) 38%, var(--wax-3) 70%, var(--wax-4) 100%);
}

.vigil.melted .vigil-wax::before {
  width: 100%;
  border-radius: 46% 54% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(ellipse at 50% 30%, var(--wax-2), var(--wax-top) 85%);
}

.vigil-drip {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.vigil-drip::before,
.vigil-drip::after {
  content: "";
  position: absolute;
  top: 0;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, var(--wax-3), var(--wax-2));
}

.vigil-drip::before {
  left: -1.5px;
  width: 34%;
  height: calc(28% + var(--melt) * 40%);
}

.vigil-drip::after {
  right: -1px;
  width: 26%;
  height: calc(14% + var(--melt) * 24%);
}

.memorial-candle .vigil.melted::after {
  content: "";
  position: relative;
  z-index: 3;
  width: calc(var(--ww) * 1.9);
  height: calc(var(--ww) * 0.5);
  margin-top: calc(var(--ww) * -0.28);
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--wax-2) 55%, rgba(var(--halo), 0));
}

.vigil.just-lit .vigil-flame { animation: kindle 1.1s ease-out, flicker calc(var(--dur) * 0.42) ease-in-out 1.1s infinite; }
.vigil.just-lit .vigil-flame::before { animation: flare 1.4s ease-out, glow calc(var(--dur) * 0.55) ease-in-out 1.1s infinite; }

.memorial h3 {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  font-size: clamp(26px, 2.1vw, 31px);
  font-weight: 600;
  line-height: 1.06;
  text-wrap: balance;
  align-self: end;
  transition: text-shadow 0.45s ease;
}

.memorial h3::after {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  margin: 10px auto 0;
  background: rgba(var(--gold-rgb), 0.55);
}

.memorial .years {
  position: relative;
  z-index: 1;
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.14em;
  color: rgba(var(--gold-rgb), 0.72);
}

.memorial:hover h3,
.memorial:focus-visible h3 { text-shadow: 0 0 28px rgba(var(--gold-rgb), 0.55); }

.no-results {
  padding: 64px 0;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 28px;
  color: var(--ink);
}

.wall-count {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Share their light */
.share-section {
  width: min(760px, 100%);
  margin: 56px auto 0;
  text-align: center;
}

.share-section::before {
  content: "";
  display: block;
  width: 1px;
  height: 72px;
  margin: 0 auto 56px;
  background: linear-gradient(rgba(var(--gold-rgb), 0), var(--gold));
}

.share-section h2 { font-size: clamp(36px, 4.6vw, 56px); font-style: italic; }

.share-lede {
  max-width: 50ch;
  margin: 18px auto 0;
  font-size: 17px;
  line-height: 1.7;
}

.share-block { margin-top: 36px; }

.share-field {
  display: grid;
  justify-items: center;
  gap: 4px;
  max-width: 440px;
  margin: 0 auto;
}

.share-field label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.share-field input {
  width: 100%;
  margin: 0;
  padding: 10px 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-style: italic;
  font-size: 30px;
  text-align: center;
  transition: border-color 0.25s;
}

.share-field input::placeholder { color: var(--muted); }

.share-field input:focus { outline: none; border-bottom-color: var(--gold); }

.caption-tabs {
  display: inline-flex;
  margin-top: 30px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.caption-tabs label { position: relative; margin: 0; cursor: pointer; }

.caption-tabs input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.caption-tabs span {
  display: block;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: background 0.25s, color 0.25s;
}

.caption-tabs input:checked + span { background: var(--gold); color: #0a0805; }

.caption-tabs input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 3px; }

.caption-preview {
  position: relative;
  margin: 22px auto 0;
  padding: 26px clamp(22px, 5vw, 44px);
  border: 1px solid var(--line);
  background: linear-gradient(rgba(var(--gold-rgb), 0.045), rgba(var(--gold-rgb), 0.015));
  text-align: left;
  font-family: var(--serif);
  font-size: clamp(19px, 2.4vw, 22px);
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-line;
  text-wrap: pretty;
}

.caption-preview::before {
  content: "";
  position: absolute;
  left: -1px;
  top: -1px;
  bottom: -1px;
  width: 2px;
  background: linear-gradient(var(--blue), var(--green));
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 0.25s, border-color 0.25s, color 0.25s, box-shadow 0.35s;
}

.share-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.share-btn:hover {
  background: rgba(var(--gold-rgb), 0.12);
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(var(--gold-rgb), 0.18);
}

.share-btn-primary { background: var(--gold); border-color: var(--gold); color: #0a0805; }

.share-btn-primary:hover { background: var(--ink); border-color: var(--ink); }

.share-note {
  max-width: 52ch;
  margin: 18px auto 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.share-block.is-compact { margin-top: 22px; }
.share-block.is-compact .share-buttons { margin-top: 0; gap: 8px; }
.share-block.is-compact .share-btn { min-height: 42px; padding: 0 16px; }

.share-heading {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 14px;
}

.form-section,
.site-footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 1200px;
}

.site-footer {
  content-visibility: visible;
  contain-intrinsic-size: auto 420px;
}

/* Light a candle */
.form-section {
  padding: 120px 0;
  border-top: 1px solid var(--line);
}

.form-intro {
  display: grid;
  justify-items: center;
  width: min(680px, calc(100% - 48px));
  margin: 0 auto 56px;
  text-align: center;
}

.strike {
  width: min(220px, 72%);
  margin: -28px auto 36px;
}

.hero-body > .hero-strike {
  width: min(100%, 440px);
  margin: 0;
  justify-self: center;
  align-self: center;
  pointer-events: none;
}

.hero-strike .strike-svg {
  width: 100%;
  max-width: 440px;
}

.strike-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.strike-wax { fill: #f4ead4; }
.strike-pool { fill: #fff8ea; }
.strike-wick { stroke: #1c140c; stroke-width: 1.25; stroke-linecap: round; }
.strike-glow { fill: rgba(255, 196, 90, 0.28); }
.strike-flame { fill: #ffd56a; }
.strike-stick { stroke: #cbb892; stroke-width: 2; stroke-linecap: round; }
.strike-head { fill: #2c241c; }
.strike-match-fire ellipse { fill: rgba(255, 186, 70, 0.35); }
.strike-match-fire path { fill: #ffe08a; }

.strike-fire {
  transform-box: view-box;
  transform-origin: 120px 112px;
  animation: strike-light 8.5s ease-in-out infinite;
}

.strike-flame {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: strike-flicker 1.6s ease-in-out infinite;
}

.strike-match {
  transform-box: view-box;
  transform-origin: 0 0;
  animation: strike-carry 8.5s cubic-bezier(0.45, 0.05, 0.2, 1) infinite;
}

.strike-match-fire {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: strike-match-flame 8.5s linear infinite;
}

@keyframes strike-carry {
  0%, 10% { transform: translate(198px, 86px) rotate(-16deg); opacity: 0; }
  16% { opacity: 1; }
  34%, 46% { transform: translate(120px, 104px) rotate(-6deg); opacity: 1; }
  64% { transform: translate(196px, 78px) rotate(-18deg); opacity: 0; }
  100% { transform: translate(198px, 86px) rotate(-16deg); opacity: 0; }
}

@keyframes strike-match-flame {
  0%, 14% { opacity: 0; }
  18%, 56% { opacity: 1; }
  64%, 100% { opacity: 0; }
}

@keyframes strike-light {
  0%, 32% { opacity: 0; transform: scale(0.15, 0.2); }
  42% { opacity: 1; transform: scale(1.06, 1.12); }
  50%, 84% { opacity: 1; transform: scale(1); }
  94%, 100% { opacity: 0; transform: scale(0.9, 0.85); }
}

@keyframes strike-flicker {
  0%, 100% { transform: scale(1, 1) rotate(0deg); }
  40% { transform: scale(0.96, 1.06) rotate(-2deg); }
  70% { transform: scale(1.03, 0.96) rotate(2deg); }
}

.form-intro h2 { font-size: clamp(52px, 7vw, 84px); }

.form-intro > p:not(.kicker) {
  max-width: 42ch;
  margin-top: 18px;
  font-size: 17px;
  line-height: 1.7;
}

.form-panel {
  position: relative;
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 10px;
  border: 1px solid rgba(var(--gold-rgb), 0.7);
  background: rgba(255, 255, 255, 0.012);
}

.form-panel::before,
.form-panel::after,
.plaque::before,
.plaque::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 7px;
  height: 7px;
  translate: -50% 0;
  rotate: 45deg;
  background: var(--bg);
  border: 1px solid var(--gold);
}

.form-panel::before { top: -4px; }
.form-panel::after { bottom: -4px; }

.form-panel > form {
  padding: 56px clamp(22px, 6vw, 64px) 44px;
  border: 1px solid rgba(var(--gold-rgb), 0.3);
  background: radial-gradient(closest-side, rgba(var(--gold-rgb), 0.07), rgba(var(--gold-rgb), 0)) 50% 0 / 100% 40% no-repeat;
}

.memorial-form fieldset {
  border: 0;
  margin: 0 0 36px;
  padding: 0;
  min-width: 0;
}

.form-panel fieldset + fieldset {
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.memorial-form legend {
  margin-bottom: 18px;
  padding: 0;
  font-size: 32px;
}

.memorial-form legend span {
  margin-right: 10px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--gold);
}

.form-panel legend {
  float: left;
  width: 100%;
  margin-bottom: 26px;
  font-size: 34px;
  line-height: 1.15;
}

.form-panel legend + * { clear: both; }

.form-panel legend span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-right: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  letter-spacing: 0.04em;
  vertical-align: 0.3em;
}

.form-panel .submit-button { min-height: 58px; font-size: 14px; }

.memorial-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--ink-soft);
}

.memorial-form abbr { text-decoration: none; color: var(--gold); }

.optional { color: var(--muted); }

input:where(:not([type="radio"], [type="file"], [type="checkbox"])),
textarea {
  display: block;
  width: 100%;
  margin-bottom: 16px;
  padding: 12px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  color: var(--ink);
  font-size: 16px;
  transition: border-color 0.25s;
}

textarea { min-height: 120px; resize: vertical; line-height: 1.6; }

input::placeholder, textarea::placeholder { color: rgba(227, 224, 207, 0.4); }

input:where(:not([type="radio"], [type="checkbox"])):focus,
textarea:focus {
  outline: none;
  border-bottom-color: var(--gold);
}

input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 60px #0b0d11 inset;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.upload-area {
  display: flex !important;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  margin-bottom: 8px;
  padding: 12px 0 !important;
  border-bottom: 1px solid var(--line-strong);
  cursor: pointer;
}

.upload-area svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.2;
  flex-shrink: 0;
}

.upload-area strong { font-weight: 600; font-size: 15px; color: var(--ink); }

.upload-area small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }

.upload-area img { width: 48px; height: 56px; object-fit: cover; border-radius: 50%; }

.field-error { color: #f0b9a8; font-size: 14px; margin: 0 0 8px; }

.field-error:empty { display: none; }

.field-hint {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

/* Gift a candle */
.gift-toggle { margin-bottom: 4px; }

.memorial-form .switch {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 0;
  cursor: pointer;
  color: var(--ink);
}

.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.switch-ui {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 26px;
  margin-top: 1px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: background 0.3s, border-color 0.3s;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  transition: translate 0.3s ease, background 0.3s;
}

.switch input:checked + .switch-ui { background: rgba(176, 208, 64, 0.16); border-color: var(--green); }

.switch input:checked + .switch-ui::after { translate: 22px 0; background: var(--green); }

.switch input:focus-visible + .switch-ui { outline: 2px solid var(--blue); outline-offset: 4px; }

.switch-text { display: grid; gap: 2px; font-size: 16px; font-weight: 600; }

.switch-text small { font-size: 13px; font-weight: 400; color: var(--muted); }

.memorial-form .name-on-wall { margin-top: 8px; margin-bottom: 20px; }

.gift-fields {
  margin-top: 26px;
  padding-left: 22px;
  border-left: 1px solid rgba(176, 208, 64, 0.6);
}

.gift-fields .field-hint { margin-top: -4px; }

/* Foundation */
.foundation {
  width: min(880px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 120px;
  scroll-margin-top: 36px;
}

.foundation::before {
  content: "";
  display: block;
  width: 1px;
  height: 88px;
  margin: 0 auto 64px;
  background: linear-gradient(rgba(var(--gold-rgb), 0), var(--gold));
}

.foundation-head { text-align: center; }

.foundation-head h2 a {
  display: block;
  text-align: center;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(var(--gold-rgb), 0.55);
  text-underline-offset: 0.12em;
  text-decoration-thickness: 1px;
}

.programs h4 a,
.footer-promise a,
.foundation-stats a,
.foundation-head > p a,
.wall-copy a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

.programs h4 a,
.footer-promise a {
  color: inherit;
  text-decoration-color: rgba(var(--gold-rgb), 0.55);
}

.foundation-head h2 a:hover,
.programs h4 a:hover,
.footer-promise a:hover,
.foundation-stats a:hover,
.foundation-head > p a:hover { color: var(--gold); text-decoration-color: var(--gold); }

.foundation-stats a,
.foundation-head > p a {
  color: inherit;
  text-decoration-color: rgba(var(--gold-rgb), 0.55);
}

.wall-copy a {
  color: #fff;
  text-decoration-color: rgba(255, 255, 255, 0.7);
}

.wall-copy a:hover { color: var(--gold); text-decoration-color: var(--gold); }

.foundation-head h2 { font-size: clamp(44px, 6vw, 72px); }

.foundation-head > p:not(.kicker) {
  max-width: 58ch;
  margin: 26px auto 0;
  font-size: 17px;
  line-height: 1.75;
}

.foundation-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 64px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.foundation-stats li {
  padding: 34px 24px;
  text-align: center;
}

.foundation-stats li + li { border-left: 1px solid var(--line); }

.foundation-stats strong {
  display: block;
  font-family: var(--serif);
  font-size: clamp(40px, 5vw, 58px);
  font-weight: 500;
  line-height: 1;
  color: var(--gold);
}

.foundation-stats li:nth-child(2) strong { color: var(--green); }
.foundation-stats li:nth-child(3) strong { color: var(--blue); }

.foundation-stats span {
  display: block;
  max-width: 24ch;
  margin: 12px auto 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.foundation-sub {
  margin-top: 88px;
  font-size: clamp(32px, 4vw, 42px);
  font-style: italic;
  text-align: center;
}

.programs {
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.programs li {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 32px;
  align-items: baseline;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.programs h4 {
  font-size: 27px;
  font-weight: 600;
  line-height: 1.15;
}

.programs p { font-size: 16px; line-height: 1.65; }

.foundation-actions {
  display: grid;
  justify-items: center;
  gap: 20px;
  margin-top: 60px;
  text-align: center;
}

.foundation-actions address {
  font-style: normal;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.foundation-actions address a:hover { color: var(--ink); }

.gift-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 8px 0 16px;
}

.gift-options label { margin: 0; position: relative; }

.gift-options input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.gift-options label > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 56px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 16px;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.gift-options label:hover > span { border-color: var(--gold); }

.gift-options small {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.gift-options input:checked + span {
  background: var(--gold);
  border-color: var(--gold);
  color: #0a0805;
}

.gift-options input:checked + span small { color: #0a0805; }

.gift-options input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 3px; }

.gift-options.gift-options-3 { grid-template-columns: repeat(3, 1fr); }

.gift-options.gift-options-4 { grid-template-columns: repeat(4, 1fr); }

.prototype-note { font-size: 14px; line-height: 1.5; color: var(--muted); }

.prototype-note { margin-top: 12px; text-align: center; }

.submit-button { width: 100%; margin-top: 8px; }

/* Footer */
.site-footer {
  position: relative;
  isolation: isolate;
  width: min(1100px, calc(100% - 64px));
  margin: 0 auto;
  padding-top: 28px;
}

.footer-photo {
  position: absolute;
  z-index: 0;
  left: 50%;
  bottom: 0;
  width: 100vw;
  height: 100%;
  transform: translateX(-50%);
  overflow: hidden;
  background: var(--bg);
  pointer-events: none;
}

.footer-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 62%;
  opacity: 0.38;
}

.footer-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, var(--bg) 0%, rgba(5, 6, 8, 0.55) 34%, transparent 68%);
}

.footer-top,
.footer-bottom { position: relative; z-index: 1; }

.footer-top {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 40px;
  padding: 44px 0 36px;
  border-top: 1px solid var(--line);
}

.footer-top .brand img { height: 132px; }

.footer-top p { margin-top: 18px; font-size: 15px; max-width: 34ch; }

.footer-promise {
  font-family: var(--serif);
  font-style: italic;
  font-size: 28px !important;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink) !important;
  margin-top: 0 !important;
  max-width: 20ch !important;
}

.footer-top nav { display: flex; flex-direction: column; gap: 10px; font-size: 15px; }

.footer-top nav a { color: var(--ink-soft); transition: color 0.2s; }

.footer-top nav a:hover { color: var(--gold); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 18px 0 32px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Dialogs */
dialog {
  width: min(860px, calc(100vw - 32px));
  max-height: min(90svh, 760px);
  padding: 0;
  border: 1px solid rgba(var(--gold-rgb), 0.6);
  background: var(--surface);
  color: var(--ink-soft);
  overflow: auto;
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.8), 0 0 80px rgba(var(--gold-rgb), 0.08);
  overscroll-behavior: contain;
}

dialog::backdrop {
  background: rgba(2, 3, 4, 0.82);
  backdrop-filter: blur(6px);
}

dialog[open] { animation: rise 0.35s ease-out; }

.dialog-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.dialog-close:hover { color: var(--ink); }

.modal-years {
  margin-top: 10px;
  letter-spacing: 0.18em;
  font-size: 13px;
  color: var(--gold);
}

.modal-candles {
  justify-content: flex-start;
  width: auto;
  max-width: 260px;
  height: auto;
  min-height: 64px;
  margin-top: 22px;
}

.plaque-dialog {
  width: min(600px, calc(100vw - 24px));
  max-height: 94svh;
  padding: 10px;
  border-color: rgba(var(--gold-rgb), 0.75);
}

.plaque {
  position: relative;
  padding: 56px clamp(24px, 6vw, 52px) 32px;
  border: 1px solid rgba(var(--gold-rgb), 0.3);
  text-align: center;
  background: radial-gradient(closest-side, rgba(var(--gold-rgb), 0.1), rgba(var(--gold-rgb), 0)) 50% 0 / 100% 56% no-repeat;
}

.plaque::before { top: -4px; }
.plaque::after { bottom: -4px; }

.plaque-kicker {
  margin-bottom: 28px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--blue);
}

.plaque-portrait {
  position: relative;
  width: min(168px, 46%);
  aspect-ratio: 3 / 4;
  margin: 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  box-shadow: 0 0 70px rgba(var(--gold-rgb), 0.16);
}

.plaque-portrait img {
  position: absolute;
  inset: 7px;
  width: calc(100% - 14px);
  height: calc(100% - 14px);
  border-radius: 50%;
  object-fit: cover;
  object-position: center 22%;
}

.plaque-portrait.portrait-fallback { font-size: 64px; }

.plaque-name {
  margin-top: 32px;
  font-size: clamp(34px, 7vw, 46px);
  font-weight: 600;
  text-wrap: balance;
}

.plaque-years {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--gold);
}

.plaque-years::before,
.plaque-years::after {
  content: "";
  width: 36px;
  height: 1px;
  background: var(--line-strong);
}

.plaque-dot {
  width: 5px;
  height: 5px;
  rotate: 45deg;
  background: var(--gold);
}

.plaque-tribute {
  display: grid;
  gap: 14px;
  max-width: 36ch;
  margin: 28px auto 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.42;
  color: var(--ink);
  text-wrap: pretty;
}

.plaque-tribute p { color: inherit; }

.plaque-tribute.is-long {
  max-width: 46ch;
  font-size: 19px;
  line-height: 1.6;
  text-align: left;
  hyphens: auto;
}

.plaque-rule {
  width: 140px;
  height: 1px;
  margin: 32px auto 0;
  background: linear-gradient(90deg, rgba(var(--gold-rgb), 0), var(--gold), rgba(var(--gold-rgb), 0));
}

.plaque .modal-candles {
  justify-content: center;
  max-width: 300px;
  margin: 20px auto 0;
}

.plaque-count {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.plaque-lit-by {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 20px;
  font-style: italic;
  line-height: 1.35;
  color: var(--ink-soft);
}

.plaque-actions {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-top: 26px;
}

.plaque-actions .button { min-width: min(300px, 100%); }

.plaque-foot {
  margin-top: 30px;
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}

.candle-dialog {
  width: min(600px, calc(100vw - 32px));
  max-height: min(92svh, 900px);
  padding: 30px 40px 36px;
}

.flow-steps {
  display: flex;
  gap: 22px;
  margin: 0 64px 28px 0;
  padding: 0;
  list-style: none;
  counter-reset: flow;
}

.flow-steps li {
  counter-increment: flow;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.flow-steps li::before { content: counter(flow, decimal-leading-zero); }

.flow-steps li[aria-current="step"],
.flow-steps li[aria-current="step"]::before { color: var(--gold); }

.flow-head {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: end;
  gap: 18px;
  padding-bottom: 24px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.flow-preview {
  display: grid;
  justify-items: center;
  align-items: end;
  height: 92px;
}

.flow-head .kicker { margin-bottom: 6px; }

.flow-head h2 { font-size: clamp(32px, 5vw, 44px); line-height: 1.05; }

.candle-dialog[data-step="lit"] .flow-head { grid-template-columns: 1fr; }
.candle-dialog[data-step="lit"] .flow-preview { display: none; }

.candle-dialog .memorial-form fieldset { margin-bottom: 22px; }

.candle-dialog textarea { min-height: 84px; }

.flow-panel h3 {
  font-size: 30px;
  font-weight: 600;
}

.flow-panel h3:focus { outline: none; }

.checkout-note { margin-top: 8px; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }

.checkout-summary { margin: 22px 0 0; }

.checkout-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.checkout-summary dt { color: var(--muted); }

.checkout-summary dd { margin: 0; text-align: right; color: var(--ink); overflow-wrap: anywhere; }

.checkout-summary .checkout-total { border-bottom: 0; padding-top: 16px; }

.checkout-total dt,
.checkout-total dd {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--gold);
}

.checkout-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 20px;
  margin-top: 10px;
  padding: 16px 18px;
  border: 1px dashed var(--line-strong);
  font-size: 14px;
  color: var(--muted);
}

.checkout-card span:nth-child(even) { text-align: right; letter-spacing: 0.12em; }

.flow-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 26px;
}

.flow-actions .button { flex: 1; max-width: 340px; }

.flow-actions .button:disabled { opacity: 0.7; cursor: progress; }

.text-button {
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.text-button:hover { color: var(--ink); }

.flow-lit { text-align: center; }

.flow-lit .modal-candles {
  justify-content: center;
  max-width: 300px;
  margin: 0 auto 22px;
}

.flow-lit p:not(.checkout-note, .share-heading) {
  margin-top: 10px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--ink);
}

.flow-lit .button { margin-top: 26px; }

.mock-dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 40px 34px 34px;
  text-align: center;
}

#mock-candle { display: grid; justify-content: center; margin-bottom: 8px; }

.mock-dialog h2 { font-size: 46px; }

.mock-dialog > p:not(.kicker) { margin-top: 12px; }

.mock-detail { font-size: 15px !important; margin-bottom: 22px; }

.toast {
  position: fixed;
  inset: auto auto 28px 50%;
  margin: 0;
  width: max-content;
  translate: -50% 12px;
  max-width: calc(100% - 32px);
  padding: 13px 22px;
  border: 0;
  overflow: visible;
  background: var(--ink);
  color: #0a0805;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, translate 0.25s;
}

.toast.show { opacity: 1; translate: -50% 0; }

@keyframes sway {
  from { transform: translate3d(-1px, 1px, 0) rotate(-5deg) scale(0.92, 1.06); }
  to { transform: translate3d(1.5px, -1px, 0) rotate(6deg) scale(1.08, 0.9); }
}

@keyframes flicker {
  0% { transform: translate3d(0, 0, 0) rotate(-1deg) scale(1, 1); }
  10% { transform: translate3d(-0.6px, 0.4px, 0) rotate(-7deg) scale(0.94, 1.1); }
  18% { transform: translate3d(0.7px, -0.5px, 0) rotate(5deg) scale(1.06, 0.9); }
  27% { transform: translate3d(-0.2px, 0.6px, 0) rotate(-2deg) scale(0.82, 1.18); }
  36% { transform: translate3d(0.4px, -0.7px, 0) rotate(3deg) scale(1.08, 0.94); }
  48% { transform: translate3d(-0.8px, 0.2px, 0) rotate(-8deg) scale(0.9, 1.12); }
  60% { transform: translate3d(0.2px, 0, 0) rotate(1deg) scale(1, 1); }
  72% { transform: translate3d(0.9px, -0.4px, 0) rotate(7deg) scale(1.1, 0.86); }
  84% { transform: translate3d(-0.4px, 0.7px, 0) rotate(-4deg) scale(0.78, 1.2); }
  100% { transform: translate3d(0, 0, 0) rotate(-1deg) scale(1, 1); }
}

@keyframes tongue {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1, 1); opacity: 0.95; }
  30% { transform: translate3d(-0.6px, 1px, 0) scale(0.86, 1.16); opacity: 1; }
  55% { transform: translate3d(0.7px, -0.4px, 0) scale(1.08, 0.82); opacity: 0.75; }
  78% { transform: translate3d(-0.3px, 0.8px, 0) scale(0.8, 1.22); opacity: 0.9; }
}

@keyframes glow {
  0%, 100% { opacity: 0.45; scale: 0.9; }
  28% { opacity: 0.95; scale: 1.16; }
  52% { opacity: 0.22; scale: 0.74; }
  74% { opacity: 0.72; scale: 1.05; }
}

@keyframes kindle {
  from { transform: scale(0.2, 0.1); opacity: 0; }
  60% { transform: scale(1.15, 1.25); opacity: 1; }
  to { transform: scale(1, 1); }
}

@keyframes flare {
  from { scale: 2.4; opacity: 1; }
  to { scale: 1; }
}

@keyframes rise {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Short final rows sit in the middle of the wall, however many columns there are. */
@media (min-width: 1101px) {
  .memorial:nth-child(4n + 1):nth-last-child(3) { grid-column: 2 / span 2; }
  .memorial:nth-child(4n + 1):nth-last-child(2) { grid-column: 3 / span 2; }
  .memorial:nth-child(4n + 1):nth-last-child(1) { grid-column: 4 / span 2; }
}

@media (max-width: 1100px) {
  .brand img { height: 118px; }
  .hero-stage > .wall-opening,
  .hero-stage > .wall-fundraiser {
    white-space: normal;
    text-wrap: balance;
  }
  .hero-body {
    grid-template-columns: 1fr;
    row-gap: 12px;
    width: min(100%, 42rem);
  }
  .hero-body > .hero-strike {
    width: min(360px, 88%);
  }
}

@media (max-width: 900px) {
  .hero-body > .hero-strike {
    width: min(300px, 78%);
  }
}

@media (min-width: 681px) and (max-width: 1100px) {
  .memorial-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); --row-space: 52px; column-gap: 28px; }
  .niche { width: min(100%, 210px); }
  .memorial:nth-child(3n + 1):nth-last-child(2) { grid-column: 2 / span 2; }
  .memorial:nth-child(3n + 1):nth-last-child(1) { grid-column: 3 / span 2; }
}

@media (max-width: 800px) {
  .footer-top { grid-template-columns: 1fr; }
  .site-footer { width: calc(100% - 72px); }
  .programs li { grid-template-columns: 1fr; gap: 6px; }
  .footer-promise { font-size: 24px !important; }
  .footer-top nav { align-items: flex-start; }
}

@media (max-width: 680px) {
  .site-frame { display: none; }
  .hero-copy { justify-items: center; }
  .wall-copy { text-align: center; }
  .site-header { top: 20px; left: 20px; }
  .site-header::before { inset: -24px -44px -30px -32px; }
  .brand img { height: 92px; }
  .footer-top .brand img { height: 104px; }
  .dock {
    right: max(22px, env(safe-area-inset-right));
    bottom: max(22px, env(safe-area-inset-bottom));
    min-height: 50px;
    padding: 0 26px;
  }
  .wall { --wall-pad: 22px; padding: 140px var(--wall-pad) 96px; }
  .site-footer { width: calc(100% - 56px); }
  .wall-head h1 { font-size: clamp(38px, 11vw, 48px); line-height: 1.05; }
  .wall-head { gap: 20px; margin-bottom: 64px; }
  .wall-opening { font-size: 32px; }
  .wall-copy p { font-size: 16.5px; }
  .wall-actions { width: 100%; flex-direction: column; }
  .wall-actions .button { width: 100%; }
  .hero-body > .hero-strike {
    width: min(260px, 72%);
  }
  .search-field { height: 56px; padding: 0 16px 0 18px; }
  .search-icon { width: 19px; height: 19px; }
  .wall .search-field input[type="search"] { padding: 0 10px; font-size: 21px; }
  .memorial-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); --row-space: 22px; gap: 28px 8px; padding: 28px 12px 20px; }
  .memorial { max-width: none; }
  .memorial:nth-child(2n + 1):nth-last-child(1) { grid-column: 2 / span 2; }
  .niche { width: min(100%, 168px); }
  .niche::after { width: 300px; height: 300px; }
  .memorial h3 { font-size: 22px; }
  .memorial .years { font-size: 20px; letter-spacing: 0.1em; }
  .share-section { margin-top: 24px; }
  .share-section::before { height: 56px; margin-bottom: 40px; }
  .share-field input { font-size: 26px; }
  .caption-tabs span { padding: 8px 12px; letter-spacing: 0.1em; }
  .share-buttons { gap: 10px; }
  .share-btn { flex: 1 1 calc(50% - 10px); justify-content: center; padding: 0 14px; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .gift-options { grid-template-columns: repeat(3, 1fr); }
  .gift-options.gift-options-4 { grid-template-columns: repeat(2, 1fr); }
  .candle-dialog { padding: 24px 20px 28px; }
  .flow-steps { gap: 14px; margin-right: 56px; }
  .flow-steps li { letter-spacing: 0.1em; }
  .flow-actions { flex-direction: column-reverse; align-items: stretch; }
  .flow-actions .button { max-width: none; }
  .form-section { padding: 88px 0; }
  .form-intro { margin-bottom: 40px; }
  .form-panel { width: calc(100% - 24px); padding: 6px; }
  .form-panel > form { padding: 40px 18px 32px; }
  .form-panel legend { font-size: 28px; }
  .form-panel legend span { width: 30px; height: 30px; margin-right: 12px; }
  .gift-fields { padding-left: 16px; }
  .foundation { width: calc(100% - 56px); padding-bottom: 96px; }
  .foundation::before { height: 64px; margin-bottom: 48px; }
  .foundation-stats { grid-template-columns: 1fr; margin-top: 48px; }
  .foundation-stats li { padding: 26px 8px; }
  .foundation-stats li + li { border-left: 0; border-top: 1px solid var(--line); }
  .foundation-sub { margin-top: 64px; }
  .programs h4 { font-size: 24px; }
  .plaque-dialog { padding: 8px; }
  .plaque { padding: 48px 20px 28px; }
  .plaque-tribute.is-long { font-size: 18px; }
  .footer-bottom { flex-direction: column; }
}

@media (max-height: 760px) and (min-width: 900px) {
  .wall { padding-top: 88px; }
  .wall-head { gap: 22px; margin-bottom: 64px; }
  .wall-head h1 { font-size: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .strike-match { display: none; }
  .strike-fire { opacity: 1; transform: none; }
}
