@font-face { font-family: "Guton"; src: url(fonts/Guton-SemiBold.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Guton"; src: url(fonts/Guton-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ink: #0d0605;
  --ink-2: #1a0d09;
  --night: #090b24;
  --cobalt: #1a19cf;
  --orange: #ff6d00;
  --amber: #ffb25c;
  --red: #d8261c;
  --paper: #f4ead8;
  --paper-2: #e8d9bd;
  --cream: #fff8ec;
  --text: #f6efe4;
  --text-2: rgba(246, 239, 228, .68);
  --ice: #d9f7ff;
  --flow-bg: #060606;
  --flow-card: #1b1f29;
  --serif: "Fraunces", Georgia, serif;
  --hand: "Caveat", "Comic Sans MS", cursive;
  --sans: "Geist", system-ui, -apple-system, sans-serif;
  --flow: "Guton", "Geist", sans-serif;
  --beat: .49s;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ink); color: var(--text);
  font-family: var(--sans); font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
.hidden { display: none !important; }
.hand { font-family: var(--hand); }
.no { font-family: var(--serif); font-style: normal; letter-spacing: 0; }
.no i { font-style: normal; font-size: .52em; vertical-align: .62em; text-decoration: underline; text-decoration-thickness: .07em; text-underline-offset: .12em; margin: 0 .04em 0 .02em; }

/* grain and flash */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .11; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1s steps(4) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); } }
.flash { position: fixed; inset: 0; z-index: 95; pointer-events: none; background: #fffaf0; opacity: 0; }

/* buttons */
.btn {
  appearance: none; border: 0; cursor: pointer; border-radius: 999px;
  padding: 15px 26px; font-weight: 500; font-size: 16px; letter-spacing: .01em;
  transition: transform .2s cubic-bezier(.2, .9, .3, 1.4), background .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.96); }
.btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.btn-ice { background: #e6e8ec; color: #0a0a0a; font-family: var(--flow); font-weight: 600; border-radius: 12px; }
.btn-ice:hover { background: #fff; }
.btn-ghost { background: transparent; color: rgba(245, 245, 245, .7); font-family: var(--flow); font-weight: 600; }
.btn-ghost:hover { color: #fff; }
.btn-warm { background: var(--orange); color: #1a0700; box-shadow: 0 10px 40px -10px rgba(255, 109, 0, .7); }
.btn-warm:hover { background: #ff7f1f; box-shadow: 0 14px 50px -10px rgba(255, 109, 0, .9); }
.btn-ghost-warm { background: rgba(255, 178, 92, .08); color: var(--amber); box-shadow: inset 0 0 0 1px rgba(255, 178, 92, .45); }
.btn-ghost-warm:hover { background: rgba(255, 178, 92, .16); }
.btn-ghost-dark { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(13, 6, 5, .25); }
.btn-ghost-dark:hover { box-shadow: inset 0 0 0 1px rgba(13, 6, 5, .6); }
.btn-sm { padding: 10px 18px; font-size: 14px; }

/* HUD */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80; display: flex; justify-content: space-between; align-items: center;
  padding: calc(14px + env(safe-area-inset-top)) 20px 14px; pointer-events: none;
  opacity: 0; transform: translateY(-10px); transition: opacity .6s, transform .6s;
}
body.started .hud { opacity: 1; transform: none; }
.hud > * { pointer-events: auto; }
.hud-mark { color: var(--text); text-decoration: none; font-family: var(--serif); font-size: 19px; font-weight: 600; font-variation-settings: "SOFT" 100, "WONK" 1; letter-spacing: -.01em; mix-blend-mode: difference; }
.hud-mark b { font-weight: 700; }
.hud-right { display: flex; align-items: center; gap: 10px; }
.hud-key { width: 44px; height: 30px; display: grid; place-items: center; color: var(--amber); opacity: 0; transform: scale(.4) rotate(-30deg); transition: all .6s cubic-bezier(.2, .9, .3, 1.4); }
.hud-key svg { width: 34px; }
body.has-key .hud-key { opacity: 1; transform: none; }
.hud-sound { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .08); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); cursor: pointer; display: grid; place-items: center; }
.eq { display: flex; gap: 3px; align-items: flex-end; height: 14px; }
.eq i { width: 3px; height: 3px; background: var(--text); border-radius: 2px; transition: height .1s; }
.hud-sound[aria-pressed="false"] .eq i { height: 3px !important; opacity: .5; }

body.on-paper .hud-mark { mix-blend-mode: normal; color: var(--ink); }
body.on-paper .hud-sound { background: rgba(13, 6, 5, .08); }
body.on-paper .eq i { background: var(--ink); }
body.on-paper .hud-key { color: #b44a10; }

/* A1 gate */
.scene { position: relative; min-height: 100vh; min-height: 100svh; }
.s-gate { background: var(--flow-bg); display: grid; place-items: center; overflow: hidden; }
.gate-sky { position: absolute; inset: 0; background: radial-gradient(60% 50% at 50% 110%, rgba(255, 109, 0, .28), transparent 70%), radial-gradient(40% 40% at 70% 0%, rgba(0, 197, 252, .12), transparent 70%); }
.gate-inner { position: relative; width: min(92vw, 420px); text-align: center; }
.notif {
  display: flex; gap: 12px; align-items: center; text-align: left; padding: 14px 16px; border-radius: 22px;
  background: rgba(27, 31, 41, .82); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(255, 255, 255, .07);
  opacity: 0; transform: translateY(-40px) scale(.96);
}
.notif-icon { width: 44px; height: 44px; border-radius: 11px; background: #000; object-fit: contain; padding: 4px; }
.notif-body { flex: 1; min-width: 0; }
.notif-top { display: flex; justify-content: space-between; font-size: 13px; color: rgba(245, 245, 245, .6); }
.notif-top b { font-family: var(--flow); font-weight: 600; color: #f5f5f5; font-size: 14px; }
.notif-text { font-size: 16px; color: #f5f5f5; margin-top: 1px; }
.gate-hint { margin: 46px 0 18px; color: rgba(245, 245, 245, .55); font-size: 15px; opacity: 0; }
.gate-actions { display: flex; flex-direction: column; gap: 6px; align-items: center; opacity: 0; }
.gate-actions .btn-ice { min-width: 240px; }

/* A2 invite */
.s-invite {
  min-height: 140vh; display: flex; justify-content: center; overflow: hidden;
  background: radial-gradient(80% 60% at 50% 40%, #3a1a0e 0%, #1a0b07 55%, var(--ink) 100%);
}
.invite-stage { position: sticky; top: 0; height: 100vh; height: 100svh; width: 100%; display: grid; place-items: center; }
.env-wrap { perspective: 1800px; width: min(86vw, 500px); aspect-ratio: 1.48; position: relative; z-index: 2; cursor: pointer; }
.env { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 1.1s cubic-bezier(.6, .05, .2, 1); }
.env.flipped { transform: rotateY(180deg); }
.env-face {
  position: absolute; inset: 0; border-radius: 6px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background:
    radial-gradient(120% 90% at 30% 20%, rgba(255, 255, 255, .35), transparent 60%),
    repeating-linear-gradient(17deg, rgba(120, 90, 50, .035) 0 2px, transparent 2px 5px),
    linear-gradient(160deg, var(--cream), var(--paper) 55%, var(--paper-2));
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .9), 0 2px 0 rgba(255, 255, 255, .5) inset;
}
.env-back { transform: rotateY(180deg); overflow: visible; background: none; box-shadow: none; }
.env-front { color: #2a1f6e; }
.env-stamp { position: absolute; top: 7%; right: 6%; width: 17%; transform: rotate(4deg); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .2)); }
.env-stamp svg { display: block; }
.env-postmark { position: absolute; top: 9%; right: 17%; width: 30%; color: rgba(26, 25, 207, .55); transform: rotate(-8deg); }
.env-to { position: absolute; left: 12%; bottom: 20%; display: flex; flex-direction: column; }
.env-to-label { font-family: var(--serif); font-style: italic; font-size: clamp(13px, 2.6vw, 16px); color: rgba(42, 31, 110, .6); }
.env-to-name { font-size: clamp(34px, 8vw, 54px); line-height: 1; color: #1d1a5e; font-weight: 700; transform: rotate(-3deg); transform-origin: left; }
.env-to-addr { font-size: clamp(18px, 4vw, 24px); color: #1d1a5e; opacity: .85; margin-top: 4px; }
.env-from { position: absolute; right: 6%; bottom: 8%; width: 18%; opacity: .9; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .3)); }

/* back of the envelope */
.env-back::before { /* the inside of the envelope */
  content: ""; position: absolute; inset: 0; border-radius: 6px;
  background: linear-gradient(180deg, #2a2366, #1a1650); box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .9);
}
.env-letters { position: absolute; left: 5%; right: 5%; top: 6%; height: 92%; z-index: 2; clip-path: inset(-300% 0 0 0); }
.env-pocket {
  position: absolute; inset: 0; z-index: 3; border-radius: 6px; pointer-events: none;
  background:
    linear-gradient(to top right, var(--paper-2) 49.6%, transparent 50%) left bottom / 51% 100% no-repeat,
    linear-gradient(to top left, var(--paper-2) 49.6%, transparent 50%) right bottom / 51% 100% no-repeat,
    linear-gradient(160deg, var(--cream), var(--paper));
  clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%);
}
.env-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 58%; z-index: 4; transform-origin: 50% 0;
  transform-style: preserve-3d; transition: transform .9s cubic-bezier(.6, .05, .2, 1);
}
.env-flap-in {
  position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(180deg, var(--cream) 0%, var(--paper) 70%, #d9c7a6 100%);
}
.env.open .env-flap { transform: rotateX(180deg); z-index: 1; }
.seal {
  position: absolute; left: 50%; top: 58%; width: 86px; height: 86px; margin: -43px 0 0 -43px; z-index: 6; cursor: pointer;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.seal-half {
  position: absolute; inset: 0; border-radius: 47% 53% 49% 51% / 52% 46% 54% 48%;
  background: radial-gradient(circle at 35% 30%, #ff8d3a 0%, #e04a0c 38%, #9a2306 78%, #6e1503 100%);
  box-shadow: inset 0 -4px 8px rgba(0, 0, 0, .35), inset 0 3px 6px rgba(255, 210, 160, .35);
  display: grid; place-items: center; transition: transform .7s cubic-bezier(.3, 1.4, .5, 1), opacity .7s;
}
.seal::before { content: ""; position: absolute; inset: 2px; border-radius: 47% 53% 49% 51% / 52% 46% 54% 48%; box-shadow: 0 6px 14px rgba(0, 0, 0, .45); transition: opacity .3s; }
.seal.cracked::before { opacity: 0; }
.seal-half img { width: 58%; opacity: .5; filter: grayscale(1) brightness(1.5) drop-shadow(0 1px 0 rgba(0, 0, 0, .45)); pointer-events: none; }
.seal-l { clip-path: polygon(0 0, 54% 0, 46% 30%, 56% 52%, 44% 74%, 52% 100%, 0 100%); }
.seal-r { clip-path: polygon(54% 0, 100% 0, 100% 100%, 52% 100%, 44% 74%, 56% 52%, 46% 30%); }
.seal.cracked .seal-l { transform: translate(-60px, 120px) rotate(-70deg); opacity: 0; }
.seal.cracked .seal-r { transform: translate(70px, 140px) rotate(80deg); opacity: 0; }
.seal-ring { position: absolute; inset: -9px; width: calc(100% + 18px); height: calc(100% + 18px); transform: rotate(-90deg); pointer-events: none; }
.seal-ring circle { fill: none; stroke: var(--amber); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 296; stroke-dashoffset: 296; }
.seal:not(.cracked)::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 1px solid rgba(255, 178, 92, .5); animation: ping 1.8s ease-out infinite; pointer-events: none; }
@keyframes ping { from { transform: scale(.8); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.env:not(.flipped) .seal::after { animation: none; opacity: 0; }

/* the fridge note */
.note {
  position: absolute; left: 0; right: 0; top: 0; padding: 30px 26px 26px; border-radius: 3px; color: #1d1a5e;
  background:
    repeating-linear-gradient(180deg, transparent 0 33px, rgba(26, 25, 207, .16) 33px 34px) 0 30px / 100% 34px repeat-y,
    linear-gradient(90deg, transparent 38px, rgba(216, 38, 28, .3) 38px 39px, transparent 39px),
    linear-gradient(170deg, #fffdf6, #fbf2df);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7), 0 1px 0 rgba(0, 0, 0, .05);
  transform-origin: 50% 0;
}
.note-lines p { margin: 0 0 0 26px; font-size: clamp(21px, 4.6vw, 27px); line-height: 34px; font-weight: 500; }
.note-lines .note-hi { font-weight: 700; }
.note .no { font-family: inherit; }
.note-lines .note-sign { margin-top: 10px; color: var(--red); font-weight: 700; }
.note.writing p { clip-path: inset(0 100% 0 0); }
.magnet {
  position: absolute; top: -14px; left: 50%; width: 34px; height: 34px; margin-left: -17px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffb070, var(--orange) 45%, #a83b00);
  box-shadow: 0 6px 10px rgba(0, 0, 0, .35); opacity: 0;
}
.note.stuck .magnet { opacity: 1; }

/* the key */
.key-card { position: absolute; left: 50%; bottom: max(5vh, 30px); transform: translateX(-50%); text-align: center; z-index: 3; width: min(90vw, 420px); opacity: 0; pointer-events: none; }
.key-card.show { pointer-events: auto; }
.key { position: relative; width: 190px; margin: 0 auto; overflow: hidden; }
.key svg { width: 100%; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .5)); }
.key-shine { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, .8) 50%, transparent 60%); mix-blend-mode: overlay; transform: translateX(-120%); animation: shine 2.8s ease-in-out infinite 1s; }
@keyframes shine { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.key-line { font-size: 28px; color: var(--amber); margin: 0 0 14px; font-weight: 700; }
.invite-hint { position: absolute; bottom: 7vh; left: 0; right: 0; text-align: center; font-family: var(--serif); font-style: italic; color: var(--text-2); font-size: 17px; margin: 0; z-index: 3; transition: opacity .4s; }

/* A3 the door */
.s-door { overflow: hidden; background: var(--night); }
.street { position: absolute; inset: 0; }
.sky { position: absolute; inset: 0; background: radial-gradient(70% 50% at 50% 0%, #1d2370 0%, #0b0e33 60%, #05061a 100%); }
.facade {
  position: absolute; left: 50%; bottom: 0; width: min(900px, 140vw); height: 92%; transform: translateX(-50%);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .55), transparent 18%, transparent 82%, rgba(0, 0, 0, .55)),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .35) 0 2px, transparent 2px 22px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .3) 0 2px, transparent 2px 52px),
    linear-gradient(180deg, #2a120e, #3b1b13 60%, #2a120c);
  clip-path: polygon(0 12%, 18% 12%, 18% 4%, 30% 0, 70% 0, 82% 4%, 82% 12%, 100% 12%, 100% 100%, 0 100%);
}
.win { position: absolute; width: 15%; aspect-ratio: .72; background: #1a0b06; box-shadow: 0 0 0 6px #e7dcc8, 0 0 0 9px rgba(0, 0, 0, .4); }
.win-l { left: 10%; top: 44%; } .win-r { right: 10%; top: 44%; } .win-t { left: 10%; top: 14%; } .win-t2 { right: 10%; top: 14%; }
.win-glow { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(circle at 50% 60%, #ffb25c, #ff6d00 55%, #8a2a05); box-shadow: 0 0 60px 10px rgba(255, 109, 0, .35); animation: pulse var(--beat) ease-out infinite; }
.win-glow::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 47%, #e7dcc8 47% 53%, transparent 53%), linear-gradient(0deg, transparent 47%, #e7dcc8 47% 53%, transparent 53%); }
.win-glow i { position: absolute; bottom: -8%; width: 30%; height: 62%; background: #2a0d04; border-radius: 45% 45% 10% 10% / 30% 30% 10% 10%; animation: bob var(--beat) ease-in-out infinite; }
.win-glow i::before { content: ""; position: absolute; left: 22%; top: -30%; width: 56%; aspect-ratio: 1; border-radius: 50%; background: #2a0d04; }
.win-glow i:nth-child(1) { left: 6%; } .win-glow i:nth-child(2) { left: 40%; animation-delay: calc(var(--beat) * -.5); height: 70%; } .win-glow i:nth-child(3) { left: 72%; animation-delay: calc(var(--beat) * -.25); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9%); } }
@keyframes pulse { 0% { filter: brightness(1.25); } 100% { filter: brightness(.92); } }
.cobbles { position: absolute; left: 0; right: 0; bottom: 0; height: 10%; background: repeating-linear-gradient(90deg, #15131f 0 30px, #0e0c17 30px 32px), #15131f; box-shadow: 0 -10px 30px rgba(0, 0, 0, .6); }
.doorway { position: absolute; left: 50%; bottom: 10%; width: clamp(150px, 30vw, 240px); transform: translateX(-50%); z-index: 2; }
.fanlight { width: 100%; aspect-ratio: 2; border-radius: 999px 999px 0 0; background: #e7dcc8; padding: 8px 8px 0; }
.fanlight span { display: block; width: 100%; height: 100%; border-radius: 999px 999px 0 0; background: radial-gradient(circle at 50% 100%, #ffd08a, #ff6d00 60%, #7a2404); box-shadow: inset 0 0 20px rgba(0, 0, 0, .3); animation: pulse var(--beat) ease-out infinite; background-image: repeating-conic-gradient(from -90deg at 50% 100%, transparent 0 16deg, rgba(231, 220, 200, .9) 16deg 18deg), radial-gradient(circle at 50% 100%, #ffd08a, #ff6d00 60%, #7a2404); }
.door-hole { position: relative; width: 100%; aspect-ratio: .5; background: #120502; box-shadow: 0 0 0 8px #e7dcc8; perspective: 1400px; }
.inside { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(90% 70% at 50% 70%, #ffc27a, #ff6d00 45%, #6b1e03 100%); }
.inside-haze { position: absolute; inset: -20%; background: radial-gradient(40% 30% at 30% 60%, rgba(255, 240, 220, .5), transparent 70%), radial-gradient(40% 30% at 70% 40%, rgba(255, 220, 200, .4), transparent 70%); animation: haze 7s ease-in-out infinite alternate; }
@keyframes haze { to { transform: translate(8%, -6%) scale(1.1); } }
.inside-people i { position: absolute; bottom: -6%; width: 26%; height: 46%; background: #2a0b03; border-radius: 45% 45% 10% 10% / 30% 30% 10% 10%; animation: bob var(--beat) ease-in-out infinite; }
.inside-people i::before { content: ""; position: absolute; left: 22%; top: -26%; width: 56%; aspect-ratio: 1; border-radius: 50%; background: #2a0b03; }
.inside-people i:nth-child(1) { left: -4%; height: 50%; } .inside-people i:nth-child(2) { left: 18%; height: 38%; animation-delay: -.2s; opacity: .8; } .inside-people i:nth-child(3) { left: 42%; height: 54%; animation-delay: -.1s; } .inside-people i:nth-child(4) { left: 64%; height: 40%; animation-delay: -.3s; opacity: .8; } .inside-people i:nth-child(5) { left: 82%; height: 48%; }
.door {
  position: absolute; inset: 0; transform-origin: 0 50%; transform-style: preserve-3d;
  background: linear-gradient(90deg, #12118f, var(--cobalt) 20%, #2524e0 55%, #1413a8);
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, .25), inset -6px 0 12px rgba(0, 0, 0, .3);
}
.door-panel { position: absolute; left: 14%; right: 14%; border-radius: 3px; box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .12), inset -2px -2px 0 rgba(0, 0, 0, .3), 0 0 0 3px rgba(0, 0, 0, .12); }
.door-panel.p1 { top: 7%; height: 30%; } .door-panel.p2 { top: 55%; height: 38%; }
.door-plate { position: absolute; left: 50%; top: 38.5%; transform: translateX(-50%); font-family: var(--serif); font-weight: 700; font-size: clamp(20px, 4vw, 30px); color: #f3c870; text-shadow: 0 1px 0 rgba(0, 0, 0, .5), 0 0 12px rgba(243, 200, 112, .4); }
.slot { position: absolute; left: 30%; right: 30%; top: 50%; height: 4.2%; background: #0b0420; border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 2px #c99a3c; }
.slot-flap { position: absolute; inset: 0; background: linear-gradient(#f3c870, #a8701c); transform-origin: 50% 0; transition: transform .35s; z-index: 2; }
.slot.open .slot-flap { transform: rotateX(80deg) translateY(-100%); }
.eyes { position: absolute; inset: 0; display: flex; justify-content: center; gap: 14%; align-items: center; background: radial-gradient(#ffb25c, #ff6d00); }
.eyes i { width: 9%; height: 46%; border-radius: 50%; background: #120502; animation: blink 3s infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.knocker { position: absolute; left: 50%; top: 27%; width: 16%; aspect-ratio: 1; margin-left: -8%; border: 3px solid #e2b55b; border-radius: 50%; border-top-color: #f8d98f; }
.keyhole { position: absolute; right: 12%; top: 54%; width: 8px; height: 14px; background: radial-gradient(circle at 50% 30%, #0b0420 35%, transparent 37%), linear-gradient(#0b0420, #0b0420) 50% 100% / 3px 55% no-repeat; box-shadow: 0 0 0 5px #d9a23d; border-radius: 3px; }
.stoop i { display: block; height: 14px; background: #4b4038; margin: 0 -14%; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .1); }
.stoop i + i { margin: 0 -24%; background: #3a312a; }
.door-ui { position: absolute; left: 0; right: 0; bottom: 3%; z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 16px; }
.door-actions { display: flex; gap: 10px; }
.bubble {
  position: absolute; left: 50%; bottom: calc(100% + 34vh); transform: translateX(-50%) scale(.6); opacity: 0;
  background: var(--cream); color: #1d1a5e; font-family: var(--hand); font-weight: 700; font-size: 26px; line-height: 1.1;
  padding: 10px 18px; border-radius: 20px; white-space: nowrap; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); transition: opacity .25s, transform .35s cubic-bezier(.2, .9, .3, 1.5);
}
.doorway .bubble { bottom: auto; top: 16%; }
.bubble.show { opacity: 1; transform: translateX(-50%) scale(1); }
.bubble.me { background: var(--orange); color: #1a0700; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 16px; height: 16px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 3px; }
.s-door .light-flood { position: absolute; inset: 0; z-index: 5; pointer-events: none; background: radial-gradient(40% 60% at 50% 75%, rgba(255, 190, 110, .95), rgba(255, 109, 0, .6) 40%, transparent 75%); opacity: 0; }

/* A4 the house */
.s-house { position: relative; height: 900vh; background: #050302; }
.house-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.house-cam { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.house-img { width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.house-fx { position: absolute; inset: 0; pointer-events: none; }
.fx-spark { position: absolute; width: .5%; aspect-ratio: 1; border-radius: 50%; background: #fff; box-shadow: 0 0 10px 3px rgba(255, 230, 200, .9); opacity: 0; animation: spark 1.6s ease-in-out infinite; }
@keyframes spark { 0%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: .95; transform: scale(1); } }
.fx-glow { position: absolute; border-radius: 50%; background: radial-gradient(circle, rgba(255, 190, 110, .55), transparent 65%); mix-blend-mode: screen; animation: pulse var(--beat) ease-out infinite; }
.fx-tv { position: absolute; background: rgba(90, 140, 255, .35); mix-blend-mode: screen; animation: tv .18s steps(2) infinite; }
@keyframes tv { 50% { opacity: .35; } }
.fx-haze { position: absolute; border-radius: 50%; background: radial-gradient(circle, rgba(255, 220, 200, .25), transparent 70%); filter: blur(6px); animation: drift 9s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(12%, -10%) scale(1.2); } }
.fx-beam { position: absolute; transform-origin: 50% 0; width: 2%; height: 38%; background: linear-gradient(rgba(255, 120, 60, .5), transparent); mix-blend-mode: screen; filter: blur(3px); animation: sweep 3s ease-in-out infinite alternate; }
@keyframes sweep { from { transform: rotate(-35deg); } to { transform: rotate(35deg); } }
.house-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, .7)); }
.room-card { position: absolute; left: max(5vw, 20px); bottom: max(7vh, 28px); width: min(440px, 88vw); z-index: 3; text-shadow: 0 2px 20px rgba(0, 0, 0, .9); }
.room-card::before { content: ""; position: absolute; inset: -60px -80px -40px -60px; z-index: -1; background: radial-gradient(closest-side, rgba(5, 3, 2, .82), transparent); }
.room-code { font-size: 12px; letter-spacing: .14em; color: var(--amber); opacity: .8; font-variant-numeric: tabular-nums; }
.room-name { font-family: var(--serif); font-weight: 500; font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; font-size: clamp(38px, 6vw, 68px); line-height: 1; letter-spacing: -.025em; margin: 6px 0 14px; }
.room-line { font-size: clamp(16px, 2vw, 19px); margin: 0; color: var(--text); max-width: 36ch; }
.room-who { margin: 12px 0 0; font-family: var(--serif); font-style: italic; color: var(--amber); font-size: 16px; min-height: 1em; }
.polaroid {
  position: absolute; right: max(6vw, 18px); top: 15vh; width: clamp(140px, 21vw, 290px); margin: 0; z-index: 3;
  background: #fbf8f2; padding: 10px 10px 0; box-shadow: 0 30px 60px -10px rgba(0, 0, 0, .8); opacity: 0;
}
.polaroid img { width: 100%; aspect-ratio: .82; object-fit: cover; filter: contrast(1.05) saturate(1.05); }
.polaroid figcaption { color: #2a2366; font-size: clamp(18px, 2.2vw, 24px); font-weight: 700; padding: 6px 2px 10px; text-align: center; line-height: 1.1; }
.house-progress { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); z-index: 3; }
.house-progress #house-dots { display: flex; flex-direction: column; gap: 10px; }
.house-progress span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .25); transition: all .3s; }
.house-progress span.on { background: var(--orange); transform: scale(1.5); }

/* A5 the night */
.s-night { position: relative; height: 520vh; background: var(--ink); }
.night-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: grid; place-items: center; }
.night-bg { position: absolute; inset: -4%; background: url(img/living.webp) center / cover; filter: saturate(1.2) brightness(.42); transform: scale(1.06); }
.night-bg::after { content: ""; position: absolute; inset: 0; background: var(--wash, rgba(255, 109, 0, .25)); mix-blend-mode: color; transition: background .6s; }
.night-lights { position: absolute; inset: 0; mix-blend-mode: screen; pointer-events: none; }
.night-lights i { position: absolute; top: -10%; width: 22vw; height: 130%; background: linear-gradient(var(--beam, rgba(255, 109, 0, .4)), transparent 75%); filter: blur(18px); transform-origin: 50% 0; animation: sweep calc(var(--beat) * 8) ease-in-out infinite alternate; }
.night-lights i:nth-child(1) { left: 5%; } .night-lights i:nth-child(2) { left: 30%; animation-delay: calc(var(--beat) * -3); } .night-lights i:nth-child(3) { left: 55%; animation-delay: calc(var(--beat) * -5); } .night-lights i:nth-child(4) { left: 78%; animation-delay: calc(var(--beat) * -7); }
.night-inner { position: relative; width: min(760px, 90vw); text-align: center; }
.night-kicker { font-family: var(--serif); font-style: italic; color: var(--amber); margin: 0 0 6px; font-size: 18px; }
.night-clock { font-family: var(--serif); font-variation-settings: "SOFT" 50, "opsz" 144; font-weight: 300; font-size: clamp(96px, 22vw, 230px); line-height: .9; letter-spacing: -.04em; font-variant-numeric: tabular-nums; text-shadow: 0 0 60px rgba(255, 140, 60, .35); }
.night-meta { display: flex; gap: 10px; justify-content: center; align-items: baseline; margin: 10px 0 16px; font-size: 18px; color: var(--text-2); }
.night-meta b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.night-meta #night-genre { color: var(--text); }
.night-what { font-size: clamp(18px, 2.4vw, 23px); max-width: 30ch; margin: 0 auto; min-height: 3.2em; }
.night-bar { position: relative; height: 2px; background: rgba(255, 255, 255, .15); margin: 36px auto 0; width: min(560px, 82vw); }
.night-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--orange); box-shadow: 0 0 12px var(--orange); }
.night-ticks { position: absolute; inset: 0; display: flex; justify-content: space-between; }
.night-ticks span { position: relative; width: 1px; }
.night-ticks span::after { content: attr(data-t); position: absolute; top: 10px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.night-eq { display: flex; gap: 4px; align-items: flex-end; justify-content: center; height: 54px; margin-top: 40px; }
.night-eq i { width: 5px; border-radius: 3px; background: linear-gradient(var(--amber), var(--orange)); height: 4px; opacity: .85; }

/* A6 the yes */
.s-yes { display: grid; place-items: center; overflow: hidden; background: #070303; transition: background 1.2s; padding: 0 0 12vh; }
.s-yes.lit { background: radial-gradient(70% 60% at 50% 18%, #6b2a0a 0%, #2a0e05 45%, #0d0605 100%); }
.yes-inner { position: relative; width: min(560px, 90vw); text-align: center; padding-top: 4vh; }
.lamp { position: relative; width: 190px; margin: 0 auto 120px; }
.lamp::before { content: ""; position: absolute; left: 50%; top: -40vh; width: 2px; height: 40vh; background: #2a1d14; transform: translateX(-50%); }
.lamp-shade { width: 100%; display: block; position: relative; z-index: 2; }
.lamp-shade .shade { fill: #2b1a10; stroke: #3d2618; stroke-width: 2; transition: fill .4s; }
.lamp-shade .fringe { stroke: #3d2618; stroke-width: 10; stroke-dasharray: 2 4; }
.s-yes.lit .lamp-shade .shade { fill: #ffb25c; filter: drop-shadow(0 0 30px rgba(255, 160, 70, .9)); }
.s-yes.lit .lamp-shade .fringe { stroke: #ff6d00; }
.lamp-cone { position: absolute; left: 50%; top: 80%; width: 700px; height: 70vh; transform: translateX(-50%); clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%); background: linear-gradient(rgba(255, 190, 110, .55), rgba(255, 140, 50, .08) 70%, transparent); opacity: 0; transition: opacity .5s; pointer-events: none; filter: blur(4px); }
.s-yes.lit .lamp-cone { opacity: 1; }
.lamp-cord { position: absolute; right: 12%; top: 84%; z-index: 3; display: flex; flex-direction: column; align-items: center; touch-action: none; }
.cord-line { width: 1.5px; height: 70px; background: #8a6a45; transform-origin: top; }
.cord-bead { width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; cursor: grab; background: radial-gradient(circle at 35% 30%, #ffe4a3, #d9a23d 50%, #8a5a14); box-shadow: 0 4px 10px rgba(0, 0, 0, .5); }
.cord-bead:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }
.lamp-cord.hint .cord-bead { animation: tug 2.2s ease-in-out infinite; }
@keyframes tug { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(12px); } 90% { transform: translateY(0); } }
.yes-title { font-family: var(--serif); font-weight: 500; font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; font-size: clamp(36px, 7vw, 64px); line-height: 1.02; letter-spacing: -.025em; margin: 0 0 12px; }
.yes-sub { color: var(--text-2); font-size: 18px; margin: 0; }
.plus { margin-top: 38px; text-align: left; }
.plus-label { display: block; font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--amber); margin-bottom: 10px; text-align: center; }
.plus-row { display: flex; gap: 8px; }
.plus-row input { flex: 1; min-width: 0; height: 52px; border-radius: 999px; border: 0; padding: 0 22px; font: 500 20px var(--hand); font-family: var(--hand); background: rgba(255, 248, 236, .08); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 178, 92, .35); }
.plus-row input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--amber); }
.plus-row .btn { white-space: nowrap; }
.plus-err { color: #ff8a7a; font-size: 14px; margin: 8px 0 0 22px; min-height: 1em; }
.plus-out { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.plus-link { color: var(--amber); font-size: 15px; word-break: break-all; }
.chat { display: flex; gap: 12px; align-items: center; margin-top: 30px; padding: 14px 16px; border-radius: 18px; background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.chat-icon svg { width: 36px; height: 36px; }
.chat-body { flex: 1; display: flex; flex-direction: column; font-size: 14px; color: var(--text-2); }
.chat-body b { color: var(--text); font-weight: 600; font-size: 15px; }
.chat-soon { font-size: 12px; color: var(--amber); white-space: nowrap; }

/* B backstage */
.s-back { background: var(--paper); color: #1c1410; padding: 16vh 20px 10vh; }
.back-inner { max-width: 64ch; margin: 0 auto; }
.back-kicker { font-family: var(--serif); font-style: italic; color: #b44a10; margin: 0 0 10px; font-size: 18px; }
.back-title { font-family: var(--serif); font-weight: 500; font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; font-size: clamp(40px, 7vw, 72px); line-height: 1; letter-spacing: -.03em; margin: 0 0 24px; }
.back-lead { font-size: 20px; line-height: 1.55; margin: 0 0 9vh; color: #3a2c22; }
.back-block { margin: 0 0 8vh; }
.back-block h3 { font-family: var(--serif); font-weight: 600; font-size: 24px; letter-spacing: -.01em; margin: 0 0 18px; }
.back-list { margin: 0; padding: 0 0 0 1.2em; }
.back-list li { margin: 0 0 12px; padding-left: 6px; font-size: 18px; }
.back-list li::marker { font-family: var(--serif); color: #b44a10; font-weight: 600; }
.back-flow, .back-open, .credits { list-style: none; margin: 0; padding: 0; }
.back-flow li { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid rgba(28, 20, 16, .12); font-size: 17px; }
.back-flow li b { font-weight: 600; font-size: 14px; }
.back-flow li.live b { color: #0f7a4a; }
.back-flow li.build b { color: #b44a10; }
.back-open li { display: inline-block; margin: 0 6px 10px 0; padding: 8px 14px; border-radius: 999px; font-size: 15px; background: rgba(28, 20, 16, .06); }
.credits li { display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding: 10px 0; font-size: 17px; border-top: 1px solid rgba(28, 20, 16, .1); }
.credits li b { font-family: var(--serif); font-weight: 600; }
.back-foot { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; border-top: 1px solid rgba(28, 20, 16, .15); padding-top: 26px; }
.made { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: #6a5a4c; }
.made img { width: 22px; height: 22px; background: #000; border-radius: 6px; padding: 2px; }

/* codes */
.code-tag { display: none; position: absolute; top: 6px; left: 6px; z-index: 70; font: 600 11px/1 var(--sans); letter-spacing: .06em; padding: 4px 7px; border-radius: 6px; background: rgba(255, 109, 0, .92); color: #1a0700; pointer-events: none; }
body.show-codes .code-tag { display: block; }
body.show-codes .hud .code-tag { top: 56px; }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .polaroid { top: 12vh; right: 16px; width: 128px; padding: 7px 7px 0; }
  .polaroid figcaption { font-size: 16px; padding: 4px 2px 6px; }
  .room-card { bottom: 5vh; left: 20px; width: calc(100vw - 40px); }
  .room-card::before { inset: -80px -30px -40px -30px; }
  .back-flow li, .credits li { grid-template-columns: 1fr; gap: 2px; }
  .lamp-cone { width: 120vw; }
  .plus-row { flex-direction: column; }
  .plus-row input { flex: none; width: 100%; }
  .plus-row .btn { width: 100%; }
  .made { margin-left: 0; width: 100%; }
  .house-progress { right: 8px; }
  .bubble { font-size: 22px; bottom: calc(100% + 30vh); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .grain { display: none; }
}

/* the invite, once it is out of the envelope */
.invite-final { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3.2vh; padding: 64px 0 3vh; pointer-events: none; }
.invite-final > * { pointer-events: auto; }
.invite-final .key-card { position: relative; left: auto; bottom: auto; transform: none; }
.note.big { position: relative; left: auto; right: auto; top: auto; width: min(86vw, 450px); transform-origin: 50% 50%; }
.key-fly { position: fixed; z-index: 85; width: 120px; pointer-events: none; }
