/* ==========================================================================
   TOKENS
   ========================================================================== */
:root {
  --gold:       #E8B679;   /* morning sun */
  --rose:       #C98B7A;   /* late afternoon */
  --plum:       #3B2E3E;   /* dusk */
  --plum-deep:  #241F2B;   /* early night */
  --navy:       #12111A;   /* night sky */
  --cream:      #F7F1E6;   /* light ink */
  --ink:        #2E2018;   /* dark ink, used on light gold */

  --display: 'Fraunces', Georgia, serif;
  --serif:   'Newsreader', Georgia, serif;
  --sans:    'Inter', -apple-system, sans-serif;

  --wrap: 1180px;
}

/* ==========================================================================
   RESET / BASE
   ========================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--serif);
  color: var(--cream);
  background: linear-gradient(
    180deg,
    var(--gold)      0%,
    var(--gold)      6%,
    var(--rose)      20%,
    var(--plum)      42%,
    var(--plum-deep) 64%,
    var(--navy)      100%
  );
  background-repeat: no-repeat;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 4px;
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8vh 1.5rem 4rem;
  color: var(--ink);
  position: relative;
}

.hero__inner { max-width: 46rem; }

.hero__eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.72;
  margin: 0 0 1.25rem;
}

.hero__name {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(3.2rem, 11vw, 6.5rem);
  line-height: 1;
  margin: 0 0 0.9rem;
  letter-spacing: -0.01em;
}

.hero__dates {
  font-family: var(--sans);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  opacity: 0.75;
  margin: 0 0 2.4rem;
}

.hero__epitaph {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  line-height: 1.55;
  opacity: 0.88;
  margin: 0;
}

.hero__scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 3.5rem;
  background: currentColor;
  color: var(--ink);
  opacity: 0.45;
  overflow: hidden;
}

.hero__scroll span {
  display: block;
  width: 100%;
  height: 40%;
  background: var(--ink);
  animation: scrollLine 2.2s ease-in-out infinite;
}

@keyframes scrollLine {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(250%); }
}

/* ==========================================================================
   MESSAGE
   ========================================================================== */
.message {
  max-width: 38rem;
  margin: 0 auto;
  padding: 6rem 1.5rem 5rem;
  text-align: center;
}

.message p {
  font-style: italic;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.75;
  opacity: 0.92;
  margin: 0;
}

/* ==========================================================================
   GALLERY
   ========================================================================== */
.gallery-section {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 2rem 1.5rem 8rem;
}

.gallery {
  column-count: 1;
  column-gap: 1.5rem;
}

@media (min-width: 620px) {
  .gallery { column-count: 2; }
}

@media (min-width: 980px) {
  .gallery { column-count: 3; }
}

.gallery figure {
  margin: 0 0 1.5rem;
  break-inside: avoid;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.15);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.gallery figure.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery img {
  width: 100%;
  cursor: pointer;
  transition: transform 0.5s ease;
}

.gallery figure:hover img {
  transform: scale(1.035);
}

.gallery figcaption {
  position: absolute;
  left: 0.6rem;
  right: 0.6rem;
  bottom: 0.6rem;
  padding: 0.45rem 0.7rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--cream);
  background: rgba(18, 15, 22, 0.55);
  backdrop-filter: blur(6px);
  border-radius: 4px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.gallery figure:hover figcaption,
.gallery figure:focus-within figcaption {
  opacity: 1;
  transform: translateY(0);
}

.gallery__empty {
  text-align: center;
  font-family: var(--sans);
  font-size: 0.95rem;
  opacity: 0.65;
  padding: 3rem 1rem;
}

.gallery__empty code {
  background: rgba(255, 255, 255, 0.12);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

/* ==========================================================================
   CLOSING / STARS
   ========================================================================== */
.closing {
  position: relative;
  padding: 7rem 1.5rem 6rem;
  text-align: center;
  overflow: hidden;
}

.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, rgba(247,241,230,0.8), transparent),
    radial-gradient(1.5px 1.5px at 25% 65%, rgba(247,241,230,0.6), transparent),
    radial-gradient(1px 1px at 40% 15%, rgba(247,241,230,0.7), transparent),
    radial-gradient(1.5px 1.5px at 55% 50%, rgba(247,241,230,0.5), transparent),
    radial-gradient(1px 1px at 70% 30%, rgba(247,241,230,0.8), transparent),
    radial-gradient(1.5px 1.5px at 85% 70%, rgba(247,241,230,0.6), transparent),
    radial-gradient(1px 1px at 92% 22%, rgba(247,241,230,0.7), transparent),
    radial-gradient(1.5px 1.5px at 15% 85%, rgba(247,241,230,0.5), transparent),
    radial-gradient(1px 1px at 60% 88%, rgba(247,241,230,0.6), transparent),
    radial-gradient(1.5px 1.5px at 78% 92%, rgba(247,241,230,0.7), transparent);
  animation: twinkle 5s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1; }
}

.closing__inner { position: relative; }

.closing__line {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  margin: 0 0 0.75rem;
  opacity: 0.95;
}

.closing__signature {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.55;
  margin: 0;
}

/* ==========================================================================
   LIGHTBOX
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 13, 19, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 100;
}

.lightbox[hidden] { display: none; }

.lightbox__img {
  max-width: min(90vw, 1100px);
  max-height: 78vh;
  border-radius: 4px;
  box-shadow: 0 20px 60px -10px rgba(0,0,0,0.6);
}

.lightbox__caption {
  color: var(--cream);
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  opacity: 0.85;
  margin-top: 1.1rem;
  max-width: 34rem;
  text-align: center;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  background: none;
  border: none;
  color: var(--cream);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.lightbox__close:hover,
.lightbox__nav:hover { opacity: 1; }

.lightbox__close {
  top: 1.5rem;
  right: 1.5rem;
  font-size: 2.2rem;
  line-height: 1;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  padding: 0.5rem 0.75rem;
}

.lightbox__nav--prev { left: 1rem; }
.lightbox__nav--next { right: 1rem; }

@media (max-width: 640px) {
  .lightbox__nav--prev { left: 0.25rem; }
  .lightbox__nav--next { right: 0.25rem; }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__scroll span { animation: none; }
  .stars { animation: none; }
  .gallery figure {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .gallery img,
  .gallery figcaption {
    transition: none;
  }
}
