:root {
  --parchment: #f6ead7;
  --cream: #fbf3e4;
  --ink: #2a1d16;
  --ink-soft: #5a4538;
  --burgundy: #6e1d24;
  --burgundy-deep: #4a1218;
  --pine: #234033;
  --pine-deep: #13241d;
  --gold: #c4a35a;
  --gold-soft: #e6d3a3;
  --russet: #8a3d1e;
  --snow: #fffaf3;
  --line: rgba(42, 29, 22, 0.14);
  --shadow: 0 18px 50px rgba(19, 36, 29, 0.14);
  --serif: "Fraunces", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --sans: "Figtree", "Segoe UI", sans-serif;
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(196, 163, 90, 0.18), transparent 50%),
    radial-gradient(900px 500px at 0% 0%, rgba(110, 29, 36, 0.08), transparent 45%),
    var(--parchment);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.6;
  min-height: 100vh;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--burgundy); }
a:hover { color: var(--burgundy-deep); }

.wrap {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header, .site-footer {
  padding: 1.1rem 0;
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
}
.brand-mark { width: 42px; height: 42px; flex: none; }
.brand-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}
.brand-name span { display: block; font-size: 0.72rem; font-family: var(--sans); font-weight: 500; color: var(--ink-soft); letter-spacing: 0.08em; text-transform: uppercase; }
.nav {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
}
.nav a:hover { color: var(--ink); }

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.2rem;
  align-items: center;
  padding: 1.2rem 0 2.5rem;
}
.eyebrow {
  color: var(--russet);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin: 0 0 0.7rem;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); margin: 0 0 0.8rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 0.8rem; }
h3 { font-size: 1.2rem; margin: 0 0 0.4rem; }
.lede { font-size: 1.15rem; color: var(--ink-soft); margin: 0 0 1.3rem; max-width: 38rem; }
.hero-art {
  background: linear-gradient(180deg, #163126 0%, #234033 42%, #3a2a1f 100%);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 320px;
}
.hero-art svg { width: 100%; height: auto; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.25rem;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--burgundy); color: var(--snow); }
.btn-primary:hover { background: var(--burgundy-deep); color: var(--snow); }
.btn-secondary { background: var(--pine); color: var(--snow); }
.btn-secondary:hover { background: var(--pine-deep); color: var(--snow); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.price-pill {
  display: inline-flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0 0 1.1rem;
  padding: 0;
  list-style: none;
}
.price-pill li {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.disclose {
  background: rgba(110, 29, 36, 0.07);
  border-left: 3px solid var(--burgundy);
  padding: 0.85rem 1rem;
  border-radius: 0 14px 14px 0;
  margin: 0 0 1.3rem;
  color: var(--ink);
  max-width: 40rem;
}

section { padding: 1.6rem 0 2rem; }
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.card, .panel, .form-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.15rem 1.2rem;
  box-shadow: 0 10px 30px rgba(19, 36, 29, 0.05);
}
.step-num {
  font-family: var(--serif);
  color: var(--gold);
  font-size: 1.5rem;
  margin: 0 0 0.4rem;
}
.privacy-grid, .split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
.muted, .fine { color: var(--ink-soft); }
.fine { font-size: 0.92rem; }

label, .label {
  display: block;
  font-weight: 700;
  margin: 0.9rem 0 0.35rem;
}
input, textarea, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--snow);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
}
textarea { min-height: 6rem; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--gold);
  border-color: var(--gold);
}
.consent {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin: 1rem 0;
  font-weight: 600;
}
.consent input { width: auto; margin-top: 0.3rem; }
.error {
  color: var(--burgundy-deep);
  background: rgba(110, 29, 36, 0.08);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  margin: 0.6rem 0;
  font-weight: 600;
}
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.site-footer p { margin: 0.35rem 0; }
.foot-brand { font-family: var(--serif); color: var(--ink); font-weight: 600; }

.talk-shell { padding: 0.4rem 0 3rem; }
.talk-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
}
.timer {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--burgundy);
}
.talk-log {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 240px;
  max-height: 55vh;
  overflow: auto;
  padding: 0.2rem 0.2rem 1rem;
}
.bubble {
  max-width: 92%;
  padding: 0.8rem 1rem;
  border-radius: 20px;
}
.bubble-label {
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}
.bubble-text { margin: 0; }
.bubble-santa {
  align-self: flex-start;
  background: #234033;
  color: var(--snow);
}
.bubble-santa .bubble-label { color: var(--gold-soft); }
.bubble-child {
  align-self: flex-end;
  background: #fff;
  border: 1px solid var(--line);
}
.talk-form {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: center;
  margin-top: 1rem;
}
/* #mic-btn state is styled via .btn-talk-big[data-mode] below */
.pay-status { font-weight: 700; margin: 0.8rem 0; }
.pay-status.is-ok { color: var(--pine); }
.pay-status.is-wait { color: var(--russet); }
.pay-status.is-warn { color: var(--burgundy-deep); }
#qr-box {
  background: #fff;
  padding: 0.8rem;
  border-radius: 18px;
  width: min(100%, 280px);
  margin: 0 auto 1rem;
}
#qr-box svg { width: 100%; height: auto; }
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  word-break: break-all;
  background: var(--snow);
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.dl { display: grid; gap: 0.7rem; margin: 1rem 0; }
.dl div { display: grid; gap: 0.2rem; }
.dl dt { font-weight: 700; font-size: 0.86rem; color: var(--ink-soft); }
.coming-soon {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
}

@media (max-width: 860px) {
  .hero, .cards, .privacy-grid, .split { grid-template-columns: 1fr; }
  .site-header { align-items: flex-start; flex-direction: column; }
  .talk-form { grid-template-columns: 1fr; }
  h1 { font-size: 2.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover { transform: none; }
}

/* ================= PWA Install Banner & Guide ================= */
.pwa-bar {
  background: linear-gradient(135deg, #1b4332 0%, #265842 100%);
  color: var(--snow);
  border-radius: 18px;
  padding: 0.9rem 1.15rem;
  margin: 0.5rem 0 1.4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  box-shadow: 0 10px 26px rgba(27, 67, 50, 0.22);
}
.pwa-bar-copy { flex: 1 1 260px; }
.pwa-bar-title { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; margin: 0 0 0.15rem; color: #fff6dc; }
.pwa-bar-guide { margin: 0; font-size: 0.9rem; color: #e4f0e9; }
.btn-install {
  background: #ffd166;
  color: #24150e;
  font-weight: 800;
  padding: 0.68rem 1.15rem;
}
.btn-install:hover { background: #ffe08a; color: #24150e; }

/* ================= Full-Screen Portrait Call Shell ================= */
body.is-in-call .site-footer { display: none; }
body.is-in-call .site-header { padding: 0.55rem 0; }
body.is-in-call .call-intro-copy { display: none; }

.call-card {
  background: linear-gradient(180deg, #1b3a2d 0%, #162b22 100%);
  color: var(--snow);
  border-radius: 26px;
  padding: 0.9rem;
  box-shadow: 0 22px 60px rgba(13, 28, 22, 0.32);
  border: 2px solid rgba(255, 216, 107, 0.32);
}

.call-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
  flex-wrap: wrap;
}
.call-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.call-title {
  margin: 0;
  font-size: 1.05rem;
  color: #fff5d8;
}
.call-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.call-topbar .timer {
  background: rgba(255, 255, 255, 0.12);
  color: #ffd86b;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  margin: 0;
  font-size: 0.95rem;
}
.btn-chip {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fffaf3;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-chip:hover { background: rgba(255, 255, 255, 0.2); color: #fffaf3; }
.btn-chip[aria-pressed="true"] {
  background: rgba(255, 107, 107, 0.26);
  border-color: rgba(255, 140, 140, 0.55);
}

/* ================= Avatar Stage & Workshop Animations ================= */
.avatar-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 6 / 5;
  max-height: 460px;
  border-radius: 22px;
  overflow: hidden;
  background: #22120f;
  box-shadow: inset 0 0 0 2px rgba(255, 216, 107, 0.25);
}
.avatar-svg, .avatar-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.avatar-fx { pointer-events: none; }

.avatar-ring {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  pointer-events: none;
  z-index: 3;
  transition: box-shadow 0.25s ease;
}
.avatar-stage[data-state="listening"] .avatar-ring {
  box-shadow: inset 0 0 0 5px #ffd86b, inset 0 0 36px rgba(255, 216, 107, 0.65);
  animation: ring-pulse 1.3s ease-in-out infinite;
}
.avatar-stage[data-state="speaking"] .avatar-ring {
  box-shadow: inset 0 0 0 4px rgba(126, 242, 157, 0.85), inset 0 0 24px rgba(126, 242, 157, 0.35);
}
.avatar-stage[data-state="thinking"] .avatar-ring {
  box-shadow: inset 0 0 0 4px rgba(112, 214, 255, 0.75);
}

@keyframes ring-pulse {
  0%, 100% { box-shadow: inset 0 0 0 4px #ffd86b, inset 0 0 20px rgba(255, 216, 107, 0.45); }
  50% { box-shadow: inset 0 0 0 7px #ffe89e, inset 0 0 44px rgba(255, 216, 107, 0.85); }
}

.stage-pill {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 4;
  background: rgba(19, 36, 29, 0.84);
  color: #fff6dc;
  border: 1px solid rgba(255, 216, 107, 0.42);
  border-radius: 999px;
  padding: 0.28rem 0.8rem;
  font-size: 0.84rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
}
.avatar-stage[data-state="listening"] .stage-pill {
  background: #ffd86b;
  color: #24150e;
  border-color: #fff3c4;
}

/* Eye Blinks */
.santa-eyes .eyelid {
  transform-origin: center 182px;
  transform: scaleY(0);
  transition: transform 0.08s ease;
}
.santa-eyes.is-blinking .eyelid {
  transform: scaleY(1);
}

/* Listening Hand-to-Ear Arm */
.santa-listen-arm {
  transform-origin: 386px 346px;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}
.avatar-stage[data-state="listening"] .santa-listen-arm {
  transform: translate(-38px, -36px) rotate(-125deg);
}

/* Waving Hello Arm */
.santa-wave-arm {
  transform-origin: 214px 346px;
  transition: transform 0.35s ease;
}
.avatar-stage.is-waving .santa-wave-arm {
  animation: santa-wave 0.55s ease-in-out 4;
}
@keyframes santa-wave {
  0%, 100% { transform: rotate(98deg) translate(6px, -42px); }
  50% { transform: rotate(126deg) translate(12px, -48px); }
}

/* Fireplace Crackling Flames & Embers */
.fire-flames { transform-origin: 92px 204px; animation: flame-dance 1.3s ease-in-out infinite alternate; }
.flame-mid { transform-origin: 92px 204px; animation: flame-dance 0.95s ease-in-out infinite alternate-reverse; }
@keyframes flame-dance {
  0% { transform: scaleY(0.95) skewX(-2deg); }
  100% { transform: scaleY(1.07) skewX(2.5deg); }
}
.ember { animation: ember-rise 2.2s ease-out infinite; }
.ember.e2 { animation-delay: 0.7s; }
.ember.e3 { animation-delay: 1.4s; }
@keyframes ember-rise {
  0% { transform: translateY(6px); opacity: 0.95; }
  100% { transform: translateY(-28px); opacity: 0; }
}

/* Twinkling Fairy Lights */
.twinkle-dot { animation: twinkle 2.2s ease-in-out infinite; }
.twinkle-dot.t2 { animation-delay: 0.55s; }
.twinkle-dot.t3 { animation-delay: 1.1s; }
.twinkle-dot.t4 { animation-delay: 1.65s; }
@keyframes twinkle {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 4px currentColor); }
  50% { opacity: 0.45; }
}

/* Peeking Elf & Reindeer Gentle Bob */
.peeking-elf { animation: peek-bob 4.2s ease-in-out infinite; }
.peeking-reindeer { animation: peek-bob 5.1s ease-in-out infinite reverse; }
@keyframes peek-bob {
  0%, 100% { transform: translate(46px, 188px); }
  50% { transform: translate(46px, 182px); }
}
.peeking-reindeer {
  animation-name: peek-deer;
}
@keyframes peek-deer {
  0%, 100% { transform: translate(110px, 174px); }
  50% { transform: translate(110px, 169px); }
}

/* Snow-Globe Calling Intro Overlay */
.calling-intro {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, rgba(23, 56, 96, 0.92), rgba(11, 29, 58, 0.96));
  transition: opacity 0.38s ease, transform 0.38s ease;
}
.calling-intro[hidden] { display: none; }
.calling-intro.is-leaving {
  opacity: 0;
  transform: scale(1.18);
}
.snow-globe {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.25), rgba(35, 92, 128, 0.55) 65%, rgba(16, 40, 68, 0.9));
  border: 4px solid rgba(255, 216, 107, 0.8);
  box-shadow: 0 0 50px rgba(255, 216, 107, 0.4), inset 0 0 24px rgba(255, 255, 255, 0.25);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  animation: globe-zoom 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes globe-zoom {
  0% { transform: scale(0.72); opacity: 0.4; }
  70% { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.globe-ring {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 3px solid rgba(255, 216, 107, 0.65);
  animation: globe-ring 1.1s ease-out infinite;
}
@keyframes globe-ring {
  0% { transform: scale(0.96); opacity: 0.95; }
  100% { transform: scale(1.22); opacity: 0; }
}
.globe-bell { font-size: 2.3rem; display: block; margin-bottom: 0.25rem; color: #fff7dc; }
.globe-title { font-family: var(--serif); font-weight: 700; font-size: 1.12rem; margin: 0 0 0.2rem; color: #fff; }
.globe-sub { margin: 0; font-size: 0.82rem; color: #d6ecff; }

/* ================= Live Caption + Big Kid-Sized Tap-to-Talk ================= */
.santa-caption-box {
  background: rgba(255, 250, 243, 0.95);
  color: var(--ink);
  border-radius: 18px;
  padding: 0.8rem 1rem;
  margin: 0.75rem 0 0.65rem;
  border: 1.5px solid rgba(255, 216, 107, 0.65);
  font-size: 1.02rem;
  line-height: 1.45;
  min-height: 3.4rem;
}
.santa-caption-box p { margin: 0; }

.kid-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin: 0.4rem 0 0.5rem;
}
.btn-talk-big {
  width: min(100%, 340px);
  min-height: 68px;
  border-radius: 999px;
  border: 3px solid #ffd86b;
  background: linear-gradient(180deg, #d62839 0%, #9b1322 100%);
  color: #ffffff;
  font-family: var(--serif);
  font-size: 1.24rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34), 0 0 0 4px rgba(255, 216, 107, 0.2);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-talk-big:hover:not([disabled]) { transform: translateY(-2px) scale(1.015); }
.btn-talk-big:active:not([disabled]) { transform: scale(0.97); }
.btn-talk-big[data-mode="listening"] {
  background: linear-gradient(180deg, #ffbe3b 0%, #e08e00 100%);
  color: #24150e;
  border-color: #fff6cf;
  animation: talk-pulse 1.25s ease-in-out infinite;
}
.btn-talk-big[disabled] {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
}
@keyframes talk-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255, 216, 107, 0.4), 0 12px 28px rgba(0, 0, 0, 0.35); }
  50% { box-shadow: 0 0 0 12px rgba(255, 216, 107, 0.18), 0 12px 32px rgba(0, 0, 0, 0.45); }
}

.talk-status-line {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffe89e;
  text-align: center;
}
.call-card .fine {
  color: #d6e6dc;
  margin: 0.2rem 0;
  text-align: center;
}

.talk-type-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.25rem;
}
.talk-type-row input {
  border-radius: 999px;
  padding: 0.72rem 1rem;
  border-color: rgba(255, 255, 255, 0.25);
}
.talk-type-row button {
  padding: 0.72rem 1.2rem;
}

.call-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
}
.call-card .btn-ghost {
  color: #fffaf3;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.28);
}

.transcript-box {
  margin-top: 0.75rem;
  background: rgba(251, 243, 228, 0.96);
  color: var(--ink);
  border-radius: 16px;
  padding: 0.7rem;
}
.transcript-box .talk-log {
  min-height: 120px;
  max-height: 240px;
}

@media (max-width: 600px) {
  .call-card { padding: 0.65rem; border-radius: 20px; }
  .avatar-stage { aspect-ratio: 6 / 5; }
  .btn-talk-big { min-height: 64px; font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  .fire-flames, .flame-mid, .ember, .twinkle-dot, .peeking-elf, .peeking-reindeer,
  .avatar-stage[data-state="listening"] .avatar-ring, .btn-talk-big[data-mode="listening"],
  .avatar-stage.is-waving .santa-wave-arm, .globe-ring, .snow-globe {
    animation: none !important;
  }
}
