:root {
  --gradient-start: #100F0D;
  --gradient-end: #1C1A16;
  --primary-500: #E8981A;
  --primary-600: #D4890F;
  --accent: #06b6d4;
  --glass: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 30px 80px rgba(16, 15, 13, 0.55);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at 10% 20%, rgba(232, 152, 26, 0.22) 0%, transparent 50%),
    radial-gradient(circle at 90% 10%, rgba(6, 182, 212, 0.18) 0%, transparent 45%), linear-gradient(180deg, var(--gradient-start), var(--gradient-end));
}

body.scroll-lock {
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
  width: auto;
  height: auto;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  z-index: 1000;
}

.background-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(circle at center, rgba(255, 255, 255, 0.6), transparent 70%);
  z-index: 0;
}

.glass-panel {
  box-shadow: var(--shadow);
}

.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--primary-500));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--accent);
}

.nav-link:hover::after,
.nav-link:focus::after {
  transform: scaleX(1);
}

.gradient-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.9rem;
  background-image: linear-gradient(120deg, var(--primary-600), var(--accent));
  color: #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-position 2s linear;
  background-size: 200% 200%;
  box-shadow: 0 20px 35px rgba(212, 137, 15, 0.35);
}

.gradient-button:hover,
.gradient-button:focus {
  transform: translateY(-2px);
  background-position: 100% 0;
  box-shadow: 0 25px 45px rgba(232, 152, 26, 0.4);
}

.feature-card {
  position: relative;
  padding: 2rem;
  border-radius: 1.5rem;
  border: 1px solid var(--border);
  background: rgba(23, 20, 16, 0.65);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
  will-change: transform;
}

.feature-card::before {
  content: "";
  position: absolute;
  inset: -40% -40%;
  background: radial-gradient(circle, rgba(232, 152, 26, 0.2), transparent 60%);
  transform: translateY(60%);
  transition: transform 0.5s ease;
  z-index: 0;
}

.feature-card:hover,
.feature-card:focus-within {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(232, 152, 26, 0.45);
  box-shadow: 0 25px 60px rgba(16, 15, 13, 0.55), 0 0 0 1px rgba(232, 152, 26, 0.25);
}

.feature-card:hover::before,
.feature-card:focus-within::before {
  transform: translateY(30%);
}

.feature-card h3 {
  position: relative;
  margin-top: 1.25rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  z-index: 1;
}

.feature-card p {
  position: relative;
  margin-top: 0.75rem;
  color: rgba(226, 232, 240, 0.75);
  line-height: 1.6;
  z-index: 1;
}

.feature-icon {
  position: relative;
  display: inline-flex;
  height: 3rem;
  width: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  background: linear-gradient(130deg, rgba(232, 152, 26, 0.2), rgba(6, 182, 212, 0.15));
  color: var(--accent);
  z-index: 1;
}

/* =============================================
   How It Works — Split Layout (GSAP driven)
   ============================================= */

.how-section {
  position: relative;
  padding: 6rem 0;
}

.how-split {
  display: flex;
  flex-direction: row;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  gap: 4rem;
}

/* ── Dashboard (sticky left) ── */

.how-dashboard {
  flex: 0 0 340px;
  width: 340px;
  max-width: 340px;
  min-width: 0;
  position: sticky;
  top: 120px;
  align-self: flex-start;
  z-index: 2;
}

.how-dashboard-inner {
  width: 100%;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 1.75rem;
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  box-shadow: 0 30px 80px rgba(16, 15, 13, 0.45);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

:is(.how-dashboard, .how-mobile-dash)[data-state="2"] .how-dashboard-inner {
  border-color: rgba(232, 152, 26, 0.35);
  box-shadow: 0 30px 80px rgba(232, 152, 26, 0.08);
}

:is(.how-dashboard, .how-mobile-dash)[data-state="3"] .how-dashboard-inner {
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: 0 30px 80px rgba(6, 182, 212, 0.08);
}

/* ── Dashboard glow animation (activated on scroll via .is-visible) ── */

@keyframes dashboard-glow {
  0%, 100% {
    border-color: var(--border);
    box-shadow: 0 30px 80px rgba(16, 15, 13, 0.45);
  }
  50% {
    border-color: rgba(6, 182, 212, 0.18);
    box-shadow: 0 30px 80px rgba(16, 15, 13, 0.45), 0 0 25px rgba(6, 182, 212, 0.08);
  }
}

/* Glow applies to any dashboard-inner whose parent scrolled into view */
.is-visible .how-dashboard-inner {
  animation: dashboard-glow 4s ease-in-out infinite;
}

/* ── Mobile static dashboard (hidden on desktop) ── */

.how-mobile-dash {
  display: none;
}

/* Step indicator dots */

.how-step-indicator {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.how-step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.4s ease, transform 0.3s ease;
}

:is(.how-dashboard, .how-mobile-dash)[data-state="1"] .how-step-dot[data-step="1"],
:is(.how-dashboard, .how-mobile-dash)[data-state="2"] .how-step-dot[data-step="2"],
:is(.how-dashboard, .how-mobile-dash)[data-state="3"] .how-step-dot[data-step="3"] {
  background: var(--primary-500);
  transform: scale(1.3);
}

/* Lead counter */

.how-lead-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  overflow: hidden;
}

.how-lead-label {
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.6);
  font-weight: 500;
}

.how-lead-count {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: right;
  min-width: 3ch;
  transition: color 0.4s ease;
}

:is(.how-dashboard, .how-mobile-dash)[data-state="2"] .how-lead-count {
  color: var(--primary-500);
}

:is(.how-dashboard, .how-mobile-dash)[data-state="3"] .how-lead-count {
  color: var(--accent);
}

/* AI badge */

.how-ai-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  transition: background 0.4s ease, border-color 0.4s ease;
}

:is(.how-dashboard, .how-mobile-dash)[data-state="2"] .how-ai-badge {
  background: rgba(232, 152, 26, 0.12);
  border-color: rgba(232, 152, 26, 0.25);
}

:is(.how-dashboard, .how-mobile-dash)[data-state="3"] .how-ai-badge {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.35);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: badge-pulse 2s ease-in-out infinite;
}

:is(.how-dashboard, .how-mobile-dash)[data-state="2"] .badge-dot {
  background: var(--primary-500);
}

:is(.how-dashboard, .how-mobile-dash)[data-state="3"] .badge-dot {
  background: #22c55e;
}

.badge-text {
  font-size: 0.8rem;
  color: rgba(226, 232, 240, 0.75);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Typewriter effect on badge text via JS-driven data attribute */

.badge-text[data-typewriter]::after {
  content: "|";
  display: inline-block;
  animation: cursor-blink 0.7s step-end infinite;
  color: var(--accent);
  font-weight: 300;
  margin-left: 2px;
}

@keyframes cursor-blink {
  50% { opacity: 0; }
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* ── Mobile typewriter animation for badge text ── */

@keyframes typewriter-mobile {
  from { width: 0; }
  to { width: 100%; }
}

.how-mobile-dash.is-visible .badge-text[data-typewriter] {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  animation: typewriter-mobile 0.9s steps(30, end) forwards;
  animation-delay: 0.5s;
}

/* Mini chart */

.how-chart-area {
  height: 60px;
  border-radius: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
  position: relative;
}

.how-chart-svg {
  width: 100%;
  height: 100%;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(6, 182, 212, 0.3));
  transition: stroke 0.5s ease, filter 0.5s ease;
}

:is(.how-dashboard, .how-mobile-dash)[data-state="2"] .chart-line {
  stroke: var(--primary-500);
  filter: drop-shadow(0 0 6px rgba(232, 152, 26, 0.3));
}

/* Scrub bar */

.how-scrub-bar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.scrub-track {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.scrub-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary-500), var(--accent));
  transition: width 0.1s linear;
}

.scrub-label {
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.45);
  font-weight: 500;
  text-align: center;
  letter-spacing: 0.05em;
}

/* ── Steps (scrollable right) ── */

.how-steps {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5rem;
  padding-top: 0.5rem;
}

.how-steps-header {
  margin-bottom: 1rem;
}

.how-step {
  position: relative;
  padding: 2rem 2rem 2.5rem;
  border-radius: 1.75rem;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.how-step::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(140deg, rgba(232, 152, 26, 0.18), rgba(6, 182, 212, 0.08));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.how-step:hover::before,
.how-step:focus-within::before {
  opacity: 1;
}

.how-step-head {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.how-step-num {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: rgba(226, 232, 240, 0.4);
}

.how-step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.9rem;
  background: linear-gradient(130deg, rgba(232, 152, 26, 0.2), rgba(6, 182, 212, 0.15));
}

.how-step-title {
  margin-top: 1.25rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
}

.how-step-desc {
  margin-top: 0.75rem;
  color: rgba(226, 232, 240, 0.75);
  line-height: 1.65;
}

/* ── Mobile stacked layout ── */

@media (max-width: 767px) {
  .how-section {
    padding-top: 5rem;
  }

  .how-split {
    flex-direction: column;
    gap: 2rem;
  }

  .how-dashboard {
    display: none !important;
  }

  .how-mobile-dash {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 1rem auto 4rem;
  }

  .how-steps {
    gap: 2.5rem;
    padding-top: 0;
  }

  .how-steps-header {
    text-align: left;
    margin-bottom: 1rem;
  }

  .how-step {
    padding: 1.5rem;
    margin-bottom: 1rem;
  }

  .how-step-head {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }

  .how-dashboard-inner {
    padding: 1.25rem 1rem;
    gap: 1rem;
    background: #0f172a;
    backdrop-filter: blur(20px);
    opacity: 1 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    min-height: 260px;
  }

  .how-lead-count {
    font-size: 1.5rem;
  }

  .badge-text {
    font-size: 0.7rem;
  }

  .how-chart-area {
    height: 40px;
  }
}

.faq-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.5rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 1.25rem 1.5rem;
}

.faq-item button {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
  font-weight: 600;
  color: #fff;
}

.faq-item .chevron {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent);
  transition: transform 0.3s ease;
}

.faq-item.active .chevron {
  transform: rotate(180deg);
}

.faq-content {
  overflow: hidden;
  height: 0;
  opacity: 0;
  transition: height 0.35s ease, opacity 0.35s ease, margin-top 0.35s ease;
}

.faq-item.active .faq-content {
  opacity: 1;
  margin-top: 1rem;
}

.faq-content p {
  color: rgba(226, 232, 240, 0.75);
  line-height: 1.6;
}

.contact-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 2rem;
  border-radius: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.contact-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(140deg, rgba(6, 182, 212, 0.18), rgba(232, 152, 26, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.contact-card:hover,
.contact-card:focus {
  transform: translateY(-4px);
  border-color: rgba(6, 182, 212, 0.45);
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.5);
}

.contact-card:hover::after,
.contact-card:focus::after {
  opacity: 1;
}

.contact-card > * {
  position: relative;
  z-index: 1;
}

.contact-icon {
  display: inline-flex;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  align-items: center;
  justify-content: center;
  background: rgba(6, 182, 212, 0.16);
  color: var(--accent);
}

.footer-link {
  position: relative;
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  transition: color 0.25s ease, transform 0.25s ease;
}

.footer-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.4rem;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.footer-link:hover,
.footer-link:focus {
  color: var(--accent);
  transform: translateY(-1px);
}

.footer-link:hover::after,
.footer-link:focus::after {
  transform: scaleX(1);
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Transparent video overlay — rendered from Remotion with alpha channel */
.hero-video {
  display: block;
  width: min(510px, 90vw);
  max-height: 85vh;
  height: auto;
  border-radius: 1.5rem;
  object-fit: contain;
  /* blend the video over any background — the alpha channel is handled by the codec */
}

@media (min-width: 1024px) {
  .hero-video {
    width: min(570px, 54vw);
    max-height: 90vh;
  }
}

.phone-frame {
  position: relative;
  width: min(320px, 100%);
  will-change: transform;
  border-radius: 2rem;
  padding: 1.5rem 1.1rem 2rem;
  background: linear-gradient(160deg, #1a1a1a, #0d0d0d);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 40px 100px rgba(16, 15, 13, 0.55);
  transform: rotateY(-6deg) rotateX(4deg);
  animation: deviceFloat 12s cubic-bezier(0.16, 1, 0.3, 1) infinite, phoneGlow 12s ease infinite;
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1.5rem;
}

.status-icons {
  display: flex;
  gap: 0.3rem;
}

.status-icons .dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
}

.chat-window {
  display: grid;
  gap: 0.6rem;
  position: relative;
}

/* ── message base ── */
.message {
  padding: 0.9rem 1rem;
  max-width: 230px;
  position: relative;
  opacity: 0;
  transform: translateY(16px);
  animation: msg-cycle 12s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.message .label {
  display: block;
  font-size: 0.65rem;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0.3rem;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 400;
}

.message .label .timestamp {
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.6rem;
}

.message p {
  font-size: 0.95rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.88);
}

.message.incoming {
  background: rgba(38, 38, 38, 0.85);
  border-radius: 0.375rem 1.375rem 1.375rem 1.375rem;
  animation-name: msg-incoming;
  animation-delay: 0s;
}

/* second incoming: later entrance, same exit */
.message.incoming:nth-child(2) {
  animation-name: msg-incoming-2;
  animation-delay: 0s;
}

.message.outgoing {
  margin-left: auto;
  background: linear-gradient(135deg, #E1306C, #833AB4);
  border-radius: 1.375rem 0.375rem 1.375rem 1.375rem;
}

.message.reply-instant {
  animation-name: msg-reply;
  animation-delay: 0s;
}

.message.reply-typing {
  animation-name: msg-reply-typing;
  animation-delay: 0s;
}

.message.outgoing .label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.6rem;
}

.message .typing {
  letter-spacing: 0.15em;
  text-transform: none;
  font-style: italic;
  opacity: 0.7;
}

/* ── waiting dots ── */
.waiting-dots {
  display: flex;
  gap: 0.35rem;
  padding: 0.4rem 1rem;
  opacity: 0;
  animation: waiting-blink 12s step-end infinite;
}

.waiting-dots .dot {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.5);
  opacity: 0.4;
}

.waiting-dots .dot:nth-child(1) { animation: dot-pulse 0.9s ease infinite 0s; }
.waiting-dots .dot:nth-child(2) { animation: dot-pulse 0.9s ease infinite 0.3s; }
.waiting-dots .dot:nth-child(3) { animation: dot-pulse 0.9s ease infinite 0.6s; }

/* ── badge ── */
.floating-badge {
  display: inline-grid;
  place-items: center;
  position: relative;
  padding: 0.75rem 1.6rem;
  will-change: transform;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.2);
  color: #f8fafc;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  box-shadow: 0 18px 45px rgba(6, 182, 212, 0.25);
  animation: badge-float-cycle 12s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.floating-badge .badge-text {
  grid-row: 1;
  grid-column: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.badge-state-1 { animation: badge-text-1 12s step-end infinite; }
.badge-state-2 { animation: badge-text-2 12s step-end infinite; }
.badge-state-3 { animation: badge-text-3 12s step-end infinite; }

/* ═══════════════════════════════════════════
   KEYFRAMES — 12-second master cycle
   ═══════════════════════════════════════════ */

/* ── incoming comment: appears early, visible through the whole arc, fades at end ── */
@keyframes msg-incoming {
  0%           { opacity: 0; transform: translateY(16px) scale(0.97); }
  3%, 8%       { opacity: 1; transform: translateY(0) scale(1); }
  80%          { opacity: 1; transform: translateY(0) scale(1); }
  88%, 100%    { opacity: 0; transform: translateY(8px) scale(0.98); }
}

/* ── second incoming: slightly later entrance, same exit at 80–88% ── */
@keyframes msg-incoming-2 {
  0%           { opacity: 0; transform: translateY(16px) scale(0.97); }
  8%, 13%      { opacity: 1; transform: translateY(0) scale(1); }
  80%          { opacity: 1; transform: translateY(0) scale(1); }
  88%, 100%    { opacity: 0; transform: translateY(8px) scale(0.98); }
}

/* ── digi-talk instant reply: snaps in fast at 33% (4s), stays until fade-out ── */
@keyframes msg-reply {
  0%, 32%      { opacity: 0; transform: translateY(12px) scale(0.96); }
  35%, 38%     { opacity: 1; transform: translateY(0) scale(1); }
  80%          { opacity: 1; transform: translateY(0) scale(1); }
  88%, 100%    { opacity: 0; transform: translateY(8px) scale(0.98); }
}

/* ── second automated reply with typing: appears at 50% (6s) ── */
@keyframes msg-reply-typing {
  0%, 49%      { opacity: 0; transform: translateY(12px) scale(0.96); }
  52%, 55%     { opacity: 1; transform: translateY(0) scale(1); }
  80%          { opacity: 1; transform: translateY(0) scale(1); }
  88%, 100%    { opacity: 0; transform: translateY(8px) scale(0.98); }
}

/* ── waiting dots: blink during the pause (12%–25% of 12s = 1.44–3s) ── */
@keyframes waiting-blink {
  0%, 10%      { opacity: 0; }
  12%, 26%     { opacity: 1; }
  27%, 100%    { opacity: 0; }
}

@keyframes dot-pulse {
  0%, 100%     { opacity: 0.3; }
  50%          { opacity: 1; }
}

/* ── badge float: gentle drift, with a settle pulse at 66% (8s) ── */
@keyframes badge-float-cycle {
  0%, 66%      { transform: translateY(0); }
  30%          { transform: translateY(-6px); }
  68%          { transform: translateY(3px); }
  72%, 100%    { transform: translateY(0); }
}

/* ── badge text cycling ── */
@keyframes badge-text-1 {
  0%, 28%      { opacity: 1; }
  29%, 100%    { opacity: 0; }
}
@keyframes badge-text-2 {
  0%, 28%      { opacity: 0; }
  29%, 54%     { opacity: 1; }
  55%, 100%    { opacity: 0; }
}
@keyframes badge-text-3 {
  0%, 54%      { opacity: 0; }
  55%, 88%     { opacity: 1; }
  89%, 100%    { opacity: 0; }
}

/* ── device float with settle at 66% (8s) ── */
@keyframes deviceFloat {
  0%,
  66% {
    transform: translateY(0) rotateY(-6deg) rotateX(4deg);
  }
  30% {
    transform: translateY(-12px) rotateY(-4deg) rotateX(2deg);
  }
  68% {
    transform: translateY(4px) rotateY(-5deg) rotateX(3deg);
  }
  72%,
  100% {
    transform: translateY(0) rotateY(-6deg) rotateX(4deg);
  }
}

/* ── phone glow pulse at automation moment (33%) ── */
@keyframes phoneGlow {
  0%, 31%  { box-shadow: 0 40px 100px rgba(16, 15, 13, 0.55); }
  33%, 38% { box-shadow: 0 40px 120px rgba(6, 182, 212, 0.25), 0 0 60px rgba(6, 182, 212, 0.12); }
  42%, 100% { box-shadow: 0 40px 100px rgba(16, 15, 13, 0.55); }
}

.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 26, 0.7);
  backdrop-filter: blur(18px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 60;
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu__dialog {
  width: 100%;
  max-width: 360px;
  border-radius: 1.75rem;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.92);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mobile-menu__dialog nav a {
  display: block;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: color 0.25s ease;
}

.mobile-menu__dialog nav a:hover,
.mobile-menu__dialog nav a:focus {
  color: var(--accent);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 26, 0.75);
  backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 70;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: none;
  z-index: 80;
}

.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 420px;
  border-radius: 1.75rem;
  padding: 2.5rem 2rem 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 30px 100px rgba(15, 23, 42, 0.6);
  transform: translateY(24px) scale(0.98);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.modal.active {
  pointer-events: auto;
}

.modal.active .modal__dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal__close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  padding: 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(226, 232, 240, 0.8);
  background: rgba(15, 23, 42, 0.75);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.modal__close:hover,
.modal__close:focus {
  color: #fff;
  border-color: rgba(6, 182, 212, 0.5);
}

.modal-link {
  border-radius: 0.95rem;
  padding: 0.85rem 1rem;
  background: rgba(232, 152, 26, 0.14);
  transition: background 0.25s ease;
}

.modal-link:hover,
.modal-link:focus {
  background: rgba(6, 182, 212, 0.22);
}

.modal-pulse {
  animation: modalPulse 0.4s ease;
}

@keyframes modalPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

[data-section] {
  scroll-margin-top: clamp(80px, 12vw, 140px);
}

[data-animate] {
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 0.65s cubic-bezier(0.19, 1, 0.22, 1), transform 0.65s cubic-bezier(0.19, 1, 0.22, 1);
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-animate="fade-in"] {
  transform: translateY(20px) scale(0.98);
}

[data-animate="fade-in"].is-visible {
  transform: translateY(0) scale(1);
}

[data-animate="fade-up"].is-visible[data-animate-delay="100"] {
  transition-delay: 0.12s;
}

[data-animate="fade-up"].is-visible[data-animate-delay="200"] {
  transition-delay: 0.2s;
}

[data-animate="fade-up"].is-visible[data-animate-delay="300"] {
  transition-delay: 0.28s;
}

/* Legal pages shared styles */
.legal-hero {
  background: linear-gradient(160deg, rgba(232, 152, 26, 0.2), rgba(6, 182, 212, 0.1));
  border-radius: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3rem;
  box-shadow: var(--shadow);
}

.legal-toc {
  position: sticky;
  top: 7.5rem;
  border-radius: 1.75rem;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.75);
}

.legal-toc a {
  display: block;
  margin-bottom: 0.75rem;
  color: rgba(203, 213, 225, 0.9);
  text-decoration: none;
  transition: color 0.2s ease;
}

.legal-toc a:hover,
.legal-toc a:focus {
  color: var(--accent);
}

.legal-section {
  padding-block: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.legal-section:last-child {
  border-bottom: none;
}

.legal-section h2 {
  font-size: clamp(1.4rem, 2vw, 1.7rem);
  font-weight: 600;
  color: #fff;
  margin-bottom: 1rem;
}

.legal-section p,
.legal-section ul {
  color: rgba(226, 232, 240, 0.78);
  line-height: 1.75;
}

.legal-section ul {
  padding-left: 1rem;
  margin-top: 0.75rem;
  list-style: disc;
}

/* Print styles for legal PDFs */
@media print {
  body {
    background: #fff !important;
    color: #0f172a !important;
  }

  header,
  footer,
  nav,
  .modal,
  .modal-backdrop,
  .mobile-menu,
  .gradient-button,
  .background-grid {
    display: none !important;
  }

  main {
    padding: 0;
    margin: 0;
  }

  [data-section] {
    scroll-margin-top: auto;
  }

  .legal-hero,
  .legal-toc {
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .legal-section {
    border-color: rgba(15, 23, 42, 0.1);
  }
}

@media (max-width: 1023px) {
  header nav {
    padding: 1.1rem 1.4rem;
  }

  .phone-frame {
    margin-inline: auto;
    transform: translateY(0) rotateY(-2deg) rotateX(0deg);
  }
}

@media (max-width: 374px) {
  .legal-hero {
    padding: 1.75rem;
  }

  .modal__dialog {
    padding: 2rem 1.25rem 2.25rem;
  }

  .floating-badge {
    font-size: 0.65rem;
    padding: 0.5rem 1rem;
  }
}

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

  .message {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .waiting-dots {
    animation: none !important;
    opacity: 1 !important;
  }

  .waiting-dots .dot {
    animation: none !important;
    opacity: 0.7 !important;
  }

  .badge-text {
    animation: none !important;
  }

  .badge-state-1 {
    opacity: 1 !important;
  }

  .badge-state-2,
  .badge-state-3 {
    opacity: 0 !important;
  }

  .phone-frame {
    animation: none !important;
    box-shadow: 0 40px 100px rgba(16, 15, 13, 0.55) !important;
  }

  .floating-badge {
    animation: none !important;
    transform: none !important;
  }

  /* How-section reduced motion overrides */
  .badge-dot {
    animation: none !important;
  }

  .badge-text[data-typewriter]::after {
    animation: none !important;
    content: "" !important;
  }

  /* Disable dashboard glow when reduced motion is preferred */
  .is-visible .how-dashboard-inner {
    animation: none !important;
  }

  /* Disable mobile typewriter animation */
  .how-mobile-dash .badge-text[data-typewriter] {
    animation: none !important;
    width: auto !important;
  }

  .scrub-fill {
    transition: none !important;
  }

  .chart-line {
    transition: none !important;
  }

  :is(.how-dashboard, .how-mobile-dash)[data-state="1"] .how-step-dot,
  :is(.how-dashboard, .how-mobile-dash)[data-state="2"] .how-step-dot,
  :is(.how-dashboard, .how-mobile-dash)[data-state="3"] .how-step-dot {
    transform: none !important;
  }
}
