@font-face { font-family: 'Inter Tight'; src: url(/fonts/InterTight-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter Tight'; src: url(/fonts/InterTight-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Inter Tight'; src: url(/fonts/InterTight-800.woff2) format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url(/fonts/DMSans-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url(/fonts/DMSans-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url(/fonts/DMSans-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }
/* Jost and Playfair below are only for the invitation picture itself */
@font-face { font-family: Jost; src: url(/fonts/Jost.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Playfair Display'; src: url(/fonts/Playfair-Italic.woff2) format('woff2'); font-style: italic; font-weight: 400 600; font-display: swap; }

:root {
  --paper: #FFFFFF; --card: #FFFFFF; --ink: #1D1D1D; --soft: #5B564E; --line: #E3DCCD;
  --gold: #0D1A2D; --gold-deep: #24406B; --green: #1F4634; --box: #F1ECDD; --wa: #1FA855; --err: #A12A1E;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.55 'DM Sans', 'Helvetica Neue', Arial, sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 20px 56px; }
a { color: var(--gold-deep); }
[hidden] { display: none !important; }
h1, h2 { font-family: 'Inter Tight', 'Helvetica Neue', Arial, sans-serif; font-weight: 800; letter-spacing: -0.022em; line-height: 1.05; margin: 0 0 14px; text-wrap: balance; }
h1 { font-size: clamp(2rem, 6vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 4.4vw, 2.2rem); }
.kicker { margin: 0 0 12px; font-family: 'Inter Tight', sans-serif; font-size: .78rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-deep); }
.lede { color: var(--soft); max-width: 34em; margin: 0 0 28px; font-size: 1.08rem; }
.hint { color: var(--soft); font-size: .92rem; margin: 8px 0 0; }
.error { color: var(--err); font-weight: 500; margin: 10px 0 0; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; max-width: 1280px; margin: 0 auto; padding: 18px 20px; }
.top__logo img { display: block; height: 38px; width: auto; max-width: 56vw; object-fit: contain; object-position: left; }
.top__switch { white-space: nowrap; }
.top__switch, .back { background: none; border: 0; padding: 10px 0; font: inherit; font-size: .95rem; color: var(--gold-deep); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.back { padding: 0 0 18px; }
.back::before { content: '← '; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 24px; border: 2px solid var(--gold); border-radius: 6px; background: var(--gold); color: #fff; font: 700 .92rem/1 'Inter Tight', sans-serif; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; text-align: center; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { background: var(--gold-deep); border-color: var(--gold-deep); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn--wide { width: 100%; }
.btn--wa { background: var(--wa); border-color: var(--wa); }
.btn--wa:hover { background: #178A45; border-color: #178A45; }
.btn--dark { background: var(--ink); border-color: var(--ink); }
.btn--dark:hover { background: #000; border-color: #000; }
.btn--line { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--line:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* step 1 */
.start { max-width: 720px; padding-top: clamp(24px, 7vw, 72px); }
.order { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; max-width: 560px; }
label, .label { display: block; font-family: 'Inter Tight', sans-serif; font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 8px; }
input, select { width: 100%; min-height: 52px; padding: 0 14px; border: 1.5px solid #BDB5A4; border-radius: 6px; background: #fff; color: var(--ink); font: 500 1.05rem 'DM Sans', sans-serif; }
input::placeholder { color: #9A9388; font-weight: 400; }
input:focus, select:focus { border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: 0; }
.order__row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.order__num { flex: 1 1 130px; }
.order__email { flex: 3 1 240px; }
.order__num input { font-size: 1.15rem; letter-spacing: .04em; }
.how { list-style: none; counter-reset: s; padding: 0; margin: 40px 0 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); color: var(--soft); font-size: .98rem; }
.how li { counter-increment: s; border-top: 2px solid var(--gold); padding-top: 12px; }
.how li::before { content: counter(s); display: block; font: 800 1.7rem 'Inter Tight', sans-serif; color: var(--gold); line-height: 1; margin-bottom: 6px; }
.how b { color: var(--ink); font-family: 'Inter Tight', sans-serif; font-weight: 700; display: block; }

/* step 2 */
.pick { padding-top: 28px; }
.pick__grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); align-items: start; margin-top: 22px; }
.pick__card { background: none; border: 0; padding: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.pick__card canvas { display: block; width: 100%; height: auto; border-radius: 8px; box-shadow: 0 1px 2px rgba(40, 30, 10, .12), 0 10px 28px rgba(40, 30, 10, .12); transition: transform .18s; }
.pick__card:hover canvas, .pick__card:focus-visible canvas { transform: translateY(-4px); }
.pick__card span { display: block; margin-top: 12px; font-family: 'Inter Tight', sans-serif; font-weight: 700; }
.pick__card small { color: var(--gold-deep); font-family: 'Inter Tight', sans-serif; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }

/* step 3 */
.edit { display: grid; gap: 28px; padding-top: 20px; }
.edit__preview { order: -1; }
.edit__preview canvas { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; border-radius: 10px; box-shadow: 0 1px 2px rgba(40, 30, 10, .12), 0 16px 44px rgba(40, 30, 10, .16); }
#fields { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; margin: 22px 0 26px; }
#fields .f { min-width: 0; }
#fields .f--wide { grid-column: 1 / -1; }
#fields .costume { grid-column: 1 / -1; margin: -6px 0 0; padding: 12px 14px; background: var(--box); border-radius: 8px; font-size: .95rem; color: var(--soft); }
.send { border-top: 1px solid var(--line); padding-top: 24px; }
.send__ready { display: grid; gap: 12px; margin-top: 4px; }
.send__note { margin: -4px 0 4px; padding: 10px 12px; background: var(--box); border-radius: 6px; color: var(--ink); }
.send__ok { margin: 0 0 2px; font: 800 1.4rem 'Inter Tight', sans-serif; letter-spacing: -0.02em; color: var(--ink); }
.send__link { display: flex; gap: 10px; }
.send__link input { flex: 1; min-width: 0; font-size: .95rem; }
.send__link .btn { flex: none; padding: 0 16px; }
@media (min-width: 860px) {
  .edit { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 56px; align-items: start; }
  .edit__preview { order: 0; position: sticky; top: 24px; }
  .edit__preview canvas { width: auto; max-width: 100%; max-height: calc(100vh - 48px); }
}
@media (max-width: 420px) { #fields { grid-template-columns: 1fr; } .send__link { flex-direction: column; } .send__link .btn { min-height: 46px; } }

.foot { border-top: 1px solid var(--line); padding: 22px 20px 30px; text-align: center; color: var(--soft); font-size: .92rem; }
.foot p { margin: 2px 0; }

/* the page a guest opens */
.view { background: #FFFFFF; }
.view--dark { background: #0C0B09; color: #F3EBDD; }
.view__main { max-width: 560px; padding: 20px 16px 40px; display: flex; flex-direction: column; align-items: center; }
.view__card { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 0 2px 4px rgba(0, 0, 0, .14), 0 22px 60px rgba(0, 0, 0, .22); }
.view__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 24px 0 0; width: 100%; }
.view__actions .btn { flex: 1 1 200px; }
.view--dark .btn--line { color: #F3EBDD; border-color: #F3EBDD; }
.view--dark .btn--line:hover { background: #F3EBDD; color: #0C0B09; }
.view__foot { margin: 28px 0 0; font-size: .9rem; opacity: .8; text-align: center; }
.view--dark .view__foot a { color: #E2C27C; }


/* murder kits: pick the guest's character from the suspects' portraits */
.cast { grid-column: 1 / -1; }
.cast__grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.cast__tile { display: block; padding: 0; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.cast__pic { display: block; position: relative; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: #17140F; box-shadow: 0 1px 2px rgba(20, 16, 8, .14), 0 8px 20px rgba(20, 16, 8, .12); transition: transform .2s ease, box-shadow .2s ease; }
.cast__pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cast__tile:hover .cast__pic { transform: translateY(-3px); }
.cast__tile[aria-checked="true"] .cast__pic { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--gold); }
.cast__tile[aria-checked="true"] .cast__pic::after { content: ''; position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; background: #E2C27C; clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); }
.cast__tile--all .cast__pic { display: grid; place-items: center; }
.cast__star { width: 38%; aspect-ratio: 1; background: #E2C27C; clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); }
.cast__name { display: block; margin-top: 9px; font: 700 .95rem/1.2 'Inter Tight', sans-serif; }
.cast__role { display: block; margin-top: 2px; font-size: .82rem; line-height: 1.3; color: var(--soft); }
.cast .costume { margin: 26px 0 0; }
/* in this layout the invite sits underneath, once a suspect is chosen */
.edit--cast { grid-template-columns: minmax(0, 1fr) !important; max-width: 860px; margin: 0 auto; }
.edit--cast .edit__preview { order: 0; position: static; }
.edit--cast .edit__preview canvas { width: 100%; max-width: 560px; max-height: none; margin: 0 auto; }
.edit--cast .send { max-width: 560px; width: 100%; margin: 0 auto; }
.edit--cast .edit__preview:not([hidden]) { animation: arrive .5s cubic-bezier(.2, .7, .2, 1) both; }

/* ---- brand motion -------------------------------------------------------------- */
.top, main, .foot { position: relative; z-index: 1; }
.sparkles { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.spark, .top__star, .confetti--star { clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); }
.spark { position: absolute; width: var(--size); height: var(--size); background: #C9A54E; opacity: 0; animation: twinkle var(--dur) ease-in-out var(--delay) infinite; }
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: translateY(0) scale(.2) rotate(0deg); }
  50% { opacity: .75; transform: translateY(var(--drift)) scale(1) rotate(45deg); }
}

/* the star above the l in the logo catches the light now and then */
.top__logo { position: relative; display: inline-block; }
.top__star { position: absolute; left: 70.8%; top: 26%; width: 7%; aspect-ratio: 1; margin: -3.5% 0 0 -3.5%; background: #E2C27C; opacity: 0; animation: glint 5.5s ease-in-out 1.2s infinite; }
@keyframes glint {
  0%, 78%, 100% { opacity: 0; transform: scale(.6) rotate(0deg); }
  86% { opacity: .95; transform: scale(2.1) rotate(45deg); }
  94% { opacity: 0; transform: scale(1) rotate(90deg); }
}

/* each step arrives rather than appearing */
main > section { animation: arrive .5s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(14px); } }
.word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; }
.word > span { display: inline-block; animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { transform: translateY(105%); } }

/* buttons: a light sweep on hover */
.btn { position: relative; overflow: hidden; }
.btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .28) 50%, transparent 65%); transform: translateX(-120%); pointer-events: none; }
.btn:hover::after { transform: translateX(120%); transition: transform .7s ease; }

/* start page: a hand of invitations */
.start--home { max-width: none; display: grid; gap: 8px 48px; }
.fan { position: relative; height: 470px; margin: 28px auto 0; width: min(100%, 460px); transform: translate(calc(var(--px, 0) * -14px), calc(var(--py, 0) * -10px)); transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.fan__card { position: absolute; left: 50%; top: 8%; width: 58%; margin-left: -29%; opacity: 0; transform: translateY(70px) rotate(0deg) scale(.9); transition: transform .9s cubic-bezier(.2, .9, .25, 1.15), opacity .5s ease; }
.fan__card canvas { display: block; width: 100%; height: auto; border-radius: 7px; box-shadow: 0 1px 2px rgba(20, 16, 8, .16), 0 18px 40px rgba(20, 16, 8, .22); animation: bob 6s ease-in-out infinite; }
.fan__card--2 canvas { animation-duration: 7.2s; animation-delay: -2s; }
.fan__card--3 canvas { animation-duration: 6.6s; animation-delay: -4s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.fan.is-dealt .fan__card { opacity: 1; }
.fan.is-dealt .fan__card--1 { transform: translate(-30%, 6%) rotate(-9deg); transition-delay: .15s; }
.fan.is-dealt .fan__card--2 { transform: translate(30%, 9%) rotate(9deg); transition-delay: .3s; }
.fan.is-dealt .fan__card--3 { transform: translate(0, -4%) rotate(1.5deg); transition-delay: .45s; z-index: 2; }
@media (min-width: 940px) {
  .start--home { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: center; }
  .fan { height: clamp(620px, 62vw, 800px); width: 100%; margin: 0; }
  .fan__card { top: 7%; width: 56%; margin-left: -28%; }
  .fan.is-dealt .fan__card--1 { transform: translate(-38%, 6%) rotate(-10deg); }
  .fan.is-dealt .fan__card--2 { transform: translate(38%, 9%) rotate(10deg); }
}

/* choosing a design: the cards are dealt in */
.cast__tile { animation: deal .5s cubic-bezier(.2, .9, .25, 1.1) both; }
.cast__tile:nth-child(2) { animation-delay: .04s; } .cast__tile:nth-child(3) { animation-delay: .08s; } .cast__tile:nth-child(4) { animation-delay: .12s; }
.cast__tile:nth-child(5) { animation-delay: .16s; } .cast__tile:nth-child(6) { animation-delay: .2s; } .cast__tile:nth-child(7) { animation-delay: .24s; } .cast__tile:nth-child(n+8) { animation-delay: .28s; }
.pick__card { animation: deal .6s cubic-bezier(.2, .9, .25, 1.1) both; }
.pick__card:nth-child(2) { animation-delay: .08s; } .pick__card:nth-child(3) { animation-delay: .16s; }
.pick__card:nth-child(4) { animation-delay: .24s; } .pick__card:nth-child(n+5) { animation-delay: .32s; }
@keyframes deal { from { opacity: 0; transform: translateY(40px) rotate(-4deg); } }

/* the preview is a card in your hand, and it shines when the invite is ready */
.edit__preview { position: relative; }
.edit__preview canvas { transition: transform .25s ease-out; will-change: transform; }
.edit__preview::after { content: ''; position: absolute; inset: 0; border-radius: 10px; pointer-events: none; opacity: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 236, 190, .55) 48%, rgba(255, 255, 255, .7) 52%, transparent 70%); background-size: 260% 100%; background-position: 130% 0; }
.edit__preview.is-shining::after { animation: shine 1.1s ease-out; }
@keyframes shine { 0% { opacity: 1; background-position: 130% 0; } 100% { opacity: 0; background-position: -60% 0; } }
.send__ready > * { animation: arrive .45s cubic-bezier(.2, .7, .2, 1) both; }
.send__ready > :nth-child(2) { animation-delay: .06s; } .send__ready > :nth-child(3) { animation-delay: .12s; }
.send__ready > :nth-child(4) { animation-delay: .18s; } .send__ready > :nth-child(n+5) { animation-delay: .24s; }
.confetti { position: fixed; z-index: 50; pointer-events: none; border-radius: 1px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .spark, .top__star { display: none; }
  .fan__card { opacity: 1; }
}
