:root {
  --bg-deep: #f2f9ff;
  --bg-mid: #fff3df;
  --paper: #fffef9;
  --ink: #1f3a45;
  --muted: #4e6772;
  --accent: #eb8f3c;
  --accent-soft: #f3b56f;
  --line: rgba(35, 82, 99, 0.16);
  --card-shadow: 0 12px 34px rgba(35, 82, 99, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 14%, rgba(235, 143, 60, 0.24), transparent 40%),
    radial-gradient(circle at 88% 20%, rgba(101, 170, 190, 0.28), transparent 42%),
    linear-gradient(170deg, var(--bg-deep), var(--bg-mid) 55%, #f8efe2 100%);
  min-height: 100vh;
}

.background-ornament {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(34, 76, 92, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(34, 76, 92, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black, transparent 75%);
  z-index: -1;
}

.section {
  width: min(980px, calc(100% - 2rem));
  margin: 1.3rem auto;
}

.hero {
  text-align: center;
  color: #1f3a45;
  padding: 4.8rem 1rem 2.4rem;
}

.eyebrow {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #ce7a2d;
  font-size: 0.8rem;
}

h1,
h2,
h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  line-height: 1.04;
  margin: 0;
}

h1 {
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  margin-bottom: 1rem;
}

.hero-subtitle {
  margin: 0 auto;
  max-width: 680px;
  font-size: clamp(1rem, 2.4vw, 1.28rem);
  line-height: 1.7;
  color: #34515d;
}

.hero-actions,
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.4rem;
  justify-content: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.78rem 1.2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  transition: transform 220ms ease, box-shadow 220ms ease, background-color 220ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 42, 45, 0.25);
}

.button-primary {
  background: linear-gradient(130deg, var(--accent), var(--accent-soft));
  color: #1f1611;
}

.button-secondary {
  background: #def2f9;
  border-color: rgba(47, 101, 121, 0.36);
  color: #234658;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(1rem, 2vw, 2rem);
  box-shadow: var(--card-shadow);
}

h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 1.2rem;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 0.75rem;
}

.card p {
  line-height: 1.75;
  margin: 0.9rem 0;
}

.obituary-toggle {
  margin: 1rem auto 0;
  cursor: pointer;
}

.obituary-more {
  margin-top: 0.75rem;
}

.signoff,
.closing {
  font-weight: 700;
  color: #273538;
}

.embed-panel,
.embed-shell {
  margin-top: 1.4rem;
  border: 1px dashed rgba(17, 33, 36, 0.24);
  border-radius: 16px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.55);
}

.embed-panel iframe,
.embed-shell iframe {
  width: 100%;
  min-height: 600px;
  border: 0;
  border-radius: 12px;
  background: #f8f8f8;
}

.embed-note {
  margin: 0;
  color: var(--muted);
}

.compact-embed {
  margin-top: 1rem;
}

.compact-embed .embed-note {
  margin-bottom: 0.75rem;
}

.section-heading p {
  margin-top: 0.8rem;
  color: #36525e;
}

.featured-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
  align-items: start;
}

.featured-main {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.featured-grid .featured-side:nth-of-type(2) {
  grid-column: 2;
  grid-row: 1;
}

.featured-grid .featured-side:nth-of-type(3) {
  grid-column: 2;
  grid-row: 2;
}

.chapter-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.chapter-card {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(17, 33, 36, 0.2);
  border-radius: 14px;
  padding: 0.85rem 1rem;
}

.chapter-card h3 {
  margin-bottom: 0.35rem;
  font-size: 1.5rem;
}

.chapter-card p {
  margin: 0;
  color: #334144;
  line-height: 1.5;
}

.memory-wall {
  margin-top: 1rem;
  columns: 3;
  column-gap: 1rem;
}

.photo-card {
  margin: 0;
  background: var(--paper);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--card-shadow);
  break-inside: avoid;
}

.memory-wall .photo-card {
  margin: 0 0 1rem;
}

.photo-card img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  background: linear-gradient(120deg, #f8dfbf, #bedee4);
  transition: transform 350ms ease;
}

.photo-card:hover img {
  transform: scale(1.03);
}

.photo-card figcaption {
  padding: 0.85rem 0.95rem;
  color: #2d383b;
}

.footer {
  text-align: center;
  color: #35515c;
  padding: 2rem 1rem 3rem;
}

.gfm-embed iframe {
  width: 100%;
  border-radius: 12px;
  border: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise-in 720ms ease forwards;
}

.reveal:nth-of-type(2) {
  animation-delay: 120ms;
}

.reveal:nth-of-type(3) {
  animation-delay: 200ms;
}

.reveal:nth-of-type(4) {
  animation-delay: 290ms;
}

.reveal:nth-of-type(5) {
  animation-delay: 360ms;
}

@keyframes rise-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 700px) {
  .hero {
    padding-top: 3.4rem;
  }

  .embed-panel iframe,
  .embed-shell iframe {
    min-height: 500px;
  }

  .featured-grid,
  .chapter-grid {
    grid-template-columns: 1fr;
  }

  .featured-main {
    grid-row: auto;
  }

  .memory-wall {
    columns: 2;
  }
}

@media (max-width: 480px) {
  .memory-wall {
    columns: 1;
  }
}
