/* Layout: fiesta banderitas across the top, toy-block date with a parol, chunky ink-outlined RSVP card, colorful lists below.
   Motion: everything lives in the "motion" block at the end and switches off with prefers-reduced-motion. */
:root {
  --bg: #fff5fa;
  --surface: #ffffff;
  --ink: #24123a;
  --muted: #6c5a80;
  --line: #f0dcea;
  --on-color: #24123a;
  --pink: #ff4f9a;
  --sun: #ffc531;
  --teal: #13b5a4;
  --sky: #3d8bff;
  --orange: #ff7a2e;
  --violet: #8d5cf6;
  --font-display: "Sniglet", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a0f2b; --surface: #261839; --ink: #fbf1ff; --muted: #bba9cc; --line: #3b2a54;
    --pink: #ff6aab; --sun: #ffcf4d; --teal: #2fd0bf; --sky: #6aa6ff; --orange: #ff9150; --violet: #a785ff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow-x: hidden;
}
h1, h2 { font-family: var(--font-display); font-weight: 800; text-wrap: balance; margin: 0; line-height: 1.05; }
p { margin: 0; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

/* banderitas */
.banderitas {
  position: relative; z-index: 2; height: 3.4rem; overflow: hidden;
  padding-top: env(safe-area-inset-top, 0px);
  box-sizing: content-box;
}
.banderitas svg { display: block; width: 100%; height: 3.4rem; }

.wrap {
  position: relative; z-index: 1;
  max-width: 40rem; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: .5rem 4rem;
  display: flex; flex-direction: column; gap: 3rem;
}
.top { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.hostpill {
  font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  background: var(--violet); color: #fff; border-radius: 999px; padding: .25rem .7rem;
}
.lang { margin-left: auto; display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; padding: 3px; gap: 2px; background: var(--surface); }
.lang button {
  border: 0; background: transparent; padding: .3rem .85rem; border-radius: 999px; cursor: pointer;
  font-weight: 800; font-size: .8rem; letter-spacing: .08em;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* hero */
.hero { display: flex; flex-direction: column; gap: 1.2rem; }
h1 { font-size: clamp(2.5rem, 10vw, 4rem); letter-spacing: -.01em; }
h1 .name { color: var(--pink); }
.blocks { display: flex; gap: .55rem; flex-wrap: nowrap; align-items: flex-end; }
.block {
  width: clamp(3rem, 14vw, 4.8rem); aspect-ratio: 1; flex: none; max-width: 100%;
  border-radius: 16px; border: 2.5px solid var(--ink);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: clamp(1.8rem, 8vw, 2.8rem);
  color: var(--on-color);
  box-shadow: 4px 4px 0 var(--ink);
  transition: rotate .3s cubic-bezier(.3, 1.6, .5, 1);
}
.block.num {
  width: clamp(4rem, 19vw, 6.2rem);
  font-family: var(--font-body); font-size: clamp(2.6rem, 12vw, 3.9rem);
  background: var(--pink); color: #fff; margin-right: .5rem; rotate: -5deg;
}
.block.m1 { background: var(--sun); rotate: 4deg; }
.block.m2 { background: var(--teal); rotate: -3deg; }
.block.m3 { background: var(--sky); rotate: 5deg; }
.block { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.parol { align-self: flex-start; flex: none; width: clamp(3.4rem, 15vw, 5.4rem); height: auto; margin-top: -1.2rem; margin-left: .3rem; transform-origin: 50% 0; }
.when { font-size: 1.25rem; font-weight: 700; }
.where { font-size: 1.1rem; font-weight: 600; color: var(--muted); }
.where a { color: inherit; text-underline-offset: 3px; }
.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.pill {
  font-family: var(--font-display); font-size: 1rem; font-variant-numeric: tabular-nums;
  background: var(--sun); color: var(--on-color); border: 2px solid var(--ink); border-radius: 999px; padding: .3rem .9rem;
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: .4rem; text-decoration: none;
  border: 2px solid var(--ink); background: var(--surface); color: var(--ink); border-radius: 999px;
  padding: .45rem 1rem; font-weight: 700; cursor: pointer; box-shadow: 3px 3px 0 var(--ink);
  transition: transform .1s, box-shadow .1s;
}
.btn:active, .primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.primary {
  border: 2.5px solid var(--ink); background: var(--pink); color: #fff; border-radius: 999px;
  padding: .85rem 1.6rem; font-weight: 800; font-size: 1.05rem; cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink); transition: transform .1s, box-shadow .1s;
}
.primary:disabled { opacity: .6; cursor: default; }
.link { border: 0; background: none; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 700; }

input[type="text"], input[type="url"] {
  width: 100%; min-width: 0; border: 2px solid var(--ink); background: var(--surface); border-radius: 14px;
  padding: .75rem .95rem; font-size: 1rem;
}
input::placeholder { color: var(--muted); }
.lbl { font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* rsvp card */
.card {
  background: var(--surface); border: 2.5px solid var(--ink); border-radius: 24px;
  box-shadow: 7px 7px 0 var(--teal);
  padding: 0 1.5rem 1.5rem; overflow: hidden;
  display: flex; flex-direction: column; gap: 1.25rem;
}
.banig {
  height: 16px; margin: 0 -1.5rem; border-bottom: 2.5px solid var(--ink);
  background: repeating-conic-gradient(from 45deg, var(--sun) 0 25%, var(--pink) 0 50%) 0 0 / 16px 16px;
}
.card h2 { font-size: 2rem; }
.stack { display: flex; flex-direction: column; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  border: 2px solid var(--ink); border-radius: 16px; padding: .85rem .6rem; text-align: center;
  font-weight: 800; cursor: pointer; background: var(--bg);
}
#goingYes:checked + label { background: var(--teal); color: var(--on-color); box-shadow: 3px 3px 0 var(--ink); }
#goingNo:checked + label { background: var(--line); box-shadow: 3px 3px 0 var(--ink); }
.choice input:focus-visible + label { outline: 3px solid var(--sky); outline-offset: 2px; }
.stepper { display: flex; align-items: center; gap: 1rem; }
.stepper button {
  width: 2.8rem; height: 2.8rem; border-radius: 50%; border: 2px solid var(--ink);
  background: var(--sun); color: var(--on-color); font-size: 1.4rem; font-weight: 800; cursor: pointer; line-height: 1;
  box-shadow: 2px 2px 0 var(--ink);
}
.stepper button:disabled { background: var(--bg); color: var(--muted); box-shadow: none; cursor: default; }
.stepper output { font-family: var(--font-display); font-weight: 800; font-size: 2rem; min-width: 1.5ch; text-align: center; font-variant-numeric: tabular-nums; }
.done strong { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; line-height: 1.2; }
.links { gap: 1.2rem; }

/* sections */
.section { display: flex; flex-direction: column; gap: 1rem; }
.section h2 { font-size: 2rem; display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.gifts h2 { color: var(--orange); }
.gifts p { font-size: 1.1rem; font-weight: 500; max-width: 34rem; }
.who h2 { color: var(--violet); }
.subhead { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; line-height: 1.1; color: var(--muted); }
.empty { color: var(--muted); font-weight: 600; }

.hostbox {
  border: 2px dashed var(--violet); border-radius: 16px; padding: 1rem;
  display: flex; flex-direction: column; gap: .7rem;
}
.host-form { display: grid; grid-template-columns: 1fr; gap: .6rem; }
@media (min-width: 560px) { .host-form.one { grid-template-columns: 1fr auto; } }

.total { font-family: var(--font-display); font-weight: 400; font-size: 1.1rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .55rem; }
.chips li {
  border: 2px solid var(--ink); border-radius: 999px; padding: .35rem .95rem;
  font-weight: 700; overflow-wrap: anywhere; color: var(--on-color);
}
.chips li:nth-child(6n+1) { background: var(--pink); color: #fff; }
.chips li:nth-child(6n+2) { background: var(--sun); }
.chips li:nth-child(6n+3) { background: var(--teal); }
.chips li:nth-child(6n+4) { background: var(--sky); color: #fff; }
.chips li:nth-child(6n+5) { background: var(--orange); }
.chips li:nth-child(6n+6) { background: var(--violet); color: #fff; }
.chips li span { opacity: .75; margin-left: .3rem; font-variant-numeric: tabular-nums; }
.chips.quiet li { background: var(--surface) !important; color: var(--muted) !important; border-color: var(--line); }

.toast {
  position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(1rem); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: .65rem 1.2rem; border-radius: 999px; font-weight: 700;
  transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); z-index: 20;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 15; }


/* floating fiesta shapes behind the page */
.floaties { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.floaties span { position: absolute; bottom: -3rem; display: block; opacity: .24; }
.floaties .c { border-radius: 50%; }
.floaties .t { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.floaties .s { clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }

/* motion */
@media (prefers-reduced-motion: no-preference) {
  .banderitas svg { animation: drop .9s cubic-bezier(.2, 1.4, .4, 1) both; }
  .banderitas polygon { transform-box: fill-box; transform-origin: 50% 0; animation: flutter 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -.21s); }
  h1 { animation: pop .7s .1s cubic-bezier(.2, 1.5, .4, 1) both; }
  .block { animation: blockIn .65s calc(.35s + var(--i) * .09s) cubic-bezier(.2, 1.7, .4, 1) both, bob 3.2s calc(1.2s + var(--i) * .35s) ease-in-out infinite; }
  .block.boing { animation: boing .55s cubic-bezier(.2, 1.8, .4, 1), bob 3.2s .55s ease-in-out infinite; }
  .blocks:hover .block { rotate: 0deg; }
  .parol { animation: parolIn .8s .75s cubic-bezier(.2, 1.5, .4, 1) both, sway 4.5s 1.6s ease-in-out infinite; }
  .parol .core { transform-box: fill-box; transform-origin: center; animation: twinkle 1.4s ease-in-out infinite; }
  .parol .spin { transform-origin: 50px 45px; animation: spin 14s linear infinite; }
  .when, .where, .hero .row { animation: rise .6s cubic-bezier(.2, 1.2, .4, 1) both; }
  .when { animation-delay: .7s; } .where { animation-delay: .8s; } .hero .row { animation-delay: .9s; }
  .card { animation: rise .7s 1s cubic-bezier(.2, 1.2, .4, 1) both; }
  .banig { animation: weave 2.5s linear infinite; }
  .pill { animation: wiggle 4s 2s ease-in-out infinite; }
  .primary { animation: breathe 2.6s ease-in-out infinite; }
  .primary:hover { animation-play-state: paused; scale: 1.04; }
  .choice input:checked + label { animation: boing .45s cubic-bezier(.2, 1.8, .4, 1); }
  .chips li.new { animation: chipIn .5s calc(var(--i, 0) * .06s) cubic-bezier(.2, 1.8, .4, 1) both; }
  .done strong { animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
  .floaties span { animation: floatUp var(--d) linear var(--delay) infinite; }
  .btn, .primary, .toast { transition: transform .1s, box-shadow .1s, scale .15s; }
}
@keyframes drop { from { transform: translateY(-100%); } }
@keyframes flutter { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@keyframes pop { from { opacity: 0; scale: .6; rotate: -4deg; } }
@keyframes blockIn { from { opacity: 0; scale: .2; translate: 0 -60px; } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@keyframes boing { 0% { scale: 1; } 35% { scale: 1.28; } 65% { scale: .9; } 100% { scale: 1; } }
@keyframes parolIn { from { opacity: 0; translate: 0 -80px; } }
@keyframes sway { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes twinkle { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.5); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; translate: 0 24px; } }
@keyframes weave { to { background-position: 32px 0; } }
@keyframes wiggle { 0%, 86%, 100% { rotate: 0deg; } 89% { rotate: -6deg; } 93% { rotate: 6deg; } 96% { rotate: -3deg; } }
@keyframes breathe { 0%, 100% { scale: 1; } 50% { scale: 1.035; } }
@keyframes chipIn { from { opacity: 0; scale: .3; } }
@keyframes floatUp {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(var(--sway), -55vh) rotate(180deg); }
  100% { transform: translate(0, -115vh) rotate(360deg); }
}
