:root {
  --bg: #0d0f11;
  --bg-soft: #12161a;
  --paper: #efe8d8;
  --muted: #b3b0a7;
  --muted-strong: #d2cec2;
  --line: rgba(239, 232, 216, 0.18);
  --accent: #c8a46a;
  --accent-soft: #8f7447;
  --max-width: 1160px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--paper);
  background:
    radial-gradient(circle at 10% -10%, #26313d 0%, transparent 40%),
    radial-gradient(circle at 90% 10%, #34291d 0%, transparent 35%),
    linear-gradient(155deg, #0a0c0e 0%, #101419 48%, #090b0d 100%);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  letter-spacing: 0.01rem;
}

body.lock-scroll {
  overflow: hidden;
}

.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.15;
  background-image: radial-gradient(rgba(255, 255, 255, 0.22) 0.55px, transparent 0.55px);
  background-size: 3px 3px;
}

.site-header,
main,
.site-footer {
  width: min(var(--max-width), calc(100% - 2.4rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 1rem;
  z-index: 30;
  margin-top: 1rem;
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(16px);
  background: rgba(8, 10, 12, 0.64);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22);
}

.brand {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.4rem;
  letter-spacing: 0.18rem;
  color: var(--paper);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.brand img {
  display: block;
  height: 34px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 1.1rem;
}

.nav-links a {
  color: var(--paper);
  text-decoration: none;
  font-size: 0.92rem;
  opacity: 0.85;
  transition: opacity 220ms ease, color 220ms ease;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.2rem;
  width: 100%;
  height: 1px;
  transform: scaleX(0);
  transform-origin: left;
  background: rgba(200, 164, 106, 0.9);
  transition: transform 220ms ease;
}

.nav-links a:hover {
  opacity: 1;
  color: var(--muted-strong);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

main {
  display: grid;
  gap: 3.8rem;
  padding: 4.8rem 0 4rem;
}

section {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  padding: clamp(1.4rem, 3.5vw, 3rem);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 24px 44px rgba(0, 0, 0, 0.2);
}

.kicker {
  font-size: 0.78rem;
  letter-spacing: 0.14rem;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}

h1,
h2,
h3 {
  font-family: "Cormorant Garamond", serif;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2.3rem, 7vw, 5.1rem);
  max-width: 18ch;
}

h1 span {
  color: var(--accent);
}

h2 {
  font-size: clamp(1.8rem, 5vw, 3.1rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.24rem, 2vw, 1.6rem);
  margin-bottom: 0.7rem;
}

.lead {
  margin-top: 1.25rem;
  max-width: 62ch;
  color: var(--muted);
}

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
  gap: clamp(1rem, 2.4vw, 2.2rem);
}

.hero-metrics {
  display: grid;
  gap: 0.72rem;
  align-content: end;
}

.hero-metrics article {
  border: 1px solid rgba(200, 164, 106, 0.2);
  border-radius: 16px;
  padding: 0.8rem 0.9rem;
  background: linear-gradient(165deg, rgba(200, 164, 106, 0.08), rgba(200, 164, 106, 0.015));
}

.metric-value {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1;
  color: var(--paper);
}

.metric-label {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.btn {
  padding: 0.8rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.03rem;
  transition: transform 180ms ease, border-color 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-solid {
  background: var(--accent);
  color: #18130d;
  border-color: transparent;
}

.btn-ghost {
  color: var(--paper);
}

.btn-ghost:hover {
  border-color: rgba(239, 232, 216, 0.38);
}

.section-head {
  margin-bottom: 1.4rem;
}

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

.obituary-grid article {
  padding: 1.1rem;
  border-radius: 18px;
  border: 1px solid rgba(239, 232, 216, 0.12);
  background: rgba(10, 12, 14, 0.38);
}

.obituary-grid p,
.series-list p,
.contact-card p {
  color: var(--muted);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.tile {
  min-height: 220px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(239, 232, 216, 0.12);
  background-image:
    linear-gradient(to top, rgba(8, 9, 11, 0.82), rgba(8, 9, 11, 0.08)),
    var(--img);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  transform: translateY(6px);
  transition: transform 280ms ease, filter 280ms ease;
  cursor: pointer;
}

.tile:hover {
  transform: translateY(-3px);
  filter: saturate(112%);
}

.tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.tile figcaption {
  width: 100%;
  padding: 1rem;
  font-size: 0.9rem;
  letter-spacing: 0.04rem;
}

.tile.tall {
  grid-row: span 2;
  min-height: 460px;
}

.tile.wide {
  grid-column: span 2;
}

.gallery-note {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.series-list {
  display: grid;
  gap: 0.9rem;
}

.series-list article {
  border-left: 2px solid var(--accent-soft);
  padding: 0.9rem 0 0.9rem 1rem;
  background: rgba(10, 12, 14, 0.35);
  border-radius: 0 12px 12px 0;
}

.contact-card {
  border-radius: 20px;
  padding: 1.4rem;
  background:
    linear-gradient(140deg, rgba(200, 164, 106, 0.16), rgba(200, 164, 106, 0.02) 42%),
    rgba(8, 10, 12, 0.45);
  border: 1px solid rgba(200, 164, 106, 0.3);
}

.contact-links {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.95rem;
}

.contact-links a {
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid rgba(239, 232, 216, 0.2);
  padding-bottom: 0.1rem;
}

.site-footer {
  padding: 0.4rem 0 2.3rem;
  color: #a8a49a;
  font-size: 0.85rem;
  text-align: center;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  z-index: 60;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 7, 0.86);
  backdrop-filter: blur(5px);
}

.lightbox-panel {
  position: relative;
  z-index: 2;
  width: min(980px, calc(100% - 2rem));
  border: 1px solid rgba(239, 232, 216, 0.25);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(6, 8, 10, 0.92);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-panel img {
  display: block;
  width: 100%;
  max-height: 74vh;
  object-fit: cover;
}

.lightbox-panel p {
  padding: 0.9rem 1rem 1rem;
  color: var(--paper);
  border-top: 1px solid rgba(239, 232, 216, 0.15);
}

.lightbox-close {
  position: absolute;
  right: 0.7rem;
  top: 0.7rem;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  border: 1px solid rgba(239, 232, 216, 0.35);
  color: var(--paper);
  background: rgba(8, 10, 12, 0.6);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  animation: rise 900ms cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.hero {
  animation-delay: 0.06s;
}

.obituary {
  animation-delay: 0.2s;
}

.gallery {
  animation-delay: 0.3s;
}

.series {
  animation-delay: 0.42s;
}

.contact {
  animation-delay: 0.52s;
}

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

@media (max-width: 960px) {
  .site-header {
    border-radius: 22px;
    flex-direction: column;
    gap: 0.7rem;
  }

  .obituary-grid {
    grid-template-columns: 1fr;
  }

  .hero-shell {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tile.tall,
  .tile.wide {
    grid-row: auto;
    grid-column: auto;
    min-height: 260px;
  }
}

@media (max-width: 620px) {
  main {
    padding-top: 3.4rem;
    gap: 2.2rem;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.4rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  section {
    border-radius: 20px;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }
}
