/* ==========================================================================
   Alfred — custom styles
   Tailwind (Play CDN) handles layout and spacing utilities. This file holds
   the brand layer: glassmorphism, glows, buttons, form controls, and the
   call-state animations for the live demo. Plain CSS (no @apply) so it works
   with or without a Tailwind build step.
   ========================================================================== */

:root {
  --ink: #0f172a;
  --ink-900: #0b1120;
  --cyan: #06b6d4;
  --emerald: #10b981;
  --rose: #f43f5e;
  --amber: #f59e0b;
  --glass-bg: rgba(15, 23, 42, 0.55);
  --glass-border: rgba(148, 163, 184, 0.12);
  --radius: 0.875rem;
}

html { -webkit-tap-highlight-color: transparent; }
body { background-color: var(--ink); overflow-x: hidden; }

/* Ambient aurora background ------------------------------------------------ */
.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(6, 182, 212, 0.14), transparent 60%),
    radial-gradient(50rem 30rem at -10% 30%, rgba(16, 185, 129, 0.10), transparent 60%),
    radial-gradient(40rem 25rem at 50% 110%, rgba(6, 182, 212, 0.08), transparent 60%),
    var(--ink);
}

/* Glassmorphism ------------------------------------------------------------ */
.glass {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.55), var(--glass-bg));
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Gradient text ------------------------------------------------------------ */
.text-gradient {
  background: linear-gradient(90deg, var(--cyan), var(--emerald));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Logo mark ---------------------------------------------------------------- */
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  color: var(--ink);
  background: linear-gradient(135deg, var(--cyan), var(--emerald));
  box-shadow: 0 0 24px -4px rgba(6, 182, 212, 0.6);
}

/* Navigation --------------------------------------------------------------- */
.nav-link { position: relative; transition: color 0.2s; }
.nav-link:hover { color: #fff; }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}
.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); }
.nav-link.is-active { color: #fff; }

.mobile-link {
  display: block;
  padding: 0.75rem 0.75rem;
  border-radius: 0.5rem;
  color: #cbd5e1;
}
.mobile-link:hover, .mobile-link:focus-visible { background: rgba(255, 255, 255, 0.05); color: #fff; }

/* Buttons ------------------------------------------------------------------ */
.btn-primary, .btn-secondary, .btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: 0.65rem;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.25rem;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease, opacity 0.2s;
  cursor: pointer;
  white-space: nowrap;
}
.btn-lg { padding: 0.9rem 1.4rem; font-size: 1rem; }

.btn-primary {
  color: var(--ink);
  background: linear-gradient(135deg, #22d3ee, var(--cyan) 45%, var(--emerald));
  box-shadow: 0 8px 30px -10px rgba(6, 182, 212, 0.7);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 36px -10px rgba(6, 182, 212, 0.9); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-secondary {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(6, 182, 212, 0.5); }

.btn-danger {
  color: #fff;
  background: var(--rose);
  box-shadow: 0 8px 30px -10px rgba(244, 63, 94, 0.7);
}
.btn-danger:hover { background: #e11d48; }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* Section scaffolding ------------------------------------------------------ */
.section { padding: 4.5rem 0; }
@media (min-width: 1024px) { .section { padding: 6.5rem 0; } }

.section-head { max-width: 46rem; margin: 0 auto; text-align: center; }
.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}
.section-title {
  margin-top: 0.75rem;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #fff;
}
.section-sub { margin-top: 1rem; font-size: 1.075rem; line-height: 1.7; color: #94a3b8; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #a5f3fc;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

/* Chat bubbles (hero + transcript) ---------------------------------------- */
.bubble {
  max-width: 88%;
  padding: 0.65rem 0.9rem;
  border-radius: 0.9rem;
  line-height: 1.5;
}
.bubble-ai {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: #e0f7fb;
  border-bottom-left-radius: 0.25rem;
}
.bubble-user {
  margin-left: auto;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.15);
  color: #e2e8f0;
  border-bottom-right-radius: 0.25rem;
}
.bubble-partial { opacity: 0.6; font-style: italic; }
.bubble-role {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
}
.transcript-empty { color: #64748b; text-align: center; padding-top: 5rem; }
.transcript-system { color: #64748b; font-size: 0.75rem; text-align: center; }
.transcript-system.is-error { color: #fda4af; }

#transcript li { animation: fade-up 0.25s ease both; }

/* Live demo: orb + call states -------------------------------------------- */
.orb-wrap {
  position: relative;
  width: 9rem;
  height: 9rem;
  display: grid;
  place-items: center;
}
.orb {
  position: relative;
  z-index: 1;
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #e2e8f0;
  background: radial-gradient(circle at 30% 30%, #1e293b, #0b1120);
  border: 1px solid rgba(148, 163, 184, 0.2);
  transition: box-shadow 0.3s, color 0.3s, border-color 0.3s, transform 0.12s linear;
  /* --level is updated from JS with the live audio volume (0–1). */
  transform: scale(calc(1 + var(--level, 0) * 0.18));
}
.orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 2px solid transparent;
  opacity: 0;
}

.status-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background: #64748b;
  transition: background-color 0.2s;
}

/* idle */
.demo-card[data-state="idle"] .orb { box-shadow: 0 0 0 0 transparent; }

/* connecting — amber, spinning ring */
.demo-card[data-state="connecting"] .status-dot { background: var(--amber); animation: blink 1s infinite; }
.demo-card[data-state="connecting"] .orb { color: var(--amber); border-color: rgba(245, 158, 11, 0.4); }
.demo-card[data-state="connecting"] .orb-ring {
  opacity: 1;
  border-color: rgba(245, 158, 11, 0.6) transparent rgba(245, 158, 11, 0.15) transparent;
  animation: spin 1.1s linear infinite;
}

/* listening — cyan, slow breathing pulse */
.demo-card[data-state="listening"] .status-dot { background: var(--cyan); }
.demo-card[data-state="listening"] .orb {
  color: #67e8f9;
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 0 40px -6px rgba(6, 182, 212, 0.55);
}
.demo-card[data-state="listening"] .orb-ring {
  border-color: rgba(6, 182, 212, 0.45);
  animation: ripple 2.4s ease-out infinite;
}
.demo-card[data-state="listening"] .orb-ring-2 { animation-delay: 1.2s; }

/* speaking — emerald, faster ripple */
.demo-card[data-state="speaking"] .status-dot { background: var(--emerald); animation: blink 0.6s infinite; }
.demo-card[data-state="speaking"] .orb {
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 0 55px -4px rgba(16, 185, 129, 0.65);
}
.demo-card[data-state="speaking"] .orb-ring {
  border-color: rgba(16, 185, 129, 0.5);
  animation: ripple 1.2s ease-out infinite;
}
.demo-card[data-state="speaking"] .orb-ring-2 { animation-delay: 0.6s; }

/* ended */
.demo-card[data-state="ended"] .status-dot { background: var(--rose); }
.demo-card[data-state="ended"] .orb { color: #94a3b8; opacity: 0.7; }

/* error */
.demo-card[data-state="error"] .status-dot { background: var(--rose); animation: blink 1s infinite; }
.demo-card[data-state="error"] .orb { color: #fda4af; border-color: rgba(244, 63, 94, 0.4); }

/* How it works -------------------------------------------------------------- */
.step-card { position: relative; transition: transform 0.25s ease, border-color 0.25s ease; }
.step-card:hover { transform: translateY(-4px); border-color: rgba(6, 182, 212, 0.35); }
.step-num {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 2.5rem;
  font-weight: 700;
  color: rgba(148, 163, 184, 0.12);
}
.step-icon {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.8rem;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.2);
}

/* ROI calculator: range sliders ------------------------------------------- */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 0.5rem;
  border-radius: 999px;
  /* --fill is set from JS to the slider's percentage position. */
  background: linear-gradient(90deg, var(--cyan), var(--emerald)) 0 0 / var(--fill, 50%) 100% no-repeat,
              rgba(148, 163, 184, 0.18);
  cursor: pointer;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: #fff;
  border: 4px solid var(--cyan);
  box-shadow: 0 0 0 6px rgba(6, 182, 212, 0.15), 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s;
}
.range::-webkit-slider-thumb:active { transform: scale(1.12); }
.range::-moz-range-thumb {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: #fff;
  border: 4px solid var(--cyan);
  box-shadow: 0 0 0 6px rgba(6, 182, 212, 0.15);
}

.roi-result {
  border-color: rgba(244, 63, 94, 0.2);
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.07), var(--glass-bg));
}
.roi-bump { animation: bump 0.3s ease; }

/* Integrations ------------------------------------------------------------- */
.integration {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.95rem 0.75rem;
  border-radius: 0.8rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #e2e8f0;
  text-align: center;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid var(--glass-border);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.integration:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--dot) 55%, transparent);
  box-shadow: 0 8px 24px -12px var(--dot);
}
.integration-dot {
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--dot);
  box-shadow: 0 0 10px var(--dot);
}

/* Proof metrics ------------------------------------------------------------ */
.metric {
  padding: 1.25rem;
  border-radius: 0.9rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
}
.metric dt { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8; }
.metric dd { margin-top: 0.4rem; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 2rem; font-weight: 700; }

/* Pricing ------------------------------------------------------------------ */
.pricing-card {
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: 0 0 80px -30px rgba(6, 182, 212, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.check { position: relative; padding-left: 1.85rem; }
.check::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='3'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 0.75rem no-repeat,
    rgba(16, 185, 129, 0.12);
}

/* FAQ ---------------------------------------------------------------------- */
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 1.1rem 3rem 1.1rem 1.25rem;
  font-weight: 600;
  color: #f1f5f9;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--cyan);
  transition: transform 0.2s;
}
.faq[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq p { padding: 0 1.25rem 1.2rem; color: #94a3b8; line-height: 1.7; }

/* Form fields -------------------------------------------------------------- */
.field-label { display: block; margin-bottom: 0.4rem; font-size: 0.8rem; font-weight: 600; color: #cbd5e1; }
.field {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 0.65rem;
  font-size: 1rem; /* 16px prevents iOS zoom-on-focus */
  color: #f1f5f9;
  background: rgba(11, 17, 32, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field::placeholder { color: #475569; }
.field:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2); }
.field.is-invalid { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15); }
select.field {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 1rem;
}
select.field option { background: var(--ink); }

/* Sticky mobile CTA -------------------------------------------------------- */
.mobile-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.95) 35%);
  transform: translateY(110%);
  transition: transform 0.3s ease;
}
.mobile-cta.is-visible { transform: translateY(0); }
@media (max-width: 1023px) { footer { padding-bottom: 4.5rem; } }

/* Scroll reveal ------------------------------------------------------------ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* Keyframes ---------------------------------------------------------------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ripple {
  0%   { transform: scale(0.72); opacity: 0.9; }
  100% { transform: scale(1.25); opacity: 0; }
}
@keyframes blink { 50% { opacity: 0.35; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes bump { 50% { transform: scale(1.03); } }

/* Respect reduced-motion preferences -------------------------------------- */
@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;
  }
  .reveal { opacity: 1; transform: none; }
}
