/* =========================================================
   Happy birthday, Alina — styles
   Palette: strawberry milk, cobalt ink, bubblegum, butter,
   mint, cherry, lilac. Type: Shrikhand + Geologica.
   ========================================================= */

/* ---------- Fonts (self-hosted, SIL Open Font License) ----------
   "Alina Display" = Shrikhand for Latin letters, digits and punctuation
   + Playfair Display Black Italic for Cyrillic (Shrikhand has no Cyrillic). */
@font-face {
  font-family: "Alina Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/shrikhand-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Alina Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/shrikhand-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Alina Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/playfair-display-cyrillic-900-italic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
  size-adjust: 106%;
}
@font-face {
  font-family: "Geologica";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/geologica-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geologica";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/geologica-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geologica";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/geologica-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Geologica";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/geologica-cyrillic-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* ---------- Tokens ---------- */
:root {
  --milk: #FFE8F0;      /* strawberry milk: page */
  --cream: #FFFBF2;     /* frosting, paper */
  --ink: #2723B8;       /* cobalt: all text + outlines */
  --gum: #FF5FA2;       /* bubblegum */
  --gum-soft: #FF8DBD;
  --butter: #FFD84D;
  --mint: #5FD9B0;
  --cherry: #F0304F;
  --lilac: #B7A4FF;

  --display: "Alina Display", "Cooper Black", Georgia, serif;
  --body: "Geologica", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --pad: clamp(20px, 5vw, 56px);
  --line: 3px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink);
  background: var(--milk) url("assets/sprinkles.svg") 0 0 / 460px repeat;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p, figure { margin: 0; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--gum);
  outline-offset: 4px;
  border-radius: 8px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 12px 22px;
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.1;
  color: var(--ink);
  background: var(--butter);
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .12s ease, box-shadow .12s ease, background-color .2s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: default; transform: none; box-shadow: 4px 4px 0 var(--ink); }
.btn svg {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.btn--light { background: var(--cream); }
.btn--big { min-height: 58px; padding: 14px 28px; font-size: 1.1rem; }
.btn[aria-pressed="true"] { background: var(--mint); }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  background: var(--ink);
  color: var(--cream);
  padding: 11px 0 10px;
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 42s linear infinite;
}
.marquee__group {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-right: 20px;
  flex: none;
  font-size: .95rem;
  font-weight: 600;
  white-space: nowrap;
}
.marquee__star { width: 15px; height: 15px; fill: var(--butter); flex: none; }
.marquee__group span:nth-of-type(3n+2) + .marquee__star { fill: var(--gum); }
.marquee__group span:nth-of-type(3n) + .marquee__star { fill: var(--mint); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: clamp(34px, 7vw, 72px) var(--pad) clamp(56px, 9vw, 96px);
}

.hero__title { font-weight: 400; }

.hero__greeting {
  display: block;
  font-family: var(--body);
  font-size: clamp(1.25rem, 4.6vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -.01em;
}

.hero__name {
  position: relative;
  display: inline-block;
  margin-top: .02em;
  padding: 0 .14em .12em 0;
  font-family: var(--display);
  font-size: clamp(5.2rem, 27vw, 13.5rem);
  line-height: .95;
  color: var(--gum);
  -webkit-text-stroke: .03em var(--ink);
  paint-order: stroke fill;
  text-shadow: .055em .06em 0 var(--ink);
}

.ltr {
  display: inline-block;
  cursor: pointer;
  animation: drop .9s cubic-bezier(.3, 1.45, .5, 1) backwards;
  animation-delay: calc(var(--i) * 85ms + 120ms);
}
.ltr:nth-child(odd)  { rotate: -4deg; }
.ltr:nth-child(even) { rotate: 3deg; }
.ltr:nth-child(3)    { color: var(--butter); }
.ltr:nth-child(5)    { color: var(--mint); }
.ltr.landed { animation: none; }
.ltr.landed.boing { animation: boing .65s cubic-bezier(.3, 1.6, .5, 1); }

@keyframes drop {
  0%   { transform: translateY(-140%) scale(.7); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: none; }
}
@keyframes boing {
  0%   { transform: none; }
  30%  { transform: translateY(-24%) scale(1.06, .94); }
  62%  { transform: translateY(0) scale(.92, 1.08); }
  100% { transform: none; }
}

.sticker {
  position: absolute;
  z-index: 2;
  top: 3%;
  right: -3%;
  display: grid;
  place-content: center;
  width: clamp(64px, 17vw, 100px);
  aspect-ratio: 1;
  font-family: var(--display);
  font-size: clamp(1.25rem, 5vw, 1.8rem);
  line-height: .85;
  color: var(--ink);
  background: var(--butter);
  border: var(--line) solid var(--ink);
  border-radius: 50%;
  box-shadow: 3px 3px 0 var(--ink);
  rotate: 14deg;
  animation: pop .55s cubic-bezier(.3, 1.6, .5, 1) .75s backwards;
}
.sticker small { display: block; font-size: .58em; margin-top: .18em; }

@keyframes pop {
  0%   { transform: scale(0); }
  100% { transform: scale(1); }
}

.hero__sub {
  max-width: 30ch;
  margin: clamp(12px, 2.4vw, 22px) auto 0;
  font-size: clamp(1.1rem, 3.9vw, 1.35rem);
  font-weight: 500;
  line-height: 1.45;
  text-wrap: balance;
}

/* ---------- Cake ---------- */
.cake {
  position: relative;
  isolation: isolate;
  width: min(86vw, 400px);
  margin: clamp(24px, 5vw, 40px) auto 0;
}
.cake::before { /* retro sunburst behind the cake */
  content: "";
  position: absolute;
  z-index: -1;
  inset: -16% -34% -6%;
  background: repeating-conic-gradient(from 0deg at 50% 46%, rgba(255, 216, 77, .8) 0deg 7deg, transparent 7deg 15deg);
  -webkit-mask-image: radial-gradient(closest-side at 50% 46%, #000 30%, transparent 100%);
          mask-image: radial-gradient(closest-side at 50% 46%, #000 30%, transparent 100%);
}
.cake__svg { display: block; width: 100%; height: auto; overflow: visible; }

.candle { cursor: pointer; outline: none; }
.candle:focus-visible .candle__hit { stroke: var(--gum); stroke-width: 4; stroke-dasharray: 6 6; }

.flame-out {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition: transform .4s cubic-bezier(.6, -0.3, .7, .4), opacity .4s;
}
.flame-sway {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: skewX(calc(var(--wind, 0) * -30deg)) scaleY(calc(1 - var(--wind, 0) * .25));
  transition: transform .12s linear;
}
.flame {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: flicker 1.5s ease-in-out infinite alternate;
}
.candle[data-label="6"] .flame { animation-duration: 1.2s; animation-delay: -.5s; }
.glow {
  transform-box: fill-box;
  transform-origin: center;
  animation: glow 2.2s ease-in-out infinite alternate;
}
@keyframes flicker {
  0%   { transform: rotate(-3deg) scale(1, 1); }
  35%  { transform: rotate(2deg) scale(.95, 1.06); }
  70%  { transform: rotate(-1deg) scale(1.03, .96); }
  100% { transform: rotate(3deg) scale(.97, 1.04); }
}
@keyframes glow {
  from { transform: scale(.9); opacity: .75; }
  to   { transform: scale(1.12); opacity: 1; }
}

.smoke circle { opacity: 0; transform-box: fill-box; transform-origin: center; }
.candle.is-out .flame-out { transform: scale(0); opacity: 0; }
.candle.is-out .smoke circle { animation: smoke 1.7s ease-out forwards; }
.candle.is-out .smoke circle:nth-child(2) { animation-delay: .15s; --dx: -10px; }
.candle.is-out .smoke circle:nth-child(3) { animation-delay: .3s; --dx: 9px; }
@keyframes smoke {
  0%   { opacity: .9; transform: translate(0, 0) scale(.6); }
  100% { opacity: 0; transform: translate(var(--dx, 3px), -54px) scale(2); }
}

.cake__hint {
  min-height: 1.6em;
  margin-top: clamp(16px, 3vw, 24px);
  font-size: 1.05rem;
  font-weight: 600;
}
.cake__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
}
.cake__actions [hidden] { display: none; }

@media (min-width: 960px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    grid-template-areas: "title cake" "sub cake" "hint cake" "actions cake";
    align-content: center;
    column-gap: clamp(32px, 5vw, 88px);
    max-width: 1240px;
    min-height: min(calc(100svh - 42px), 860px);
    margin: 0 auto;
    padding-block: 40px 56px;
    text-align: left;
  }
  .hero__title { grid-area: title; }
  .hero__name { font-size: min(12rem, 13.5vw); margin-left: -.04em; }
  .hero__sub { grid-area: sub; margin-left: 0; max-width: 26ch; font-size: 1.45rem; }
  .cake { grid-area: cake; align-self: center; width: min(100%, 460px); margin: 0 auto; }
  .cake__hint { grid-area: hint; margin-top: 28px; }
  .cake__actions { grid-area: actions; justify-content: flex-start; margin-top: 14px; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(68px, 11vw, 128px) var(--pad); }
.section__inner { max-width: 1080px; margin: 0 auto; }
.section__head { max-width: 34rem; margin-bottom: clamp(34px, 6vw, 56px); }
.section__title {
  font-family: var(--display);
  font-size: clamp(2.35rem, 8.6vw, 4.1rem);
  font-weight: 400;
  line-height: 1.04;
  text-shadow: .05em .05em 0 var(--gum);
  text-wrap: balance;
}
.section__lead {
  max-width: 36ch;
  margin-top: 14px;
  font-size: clamp(1.08rem, 3.5vw, 1.25rem);
  line-height: 1.5;
}

/* ---------- Photos ---------- */
.moments__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(26px, 5vw, 44px) clamp(16px, 3.5vw, 32px);
}

.photo {
  --tilt: 0deg;
  position: relative;
  padding: 10px 10px 0;
  background: #fff;
  border: var(--line) solid var(--ink);
  border-radius: 6px;
  box-shadow: 6px 6px 0 var(--ink);
  rotate: var(--tilt);
  cursor: pointer;
  transition: rotate .35s cubic-bezier(.3, 1.5, .5, 1);
}
.photo::before { /* washi tape */
  content: "";
  position: absolute;
  z-index: 2;
  top: -14px;
  left: 50%;
  width: 92px;
  height: 28px;
  translate: -50% 0;
  rotate: -5deg;
  background: rgba(183, 164, 255, .78);
  -webkit-mask: linear-gradient(90deg, transparent 0 3px, #000 3px calc(100% - 3px), transparent calc(100% - 3px)),
                repeating-linear-gradient(0deg, #000 0 4px, transparent 4px 6px);
          mask: linear-gradient(90deg, transparent 0 3px, #000 3px calc(100% - 3px), transparent calc(100% - 3px)),
                repeating-linear-gradient(0deg, #000 0 4px, transparent 4px 6px);
}
.photo:nth-child(even)::before { background: rgba(95, 217, 176, .8); rotate: 6deg; }
.photo:nth-child(3)::before { background: rgba(255, 216, 77, .85); }

.photo:nth-child(1) { --tilt: -1.6deg; grid-column: 1 / -1; }
.photo:nth-child(2) { --tilt: 2.2deg; }
.photo:nth-child(3) { --tilt: -2.4deg; }
.photo:nth-child(4) { --tilt: 1.4deg; }
.photo:nth-child(5) { --tilt: -2deg; }
.photo.wiggle { animation: wiggle .5s ease; }
@keyframes wiggle {
  25% { transform: rotate(3deg); }
  50% { transform: rotate(-3deg); }
  75% { transform: rotate(1.5deg); }
}

.photo__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border: 2px solid var(--ink);
  border-radius: 3px;
}
.photo:nth-child(1) .photo__media { aspect-ratio: 4 / 3; }

.photo__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .5s ease;
}
.photo.is-loaded img { opacity: 1; }

.photo__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 12px;
  text-align: center;
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.25;
  background: repeating-linear-gradient(-45deg, #FFF3F8 0 14px, #FFE0EE 14px 28px);
}
.photo__empty svg {
  width: 42px; height: 42px;
  fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linejoin: round;
}
.photo__empty code {
  font-family: var(--body);
  font-size: .78rem;
  font-weight: 500;
  padding: 2px 8px;
  background: var(--cream);
  border: 1.5px dashed var(--ink);
  border-radius: 6px;
}

.photo figcaption {
  padding: 12px 6px 14px;
  font-family: var(--display);
  font-size: clamp(1rem, 3.4vw, 1.2rem);
  line-height: 1.2;
  text-align: center;
}

@media (min-width: 820px) {
  .moments__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
    gap: 56px 32px;
  }
  .photo:nth-child(1) { grid-column: 1 / span 5; grid-row: 1 / span 2; }
  .photo:nth-child(2) { grid-column: 6 / span 4; }
  .photo:nth-child(3) { grid-column: 10 / span 3; margin-top: 48px; }
  .photo:nth-child(4) { grid-column: 6 / span 3; }
  .photo:nth-child(5) { grid-column: 9 / span 4; margin-top: 20px; }
  .photo:nth-child(1) .photo__media { aspect-ratio: 4 / 5; }
  .photo:nth-child(2) .photo__media { aspect-ratio: 1 / 1; }
  .photo:nth-child(5) .photo__media { aspect-ratio: 4 / 3; }
  .photo:hover { rotate: 0deg; }
}

/* ---------- Wishes / gumball machine ---------- */
.wishes {
  position: relative;
  z-index: 1;
  background: var(--butter);
  margin: 14px 0;
}
.wishes::before,
.wishes::after { /* scalloped edges */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 14px;
  background-size: 28px 14px;
  background-repeat: repeat-x;
}
.wishes::before {
  top: -13px;
  background-image: radial-gradient(circle at 14px 14px, var(--butter) 11px, var(--ink) 11.5px 14px, transparent 14.5px);
}
.wishes::after {
  bottom: -13px;
  background-image: radial-gradient(circle at 14px 0, var(--butter) 11px, var(--ink) 11.5px 14px, transparent 14.5px);
}

.wishes__layout {
  display: grid;
  grid-template-areas: "head" "machine" "controls";
  gap: 26px;
  justify-items: center;
}
.wishes__head { grid-area: head; justify-self: stretch; margin-bottom: 0; }
.wishes__head .section__lead { max-width: 34ch; }
.machine { grid-area: machine; width: min(80vw, 330px); }
.machine svg { display: block; width: 100%; height: auto; overflow: visible; cursor: pointer; }
.wishes__controls { grid-area: controls; display: grid; justify-items: center; gap: 14px; }
.wishes__count { font-weight: 600; }
.wishes__count strong { font-family: var(--display); font-weight: 400; font-size: 1.5em; margin-right: 2px; }

@media (min-width: 820px) {
  .wishes__layout {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "head machine" "controls machine";
    align-items: center;
    column-gap: 56px;
    row-gap: 32px;
  }
  .wishes__head { align-self: end; }
  .wishes__controls { align-self: start; justify-self: start; justify-items: start; }
  .machine { width: min(100%, 380px); }
}

.ball { transition: transform .6s cubic-bezier(.34, 1.4, .64, 1); }
.machine__handle { transform-box: fill-box; transform-origin: center; }
.machine__all { transform-box: view-box; transform-origin: 150px 430px; }
.machine.is-shaking .machine__all { animation: shake .6s ease-in-out; }
@keyframes shake {
  20% { transform: rotate(-2.2deg); }
  40% { transform: rotate(2deg); }
  60% { transform: rotate(-1.4deg); }
  80% { transform: rotate(.8deg); }
}

/* ---------- Wish popup ---------- */
dialog {
  width: min(92vw, 440px);
  max-width: none;
  padding: 0;
  overflow: visible;
  color: var(--ink);
  background: transparent;
  border: 0;
}
dialog::backdrop {
  background: rgba(255, 236, 244, .62);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
}

.wish__card {
  position: relative;
  margin-top: 44px;
  padding: 58px clamp(20px, 6vw, 34px) 26px;
  text-align: center;
  background: #fff;
  border: var(--line) solid var(--ink);
  border-radius: 28px;
  box-shadow: 8px 8px 0 var(--ink);
}
.wish[open] .wish__card { animation: popUp .5s cubic-bezier(.3, 1.45, .5, 1); }
@keyframes popUp {
  from { transform: translateY(40px) scale(.7); opacity: 0; }
}

.wish__ball {
  position: absolute;
  top: -44px;
  left: 50%;
  width: 84px;
  height: 84px;
  translate: -50% 0;
  background: var(--ball, var(--gum));
  border: var(--line) solid var(--ink);
  border-radius: 50%;
  box-shadow: inset -9px -11px 0 rgba(39, 35, 184, .12), 4px 4px 0 var(--ink);
}
.wish__ball::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 17px;
  width: 22px;
  height: 14px;
  background: rgba(255, 255, 255, .85);
  border-radius: 50%;
  rotate: -32deg;
}
.wish[open] .wish__ball { animation: spin .7s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes spin { from { transform: rotate(-200deg) scale(.4); } }

.wish__num { font-family: var(--display); font-size: 1.55rem; line-height: 1.1; }
.wish__num small { font-family: var(--body); font-size: 1rem; font-weight: 600; }
.wish__text {
  margin-top: 14px;
  font-size: clamp(1.2rem, 4.8vw, 1.45rem);
  font-weight: 600;
  line-height: 1.35;
  text-wrap: balance;
}
.wish__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}
.wish__actions [hidden] { display: none; }

/* ---------- Photo viewer ---------- */
.lightbox { width: min(94vw, 880px); }
.lightbox img {
  width: 100%;
  max-height: 84vh;
  object-fit: contain;
  background: #fff;
  border: var(--line) solid var(--ink);
  border-radius: 14px;
  box-shadow: 8px 8px 0 var(--ink);
}
.lightbox[open] img { animation: popUp .45s cubic-bezier(.3, 1.4, .5, 1); }
.lightbox__close {
  position: absolute;
  top: -16px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: var(--butter);
  border: var(--line) solid var(--ink);
  border-radius: 50%;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}
.lightbox__close svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }

/* ---------- Letter ---------- */
.letter-section__inner {
  display: grid;
  justify-items: center;
  text-align: center;
}

.envelope {
  display: grid;
  justify-items: center;
  gap: 18px;
  width: min(84vw, 360px);
  margin-top: clamp(96px, 16vw, 120px);
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}
.envelope svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(6px 6px 0 var(--ink)); }
.envelope:not(.is-open) svg { animation: bob 2.6s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50%      { transform: translateY(-8px) rotate(1.5deg); }
}
.envelope__hint { font-weight: 600; }
.envelope.is-open .envelope__hint { visibility: hidden; }

.env-flap-closed,
.env-flap-open {
  transform-box: view-box;
  transform-origin: 150px 32px;
}
.env-flap-closed { transition: transform .28s ease-in; }
.env-flap-open { transform: scaleY(0); transition: transform .3s ease-out .28s; }
.envelope.is-open .env-flap-closed { transform: scaleY(0); }
.envelope.is-open .env-flap-open { transform: scaleY(1); }
.env-paper { transition: transform .75s cubic-bezier(.3, 1.35, .5, 1) .5s; }
.envelope.is-open .env-paper { transform: translateY(-88px); }
.env-seal {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform .25s ease-in, opacity .25s;
}
.envelope.is-open .env-seal { transform: scale(.2); opacity: 0; }

.letter {
  width: 100%;
  max-width: 36rem;
  margin-top: 28px;
  padding: clamp(26px, 6vw, 48px) clamp(22px, 6vw, 52px);
  text-align: left;
  font-size: clamp(1.06rem, 3.5vw, 1.15rem);
  line-height: 1.7;
  background: #fff;
  border: var(--line) solid var(--ink);
  border-radius: 20px;
  box-shadow: 8px 8px 0 var(--ink);
}
.letter.is-revealed {
  transform-origin: 50% 0;
  animation: unfold .8s cubic-bezier(.3, 1.3, .5, 1) both;
}
@keyframes unfold {
  from { opacity: 0; transform: translateY(-30px) scaleY(.5) rotate(-2deg); }
}
.letter p + p { margin-top: 1em; }
.letter__hello { font-family: var(--display); font-size: 1.6rem; line-height: 1.2; }
.letter__sign {
  margin-top: 1.4em !important;
  font-family: var(--display);
  font-size: 1.6rem;
  line-height: 1.2;
  text-align: right;
}

/* ---------- Footer ---------- */
.footer {
  padding: 64px var(--pad) calc(80px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--cream);
  background: var(--ink);
}
.footer__big {
  font-family: var(--display);
  font-size: clamp(2.2rem, 9vw, 3.8rem);
  line-height: 1.05;
  text-shadow: .05em .05em 0 var(--gum);
}
.footer__small { margin-top: 12px; opacity: .85; text-wrap: balance; }
.footer .btn { margin-top: 26px; box-shadow: 4px 4px 0 var(--gum); }
.footer .btn:hover { box-shadow: 5px 5px 0 var(--gum); }
.footer .btn:active { box-shadow: 1px 1px 0 var(--gum); }

/* ---------- Sound toggle ---------- */
.sound {
  position: fixed;
  z-index: 40;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  background: var(--cream);
  border: var(--line) solid var(--ink);
  border-radius: 50%;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}
.sound svg {
  width: 24px; height: 24px;
  fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.sound svg path:first-child { fill: var(--ink); }
.sound[aria-pressed="true"] .sound__off,
.sound[aria-pressed="false"] .sound__on { display: none; }

/* ---------- Confetti layer ---------- */
.confetti {
  position: fixed;
  inset: 0;
  z-index: 60;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .marquee__track,
  .ltr,
  .sticker,
  .flame,
  .glow,
  .envelope:not(.is-open) svg { animation: none; }
  .ball, .env-paper, .env-flap-open, .env-flap-closed { transition-duration: .01s; transition-delay: 0s; }
  .letter.is-revealed, .wish[open] .wish__card, .wish[open] .wish__ball { animation: none; }
}
