/* The invite page (and its previews). Every color is a theme token. */
.invite-page { min-height: 100vh; background: radial-gradient(120% 70% at 50% 0%, var(--bg2) 0%, var(--bg) 60%) fixed, var(--bg); }
.inv { max-width: 560px; margin: 0 auto; padding: 0 16px 90px; position: relative; }
.inv .sections { position: relative; z-index: 1; }

/* hero */
.hero { position: relative; text-align: center; padding: 22px 0 6px; }
.hero-sky { position: relative; margin: 0 -16px; height: 168px; overflow: hidden; will-change: transform; }
.hero-art { width: 100%; height: 100%; display: block; }
/* The sky drifts down on scroll (parallax); keep the words painted above it. */
.hero > :not(.hero-sky) { position: relative; z-index: 1; }
.eyebrow { margin: 6px 0 4px; font-family: var(--font-display); font-weight: 600; letter-spacing: .04em; color: var(--gold); font-size: 1.02rem; }
.title { font-size: clamp(2.1rem, 9vw, 3.1rem); margin: 0 0 6px; color: var(--ink); text-shadow: 0 3px 0 rgba(0, 0, 0, .18); overflow-wrap: anywhere; }
.age-badge { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 92px; height: 92px; padding: 6px; margin: 4px auto 6px; border-radius: 50%;
  background: var(--gold); color: var(--btnInk); box-shadow: 0 6px 0 rgba(0, 0, 0, .18); transform: rotate(-6deg); }
.age-badge b { font-family: var(--font-display); font-size: 2.3rem; line-height: 1; }
.age-badge small { font-weight: 800; font-size: .56rem; text-transform: uppercase; letter-spacing: .03em; line-height: 1.1; text-align: center; max-width: 72px; }
.lede { margin: 6px auto 4px; max-width: 34ch; color: var(--ink); opacity: .92; font-weight: 600; }
.squad { display: flex; justify-content: center; align-items: flex-end; gap: 2px; margin: 10px auto 4px; min-height: 64px; flex-wrap: nowrap; }
.sq { background: none; border: 0; padding: 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; -webkit-tap-highlight-color: transparent; animation: sq-bob 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * -.6s); }
.sq em { font-style: normal; font-size: .7rem; font-weight: 800; color: var(--ink); opacity: .85; }
.sq.boop { animation: sq-boop .45s ease; }
@keyframes sq-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes sq-boop { 0% { transform: scale(1); } 35% { transform: scale(1.25, .78); } 70% { transform: scale(.92, 1.12); } 100% { transform: scale(1); } }

/* sections */
.facts { display: grid; gap: 12px; }
.fact { display: grid; grid-template-columns: 1fr; gap: 2px; }
.fact .k { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fact .v { font-weight: 800; font-size: 1.12rem; }
.fact .sub { color: var(--muted); font-weight: 600; font-size: .95rem; }
.fact .links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.facts-card .rsvp-cta { width: 100%; min-height: 60px; font-size: 1.25rem; margin-top: 16px; }
.calrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; font-size: .9rem; font-weight: 700; color: var(--muted); }
.coming { margin: 12px 0 0; font-weight: 800; color: var(--cardInk); display: flex; gap: 6px; align-items: center; }
.count { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cbox { background: color-mix(in srgb, var(--accent2) 22%, #fff); border-radius: 16px; padding: 10px 4px; text-align: center; }
.cbox b { display: block; font-family: var(--font-display); font-size: 1.7rem; line-height: 1.1; }
.cbox span { font-size: .75rem; font-weight: 800; text-transform: uppercase; color: var(--muted); }
.plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.plan li { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: start; }
.plan .pi { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 22%, #fff); color: var(--cardInk); }
.plan b { font-size: 1.05rem; }
.plan p { margin: 2px 0 0; color: var(--muted); font-size: .95rem; }
.pack { display: grid; gap: 2px; }
.who-line { margin: 0 0 12px; font-weight: 700; }

/* the RSVP send sequence: the button morphs, then a ticket prints */
.send-btn { position: relative; overflow: hidden; transition: width .3s ease, border-radius .3s ease, background .3s; }
.send-btn.sending .lbl { opacity: 0; }
.send-btn.sending::after { content: ""; position: absolute; width: 26px; height: 26px; border-radius: 50%; border: 4px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.send-btn.done { background: var(--accent3); }
.send-btn.done .lbl { opacity: 0; }
.send-btn.done::after { content: ""; position: absolute; width: 12px; height: 22px; border: solid currentColor; border-width: 0 5px 5px 0; transform: rotate(45deg) translate(-2px, -3px); animation: pop .3s ease; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(.2) rotate(45deg); } to { transform: scale(1) rotate(45deg) translate(-2px, -3px); } }
.sent { text-align: center; }
.ticket-slot { overflow: hidden; padding: 6px 0 14px; }
.ticket { display: flex; margin: 0 auto; max-width: 340px; border-radius: 16px; background: var(--gold); color: var(--btnInk); box-shadow: var(--shadow); text-align: left; animation: print .9s cubic-bezier(.2, .8, .2, 1) both;
  -webkit-mask: radial-gradient(circle 9px at 72% 0, transparent 98%, #000) top/100% 51% no-repeat, radial-gradient(circle 9px at 72% 100%, transparent 98%, #000) bottom/100% 51% no-repeat;
  mask: radial-gradient(circle 9px at 72% 0, transparent 98%, #000) top/100% 51% no-repeat, radial-gradient(circle 9px at 72% 100%, transparent 98%, #000) bottom/100% 51% no-repeat; }
.ticket .t-main { flex: 1; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; border-right: 2px dashed rgba(0, 0, 0, .25); min-width: 0; }
.ticket small { font-weight: 800; letter-spacing: .14em; font-size: .7rem; }
.ticket b { font-family: var(--font-display); font-size: 1.5rem; overflow-wrap: break-word; hyphens: manual; } /* break after a hyphen, not before it */
.ticket span { font-weight: 700; font-size: .85rem; }
.ticket .t-stub { width: 28%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; }
@keyframes print { from { transform: translateY(-110%); opacity: 0; } 60% { opacity: 1; } to { transform: translateY(0); } }
.sent h3 { font-size: 1.4rem; margin-top: 4px; }

/* sticky RSVP pill */
.rsvp-pill { position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 30; display: inline-flex; align-items: center; gap: 6px; min-height: 52px; padding: 0 20px; border-radius: 999px;
  background: var(--accent); color: var(--btnInk); font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; text-decoration: none; box-shadow: var(--shadow); animation: pill-in .3s ease; }
@keyframes pill-in { from { transform: translateY(30px); opacity: 0; } }

/* "Just for fun" */
.divider { display: flex; align-items: center; gap: 12px; margin: 28px 0 16px; color: var(--ink); font-family: var(--font-display); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: .9rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 2px; background: currentColor; opacity: .3; border-radius: 2px; }
.parade { display: flex; flex-wrap: wrap; gap: 6px 4px; justify-content: center; }
.parade .pal { display: flex; flex-direction: column; align-items: center; width: 64px; animation: sq-bob 3s ease-in-out infinite; animation-delay: calc(var(--i) * -.35s); }
.parade em { font-style: normal; font-weight: 800; font-size: .75rem; text-align: center; overflow-wrap: anywhere; }
.wall { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.wish-note { margin: 0; padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--gold) 45%, #fff); transform: rotate(-1deg); }
.wish-note:nth-child(even) { transform: rotate(1.2deg); background: color-mix(in srgb, var(--accent3) 40%, #fff); }
.wish-note blockquote { margin: 4px 0; font-weight: 700; overflow-wrap: anywhere; }
.wish-note figcaption { font-size: .85rem; color: var(--muted); font-weight: 800; }
.games-card .btn { width: 100%; }

/* locked / not ready */
.gate { text-align: center; }
.gate-sq { display: flex; justify-content: center; margin-bottom: 6px; }
.resend { text-align: left; margin-top: 14px; }
.resend-row { display: flex; gap: 8px; flex-wrap: wrap; }
.resend-row input { flex: 1 1 180px; min-height: 46px; border-radius: 14px; border: 2px solid var(--line); padding: 10px 12px; font-weight: 700; }
.preview-banner { position: sticky; top: 0; z-index: 40; margin: 0 -16px; padding: 10px 16px; background: var(--gold); color: var(--btnInk); font-weight: 800; text-align: center; display: flex; gap: 6px; justify-content: center; align-items: center; }
.foot { text-align: center; color: var(--ink); opacity: .75; font-size: .9rem; margin: 26px 0 0; }
.topbar { display: flex; justify-content: flex-end; padding: 10px 0 0; }
.topbar .chip { background: rgba(255, 255, 255, .14); color: var(--ink); }

/* scroll reveals (resting state without motion: visible) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } .sq, .parade .pal { animation: none; } }

/* ---- opening title sequence ---- */
body.op-on { overflow: hidden; }
.op-host { position: fixed; inset: 0; z-index: 200; background: radial-gradient(120% 80% at 50% 10%, var(--bg2), var(--bg)); color: var(--ink); overflow: hidden; transition: opacity .45s ease; }
.op-host.op-out { opacity: 0; }
.opening { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; }
.op-gate { gap: 18px; }
.op-ticket { display: flex; width: min(340px, 100%); border: 0; padding: 0; border-radius: 18px; background: var(--gold); color: var(--btnInk); text-align: left; cursor: pointer; box-shadow: var(--shadow); animation: sq-bob 2.6s ease-in-out infinite; }
.op-ticket .t-main { flex: 1; padding: 18px; display: flex; flex-direction: column; gap: 2px; border-right: 2px dashed rgba(0, 0, 0, .25); min-width: 0; }
.op-ticket small { font-weight: 800; letter-spacing: .14em; font-size: .72rem; }
.op-ticket b { font-family: var(--font-display); font-size: 1.7rem; overflow-wrap: break-word; }
.op-ticket b.long { font-size: clamp(1.15rem, 6vw, 1.5rem); } /* long names fit whole words at 320px */
.op-ticket .t-stub { width: 30%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px; font-weight: 800; }
.op-skip { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .16); color: var(--ink); font-weight: 800; cursor: pointer; }
.op-stage { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.op-art { width: 100%; max-width: 640px; height: 46vh; opacity: 0; transform: scale(1.08); transition: opacity 1.2s ease, transform 3s ease; }
.op-art svg { width: 100%; height: 100%; }
.op-line { position: absolute; top: 14%; left: 0; right: 0; text-align: center; font-family: var(--font-display); font-size: 1.5rem; opacity: 0; transform: translateY(10px); transition: opacity .6s ease, transform .6s ease; padding: 0 20px; }
.op-squad { display: flex; gap: 6px; margin-top: -40px; }
.op-pal { transform: translateX(-120vw); transition: transform 1.1s cubic-bezier(.2, .9, .3, 1.15); transition-delay: calc(3.4s + var(--i) * .18s); }
.op-run .op-art { opacity: 1; transform: none; }
.op-run .op-line { animation: op-line 1.25s ease forwards; animation-delay: calc(.9s + var(--i) * 1.2s); }
.op-run .op-pal { transform: none; }
@keyframes op-line { 0% { opacity: 0; transform: translateY(10px); } 20%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }
.op-card { position: relative; z-index: 2; text-align: center; max-width: 420px; padding: 24px 20px; border-radius: 26px; background: rgba(0, 0, 0, .28); backdrop-filter: blur(6px); opacity: 0; transform: scale(.9); pointer-events: none; transition: opacity .6s ease, transform .6s cubic-bezier(.2, .9, .3, 1.2); }
.op-card h2 { font-size: clamp(1.9rem, 8vw, 2.6rem); }
.op-eyebrow { color: var(--gold); font-weight: 800; margin: 0 0 4px; }
.op-turn, .op-when { font-weight: 800; margin: 4px 0; }
.op-final .op-card { opacity: 1; transform: none; pointer-events: auto; }
.op-final .op-stage { opacity: .35; transition: opacity .6s; }
.op-final .op-art, .op-final .op-pal { opacity: 1; transform: none; transition: none; }

/* First screen: keep the facts and the RSVP button above the fold on a phone. */
.hero-sky { height: 132px; }
.hero .age-badge { position: absolute; top: 84px; right: -4px; width: 78px; height: 78px; margin: 0; z-index: 2; }
.hero .age-badge b { font-size: 1.9rem; }
.hero .lede { margin-top: 2px; }
.squad { margin-top: 6px; min-height: 56px; }
.squad .critter { width: 50px; height: 50px; }
.facts-card { padding-top: 16px; }
.facts-card .facts { gap: 8px; }
.facts-card .fact .links .chip { min-height: 44px; padding: 6px 12px; font-size: .85rem; }
.facts-card .rsvp-cta { margin-top: 12px; }

/* thank-you card (add-on) */
.thanks-card { text-align: center; padding: 26px 20px; }
.thanks-art { display: flex; justify-content: center; gap: 4px; }
.thanks-to { font-size: 2.2rem; margin: 0; }
.thanks-gift { font-family: var(--font-display); font-size: 1.3rem; margin: 12px 0 4px; }
.thanks-msg { font-size: 1.05rem; white-space: pre-wrap; margin: 8px auto; max-width: 32ch; }
.thanks-from { font-weight: 800; color: var(--muted); margin-top: 14px; }

/* the fine print + serving note */
.fine-print { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.fine-print li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--accent3) 30%, var(--card)); color: var(--cardInk); min-height: 36px; font-weight: 700; font-size: .9rem; }
.fine-print li.fp-gifts { border-radius: 14px; }
.serving { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; padding: 10px 12px; border-radius: 14px; background: var(--warn-bg); color: var(--warn-ink); font-size: .92rem; }
.host-cta { margin: 14px 0 0; font-size: .92rem; color: var(--muted); text-align: center; }
.host-cta a { color: inherit; font-weight: 800; }
/* Why the link is personal, and who sees what (guest-facing trust, next to Send). */
.rsvp-privacy { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; line-height: 1.4; margin: 4px 0 12px; }
.rsvp-privacy .ic { flex: none; width: 16px; height: 16px; margin-top: 2px; }

/* Party Memories: the photo question on the RSVP and the photo on a thank-you card. */
.photo-q .photo-q-ask { margin: 0 0 10px; color: var(--muted); font-size: .95rem; text-wrap: pretty; }
.photo-q .photo-q-note { display: flex; gap: 6px; align-items: flex-start; margin: 8px 0 0; }
.photo-q .photo-q-note .ic { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.thanks-photo { margin: 14px auto 6px; max-width: 360px; padding: 10px 10px 14px; background: #fff; border-radius: 6px; box-shadow: 0 10px 28px rgb(0 0 0 / .18), 0 2px 6px rgb(0 0 0 / .1); rotate: -2deg; }
.thanks-photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2px; background: #eee; }
.thanks-more { margin: 16px 0 0; text-align: center; }
@media (prefers-reduced-motion: no-preference) {
  .thanks-photo { animation: thanks-photo-in .7s var(--ds-spring, cubic-bezier(.2, .8, .2, 1)) .25s both; }
  @keyframes thanks-photo-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
}
