:root {
  --cream: #fff5d8;
  --paper: #f8e9bb;
  --gold: #efad10;
  --gold-bright: #ffd34a;
  --ochre: #b86612;
  --rust: #7e3218;
  --brown: #4a2414;
  --brown-deep: #251009;
  --green: #4d7f36;
  --shadow: rgba(28, 10, 2, 0.46);
  --font-text: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-display: "Bilbo Swash Caps", "Cormorant Garamond", cursive;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  overflow-x: hidden;
  color: var(--cream);
  background:
    radial-gradient(circle at 50% 36%, #9e5521 0, #572a16 38%, #291108 76%, #150804 100%);
  font-family: var(--font-text);
}

body::before,
body::after {
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  content: "";
}

body::before {
  opacity: 0.22;
  background-image:
    repeating-radial-gradient(ellipse at 0 50%, transparent 0 39px, #e7a52d 40px 42px, transparent 43px 68px),
    repeating-radial-gradient(ellipse at 100% 50%, transparent 0 39px, #e7a52d 40px 42px, transparent 43px 68px);
  background-size: 180px 210px;
  background-position: -87px 0, calc(100% + 87px) 105px;
}

body::after {
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.34'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

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

.skip-intro {
  position: fixed;
  z-index: 30;
  top: 18px;
  right: 22px;
  padding: 0.56rem 0.9rem;
  border: 1px solid rgba(255, 239, 187, 0.38);
  border-radius: 999px;
  color: rgba(255, 245, 216, 0.82);
  background: rgba(34, 13, 6, 0.42);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  font: 600 0.82rem/1.1 var(--font-text);
  letter-spacing: 0.04em;
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.skip-intro:hover,
.skip-intro:focus-visible {
  color: #fff;
  background: rgba(77, 33, 12, 0.82);
  transform: translateY(-1px);
}

.ambient,
.glow,
.spark-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.ambient {
  z-index: 1;
  overflow: hidden;
}

.glow {
  border-radius: 50%;
  filter: blur(60px);
  animation: glow-drift 11s ease-in-out infinite alternate;
}

.glow-one {
  width: 46vw;
  height: 46vw;
  top: -26vw;
  left: -10vw;
  background: rgba(255, 185, 43, 0.23);
}

.glow-two {
  width: 42vw;
  height: 42vw;
  right: -18vw;
  bottom: -25vw;
  background: rgba(186, 89, 22, 0.32);
  animation-delay: -4s;
}

.spark-field {
  opacity: 0.48;
  background-image:
    radial-gradient(circle, #ffe9a0 0 1px, transparent 1.6px),
    radial-gradient(circle, #e7a52d 0 1.2px, transparent 1.8px);
  background-position: 0 0, 33px 42px;
  background-size: 86px 86px, 119px 119px;
  mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
  animation: sparks-drift 28s linear infinite;
}

.intro {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 100svh;
  place-content: center;
  gap: clamp(0.65rem, 1.4vh, 1.15rem);
  padding: clamp(4rem, 8vh, 6.5rem) 4vw clamp(2.5rem, 5vh, 4rem);
  text-align: center;
}

.birthday-copy {
  position: relative;
  z-index: 3;
  animation: title-arrives 1.6s cubic-bezier(.17, .78, .2, 1) both;
}

.eyebrow {
  margin: 0 0 0.28rem;
  color: #f1c86d;
  font: 700 clamp(0.68rem, 1.05vw, 0.9rem)/1.2 var(--font-text);
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #fff9e9;
  font-size: clamp(3rem, 6.5vw, 6.4rem);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.035em;
  text-shadow: 0 4px 0 #773714, 0 9px 28px rgba(0, 0, 0, 0.48);
}

h1::after {
  display: block;
  width: clamp(7.5rem, 16vw, 13rem);
  height: 0.22rem;
  margin: 0.48rem auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--gold-bright) 15% 85%, transparent);
  box-shadow: 0 0 18px rgba(255, 202, 44, 0.65);
  content: "";
  transform-origin: center;
  animation: underline-in 1s 0.7s ease-out both;
}

.invitation {
  margin: 0.45rem 0 0;
  color: rgba(255, 245, 216, 0.84);
  font-size: clamp(1rem, 1.65vw, 1.32rem);
  font-style: italic;
}

.gift-stage {
  position: relative;
  width: min(82vw, 860px);
  margin: 0.72rem auto 0;
}

.box-button {
  position: relative;
  z-index: 3;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.photo-mat {
  position: relative;
  display: block;
  width: min(100%, 760px);
  aspect-ratio: 6 / 5;
  margin-inline: auto;
  overflow: hidden;
  border: clamp(7px, 0.75vw, 11px) solid #e6a716;
  border-radius: 18px;
  outline: 2px solid rgba(255, 225, 117, 0.88);
  outline-offset: -7px;
  background: #eab122;
  box-shadow:
    0 0 0 3px #783615,
    0 0 0 7px rgba(236, 167, 22, 0.72),
    0 20px 60px var(--shadow),
    0 0 48px rgba(255, 181, 31, 0.2);
  transform: perspective(1100px) rotateX(1.2deg) rotateZ(-0.35deg);
  transition: transform 320ms ease, box-shadow 320ms ease;
  animation: box-breathe 3.4s 1.45s ease-in-out infinite;
}

.photo-mat::before,
.photo-mat::after {
  position: absolute;
  z-index: 10;
  top: 8px;
  bottom: 8px;
  width: 18px;
  opacity: 0.58;
  background:
    radial-gradient(circle, #7a3415 0 2px, transparent 2.7px) center top / 12px 28px repeat-y;
  content: "";
  pointer-events: none;
}

.photo-mat::before { left: 7px; }
.photo-mat::after { right: 7px; }

.box-button:hover .photo-mat,
.box-button:focus-visible .photo-mat {
  box-shadow:
    0 0 0 3px #783615,
    0 0 0 8px rgba(255, 192, 39, 0.88),
    0 23px 68px rgba(20, 5, 0, 0.55),
    0 0 70px rgba(255, 189, 47, 0.42);
  transform: perspective(1100px) rotateX(0deg) rotateZ(0deg) translateY(-4px) scale(1.012);
}

.box-button:focus-visible {
  outline: 3px solid #fff4c8;
  outline-offset: 14px;
  border-radius: 20px;
}

.box-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 90ms linear;
}

.box-frame-front { z-index: 2; }
.box-frame-back { z-index: 1; }
.box-frame.is-fading { opacity: 0; }

.photo-glint {
  position: absolute;
  z-index: 9;
  inset: -60% -45%;
  opacity: 0;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 229, 0.44) 48%, transparent 55%);
  transform: translateX(-40%);
  pointer-events: none;
}

.box-button:not(.is-opening):hover .photo-glint {
  opacity: 0.7;
  animation: glint 1.15s ease-out;
}

.opening-label {
  display: inline-grid;
  margin-top: 1.08rem;
  padding: 0.72rem 1.8rem 0.68rem;
  border: 2px solid #f0bd3d;
  border-radius: 999px;
  color: #4a210f;
  background: linear-gradient(#ffdc68, #e9a918);
  box-shadow: 0 5px 0 #8d4215, 0 12px 25px rgba(0, 0, 0, 0.3), inset 0 1px rgba(255, 255, 255, 0.6);
  text-shadow: 0 1px rgba(255, 255, 255, 0.46);
  transition: transform 180ms ease, filter 180ms ease;
  animation: invitation-pulse 2.25s 2.25s ease-in-out infinite;
}

.box-button:hover .opening-label,
.box-button:focus-visible .opening-label {
  filter: saturate(1.12) brightness(1.06);
  transform: translateY(-2px) scale(1.03);
}

.opening-label-main {
  font-size: clamp(1.06rem, 1.7vw, 1.32rem);
  font-weight: 700;
  line-height: 1.05;
}

.opening-label-small {
  margin-top: 0.15rem;
  font: 700 0.63rem/1.1 var(--font-text);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.box-button.is-opening {
  cursor: wait;
}

.box-button.is-opening .photo-mat {
  animation: opening-rumble 520ms ease-in-out 2;
}

.box-button.is-open .photo-mat {
  animation: open-settle 1.1s cubic-bezier(.17, .8, .16, 1) both;
}

.box-button.is-opening .opening-label,
.box-button.is-open .opening-label {
  opacity: 0;
  transform: translateY(12px);
  animation: none;
}

.kitchen-staff {
  position: absolute;
  z-index: 7;
  right: -2%;
  bottom: -8%;
  width: min(41%, 310px);
  max-height: 82%;
  opacity: 0;
  object-fit: contain;
  object-position: right bottom;
  pointer-events: none;
  filter: drop-shadow(0 13px 8px rgba(42, 17, 2, 0.3));
  transform: translateY(34%) rotate(2deg) scale(0.85);
}

.box-button.is-open .kitchen-staff {
  animation: staff-arrives 1.15s 0.35s cubic-bezier(.18, .92, .24, 1.18) forwards;
}

.card-burst {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 52%;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.card-burst i {
  position: absolute;
  width: clamp(52px, 8vw, 82px);
  aspect-ratio: 5 / 3;
  border: 1px solid #d1b680;
  background:
    repeating-linear-gradient(to bottom, #fffbed 0 9px, #c8ddef 10px 11px),
    #fffbed;
  box-shadow: 0 7px 12px rgba(40, 19, 4, 0.28);
  opacity: 0;
}

.card-burst.is-active i:nth-child(1) { animation: card-fly-one 780ms ease-out; }
.card-burst.is-active i:nth-child(2) { animation: card-fly-two 850ms 35ms ease-out; }
.card-burst.is-active i:nth-child(3) { animation: card-fly-three 760ms 55ms ease-out; }
.card-burst.is-active i:nth-child(4) { animation: card-fly-four 820ms 20ms ease-out; }
.card-burst.is-active i:nth-child(5) { animation: card-fly-five 810ms 75ms ease-out; }
.card-burst.is-active i:nth-child(6) { animation: card-fly-six 740ms 90ms ease-out; }
.card-burst.is-active i:nth-child(7) { animation: card-fly-seven 870ms 15ms ease-out; }

.reveal-message {
  position: absolute;
  z-index: 9;
  left: 50%;
  bottom: 4.1rem;
  width: max-content;
  max-width: 92%;
  margin: 0;
  padding: 0.62rem 1.2rem;
  border: 1px solid rgba(255, 227, 140, 0.66);
  border-radius: 999px;
  color: #fff7dd;
  background: rgba(63, 26, 10, 0.82);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  font-size: clamp(1rem, 1.75vw, 1.35rem);
  font-style: italic;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px) scale(0.92);
  backdrop-filter: blur(7px);
}

.reveal-message.is-visible {
  animation: message-arrives 2.4s ease both;
}

.mobile-enter {
  display: none;
}

.mobile-enter[hidden] {
  display: none;
}

.confetti {
  position: fixed;
  z-index: 12;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: -8vh;
  width: 10px;
  height: 18px;
  border-radius: 2px;
  opacity: 0;
  animation: confetti-fall var(--fall-time) var(--fall-delay) cubic-bezier(.1, .5, .35, 1) forwards;
}

.ribbon {
  position: absolute;
  z-index: 0;
  top: 48%;
  width: 18vw;
  max-width: 240px;
  height: 4px;
  opacity: 0.32;
  background: linear-gradient(90deg, transparent, #efb831);
  filter: drop-shadow(0 0 5px #efb831);
}

.ribbon::after {
  position: absolute;
  width: 52px;
  height: 52px;
  top: -25px;
  border: 3px solid #efb831;
  border-radius: 50% 0 50% 0;
  content: "";
  transform: rotate(45deg);
}

.ribbon-left { right: 98%; }
.ribbon-left::after { right: 0; }
.ribbon-right { left: 98%; transform: scaleX(-1); }
.ribbon-right::after { right: 0; }

.sound-button {
  position: fixed;
  z-index: 25;
  left: 20px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.56rem 0.82rem;
  border: 1px solid rgba(255, 232, 157, 0.36);
  border-radius: 999px;
  color: #fff2ca;
  background: rgba(35, 14, 7, 0.66);
  font: 700 0.72rem/1 var(--font-text);
  letter-spacing: 0.04em;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.sound-button[hidden] { display: none; }
.sound-icon { font: 700 1.1rem/1 var(--font-text); }
.sound-button.is-muted { opacity: 0.66; }

.maximize-card[hidden] { display: none; }

.maximize-card {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.maximize-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 8, 3, 0.78);
  backdrop-filter: blur(13px) saturate(0.76);
  animation: fade-in 520ms ease both;
}

.maximize-panel {
  position: relative;
  width: min(650px, 94vw);
  overflow: hidden;
  padding: clamp(2rem, 5vw, 3.25rem);
  border: 7px solid #df9d13;
  border-radius: 24px;
  outline: 2px solid #713114;
  outline-offset: -13px;
  color: #45200e;
  background:
    radial-gradient(circle at 50% -40%, #fffdf0 0 44%, transparent 45%),
    linear-gradient(145deg, #fff9df, #eed18b);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.63), inset 0 0 45px rgba(180, 102, 13, 0.12);
  text-align: center;
  animation: panel-arrives 720ms cubic-bezier(.15, .82, .19, 1.08) both;
}

.maximize-panel::before {
  position: absolute;
  inset: 12px;
  border: 1px dotted rgba(113, 49, 20, 0.44);
  border-radius: 13px;
  content: "";
  pointer-events: none;
}

.maximize-kicker {
  margin: 0 0 0.25rem;
  color: #9a5314;
  font: 800 0.72rem/1.2 var(--font-text);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.maximize-panel h2 {
  margin: 0 0 0.65rem;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.98;
}

.maximize-panel > p:not(.maximize-kicker):not(.maximize-status) {
  width: min(100%, 520px);
  margin: 0 auto 1.15rem;
  font-size: clamp(1rem, 2.1vw, 1.18rem);
  line-height: 1.42;
}

.browser-example {
  width: min(100%, 470px);
  margin: 1.1rem auto 0.8rem;
  overflow: hidden;
  border: 2px solid #5c351e;
  border-radius: 13px;
  background: #fffdf6;
  box-shadow: 0 9px 25px rgba(74, 36, 20, 0.2);
  text-align: left;
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 43px;
  padding: 0 13px;
  background: #dedad4;
}

.traffic {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 50%;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.18);
}

.traffic.red { background: #ff5f57; }
.traffic.yellow { background: #febc2e; }
.traffic.green { background: #28c840; }

.green-rings {
  position: absolute;
  inset: -7px;
  border: 3px solid rgba(40, 200, 64, 0.57);
  border-radius: 50%;
  animation: green-pulse 1.5s ease-out infinite;
}

.browser-tab {
  min-width: 0;
  margin-left: 9px;
  overflow: hidden;
  color: #504c46;
  font: 600 0.72rem/1 var(--font-text);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.browser-page {
  position: relative;
  display: grid;
  min-height: 88px;
  place-items: center;
  padding: 18px 18px 17px 96px;
  color: #73401b;
  background: linear-gradient(135deg, #fffef8, #f8e7ba);
  font-size: 1rem;
}

.little-gnome-frame {
  position: absolute;
  left: 13px;
  bottom: 5px;
  width: 102px;
  height: 82px;
  overflow: hidden;
}

.little-gnome {
  position: absolute;
  inset: 0;
  display: block;
  background: url("../images/characters/ochre-indigo-box-transparent.png") center bottom / contain no-repeat;
}

.pointing-arrow {
  position: absolute;
  z-index: 4;
  left: 40px;
  top: -39px;
  width: 72px;
  height: 88px;
  overflow: visible;
  fill: none;
  stroke: #ae5c15;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px rgba(255, 248, 218, 0.75));
  pointer-events: none;
}

.pointing-arrow .arrow-head {
  stroke-width: 3.25;
}

.maximize-status {
  min-height: 1.25rem;
  margin: 0.65rem 0 0.7rem;
  color: #86501f;
  font-size: 0.9rem;
  font-style: italic;
}

.maximize-card.is-maximized .maximize-status {
  color: #2f672d;
  font-weight: 700;
  font-style: normal;
}

.enter-cookbook {
  display: inline-block;
  padding: 0.86rem 1.35rem;
  border: 2px solid #7a3715;
  border-radius: 999px;
  color: #fff9e6;
  background: linear-gradient(#9b4e1d, #6f2d13);
  box-shadow: 0 4px 0 #401507, 0 9px 22px rgba(73, 30, 8, 0.3);
  font: 700 clamp(0.92rem, 2vw, 1.05rem)/1.1 var(--font-text);
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

.enter-cookbook:hover,
.enter-cookbook:focus-visible {
  filter: brightness(1.13);
  transform: translateY(-2px);
}

.maximize-card.is-maximized .enter-cookbook {
  animation: invitation-pulse 1.55s ease-in-out infinite;
}

.quiet-enter {
  display: block;
  width: max-content;
  margin: 0.9rem auto 0;
  color: #774219;
  font: 700 0.75rem/1.2 var(--font-text);
  text-underline-offset: 3px;
}

.floral-corner {
  position: absolute;
  width: 106px;
  height: 106px;
  opacity: 0.27;
  border: 4px solid #9a571b;
  border-radius: 50% 0 50% 0;
  pointer-events: none;
}

.floral-corner::before,
.floral-corner::after {
  position: absolute;
  border: 3px solid #9a571b;
  border-radius: 50%;
  content: "";
}

.floral-corner::before { inset: 18px 39px; }
.floral-corner::after { inset: 39px 18px; }
.floral-corner-left { left: -54px; bottom: -52px; transform: rotate(22deg); }
.floral-corner-right { right: -54px; top: -52px; transform: rotate(202deg); }

body.is-leaving .maximize-panel {
  animation: leave-panel 700ms ease-in forwards;
}

body.is-leaving::before {
  z-index: 100;
  background: #fff8df;
  opacity: 0;
  animation: page-wash 850ms 300ms ease-in forwards;
}

@keyframes title-arrives {
  from { opacity: 0; transform: translateY(-22px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes underline-in {
  from { opacity: 0; transform: scaleX(0); }
  to { opacity: 1; transform: scaleX(1); }
}

@keyframes box-breathe {
  0%, 100% { transform: perspective(1100px) rotateX(1.2deg) rotateZ(-0.35deg) translateY(0); }
  50% { transform: perspective(1100px) rotateX(0.6deg) rotateZ(0.25deg) translateY(-5px); }
}

@keyframes invitation-pulse {
  0%, 100% { box-shadow: 0 5px 0 #8d4215, 0 12px 25px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(255, 205, 70, 0); }
  50% { box-shadow: 0 5px 0 #8d4215, 0 12px 25px rgba(0, 0, 0, 0.3), 0 0 0 12px rgba(255, 205, 70, 0.15); }
}

@keyframes glint {
  from { transform: translateX(-45%); }
  to { transform: translateX(55%); }
}

@keyframes glow-drift {
  from { transform: translate(-2%, -2%) scale(0.95); }
  to { transform: translate(5%, 4%) scale(1.08); }
}

@keyframes sparks-drift {
  to { background-position: 86px 172px, -86px 214px; }
}

@keyframes opening-rumble {
  0%, 100% { transform: perspective(1100px) rotateZ(0); }
  20% { transform: perspective(1100px) rotateZ(-0.5deg) translateX(-2px); }
  60% { transform: perspective(1100px) rotateZ(0.5deg) translateX(2px); }
}

@keyframes open-settle {
  0% { transform: perspective(900px) scale(0.97) rotateX(2deg); }
  45% { transform: perspective(900px) scale(1.022) rotateX(0); }
  100% { transform: perspective(900px) scale(1) rotateX(0); }
}

@keyframes staff-arrives {
  0% { opacity: 0; transform: translateY(34%) rotate(2deg) scale(0.85); }
  68% { opacity: 1; transform: translateY(-3%) rotate(-1deg) scale(1.035); }
  100% { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

@keyframes message-arrives {
  0% { opacity: 0; transform: translate(-50%, 20px) scale(0.92); }
  18%, 72% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -9px) scale(1); }
}

@keyframes card-fly-one { 0% { opacity: .9; transform: translate(0) rotate(0); } 100% { opacity: 0; transform: translate(-310px, -260px) rotate(-28deg); } }
@keyframes card-fly-two { 0% { opacity: .9; transform: translate(0) rotate(0); } 100% { opacity: 0; transform: translate(-165px, -335px) rotate(19deg); } }
@keyframes card-fly-three { 0% { opacity: .9; transform: translate(0) rotate(0); } 100% { opacity: 0; transform: translate(12px, -355px) rotate(-12deg); } }
@keyframes card-fly-four { 0% { opacity: .9; transform: translate(0) rotate(0); } 100% { opacity: 0; transform: translate(190px, -320px) rotate(27deg); } }
@keyframes card-fly-five { 0% { opacity: .9; transform: translate(0) rotate(0); } 100% { opacity: 0; transform: translate(330px, -230px) rotate(-18deg); } }
@keyframes card-fly-six { 0% { opacity: .9; transform: translate(0) rotate(0); } 100% { opacity: 0; transform: translate(-360px, -90px) rotate(35deg); } }
@keyframes card-fly-seven { 0% { opacity: .9; transform: translate(0) rotate(0); } 100% { opacity: 0; transform: translate(355px, -65px) rotate(-34deg); } }

@keyframes confetti-fall {
  0% { opacity: 0; transform: translate3d(0, -8vh, 0) rotate(0deg); }
  8% { opacity: 1; }
  100% { opacity: 0.85; transform: translate3d(var(--drift), 112vh, 0) rotate(var(--spin)); }
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@keyframes panel-arrives {
  from { opacity: 0; transform: translateY(35px) scale(0.92) rotate(-0.5deg); }
  to { opacity: 1; transform: none; }
}

@keyframes green-pulse {
  0% { opacity: 0.9; transform: scale(0.7); }
  90%, 100% { opacity: 0; transform: scale(1.8); }
}

@keyframes leave-panel {
  to { opacity: 0; transform: translateY(-22px) scale(1.035); filter: blur(4px); }
}

@keyframes page-wash {
  to { opacity: 1; }
}

@media (max-height: 980px) and (min-width: 760px) {
  .intro {
    gap: 0.4rem;
    padding-top: 3.2rem;
    padding-bottom: 1.1rem;
  }

  .gift-stage { width: min(69vw, 640px); }
  .opening-label { margin-top: 0.7rem; padding-block: 0.58rem 0.54rem; }
  .birthday-copy h1 { font-size: clamp(2.8rem, 7vh, 4.6rem); }
  .invitation { margin-top: 0.28rem; }
}

@media (max-width: 700px) {
  body {
    background: radial-gradient(circle at 50% 28%, #95501f, #4b2413 54%, #200c06 100%);
  }

  .skip-intro {
    top: 12px;
    right: 12px;
    font-size: 0.72rem;
  }

  .intro {
    min-height: 100svh;
    padding: 4.6rem 16px 2rem;
  }

  .eyebrow { padding-inline: 1.5rem; line-height: 1.4; }
  h1 { font-size: clamp(3rem, 15vw, 4.8rem); }
  .gift-stage { width: min(94vw, 560px); }
  .photo-mat { border-width: 6px; border-radius: 12px; }
  .ribbon { display: none; }
  .kitchen-staff { width: 47%; right: -4%; bottom: -6%; }
  .opening-label { margin-top: 1rem; }
  .reveal-message { bottom: 4.3rem; font-size: 1rem; }
  .maximize-card { padding: 12px; }
  .maximize-panel { padding: 2.2rem 1.35rem 1.75rem; border-width: 5px; border-radius: 18px; }
  .maximize-panel h2 { font-size: 2.15rem; }
  .browser-example { margin-top: 0.8rem; }
  .browser-page { min-height: 78px; padding-left: 82px; font-size: 0.88rem; }
  .little-gnome-frame { left: 10px; width: 94px; height: 76px; }
  .sound-button { left: 12px; bottom: 12px; }

  .mobile-enter.is-visible {
    position: absolute;
    z-index: 14;
    left: 50%;
    bottom: 0;
    display: block;
    width: max-content;
    max-width: 88vw;
    padding: 0.8rem 1.45rem;
    border: 2px solid #f0bd3d;
    border-radius: 999px;
    color: #4a210f;
    background: linear-gradient(#ffdc68, #e9a918);
    box-shadow: 0 5px 0 #8d4215, 0 12px 25px rgba(0, 0, 0, 0.3);
    font: 700 1rem/1.1 var(--font-text);
    cursor: pointer;
    transform: translateX(-50%);
    animation: mobile-entry-arrives 650ms cubic-bezier(.16, .82, .22, 1.1) both,
               invitation-pulse 2s 700ms ease-in-out infinite;
  }
}

@keyframes mobile-entry-arrives {
  from { opacity: 0; transform: translate(-50%, 14px) scale(0.92); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

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

  .spark-field { display: none; }
}
