:root {
  --bg: #fdf8f0;
  --paper: #fffaf2;
  --text: #5c4033;
  --muted: #9b8576;
  --gold: #daa520;
  --placeholder: #f5e6cc;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(218, 165, 32, 0.12) 0, rgba(253, 248, 240, 0) 180px),
    linear-gradient(0deg, rgba(218, 165, 32, 0.14) 0, rgba(253, 248, 240, 0) 220px),
    var(--bg);
  color: var(--text);
  font-family: "Noto Serif SC", Georgia, "STSong", serif;
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body::before,
body::after {
  position: fixed;
  left: 0;
  z-index: -1;
  width: 100%;
  height: 170px;
  pointer-events: none;
  content: "";
}

body::before {
  top: 0;
  background: linear-gradient(180deg, rgba(255, 242, 209, 0.72), rgba(253, 248, 240, 0));
}

body::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(255, 231, 173, 0.58), rgba(253, 248, 240, 0));
}

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

main {
  overflow: hidden;
}

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

.hero {
  position: relative;
  display: grid;
  min-height: 100svh;
  padding: 56px max(22px, env(safe-area-inset-left)) 88px;
  place-items: center;
  text-align: center;
}

.hero::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(135deg, rgba(255, 244, 218, 0.86), rgba(253, 248, 240, 0.15) 58%),
    repeating-linear-gradient(110deg, rgba(218, 165, 32, 0.055) 0 1px, transparent 1px 18px);
  content: "";
}

.hero__inner {
  width: min(100%, 560px);
}

.hero__kicker {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.hero__title {
  min-height: 78px;
  margin: 0;
  color: var(--text);
  font-size: clamp(28px, 8vw, 48px);
  font-weight: 600;
  line-height: 1.4;
}

.hero__title::after {
  display: inline-block;
  width: 1px;
  height: 1em;
  margin-left: 4px;
  background: rgba(92, 64, 51, 0.5);
  vertical-align: -0.12em;
  animation: blink 1s steps(1) infinite;
  content: "";
}

.hero__title.is-complete::after {
  content: none;
}

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  display: grid;
  width: 42px;
  height: 42px;
  transform: translateX(-50%);
  place-items: center;
  opacity: 0.8;
}

.scroll-cue span {
  width: 15px;
  height: 15px;
  border-right: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  transform: rotate(45deg);
  animation: cue 1.8s ease-in-out infinite;
}

.letter-section {
  padding: 54px 18px 72px;
}

.letter-card {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 28px 22px 24px;
  background: rgba(255, 250, 242, 0.88);
  border: 1px solid rgba(218, 165, 32, 0.16);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.letter-card p {
  margin: 0 0 18px;
}

.letter-card footer {
  margin-top: 28px;
  color: #745849;
  font-size: 14px;
  text-align: right;
}

.timeline {
  padding: 20px 0 10px;
}

.section-title {
  display: grid;
  grid-template-columns: minmax(36px, 1fr) auto minmax(36px, 1fr);
  align-items: center;
  gap: 14px;
  width: min(100% - 36px, 680px);
  margin: 0 auto 12px;
}

.section-title span {
  height: 1px;
  background: linear-gradient(90deg, rgba(218, 165, 32, 0), rgba(218, 165, 32, 0.75));
}

.section-title span:last-child {
  background: linear-gradient(90deg, rgba(218, 165, 32, 0.75), rgba(218, 165, 32, 0));
}

.section-title h2 {
  margin: 0;
  color: var(--gold);
  font-size: 18px;
  font-weight: 500;
}

.scene {
  display: grid;
  min-height: 92svh;
  padding: 54px 0 64px;
  align-content: center;
  gap: 28px;
}

.scene__text {
  width: min(100% - 40px, 660px);
  margin: 0 auto;
  text-align: center;
}

.scene__time {
  margin: 0 0 16px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.scene h3 {
  margin: 0;
  font-size: clamp(21px, 6vw, 34px);
  font-weight: 500;
  line-height: 1.68;
}

.scene__visual {
  position: relative;
  width: 100%;
  min-height: 300px;
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(253, 248, 240, 0.25), rgba(218, 165, 32, 0.12)),
    var(--placeholder);
  border-top: 1px solid rgba(218, 165, 32, 0.16);
  border-bottom: 1px solid rgba(218, 165, 32, 0.14);
  cursor: zoom-in;
}

.scene__visual img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
  opacity: 0;
  transform: translateY(var(--parallax-y, 0));
  transition: opacity 0.45s ease, transform 0.2s ease-out;
}

.scene__visual.is-loaded img {
  opacity: 1;
}

.scene__visual figcaption {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(92, 64, 51, 0.52);
  font-size: 14px;
  font-style: italic;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.scene__visual.is-loaded figcaption {
  display: none;
}

.closing {
  display: grid;
  min-height: 62svh;
  padding: 96px 22px 118px;
  place-items: center;
  text-align: center;
}

.closing h2 {
  margin: 0;
  font-size: clamp(27px, 8vw, 46px);
  font-weight: 600;
  line-height: 1.45;
}

.closing p {
  margin: 18px 0 0;
  color: #a99a90;
  font-size: 12px;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  padding: 22px;
  background: rgba(32, 24, 20, 0.82);
  place-items: center;
}

.lightbox.is-open {
  display: grid;
}

.lightbox__content {
  display: grid;
  width: min(100%, 980px);
  min-height: min(70vh, 680px);
  place-items: center;
}

.lightbox__content img {
  display: none;
  max-width: 100%;
  max-height: 84vh;
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.lightbox__content.is-image img {
  display: block;
}

.lightbox__content p {
  display: grid;
  width: min(100%, 720px);
  min-height: 300px;
  margin: 0;
  background: var(--placeholder);
  border-radius: 8px;
  color: rgba(92, 64, 51, 0.74);
  place-items: center;
  text-align: center;
}

.lightbox__content.is-image p {
  display: none;
}

.lightbox__close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 21;
  width: 44px;
  height: 44px;
  padding: 0;
  background: rgba(255, 250, 242, 0.92);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 30px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.lightbox__close:active {
  transform: scale(0.92);
}

.sparkles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(218, 165, 32, 0.9), rgba(218, 165, 32, 0));
  animation: sparkle-float var(--dur) var(--delay) ease-in-out infinite;
}

.sparkle::before {
  position: absolute;
  top: -3px;
  left: 50%;
  width: 1px;
  height: 10px;
  background: linear-gradient(rgba(218, 165, 32, 0), rgba(218, 165, 32, 0.5), rgba(218, 165, 32, 0));
  transform: translateX(-50%);
  content: "";
}

.sparkle::after {
  position: absolute;
  top: 50%;
  left: -3px;
  width: 10px;
  height: 1px;
  background: linear-gradient(90deg, rgba(218, 165, 32, 0), rgba(218, 165, 32, 0.5), rgba(218, 165, 32, 0));
  transform: translateY(-50%);
  content: "";
}

@keyframes sparkle-float {
  0%, 100% {
    opacity: 0;
    transform: translateY(0) scale(0.6);
  }
  20% {
    opacity: 1;
    transform: translateY(-8px) scale(1);
  }
  50% {
    opacity: 0.6;
    transform: translateY(-20px) scale(0.8);
  }
  80% {
    opacity: 0.9;
    transform: translateY(-12px) scale(1.1);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes cue {
  0%,
  100% {
    transform: translateY(-4px) rotate(45deg);
  }

  50% {
    transform: translateY(5px) rotate(45deg);
  }
}

@media (min-width: 700px) {
  .letter-section {
    padding-top: 76px;
  }

  .letter-card {
    padding: 38px 42px 32px;
  }

  .scene {
    min-height: 96svh;
    padding-top: 70px;
    padding-bottom: 78px;
  }

  .scene__visual {
    min-height: 420px;
  }

  .scene__visual img {
    min-height: 420px;
  }
}

.site-footer {
  padding: 24px 18px 32px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  opacity: 0.7;
}

.site-footer p {
  margin: 0;
}

::selection {
  background: rgba(218, 165, 32, 0.24);
  color: var(--text);
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .scene__visual img {
    transform: none;
  }
}
