/* The Wall That Heals Wadsworth: permanent memorial page.
   Morning-light palette per the committee brief.
   Motion thesis: the page emerges from the lit Wall at dusk into daylight.
   Every animated default state is the visible one, so a failed script or a
   reduced-motion preference leaves the page fully readable. */

:root {
  --bg: #FAF8F4;
  --bg-warm: #F4EFE6;
  --bg-deep: #EFE8DC;
  --ink: #2B2B2B;
  --ink-soft: #5A544C;
  --navy: #1F3A5F;
  --gold: #B08D4F;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.75;
  overflow-x: hidden;
}

/* Depth: warm light pooling down the page rather than one flat fill.
   Fixed attachment keeps the light still while the content moves over it. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% 0%, #FFFDF8 0%, rgba(255, 253, 248, 0) 55%),
    radial-gradient(90% 60% at 12% 42%, var(--bg-warm) 0%, rgba(244, 239, 230, 0) 60%),
    radial-gradient(100% 65% at 88% 78%, var(--bg-deep) 0%, rgba(239, 232, 220, 0) 62%),
    var(--bg);
}

/* Archival tooth. One tiny tiling texture, very low opacity. */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 88vh; overflow: hidden;
  display: flex; align-items: flex-end;
}
.hero-media { position: absolute; inset: -12% 0 -12% 0; will-change: transform; }
.hero picture, .hero img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
/* Two-stop scrim plus a vignette: the text sits in shadow, the frame recedes. */
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 40%, rgba(12, 15, 20, 0) 38%, rgba(12, 15, 20, 0.55) 100%),
    linear-gradient(to top, rgba(14, 17, 23, 0.85) 0%, rgba(14, 17, 23, 0.22) 46%, rgba(14, 17, 23, 0.42) 100%);
}
/* The page surface rising over the photograph. */
.hero::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 130px; z-index: 2;
  pointer-events: none;
  background: linear-gradient(to top, var(--bg) 0%, rgba(250, 248, 244, 0.72) 42%, rgba(250, 248, 244, 0) 100%);
}
.hero-text {
  position: relative; z-index: 3; width: 100%;
  max-width: 760px; margin: 0 auto; padding: 120px 24px 96px; text-align: center; color: #FAF8F4;
  will-change: transform, opacity;
}
.hero-text .kicker {
  font-family: var(--serif); font-size: clamp(17px, 2.4vw, 22px);
  letter-spacing: 0.06em; color: #E9DFC9; margin-bottom: 6px; font-style: italic;
}
.hero-text h1 {
  font-family: var(--serif); font-size: clamp(44px, 8vw, 82px); font-weight: 700;
  line-height: 1.04; letter-spacing: -0.02em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.4);
}
.hero-dates {
  font-size: 18px; margin-top: 18px; letter-spacing: 0.16em; text-transform: uppercase;
  color: #D8CFC0;
}
.hero-dates::before {
  content: ""; display: block; width: 54px; height: 1px; background: var(--gold);
  margin: 0 auto 18px;
}

/* ---------- Sections ---------- */
.prose { max-width: 680px; margin: 0 auto; padding: 96px 24px 8px; position: relative; }
.prose p { margin-bottom: 22px; }
.prose h2 {
  font-family: var(--serif); color: var(--navy);
  font-size: clamp(30px, 4.6vw, 44px); line-height: 1.16; letter-spacing: -0.015em;
  margin-bottom: 30px; text-wrap: balance;
}
.prose strong { color: var(--navy); }

.label {
  font-size: 13px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 14px; padding-top: 14px;
}

/* The page's one recurring accent: a gold hairline that draws itself in. */
.prose::before {
  content: ""; position: absolute; top: 96px; left: 24px;
  width: 64px; height: 1px; background: var(--gold); transform-origin: left center;
}
.motion .reveal::before { transform: scaleX(0); transition: transform 0.9s var(--ease); }
.motion .reveal.in::before { transform: scaleX(1); }

.motion .reveal > .label,
.motion .reveal > h2,
.motion .reveal > p,
.motion .reveal > form {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}
.motion .reveal.in > .label,
.motion .reveal.in > h2,
.motion .reveal.in > p,
.motion .reveal.in > form { opacity: 1; transform: none; }
.motion .reveal.in > .label { transition-delay: 0.02s; }
.motion .reveal.in > h2 { transition-delay: 0.10s; }
.motion .reveal.in > p:nth-of-type(1) { transition-delay: 0.14s; }
.motion .reveal.in > p:nth-of-type(2) { transition-delay: 0.20s; }
.motion .reveal.in > p:nth-of-type(3) { transition-delay: 0.26s; }
.motion .reveal.in > p:nth-of-type(n+4) { transition-delay: 0.30s; }
.motion .reveal.in > form { transition-delay: 0.14s; }

.closing { padding-bottom: 96px; }

/* ---------- Photographic band ---------- */
.band {
  position: relative; height: clamp(320px, 52vh, 520px); margin: 88px 0 0;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.band-media {
  position: absolute; inset: -14% 0 -14% 0; will-change: transform;
  background-image: url("/images/band-1600.jpg");
  background-size: cover; background-position: center 58%;
}
/* Nothing sits on the band any more, so it only needs to feather into the
   page above and below. The photograph stays a photograph in the middle. */
.band::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom,
    var(--bg) 0%,
    rgba(250, 248, 244, 0.55) 9%,
    rgba(250, 248, 244, 0) 26%,
    rgba(250, 248, 244, 0) 74%,
    rgba(250, 248, 244, 0.55) 91%,
    var(--bg) 100%);
}
/* ---------- Stories ---------- */
/* Someone else's voice, so it is set apart by type and air rather than by a
   box. Serif, larger, looser, with the attribution quiet underneath. */
.story { margin: 40px 0 0; }
.story + .story { margin-top: 56px; padding-top: 56px; border-top: 1px solid rgba(176, 141, 79, 0.28); }
.story blockquote { margin: 0; }
.story blockquote p {
  font-family: var(--serif); font-size: 20px; line-height: 1.75;
  color: #37322b; margin: 0 0 20px;
}
.story blockquote p:first-child::before {
  content: "\201C"; font-family: var(--serif); color: var(--gold);
  font-size: 46px; line-height: 0; vertical-align: -0.14em; margin-right: 6px;
}
.story blockquote p:last-of-type::after {
  content: "\201D"; font-family: var(--serif); color: var(--gold);
  font-size: 46px; line-height: 0; vertical-align: -0.24em; margin-left: 4px;
}
.story figcaption { margin-top: 6px; }
.story-name {
  display: block; font-family: var(--sans); font-weight: 600;
  font-size: 16px; letter-spacing: 0.04em; color: var(--navy);
}
.story-role {
  display: block; font-family: var(--sans); font-size: 15px;
  color: var(--ink-soft); margin-top: 2px;
}
.motion .reveal > .story { opacity: 0; transform: translateY(18px); transition: opacity 0.75s var(--ease), transform 0.75s var(--ease); }
.motion .reveal.in > .story { opacity: 1; transform: none; transition-delay: 0.22s; }
@media (max-width: 620px) {
  .story blockquote p { font-size: 19px; }
}

/* ---------- Gallery ---------- */
.gallery-section { padding-bottom: 24px; }
.gallery {
  max-width: 1240px; margin: 44px auto 0; padding: 0 24px;
  columns: 3; column-gap: 20px;
}
@media (max-width: 980px) { .gallery { columns: 2; } }
@media (max-width: 620px) { .gallery { columns: 1; } }
.gallery figure { break-inside: avoid; margin: 0 0 20px; }
.motion .gallery figure {
  opacity: 0; transform: translateY(20px) scale(0.985);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.motion .gallery figure.visible { opacity: 1; transform: none; }
.gallery img {
  width: 100%; height: auto; display: block; border-radius: 2px; cursor: zoom-in;
  box-shadow: 0 2px 4px rgba(43, 38, 30, 0.06), 0 12px 28px -10px rgba(43, 38, 30, 0.28);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.gallery img:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(43, 38, 30, 0.08), 0 22px 44px -14px rgba(43, 38, 30, 0.36);
}
.photo-credit {
  max-width: 1240px; margin: 22px auto 0; padding: 0 24px 40px;
  font-size: 15px; color: var(--ink-soft);
}
.photo-credit a { color: var(--navy); }

/* ---------- Form ---------- */
form { margin-top: 12px; }
.hp { position: absolute; left: -9999px; }
.field { margin-bottom: 24px; }
.field label { display: block; font-weight: 600; color: var(--navy); margin-bottom: 8px; }
.field .opt { font-weight: 400; color: var(--ink-soft); font-size: 15px; }
.field input[type="text"], .field input[type="email"], .field textarea {
  width: 100%; font-size: 18px; font-family: var(--sans); color: var(--ink);
  padding: 13px 14px; border: 1px solid #cec6b6; border-radius: 3px;
  background: rgba(255, 255, 255, 0.75);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}
.field input:hover, .field textarea:hover { border-color: #b6ab97; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--navy); background: #fff;
  box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.16);
}
.field input[type="file"] { font-size: 16px; }
.note { font-size: 15px; color: var(--ink-soft); margin-top: 8px; }
.note a { color: var(--navy); }
.checkbox-field label { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.checkbox-field input { width: 22px; height: 22px; flex-shrink: 0; margin-top: 4px; accent-color: var(--navy); }
.err { display: none; color: #8C2B2B; font-size: 16px; margin-top: 8px; }
.field.invalid .err { display: block; }
.field.invalid input, .field.invalid textarea { border-color: #8C2B2B; }

.progress { margin-bottom: 20px; }
.progress-bar {
  height: 8px; width: 100%; background: var(--gold); border-radius: 4px;
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.3s var(--ease);
}
.progress-text { font-size: 15px; color: var(--ink-soft); margin-top: 6px; }

#share-submit {
  font-family: var(--sans); font-size: 18px; font-weight: 600;
  background: var(--navy); color: #FAF8F4; border: 0; border-radius: 3px;
  padding: 15px 34px; cursor: pointer;
  box-shadow: 0 2px 6px rgba(31, 58, 95, 0.22), 0 10px 24px -12px rgba(31, 58, 95, 0.5);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
#share-submit:hover { background: #2a4d7c; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(31, 58, 95, 0.26), 0 16px 32px -14px rgba(31, 58, 95, 0.55); }
#share-submit:focus-visible { outline: 3px solid rgba(31, 58, 95, 0.4); outline-offset: 3px; }
#share-submit:disabled { opacity: 0.6; cursor: default; transform: none; }
.form-thanks { margin-top: 20px; font-size: 19px; color: var(--navy); font-weight: 600; }
.form-error { margin-top: 20px; color: #8C2B2B; }
.form-error a { color: var(--navy); }

/* ---------- Footer ---------- */
footer {
  position: relative; margin-top: 56px;
  padding: 40px 24px 56px; text-align: center; font-size: 16px; color: var(--ink-soft);
  background: linear-gradient(to bottom, rgba(239, 232, 220, 0) 0%, rgba(239, 232, 220, 0.75) 100%);
}
footer::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(680px, calc(100% - 48px)); height: 1px; background: var(--gold);
}
footer p { margin-bottom: 8px; }
footer a { color: var(--navy); }
footer .fine { font-size: 14px; margin-top: 10px; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(12, 14, 18, 0.95);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.32s var(--ease);
  backdrop-filter: blur(6px);
}
.lightbox.open { opacity: 1; }
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 92vw; max-height: 88vh; object-fit: contain;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
  transform: scale(0.97); opacity: 0;
  transition: transform 0.4s var(--ease), opacity 0.32s var(--ease);
}
.lightbox.open img { transform: none; opacity: 1; }
.lightbox button {
  position: absolute; background: none; border: 0; color: #FAF8F4; cursor: pointer;
  font-size: 44px; line-height: 1; padding: 16px; opacity: 0.8;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.lightbox button:hover { opacity: 1; transform: scale(1.08); }
.lightbox button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; opacity: 1; }
.lb-close { top: 10px; right: 14px; }
.lb-prev { left: 6px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 6px; top: 50%; transform: translateY(-50%); }
.lb-prev:hover, .lb-next:hover { transform: translateY(-50%) scale(1.08); }
@media (max-width: 620px) { .lb-prev, .lb-next { font-size: 36px; padding: 12px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
