/* =====================================================================
   Birthday Countdown — design system
   Reference: a sheet of party stickers + a paper invitation.
   Memory point: the candle-topped countdown number and sticker-outlined gift boxes.
   ===================================================================== */

/* ---------- 1. tokens ---------- */
:root {
  --bg: #fff4e8;
  --surface: #ffffff;
  --text: #2a1533;
  --muted: #6e5a73;
  --primary: #ff4f8b;
  --primary-deep: #d62e6a;
  --accent: #ffc53d;
  --ink: #2a1533;
  --line: rgb(42 21 51 / 0.12);
  --line-strong: rgb(42 21 51 / 0.22);
  --primary-soft: #ffe1ec;
  --accent-soft: #fff1c9;

  /* illustration-only colors (stickers, confetti, wrapping) */
  --mint: #3ccfae;
  --sky: #6fb6ff;
  --lilac: #b497ff;
  --flame: #ff8a3d;

  /* gift wrapping (per theme) */
  --wrap-a: #ff8fb5;
  --wrap-b: #ffd3e2;
  --ribbon: #ffc53d;
  --stage: linear-gradient(170deg, #ffe7f0 0%, #fff4e8 60%);

  --radius: 18px;
  --radius-sm: 12px;
  --pop: 3px 4px 0 var(--ink);
  --pop-sm: 2px 3px 0 var(--ink);
  --soft: 0 22px 48px rgb(42 21 51 / 0.14);

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;

  --fs-xs: 13px; --fs-sm: 15px; --fs-md: 17px; --fs-lg: 20px;
  --fs-xl: 26px; --fs-2xl: 36px; --fs-3xl: 52px; --fs-4xl: 76px;

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --font-hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;
}

[data-theme="lemonade"] {
  --bg: #fff8e3;
  --primary: #f0508a;
  --wrap-a: #ffd54a;
  --wrap-b: #fff2b8;
  --ribbon: #3ccfae;
  --stage: linear-gradient(170deg, #fff0b8 0%, #fff8e3 62%);
}

[data-theme="midnight"] {
  --bg: #1a1233;
  --surface: #271d4a;
  --text: #fff4e8;
  --muted: #c3b6dc;
  --ink: #0d0820;
  --line: rgb(255 244 232 / 0.14);
  --line-strong: rgb(255 244 232 / 0.28);
  --primary: #ff5c9a;
  --primary-deep: #ff86b3;
  --primary-soft: #3a2560;
  --accent-soft: #3b2e5e;
  --wrap-a: #7b67ff;
  --wrap-b: #a596ff;
  --ribbon: #ffc53d;
  --stage: radial-gradient(1.5px 1.5px at 12% 18%, #fff8 50%, transparent 51%),
           radial-gradient(1.5px 1.5px at 78% 9%, #fff9 50%, transparent 51%),
           radial-gradient(1px 1px at 52% 34%, #fff7 50%, transparent 51%),
           radial-gradient(1.5px 1.5px at 90% 62%, #fff6 50%, transparent 51%),
           radial-gradient(1px 1px at 30% 70%, #fff8 50%, transparent 51%),
           linear-gradient(170deg, #2b1d57 0%, #1a1233 70%);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-md)/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-deep); }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0 0 var(--space-3);
}
h1 { font-size: clamp(40px, 6vw, var(--fs-4xl)); font-weight: 800; }
h2 { font-size: clamp(30px, 4vw, var(--fs-3xl)); font-weight: 800; }
h3 { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 var(--space-4); text-wrap: pretty; }
::selection { background: var(--primary-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.tnum { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: 999px; z-index: 50; }
.skip:focus { left: 12px; }
[hidden] { display: none !important; }

/* ---------- 2. layout & controls ---------- */
.wrap { max-width: 1180px; margin-inline: auto; padding-inline: 20px; }
.wrap-text { max-width: 760px; margin-inline: auto; padding-inline: 20px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 var(--space-3);
  font: 700 var(--fs-xs)/1.2 var(--font-body);
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary-deep);
}

.btn, .btn-main, .btn-soft {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px;
  border-radius: 999px; border: 2px solid var(--ink);
  font: 700 var(--fs-sm)/1.1 var(--font-body);
  color: var(--text); background: var(--surface);
  text-decoration: none; cursor: pointer;
  box-shadow: var(--pop-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn:hover, .btn-main:hover, .btn-soft:hover { transform: translateY(-1px); box-shadow: 3px 5px 0 var(--ink); color: inherit; }
.btn:active, .btn-main:active, .btn-soft:active { transform: translate(2px, 2px); box-shadow: 0 1px 0 var(--ink); }
.btn-main { background: var(--primary); color: #fff; min-height: 54px; padding-inline: 26px; font-size: var(--fs-md); }
.btn-main:hover { color: #fff; }
.btn-main.big { min-height: 60px; font-size: var(--fs-lg); padding-inline: 32px; }
.btn-main[disabled], .btn[disabled] { opacity: 0.6; cursor: progress; transform: none; }
.btn-soft { background: var(--accent-soft); }
.btn svg, .btn-main svg, .btn-soft svg { width: 20px; height: 20px; flex: none; }
.link-btn {
  background: none; border: 0; padding: 4px 2px; cursor: pointer;
  color: var(--muted); font: 600 var(--fs-sm)/1.3 var(--font-body);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong);
}
.link-btn:hover { color: var(--primary-deep); }

.field { display: grid; gap: 6px; }
.field > span, .label { font: 700 var(--fs-sm)/1.2 var(--font-body); color: var(--text); }
.field small { color: var(--muted); font-size: var(--fs-xs); }
input[type="text"], input[type="number"], input[type="email"], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 2px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: 500 var(--fs-md)/1.3 var(--font-body);
  transition: border-color 150ms ease, box-shadow 150ms ease;
  appearance: none; -webkit-appearance: none;
}
select {
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1.5 1.5 7 7l5.5-5.5' fill='none' stroke='%236e5a73' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }

.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--surface);
}
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span {
  display: flex; align-items: center; justify-content: center; min-height: 40px;
  border-radius: 999px; font: 700 var(--fs-sm)/1 var(--font-body); color: var(--muted);
  transition: background-color 160ms ease, color 160ms ease;
}
.seg input:checked + span { background: var(--text); color: var(--bg); }
.seg input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 16px;
  border: 2px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  font: 700 var(--fs-sm)/1 var(--font-body); color: var(--text);
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}
.chip input:checked + span { border-color: var(--ink); background: var(--accent); box-shadow: var(--pop-sm); }
.chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.chip span:hover { transform: translateY(-1px); }

.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.swatch { position: relative; }
.swatch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; }
.swatch span {
  display: grid; gap: 6px; justify-items: center; padding: 10px 6px 8px;
  border: 2px solid var(--line-strong); border-radius: 14px; background: var(--surface);
  font: 700 var(--fs-xs)/1 var(--font-body); color: var(--text);
  transition: border-color 160ms ease, transform 160ms ease;
}
.swatch i {
  width: 34px; height: 34px; border-radius: 10px; border: 2px solid #2a1533;
  background: repeating-linear-gradient(135deg, var(--sa) 0 6px, var(--sb) 6px 12px);
  position: relative;
}
.swatch i::after { content: ""; position: absolute; inset: 0 40%; background: var(--sr); border-inline: 1.5px solid #2a1533; }
.swatch input:checked + span { border-color: var(--ink); box-shadow: var(--pop-sm); transform: translateY(-1px); }
.swatch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: var(--fs-sm); color: var(--text); }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--primary); flex: none; cursor: pointer; }

.form-error { margin: 0; color: #c0123f; font-weight: 600; font-size: var(--fs-sm); min-height: 1em; }
[data-theme="midnight"] .form-error { color: #ff9fbf; }

/* ---------- 3. site chrome ---------- */
.top { position: relative; z-index: 5; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 800 19px/1 var(--font-display); letter-spacing: -0.02em; color: var(--text); }
.brand svg { width: 36px; height: 36px; }
.brand b { color: var(--primary); font-weight: 800; }
.top-nav { display: flex; align-items: center; gap: 22px; font-weight: 600; font-size: var(--fs-sm); }
.top-nav a { text-decoration: none; color: var(--muted); }
.top-nav a:hover { color: var(--text); }
.top-nav .btn { min-height: 40px; padding: 8px 16px; color: var(--text); }

.bottom { border-top: 1px solid var(--line); margin-top: var(--space-8); padding: 48px 0 40px; color: var(--muted); font-size: var(--fs-sm); }
.bottom-in { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.bottom h4 { font: 700 var(--fs-sm)/1.2 var(--font-body); color: var(--text); letter-spacing: 0; margin-bottom: 12px; }
.bottom ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bottom a { text-decoration: none; }
.bottom a:hover { text-decoration: underline; }
.bottom-small { margin-top: 32px; font-size: var(--fs-xs); }

/* ---------- 4. hero & maker ---------- */
.hero { position: relative; padding: 8px 0 72px; }
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 620px; z-index: -1;
  background:
    radial-gradient(600px 320px at 85% 10%, rgb(255 79 139 / 0.14), transparent 70%),
    radial-gradient(520px 300px at 10% 0%, rgb(255 197 61 / 0.18), transparent 70%);
}
.hero-in { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 48px; align-items: start; }
.hero h1 { margin: 6px 0 12px; }
.hero h1 .sub { display: block; font-size: 0.5em; font-weight: 700; letter-spacing: -0.01em; color: var(--primary-deep); margin-top: 6px; }
.lede { font-size: var(--fs-lg); color: var(--muted); max-width: 34ch; margin-bottom: 24px; }

.maker {
  position: relative; display: grid; gap: 18px; padding: 24px;
  background: var(--surface); border: 2px solid var(--ink); border-radius: 24px; box-shadow: var(--pop);
}
.maker .btn-main { width: 100%; }
.maker-note { margin: -4px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.maker-note b { color: var(--text); }
.maker-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: var(--fs-sm); color: var(--muted); }
.maker-foot a { font-weight: 600; }

.mine-list { display: grid; gap: 8px; margin-top: 18px; }
.mine-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px;
  border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--surface); text-decoration: none; font-weight: 600;
}
.mine-list a small { color: var(--muted); font-weight: 500; }

.stage {
  position: sticky; top: 16px;
  border: 2px solid var(--ink); border-radius: 28px; box-shadow: var(--soft);
  background: var(--stage); padding: 28px 24px 24px; overflow: hidden;
  color: var(--text);
}
.stage-deco { position: absolute; width: 46px; height: 46px; pointer-events: none; opacity: 0.95; }
.stage-deco.d1 { top: 18px; right: 22px; transform: rotate(14deg); }
.stage-deco.d2 { bottom: 112px; left: -6px; transform: rotate(-18deg); width: 38px; }
.stage-deco.d3 { top: 46%; right: -8px; transform: rotate(8deg); width: 34px; }

/* ---------- 5. countdown number (memory point) ---------- */
.board-head { text-align: center; margin-bottom: 18px; }
.board-for { margin: 0; font: 700 var(--fs-sm)/1.2 var(--font-body); color: var(--muted); letter-spacing: 0.02em; }
.board-title { font: 800 clamp(24px, 3vw, 32px)/1.1 var(--font-display); letter-spacing: -0.02em; margin: 4px 0 10px; color: var(--text); overflow-wrap: anywhere; }
.counter { display: inline-grid; justify-items: center; gap: 2px; }
.counter-num {
  position: relative; display: inline-block;
  font: 800 clamp(84px, 11vw, 132px)/0.86 var(--font-display);
  letter-spacing: -0.05em; font-variant-numeric: tabular-nums;
  color: var(--text);
  -webkit-text-stroke: 0;
  text-shadow: 4px 5px 0 var(--primary);
  padding-top: 34px;
}
.counter-num .candle {
  position: absolute; top: -6px; left: 50%; width: 22px; height: 46px; transform: translateX(-50%);
}
.counter-unit { font: 800 var(--fs-lg)/1.1 var(--font-display); letter-spacing: -0.01em; margin-top: 8px; }
.counter-clock { font: 700 var(--fs-sm)/1 var(--font-body); color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.counter-date {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 6px 12px;
  border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line-strong);
  font: 700 var(--fs-xs)/1 var(--font-body); color: var(--text);
}
.flame { transform-origin: 50% 90%; animation: flicker 1.6s ease-in-out infinite; }
.flame-in { transform-origin: 50% 90%; animation: flicker 1.1s ease-in-out infinite reverse; }
@keyframes flicker {
  0%, 100% { transform: scale(1, 1) rotate(-2deg); }
  30% { transform: scale(0.92, 1.08) rotate(3deg); }
  60% { transform: scale(1.05, 0.94) rotate(-1deg); }
}

/* ---------- 6. doors ---------- */
.doors { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 16px 12px; }
.stage .doors { grid-template-columns: repeat(5, 1fr); gap: 14px 10px; }
.door {
  position: relative; display: grid; gap: 7px; justify-items: center;
  padding: 0; border: 0; background: none; color: inherit; cursor: pointer; font: inherit;
  -webkit-tap-highlight-color: transparent;
}
.door[disabled] { cursor: default; }
.door-box {
  position: relative; width: 100%; aspect-ratio: 1;
  border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: var(--pop-sm);
  background: repeating-linear-gradient(135deg, var(--wrap-a) 0 9px, var(--wrap-b) 9px 18px);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.door-box::before, .door-box::after { content: ""; position: absolute; background: var(--ribbon); }
.door-box::before { left: 50%; top: -1px; bottom: -1px; width: 14%; transform: translateX(-50%); border-inline: 2px solid var(--ink); }
.door-box::after { top: 50%; left: -1px; right: -1px; height: 14%; transform: translateY(-50%); border-block: 2px solid var(--ink); }
.door-bow { position: absolute; top: -15px; left: 50%; width: 38%; transform: translateX(-50%); z-index: 2; }
.door-num {
  position: absolute; top: -9px; left: -9px; z-index: 3;
  min-width: 26px; height: 26px; padding: 0 6px; display: grid; place-items: center;
  border-radius: 999px; background: var(--surface); border: 2px solid var(--ink);
  font: 800 12px/1 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums;
}
.door-seal {
  position: absolute; left: 50%; top: 50%; width: 58%; aspect-ratio: 1; transform: translate(-50%, -50%); z-index: 2;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); display: grid; place-items: center;
}
.door-seal svg { width: 76%; height: 76%; }
.door-lock { position: absolute; right: -7px; bottom: -7px; z-index: 3; width: 24px; height: 24px; }
.door-cap {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 700 12px/1.1 var(--font-body); color: var(--muted);
}
.door-cap b { color: var(--text); }

.door:not([disabled]):hover .door-box { transform: translateY(-2px) rotate(-2deg); box-shadow: 3px 5px 0 var(--ink); }
.door.is-empty .door-box {
  background: var(--surface); border-style: dashed; border-color: var(--line-strong); box-shadow: none;
  display: grid; place-items: center;
}
.door.is-empty .door-box::before, .door.is-empty .door-box::after { display: none; }
.door.is-empty .door-plus { font: 800 26px/1 var(--font-display); color: var(--muted); }
.door.is-empty:not([disabled]):hover .door-box { border-color: var(--primary); border-style: solid; }
.door.is-empty:not([disabled]):hover .door-plus { color: var(--primary); }
.door.is-mine .door-box { box-shadow: 0 0 0 4px var(--accent), var(--pop-sm); }
.door.is-ready .door-box { animation: wiggle 2.4s ease-in-out infinite; box-shadow: 0 0 0 4px var(--accent), var(--pop-sm); }
.door.is-ready .door-cap b { color: var(--primary-deep); }
.door.is-opened .door-box {
  background:
    repeating-linear-gradient(180deg, transparent 0 13px, var(--line) 13px 14px),
    var(--surface);
}
.door.is-opened .door-box::before, .door.is-opened .door-box::after { display: none; }
.door.is-opened .door-bow { display: none; }
.door.is-pop .door-box { animation: popin 520ms cubic-bezier(.2, 1.6, .4, 1); }
@keyframes wiggle {
  0%, 82%, 100% { transform: rotate(0); }
  86% { transform: rotate(-6deg); }
  90% { transform: rotate(5deg); }
  94% { transform: rotate(-3deg); }
}
@keyframes popin {
  0% { transform: scale(0.6) rotate(-8deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ---------- 7. cake ---------- */
.cake-wrap { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; margin-top: 26px; padding-top: 22px; border-top: 2px dashed var(--line-strong); }
.cake-art { width: 132px; }
.cake-art svg { width: 100%; height: auto; overflow: visible; }
.cake-copy h3 { margin: 0 0 4px; font-size: var(--fs-lg); }
.cake-copy p { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.candle-out .flame, .candle-out .flame-in { animation: blowout 420ms ease forwards; }
@keyframes blowout { to { transform: scale(0.1, 0.2) translateY(-6px); opacity: 0; } }
.smoke { opacity: 0; }
.candle-out .smoke { animation: smoke 1.4s ease-out forwards; }
@keyframes smoke { 0% { opacity: 0.7; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-18px) scale(1.6); } }

/* ---------- 8. content sections ---------- */
.sec { padding: 96px 0 0; }
.sec-head { max-width: 760px; margin-bottom: 40px; }
.sec-head p { color: var(--muted); font-size: var(--fs-lg); max-width: 60ch; }

.how-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; counter-reset: step; }
.how-item { display: grid; gap: 18px; align-content: start; }
.phone {
  position: relative; margin: 0; padding: 8px; border-radius: 34px; background: #1d1424;
  box-shadow: 0 0 0 1px #0d0912, 0 1px 0 1px rgb(255 255 255 / 0.1) inset, 0 24px 44px rgb(42 21 51 / 0.24);
}
.phone::before {
  content: ""; position: absolute; top: 15px; left: 50%; width: 72px; height: 20px; transform: translateX(-50%);
  background: #1d1424; border-radius: 999px; z-index: 2;
}
.phone img { width: 100%; height: auto; aspect-ratio: 600 / 1298; object-fit: cover; object-position: top; border-radius: 27px; background: var(--bg); }
.how-txt h3 { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.how-txt h3::before {
  counter-increment: step; content: counter(step);
  display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--ink); font: 800 14px/1 var(--font-display);
}
.how-txt p { color: var(--muted); font-size: var(--fs-sm); margin: 0; }

.feat-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.feat { padding: 28px 26px 30px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.feat svg { width: 48px; height: 48px; margin-bottom: 16px; }
.feat h3 { margin-bottom: 6px; }
.feat p { margin: 0; color: var(--muted); font-size: var(--fs-sm); }

.guide { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 56px; align-items: start; }
.toc { position: sticky; top: 24px; display: grid; gap: 4px; font-size: var(--fs-sm); }
.toc p { margin: 0 0 8px; }
.toc a { display: block; padding: 6px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600; border-left: 2px solid transparent; }
.toc a:hover { color: var(--text); background: var(--surface); }
.prose { max-width: 70ch; font-size: 18px; }
.prose h2 { font-size: clamp(26px, 3vw, 36px); margin-top: 56px; scroll-margin-top: 24px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 28px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 18px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--primary); font-weight: 800; }
.prose figure { margin: 28px 0; }
.prose figcaption { font-size: var(--fs-sm); color: var(--muted); margin-top: 10px; }
.prose .callout { padding: 18px 20px; border-radius: var(--radius); background: var(--accent-soft); border: 1.5px solid var(--line-strong); }
.prose .callout p:last-child { margin: 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; margin: 28px 0; }
.pair .phone { max-width: 290px; justify-self: center; }

.ideas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 56px; counter-reset: idea; }
.ideas li { display: grid; grid-template-columns: 72px 1fr; gap: 6px 14px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.ideas li::before {
  counter-increment: idea; content: counter(idea, decimal-leading-zero);
  grid-row: span 2; font: 800 44px/1 var(--font-display); color: var(--primary); opacity: 0.32; letter-spacing: -0.04em;
}
.ideas h3 { margin: 0; font-size: var(--fs-md); }
.ideas p { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.ideas q { font-family: var(--font-hand); font-size: 22px; color: var(--text); quotes: "“" "”"; }

.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 4px;
  cursor: pointer; list-style: none; font: 700 var(--fs-md)/1.35 var(--font-body);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+"; flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--ink); font: 800 18px/1 var(--font-display); transition: transform 200ms ease, background-color 200ms ease;
}
.faq-list details[open] summary::after { transform: rotate(45deg); background: var(--accent); }
.faq-list details p { padding: 0 4px 20px; margin: 0; color: var(--muted); max-width: 70ch; }

.cta { margin-top: 96px; }
.cta-in {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center;
  padding: 48px; border-radius: 32px; border: 2px solid var(--ink); box-shadow: var(--pop);
  background:
    radial-gradient(4px 4px at 12% 22%, var(--accent) 60%, transparent 62%),
    radial-gradient(3px 3px at 30% 80%, #fff 60%, transparent 62%),
    radial-gradient(4px 4px at 62% 14%, var(--mint) 60%, transparent 62%),
    radial-gradient(3px 3px at 52% 70%, var(--accent) 60%, transparent 62%),
    radial-gradient(4px 4px at 86% 88%, #fff 60%, transparent 62%),
    var(--primary);
  color: #fff;
}
.cta-in h2 { color: #fff; margin-bottom: 8px; }
.cta-in p { margin: 0 0 22px; font-size: var(--fs-lg); max-width: 44ch; color: #fff; opacity: 0.95; }
.cta-in .btn-main { background: var(--accent); color: var(--text); }
.cta-in .btn-main:hover { color: var(--text); }
.cta-art { width: 220px; }

.talk-form { display: grid; gap: 14px; padding: 22px; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); margin-bottom: 24px; }
.talk-form .row { grid-template-columns: 1fr; }
.talk-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.c { padding: 18px 0; border-bottom: 1px solid var(--line); }
.c-head { display: flex; gap: 10px; align-items: baseline; margin: 0 0 4px; font-size: var(--fs-sm); }
.c-head time { color: var(--muted); font-size: var(--fs-xs); }
.c p { margin: 0 0 6px; white-space: pre-wrap; }
.c .c { margin-left: 22px; padding-bottom: 8px; border: 0; border-left: 2px solid var(--line); padding-left: 16px; }
.empty-note { color: var(--muted); }

/* ---------- 9. app overlays: sheet, toast, confetti ---------- */
.sheet-back {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: end center;
  background: rgb(26 12 34 / 0.48); backdrop-filter: blur(2px);
  animation: fade 200ms ease;
}
.sheet {
  width: min(560px, 100%); max-height: min(92vh, 900px); overflow: auto; overscroll-behavior: contain;
  background: var(--bg); color: var(--text); border: 2px solid var(--ink); border-bottom: 0;
  border-radius: 28px 28px 0 0; padding: 22px 22px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgb(26 12 34 / 0.25);
  animation: rise 280ms cubic-bezier(.2, .9, .3, 1.1);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet-head h2 { font-size: var(--fs-xl); margin: 0; }
.x-btn {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink); background: var(--surface); color: var(--text);
  display: grid; place-items: center; cursor: pointer; font: 800 18px/1 var(--font-display);
}
.sheet-body { display: grid; gap: 16px; }
.sheet .lead { margin: 0; color: var(--muted); }
@media (min-width: 720px) {
  .sheet-back { place-items: center; }
  .sheet { border-radius: 28px; border-bottom: 2px solid var(--ink); box-shadow: var(--pop), 0 30px 80px rgb(26 12 34 / 0.35); }
}
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translateX(-50%); max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 999px; background: var(--text); color: var(--bg);
  font: 700 var(--fs-sm)/1.3 var(--font-body); box-shadow: 0 12px 30px rgb(26 12 34 / 0.3);
  animation: rise 240ms ease;
}
.confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; }

/* sticker picker */
.stickers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.sticker-opt { position: relative; }
.sticker-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; }
.sticker-opt span {
  display: grid; place-items: center; aspect-ratio: 1; border-radius: 16px; border: 2px solid var(--line-strong); background: var(--surface);
  transition: transform 160ms ease, border-color 160ms ease;
}
.sticker-opt svg { width: 70%; height: 70%; }
.sticker-opt input:checked + span { border-color: var(--ink); box-shadow: var(--pop-sm); transform: translateY(-2px) rotate(-4deg); background: var(--accent-soft); }
.sticker-opt input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

.day-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; }
.day-opt { position: relative; flex: none; scroll-snap-align: start; }
.day-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; }
.day-opt span {
  display: grid; justify-items: center; gap: 2px; min-width: 62px; padding: 8px 8px 7px; border-radius: 14px;
  border: 2px solid var(--line-strong); background: var(--surface); font: 700 11px/1.1 var(--font-body); color: var(--muted);
}
.day-opt b { font: 800 22px/1 var(--font-display); color: var(--text); }
.day-opt input:checked + span { border-color: var(--ink); background: var(--accent); color: var(--text); box-shadow: var(--pop-sm); }
.day-opt input:disabled + span { opacity: 0.35; }

.prompts { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.prompt {
  flex: none; padding: 8px 12px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface);
  font: 600 13px/1.1 var(--font-body); color: var(--text); cursor: pointer; transition: border-color 160ms ease, transform 160ms ease;
}
.prompt:hover { border-color: var(--primary); transform: translateY(-1px); }
.count { justify-self: end; margin-top: -10px; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }

.note-card {
  position: relative; padding: 26px 22px 22px; border-radius: 20px; border: 2px solid var(--ink); box-shadow: var(--pop);
  background:
    repeating-linear-gradient(180deg, transparent 0 33px, rgb(111 182 255 / 0.28) 33px 34px) 0 40px / 100% calc(100% - 40px) no-repeat,
    #fffdf7;
  color: #2a1533;
}
.note-card .ns { position: absolute; top: -26px; right: 18px; width: 64px; height: 64px; transform: rotate(10deg); filter: drop-shadow(2px 3px 0 #2a1533); }
.note-card .nf { margin: 0 0 6px; font: 700 var(--fs-xs)/1 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: #6e5a73; }
.note-card .nb { margin: 0; font: 600 28px/1.25 var(--font-hand); white-space: pre-wrap; overflow-wrap: anywhere; }
.note-card .nd { margin: 14px 0 0; font: 700 var(--fs-xs)/1 var(--font-body); color: #6e5a73; }

.unwrap { display: grid; place-items: center; padding: 20px 0 6px; }
.unwrap .door { width: 150px; pointer-events: none; }
.unwrap .door-box { animation: shake 900ms ease-in-out; }
.unwrap.is-open .door-box { animation: lift 520ms ease-in forwards; }
@keyframes shake {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(-8deg) scale(1.03); } 30% { transform: rotate(7deg) scale(1.05); }
  45% { transform: rotate(-6deg) scale(1.06); } 60% { transform: rotate(5deg) scale(1.07); } 80% { transform: rotate(-2deg) scale(1.08); }
}
@keyframes lift { to { transform: translateY(-40px) scale(1.15) rotate(-8deg); opacity: 0; } }

.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-grid .btn { width: 100%; }
.story-preview { display: grid; place-items: center; }
.story-preview img { width: min(260px, 70vw); border-radius: 18px; border: 2px solid var(--ink); box-shadow: var(--pop); }
.secret {
  display: grid; gap: 10px; padding: 16px; border-radius: 18px; border: 2px dashed var(--line-strong); background: var(--surface);
}
.secret code { font: 600 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; color: var(--muted); }

/* ---------- 10. responsive ---------- */
@media (max-width: 1020px) {
  .hero-in { grid-template-columns: 1fr; gap: 28px; }
  .stage { position: relative; top: 0; order: 1; }
  .hero-copy { display: contents; }
  .hero-title { order: -1; }
  .maker { order: 0; }
  .lede { max-width: 46ch; }
  .how-list { grid-template-columns: repeat(2, 1fr); gap: 36px 24px; }
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
  .guide { grid-template-columns: 1fr; gap: 0; }
  .toc { display: none; }
  .ideas { grid-template-columns: 1fr; }
  .cta-in { grid-template-columns: 1fr; padding: 36px 28px; }
  .cta-art { width: 160px; order: -1; }
  .bottom-in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .top-nav a:not(.btn) { display: none; }
  .hero { padding-bottom: 48px; }
  .stage { padding: 22px 14px 18px; border-radius: 24px; }
  .stage .doors { gap: 12px 8px; }
  .maker { padding: 18px; border-radius: 22px; }
  .sec { padding-top: 72px; }
  .how-list { grid-template-columns: 1fr 1fr; gap: 28px 14px; }
  .phone { padding: 6px; border-radius: 26px; }
  .phone img { border-radius: 21px; }
  .phone::before { top: 11px; width: 50px; height: 14px; }
  .feat-grid { grid-template-columns: 1fr; }
  .feat { padding: 22px 18px; }
  .pair { grid-template-columns: 1fr; }
  .prose { font-size: 17px; }
  .cake-wrap { grid-template-columns: 96px 1fr; gap: 14px; }
  .cake-art { width: 96px; }
  .bottom-in { grid-template-columns: 1fr; }
  .stickers { grid-template-columns: repeat(5, 1fr); gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- 11. hero tuning ---------- */
.hero h1 { font-size: clamp(40px, 4.6vw, 62px); }
.hero .lede { font-size: var(--fs-md); max-width: 40ch; margin-bottom: 20px; }
.maker { gap: 14px; padding: 20px 22px; }
.seg span { min-height: 36px; }
.field > span small, .label small { font-weight: 500; color: var(--muted); font-size: var(--fs-xs); }
.chip span { min-height: 38px; padding: 7px 14px; }
.stage-styles { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 2px dashed var(--line-strong); }
.stage-styles .label { margin-right: 4px; }
.stage-styles .swatch span { grid-auto-flow: column; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; }
.stage-styles .swatch i { width: 26px; height: 26px; border-radius: 999px; }
@media (max-width: 1020px) {
  .stage-deco.d1, .stage-deco.d3 { display: none; }
  .stage .counter-num { font-size: 88px; padding-top: 30px; }
  .stage .counter-num .candle { width: 18px; height: 38px; top: -4px; }
  .board-title { font-size: 22px; }
  .stage .cake-wrap { grid-template-columns: 84px 1fr; margin-top: 18px; padding-top: 16px; }
  .stage .cake-art { width: 84px; }
  .stage .cake-copy h3 { font-size: var(--fs-md); }
}
@media (max-width: 640px) {
  .hero h1 { font-size: 40px; }
  .hero .lede { font-size: 16px; margin-bottom: 4px; }
  .stage .doors { grid-template-columns: repeat(5, 1fr); gap: 12px 7px; }
  .stage .door-num { min-width: 22px; height: 22px; font-size: 11px; top: -8px; left: -7px; }
  .stage .door-cap { font-size: 11px; }
  .stage-styles .label { width: 100%; text-align: center; margin: 0; }
  .stage-styles .swatch span { padding: 5px 10px 5px 5px; }
}

/* ---------- 12. sheet overflow guards ---------- */
.sheet-body > * { min-width: 0; }
.share-grid .btn, .note-actions .btn, .cake-btns .btn { white-space: normal; text-align: center; line-height: 1.2; }
.pair .phone { width: 100%; max-width: 290px; }
.how-item .phone { width: 100%; }

/* ---------- 13. gift wrap variety (shared by home and countdown pages) ---------- */
.door { --hl: linear-gradient(155deg, rgb(255 255 255 / 0.42) 0%, rgb(255 255 255 / 0) 42%); }
.door.w0 .door-box { background: var(--hl), repeating-linear-gradient(135deg, var(--wrap-a) 0 9px, var(--wrap-b) 9px 18px); }
.door.w1 .door-box { --ribbon: #ff4f8b; background: var(--hl), radial-gradient(circle, #fff 2.6px, transparent 3.2px) 0 0 / 13px 13px, var(--mint); }
.door.w2 .door-box { background: var(--hl), radial-gradient(circle, var(--wrap-a) 2.8px, transparent 3.4px) 3px 3px / 14px 14px, var(--wrap-b); }
.door.w3 .door-box { --ribbon: #ff4f8b; background: var(--hl), linear-gradient(90deg, rgb(255 255 255 / 0.34) 50%, transparent 0) 0 0 / 16px 16px, linear-gradient(rgb(255 255 255 / 0.34) 50%, transparent 0) 0 0 / 16px 16px, var(--sky); }
.door.w4 .door-box { --ribbon: #ffffff; background: var(--hl), repeating-linear-gradient(90deg, #ffc53d 0 8px, #ffe39a 8px 16px); }
.door.w5 .door-box { background: var(--hl), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M9 2.5l1.7 3.7 4 .5-3 2.7.8 4L9 11.4l-3.5 2 .8-4-3-2.7 4-.5z' fill='%23fff' fill-opacity='.78'/%3E%3C/svg%3E") 0 0 / 18px 18px, var(--lilac); }
.door.is-opened .door-box { background: repeating-linear-gradient(180deg, transparent 0 13px, var(--line) 13px 14px), var(--surface); }
