:root {
  --red: #e3122b;
  --blue: #1b4fd6;
  --yellow: #ffd21f;
  --ink: #000;
  --white: #fff;
  --pink: #ff6fae;
  --display: "Bangers", "Impact", sans-serif;
  --body: "Comic Neue", "Comic Sans MS", sans-serif;
  --line: 4px solid var(--ink);
  --dots: radial-gradient(circle, rgb(0 0 0 / .16) 1.5px, transparent 2px) 0 0 / 11px 11px;
}

* { box-sizing: border-box; }
/* nothing may widen the page on phones (rotated panels, entrance animations) */
html { scroll-behavior: smooth; overflow-x: hidden; }
html:has(body.sealed) { overflow: hidden; }
body {
  margin: 0;
  font: 700 1.125rem/1.5 var(--body);
  color: var(--ink);
  background: var(--dots), var(--blue);
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
h1, h2, h3, p, ol, ul, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
:focus-visible { outline: 4px solid var(--yellow); outline-offset: 3px; }

/* ---------- Hero: two comic panels, 50/50 on desktop, stacked on phones ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--ink);
  border-bottom: 6px solid var(--ink);
  overflow: hidden;
}
.hero-panel { height: min(88svh, 820px); overflow: hidden; }
.hero-panel img { width: 100%; height: 100%; object-fit: cover; }
.hero-character {
  /* web pattern shows until a photo is uploaded */
  background:
    repeating-radial-gradient(circle at 0 0, transparent 0 46px, rgb(0 0 0 / .4) 46px 49px),
    repeating-conic-gradient(from 0deg at 0 0, rgb(0 0 0 / .4) 0 1deg, transparent 1deg 12deg),
    var(--red);
  clip-path: polygon(0 0, 100% 0, calc(100% - 46px) 100%, 0 100%);
  animation: slam-left .5s cubic-bezier(.2, 1.4, .4, 1) both;
}
.hero-child {
  display: grid;
  place-items: center;
  background: var(--dots), var(--yellow);
  clip-path: polygon(34px 0, 100% 0, 100% 100%, -12px 100%);
  margin-left: -34px;
  animation: slam-right .5s cubic-bezier(.2, 1.4, .4, 1) .1s both;
}
.hero-child p { font: 2rem var(--display); padding: 1rem; text-align: center; }
.hero-title {
  position: absolute;
  inset: auto 0 5%;
  z-index: 2;
  display: grid;
  justify-items: center;
  pointer-events: none;
}
h1 {
  font: 400 clamp(3rem, 8.5vw, 7.5rem)/.92 var(--display);
  letter-spacing: .03em;
  text-align: center;
  color: var(--yellow);
  -webkit-text-stroke: .045em var(--ink);
  paint-order: stroke fill;
  text-shadow: .06em .07em 0 var(--ink);
  transform: rotate(-3deg);
  animation: pop .45s cubic-bezier(.2, 1.6, .4, 1) .45s both;
}
/* 12-point starburst from three rotated squares */
.burst {
  position: relative;
  display: grid;
  place-content: center;
  width: 7.5rem;
  aspect-ratio: 1;
  margin-bottom: 1.5rem;
  text-align: center;
  filter: drop-shadow(3px 0 0 var(--ink)) drop-shadow(-3px 0 0 var(--ink)) drop-shadow(0 3px 0 var(--ink)) drop-shadow(0 -3px 0 var(--ink));
  animation: pop .45s cubic-bezier(.2, 1.6, .4, 1) .7s both;
}
.burst, .burst::before, .burst::after { background: var(--red); }
.burst::before, .burst::after { content: ""; position: absolute; inset: 0; z-index: -1; }
.burst::before { transform: rotate(30deg); }
.burst::after { transform: rotate(60deg); }
.burst b { font: 400 3.6rem/.8 var(--display); color: var(--white); }
.burst small { font: 400 1.3rem/1 var(--display); color: var(--yellow); }

@keyframes slam-left { from { transform: translateX(-100%); } }
@keyframes slam-right { from { transform: translateX(100%); } }
@keyframes pop { from { opacity: 0; scale: .3; } }

/* ---------- When: date, countdown, calendar ---------- */
.when {
  padding: 2.5rem 1rem 3rem;
  text-align: center;
  background: var(--yellow);
  border-bottom: 6px solid var(--ink);
}
.when-date { font: 400 clamp(1.6rem, 4.5vw, 2.6rem)/1.1 var(--display); letter-spacing: .03em; }
.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(.5rem, 2vw, 1.25rem);
  margin: 1.5rem 0 2rem;
}
.countdown > div {
  min-width: clamp(4.4rem, 20vw, 8rem);
  padding: .6rem .4rem .5rem;
  background: var(--white);
  border: var(--line);
  box-shadow: 6px 6px 0 var(--ink);
  color: var(--ink);
}
.countdown > div:nth-child(odd) { transform: rotate(-2deg); }
.countdown > div:nth-child(even) { transform: rotate(1.5deg); }
.countdown b { display: block; font: 400 clamp(2.4rem, 9vw, 4.5rem)/1 var(--display); color: var(--red); font-variant-numeric: tabular-nums; }
.countdown span { font-size: .95rem; }
.countdown-done { display: none; font: 400 2.4rem var(--display); }
.countdown.done > div { display: none; }
.countdown.done .countdown-done { display: block; }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1rem; }
.btn {
  display: inline-block;
  padding: .7rem 1.3rem;
  font: 400 1.35rem/1.1 var(--display);
  letter-spacing: .04em;
  text-decoration: none;
  color: var(--ink);
  background: var(--white);
  border: var(--line);
  border-radius: 0;
  box-shadow: 5px 5px 0 var(--ink);
  cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.btn-red { background: var(--red); color: var(--white); }
.btn-blue { background: var(--blue); color: var(--white); }
.btn-yellow { background: var(--yellow); }

/* ---------- Panels ---------- */
main {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* or wide content stretches every panel past the screen */
  gap: 3.5rem;
  max-width: 62rem;
  margin: 0 auto;
  padding: 4rem 1rem;
}
.panel {
  position: relative;
  padding: 3.25rem clamp(1rem, 4vw, 2.5rem) 2.25rem;
  background: var(--white);
  border: var(--line);
  box-shadow: 10px 10px 0 var(--ink);
}
.panel-red { background: var(--dots), var(--red); }
.panel-blue { background: var(--dots), #8fd0ff; }
.panel > * + * { margin-top: 1.25rem; }
/* section title = the yellow narration box of a comic page */
.caption {
  position: absolute;
  top: -1.5rem;
  left: clamp(.5rem, 3vw, 1.5rem);
  margin: 0;
  padding: .25rem 1rem;
  font: 400 clamp(1.7rem, 5vw, 2.4rem)/1.15 var(--display);
  letter-spacing: .04em;
  background: var(--yellow);
  border: var(--line);
  transform: rotate(-1.5deg);
}
.lead { max-width: 60ch; }
iframe.map { display: block; width: 100%; height: 320px; border: var(--line); }

/* RSVP pass */
.pass { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.5rem, 2vw, 1rem); max-width: 30rem; }
.pass label { text-align: center; }
.pass input {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: .25rem;
  padding: .2rem;
  font: 400 3rem/1 var(--display);
  text-align: center;
  color: var(--blue);
  background: var(--dots), var(--white);
  border: var(--line);
  border-radius: 0;
  pointer-events: none;
}
#asistencia .actions { justify-content: flex-start; }
.status { padding: .6rem 1rem; border: var(--line); max-width: max-content; }
.status-yes { background: #b9f5c4; }
.status-no { background: #ffd0d6; }

/* Itinerary: a real sequence, so a timeline */
.timeline { position: relative; display: grid; gap: 1.5rem; }
.timeline::before { content: ""; position: absolute; left: 1.75rem; top: 0; bottom: 0; border-left: 4px dashed var(--ink); }
.timeline li { position: relative; padding-left: 5rem; min-height: 3.75rem; }
.timeline-icon {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 3.75rem;
  aspect-ratio: 1;
  font-size: 1.8rem;
  background: var(--yellow);
  border: var(--line);
  border-radius: 50%;
}
.timeline time { font: 400 1.3rem var(--display); letter-spacing: .04em; color: var(--red); }
.timeline h3 { font: 400 1.8rem/1.1 var(--display); letter-spacing: .03em; }

/* Dress code: "heroes wanted" poster */
.mission { text-align: center; }
.mission-title {
  font: 400 clamp(2.4rem, 8vw, 4.5rem)/1 var(--display);
  letter-spacing: .03em;
  color: var(--yellow);
  -webkit-text-stroke: .05em var(--ink);
  paint-order: stroke fill;
  text-shadow: .06em .07em 0 var(--ink);
  transform: rotate(-2deg);
}
.mission-gear { display: flex; justify-content: center; gap: clamp(.4rem, 2vw, 1rem); }
.mission-gear li {
  display: grid;
  place-items: center;
  width: clamp(3.2rem, 14vw, 4.75rem);
  aspect-ratio: 1;
  font-size: clamp(1.7rem, 7vw, 2.6rem);
  background: var(--white);
  border: var(--line);
  border-radius: 50%;
  box-shadow: 4px 4px 0 var(--ink);
  animation: hop 1.6s ease-in-out infinite;
}
.mission-gear li:nth-child(2) { animation-delay: .15s; background: var(--yellow); }
.mission-gear li:nth-child(3) { animation-delay: .3s; }
.mission-gear li:nth-child(4) { animation-delay: .45s; background: var(--yellow); }
.mission-gear li:nth-child(5) { animation-delay: .6s; }
.mission-text {
  max-width: 46ch;
  margin-inline: auto;
  padding: 1rem 1.25rem;
  font-size: 1.25rem;
  background: var(--white);
  border: var(--line);
  box-shadow: 6px 6px 0 var(--ink);
  transform: rotate(.6deg);
}
.stamp {
  display: inline-block;
  padding: .2rem .9rem;
  font: 400 1.5rem var(--display);
  letter-spacing: .06em;
  color: var(--white);
  border: 4px dashed var(--white);
  transform: rotate(-5deg);
}
.place-time { font: 400 1.5rem var(--display); letter-spacing: .04em; color: var(--red); }

/* ---------- Life: stickers, reveals, idle motion, swinger, music, confetti ---------- */
.panel[data-sfx]::after {
  content: attr(data-sfx);
  position: absolute;
  top: -1.4rem;
  right: clamp(.25rem, 3vw, 1.5rem);
  padding: .1rem .7rem;
  font: 400 clamp(1.3rem, 4vw, 1.9rem) var(--display);
  letter-spacing: .05em;
  color: var(--white);
  background: var(--red);
  border: var(--line);
  border-radius: 50% / 45%;
  transform: rotate(7deg);
}
.panel:nth-of-type(even)[data-sfx]::after { background: var(--pink); color: var(--ink); }
.js .panel:not(.in) { opacity: 0; }
.panel.in { animation: panel-in .55s cubic-bezier(.2, 1.5, .4, 1) both; }
.panel.in[data-sfx]::after { animation: sticker .5s cubic-bezier(.2, 1.8, .4, 1) .35s both; }
.panel.in .caption { animation: caption-in .5s cubic-bezier(.2, 1.8, .4, 1) .2s both; }

.hero-panel img { animation: drift 14s ease-in-out infinite alternate; }
.burst { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1) .7s both, wobble 2.4s ease-in-out 1.2s infinite; }
.countdown [data-s] { animation: tick 1s ease-out infinite; }
.timeline-icon { animation: hop 2s ease-in-out infinite; }
.timeline li:nth-child(even) .timeline-icon { animation-delay: .5s; }
.btn-red, .btn-yellow { animation: nudge 3.5s ease-in-out infinite; }
.btn:hover { animation: none; }

/* fixed full-screen lane that clips the swinger: off-screen fixed elements widen the page on iOS */
.swinger { position: fixed; inset: 0; z-index: 5; overflow: hidden; pointer-events: none; }
.swinger-cross { width: 100%; animation: cross 20s linear 2.5s infinite both; }
.swinger-swing {
  position: relative;
  display: inline-block;
  padding-top: 24vh;
  font-size: clamp(3rem, 9vw, 5rem);
  line-height: 1;
  transform-origin: 50% 0;
  animation: swing 1.7s ease-in-out infinite alternate;
}
/* z-index -1: the thread runs behind the character, which covers its end */
.swinger-swing::before { content: ""; position: absolute; z-index: -1; top: 0; left: 50%; width: 3px; height: 32vh; max-height: calc(100% - .5rem); margin-left: -1px; background: var(--white); box-shadow: 0 0 0 1px var(--ink); }
.swinger img { width: clamp(5.5rem, 15vw, 10.5rem); }

.music-btn {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 6;
  width: 3.75rem;
  aspect-ratio: 1;
  font-size: 1.7rem;
  background: var(--yellow);
  border: var(--line);
  border-radius: 50%;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  animation: hop 1.4s ease-in-out infinite;
}
.music-btn[aria-pressed="true"] { background: var(--pink); animation: spin 3s linear infinite; }

.confetti { position: fixed; top: -1rem; z-index: 7; width: .7rem; height: 1rem; border: 2px solid var(--ink); pointer-events: none; animation: fall linear forwards; }

@keyframes panel-in { from { opacity: 0; transform: scale(.85) rotate(-3deg); } }
@keyframes sticker { from { opacity: 0; scale: 0; rotate: -40deg; } }
@keyframes caption-in { from { opacity: 0; translate: -3rem 0; } }
@keyframes drift { to { scale: 1.08; } }
@keyframes wobble { 50% { rotate: 10deg; scale: 1.08; } }
@keyframes tick { 0% { scale: 1.25; } 40%, 100% { scale: 1; } }
@keyframes hop { 0%, 60%, 100% { translate: 0 0; } 30% { translate: 0 -.5rem; } }
@keyframes nudge { 0%, 88%, 100% { rotate: 0deg; } 91% { rotate: -3deg; } 94% { rotate: 3deg; } 97% { rotate: -2deg; } }
@keyframes cross { 0% { transform: translateX(-45%); } 40%, 100% { transform: translateX(115%); } }
@keyframes swing { from { rotate: 32deg; } to { rotate: -32deg; } }
@keyframes spin { to { rotate: 360deg; } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* Growth carousel */
.carousel { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5rem; }
.carousel-track {
  display: flex;
  gap: 1.25rem;
  padding: .5rem .5rem 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.carousel-track li { flex: 0 0 min(78%, 20rem); scroll-snap-align: center; }
.carousel-track li:nth-child(odd) { transform: rotate(-1.5deg); }
.carousel-track li:nth-child(even) { transform: rotate(1.5deg); }
.carousel figure { background: var(--white); border: var(--line); box-shadow: 6px 6px 0 var(--ink); }
.carousel img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.carousel figcaption { padding: .4rem .75rem; border-top: var(--line); background: var(--yellow); }
.carousel-btn {
  width: 2.75rem;
  aspect-ratio: 1;
  font: 400 2rem/1 var(--display);
  color: var(--white);
  background: var(--red);
  border: var(--line);
  border-radius: 50%;
  cursor: pointer;
}

/* Songs */
.song-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 1rem; align-items: end; }
.song-form input, input[type="file"] {
  display: block;
  width: 100%;
  padding: .6rem .75rem;
  font: inherit;
  background: var(--white);
  border: var(--line);
  border-radius: 0;
}
input[type="file"] { width: auto; max-width: 100%; }
.songs { display: grid; gap: .5rem; }
.songs li { padding: .5rem .75rem; border-left: 8px solid var(--pink); background: #fff4f9; }
.songs small { float: right; font-weight: 400; }

/* Vault */
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .75rem; }
.album img { width: 100%; aspect-ratio: 1; object-fit: cover; border: var(--line); }

footer { padding: 2rem 1rem 3rem; text-align: center; color: var(--white); font: 400 1.5rem var(--display); letter-spacing: .04em; margin-top: 3rem; margin-bottom: 3rem;}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-panel { height: 62svh; clip-path: none; margin: 0; }
  .hero-title { position: static; padding: 1.5rem 1rem 1.75rem; background: var(--dots), var(--blue); border-block: 6px solid var(--ink); }
  .burst { width: 6rem; margin-bottom: 1rem; }
  .burst b { font-size: 2.8rem; }
  .song-form { grid-template-columns: 1fr; }
  .carousel-btn { display: none; }
  .carousel { grid-template-columns: 1fr; }
  .panel { box-shadow: 6px 6px 0 var(--ink); }
}

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

/* ---------- Cover: "secret file" shown before the invitation ---------- */
.cover { display: none; }
.sealed .cover, .cover.opening {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: clamp(1rem, 3svh, 2rem);
  padding: 1rem;
  overflow: hidden;
  /* web centred behind the logo */
  background:
    repeating-radial-gradient(circle at 50% 42%, transparent 0 56px, rgb(0 0 0 / .6) 56px 59px),
    repeating-conic-gradient(from 0deg at 50% 42%, rgb(0 0 0 / .6) 0 .5deg, transparent .5deg 15deg),
    radial-gradient(circle at 50% 42%, #ff4257, var(--red) 55%, #9c0a1b);
}
.cover-logo {
  height: min(46svh, 80vw);
  mix-blend-mode: multiply; /* a white background in the logo disappears on the red */
  animation: hang 3s ease-in-out infinite alternate;
}
.cover-for {
  padding: .15rem 1rem;
  font: 400 clamp(1.3rem, 5vw, 2rem) var(--display);
  letter-spacing: .04em;
  background: var(--white);
  border: var(--line);
  transform: rotate(-2deg);
}
.cover-btn {
  max-width: calc(100vw - 3.5rem);
  padding: 1rem 1.6rem;
  font: 400 clamp(1.7rem, 7vw, 3rem)/1.05 var(--display);
  letter-spacing: .04em;
  color: var(--ink);
  background: var(--yellow);
  border: 5px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink), 0 0 0 6px var(--white), 14px 14px 0 6px var(--ink);
  cursor: pointer;
  animation: float 1.6s ease-in-out infinite;
}
.cover-btn:hover { background: var(--white); }
.cover-btn:active { animation: none; transform: translate(6px, 6px); box-shadow: 2px 2px 0 var(--ink), 0 0 0 6px var(--white); }
/* after the tap: only the photo stays while the voice plays */
.cover-photo {
  display: none;
  max-width: min(86vw, 34rem);
  max-height: 60svh;
  /* soft yellow halftone: a red/blue character PNG stands out on it and on the red cover */
  background: var(--dots), radial-gradient(circle, #fff6c4, var(--yellow));
  border: 6px solid var(--ink);
  box-shadow: 10px 10px 0 var(--ink);
  animation: pop .45s cubic-bezier(.2, 1.6, .4, 1) both;
}
.cover.playing .cover-photo { display: block; }
.cover-wait {
  display: none;
  max-width: calc(100vw - 2rem);
  padding: .3rem 1rem;
  font: 400 clamp(1.3rem, 5.5vw, 2rem)/1.2 var(--display);
  letter-spacing: .04em;
  text-align: center;
  background: var(--white);
  border: var(--line);
  box-shadow: 5px 5px 0 var(--ink);
  transform: rotate(-1.5deg);
}
.cover.playing .cover-wait { display: block; }
.cover-wait b {
  display: inline-block;
  min-width: 1.4em;
  font-size: 1.5em;
  font-weight: 400;
  color: var(--red);
  font-variant-numeric: tabular-nums;
  animation: tick 1s ease-out infinite;
}
.cover.playing .cover-for, .cover.playing .cover-btn, .cover.playing:has(.cover-photo) .cover-logo { display: none; }
/* lifts like a curtain */
.cover.opening { pointer-events: none; animation: curtain 1s cubic-bezier(.7, 0, .3, 1) forwards; }
/* the hero entrance waits for the cover to open */
.sealed .hero-panel, .sealed h1, .sealed .burst, .sealed .swinger-cross { animation-play-state: paused; }

@keyframes float { 0%, 100% { transform: translateY(0) rotate(-2deg) scale(1); } 50% { transform: translateY(-14px) rotate(2deg) scale(1.06); } }
@keyframes hang { from { transform: translateY(-8px); } to { transform: translateY(8px); } }
@keyframes curtain { to { transform: translateY(-105%); } }
