:root {
  --paper: #f3efe7;
  --ink: #23221f;
  --muted: #8b867d;
  --hairline: rgba(35, 34, 31, 0.18);
  --night: #000000;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --cn: "Noto Serif SC", "Songti SC", STSong, serif;
  --page-x: clamp(22px, 4.8vw, 78px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.fireworks-open { overflow: hidden; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.site-shell { overflow: clip; }
.section { position: relative; }

.hero {
  min-height: 100svh;
  padding: clamp(28px, 4vw, 54px) var(--page-x) clamp(28px, 4vw, 46px);
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.hero-meta {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.24em;
  color: var(--muted);
  white-space: nowrap;
}
.hero-title-wrap {
  align-self: center;
  margin-top: -2vh;
  max-width: 1120px;
}
.hero-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(78px, 13vw, 188px);
  line-height: 0.72;
  letter-spacing: -0.045em;
}
.title-line { display: block; }
.title-line--second {
  margin-left: clamp(28px, 7vw, 120px);
  color: rgba(35,34,31,.58);
}
.hero-message {
  margin-top: clamp(58px, 8vh, 92px);
  margin-left: clamp(6px, 1.2vw, 20px);
}
.birthday-en {
  margin: 0;
  font-size: clamp(13px, 1.15vw, 16px);
  letter-spacing: 0.34em;
  font-weight: 300;
}
.birthday-cn {
  margin: 24px 0 0;
  font-family: var(--cn);
  font-size: clamp(15px, 1.35vw, 19px);
  font-weight: 300;
  letter-spacing: 0.08em;
  line-height: 1.9;
}
.scroll-cue {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--muted);
  transition: color .3s ease, transform .3s ease;
}
.scroll-cue:hover { color: var(--ink); transform: translateY(3px); }

.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: riseIn 1.05s cubic-bezier(.2,.72,.26,1) forwards;
  animation-delay: .18s;
}
.reveal--fast { animation-duration: .8s; }
.reveal--delay-1 { animation-delay: .42s; }
.reveal--delay-2 { animation-delay: .74s; }
.reveal--delay-3 { animation-delay: 1.08s; }
@keyframes riseIn { to { opacity: 1; transform: translateY(0); } }

.wishes {
  padding: clamp(120px, 16vh, 190px) var(--page-x) clamp(190px, 26vh, 320px);
}
.section-header {
  max-width: 1260px;
  margin: 0 auto clamp(110px, 15vh, 180px);
}
.section-kicker {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.29em;
  color: var(--muted);
  font-weight: 400;
}
.gallery {
  width: min(100%, 1320px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(150px, 22vh, 260px);
}
.wish {
  width: min(66vw, 760px);
  margin: 0;
}
.wish--left { align-self: flex-start; margin-left: clamp(0px, 4vw, 58px); }
.wish--right { align-self: flex-end; margin-right: clamp(0px, 4vw, 58px); }
.wish-label {
  margin: 0 0 18px 2px;
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--muted);
  font-weight: 400;
}
.art-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #e8e2d8;
}
.art-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.018);
  transition: transform 1.6s cubic-bezier(.2,.72,.26,1);
}
.art-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--paper);
  transform-origin: top;
  transform: scaleY(1);
  transition: transform 1.05s cubic-bezier(.77,0,.18,1);
}
.observe-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .9s ease, transform 1.05s cubic-bezier(.2,.72,.26,1);
}
.observe-reveal.is-visible { opacity: 1; transform: translateY(0); }
.observe-reveal.is-visible .art-frame::after { transform: scaleY(0); }
.observe-reveal.is-visible .art-frame img { transform: scale(1); }

.closing {
  min-height: 120svh;
  padding: clamp(160px, 24vh, 300px) var(--page-x) clamp(90px, 14vh, 160px);
  display: flex;
  align-items: center;
}
.closing-inner {
  width: min(100%, 1260px);
  margin: 0 auto;
}
.closing-copy {
  margin-top: clamp(80px, 12vh, 130px);
}
.closing-copy p:first-child {
  margin: 0;
  font-family: var(--cn);
  font-size: clamp(20px, 2.3vw, 32px);
  font-weight: 300;
  line-height: 1.8;
  letter-spacing: 0.06em;
}
.signature {
  margin: 24px 0 0;
  font-family: var(--serif);
  font-size: 20px;
  color: var(--muted);
}
.sky-button {
  margin-top: clamp(110px, 17vh, 180px);
  padding: 16px 0 13px;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  gap: 34px;
  align-items: center;
  font: 400 10px/1 var(--sans);
  letter-spacing: .28em;
  cursor: pointer;
  transition: border-color .3s ease, letter-spacing .3s ease, opacity .3s ease;
}
.sky-button:hover { border-color: rgba(35,34,31,.65); letter-spacing: .31em; }

.fireworks-stage {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--night);
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s cubic-bezier(.4,0,.2,1), visibility 0s linear 1s;
}
.fireworks-stage.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 1s cubic-bezier(.4,0,.2,1), visibility 0s;
}
#fireworksCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.fireworks-finale {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.35s ease;
}
.fireworks-finale.is-visible { opacity: 1; pointer-events: auto; }
.finale-title {
  margin: 0;
  color: #f4efe7;
  font-family: var(--serif);
  font-size: clamp(48px, 8vw, 112px);
  font-weight: 400;
  letter-spacing: .015em;
}
.finale-subtitle {
  margin: 20px 0 0;
  color: rgba(244,239,231,.64);
  font-size: 9px;
  letter-spacing: .32em;
}
.again-button {
  position: absolute;
  bottom: clamp(32px, 7vh, 70px);
  border: 0;
  border-bottom: 1px solid rgba(244,239,231,.4);
  padding: 12px 2px;
  background: transparent;
  color: rgba(244,239,231,.72);
  font: 400 9px/1 var(--sans);
  letter-spacing: .3em;
  cursor: pointer;
  transition: color .3s ease, border-color .3s ease;
}
.again-button:hover { color: #fff; border-color: rgba(255,255,255,.85); }

@media (max-width: 760px) {
  :root { --page-x: 22px; }
  .hero { min-height: 100svh; padding-top: 24px; padding-bottom: 24px; }
  .hero-meta { font-size: 8px; letter-spacing: .18em; }
  .hero-title-wrap { margin-top: -5vh; }
  .hero-title { font-size: clamp(68px, 24vw, 104px); line-height: .78; }
  .title-line--second { margin-left: 18px; }
  .hero-message { margin-top: 52px; margin-left: 2px; }
  .birthday-en { font-size: 11px; letter-spacing: .28em; }
  .birthday-cn { margin-top: 20px; font-size: 15px; letter-spacing: .04em; }
  .scroll-cue { font-size: 8px; }

  .wishes { padding-top: 110px; padding-bottom: 200px; }
  .section-header { margin-bottom: 84px; }
  .gallery { gap: 128px; }
  .wish, .wish--left, .wish--right {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    align-self: center;
  }
  .wish-label { font-size: 10px; margin-bottom: 14px; }
  .art-frame { width: 100%; }

  .closing { min-height: 108svh; padding-top: 160px; padding-bottom: 72px; align-items: flex-start; }
  .closing-copy { margin-top: 82px; }
  .closing-copy p:first-child { font-size: 21px; }
  .sky-button { margin-top: 120px; }
  .finale-title { font-size: clamp(44px, 15vw, 72px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .observe-reveal { opacity: 1; transform: none; animation: none; transition: none; }
  .art-frame::after { display: none; }
  .art-frame img { transform: none; transition: none; }
}
