/* Lamplit: an advent house your friends light up. */

:root {
  --ink: #17203d;
  --ink-soft: #4a5577;
  --snow: #f6f9fd;
  --snow-2: #e6edf7;
  --line: #d3ddeb;
  --glow: #ffc45a;
  --glow-hot: #ffdb8a;
  --glow-ink: #3a2306;
  --holly: #cf3d37;
  --pine: #22624a;
  --on-night: #eef3ff;
  --on-night-soft: rgba(226, 234, 255, 0.74);
  --sky-top: #0e1838;
  --sky-bottom: #2b467d;
  --serif: "Young Serif", "Songti SC", "Noto Serif SC", Georgia, serif;
  --sans: "Nunito", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --r-card: 22px;
  --r-field: 12px;
  color-scheme: dark;
}

[data-sky="cabin"] { --sky-top: #14102a; --sky-bottom: #4b3566; }
[data-sky="frost"] { --sky-top: #08202f; --sky-bottom: #2a6782; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font: 400 16px/1.55 var(--sans);
  color: var(--on-night);
  background: var(--sky-bottom);
  overflow-x: hidden;
}
img, svg { display: block; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--glow); color: var(--glow-ink); }
:focus-visible { outline: 3px solid var(--glow-hot); outline-offset: 3px; border-radius: 6px; }

/* ---- night sky ------------------------------------------------------------------ */
.sky {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
  transition: background 0.6s;
}
.sky::before {
  content: "";
  position: absolute; inset: 0 0 35% 0;
  background:
    radial-gradient(1.2px 1.2px at 8% 12%, #fff 98%, transparent),
    radial-gradient(1px 1px at 22% 30%, #dfe8ff 98%, transparent),
    radial-gradient(1.4px 1.4px at 35% 8%, #fff 98%, transparent),
    radial-gradient(1px 1px at 48% 22%, #fff 98%, transparent),
    radial-gradient(1.2px 1.2px at 63% 14%, #f6eccf 98%, transparent),
    radial-gradient(1px 1px at 72% 34%, #fff 98%, transparent),
    radial-gradient(1.5px 1.5px at 86% 9%, #fff 98%, transparent),
    radial-gradient(1px 1px at 93% 27%, #dfe8ff 98%, transparent),
    radial-gradient(1px 1px at 15% 46%, #fff 98%, transparent),
    radial-gradient(1px 1px at 55% 40%, #fff 98%, transparent),
    radial-gradient(1.2px 1.2px at 80% 48%, #fff 98%, transparent),
    radial-gradient(1px 1px at 3% 60%, #fff 98%, transparent);
  opacity: 0.85;
}
.moon {
  position: absolute; top: 56px; right: max(24px, 7vw);
  width: 64px; height: 64px; border-radius: 50%;
  box-shadow: inset -14px 8px 0 0 #fbf3d5;
  filter: drop-shadow(0 0 18px rgba(251, 243, 213, 0.45));
  transform: rotate(-18deg);
}
@media (max-width: 560px) { .moon { top: 74px; right: 18px; width: 40px; height: 40px; box-shadow: inset -9px 5px 0 0 #fbf3d5; opacity: 0.85; } }
#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

/* ---- layout --------------------------------------------------------------------- */
#app { position: relative; z-index: 1; min-height: 100svh; display: flex; flex-direction: column; }
#app > main { flex: 1; }
.wrap { position: relative; z-index: 1; width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-block: 18px 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand-mark { width: 34px; height: 34px; }
.brand-name { font: 400 1.35rem/1 var(--serif); letter-spacing: 0.01em; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
@media (max-width: 540px) { .hide-xs { display: none !important; } }
.lang-pill {
  display: inline-flex; align-items: center; padding: 3px; border-radius: 999px;
  border: 1px solid rgba(226, 234, 255, 0.28); background: rgba(10, 16, 40, 0.28);
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.03em; line-height: 1;
}
.lang-pill a, .lang-pill button, .lang-pill span {
  padding: 5px 8px; border-radius: 999px; text-decoration: none; border: 0; background: transparent;
  color: var(--on-night-soft); cursor: pointer; display: inline-flex; align-items: center;
}
.lang-pill a:hover, .lang-pill button:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.lang-pill .is-active { background: rgba(255, 255, 255, 0.18); color: #fff; cursor: default; }
.chip-btn {
  border: 1px solid rgba(226, 234, 255, 0.28); background: rgba(10, 16, 40, 0.25);
  border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 0.875rem; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.chip-btn:hover { background: rgba(255, 255, 255, 0.1); }

.stage {
  display: grid; gap: 28px; align-items: start; padding-block: 18px 40px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 900px) {
  .stage { grid-template-columns: minmax(0, 470px) minmax(0, 1fr); gap: 56px; padding-block-start: 40px; }
  .house-col { position: sticky; top: 16px; }
}

/* friend + owner pages: on phones the title comes first, then the house, then the cards */
.page-stage { grid-template-areas: "head" "house" "panel"; }
.page-head { grid-area: head; }
.page-house { grid-area: house; }
.page-panel { grid-area: panel; display: grid; gap: 14px; align-content: start; }
.page-panel .card + .card { margin-top: 0; }
@media (min-width: 900px) {
  .page-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); grid-template-areas: "house head" "house panel"; grid-template-rows: auto 1fr; row-gap: 22px; }
}
.house-col { display: flex; flex-direction: column; align-items: center; }

.home-stage { grid-template-areas: "copy" "house" "form"; }
.home-copy { grid-area: copy; }
.home-house { grid-area: house; }
.home-form { grid-area: form; }
.demo-hint { text-align: center; font-size: 0.9375rem; }
.fine { font-size: 0.875rem; margin-top: 10px; text-align: center; }
@media (min-width: 900px) {
  .home-stage { grid-template-areas: "copy house" "form house"; grid-template-rows: auto 1fr; row-gap: 28px; }
}

h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; }
.display { font-size: clamp(2.5rem, 6.4vw, 4.1rem); line-height: 1.02; letter-spacing: -0.015em; text-wrap: balance; }
.lede { font-size: 1.125rem; line-height: 1.6; color: var(--on-night-soft); max-width: 34em; margin: 18px 0 0; text-wrap: pretty; }
.title { font-size: clamp(2rem, 4.6vw, 2.9rem); line-height: 1.05; text-wrap: balance; }
.sub { color: var(--on-night-soft); margin: 10px 0 0; max-width: 32em; text-wrap: pretty; }

/* ---- cards & fields --------------------------------------------------------------- */
.card {
  background: var(--snow); color: var(--ink);
  border-radius: var(--r-card); padding: 22px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 24px 50px -24px rgba(0, 0, 0, 0.65);
  color-scheme: light;
}
.card + .card { margin-top: 14px; }
.card h2, .card-heading { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; line-height: 1.2; margin: 0; color: var(--ink); }
.card p { margin: 6px 0 0; color: var(--ink-soft); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.card .row { margin-top: 14px; }

.field { display: block; margin-top: 16px; }
.field > span:first-child { display: block; font-weight: 800; font-size: 0.875rem; margin-bottom: 6px; }
.input, .textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--r-field);
  background: #fff; padding: 12px 14px; font-size: 1rem; color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .textarea:focus { outline: none; border-color: #7e93c2; box-shadow: 0 0 0 4px rgba(126, 147, 194, 0.22); }
.textarea { min-height: 112px; resize: vertical; line-height: 1.5; }
.hint { font-size: 0.8125rem; color: var(--ink-soft); display: flex; justify-content: space-between; margin-top: 6px; }
.hint .over { color: var(--holly); font-weight: 800; }
.error { color: var(--holly); font-weight: 700; font-size: 0.875rem; margin-top: 10px; min-height: 1.2em; }
.check { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-weight: 600; font-size: 0.9375rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--pine); }

.btn {
  appearance: none; border: 0; cursor: pointer; border-radius: 999px;
  padding: 13px 22px; font-weight: 800; font-size: 1rem; line-height: 1.2;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn-glow {
  background: linear-gradient(180deg, var(--glow-hot), var(--glow));
  color: var(--glow-ink);
  box-shadow: 0 0 0 1px rgba(150, 90, 0, 0.25) inset, 0 6px 22px -6px rgba(255, 190, 80, 0.75);
}
.btn-glow:hover { box-shadow: 0 0 0 1px rgba(150, 90, 0, 0.25) inset, 0 8px 30px -4px rgba(255, 196, 90, 0.95); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #24305a; }
.btn-line { background: #fff; color: var(--ink); box-shadow: 0 0 0 1.5px var(--line) inset; }
.btn-line:hover { background: var(--snow-2); box-shadow: 0 0 0 1.5px #9fb0d0 inset; }
.btn-ghost { background: transparent; color: var(--on-night); box-shadow: 0 0 0 1.5px rgba(226, 234, 255, 0.35) inset; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.btn-block { width: 100%; }
.btn-small { padding: 9px 15px; font-size: 0.9rem; }
.btn-quiet.danger { color: var(--holly); }
.btn-quiet { background: none; border: 0; color: var(--ink-soft); font-weight: 700; cursor: pointer; padding: 6px 2px; text-decoration: underline; text-underline-offset: 3px; }

/* theme picker */
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-opt { position: relative; cursor: pointer; }
.theme-opt input { position: absolute; opacity: 0; inset: 0; }
.theme-opt .swatch {
  display: block; border-radius: 14px; padding: 8px 8px 9px; border: 2px solid transparent;
  background: var(--snow-2); text-align: center; font-weight: 800; font-size: 0.8125rem; transition: border-color 0.15s;
}
.theme-opt .mini { display: block; height: 66px; border-radius: 9px; overflow: hidden; margin-bottom: 7px; position: relative; }
.theme-opt .mini svg { width: 130%; height: auto; position: absolute; top: 2px; left: -15%; }
.theme-opt input:checked + .swatch { border-color: var(--ink); background: #fff; }
.theme-opt input:focus-visible + .swatch { outline: 3px solid #7e93c2; outline-offset: 2px; }

/* ---- the house -------------------------------------------------------------------- */
.house {
  position: relative; width: 100%; max-width: min(480px, calc((100svh - 140px) * 400 / 672)); aspect-ratio: 400 / 672;
  container-type: inline-size; margin: 0 auto;
  --pane-dark-1: #3b5a92; --pane-dark-2: #1b2c55; --pane-dark-3: #142244;
}
.house > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.house-front { pointer-events: none; z-index: 3; }
.slots { position: absolute; inset: 0; z-index: 2; }

.slot {
  position: absolute; padding: 0; border: 0; background: transparent; cursor: pointer;
  perspective: 40cqw; -webkit-tap-highlight-color: transparent;
}
.slot[disabled] { cursor: default; }
.slot:focus-visible { outline: none; }
.slot:focus-visible .pane-face { box-shadow: 0 0 0 0.9cqw var(--glow-hot), 0 0 4cqw 1cqw rgba(255, 210, 120, 0.7); }

.room, .pane, .pane-face, .pane-back { position: absolute; inset: 0; border-radius: inherit; }
.slot--arch, .slot--arch .room, .slot--arch .pane, .slot--arch .pane-face, .slot--arch .pane-back { border-radius: 999px 999px 0.4cqw 0.4cqw; }
.slot--attic, .slot--attic .room, .slot--attic .pane, .slot--attic .pane-face, .slot--attic .pane-back { border-radius: 50%; }
.slot--door, .slot--door .room, .slot--door .pane, .slot--door .pane-face, .slot--door .pane-back { border-radius: 999px 999px 0 0; }
.slot--window, .slot--window .room, .slot--window .pane, .slot--window .pane-face, .slot--window .pane-back { border-radius: 0.4cqw; }

/* what's behind the window */
.room {
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(160, 60, 20, 0.12) 0 1.2cqw, transparent 1.2cqw 2.4cqw),
    radial-gradient(ellipse 80% 70% at 50% 60%, #fff3cf 0%, #ffd58a 55%, #f0a54a 100%);
  display: grid; place-items: center;
}
.room::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 18%; background: rgba(120, 50, 10, 0.28); }
.room img { width: 86%; height: auto; position: relative; z-index: 1; transform: scale(0.4); opacity: 0; transition: transform 0.55s cubic-bezier(0.2, 1.6, 0.4, 1) 0.25s, opacity 0.2s 0.25s; }
.slot--door .room img { width: 80%; }
.is-open .room img { transform: scale(1); opacity: 1; }
.is-gift .room { background: radial-gradient(ellipse 80% 70% at 50% 60%, #e9f1ff 0%, #b9cdee 60%, #8ea9d6 100%); }

/* the pane that swings open */
.pane { transform-origin: 0% 50%; transform-style: preserve-3d; transition: transform 0.95s cubic-bezier(0.3, 1.25, 0.45, 1); }
.is-open .pane { transform: rotateY(-112deg); pointer-events: none; animation: pane-away 0.35s ease-in 1s forwards; }
/* after the swing, the pane fades away so it never covers the windows beside it */
@keyframes pane-away { to { opacity: 0; visibility: hidden; } }
.is-opened .pane { display: none; } /* already open when the page loaded: no swing, no pane */
.slot--door.is-open .pane { transform: rotateY(-100deg); }
.slot--attic.is-open .pane { transform: rotateY(-120deg); }
.pane-face, .pane-back { backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
/* the opened casement, seen from inside: frame, bars and a pale reflection */
.pane-back {
  transform: rotateY(180deg);
  background:
    linear-gradient(90deg, transparent calc(50% - 0.45cqw), var(--trim) calc(50% - 0.45cqw) calc(50% + 0.45cqw), transparent calc(50% + 0.45cqw)),
    linear-gradient(180deg, transparent calc(48% - 0.45cqw), var(--trim) calc(48% - 0.45cqw) calc(48% + 0.45cqw), transparent calc(48% + 0.45cqw)),
    linear-gradient(115deg, rgba(255, 255, 255, 0.05) 30%, rgba(255, 255, 255, 0.32) 31% 40%, rgba(255, 255, 255, 0.08) 41%),
    linear-gradient(160deg, #8fa6c9, #5d769f);
  box-shadow: inset 0 0 0 0.75cqw var(--trim), inset 0 0 0 1cqw rgba(0, 0, 0, 0.18);
}
.slot--door .pane-back {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.25), transparent 30%), var(--door-dark);
  box-shadow: inset 0 0 0 0.6cqw rgba(0, 0, 0, 0.25);
}

/* dark glass */
.pane-face {
  background:
    radial-gradient(ellipse 70% 40% at 0% 100%, rgba(255, 255, 255, 0.5), transparent 70%),
    radial-gradient(ellipse 60% 35% at 100% 100%, rgba(255, 255, 255, 0.38), transparent 70%),
    linear-gradient(162deg, var(--pane-dark-1) 0%, var(--pane-dark-2) 48%, var(--pane-dark-3) 100%);
  transition: box-shadow 0.6s, filter 0.6s;
}
.pane-face::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(118deg, transparent 28%, rgba(255, 255, 255, 0.14) 29% 37%, transparent 38% 50%, rgba(255, 255, 255, 0.07) 51% 54%, transparent 55%);
  transition: opacity 0.5s;
}
/* window bars */
.pane-face::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, transparent calc(50% - 0.5cqw), var(--trim, #f1e5cf) calc(50% - 0.5cqw) calc(50% + 0.5cqw), transparent calc(50% + 0.5cqw)),
    linear-gradient(180deg, transparent calc(48% - 0.5cqw), var(--trim, #f1e5cf) calc(48% - 0.5cqw) calc(48% + 0.5cqw), transparent calc(48% + 0.5cqw));
  opacity: 0.95;
}
.slot--attic .pane-face::after {
  background:
    linear-gradient(90deg, transparent calc(50% - 0.45cqw), var(--trim) calc(50% - 0.45cqw) calc(50% + 0.45cqw), transparent calc(50% + 0.45cqw)),
    linear-gradient(180deg, transparent calc(50% - 0.45cqw), var(--trim) calc(50% - 0.45cqw) calc(50% + 0.45cqw), transparent calc(50% + 0.45cqw));
}

/* lit: someone left a note behind this window */
.is-lit .pane-face {
  background:
    linear-gradient(180deg, var(--curtain) 0 11%, transparent 11%),
    linear-gradient(90deg, var(--curtain-2) 0%, var(--curtain) 7%, var(--curtain-2) 12%, var(--curtain) 16%, transparent 19%, transparent 81%, var(--curtain) 84%, var(--curtain-2) 88%, var(--curtain) 93%, var(--curtain-2) 100%),
    radial-gradient(ellipse 70% 70% at 50% 62%, #fff4cc 0%, #ffd06e 48%, #ef9b3c 100%);
  box-shadow: 0 0 3.4cqw 1.2cqw rgba(255, 186, 80, 0.5), inset 0 0 2cqw rgba(140, 60, 0, 0.45);
}
.is-lit .pane-face::before { opacity: 0.35; }
.is-lit .pane-face::after { opacity: 0.9; filter: brightness(0.55) sepia(0.6); }

/* the number plate */
.tag {
  position: absolute; left: 50%; top: 48%; transform: translate(-50%, -50%);
  min-width: 7.2cqw; padding: 0.35cqw 1cqw 0.45cqw; border-radius: 1.1cqw;
  background: #f8f0e0; color: #3b2416; font: 400 3.7cqw/1 var(--serif); text-align: center;
  box-shadow: 0 0.35cqw 0 rgba(30, 16, 8, 0.35), inset 0 0 0 0.25cqw rgba(59, 36, 22, 0.14);
  z-index: 2; pointer-events: none;
}
.slot--attic .tag { top: 50%; }
.is-lit .tag { background: #fffaf0; }
.mine-dot {
  position: absolute; right: -1.4cqw; top: -1.6cqw; width: 4cqw; height: 4cqw; z-index: 3;
  background: var(--holly); border-radius: 50%; box-shadow: 0 0 0 0.5cqw #fff;
  display: grid; place-items: center; color: #fff; font-size: 2.4cqw;
}

/* a gentle "start here" on a friend's first visit */
.is-suggest .pane-face { animation: suggest 2.6s ease-in-out infinite; }
@keyframes suggest {
  0%, 100% { box-shadow: 0 0 0 0.4cqw rgba(255, 219, 138, 0.55); }
  50% { box-shadow: 0 0 0 0.8cqw rgba(255, 219, 138, 0.95), 0 0 4cqw 1cqw rgba(255, 200, 100, 0.45); }
}
.plus-dot {
  position: absolute; right: -1.6cqw; top: -1.8cqw; width: 4.6cqw; height: 4.6cqw; z-index: 3; border-radius: 50%;
  background: var(--glow); color: var(--glow-ink); box-shadow: 0 0 0 0.5cqw #fff, 0 0 3cqw rgba(255, 196, 90, 0.8);
  display: grid; place-items: center; font: 800 3.6cqw/1 var(--sans); pointer-events: none;
  animation: bob 2.6s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-0.8cqw); } }

/* the front door */
.slot--door .pane-face {
  background:
    radial-gradient(circle at 84% 79%, #f6d27a 0 1.1cqw, #b88a2c 1.15cqw 1.4cqw, transparent 1.45cqw),
    linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent 12% 88%, rgba(0, 0, 0, 0.22)),
    var(--door);
  box-shadow: inset 0 0 0 0.6cqw var(--door-dark);
}
.slot--door .pane-face::before {
  inset: auto 16% 6% 16%; height: 15%; border-radius: 0.6cqw;
  background: none; box-shadow: inset 0 0 0 0.55cqw var(--door-dark), inset 0 0 0 1.1cqw var(--door-light);
  opacity: 1;
}
.slot--door .pane-face::after {
  inset: 6% 26% auto 26%; height: 11%; border-radius: 999px 999px 0.4cqw 0.4cqw;
  background:
    linear-gradient(90deg, transparent calc(50% - 0.35cqw), var(--door-dark) calc(50% - 0.35cqw) calc(50% + 0.35cqw), transparent calc(50% + 0.35cqw)),
    linear-gradient(170deg, var(--pane-dark-1), var(--pane-dark-3));
  box-shadow: 0 0 0 0.5cqw var(--door-dark);
  opacity: 1; filter: none;
}
.slot--door.is-lit .pane-face { box-shadow: inset 0 0 0 0.6cqw var(--door-dark), 0 0 4cqw 1cqw rgba(255, 186, 80, 0.45); }
.slot--door.is-lit .pane-face::after {
  background:
    linear-gradient(90deg, transparent calc(50% - 0.35cqw), var(--door-dark) calc(50% - 0.35cqw) calc(50% + 0.35cqw), transparent calc(50% + 0.35cqw)),
    radial-gradient(ellipse at 50% 80%, #fff2c4, #ffbf55);
  box-shadow: 0 0 0 0.5cqw var(--door-dark), 0 0 3cqw 0.8cqw rgba(255, 196, 90, 0.75);
}
.door-wreath { position: absolute; left: 50%; top: 51%; width: 80%; transform: translate(-50%, -50%); z-index: 1; filter: drop-shadow(0 0.4cqw 0.4cqw rgba(0, 0, 0, 0.35)); }
.door-wreath svg { width: 100%; height: auto; }
/* the door number is brass, set inside the wreath rather than on a plate */
.slot--door .tag {
  top: 49%; background: none; box-shadow: none; padding: 0; min-width: 0;
  color: #f9e3a3; font-size: 4.6cqw; text-shadow: 0 0.3cqw 0 rgba(20, 10, 0, 0.55), 0 0 1.2cqw rgba(255, 210, 120, 0.35);
}
.slot--door.is-ready:not(.is-open) .tag { background: none; color: #fff2c4; text-shadow: 0 0.3cqw 0 rgba(20, 10, 0, 0.55), 0 0 2cqw rgba(255, 210, 120, 0.95); }
.house[data-mode="friend"] .slot--door.is-empty:hover .tag { background: none; color: #fff; }
.slot--door .room { background: radial-gradient(ellipse 80% 60% at 50% 70%, #fff3cf 0%, #ffcf7a 55%, #e2903c 100%); }

/* states that invite a tap */
.house[data-mode="friend"] .is-empty .pane-face,
.house[data-mode="owner"] .is-ready .pane-face { cursor: pointer; }
.house[data-mode="friend"] .is-empty:hover .pane,
.house[data-mode="friend"] .is-empty:focus-visible .pane { transform: translateZ(2cqw) rotateY(-14deg); }
.house[data-mode="friend"] .is-empty:hover .tag { background: var(--glow); }
.house[data-mode="friend"] .is-taken { cursor: default; }

.is-ready:not(.is-open) .pane-face { animation: ready 2.2s ease-in-out infinite; }
.is-ready:not(.is-open) .tag { background: var(--glow); color: var(--glow-ink); }
/* a dark window whose day has come: openable, but no note behind it, so no pulse */
.is-ready.is-empty:not(.is-open) .pane-face { animation: none; box-shadow: 0 0 0 0.45cqw rgba(255, 219, 138, 0.55); }
@keyframes ready {
  0%, 100% { box-shadow: 0 0 0 0.5cqw rgba(255, 219, 138, 0.9), 0 0 3cqw 1cqw rgba(255, 186, 80, 0.45); }
  50% { box-shadow: 0 0 0 0.9cqw rgba(255, 219, 138, 1), 0 0 6cqw 2.2cqw rgba(255, 196, 90, 0.75); }
}
.slot--door.is-ready:not(.is-open) .pane-face { animation-name: ready-door; }
@keyframes ready-door {
  0%, 100% { box-shadow: inset 0 0 0 0.6cqw var(--door-dark), 0 0 0 0.5cqw rgba(255, 219, 138, 0.9), 0 0 3cqw 1cqw rgba(255, 186, 80, 0.45); }
  50% { box-shadow: inset 0 0 0 0.6cqw var(--door-dark), 0 0 0 0.9cqw rgba(255, 219, 138, 1), 0 0 6cqw 2.2cqw rgba(255, 196, 90, 0.75); }
}

/* lights switching on, one after another (landing page only) */
.house.is-waking .is-lit .pane-face { animation: wake 0.5s ease-out both; animation-delay: var(--wake, 0s); }
@keyframes wake {
  0% { filter: brightness(0.35) saturate(0.2); box-shadow: none; }
  60% { filter: brightness(1.25); }
  100% { filter: none; }
}

/* scenery motion */
.bulb { animation: twinkle 3.2s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.smoke circle { animation: smoke 7s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.smoke circle:nth-child(2) { animation-delay: -2.3s; }
.smoke circle:nth-child(3) { animation-delay: -4.6s; }
@keyframes smoke { 0% { transform: translate(0, 10px) scale(0.6); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(14px, -26px) scale(1.4); opacity: 0; } }

/* ---- progress string of bulbs ----------------------------------------------------- */
.bulbs { display: flex; align-items: flex-start; gap: 0; margin: 16px 0 0; position: relative; height: 22px; max-width: 420px; }
.bulbs::before { content: ""; position: absolute; left: 0; right: 0; top: 3px; height: 6px; border-top: 1.5px solid rgba(226, 234, 255, 0.35); border-radius: 50%; }
.bulbs i {
  flex: 1; position: relative; display: flex; justify-content: center; padding-top: 5px;
}
.bulbs i::before { content: ""; width: 3px; height: 3px; background: #1d1d26; position: absolute; top: 4px; }
.bulbs i::after {
  content: ""; width: 7px; height: 10px; border-radius: 45% 45% 50% 50%; background: rgba(160, 175, 210, 0.28); margin-top: 2px;
}
.bulbs i.on::after { background: var(--c, var(--glow)); box-shadow: 0 0 8px 1px var(--c, var(--glow)); }
.count { font-weight: 800; color: var(--on-night); margin-top: 6px; font-size: 0.95rem; }
.count span { color: var(--on-night-soft); font-weight: 600; }

/* ---- page sections ---------------------------------------------------------------- */
.steps { display: grid; gap: 14px; padding: 8px 0 24px; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { padding: 20px 20px 22px; border-radius: 18px; background: rgba(8, 14, 36, 0.32); border: 1px solid rgba(226, 234, 255, 0.12); }
.step h3 { font-size: 1.25rem; margin-top: 10px; }
.step p { margin: 6px 0 0; color: var(--on-night-soft); }
.step .num { font: 400 1rem/1 var(--serif); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--glow); color: var(--glow-ink); box-shadow: 0 0 18px rgba(255, 196, 90, 0.55); }
.section-title { font-size: clamp(1.6rem, 3.4vw, 2.2rem); margin: 34px 0 16px; }
.faq { max-width: 760px; padding-bottom: 20px; }
.faq details { border-top: 1px solid rgba(226, 234, 255, 0.16); padding: 14px 0; }
.faq details:last-child { border-bottom: 1px solid rgba(226, 234, 255, 0.16); }
.faq summary { cursor: pointer; font-weight: 800; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.4rem/1 var(--serif); color: var(--glow); }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 8px 0 0; color: var(--on-night-soft); max-width: 60ch; }

.foot { position: relative; z-index: 1; margin-top: 40px; color: var(--ink-soft); font-size: 0.875rem; }
.village { display: block; width: 100%; height: clamp(120px, 15vw, 210px); margin-bottom: -1px; }
.foot-snow { background: #e3ebf7; padding: 4px 0 calc(28px + env(safe-area-inset-bottom)); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.foot a { color: var(--ink); font-weight: 700; text-underline-offset: 3px; }
.step { position: relative; }
.step-sticker { position: absolute; right: 14px; top: -18px; width: 64px; height: 64px; transform: rotate(8deg); }

.notice { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 196, 90, 0.14); border: 1px solid rgba(255, 196, 90, 0.4); color: var(--on-night); font-weight: 600; }
.panel-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.badge-open { flex: none; font-size: 0.8125rem; font-weight: 800; color: var(--pine); background: #dff1e7; padding: 5px 10px; border-radius: 999px; }
.new-pill { display: inline-block; margin-left: 10px; padding: 2px 10px; border-radius: 999px; background: rgba(126, 224, 164, 0.18); color: #9df0bf; font-size: 0.8125rem; font-weight: 800; vertical-align: 1px; }
.code-card .linkbox, .code-lookup .linkbox { flex-wrap: wrap; }
.code-card .linkbox .input, .code-lookup .linkbox .input { flex: 1 1 200px; background: #fff; border-color: var(--line); font-family: var(--sans); letter-spacing: 0.06em; }
.mine-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.mine-list li { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--snow-2); }
.mine-list img { width: 40px; height: 40px; flex: none; }
.mine-list .txt { flex: 1; min-width: 0; font-size: 0.9375rem; }
.mine-list .txt b { display: block; color: var(--ink); }
.mine-list .txt span { color: var(--ink-soft); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkbox { display: flex; gap: 8px; margin-top: 12px; }
.linkbox .input { font-size: 0.9375rem; background: var(--snow-2); border-color: transparent; }

/* ---- social proof + the inline note form ------------------------------------------- */
.proof { margin: 12px 0 0; font-weight: 800; color: var(--glow-hot); }
.bookmark-tip { margin-top: 14px; display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 219, 138, 0.45); }
.bookmark-tip > .ico { width: 30px; height: 30px; flex: none; }
.bookmark-tip b { color: var(--on-night); }
.bookmark-tip p { margin: 2px 0 0; color: var(--on-night-soft); font-size: 0.9375rem; }
.bookmark-tip .btn { flex: none; }
@media (max-width: 480px) { .bookmark-tip { flex-wrap: wrap; } .bookmark-tip > div { flex: 1 1 200px; } }
.notice-today { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.notice-today .btn { flex: none; }
.fill-panel[hidden] { display: none; }
.fill-panel .sheet-head h2 { font-size: 1.5rem; }
.fill-switch { font-size: 0.8125rem; font-weight: 700; color: var(--pine) !important; margin-top: 2px !important; }
.build-own { background: #fff6dc; border-radius: 12px; padding: 10px 12px; margin-top: 14px; font-weight: 700; }
.own-ready { margin: 14px auto 0; padding: 12px 14px; border-radius: 14px; background: #fff6dc; color: var(--ink); font-weight: 700; max-width: 34ch; }
.is-selected .pane { transform: translateZ(2cqw); }
.is-selected .pane-face { animation: none !important; box-shadow: 0 0 0 0.9cqw var(--glow-hot), 0 0 5cqw 1.6cqw rgba(255, 200, 100, 0.75) !important; }
.is-selected .tag { background: var(--glow) !important; color: var(--glow-ink); }
.is-selected .plus-dot { display: none; }
@media (min-width: 900px) {
  .fill-panel { animation: rise 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
}
@media (max-width: 899px) {
  .fill-panel {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0 !important;
    max-height: 64svh; overflow: auto; border-radius: 24px 24px 0 0;
    padding-bottom: max(22px, env(safe-area-inset-bottom));
    box-shadow: 0 -24px 60px -12px rgba(0, 0, 0, 0.65);
    animation: rise 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  }
  body.filling #app > main { padding-bottom: 64svh; }
}

/* ---- home sections ---------------------------------------------------------------- */
.wall-sub { margin-top: -6px; }
.note-wall { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .note-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .note-wall { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.wall-note { position: relative; background: var(--snow); color: var(--ink); border-radius: 18px; padding: 22px 20px 18px; box-shadow: 0 18px 36px -20px rgba(0, 0, 0, 0.75); }
.wall-note:nth-child(3n + 1) { rotate: -1deg; } .wall-note:nth-child(3n + 2) { rotate: 0.7deg; } .wall-note:nth-child(3n) { rotate: -0.4deg; }
.wall-note img { position: absolute; right: 12px; top: -22px; width: 58px; height: 58px; rotate: 8deg; }
.wall-note p { margin: 0; font: 400 1.125rem/1.5 var(--serif); padding-right: 30px; }
.wall-note span { display: block; margin-top: 12px; font-weight: 800; font-size: 0.875rem; color: var(--pine); }
.usecases { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .usecases { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .usecases { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.usecase { padding: 20px; border-radius: 18px; background: rgba(8, 14, 36, 0.32); border: 1px solid rgba(226, 234, 255, 0.12); }
.usecase img { width: 54px; height: 54px; }
.usecase h3 { font-size: 1.2rem; margin-top: 10px; }
.usecase p { margin: 6px 0 0; color: var(--on-night-soft); }
.whys { list-style: none; padding: 0; margin: 0; display: grid; gap: 0 40px; grid-template-columns: minmax(0, 1fr); max-width: 980px; }
@media (min-width: 760px) { .whys { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.whys li { padding: 16px 0 16px 34px; border-top: 1px solid rgba(226, 234, 255, 0.14); position: relative; }
.whys li::before { content: ""; position: absolute; left: 4px; top: 22px; width: 14px; height: 14px; border-radius: 4px; background: var(--glow); box-shadow: 0 0 14px rgba(255, 196, 90, 0.8); }
.whys h3 { font-size: 1.2rem; }
.whys p { margin: 4px 0 0; color: var(--on-night-soft); max-width: 46ch; }

/* ---- static pages (help, ideas, privacy, terms) ------------------------------------ */
.prose { max-width: 820px; padding-block: 28px 20px; }
.prose > .lede { margin-bottom: 8px; }
.prose h2 { font-size: clamp(1.4rem, 3vw, 1.75rem); line-height: 1.2; margin: 40px 0 10px; }
.prose p, .prose li { color: var(--on-night-soft); max-width: 66ch; }
.prose li + li { margin-top: 8px; }
.prose a:not(.btn):not(.chip-btn) { color: var(--glow-hot); text-underline-offset: 3px; }
.prose b { color: var(--on-night); }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.idea-group h2 { display: flex; align-items: center; gap: 12px; }
.idea-group h2 img { width: 56px; height: 56px; flex: none; }
.idea-grid { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 680px) { .idea-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.idea-card { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; background: var(--snow); color: var(--ink); border-radius: 16px; padding: 16px 18px 14px; box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.7); }
.idea-card:nth-child(4n + 1) { rotate: -0.6deg; } .idea-card:nth-child(4n + 2) { rotate: 0.5deg; } .idea-card:nth-child(4n + 3) { rotate: 0.4deg; } .idea-card:nth-child(4n) { rotate: -0.3deg; }
.prose .idea-card p { margin: 0; color: var(--ink); font: 400 1.0625rem/1.5 var(--serif); }
.idea-copy { align-self: flex-end; border: 0; background: var(--snow-2); color: var(--ink-soft); border-radius: 999px; padding: 4px 11px; font-size: 0.75rem; font-weight: 800; cursor: pointer; transition: background 0.15s, color 0.15s; }
.idea-copy:hover { background: var(--line); color: var(--ink); }
.code-lookup { margin-top: 24px; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; background: rgba(226, 234, 255, 0.12); padding: 2px 6px; border-radius: 6px; color: var(--on-night); }
.idea-tips ol { padding-left: 1.2em; }
.cta-card { margin-top: 40px; }
.prose .card h2 { margin: 0; font-size: 1.35rem; line-height: 1.2; color: var(--ink); }
.prose .card p { color: var(--ink-soft); }
.prose .card li, .prose .card b { color: var(--ink); }
.prose .card li + li { margin-top: 0; }
.prose .card a:not(.btn):not(.chip-btn) { color: var(--pine); }
.help-faq { margin-top: 24px; }
.help-faq details p { color: var(--on-night-soft); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { font-weight: 700; }

/* ---- house password ----------------------------------------------------------------- */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.ico-cal { width: 1.45em; height: 1.45em; vertical-align: -0.35em; margin-right: 2px; }
.card h2 .ico, .unlock-fold summary .ico { width: 1em; height: 1em; color: var(--pine); margin-right: 2px; }
/* the address is for friends (cool, shareable); the key is the owner's (warm brass, keep it safe) */
.badge { display: inline-block; vertical-align: 3px; margin-left: 6px; padding: 3px 9px; border-radius: 999px; font: 800 0.75rem/1.2 var(--sans); letter-spacing: 0.01em; }
.badge-friends { background: #e3ecfb; color: #2c4f8f; }
.badge-you { background: #f6e3b4; color: #6b4310; }
.card.address h2, .card.keep h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.card.address h2 .badge, .card.keep h2 .badge { margin-left: 0; vertical-align: 0; }
.card.address h2 .ico { color: #2c5a96; }
.addr-row { margin-top: 14px; }
.addr-label { display: block; font-size: 0.8125rem; font-weight: 800; color: var(--ink-soft); margin-bottom: 6px; }
.addr-hint { display: block; font-size: 0.8125rem; color: var(--ink-soft); margin-top: 4px; }
.addr-row .linkbox { margin-top: 0; }
.code-line { display: flex; align-items: center; gap: 12px; }
.house-code { font: 400 1.6rem/1.1 var(--serif); letter-spacing: 0.14em; color: #2c4f8f; background: #eef3fc; border-radius: 12px; padding: 8px 14px; }
.qr-row { display: flex; gap: 14px; align-items: center; }
.qr-thumb { flex: none; padding: 6px; border: 0; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1.5px var(--line) inset, 0 8px 20px -14px rgba(0, 0, 0, 0.5); cursor: zoom-in; }
.qr-thumb img { display: block; width: 112px; height: 112px; }
.card.keep { background: #fffaf0; box-shadow: inset 0 0 0 1.5px #ecd9a8, 0 24px 50px -24px rgba(0, 0, 0, 0.65); }
.card.keep h2 .ico { color: #b07a1c; }
.key-tag {
  margin-top: 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 16px 18px 14px; border-radius: 14px; background: linear-gradient(180deg, #ffe7a6, #f6c862);
  box-shadow: inset 0 0 0 1.5px rgba(120, 76, 10, 0.25), 0 6px 16px -10px rgba(120, 76, 10, 0.7);
}
.key-tag { container-type: inline-size; }
/* the key stays on one line: the type shrinks to fit long keys instead of breaking at a dash */
.key-val { font: 400 min(1.75rem, calc(100cqw / (var(--len, 16) * 0.64))) / 1.15 var(--serif); color: #3a2306; white-space: nowrap; min-width: 0; }
.key-tag .mini-btn { background: rgba(255, 255, 255, 0.75); }
.key-how { font-weight: 600; color: var(--ink) !important; margin-top: 12px !important; }
.mini-btn { flex: none; border: 0; background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: 0.8125rem; color: var(--ink); cursor: pointer; box-shadow: 0 0 0 1.5px var(--line) inset; }
.mini-btn:hover { box-shadow: 0 0 0 1.5px #9fb0d0 inset; }
.fine-left { font-size: 0.8125rem; margin-top: 10px !important; }
.unlock .btn[type=submit] { margin-top: 2px; }
.unlock-fold summary { cursor: pointer; font: 400 1.2rem/1.2 var(--serif); list-style: none; display: flex; align-items: center; gap: 6px; }
.unlock-fold summary::-webkit-details-marker { display: none; }
.unlock-fold summary::after { content: "+"; margin-left: auto; font-size: 1.4rem; color: var(--pine); }
.unlock-fold[open] summary::after { content: "\2013"; }
.nokey .card { text-align: left; max-width: 520px; margin: 0 auto; }
.welcome-label { margin: 16px 0 0 !important; font-weight: 800; font-size: 0.875rem; color: var(--ink) !important; }
.welcome-label .ico { color: #2c5a96; }
.welcome-pass { margin: 14px 0 0 !important; padding: 12px 14px; border-radius: 14px; background: #fff3d6; box-shadow: inset 0 0 0 1.5px #ecd9a8; color: var(--ink) !important; font-weight: 600; }
.welcome-pass .ico { color: #b07a1c; }
.welcome-pass b { font-family: var(--serif); font-weight: 400; font-size: 1.1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chips-label { width: 100%; font-size: 0.8125rem; font-weight: 700; color: var(--ink-soft); }
.chip { border: 0; background: var(--snow-2); color: var(--ink); border-radius: 999px; padding: 7px 12px; font-size: 0.875rem; font-weight: 600; cursor: pointer; text-align: left; }
.chip:hover { background: #dfe8f4; }

/* ---- dialogs ---------------------------------------------------------------------- */
dialog {
  border: 0; padding: 0; background: transparent; color: var(--ink); max-width: 460px; width: calc(100% - 24px);
  margin: auto; overflow: visible;
}
dialog::backdrop { background: rgba(4, 8, 24, 0.62); backdrop-filter: blur(3px); }
dialog[open] .sheet { animation: rise 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
@keyframes rise { from { transform: translateY(24px) scale(0.98); opacity: 0; } }
.sheet { background: var(--snow); border-radius: 24px; padding: 22px; max-height: calc(100dvh - 32px); overflow: auto; color-scheme: light; position: relative; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet-head h2 { font-size: 1.6rem; line-height: 1.15; }
.sheet-head p { margin: 4px 0 0; color: var(--ink-soft); text-wrap: pretty; }
.x { border: 0; background: var(--snow-2); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; flex: none; font-size: 1.2rem; line-height: 1; color: var(--ink); }
.x:hover { background: var(--line); }
@media (max-width: 560px) {
  dialog { width: 100%; max-width: none; margin: auto 0 0; }
  .sheet { border-radius: 24px 24px 0 0; padding-bottom: max(22px, env(safe-area-inset-bottom)); max-height: 92dvh; }
}

.stickers { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 8px; }
.sticker-opt { position: relative; cursor: pointer; }
.sticker-opt input { position: absolute; opacity: 0; inset: 0; }
.sticker-opt span { display: block; border-radius: 14px; padding: 3px; border: 2px solid transparent; transition: transform 0.15s, background 0.15s; }
.sticker-opt img { width: 100%; height: auto; }
.sticker-opt:hover span { transform: translateY(-2px) rotate(-4deg); }
.sticker-opt input:checked + span { border-color: var(--ink); background: #fff; transform: scale(1.04); }
.sticker-opt input:focus-visible + span { outline: 3px solid #7e93c2; }

/* reveal */
.reveal { text-align: center; padding-top: 6px; position: relative; }
.reveal .big { width: 132px; height: 132px; margin: 0 auto; position: relative; z-index: 1; animation: pop 0.7s cubic-bezier(0.2, 1.7, 0.4, 1); }
.burst {
  position: absolute; left: 50%; top: 72px; width: 300px; height: 300px; margin: -150px 0 0 -150px; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 196, 90, 0.34) 0deg 7deg, transparent 7deg 22.5deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 68%); mask: radial-gradient(circle, #000 18%, transparent 68%);
  border-radius: 50%; animation: burst-in 0.9s ease-out both, spin 26s linear infinite;
}
.burst.cool { background: repeating-conic-gradient(from 0deg, rgba(126, 160, 220, 0.3) 0deg 7deg, transparent 7deg 22.5deg); }
@keyframes burst-in { from { transform: scale(0.2); opacity: 0; } }
@keyframes spin { to { rotate: 360deg; } }
@keyframes pop { from { transform: scale(0.3) rotate(-20deg); opacity: 0; } }
.reveal .eyebrow { font-weight: 800; color: var(--ink-soft); margin-top: 6px; font-size: 0.9375rem; }
.note {
  font: 400 1.3rem/1.5 var(--serif); color: var(--ink); margin: 14px auto 0; max-width: 26ch;
  white-space: pre-wrap; overflow-wrap: anywhere; text-wrap: pretty;
}
.from { margin-top: 12px; font-weight: 800; color: var(--pine); }
.reveal .row { justify-content: center; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 50;
  background: #fff; color: var(--ink); padding: 12px 20px; border-radius: 18px; font-weight: 700; line-height: 1.4;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.6); transition: transform 0.35s cubic-bezier(0.2, 1.5, 0.4, 1), opacity 0.25s;
  width: max-content; max-width: min(480px, calc(100vw - 32px)); text-align: center; text-wrap: balance; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

.story-preview { width: 100%; max-width: 260px; margin: 12px auto 0; border-radius: 18px; box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.5); }

.center-msg { text-align: center; padding: 80px 0; }
.center-msg .title { margin-bottom: 12px; }

.skeleton { width: 100%; max-width: 480px; aspect-ratio: 400 / 672; border-radius: 24px; background: rgba(255, 255, 255, 0.05); }

/* ---- sound switch ------------------------------------------------------------------ */
.sound-btn { padding: 6px 9px; }
.sound-btn svg { width: 18px; height: 18px; }
.sound-btn .waves { transition: opacity 0.2s; }
.sound-btn[aria-pressed="false"] .waves { opacity: 0; }
.sound-btn .slash { opacity: 0; transition: opacity 0.2s; }
.sound-btn[aria-pressed="false"] .slash { opacity: 1; }
.sound-btn[aria-pressed="false"] { color: var(--on-night-soft); }
@media (max-width: 400px) {
  .topbar { gap: 6px; }
  .top-actions { gap: 5px; }
  .top-actions .chip-btn { padding: 6px 10px; white-space: nowrap; }
  .sound-btn { padding: 5px 7px; }
  .lang-pill a, .lang-pill button, .lang-pill span { padding: 5px 6px; }
  .brand { gap: 7px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-name { font-size: 1.15rem; }
}
@media (max-width: 370px) { .topbar:has(.chip-btn:not(.hide-xs)) .brand-name { display: none; } }

/* ---- small motion: sparks, nudges, fresh lights ---------------------------------- */
.sparks { position: absolute; width: 0; height: 0; pointer-events: none; z-index: 5; }
.sparks i {
  position: absolute; left: calc(var(--s) / -2); top: calc(var(--s) / -2); width: var(--s); height: var(--s);
  border-radius: 50%; background: var(--c); box-shadow: 0 0 6px 1px var(--c);
  opacity: 0; animation: spark 0.95s cubic-bezier(0.15, 0.7, 0.3, 1) var(--dl, 0s) forwards;
}
.sparks i.star {
  border-radius: 0; box-shadow: none; filter: drop-shadow(0 0 3px var(--c));
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  width: calc(var(--s) * 2); height: calc(var(--s) * 2); left: calc(var(--s) * -1); top: calc(var(--s) * -1);
}
@keyframes spark {
  0% { opacity: 1; transform: translate(0, 0) scale(0.3) rotate(0deg); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 10px)) scale(1) rotate(90deg); }
}

/* a closed window that isn't ready yet gives a little rattle */
.slot.is-nudge .pane { animation: nudge 0.45s ease-in-out; }
@keyframes nudge {
  0%, 100% { transform: none; }
  20% { transform: rotateY(-16deg); }
  45% { transform: rotateY(8deg); }
  70% { transform: rotateY(-4deg); }
}

/* a window that has just been lit by you */
.slot.is-just-lit .pane-face { animation: just-lit 1.4s ease-out both; }
@keyframes just-lit {
  0% { filter: brightness(0.3) saturate(0.2); box-shadow: none; }
  35% { filter: brightness(1.7); box-shadow: 0 0 0 0.9cqw var(--glow-hot), 0 0 9cqw 3cqw rgba(255, 200, 100, 0.9); }
  100% { filter: none; box-shadow: 0 0 0 0 transparent; }
}

/* fresh bulbs on the progress string */
.bulbs i.fresh::after { animation: bulb-on 0.7s cubic-bezier(0.2, 1.6, 0.4, 1) both; animation-delay: calc(0.35s + var(--i, 0) * 0.14s); }
@keyframes bulb-on {
  0% { background: rgba(160, 175, 210, 0.28); box-shadow: none; transform: scale(0.6); }
  50% { transform: scale(1.5); box-shadow: 0 0 16px 4px var(--c, var(--glow)); }
  100% { transform: scale(1); }
}

/* the note unfolds a beat after its sticker pops */
.reveal > :is(.eyebrow, .note, .from, h2, .sub, .own-ready, .row, .btn-quiet) { animation: fade-up 0.5s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
.reveal > .eyebrow { animation-delay: 0.2s; }
.reveal > :is(.note, h2) { animation-delay: 0.32s; }
.reveal > :is(.from, .sub) { animation-delay: 0.5s; }
.reveal > .own-ready { animation-delay: 0.58s; }
.reveal > :is(.row, .btn-quiet) { animation-delay: 0.66s; }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } }

.sticker-opt input:checked + span { animation: pick 0.4s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes pick { 0% { transform: scale(0.85) rotate(-8deg); } }
.theme-opt input:checked + .swatch { animation: pick-soft 0.35s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes pick-soft { 0% { transform: scale(0.94); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
