:root {
  --maroon: #862424;
  --maroon-deep: #6a1a1c;
  --rust: #c4561d;
  --rust-soft: #e59a62;
  --linen: #e9dbc5;
  --linen-light: #f5ede0;
  --paper: #fbf7f1;
  --ink: #3b1a17;
  --ink-soft: #7a5a52;
  --line: rgba(134, 36, 36, 0.16);
  --shadow: 0 1px 2px rgba(59, 26, 23, .06), 0 10px 30px -10px rgba(59, 26, 23, .25);
  --radius: 22px;
  --serif: "Marcellus", Georgia, serif;
  --script: "Allura", "Brush Script MT", cursive;
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--linen);
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.08) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(120,90,60,.05) 0 1px, transparent 1px 4px),
    radial-gradient(120% 80% at 50% 0%, var(--linen-light) 0%, var(--linen) 60%);
  min-height: 100vh;
  min-height: 100dvh;
}
img { max-width: 100%; display: block; }
svg { width: 24px; height: 24px; flex: none; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--maroon); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(560px, 100%); margin: 0 auto; padding: 0 18px; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 34px 0 10px; }
.hero .mono { width: 88px; height: auto; margin: 0 auto 6px; filter: drop-shadow(0 2px 6px rgba(196, 86, 29, .15)); }
.hero h1 {
  font-family: var(--serif); font-weight: 400; color: var(--maroon);
  font-size: clamp(34px, 9vw, 46px); line-height: 1.05; margin: 6px 0 4px; letter-spacing: .3px;
}
.hero h1 .amp { font-family: var(--script); color: var(--rust); font-size: 1.25em; padding: 0 .08em; line-height: 0; position: relative; top: .1em; }
.hero .when { font-family: var(--serif); letter-spacing: .22em; text-transform: uppercase; font-size: 13px; color: var(--ink-soft); }
.hero .when b { color: var(--rust); font-weight: 400; padding: 0 .35em; }
.hero .flowers { width: 190px; margin: 12px auto 0; opacity: .95; }

.countdown { margin: 18px auto 0; display: inline-flex; gap: 6px; }
.countdown[hidden] { display: none; }
.countdown .unit {
  min-width: 64px; padding: 8px 6px 6px; border-radius: 14px;
  background: var(--paper); box-shadow: var(--shadow); border: 1px solid var(--line);
}
.countdown .n { font-family: var(--serif); font-size: 26px; color: var(--maroon); display: block; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown .l { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-soft); }
.status-line { font-family: var(--script); font-size: 34px; color: var(--rust); margin: 14px 0 0; line-height: 1.1; }

.intro { text-align: center; margin: 22px auto 6px; max-width: 30em; color: var(--ink-soft); }
.intro strong { color: var(--ink); font-weight: 500; }

/* ---------- action cards ---------- */
.actions { display: grid; gap: 14px; margin: 22px 0 10px; }
.action {
  appearance: none; border: 0; cursor: pointer; text-align: left;
  display: grid; grid-template-columns: 56px 1fr 20px; align-items: center; gap: 14px;
  padding: 18px 18px; border-radius: var(--radius);
  background: var(--paper); box-shadow: var(--shadow); border: 1px solid var(--line);
  transition: transform .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.action:active { transform: scale(.985); }
.action .ico {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: var(--linen-light); color: var(--rust);
}
.action .ico svg { width: 28px; height: 28px; }
.action h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 21px; color: var(--maroon); line-height: 1.2; }
.action p { margin: 2px 0 0; font-size: 14.5px; color: var(--ink-soft); line-height: 1.35; }
.action .chev { color: var(--rust); opacity: .7; width: 20px; height: 20px; }
.action.primary { background: linear-gradient(140deg, var(--maroon) 0%, #962b28 55%, var(--maroon-deep) 100%); border-color: transparent; }
.action.primary h2 { color: #fff; font-size: 23px; }
.action.primary p { color: #f3d9c9; }
.action.primary .ico { background: rgba(255,255,255,.12); color: #ffd7b8; }
.action.primary .chev { color: #ffd7b8; }

.promise {
  margin: 18px 0 8px; padding: 14px 16px; border-radius: 16px; text-align: center;
  font-size: 14.5px; color: var(--ink-soft); background: rgba(255,255,255,.35); border: 1px dashed var(--line);
}
.promise svg { width: 16px; height: 16px; vertical-align: -3px; color: var(--rust); margin-right: 4px; }

.helpbox { margin: 14px 0 0; padding: 16px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); text-align: center; font-size: 14.5px; color: var(--ink-soft); line-height: 1.55; }
.helpbox b { color: var(--maroon); font-weight: 500; display: block; font-family: var(--serif); font-size: 17px; }
.helpbox .tel { display: inline-block; font-weight: 500; color: var(--maroon); white-space: nowrap; }
.helpbox small { display: block; margin-top: 6px; font-size: 13px; }
.helpline { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: #fff3e8; color: var(--ink); font-size: 14px; text-align: center; }
footer.site { text-align: center; padding: 26px 0 40px; color: var(--ink-soft); font-size: 13.5px; }
footer.site .script { font-family: var(--script); font-size: 28px; color: var(--rust); display: block; line-height: 1.2; }
footer.site a { color: var(--ink-soft); }

/* ---------- sheets (modals that slide up) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(40, 14, 12, .45); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  max-height: 94dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--paper); border-radius: 26px 26px 0 0;
  box-shadow: 0 -10px 40px rgba(40, 14, 12, .3);
  transform: translateY(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  padding: 10px 0 calc(20px + env(safe-area-inset-bottom));
}
.sheet:not(.open) { visibility: hidden; transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .22s, visibility 0s .3s; }
.sheet.open { transform: none; }
@media (min-width: 640px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 560px; border-radius: 26px; transform: translate(-50%, -46%) scale(.97); opacity: 0; pointer-events: none; transition: transform .22s, opacity .22s; }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
}
.sheet .grab { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 6px; }
.sheet .inner { padding: 6px 22px 4px; }
.sheet h3 { font-family: var(--serif); font-weight: 400; color: var(--maroon); font-size: 25px; margin: 6px 0 4px; text-align: center; }
.sheet .sub { text-align: center; color: var(--ink-soft); margin: 0 0 16px; font-size: 15px; }
.sheet .close {
  position: absolute; top: 12px; right: 14px; width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: var(--linen-light); color: var(--ink-soft); cursor: pointer; font-size: 20px; line-height: 1;
}

label.field { display: block; margin: 0 0 14px; }
label.field span { display: block; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 6px 4px; }
input.text, textarea.text {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line);
  background: #fff; font-size: 17px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.text { min-height: 170px; resize: vertical; line-height: 1.5; font-family: var(--sans); }
input.text:focus, textarea.text:focus { border-color: var(--rust); box-shadow: 0 0 0 4px rgba(196, 86, 29, .14); }

.btn {
  appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 22px; border-radius: 999px; font-size: 17px; font-weight: 500; letter-spacing: .01em;
  background: var(--maroon); color: #fff; box-shadow: 0 6px 16px -6px rgba(134, 36, 36, .6);
  transition: transform .12s, background .15s, opacity .15s; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--maroon); box-shadow: none; border: 1.5px solid var(--line); }
.btn.soft { background: var(--linen-light); color: var(--maroon); box-shadow: none; }
.btn svg { width: 20px; height: 20px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.linkish { background: none; border: 0; color: var(--ink-soft); text-decoration: underline; cursor: pointer; padding: 10px; font-size: 15px; }

/* ---------- uploads ---------- */
.dropzone {
  display: grid; place-items: center; text-align: center; gap: 6px; padding: 26px 16px; border-radius: 18px;
  border: 2px dashed rgba(196, 86, 29, .45); background: var(--linen-light); color: var(--ink-soft); cursor: pointer;
}
.dropzone.drag { background: #fff3e8; border-color: var(--rust); }
.dropzone svg { width: 40px; height: 40px; color: var(--rust); }
.dropzone b { color: var(--maroon); font-weight: 500; font-size: 18px; }

.queue { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.queue li { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.queue .thumb { width: 54px; height: 54px; border-radius: 10px; background: var(--linen-light) center/cover no-repeat; display: grid; place-items: center; color: var(--rust); overflow: hidden; }
.queue .thumb svg { width: 24px; height: 24px; }
.queue .name { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue .meta { font-size: 12.5px; color: var(--ink-soft); }
.bar { height: 6px; border-radius: 3px; background: var(--linen); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--rust), var(--rust-soft)); transition: width .25s; border-radius: 3px; }
.queue .state { width: 28px; height: 28px; display: grid; place-items: center; }
.queue .state svg { width: 22px; height: 22px; }
.queue li.done .state { color: #3f7d4a; }
.queue li.error .state { color: #b3261e; }
.queue li.error .meta { color: #b3261e; }

.overall { margin: 16px 0 6px; text-align: center; font-size: 15px; color: var(--ink-soft); }
.keepopen { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 13.5px; color: var(--rust); margin: 6px 0 14px; }
.keepopen svg { width: 16px; height: 16px; }

/* ---------- thank-you ---------- */
.thanks { text-align: center; padding: 8px 0 6px; }
.thanks .big { font-family: var(--script); color: var(--rust); font-size: 54px; line-height: 1; margin: 6px 0 2px; }
.thanks p { color: var(--ink-soft); margin: 4px 0 18px; }
.thanks .heart { width: 66px; height: 66px; margin: 4px auto 0; color: var(--maroon); animation: beat 1.4s ease-in-out infinite; }
@keyframes beat { 0%,100% { transform: scale(1) } 15% { transform: scale(1.12) } 30% { transform: scale(1) } 45% { transform: scale(1.08) } }

/* ---------- recorder ---------- */
.seg { display: flex; background: var(--linen-light); border-radius: 999px; padding: 4px; margin: 0 auto 14px; width: fit-content; }
.seg button { border: 0; background: none; padding: 9px 18px; border-radius: 999px; cursor: pointer; color: var(--ink-soft); font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.seg button svg { width: 18px; height: 18px; }
.seg button.on { background: #fff; color: var(--maroon); box-shadow: 0 1px 4px rgba(0,0,0,.1); }

.stage {
  position: relative; border-radius: 20px; overflow: hidden; background: #2a1110; aspect-ratio: 3 / 4; max-height: 42dvh; margin: 0 auto;
  display: grid; place-items: center; color: #f3d9c9;
}
.stage.audio { aspect-ratio: auto; height: 200px; background: radial-gradient(circle at 50% 40%, #9b3530, var(--maroon-deep)); }
.stage video { width: 100%; height: 100%; object-fit: cover; }
.stage video.mirror { transform: scaleX(-1); }
.stage .timer {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); padding: 4px 12px; border-radius: 999px;
  background: rgba(0,0,0,.45); color: #fff; font-variant-numeric: tabular-nums; font-size: 15px; display: flex; gap: 6px; align-items: center;
}
.stage .timer .dot { width: 9px; height: 9px; border-radius: 50%; background: #ff4b3e; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2 } }
.stage .flip { position: absolute; top: 10px; right: 10px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(0,0,0,.4); color: #fff; cursor: pointer; display: grid; place-items: center; }
.stage .flip svg { width: 22px; height: 22px; }
.stage .placeholder { text-align: center; padding: 20px; font-size: 15px; }
.stage .placeholder svg { width: 46px; height: 46px; margin: 0 auto 8px; opacity: .8; }
.levels { display: flex; gap: 4px; align-items: center; height: 80px; }
.levels i { width: 6px; border-radius: 3px; background: #ffd7b8; height: 8px; transition: height .08s; }
.stage audio { width: 90%; }

.prompts { text-align: center; margin: 12px 0 4px; min-height: 48px; }
.prompts small { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.prompts .p { font-family: var(--serif); color: var(--maroon); font-size: 18px; transition: opacity .3s; }

.rec-controls { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 14px 0 6px; }
.recbtn {
  width: 78px; height: 78px; border-radius: 50%; border: 5px solid #fff; outline: 2px solid var(--line);
  background: #d93a2b; cursor: pointer; box-shadow: 0 6px 16px rgba(0,0,0,.2); transition: transform .15s, border-radius .2s;
  display: grid; place-items: center;
}
.recbtn.recording { animation: pulse 1.6s infinite; }
.recbtn.recording::after { content: ""; width: 26px; height: 26px; border-radius: 6px; background: #fff; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(217,58,43,.5) } 70% { box-shadow: 0 0 0 16px rgba(217,58,43,0) } 100% { box-shadow: 0 0 0 0 rgba(217,58,43,0) } }
.hint { text-align: center; font-size: 13.5px; color: var(--ink-soft); margin: 4px 0 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px); opacity: 0;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px; z-index: 80;
  transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* falling leaves celebration */
.leaf { position: fixed; top: -40px; z-index: 90; pointer-events: none; width: 22px; height: 22px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); opacity: .8; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
