:root {
  --sky: #4eb7d9;
  --sky-deep: #1a8bb8;
  --sun: #ffb020;
  --mango: #ff8a00;
  --sand: #fff8ec;
  --ink: #1a2a32;
  --ink-soft: #3d5460;
  --muted: #5f7580;
  --wa: #25d366;
  --wa-bubble: #dcf8c6;
  --wa-in: #ffffff;
  --line: rgba(26, 42, 50, 0.12);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.demo-reel {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 90% -5%, rgba(255, 176, 32, 0.35), transparent 55%),
    radial-gradient(700px 380px at -5% 30%, rgba(78, 183, 217, 0.28), transparent 50%),
    linear-gradient(180deg, #dff4fb 0%, var(--sand) 55%, #fffdf8 100%);
}

.reel-page {
  width: min(100% - 1.5rem, 1120px);
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.reel-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.reel-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
  line-height: 1.05;
}

.reel-hero p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 36rem;
}

.reel-stage {
  position: relative;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 24px 50px rgba(26, 139, 184, 0.14);
  overflow: hidden;
  isolation: isolate;
}

.reel-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-conic-gradient(from 0deg at 85% 12%, rgba(255,255,255,0.12) 0 8deg, transparent 8deg 20deg);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.reel-caption {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  background: rgba(26, 42, 50, 0.92);
  color: #fff8ec;
}

.reel-caption strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.reel-caption span {
  color: rgba(255, 248, 236, 0.75);
  font-size: 0.92rem;
}

.phones {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1rem;
  padding: 1.1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .phones {
    grid-template-columns: repeat(3, 1fr);
  }
}

.phone {
  background: #0b141a;
  border-radius: 22px;
  padding: 0.55rem;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.18);
  transform: translateY(8px);
  opacity: 0.55;
  transition: transform 0.45s ease, opacity 0.45s ease, box-shadow 0.45s ease;
}

.phone.is-live {
  opacity: 1;
  transform: translateY(0);
  box-shadow: 0 22px 40px rgba(26, 139, 184, 0.28);
}

.phone-inner {
  background: #ece5dd
    url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 30h60M30 0v60' stroke='%23d6cfc4' stroke-width='.4'/%3E%3C/svg%3E");
  border-radius: 16px;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.phone-head {
  background: #075e54;
  color: #fff;
  padding: 0.7rem 0.85rem;
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.phone-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--sun), var(--mango));
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #3a2200;
  font-size: 0.75rem;
}

.phone-head h3 {
  margin: 0;
  font-size: 0.92rem;
}

.phone-head p {
  margin: 0;
  font-size: 0.72rem;
  opacity: 0.8;
}

.phone-thread {
  flex: 1;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.bubble {
  max-width: 92%;
  padding: 0.45rem 0.6rem 0.35rem;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.35;
  box-shadow: 0 1px 1px rgba(0,0,0,0.08);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.35s ease, transform 0.35s ease;
  align-self: flex-start;
  background: var(--wa-in);
  color: var(--ink);
}

.bubble.is-in {
  opacity: 1;
  transform: none;
}

.bubble.from-bot {
  background: #fff8e8;
  border: 1px solid rgba(255, 176, 32, 0.35);
}

.bubble.from-self {
  align-self: flex-end;
  background: var(--wa-bubble);
}

.bubble .who {
  display: block;
  font-size: 0.68rem;
  font-weight: 750;
  color: var(--sky-deep);
  margin-bottom: 0.15rem;
}

.bubble.from-bot .who { color: var(--mango); }
.bubble.from-self .who { color: var(--wa-ink); }

.bubble time {
  display: block;
  text-align: right;
  font-size: 0.62rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.reel-controls {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 1.1rem 1.1rem;
  background: rgba(255, 253, 248, 0.9);
  border-top: 1px solid var(--line);
}

.reel-controls button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  background: linear-gradient(135deg, var(--sun), var(--mango));
  color: #3a2200;
}

.reel-controls button.ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.progress {
  flex: 1;
  min-width: 140px;
  height: 8px;
  border-radius: 999px;
  background: rgba(26, 42, 50, 0.1);
  overflow: hidden;
}

.progress > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--sky), var(--sun));
  transition: width 0.2s linear;
}

.reel-note {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.reel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.72rem 1.15rem;
  font-weight: 750;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-wa { background: var(--wa); color: #053b1f; }
.btn-outline {
  background: rgba(255,255,255,0.75);
  border-color: var(--line);
  color: var(--ink);
}

.phones-single {
  grid-template-columns: 1fr;
  max-width: 420px;
  margin-inline: auto;
}

.phone-tall {
  min-height: 560px;
}

.bubble.has-links {
  max-width: 100%;
}

.bubble-body {
  white-space: normal;
}

.bubble-links {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.bubble-links a {
  display: block;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  background: rgba(37, 211, 102, 0.18);
  border: 1px solid rgba(7, 94, 84, 0.25);
  color: #064e3b;
  font-weight: 750;
  font-size: 0.78rem;
  text-decoration: none;
}

.bubble-links a:hover {
  background: rgba(37, 211, 102, 0.32);
}

.end-panel {
  display: none;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  padding: 0 1.1rem 1rem;
  position: relative;
  z-index: 2;
}

.end-panel.is-visible {
  display: flex;
}

body.record-mode .phones-single {
  max-width: 380px;
}

body.record-mode .phone-tall {
  min-height: 520px;
}

body.record-mode .reel-hero h1 {
  font-size: 2rem;
}

body.record-mode {
  width: 1280px;
  height: 720px;
  overflow: hidden;
  background: linear-gradient(135deg, #c8ecf7 0%, #fff3d0 48%, #ffe8b0 100%);
}
body.record-mode .site-header,
body.record-mode .site-footer,
body.record-mode .reel-actions,
body.record-mode .reel-note,
body.record-mode #demo-mp4,
body.record-mode .skip-link { display: none !important; }
body.record-mode .reel-page {
  width: 1240px;
  padding: 18px 20px;
}
body.record-mode .reel-controls { display: none; }
body.record-mode .phone-inner { min-height: 480px; }
body.record-mode .phones { padding-top: 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  .bubble, .phone { transition: none; }
}
