@font-face {
  font-family: "Cabin Display";
  src: url("assets/kuaile.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+20,U+38,U+43,U+4F01,U+5212,U+522B,U+5FC6,U+65E5,U+665A,U+7279,U+751F,U+7684,U+8BB0,U+90A3;
}
:root {
  color-scheme: light;
  --ink: #332a27;
  --paper: #fffdf7;
  --heading: "Cabin Display", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --body: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.75 var(--body); }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 3px solid #965471; outline-offset: 5px; }
h1, h2, p, figure { margin: 0; }
img { display: block; max-width: 100%; }
.shell { width: min(1220px, calc(100% - 110px)); margin-inline: auto; }
.skip-link { position: absolute; z-index: 5; left: 12px; top: 12px; transform: translateY(-160%); background: white; padding: 7px 12px; }
.skip-link:focus { transform: none; }

.site-header { background: #fffdf8; border-bottom: 1px solid #e7dbc7; }
.masthead { display: flex; min-height: 79px; align-items: center; }
.brand { display: inline-flex; gap: 11px; align-items: center; white-space: nowrap; }
.brand img { width: 44px; height: 44px; }
.brand span { font-family: "Trebuchet MS", var(--body); font-weight: 800; letter-spacing: -.065em; font-size: 26px; line-height: 1; }

.hero {
  min-height: min(780px, calc(100svh - 79px));
  display: grid;
  grid-template-columns: minmax(0, .91fr) minmax(0, 1.09fr);
  grid-template-areas: "title portrait" "keepsakes portrait";
  grid-template-rows: auto 1fr;
  column-gap: clamp(35px, 6vw, 95px);
  align-items: start;
  padding-block: clamp(42px, 6vw, 86px) 40px;
}
h1 { grid-area: title; justify-self: center; font: 400 clamp(56px, 6.2vw, 94px)/.99 var(--heading); letter-spacing: -.065em; }
.headline-first, .headline-last { display: block; width: max-content; max-width: 100%; }
.headline-first { transform: rotate(-3deg); transform-origin: left bottom; }
.birthday-index { color: #a64c1b; font-size: .99em; }
.headline-last { position: relative; isolation: isolate; margin-top: .125em; padding: 0 .10em .10em 0; }
.headline-last::after {
  position: absolute; z-index: -1; left: .02em; right: -.05em; bottom: .06em; height: .14em;
  border-radius: 75% 35% 68% 18%; transform: rotate(-2.7deg); background: #ffb1bc; content: "";
}

.birthday-portrait {
  grid-area: portrait; justify-self: center; align-self: center;
  width: auto; height: auto; max-width: 100%; max-height: min(66svh, 585px);
  object-fit: contain;
}
.birthday-keepsakes {
  grid-area: keepsakes; justify-self: center; align-self: start;
  display: flex; align-items: center; justify-content: center;
  gap: clamp(24px, 4vw, 58px); margin-top: clamp(35px, 5vw, 72px);
}
.birthday-scroll { width: clamp(76px, 7.5vw, 108px); height: auto; }
.birthday-cake { width: clamp(125px, 15vw, 224px); height: auto; filter: drop-shadow(1px 5px 3px #49362b26); }
.birthday-sequence { position: relative; }
.birthday-sequence .theatre { padding: clamp(36px, 5vw, 76px) 0 clamp(42px, 6vw, 84px); }
.birthday-sequence .scroll-content { position: relative; width: min(450px, calc(100% - 46px)); margin-inline: auto; }
.birthday-sequence .paper-window { position: relative; }
.birthday-sequence .paper { position: relative; width: 100%; aspect-ratio: 2462 / 8186; }
.scroll-scan { width: 100%; height: 100%; filter: drop-shadow(2px 4px 5px #4c392d29); }
.scroll-scan:not([src]) { display: none; }
.birthday-sequence .roll, .birthday-sequence .paper-curl-shadow { display: none; }

.has-motion .birthday-sequence .hero { position: absolute; inset: 0 0 auto; }
.has-motion .birthday-scroll { opacity: var(--dock-opacity, 1); }
.has-motion .birthday-sequence .stage { position: sticky; top: 0; height: 100svh; pointer-events: none; }
.has-motion .birthday-sequence .theatre { position: absolute; inset: 0; padding: 0; overflow: clip; }
.has-motion .birthday-sequence .scroll-content {
  position: absolute; top: var(--top, 0px); left: 0; right: 0; width: var(--paper-width);
}
.has-motion .birthday-sequence .paper-window {
  clip-path: inset(0 -12px var(--cut, 100%) -12px);
}
.scroll-gifts {
  --gift-gutter: calc((100vw - 100%) / 2);
  position: absolute; inset: 0; pointer-events: none;
}
.has-motion .scroll-gifts { opacity: var(--gift-opacity, 0); }
.scroll-gift {
  position: absolute;
  top: var(--gift-top);
  left: calc(100% + var(--gift-gutter) * var(--gift-gap));
  width: min(var(--gift-width), calc(var(--gift-gutter) * var(--gift-share, .55)));
  height: auto;
  rotate: var(--gift-tilt);
}
.scroll-gift-left { left: auto; right: calc(100% + var(--gift-gutter) * var(--gift-gap)); }
.gift-aviator { --gift-top: 2%; --gift-gap: .23; --gift-width: 194px; --gift-tilt: -12deg; }
.gift-mango { --gift-top: 15%; --gift-gap: .73; --gift-width: 83px; --gift-share: .18; --gift-tilt: 10deg; }
.gift-bear { --gift-top: 4%; --gift-gap: .27; --gift-width: 193px; --gift-tilt: 9deg; }
.gift-dragon { --gift-top: 70%; --gift-gap: .23; --gift-width: 239px; --gift-tilt: -9deg; }
.gift-light { --gift-top: 73%; --gift-gap: .40; --gift-width: 87px; --gift-share: .27; --gift-tilt: 9deg; }
.scroll-wish {
  position: absolute; z-index: 2; top: var(--wish-anchor); left: calc(100% + 16px);
  display: flex; align-items: flex-start; gap: 9px; width: clamp(226px, 24vw, 300px);
  translate: 0 -50%;
}
.scroll-wish-left { left: auto; right: calc(100% + 16px); flex-direction: row-reverse; }
.wish-avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.wish-bubble {
  min-width: 0; padding: 12px 16px; border-radius: 24px 24px 24px 11px;
  background: #e7ebee; color: #151719;
  font: 15px/1.48 "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
.scroll-wish-left .wish-bubble { border-radius: 24px 24px 11px 24px; }
.wish-sender { margin-bottom: 3px; color: #62676d; font-size: 12px; }
.has-motion .scroll-wish {
  visibility: hidden; opacity: 0; transform: translateY(8px) scale(.96); transform-origin: top left;
  transition: opacity .2s ease, transform .24s cubic-bezier(.2,.75,.25,1);
}
.has-motion .scroll-wish.is-revealed { visibility: visible; opacity: 1; transform: none; pointer-events: auto; }
.has-motion .scroll-wish.is-revealed .wish-bubble { animation: wish-pop .26s .08s both; transform-origin: left top; }
@keyframes wish-pop {
  from { opacity: 0; transform: translateX(-4px) scale(.94); }
  to { opacity: 1; transform: none; }
}
.has-motion .birthday-sequence .paper-curl-shadow {
  display: block; position: absolute; inset: var(--paper-edge) 2.5% auto; height: var(--curl-height);
  transform: translateY(-100%); background: linear-gradient(transparent, #433b30a8); opacity: var(--curl-opacity, 0);
}
.has-motion .birthday-sequence .roll { display: block; position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; }

.wish-room-section { padding-block: 12px clamp(26px, 4vw, 54px); }
.wish-room-frame { display: block; width: 100%; height: 640px; border: 0; }

@media (max-width: 1060px) {
  .shell { width: calc(100% - 64px); }
  .scroll-wish { left: auto; right: -9px; width: min(272px, calc(100% - 15px)); translate: none; }
  .scroll-wish-left { left: -9px; right: auto; flex-direction: row; }
  .scroll-wish-left .wish-bubble { border-radius: 24px 24px 24px 11px; }
  .has-motion .scroll-wish { top: calc(var(--wish-trigger) + 30px); }
  .has-motion .scroll-wish.is-revealed:not(.is-current, .is-nearby) { visibility: hidden; opacity: 0; pointer-events: none; }
  .has-motion .scroll-wish.is-nearby { top: calc(var(--current-wish-trigger) + 21px); translate: 0 -100%; }
  html:not(.has-motion) .scroll-wish { position: static; width: 100%; margin-top: 12px; translate: none; }
}
@media (max-width: 620px) {
  .scroll-gifts { display: none; }
}
@media (max-width: 800px) {
  .hero { min-height: auto; grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "keepsakes" "portrait"; grid-template-rows: auto auto 1fr; gap: 22px; max-width: 550px; padding-block: 42px 26px; }
  h1 { justify-self: start; }
  .birthday-keepsakes { margin-top: 4px; }
  .birthday-portrait { max-width: min(90%, 400px); max-height: none; }
}
@media (max-width: 480px) {
  .shell { width: calc(100% - 34px); }
  .masthead { min-height: 65px; gap: 8px; }
  .brand { gap: 7px; }
  .brand img { width: 34px; height: 34px; }
  .brand span { font-size: clamp(17px, 5vw, 22px); }
  .hero { padding-block: 35px 24px; }
  h1 { font-size: clamp(45px, 13vw, 60px); }
  .scroll-wish { gap: 7px; }
  .wish-avatar { width: 36px; height: 36px; }
  .wish-bubble { padding: 9px 13px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
