:root {
  --ink: #081b1d;
  --ink-soft: #102e30;
  --cream: #fff2d5;
  --cream-muted: #dccfb7;
  --coral: #ff796b;
  --coral-deep: #d9584d;
  --saffron: #ffc966;
  --mint: #a9d8c2;
  --pink: #f4b2ad;
  --paper: #f6ead2;
  --charcoal: #183134;
  --shadow: rgba(0, 0, 0, 0.38);
  --serif-cn: "STSong", "Songti SC", "SimSun", serif;
  --display-cn: "STKaiti", "KaiTi", "FangSong", serif;
  --sans-cn: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--ink);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--cream);
  background:
    linear-gradient(118deg, transparent 0 32%, rgba(255, 242, 213, 0.025) 32.2% 32.5%, transparent 32.7%),
    linear-gradient(62deg, transparent 0 70%, rgba(255, 121, 107, 0.025) 70.2% 70.5%, transparent 70.7%),
    var(--ink);
  font-family: var(--sans-cn);
  -webkit-font-smoothing: antialiased;
}

button,
dialog {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 5px;
}

.icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

#world-canvas {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.paper-grain {
  position: fixed;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 48px, 1240px);
  margin: 0 auto;
  padding: 28px 0 0;
}

.edition {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 242, 213, 0.6);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.edition-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 5px rgba(255, 121, 107, 0.1);
  animation: breathe 2.4s ease-in-out infinite;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 242, 213, 0.22);
  border-radius: 50%;
  background: rgba(255, 242, 213, 0.04);
  cursor: pointer;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.icon-button:hover {
  border-color: rgba(255, 242, 213, 0.54);
  background: rgba(255, 242, 213, 0.09);
  transform: translateY(-1px);
}

.sound-toggle .icon-volume-off {
  display: none;
}

.sound-toggle[aria-pressed="true"] {
  color: var(--saffron);
  border-color: rgba(255, 201, 102, 0.45);
}

.sound-toggle[aria-pressed="true"] .icon-volume-on {
  display: none;
}

.sound-toggle[aria-pressed="true"] .icon-volume-off {
  display: block;
}

.birthday-stage {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 72px);
  min-height: calc(100dvh - 72px);
  padding: 28px 24px 38px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  grid-template-areas:
    "copy illustration"
    "wishes illustration"
    "actions signature";
  align-items: center;
  column-gap: 38px;
  width: min(100%, 1160px);
}

.hero-copy {
  grid-area: copy;
  align-self: end;
  padding-left: 3px;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 22px;
  color: var(--saffron);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.kicker-line {
  width: 44px;
  height: 1px;
  background: var(--saffron);
  transform-origin: left;
}

h1 {
  margin: 0;
  color: var(--cream);
  font-family: var(--display-cn);
  font-size: 5.8rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.98;
  text-wrap: balance;
}

h1 > span {
  display: block;
}

.recipient {
  margin-bottom: 8px;
  color: var(--coral);
  font-family: var(--sans-cn);
  font-size: 1rem;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.32em;
  line-height: 1.5;
}

.title-line {
  text-shadow: 0 10px 42px rgba(255, 201, 102, 0.12);
}

.intro-copy {
  max-width: 560px;
  margin: 28px 0 0;
  color: rgba(255, 242, 213, 0.68);
  font-family: var(--serif-cn);
  font-size: 1.06rem;
  letter-spacing: 0.08em;
  line-height: 1.9;
}

.illustration {
  position: relative;
  grid-area: illustration;
  justify-self: end;
  width: min(100%, 520px);
  height: 440px;
  isolation: isolate;
}

.illustration::before {
  position: absolute;
  z-index: -2;
  right: 7%;
  bottom: 0;
  width: 82%;
  height: 74%;
  border: 1px solid rgba(255, 242, 213, 0.08);
  border-radius: 50% 50% 4px 4px;
  content: "";
}

.illustration::after {
  position: absolute;
  z-index: -1;
  right: 9.5%;
  bottom: 2%;
  width: 76%;
  height: 57%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.36), transparent 70%);
  content: "";
  filter: blur(12px);
}

.ribbon-script {
  position: absolute;
  z-index: 2;
  top: 28px;
  left: 10%;
  color: rgba(255, 242, 213, 0.16);
  font-family: "Segoe Script", "Bradley Hand", cursive;
  font-size: 1.7rem;
  transform: rotate(-8deg);
}

.spark {
  position: absolute;
  z-index: 4;
  width: 7px;
  height: 7px;
  background: var(--saffron);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  opacity: 0.24;
  transition:
    opacity 600ms ease,
    transform 800ms cubic-bezier(0.22, 1, 0.36, 1);
}

.spark-one {
  top: 76px;
  right: 12%;
}

.spark-two {
  top: 170px;
  left: 8%;
  width: 10px;
  height: 10px;
  background: var(--coral);
}

.spark-three {
  top: 38px;
  right: 41%;
  width: 5px;
  height: 5px;
  background: var(--mint);
}

.cake {
  position: absolute;
  z-index: 3;
  bottom: 24px;
  left: 50%;
  width: 350px;
  height: 342px;
  transform: translateX(-50%);
}

.candles {
  position: absolute;
  z-index: 8;
  top: 21px;
  left: 50%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  width: 200px;
  height: 82px;
  transform: translateX(-50%);
}

.candle {
  position: relative;
  width: 13px;
  height: 54px;
  border-radius: 7px 7px 2px 2px;
  background:
    repeating-linear-gradient(
      145deg,
      var(--coral) 0 6px,
      #ffd8bb 6px 11px
    );
  box-shadow:
    inset -3px 0 0 rgba(0, 0, 0, 0.1),
    0 5px 10px rgba(0, 0, 0, 0.18);
}

.candle::before {
  position: absolute;
  top: -11px;
  left: 50%;
  width: 1px;
  height: 12px;
  background: #3a2d25;
  content: "";
  transform: translateX(-50%);
}

.candle-1,
.candle-5 {
  height: 45px;
}

.candle-2,
.candle-4 {
  height: 51px;
}

.candle-3 {
  height: 58px;
}

.flame {
  position: absolute;
  top: -32px;
  left: 50%;
  width: 13px;
  height: 21px;
  border-radius: 50% 50% 46% 46%;
  background: #fff8c8;
  box-shadow:
    0 0 8px 3px rgba(255, 221, 106, 0.8),
    0 0 34px 10px rgba(255, 156, 73, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) scale(0.1);
  transform-origin: 50% 100%;
  transition:
    opacity 500ms ease,
    transform 650ms cubic-bezier(0.22, 1, 0.36, 1);
}

.flame::before {
  position: absolute;
  inset: 4px 4px 2px;
  border-radius: inherit;
  background: linear-gradient(#ffdb62, #ff8a53);
  content: "";
}

.is-awake .flame {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  animation: flicker 1.4s ease-in-out infinite alternate;
}

.is-wished .flame {
  opacity: 0;
  transform: translateX(-50%) translateY(-15px) scale(0.15);
  animation: none;
}

.cake-tier {
  position: absolute;
  left: 50%;
  overflow: hidden;
  border: 1px solid rgba(255, 242, 213, 0.2);
  background: linear-gradient(135deg, #e99286 0%, #cd625d 56%, #ad4848 100%);
  box-shadow:
    inset 10px 0 30px rgba(255, 242, 213, 0.08),
    inset -12px -8px 28px rgba(74, 23, 27, 0.22),
    0 24px 32px rgba(0, 0, 0, 0.2);
  transform: translateX(-50%);
}

.cake-tier::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 34px;
  background:
    radial-gradient(circle at 12px 5px, var(--paper) 0 11px, transparent 11.5px) 0 -3px / 32px 38px repeat-x,
    var(--paper);
  content: "";
  filter: drop-shadow(0 4px 2px rgba(87, 30, 30, 0.15));
}

.cake-tier::after {
  position: absolute;
  right: 20px;
  bottom: 10px;
  left: 20px;
  height: 1px;
  background: rgba(255, 242, 213, 0.22);
  content: "";
}

.cake-tier-top {
  top: 84px;
  width: 218px;
  height: 92px;
  border-radius: 13px 13px 26px 26px;
}

.cake-tier-bottom {
  top: 169px;
  width: 330px;
  height: 113px;
  border-radius: 14px 14px 30px 30px;
}

.cake-tier-bottom::before {
  height: 38px;
  background:
    radial-gradient(circle at 15px 4px, var(--paper) 0 13px, transparent 13.5px) 0 -4px / 40px 42px repeat-x,
    var(--paper);
}

.cake-plate {
  position: absolute;
  z-index: -1;
  bottom: 14px;
  left: 50%;
  width: 383px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(#f0d7aa, #c9a97c);
  box-shadow:
    0 9px 11px rgba(0, 0, 0, 0.28),
    inset 0 5px 0 rgba(255, 255, 255, 0.25);
  transform: translateX(-50%);
}

.sprinkle {
  position: absolute;
  z-index: 3;
  top: 46px;
  width: 3px;
  height: 10px;
  border-radius: 4px;
  background: var(--saffron);
  transform: rotate(40deg);
}

.sprinkle.s1 {
  left: 34px;
}

.sprinkle.s2 {
  top: 59px;
  left: 71px;
  background: var(--mint);
  transform: rotate(-52deg);
}

.sprinkle.s3 {
  top: 48px;
  left: 112px;
  background: #fff0c0;
  transform: rotate(18deg);
}

.sprinkle.s4 {
  top: 65px;
  left: 143px;
  background: var(--mint);
  transform: rotate(64deg);
}

.sprinkle.s5 {
  top: 50px;
  left: 176px;
  transform: rotate(-28deg);
}

.sprinkle.s6 {
  top: 62px;
  left: 193px;
  background: #fff0c0;
  transform: rotate(20deg);
}

.berry {
  position: absolute;
  z-index: 3;
  top: 51px;
  width: 14px;
  height: 14px;
  border-radius: 50% 50% 46% 46%;
  background: var(--coral-deep);
  box-shadow:
    inset 3px 3px 3px rgba(255, 255, 255, 0.22),
    0 2px 3px rgba(0, 0, 0, 0.2);
}

.berry::before {
  position: absolute;
  top: -4px;
  left: 4px;
  width: 6px;
  height: 6px;
  background: var(--mint);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  content: "";
}

.berry.b1 {
  left: 34px;
}

.berry.b2 {
  top: 61px;
  left: 90px;
}

.berry.b3 {
  top: 47px;
  left: 155px;
}

.berry.b4 {
  top: 62px;
  left: 225px;
}

.berry.b5 {
  top: 47px;
  right: 35px;
}

.gift {
  position: absolute;
  z-index: 6;
  right: 0;
  bottom: 18px;
  width: 128px;
  height: 144px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: 0.88;
  transform: translateY(7px) rotate(2deg);
  transition:
    transform 300ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 300ms ease;
}

.gift:hover {
  opacity: 1;
  transform: translateY(0) rotate(-2deg);
}

.gift-shadow {
  position: absolute;
  bottom: 0;
  left: 12px;
  width: 110px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.28);
  filter: blur(6px);
}

.gift-body {
  position: absolute;
  right: 10px;
  bottom: 9px;
  width: 102px;
  height: 83px;
  border-radius: 4px 4px 8px 8px;
  background: linear-gradient(135deg, #f8c764, #d89239);
  box-shadow:
    inset -8px -4px 0 rgba(126, 71, 19, 0.13),
    0 13px 18px rgba(0, 0, 0, 0.18);
}

.gift-lid {
  position: absolute;
  z-index: 2;
  right: 3px;
  bottom: 84px;
  width: 116px;
  height: 28px;
  border-radius: 5px;
  background: linear-gradient(#ffd879, #eab14b);
  box-shadow: inset 0 -4px 0 rgba(126, 71, 19, 0.1);
  transform-origin: 13% 100%;
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gift-ribbon {
  position: absolute;
  z-index: 3;
  background: var(--coral);
  box-shadow: inset 2px 0 0 rgba(255, 255, 255, 0.12);
}

.gift-ribbon-v {
  right: 52px;
  bottom: 9px;
  width: 22px;
  height: 103px;
}

.gift-ribbon-h {
  right: 10px;
  bottom: 51px;
  width: 102px;
  height: 19px;
}

.gift-bow {
  position: absolute;
  z-index: 4;
  bottom: 97px;
  width: 42px;
  height: 28px;
  border: 11px solid var(--coral);
  background: rgba(255, 242, 213, 0.08);
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gift-bow-left {
  right: 57px;
  border-radius: 50% 13% 50% 18%;
  transform: rotate(15deg);
}

.gift-bow-right {
  right: 19px;
  border-radius: 13% 50% 18% 50%;
  transform: rotate(-15deg);
}

.is-awake .gift-lid {
  transform: translateY(-7px) rotate(-8deg);
}

.is-awake .gift-bow-left {
  transform: translate(-4px, -7px) rotate(24deg);
}

.is-awake .gift-bow-right {
  transform: translate(4px, -7px) rotate(-24deg);
}

.wish-block {
  grid-area: wishes;
  align-self: start;
  max-height: 0;
  margin-top: 5px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px);
  transition:
    max-height 700ms ease,
    opacity 700ms 180ms ease,
    transform 700ms 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.is-awake .wish-block {
  max-height: 120px;
  opacity: 1;
  transform: translateY(0);
}

.wish-heading {
  margin: 0 0 15px;
  color: rgba(255, 242, 213, 0.46);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.wish-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.wish-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 14px;
  border: 1px solid rgba(255, 242, 213, 0.16);
  border-radius: 999px;
  color: rgba(255, 242, 213, 0.78);
  font-family: var(--serif-cn);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.wish-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--coral);
}

.wish-pill:nth-child(2) i {
  background: var(--saffron);
}

.wish-pill:nth-child(3) i {
  background: var(--mint);
}

.actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 35px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

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

.button:active {
  transform: translateY(0);
}

.button-primary {
  border: 1px solid var(--coral);
  color: var(--ink);
  background: var(--coral);
  box-shadow: 0 12px 28px rgba(255, 121, 107, 0.16);
}

.button-primary:hover {
  background: #ff8c7f;
}

.button-quiet {
  border: 1px solid rgba(255, 242, 213, 0.2);
  color: var(--cream);
  background: rgba(255, 242, 213, 0.04);
}

.button-quiet:hover {
  border-color: rgba(255, 242, 213, 0.45);
  background: rgba(255, 242, 213, 0.08);
}

.signature {
  grid-area: signature;
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 11px;
  margin: 37px 28px 0 0;
  color: rgba(255, 242, 213, 0.4);
  font-size: 0.59rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.signature i {
  width: 22px;
  height: 1px;
  background: rgba(255, 242, 213, 0.25);
}

.signature span:last-child {
  color: rgba(255, 242, 213, 0.6);
  font-family: var(--serif-cn);
  letter-spacing: 0.08em;
}

.status-message {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 0;
  width: fit-content;
  max-width: min(90%, 500px);
  margin: 0 auto;
  padding: 11px 18px;
  border: 1px solid rgba(255, 242, 213, 0.15);
  border-radius: 999px;
  color: var(--cream);
  background: rgba(8, 27, 29, 0.9);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.24);
  font-family: var(--serif-cn);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 250ms ease,
    transform 250ms ease;
  backdrop-filter: blur(12px);
}

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

.letter-dialog {
  width: min(100% - 32px, 680px);
  max-width: 680px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  overflow: visible;
  color: var(--charcoal);
  background: transparent;
}

.letter-dialog::backdrop {
  background: rgba(3, 14, 15, 0.76);
  backdrop-filter: blur(12px);
}

.letter-dialog[open] {
  animation: modal-in 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.letter {
  position: relative;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 52px 62px 42px;
  overflow-y: auto;
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgba(56, 39, 23, 0.035) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(rgba(56, 39, 23, 0.025) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--paper);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.4),
    inset 0 0 80px rgba(116, 79, 38, 0.07);
}

.letter::before {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(65, 84, 70, 0.22);
  content: "";
  pointer-events: none;
}

.letter-close {
  position: absolute;
  z-index: 4;
  top: 25px;
  right: 25px;
  width: 38px;
  height: 38px;
  border-color: rgba(24, 49, 52, 0.18);
  color: var(--charcoal);
  background: transparent;
}

.letter-close:hover {
  border-color: rgba(24, 49, 52, 0.4);
  background: rgba(24, 49, 52, 0.06);
}

.letter-meta {
  display: flex;
  justify-content: space-between;
  margin-right: 46px;
  color: rgba(24, 49, 52, 0.48);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.postage-stamp {
  position: absolute;
  top: 84px;
  right: 55px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 62px;
  height: 74px;
  color: var(--coral-deep);
  background: rgba(255, 121, 107, 0.09);
  box-shadow: inset 0 0 0 1px rgba(217, 88, 77, 0.45);
  transform: rotate(5deg);
}

.postage-stamp .icon {
  width: 20px;
  height: 20px;
}

.postage-stamp span {
  font-size: 0.46rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.letter-salutation {
  margin: 48px 0 12px;
  color: var(--coral-deep);
  font-family: var(--display-cn);
  font-size: 1.08rem;
}

.letter h2 {
  max-width: 440px;
  margin: 0;
  color: var(--charcoal);
  font-family: var(--display-cn);
  font-size: 2.25rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.42;
}

.letter-body {
  margin: 27px 0 0;
  color: rgba(24, 49, 52, 0.84);
  font-family: var(--serif-cn);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  line-height: 2;
}

.letter-signoff {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  margin-top: 28px;
  color: rgba(24, 49, 52, 0.62);
  font-family: var(--serif-cn);
  font-size: 0.85rem;
  line-height: 1.7;
}

.letter-signoff strong {
  color: var(--coral-deep);
  font-family: var(--display-cn);
  font-size: 1.18rem;
  font-weight: 400;
}

.letter-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 25px;
  color: var(--coral-deep);
}

.letter-ornament span {
  width: 50px;
  height: 1px;
  background: rgba(217, 88, 77, 0.24);
}

.letter-ornament i {
  font-size: 0.7rem;
  font-style: normal;
}

@keyframes flicker {
  0% {
    border-radius: 50% 50% 46% 46%;
    transform: translateX(-50%) rotate(-2deg) scale(1);
  }
  100% {
    border-radius: 46% 50% 50% 45%;
    transform: translateX(-50%) rotate(3deg) scale(1.08, 0.95);
  }
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97) rotate(-0.6deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
  }
}

@media (max-width: 940px) {
  .birthday-stage {
    align-items: flex-start;
    padding-top: 24px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 400px;
    column-gap: 16px;
  }

  h1 {
    font-size: 4.7rem;
  }

  .illustration {
    height: 400px;
    transform: scale(0.92);
    transform-origin: right center;
  }

  .signature {
    margin-right: 10px;
  }
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .topbar {
    width: calc(100% - 32px);
    padding-top: max(17px, env(safe-area-inset-top));
  }

  .edition {
    font-size: 0.55rem;
  }

  .sound-toggle {
    width: 40px;
    height: 40px;
  }

  .birthday-stage {
    min-height: auto;
    padding: 18px 18px 36px;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "illustration"
      "wishes"
      "actions"
      "signature";
    justify-items: center;
    width: 100%;
  }

  .hero-copy {
    justify-self: stretch;
    text-align: center;
  }

  .kicker {
    justify-content: center;
    margin-bottom: 16px;
    font-size: 0.58rem;
  }

  .kicker-line {
    width: 28px;
  }

  h1 {
    font-size: 3.85rem;
    line-height: 1.03;
  }

  .recipient {
    margin-bottom: 5px;
    font-size: 0.77rem;
    letter-spacing: 0.28em;
  }

  .intro-copy {
    margin-top: 18px;
    font-size: 0.88rem;
    line-height: 1.8;
  }

  .illustration {
    justify-self: center;
    width: 100%;
    max-width: 390px;
    height: 330px;
    margin-top: 3px;
    transform: scale(0.88);
    transform-origin: center;
  }

  .cake {
    bottom: 0;
    transform: translateX(-50%) scale(0.9);
    transform-origin: center bottom;
  }

  .gift {
    right: -3px;
    bottom: 4px;
    transform: scale(0.82) rotate(2deg);
    transform-origin: right bottom;
  }

  .gift:hover {
    transform: translateY(-2px) scale(0.82) rotate(-2deg);
  }

  .ribbon-script {
    top: 20px;
    left: 7%;
    font-size: 1.35rem;
  }

  .wish-block {
    justify-self: stretch;
    margin-top: -16px;
    text-align: center;
  }

  .wish-list {
    justify-content: center;
  }

  .wish-heading {
    font-size: 0.56rem;
  }

  .wish-pill {
    min-height: 31px;
    padding: 6px 12px;
    font-size: 0.7rem;
  }

  .actions {
    width: 100%;
    margin-top: 24px;
  }

  .button {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    padding: 0 14px;
    font-size: 0.76rem;
    white-space: nowrap;
  }

  .signature {
    justify-self: center;
    gap: 8px;
    margin: 25px 0 0;
    font-size: 0.53rem;
  }

  .letter {
    padding: 44px 30px 34px;
  }

  .letter-close {
    top: 23px;
    right: 23px;
  }

  .letter-meta {
    margin-right: 44px;
    font-size: 0.5rem;
  }

  .postage-stamp {
    top: 75px;
    right: 30px;
    width: 52px;
    height: 63px;
  }

  .letter-salutation {
    margin-top: 48px;
  }

  .letter h2 {
    max-width: calc(100% - 30px);
    font-size: 1.78rem;
    line-height: 1.48;
  }

  .letter-body {
    font-size: 0.86rem;
    line-height: 1.95;
  }
}

@media (max-width: 390px) {
  h1 {
    font-size: 3.45rem;
  }

  .illustration {
    height: 300px;
    margin-top: -8px;
    transform: scale(0.8);
  }

  .wish-pill {
    padding-right: 10px;
    padding-left: 10px;
  }

  .letter {
    padding: 42px 24px 30px;
  }

  .letter h2 {
    font-size: 1.6rem;
  }
}

@media (max-height: 760px) and (min-width: 761px) {
  .topbar {
    padding-top: 18px;
  }

  .birthday-stage {
    min-height: calc(100vh - 62px);
    padding-top: 8px;
    padding-bottom: 20px;
  }

  .illustration {
    height: 390px;
    transform: scale(0.88);
  }

  h1 {
    font-size: 5rem;
  }

  .actions {
    margin-top: 21px;
  }
}

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