@import url("https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400;1,6..72,500&family=Inter:wght@400;500;600&display=swap");

:root {
  color-scheme: dark;
  --dusk-950: #14181f;
  --dusk-900: #191e27;
  --dusk-800: #212734;
  --dusk-700: #2b3241;
  --parchment: #f5eee0;
  --parchment-dim: #ece2cd;
  --gold-500: #c79a43;
  --gold-300: #e4c989;
  --ink-light: #efe8d8;
  --ink-dark: #2a251e;
  --muted-light: #a9a190;
  --muted-dark: #8c8371;
  --serif: "Newsreader", ui-serif, Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink-light);
  font-family: var(--sans);
  background: var(--dusk-950);
}

.page-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px 0;
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: var(--gold-300);
  border: 1px solid rgba(199, 154, 67, 0.45);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 1.05rem;
}

.site-header .years {
  color: var(--muted-light);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 0.9fr);
  align-items: center;
  gap: 56px;
  padding: 30px 0 70px;
  animation: rise 900ms ease-out both;
}

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

.epitaph {
  margin: 0 0 18px;
  color: var(--gold-300);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
}

.hero h1 {
  margin: 0 0 14px;
  color: var(--parchment);
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5.2vw, 4rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.dates {
  margin: 0 0 22px;
  color: var(--muted-light);
  font-size: 1.05rem;
}

.dates::before {
  display: inline-block;
  width: 26px;
  height: 1px;
  margin-right: 12px;
  vertical-align: middle;
  content: "";
  background: var(--gold-500);
}

.hero-note {
  max-width: 46ch;
  margin: 0;
  color: var(--ink-light);
  font-size: 1.02rem;
  line-height: 1.7;
}

.hero-photo {
  position: relative;
}

.hero-photo::before {
  position: absolute;
  z-index: 0;
  inset: 18px -18px -18px 18px;
  content: "";
  border: 1px solid rgba(199, 154, 67, 0.35);
  border-radius: 4px;
}

.hero-photo img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 560px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

/* ---------- story ---------- */

.story {
  max-width: 62ch;
  padding: 10px 0 76px;
}

.story h2,
.gallery h2,
.letter h2 {
  margin: 0 0 22px;
  color: var(--parchment);
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 500;
}

.story p {
  margin: 0 0 18px;
  color: var(--ink-light);
  font-size: 1.02rem;
  line-height: 1.75;
}

.story p:last-child {
  margin-bottom: 0;
}

/* ---------- gallery ---------- */

.gallery {
  padding: 10px 0 76px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 130px;
  gap: 14px;
}

.gallery-item {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--dusk-800);
  border-radius: 3px;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.94);
  transition: transform 260ms ease;
}

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

.gallery-item:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 3px;
}

.item-a {
  grid-column: span 3;
  grid-row: span 3;
}

.item-b {
  grid-column: span 3;
  grid-row: span 2;
}

.item-c {
  grid-column: span 2;
  grid-row: span 2;
}

.item-d {
  grid-column: span 2;
  grid-row: span 2;
}

.item-e {
  grid-column: span 2;
  grid-row: span 2;
}

.item-f {
  grid-column: span 3;
  grid-row: span 2;
}

/* lightbox (sin JavaScript, activado con :target) */

.lightbox {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: none;
  padding: 40px;
  place-items: center;
  background: rgba(10, 12, 16, 0.94);
}

.lightbox:target {
  display: grid;
}

.lightbox img {
  max-width: min(1100px, 92vw);
  max-height: 86vh;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: max(24px, calc((100% - 1120px) / 2));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--parchment);
  border: 1px solid rgba(245, 238, 224, 0.35);
  border-radius: 50%;
  font-size: 1.2rem;
  text-decoration: none;
}

.lightbox-close:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

/* ---------- letter ---------- */

.letter {
  padding: 20px 0 84px;
  text-align: center;
}

.letter blockquote {
  max-width: 58ch;
  margin: 0 auto 26px;
}

.letter blockquote p {
  margin: 0;
  color: var(--parchment);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  line-height: 1.55;
}

.signature {
  margin: 0;
  color: var(--gold-300);
  font-size: 0.98rem;
}

/* ---------- footer ---------- */

footer {
  padding: 30px 0 46px;
  color: var(--muted-light);
  border-top: 1px solid rgba(245, 238, 224, 0.1);
  font-size: 0.88rem;
  text-align: center;
}

footer p {
  margin: 0 0 6px;
}

footer p:first-child {
  color: var(--parchment);
  font-family: var(--serif);
  font-size: 1.05rem;
}

footer p:last-child {
  margin-bottom: 0;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-bottom: 50px;
  }

  .hero-photo img {
    height: 420px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 160px;
  }

  .item-a,
  .item-b,
  .item-c,
  .item-d,
  .item-e,
  .item-f {
    grid-column: span 1;
    grid-row: span 2;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 28px, 1120px);
  }

  .hero-photo img {
    height: 320px;
  }

  .story,
  .gallery,
  .letter {
    padding-bottom: 56px;
  }

  .lightbox {
    padding: 20px;
  }

  .lightbox-close {
    right: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero {
    animation: none;
  }

  .gallery-item img {
    transition: none;
  }
}
