/* L'Amir de Marie — shared styles */
:root {
  --pink: #FF4F8B;
  --orange: #FF8A3D;
  --yellow: #FFD23F;
  --teal: #1FC8B0;
  --purple: #6B3FD9;
  --ink: #1E1240;
  --cream: #FFF6E5;
  --stage-h: 176px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
}
button, input { font: inherit; color: inherit; }

/* Retro sunburst */
.bg {
  position: fixed; inset: -60%;
  background: repeating-conic-gradient(from 0deg,
    var(--yellow) 0deg 12deg, var(--orange) 12deg 24deg,
    var(--pink) 24deg 36deg, var(--purple) 36deg 48deg,
    var(--teal) 48deg 60deg);
  animation: spin 60s linear infinite;
  z-index: -2;
}
.bg-fade {
  position: fixed; inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(255,246,229,0.94) 0%, rgba(255,246,229,0.8) 45%, rgba(255,246,229,0.2) 100%);
  z-index: -1;
}
@keyframes spin { to { transform: rotate(360deg); } }

.wrap {
  width: 100%; max-width: 480px; margin: 0 auto;
  padding: 28px 16px 40px;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  text-align: center;
}

.eyebrow {
  font-family: 'Bungee', sans-serif;
  font-size: 0.78rem; letter-spacing: 2px;
  background: var(--ink); color: var(--yellow);
  padding: 6px 14px; border-radius: 999px;
  transform: rotate(-3deg);
  box-shadow: 4px 4px 0 var(--pink);
}
.title {
  font-family: 'Bungee Shade', 'Bungee', sans-serif;
  font-weight: 400; line-height: 1.02; color: var(--purple);
  font-size: clamp(2.4rem, 13vw, 4.6rem);
}
.title span { display: inline-block; animation: bob 2.4s ease-in-out infinite; }
.title .de { color: var(--pink); font-size: 0.55em; display: block; animation-delay: -.8s; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(-2deg); } }

.date {
  font-family: 'Bungee', sans-serif;
  font-size: clamp(1.05rem, 5vw, 1.5rem);
  background: var(--yellow);
  border: 3px solid var(--ink);
  padding: 8px 18px; border-radius: 14px;
  box-shadow: 5px 5px 0 var(--ink);
  transform: rotate(2deg);
}

.card {
  width: 100%;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: 8px 8px 0 var(--ink);
  padding: 22px 18px;
}
.card h2 {
  font-family: 'Bungee', sans-serif;
  font-size: 1.05rem; letter-spacing: 1px; line-height: 1.25;
  margin-bottom: 10px;
}

.btn {
  font-family: 'Bungee', sans-serif;
  font-size: 1rem; letter-spacing: 1px;
  background: var(--pink); color: #fff;
  border: 3px solid var(--ink); border-radius: 14px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 12px 18px; cursor: pointer;
  transition: transform .1s, box-shadow .1s;
  text-decoration: none; display: inline-block;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }

footer { font-size: 0.8rem; font-weight: 600; opacity: 0.75; }

/* Floating emoji stickers */
.stickers { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.stickers span { position: absolute; font-size: 2rem; animation: float 6s ease-in-out infinite; opacity: 0.9; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-14px) rotate(8deg); } }
.wrap > * { position: relative; z-index: 1; }
.wrap > .stage.inline { z-index: 5; }
body.stage-fixed .wrap { padding-bottom: calc(var(--stage-h) + 40px); }

/* Page transition: retro iris wipe */
.wipe {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: var(--ink);
  clip-path: circle(0% at 50% 85%);
  transition: clip-path .7s cubic-bezier(.7,0,.3,1);
}
.wipe.cover { clip-path: circle(150% at 50% 85%); pointer-events: auto; }
.wipe.instant { transition: none; }

/* ─────────── THE COUPLE ─────────── */
.stage {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: var(--stage-h);
  pointer-events: none; z-index: 20;
  transition: transform .35s ease;
}
body.typing .stage:not(.inline) { transform: translateY(78%); }
/* inline strip: the couple stands on top of the next card */
.stage.inline {
  position: relative; left: auto; right: auto; bottom: auto;
  width: 100%; height: 168px; z-index: 5;
  margin: -8px 0 -26px;
}
.stage.inline .ground { display: none; }
.stage.inline .toon { bottom: 0; }
.stage .ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 20px;
  border-top: 3px solid var(--ink);
  background: repeating-linear-gradient(90deg, var(--pink) 0 22px, var(--yellow) 22px 44px);
}
.stage.sand .ground {
  background:
    radial-gradient(circle at 20% 40%, #C99A55 0 2px, transparent 3px) 0 0 / 26px 14px,
    #F1CF8E;
}
.toon {
  position: absolute; left: 0; bottom: 12px;
  pointer-events: auto; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  will-change: transform; z-index: 2;
  outline: none;
}
.toon.amir { z-index: 3; }
.toon-inner { transition: transform .2s; perspective: 300px; }
.toon-svg { display: block; overflow: visible; }
.toon.amir .toon-svg { height: 146px; width: auto; }
.toon.marie .toon-svg { height: 133px; width: auto; }
.toon:focus-visible .toon-svg { filter: drop-shadow(0 0 4px var(--teal)); }

.toon-svg .tbody, .toon-svg .leg, .toon-svg .arm, .toon-svg .headrot { transform-box: view-box; }
.toon-svg .arm, .toon-svg .headrot { transition: transform .25s ease; }
.toon-svg .tbody { transform-origin: 60px 200px; animation: breathe 3s ease-in-out infinite; }
.toon.marie .toon-svg .tbody { animation-delay: -1.3s; }
.toon-svg .eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.6s infinite; }
.toon.marie .eyes { animation-delay: -1.9s; }
.toon-svg .m-o { display: none; }
.toon.oops .m-o { display: inline; }
.toon.oops .m-happy { display: none; }

@keyframes breathe { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(1.018); } }
@keyframes blink { 0%,93%,100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }

/* walking */
.toon.walking .tbody { animation: walkbob .38s ease-in-out infinite; }
.toon.walking .leg-l { animation: swing .38s ease-in-out infinite alternate; }
.toon.walking .leg-r { animation: swing .38s ease-in-out infinite alternate-reverse; }
.toon.walking .arm-l { animation: swingArm .38s ease-in-out infinite alternate-reverse; }
.toon.walking .arm-r { animation: swingArm .38s ease-in-out infinite alternate; }
@keyframes walkbob { 0%,100% { transform: translateY(0) rotate(2deg); } 50% { transform: translateY(-4px) rotate(2deg); } }
@keyframes swing { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
@keyframes swingArm { from { transform: rotate(-18deg); } to { transform: rotate(18deg); } }

/* wave */
.toon.wave .arm-r { animation: wave .32s ease-in-out infinite alternate; }
@keyframes wave { from { transform: rotate(-135deg); } to { transform: rotate(-168deg); } }

/* jump for joy */
.toon.jump .toon-svg { animation: jump .45s cubic-bezier(.3,.8,.4,1) infinite; }
.toon.jump .arm-l { transform: rotate(150deg); }
.toon.jump .arm-r { transform: rotate(-150deg); }
@keyframes jump { 0%,100% { transform: translateY(0); } 45% { transform: translateY(-30px); } }

/* dance */
.toon.dance .tbody { animation: wiggle .5s ease-in-out infinite alternate; }
.toon.dance .arm-l { animation: danceL .5s ease-in-out infinite alternate; }
.toon.dance .arm-r { animation: danceR .5s ease-in-out infinite alternate; }
.toon.dance .leg-l { animation: swing .5s ease-in-out infinite alternate; }
.toon.marie.dance .tbody { animation-delay: -.25s; }
@keyframes wiggle { from { transform: rotate(-7deg); } to { transform: rotate(7deg) translateY(-3px); } }
@keyframes danceL { from { transform: rotate(120deg); } to { transform: rotate(170deg); } }
@keyframes danceR { from { transform: rotate(-170deg); } to { transform: rotate(-120deg); } }

/* shrug / headshake / oops */
.toon.shrug .arm-l { transform: rotate(42deg); }
.toon.shrug .arm-r { transform: rotate(-42deg); }
.toon.shrug .headrot { transform: rotate(-9deg); }
.toon.headshake .headrot { animation: shake .22s ease-in-out infinite alternate; }
@keyframes shake { from { transform: rotate(-10deg); } to { transform: rotate(10deg); } }

/* twirl */
.toon.twirl .toon-svg { animation: twirl .8s ease-in-out; }
@keyframes twirl { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }

/* clap */
.toon.clap .arm-l { animation: clapL .22s ease-in-out infinite alternate; }
.toon.clap .arm-r { animation: clapR .22s ease-in-out infinite alternate; }
@keyframes clapL { from { transform: rotate(-12deg); } to { transform: rotate(-34deg); } }
@keyframes clapR { from { transform: rotate(12deg); } to { transform: rotate(34deg); } }

/* point (up and to the right) */
.toon.point .arm-r { transform: rotate(-115deg); }

/* hug: Amir (left) wraps an arm over Marie, Marie leans in */
.toon.hug .arm-r { transform: rotate(-80deg); }
.toon.lean .headrot { transform: rotate(-12deg); }
.toon.lean-r .headrot { transform: rotate(7deg); }

/* speech bubble */
.bubble {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  width: max-content; max-width: 200px;
  transform: translateX(-50%) scale(.5); transform-origin: bottom center;
  opacity: 0; transition: opacity .18s, transform .18s;
  background: #fff; border: 3px solid var(--ink); border-radius: 14px;
  box-shadow: 3px 3px 0 var(--ink);
  padding: 7px 10px; font-size: .82rem; font-weight: 700; line-height: 1.25;
  text-align: center; pointer-events: none;
}
.bubble.show { opacity: 1; transform: translateX(-50%) scale(1); }
.bubble::after {
  content: ''; position: absolute; top: 100%; left: 50%; margin-left: -7px;
  border: 7px solid transparent; border-top-color: var(--ink);
}

/* particles + costume-change poof */
.particle {
  position: absolute; font-size: 1.4rem; line-height: 1;
  pointer-events: none; opacity: 0;
  animation: rise 1.8s ease-out forwards;
}
@keyframes rise {
  0% { transform: translate(0, 0) scale(.4); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(var(--dx), -110px) scale(1.2); opacity: 0; }
}
.poof {
  position: absolute; bottom: 55px; width: 44px; height: 44px; margin-left: -22px;
  border-radius: 50%; background: #fff; z-index: 6; pointer-events: none;
  box-shadow: 30px 12px 0 8px #fff, -30px 10px 0 6px #fff, 0 -28px 0 10px #fff,
              22px -20px 0 4px #fff, -22px -18px 0 6px #fff, 0 30px 0 6px #fff;
  filter: drop-shadow(0 0 2px rgba(30,18,64,.6));
  animation: poof .85s ease-out forwards;
}
@keyframes poof {
  0% { transform: scale(.2); opacity: 0; }
  25% { transform: scale(1.4); opacity: 1; }
  70% { transform: scale(1.6); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
