:root {
  --ink: #101528;
  --ink-soft: #1b2340;
  --paper: #f8f3ea;
  --paper-deep: #ece3d5;
  --coral: #e9786d;
  --coral-deep: #c95759;
  --gold: #e6b86e;
  --mist: #dfe9e4;
  --muted: #6c6b73;
  --line: rgba(16, 21, 40, 0.16);
  --display: "Noto Serif SC", "Songti SC", "STSong", serif;
  --body: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.7;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

button, a, input { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

a { color: inherit; }

button { cursor: pointer; }

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: .65rem .9rem;
  background: var(--paper);
  color: var(--ink);
}

.skip-link:focus { top: 1rem; }

.eyebrow {
  margin: 0 0 1rem;
  color: var(--coral-deep);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.eyebrow--light { color: var(--gold); }

h1, h2, h3, p { margin-top: 0; }

h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.2; }

h2 { margin-bottom: 1.25rem; font-size: 2.45rem; }

h3 { margin-bottom: .45rem; font-size: 1.25rem; }

em { color: var(--coral); font-style: normal; }

.button, .text-button, .icon-button, .upload-button, .wish-card {
  border: 0;
  transition: transform .25s ease, background-color .25s ease, color .25s ease, border-color .25s ease;
}

.button {
  display: inline-flex;
  min-height: 3.15rem;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: .75rem 1.3rem;
  border-radius: 999px;
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none;
}

.button:hover { transform: translateY(-2px); }

.button--light { background: var(--paper); color: var(--ink); }
.button--coral { background: var(--coral); color: #fff; }
.button--ink { background: var(--ink); color: var(--paper); }

.text-button {
  display: inline-flex;
  min-height: 2.6rem;
  align-items: center;
  gap: .45rem;
  padding: .35rem .1rem;
  background: transparent;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 700;
}

.text-button:hover { color: var(--coral-deep); }
.text-button--light { color: var(--paper); }
.text-button--light:hover { color: var(--gold); }

.icon-button {
  display: inline-grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 1.15rem;
}

.icon-button:hover { background: var(--ink); color: var(--paper); }

.intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  transition: opacity .65s ease, visibility .65s ease;
}

.intro.is-open { opacity: 0; visibility: hidden; pointer-events: none; }

.intro__stars, .hero__sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.intro__stars::before, .intro__stars::after {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 10vw 14vh var(--gold), 26vw 72vh var(--paper), 42vw 20vh var(--mist), 64vw 38vh var(--gold), 82vw 16vh var(--paper), 92vw 76vh var(--mist), 15vw 88vh var(--coral), 73vw 88vh var(--gold);
  content: "";
  opacity: .75;
}

.intro__stars::before { left: 6vw; top: 8vh; }
.intro__stars::after { left: 52vw; top: 60vh; transform: scale(.65); }

.envelope-wrap { position: relative; z-index: 1; width: min(33rem, calc(100% - 2.5rem)); }

.envelope {
  position: relative;
  width: min(17rem, 68vw);
  aspect-ratio: 1.35;
  margin: 0 auto 2.4rem;
  border: 1px solid rgba(248, 243, 234, .35);
  background: #d8b58d;
  box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, .25);
  transform: rotate(-3deg);
}

.envelope__paper {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 12%;
  height: 76%;
  background: var(--paper);
  transform: translateY(-13%);
}

.envelope__flap {
  position: absolute;
  inset: 0 0 20%;
  background: #e5c49e;
  clip-path: polygon(0 0, 100% 0, 50% 72%);
}

.envelope__seal {
  position: absolute;
  left: 50%;
  top: 49%;
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: 50%;
  background: var(--coral-deep);
  color: var(--paper);
  font-family: var(--display);
  transform: translate(-50%, -50%);
}

.intro h1 { margin-bottom: .8rem; font-size: 2.65rem; }
.intro__copy { margin: 0 auto 1.7rem; color: rgba(248, 243, 234, .78); }
.intro__hint { position: absolute; bottom: 1.5rem; margin: 0; color: rgba(248, 243, 234, .55); font-size: .76rem; }

.site-header {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 50%;
  display: flex;
  width: min(76rem, calc(100% - 2.5rem));
  min-height: 5.2rem;
  align-items: center;
  justify-content: space-between;
  color: var(--paper);
  transform: translateX(-50%);
}

.brand { display: inline-flex; align-items: center; gap: .65rem; font-size: .86rem; font-weight: 700; text-decoration: none; }
.brand__mark { display: grid; width: 2rem; height: 2rem; place-items: center; border: 1px solid rgba(248, 243, 234, .55); border-radius: 50%; font-family: var(--display); }
.site-nav { display: flex; gap: 1.5rem; margin-left: auto; margin-right: 1.6rem; font-size: .8rem; }
.site-nav a { color: rgba(248, 243, 234, .8); text-decoration: none; }
.site-nav a:hover { color: var(--gold); }
.header-actions { display: flex; gap: .55rem; }
.site-header .icon-button { border-color: rgba(248, 243, 234, .4); color: var(--paper); }
.site-header .icon-button:hover { background: var(--paper); color: var(--ink); }

.hero {
  position: relative;
  min-height: min(54rem, 100svh);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background-color: var(--ink);
  background-image: url("assets/hero-couple.jpg");
  background-position: center 42%;
  background-size: cover;
  color: var(--paper);
}

.hero::before { position: absolute; inset: 0; background: rgba(16, 21, 40, .58); content: ""; }
.hero__content { position: relative; z-index: 1; width: min(76rem, calc(100% - 2.5rem)); margin: 0 auto; padding: 7.5rem 0 8.2rem; }
.hero h2 { max-width: 39rem; margin-bottom: 1.35rem; font-size: 4.8rem; letter-spacing: 0; }
.hero__lede { max-width: 30rem; margin-bottom: 2rem; color: rgba(248, 243, 234, .82); font-size: 1.02rem; }
.hero__actions { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.heart-glyph { font-size: 1.55rem; font-weight: 400; line-height: 1; }
.hero__note { min-height: 1.7rem; margin: 1rem 0 0; color: var(--gold); font-size: .78rem; }
.hero__stamp { position: absolute; z-index: 1; right: max(2.5rem, calc((100% - 76rem) / 2)); bottom: 3.5rem; display: grid; gap: .12rem; color: rgba(248, 243, 234, .72); font-size: .7rem; text-align: right; }
.hero__stamp strong { color: var(--gold); font-family: var(--display); font-size: 1.2rem; font-weight: 500; }
.scroll-cue { position: absolute; z-index: 1; left: 50%; bottom: 1.2rem; color: var(--paper); font-size: 1.5rem; text-decoration: none; transform: translateX(-50%); }
.scroll-cue:hover { color: var(--gold); }

.star { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--paper); box-shadow: 0 0 14px 3px rgba(248, 243, 234, .55); }
.star--one { top: 18%; left: 16%; }
.star--two { top: 22%; left: 72%; width: 5px; height: 5px; background: var(--gold); }
.star--three { top: 42%; left: 59%; }
.star--four { top: 30%; left: 88%; width: 2px; height: 2px; }
.star--five { top: 64%; left: 35%; background: var(--coral); }

.section { padding: 7rem max(1.25rem, calc((100% - 76rem) / 2)); }
.section--paper { background: var(--paper); }
.section--ink { background: var(--ink); color: var(--paper); }
.section-heading { max-width: 38rem; margin-bottom: 4rem; }
.section-heading h2 { margin-bottom: 1rem; }
.section-heading > p:last-child { color: var(--muted); }

.timeline { display: grid; gap: 0; }
.timeline-item { display: grid; grid-template-columns: 8rem 2rem minmax(0, 1fr); gap: 1.25rem; min-height: 8.7rem; }
.timeline-item__date { margin: .15rem 0 0; color: var(--coral-deep); font-size: .78rem; font-weight: 700; letter-spacing: .08em; }
.timeline-item__line { position: relative; display: flex; justify-content: center; }
.timeline-item__line::before { position: absolute; top: .5rem; bottom: -.5rem; width: 1px; background: var(--line); content: ""; }
.timeline-item:last-child .timeline-item__line::before { bottom: 4rem; }
.timeline-item__line span { position: relative; z-index: 1; width: .7rem; height: .7rem; margin-top: .42rem; border: 2px solid var(--coral); border-radius: 50%; background: var(--paper); }
.timeline-item--current .timeline-item__line span { background: var(--coral); box-shadow: 0 0 0 .45rem rgba(233, 120, 109, .14); }
.timeline-item p:last-child { max-width: 34rem; margin: 0; color: var(--muted); }

.memories { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 7rem; align-items: center; }
.memories__photo { max-width: 31rem; }
.photo-frame { position: relative; padding: .75rem .75rem 2.8rem; background: var(--paper); color: var(--ink); transform: rotate(-2deg); box-shadow: 1.2rem 1.4rem 0 rgba(230, 184, 110, .18); }
.photo-frame img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.photo-frame__label { position: absolute; bottom: .65rem; left: 1.1rem; font-family: var(--display); font-size: .92rem; }
.upload-button { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.7rem; margin-top: 1.5rem; padding: .5rem .8rem; border: 1px solid rgba(248, 243, 234, .35); border-radius: 999px; color: var(--paper); font-size: .8rem; }
.upload-button:hover { border-color: var(--gold); color: var(--gold); }
.upload-button input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.photo-credit { margin: .65rem 0 0; color: rgba(248, 243, 234, .5); font-size: .7rem; }
.memories__copy h2 { max-width: 32rem; color: var(--paper); }
.memories__copy > p:not(.eyebrow) { max-width: 29rem; color: rgba(248, 243, 234, .72); }
.memory-signature { display: flex; align-items: center; gap: .8rem; margin-top: 2.4rem; color: var(--gold); font-family: var(--display); font-size: .92rem; }
.memory-signature__line { display: inline-block; width: 3rem; height: 1px; background: var(--gold); }

.wish-section { border-bottom: 1px solid var(--line); }
.section-heading--split { display: grid; grid-template-columns: 1fr .8fr; gap: 3rem; align-items: end; max-width: none; }
.section-heading--split > p { margin: 0 0 1.1rem; }
.wish-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.wish-card { display: grid; min-height: 13.5rem; align-content: space-between; padding: 1.4rem; border: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.wish-card:hover, .wish-card.is-selected { border-color: var(--coral); background: #f1e4d9; transform: translateY(-4px); }
.wish-card__number { color: var(--coral-deep); font-size: .76rem; font-weight: 700; letter-spacing: .12em; }
.wish-card__title { font-family: var(--display); font-size: 1.45rem; }
.wish-card__meta { max-width: 12rem; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.wish-response { min-height: 1.7rem; margin: 1.4rem 0 0; color: var(--coral-deep); font-weight: 700; }

.letter-section { display: grid; grid-template-columns: 5rem minmax(0, 41rem); gap: 3rem; justify-content: center; background: var(--paper-deep); }
.letter-section__aside { display: grid; align-content: start; justify-items: center; gap: 1rem; padding-top: .5rem; color: var(--coral-deep); }
.letter-section__seal { display: grid; width: 3.5rem; height: 3.5rem; place-items: center; border: 1px solid var(--coral-deep); border-radius: 50%; font-size: 1.7rem; }
.letter-section__vertical { writing-mode: vertical-rl; font-family: var(--display); font-size: .78rem; letter-spacing: .18em; }
.letter-intro { margin-bottom: 1.5rem; color: var(--muted); }
.letter-paper { margin-top: 2rem; padding: 2rem; border: 1px solid rgba(16, 21, 40, .14); background: rgba(248, 243, 234, .7); font-family: var(--display); font-size: 1.08rem; }
.letter-paper p { margin-bottom: 1.2rem; }
.letter-paper__highlight { color: var(--coral-deep); font-size: 1.35rem; }
.letter-paper__sign { margin: 2.2rem 0 0; color: var(--muted); font-size: .9rem; text-align: right; }

.countdown-section { display: grid; grid-template-columns: 1.2fr 1.7fr auto; gap: 3rem; align-items: center; padding: 4rem max(1.25rem, calc((100% - 76rem) / 2)); background: var(--ink-soft); color: var(--paper); }
.countdown-section h2 { margin-bottom: .5rem; font-size: 2rem; }
.countdown-section__copy p:last-child { margin: 0; color: rgba(248, 243, 234, .65); font-size: .82rem; }
.countdown-grid { display: grid; grid-template-columns: repeat(4, minmax(4rem, 1fr)); gap: .6rem; }
.countdown-unit { display: grid; min-height: 6.5rem; align-content: center; justify-items: center; border-left: 1px solid rgba(248, 243, 234, .2); }
.countdown-unit strong { color: var(--gold); font-family: var(--display); font-size: 2.6rem; font-weight: 500; line-height: 1; }
.countdown-unit span { margin-top: .55rem; color: rgba(248, 243, 234, .6); font-size: .74rem; }
.together-counter { display: grid; justify-items: end; gap: .15rem; color: rgba(248, 243, 234, .68); font-size: .75rem; text-align: right; white-space: nowrap; }
.together-counter strong { color: var(--paper); font-family: var(--display); font-size: 1.6rem; font-weight: 500; }

.final-section { position: relative; display: grid; min-height: 38rem; place-items: center; overflow: hidden; padding: 7rem 1.25rem; background: var(--paper); text-align: center; }
.final-section__content { position: relative; z-index: 1; max-width: 34rem; }
.final-section h2 { font-size: 3.6rem; }
.final-section__content > p:not(.eyebrow):not(.final-response) { color: var(--muted); }
.final-actions { display: flex; justify-content: center; align-items: center; gap: 1.4rem; margin-top: 2rem; flex-wrap: wrap; }
.final-response { min-height: 1.7rem; margin: 1.25rem 0 0; color: var(--coral-deep); font-weight: 700; }
.celebration { position: absolute; inset: 0; pointer-events: none; }
.celebration span { position: absolute; top: 54%; color: var(--coral); font-size: 1.7rem; animation: float-up 1.8s ease-out forwards; }
@keyframes float-up { from { opacity: 0; transform: translate3d(0, 1rem, 0) rotate(0); } 15% { opacity: 1; } to { opacity: 0; transform: translate3d(var(--drift), -18rem, 0) rotate(240deg); } }

.site-footer { display: flex; min-height: 5rem; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem max(1.25rem, calc((100% - 76rem) / 2)); background: var(--ink); color: rgba(248, 243, 234, .6); font-size: .7rem; }
.site-footer a { color: var(--gold); text-decoration: none; }

[hidden] { display: none !important; }

@media (max-width: 760px) {
  h2 { font-size: 2rem; }
  .site-header { width: calc(100% - 2rem); min-height: 4.5rem; }
  .site-nav { display: none; }
  .hero { min-height: 100svh; background-position: 60% center; }
  .hero__content { width: calc(100% - 2rem); padding: 7rem 0 6.5rem; }
  .hero h2 { font-size: 3.15rem; }
  .hero__lede { max-width: 21rem; font-size: .92rem; }
  .hero__stamp { right: 1rem; bottom: 3.4rem; }
  .section { padding: 5rem 1rem; }
  .section-heading { margin-bottom: 3rem; }
  .timeline-item { grid-template-columns: 5.2rem 1.5rem minmax(0, 1fr); gap: .75rem; min-height: 9.5rem; }
  .timeline-item__date { font-size: .68rem; }
  .timeline-item h3 { font-size: 1.1rem; }
  .timeline-item p:last-child { font-size: .85rem; }
  .memories { grid-template-columns: 1fr; gap: 4rem; }
  .memories__photo { max-width: 24rem; margin: 0 auto; }
  .section-heading--split { grid-template-columns: 1fr; gap: 0; }
  .wish-grid { grid-template-columns: 1fr; }
  .wish-card { min-height: 9rem; }
  .letter-section { grid-template-columns: 2.4rem minmax(0, 1fr); gap: 1.3rem; }
  .letter-section__vertical { font-size: .66rem; }
  .letter-paper { padding: 1.35rem; font-size: 1rem; }
  .countdown-section { grid-template-columns: 1fr; gap: 2rem; padding: 4rem 1rem; }
  .countdown-grid { gap: .25rem; }
  .countdown-unit { min-height: 5.5rem; }
  .countdown-unit strong { font-size: 2rem; }
  .together-counter { justify-items: start; text-align: left; }
  .final-section { min-height: 33rem; padding: 5rem 1rem; }
  .final-section h2 { font-size: 2.75rem; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
