:root {
  color-scheme: dark;
  --ink: #070b12;
  --violet: #6b4e8d;
  --pink: #b94f68;
  --cyan: #57b9b2;
  --gold: #dfbe79;
  --orange: #a96845;
  --paper: #f6f0e5;
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
}

body {
  color: white;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button { font: inherit; }

.sound-toggle {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-height: 44px;
  padding: .65rem .9rem;
  border: 1px solid #dfbe7955;
  border-radius: 999px;
  background: #0b101de8;
  color: var(--paper);
  font-size: .875rem;
  cursor: pointer;
  backdrop-filter: blur(12px);
}
.sound-toggle[hidden] { display: none; }
.sound-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.sound-toggle:hover { border-color: var(--gold); }
.sound-bars { display: flex; align-items: center; gap: 3px; height: 18px; }
.sound-bars i { width: 2px; height: 4px; border-radius: 2px; background: var(--gold); }
.sound-toggle[aria-pressed="true"] .sound-bars i { animation: soundLevel .8s ease-in-out infinite alternate; }
.sound-bars i:nth-child(2) { animation-delay: -.3s; }
.sound-bars i:nth-child(3) { animation-delay: -.6s; }
.sound-bars i:nth-child(4) { animation-delay: -.15s; }
@keyframes soundLevel { to { height: 17px; } }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#starfield,
.aurora,
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#starfield { z-index: 0; }

.aurora {
  z-index: 0;
  filter: blur(60px);
  opacity: .4;
  mix-blend-mode: screen;
  will-change: transform;
}

.aurora-one {
  background: conic-gradient(from 40deg at 35% 45%, transparent 0 12%, #8e2f4966 20%, transparent 34%, #296d6a66 51%, transparent 67%, #543c7066 82%, transparent 100%);
  animation: auroraSpin 28s linear infinite;
}

.aurora-two {
  inset: -35%;
  background: conic-gradient(from 220deg, transparent, #8f583e55, transparent 24%, #5a365f66, transparent 50%, #2f757066, transparent 72%);
  animation: auroraSpin 38s linear infinite reverse;
}

.noise {
  z-index: 7;
  opacity: .13;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' 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;
}

#experience,
.portal-scene,
.reveal-scene {
  position: relative;
  width: 100%;
  min-height: 100svh;
}

#experience { z-index: 2; }

.portal-scene {
  display: grid;
  grid-template-rows: auto 1fr auto;
  place-items: center;
  padding: clamp(2rem, 6vh, 4.5rem) 1rem clamp(1.5rem, 5vh, 3rem);
  transition: opacity .55s ease, transform 1.1s cubic-bezier(.2,.8,.2,1), filter .7s ease;
}

.portal-scene.is-departing {
  opacity: 0;
  transform: scale(1.65) rotate(4deg);
  filter: blur(15px) saturate(2);
}

.eyebrow {
  margin: 0;
  font-size: clamp(.78rem, 2vw, 1rem);
  font-weight: 800;
  letter-spacing: .24em;
  text-align: center;
  text-transform: uppercase;
  color: #ead8ae;
  text-shadow: 0 0 22px #b08a52aa;
  animation: letterFloat 3.8s ease-in-out infinite;
}

.portal-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: min(78vmin, 38rem);
  aspect-ratio: 1;
  isolation: isolate;
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform .22s ease-out;
}

.portrait-button {
  position: relative;
  z-index: 3;
  width: 68%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: radial-gradient(circle at 50% 80%, #27233c, #090b12 65%);
  box-shadow:
    0 0 0 1px #f5e5c7cc,
    0 0 0 7px #dfbe7926,
    0 0 44px 10px #893e5b66,
    0 0 100px 25px #3f8f8966,
    inset 0 0 36px #070a11;
  transition: transform .35s cubic-bezier(.2,.9,.2,1.4), box-shadow .35s ease;
  animation: portalBreathe 2.8s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}

.portrait-button:hover,
.portrait-button:focus-visible {
  transform: scale(1.045);
  box-shadow:
    0 0 0 2px #fff9ee,
    0 0 0 12px #dfbe7944,
    0 0 70px 18px #95486288,
    0 0 130px 35px #4b9a9370;
  outline: none;
}

.portrait-button:active { transform: scale(.98); }

.portrait-button img {
  position: absolute;
  inset: -12% -14% -1%;
  width: 128%;
  height: 113%;
  object-fit: contain;
  object-position: center bottom;
  border-radius: 0 0 48% 48%;
  filter: drop-shadow(0 16px 24px #09000daa);
  pointer-events: none;
}

.portrait-glow {
  position: absolute;
  inset: 3%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #874158, var(--gold), #3f8c86, #59456f, #874158);
  filter: blur(22px);
  opacity: .58;
  animation: auroraSpin 10s linear infinite;
}

.tap-ribbon {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: -7%;
  display: flex;
  min-width: 66%;
  padding: .72rem 1.2rem .7rem;
  transform: translateX(-50%) rotate(-3deg);
  flex-direction: column;
  border: 1px solid #f4e8cf;
  border-radius: 999px;
  background: linear-gradient(105deg, #ead7aa, #c59b59 52%, #f2e3bd);
  color: #171008;
  box-shadow: 0 5px 0 #604522, 0 18px 40px #0009;
  line-height: .95;
  text-transform: uppercase;
  white-space: nowrap;
  animation: ribbonWiggle 4.5s ease-in-out infinite;
}

.tap-main {
  font-size: clamp(1.25rem, 4vw, 2rem);
  font-weight: 1000;
  letter-spacing: .02em;
}

.tap-small {
  margin-top: .25rem;
  font-size: clamp(.6rem, 1.7vw, .78rem);
  font-weight: 900;
  letter-spacing: .22em;
}

.orbit {
  position: absolute;
  inset: 4%;
  z-index: 1;
  border: 1px solid #dfc99555;
  border-radius: 50%;
  box-shadow: inset 0 0 25px #624a6940, 0 0 25px #4d8a8550;
  animation: auroraSpin 18s linear infinite;
}

.orbit-b {
  inset: 0;
  border-style: dashed;
  border-color: #c5a76c88;
  animation-duration: 26s;
  animation-direction: reverse;
}

.orbit-c {
  inset: 14%;
  border-width: 4px 1px;
  border-color: #9f5367 #4f9a94;
  filter: drop-shadow(0 0 7px #6e536d);
  animation-duration: 14s;
}

.orbit span {
  position: absolute;
  top: 50%;
  left: -1.5%;
  width: clamp(.65rem, 2.3vw, 1rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 10px white, 0 0 28px var(--cyan);
}

.orbit span:nth-child(2) { top: 7%; left: 74%; background: var(--gold); box-shadow: 0 0 22px var(--orange); }
.orbit span:nth-child(3) { top: 87%; left: 65%; background: var(--pink); box-shadow: 0 0 22px var(--pink); }

.tap-hint {
  margin: 0;
  color: #e7dfd3;
  font-size: clamp(.85rem, 2.4vw, 1.05rem);
  letter-spacing: .08em;
  text-align: center;
  opacity: .9;
}

.tap-hint span { color: var(--gold); }

.reveal-scene {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 3vw, 2rem);
  overflow-x: hidden;
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  transform: scale(.75);
  transition: opacity .8s ease, transform 1s cubic-bezier(.16,1,.3,1), visibility 0s 1s;
}

.reveal-scene.is-visible {
  visibility: visible;
  opacity: 1;
  transform: scale(1);
  transition-delay: 0s;
}

.reveal-rays {
  position: fixed;
  width: 170vmax;
  aspect-ratio: 1;
  background: repeating-conic-gradient(from 0deg, #dfbe790c 0deg 3deg, transparent 3deg 14deg);
  mask-image: radial-gradient(circle, black 0 42%, transparent 74%);
  animation: auroraSpin 45s linear infinite;
}

.motion-field {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.invite-shell { z-index: 2; }

.kinetic-word {
  position: absolute;
  color: transparent;
  font-size: clamp(1rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: .42em;
  text-transform: uppercase;
  -webkit-text-stroke: 1px #dfc99555;
  filter: drop-shadow(0 0 12px #8f5e7270);
  opacity: .2;
  will-change: transform;
}

.word-one { top: 12%; left: -4%; transform: rotate(-12deg); animation: wordDriftA 8s ease-in-out infinite; }
.word-two { right: -4%; top: 32%; transform: rotate(12deg); animation: wordDriftB 10s ease-in-out infinite; }
.word-three { left: 5%; bottom: 5%; transform: rotate(8deg); animation: wordDriftA 12s ease-in-out -4s infinite reverse; }

.motion-glyph {
  position: absolute;
  color: var(--gold);
  font-size: clamp(.8rem, 1.5vw, 1.4rem);
  text-shadow: 0 0 14px currentColor;
  will-change: transform;
  animation: glyphFloat 5s ease-in-out infinite;
}

.glyph-one { top: 9%; left: 19%; color: var(--cyan); animation-delay: -.7s; }
.glyph-two { top: 16%; right: 15%; color: var(--pink); animation-delay: -2.1s; }
.glyph-three { top: 68%; left: 11%; color: var(--orange); animation-delay: -3.2s; }
.glyph-four { bottom: 9%; right: 17%; color: var(--gold); animation-delay: -1.4s; }
.glyph-five { top: 48%; right: 5%; color: var(--cyan); animation-delay: -4s; }

.comet {
  position: absolute;
  width: clamp(5rem, 12vw, 10rem);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #fff, var(--cyan));
  box-shadow: 0 0 12px #fff, 0 0 25px var(--cyan);
  opacity: 0;
  transform: rotate(-28deg);
  animation: cometFly 6s linear infinite;
}

.comet-one { top: 18%; left: -18%; animation-delay: .2s; }
.comet-two { top: 62%; left: -22%; animation-delay: 2.6s; filter: hue-rotate(95deg); }
.comet-three { top: 82%; left: -15%; animation-delay: 4.4s; filter: hue-rotate(210deg); }

.invite-shell {
  position: relative;
  width: min(94vw, 48rem);
  margin: auto;
  padding: 1px;
  border-radius: clamp(1.8rem, 5vw, 3.2rem);
  background: conic-gradient(from var(--angle, 0deg), #794153, var(--gold), #3c7d78, #5b466f, #794153);
  box-shadow: 0 0 65px #55344b70, 0 35px 80px #000b;
  animation: borderTurn 14s linear infinite, cardHover 7s ease-in-out infinite;
}

@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.invite-card {
  position: relative;
  padding: clamp(2rem, 6vw, 4.3rem) clamp(1.35rem, 6vw, 4.8rem) clamp(1.6rem, 5vw, 3.6rem);
  overflow: hidden;
  border: 1px solid #ffffff5e;
  border-radius: inherit;
  background:
    radial-gradient(circle at 10% 10%, #74364842, transparent 28%),
    radial-gradient(circle at 90% 90%, #2c77713d, transparent 30%),
    linear-gradient(145deg, #15151fee, #090d15f7 55%, #1c1620f5);
  text-align: center;
  backdrop-filter: blur(24px);
}

.invite-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #fff 0 1px, transparent 1.5px);
  background-size: 30px 30px;
  opacity: .13;
  mask-image: linear-gradient(black, transparent 80%);
  pointer-events: none;
}

.corner {
  position: absolute;
  width: 3.2rem;
  height: 3.2rem;
  border-color: var(--gold);
  filter: drop-shadow(0 0 6px #ffb52c);
}

.corner-tl { top: 1rem; left: 1rem; border-top: 2px solid; border-left: 2px solid; border-radius: 1.2rem 0 0; }
.corner-tr { top: 1rem; right: 1rem; border-top: 2px solid; border-right: 2px solid; border-radius: 0 1.2rem 0 0; }
.corner-bl { bottom: 1rem; left: 1rem; border-bottom: 2px solid; border-left: 2px solid; border-radius: 0 0 0 1.2rem; }
.corner-br { bottom: 1rem; right: 1rem; border-bottom: 2px solid; border-right: 2px solid; border-radius: 0 0 1.2rem; }

.card-kicker {
  margin: 0 0 .45rem;
  color: var(--gold);
  font-size: clamp(.72rem, 2vw, .95rem);
  font-weight: 900;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.mega-word {
  margin: 0;
  color: transparent;
  font-size: clamp(3.6rem, 15vw, 8rem);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: .82;
  -webkit-text-stroke: 1px #f3e5c7;
  background: linear-gradient(90deg, #9e6d54, #ecd59f, #af8b50, #e8d8b0);
  background-size: 250% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  filter: drop-shadow(0 0 18px #ad895d66);
  animation: rainbowSlide 10s linear infinite;
}

.milestone-badge {
  display: inline-block;
  margin: .85rem 0 0;
  padding: .38rem .85rem;
  border: 1px solid #ffdf6b88;
  border-radius: 999px;
  background: #ffdf6b16;
  color: var(--gold);
  font-size: clamp(.72rem, 2vw, .9rem);
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
  box-shadow: 0 0 20px #ffbd4450;
}

.invite-card h2 {
  margin: 1.3rem 0 .65rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 7vw, 4.7rem);
  font-weight: 500;
  line-height: .95;
}

.invite-card h2 span {
  display: block;
  margin-top: .15em;
  color: var(--gold);
  font-style: italic;
  text-shadow: 0 0 25px #8d5d6580;
}

.card-copy {
  max-width: 33rem;
  margin: 0 auto 1.6rem;
  color: #e4dce2;
  font-size: clamp(1rem, 2.5vw, 1.18rem);
  line-height: 1.55;
}

.event-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(.7rem, 2vw, 1.4rem);
  padding: clamp(1rem, 3vw, 1.4rem);
  border: 1px solid #ffffff35;
  border-radius: 1.4rem;
  background: #ffffff0c;
}

.detail-block { display: grid; gap: .22rem; }
.detail-block strong { font-size: clamp(.95rem, 2.6vw, 1.2rem); }
.detail-block span:last-child { color: #dccdec; font-size: clamp(.82rem, 2.2vw, 1rem); }

.detail-label {
  color: #8fc7c1;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.detail-star { color: var(--gold); font-size: 1.5rem; animation: starPulse 1.7s ease-in-out infinite; }

.dress-code {
  margin: 1.35rem 0 .5rem;
  font-size: clamp(.92rem, 2.3vw, 1.04rem);
}

.dress-code span {
  margin-right: .4rem;
  color: #c77b8e;
  font-weight: 900;
  text-transform: uppercase;
}

.party-console { margin: 1rem 0 .6rem; }

.party-console > p {
  margin: 0 0 .65rem;
  color: #ddc9ed;
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.party-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .55rem;
}

.party-action {
  position: relative;
  display: grid;
  place-items: center;
  gap: .2rem;
  min-width: 0;
  padding: .55rem .35rem .48rem;
  overflow: hidden;
  border: 1px solid #ffffff3d;
  border-radius: .6rem;
  background: linear-gradient(145deg, #ffffff10, #ffffff04);
  color: white;
  cursor: pointer;
  box-shadow: inset 0 0 16px #ffffff08;
  transition: transform .22s ease, border-color .22s ease, background .22s ease;
}

.party-action::after {
  content: "";
  position: absolute;
  inset: -80% 25%;
  background: linear-gradient(90deg, transparent, #ffffffaa, transparent);
  transform: rotate(25deg) translateX(-240%);
  transition: transform .6s ease;
}

.party-action:hover,
.party-action:focus-visible,
.party-action.is-active {
  z-index: 1;
  border-color: var(--gold);
  background: linear-gradient(145deg, #8c495c38, #2d666138);
  transform: translateY(-3px) scale(1.02);
  outline: none;
}

.party-action:hover::after,
.party-action:focus-visible::after,
.party-action.is-active::after { transform: rotate(25deg) translateX(240%); }
.party-icon { display: grid; width: clamp(1.35rem, 3vw, 1.8rem); aspect-ratio: 1; color: var(--gold); filter: drop-shadow(0 0 7px #a98349); }
.party-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.party-action strong { font-size: clamp(.7rem, 1.7vw, .86rem); letter-spacing: .05em; }
.party-action[data-party="music"].is-active > span { animation: iconDance .2s ease-in-out 5 alternate; }
.party-action[data-party="dhol"].is-active { animation: dholShake .12s linear 7; }
.party-action[data-party="cheers"].is-active > span { animation: cheersClink .28s ease-in-out 3 alternate; }
.party-action[data-party="laugh"].is-active > span { animation: laughBounce .22s ease-in-out 4 alternate; }

.signature {
  margin: .45rem 0 1rem;
  color: #fff6b9;
  font-family: Georgia, serif;
  font-size: clamp(1.05rem, 3vw, 1.4rem);
  font-style: italic;
}

.replay-button {
  padding: .78rem 1.2rem;
  border: 1px solid #ffffff66;
  border-radius: 999px;
  background: transparent;
  color: white;
  cursor: pointer;
  transition: background .25s ease, color .25s ease, transform .25s ease;
}

.replay-button:hover,
.replay-button:focus-visible {
  background: white;
  color: var(--ink);
  transform: translateY(-2px);
  outline: none;
}

.reveal-line { opacity: 0; transform: translateY(24px); }
.is-visible .reveal-line { animation: revealLine .75s cubic-bezier(.16,1,.3,1) forwards; }
.is-visible .reveal-line:nth-of-type(1) { animation-delay: .25s; }
.is-visible .reveal-line:nth-of-type(2) { animation-delay: .38s; }
.is-visible .reveal-line:nth-of-type(3) { animation-delay: .52s; }
.is-visible .reveal-line:nth-of-type(4) { animation-delay: .66s; }
.is-visible .event-grid { animation-delay: .8s; }
.is-visible .dress-code { animation-delay: .95s; }
.is-visible .party-console { animation-delay: 1.04s; }
.is-visible .signature { animation-delay: 1.14s; }
.is-visible .replay-button { animation-delay: 1.24s; }

.flash {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  background: white;
}

.flash.is-firing { animation: flashBang .85s ease-out; }

.curtain {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 15;
  width: 51%;
  pointer-events: none;
  background:
    repeating-linear-gradient(100deg, transparent 0 7%, #ffffff12 8%, transparent 12%),
    linear-gradient(135deg, #5c2738, #272238 48%, #0b1018);
  box-shadow: 0 0 80px #000;
  transform: scaleX(0);
}

.curtain-left { left: 0; transform-origin: left; }
.curtain-right { right: 0; transform-origin: right; }
.curtain.is-closing { animation: curtainClose 1.45s cubic-bezier(.7,0,.2,1) both; }
.curtain.is-opening { animation: curtainOpen 1.1s cubic-bezier(.8,0,.2,1) both; }

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

.party-effect-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  pointer-events: none;
}

.party-burst {
  position: fixed;
  left: var(--x);
  top: var(--y);
  color: var(--color, var(--gold));
  font-size: var(--size, 1.3rem);
  font-weight: 700;
  letter-spacing: .12em;
  text-shadow: 0 0 14px currentColor;
  opacity: 0;
  will-change: transform, opacity;
  animation: partyBurst var(--duration, 1.8s) cubic-bezier(.17,.7,.25,1) forwards;
}

.beat-ring {
  position: fixed;
  left: var(--x);
  top: var(--y);
  width: 3rem;
  aspect-ratio: 1;
  border: 2px solid var(--color, var(--gold));
  border-radius: 50%;
  box-shadow: 0 0 18px var(--color, var(--gold));
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: beatRing 1s ease-out var(--delay, 0s) forwards;
}

.confetti {
  position: absolute;
  left: var(--x);
  top: -8vh;
  width: var(--w);
  height: calc(var(--w) * 1.8);
  border-radius: 3px;
  background: var(--color);
  box-shadow: 0 0 8px var(--color);
  transform: rotate(var(--rotate));
  animation: confettiFall var(--duration) cubic-bezier(.1,.5,.3,1) var(--delay) forwards;
}

@keyframes auroraSpin { to { transform: rotate(360deg); } }
@keyframes borderTurn { to { --angle: 360deg; } }
@keyframes letterFloat { 50% { transform: translateY(6px); letter-spacing: .3em; } }
@keyframes portalBreathe { 50% { transform: scale(1.022); } }
@keyframes ribbonWiggle { 0%,100% { transform: translateX(-50%) rotate(-3deg); } 50% { transform: translateX(-50%) rotate(2deg) translateY(-5px); } }
@keyframes rainbowSlide { to { background-position: 250% 0; } }
@keyframes starPulse { 50% { transform: scale(1.35) rotate(35deg); filter: drop-shadow(0 0 9px var(--gold)); } }
@keyframes cardHover { 50% { transform: translateY(-7px) rotateX(1deg); } }
@keyframes revealLine { to { opacity: 1; transform: translateY(0); } }
@keyframes flashBang { 0% { opacity: 0; } 16% { opacity: 1; } 100% { opacity: 0; } }
@keyframes curtainClose { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes curtainOpen { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes confettiFall {
  0% { transform: translate3d(0,-10vh,0) rotate(var(--rotate)); opacity: 1; }
  100% { transform: translate3d(var(--drift),112vh,0) rotate(calc(var(--rotate) + 760deg)); opacity: .85; }
}
@keyframes wordDriftA {
  0%, 100% { transform: translate3d(0,0,0) rotate(-12deg); }
  50% { transform: translate3d(34px,-24px,0) rotate(-5deg) scale(1.08); }
}
@keyframes wordDriftB {
  0%, 100% { transform: translate3d(0,0,0) rotate(12deg); }
  50% { transform: translate3d(-38px,28px,0) rotate(4deg) scale(.94); }
}
@keyframes glyphFloat {
  0%, 100% { transform: translate3d(0,0,0) rotate(0deg) scale(.8); opacity: .45; }
  50% { transform: translate3d(18px,-34px,0) rotate(160deg) scale(1.3); opacity: 1; }
}
@keyframes cometFly {
  0% { transform: translate3d(0,0,0) rotate(-28deg) scaleX(.2); opacity: 0; }
  8% { opacity: .9; }
  45%, 100% { transform: translate3d(145vw,-42vh,0) rotate(-28deg) scaleX(1); opacity: 0; }
}
@keyframes partyBurst {
  0% { opacity: 0; transform: translate(-50%,-30%) scale(.4) rotate(-15deg); }
  14% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.35) rotate(var(--spin)); }
}
@keyframes beatRing {
  0% { opacity: .95; transform: translate(-50%,-50%) scale(.2); }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(8); }
}
@keyframes iconDance { to { transform: rotate(18deg) scale(1.28); } }
@keyframes dholShake { 25% { transform: translate(-3px,-3px) rotate(-2deg); } 75% { transform: translate(3px,-2px) rotate(2deg); } }
@keyframes cheersClink { to { transform: rotate(-16deg) scale(1.22); } }
@keyframes laughBounce { to { transform: translateY(-7px) rotate(8deg) scale(1.18); } }

@media (max-width: 640px) {
  .portal-scene { padding-top: 5rem; }
  .portal-wrap { width: min(95vw, 30rem); }
  .portrait-button { width: 68%; }
  .tap-ribbon { bottom: -9%; }
  .event-grid { grid-template-columns: 1fr; }
  .detail-star { transform: rotate(90deg); font-size: 1rem; }
  .invite-shell { margin: 1rem auto; }
  .reveal-scene { align-items: start; }
  .kinetic-word { opacity: .2; }
  .word-one { top: 4%; }
  .word-two { top: 52%; }
  .party-actions { grid-template-columns: repeat(2, 1fr); }
}

@media (max-height: 720px) and (min-width: 641px) {
  .portal-wrap { width: min(66vmin, 31rem); }
  .portal-scene { padding-block: 1.5rem; }
  .invite-card { padding-block: 1.7rem; }
  .mega-word { font-size: clamp(3.7rem, 13vh, 6.4rem); }
  .invite-card h2 { font-size: clamp(2rem, 7vh, 3.4rem); }
}

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