:root {
  --bg: #0f1115;
  --bg-elev: #161922;
  --fg: #f5f6f8;
  --fg-muted: #9aa1ad;
  --fg-dim: #6b7280;
  --accent: #5276e4;
  --accent-hover: #6b8aea;
  --accent-alt: #7a5cff;
  --accent-cta: #0a84ff;
  --accent-cta-hover: #2b95ff;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui,
    sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f7fc;
    --bg-elev: #ffffff;
    --fg: #0c0e12;
    --fg-muted: #3f4755;
    --fg-dim: #7a8494;
    --border: rgba(0, 0, 0, 0.14);
    --shadow: 0 24px 60px rgba(15, 17, 21, 0.12);
    --accent-alt: #5e52c8;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
}

body::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 880px;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(ellipse 95% 75vh at -10% -25%,
      color-mix(in srgb, var(--accent) 38%, transparent),
      transparent 78%),
    radial-gradient(ellipse 90% 70vh at 110% -15%,
      color-mix(in srgb, var(--accent-alt) 32%, transparent),
      transparent 78%),
    radial-gradient(ellipse 100% 45vh at 50% -20%,
      color-mix(in srgb, var(--accent) 18%, transparent),
      transparent 80%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}

@media (prefers-color-scheme: light) {
  body::before {
    background:
      radial-gradient(ellipse 95% 75vh at -10% -25%,
        color-mix(in srgb, var(--accent) 58%, transparent),
        transparent 78%),
      radial-gradient(ellipse 90% 70vh at 110% -15%,
        color-mix(in srgb, var(--accent-alt) 48%, transparent),
        transparent 78%),
      radial-gradient(ellipse 100% 45vh at 50% -20%,
        color-mix(in srgb, var(--accent) 34%, transparent),
        transparent 80%);
  }
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1, h2, h3 {
  margin: 0 0 0.4em;
  letter-spacing: -0.02em;
  font-weight: 700;
}

h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); line-height: 1.08; max-width: 8em; margin: 0 auto 0.4em auto;}
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.15; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1em; }
.muted { color: var(--fg-muted); }

/* ---------- main wrapper ---------- */
main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 max(20px, 5vw);
}

section {
  padding: 72px 0;
  border-bottom: 1px solid var(--border);
}
section:last-of-type { border-bottom: none; }

/* ---------- hero ---------- */
.hero {
  text-align: center;
  padding-top: 48px;
}
.hero .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 124px;
}
.hero .brand img { border-radius: 8px; }
.hero .lede {
  font-size: 1.2rem;
  color: var(--fg-muted);
  max-width: 36em;
  margin: 0 auto 2em;
}
.hero-note {
  margin-top: 18px;
  color: var(--fg-muted);
  font-size: 0.95rem;
  opacity: 0.6;
}
/* ---------- buttons ---------- */
.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}
.btn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid transparent;
  transition: transform 0.05s ease, background 0.15s ease;
  text-align: left;
  width: 260px;
  max-width: 100%;
}
.btn-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.btn-label {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
}
.btn-title { line-height: 1.2; }
.btn-sub {
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.78;
  margin-top: 2px;
}
.btn.primary {
  background: var(--accent-cta);
  color: #fff;
}
.btn.primary:hover {
  background: var(--accent-cta-hover);
  color: #fff;
}
.btn.primary:active { transform: translateY(1px); }

.hero .btn {
  padding: 12px 20px;
}
.hero .btn.primary {
  background: color-mix(in srgb, var(--accent-cta) 14%, transparent);
  color: var(--accent-cta);
  border-color: color-mix(in srgb, var(--accent-cta) 28%, transparent);
}
.hero .btn.primary:hover {
  background: color-mix(in srgb, var(--accent-cta) 22%, transparent);
  color: var(--accent-cta);
}

/* ---------- features (alternating image + text) ---------- */
.features {
  display: flex;
  flex-direction: column;
  gap: 64px;
}
.feature {
  display: grid;
  grid-template-columns: 0.85fr 1.5fr;
  gap: 64px;
  align-items: center;
}
.feature-shot {
  position: relative;
}
.feature-shot::before {
  --glow-w: 29%;
  --glow-h: 97%;
  content: "";
  position: absolute;
  top: -80px;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(ellipse var(--glow-w) var(--glow-h) at 50% 50%,
    color-mix(in srgb, var(--accent) 22%, transparent),
    transparent 70%);
  mask-image: linear-gradient(to bottom,
    transparent 0%, #000 15%, #000 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom,
    transparent 0%, #000 15%, #000 85%, transparent 100%);
}
.feature.reverse .feature-shot::before {
  background: radial-gradient(ellipse var(--glow-w) var(--glow-h) at 50% 50%,
    color-mix(in srgb, var(--accent-alt) 20%, transparent),
    transparent 70%);
}
@media (prefers-color-scheme: light) {
  .feature-shot::before {
    background: radial-gradient(ellipse var(--glow-w) var(--glow-h) at 50% 50%,
      color-mix(in srgb, var(--accent) 36%, transparent),
      transparent 70%);
  }
  .feature.reverse .feature-shot::before {
    background: radial-gradient(ellipse var(--glow-w) var(--glow-h) at 50% 50%,
      color-mix(in srgb, var(--accent-alt) 32%, transparent),
      transparent 70%);
  }
}
.feature.reverse { grid-template-columns: 1.5fr 0.85fr; }
.feature.reverse .feature-text { order: 2; }
.feature.reverse .feature-shot { order: 1; }
.feature-text h2 { margin-bottom: 16px; }
.feature-text p { color: var(--fg-muted); margin: 0; font-size: 1.05rem; }
.feature-shot img { width: 100%; height: auto; }

@media (max-width: 820px) {
  .feature,
  .feature.reverse {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .feature.reverse .feature-text { order: initial; }
  .feature.reverse .feature-shot { order: initial; }
  .features { gap: 64px; }
  .feature-shot::before {
    --glow-w: 70%;
    --glow-h: 60%;
  }
}

/* ---------- shared section bits ---------- */
.section-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 12px;
}
.section-intro {
  color: var(--fg-muted);
  font-size: 1.1rem;
  max-width: 44em;
  margin: 0 0 48px;
}

/* ---------- problem section ---------- */
.problem { position: relative; }
.problem h2 { margin-bottom: 40px; }
.problems {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.problem-card {
  padding: 28px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
@media (prefers-color-scheme: light) {
  .problem-card {
    box-shadow: 0 1px 2px rgba(15, 17, 21, 0.04),
                0 8px 24px rgba(15, 17, 21, 0.06);
  }
}
.problem-card h3 { margin: 0 0 10px; }
.problem-card > p { color: var(--fg-muted); margin: 0; }
@media (max-width: 820px) {
  .problems { grid-template-columns: 1fr; }
}

.problem-icon,
.solution-icon {
  display: block;
  width: 32px;
  height: 32px;
  margin-bottom: 16px;
}
.problem-icon { color: #ff8a7c; }
@media (prefers-color-scheme: light) {
  .problem-icon { color: #e85c4d; }
}
.solution-icon { color: var(--accent-cta); }
.problem::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(ellipse 80% 60% at 50% 50%,
    color-mix(in srgb, #ff6b5c 9%, transparent),
    transparent 70%);
  mask-image: linear-gradient(to bottom,
    transparent 0%, #000 20%, #000 80%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom,
    transparent 0%, #000 20%, #000 80%, transparent 100%);
}
@media (prefers-color-scheme: light) {
  .problem::before {
    background: radial-gradient(ellipse 80% 60% at 50% 50%,
      color-mix(in srgb, #ff6b5c 20%, transparent),
      transparent 70%);
  }
}

/* ---------- cta ---------- */
.cta { text-align: center; }
.cta h2 { margin-bottom: 28px; }
.cta-sub {
  color: var(--fg-muted);
  margin: 0 auto 28px;
  max-width: 36em;
}

/* ---------- hero demo (voice -> text animation) ---------- */
.hero-demo {
  position: relative;
  max-width: 560px;
  margin: 28px auto 80px;
  text-align: left;
}

/* bars float as a pill overlapping the bottom edge of the window;
   fade out when not actively "speaking" */
.demo-bars {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform-origin: center bottom;
  transform: translateX(-50%) scale(0.2) translateY(-14px);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 12px 9px 10px;
  background: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 88%, #000 12%);
  border-radius: 999px;
  box-shadow: 0 0 28px 4px color-mix(in srgb, var(--accent) 50%, transparent);
  z-index: 2;
  opacity: 0;
  transition:
    opacity 0.2s ease-out 0.18s,
    transform 0.38s cubic-bezier(0.55, 0, 0.7, 0.15);
}
.hero-demo.is-speaking .demo-bars {
  opacity: 1;
  transform: translateX(-50%) scale(1) translateY(0);
  transition:
    opacity 0.22s ease-out,
    transform 0.4s cubic-bezier(0.18, 0.9, 0.3, 1.35);
}
.demo-mic {
  width: 14px;
  height: 14px;
  color: #fff;
  flex-shrink: 0;
  margin-right: 4px;
}
.demo-bars span {
  display: block;
  width: 3px;
  height: 20px;
  background: #fff;
  border-radius: 2px;
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.28s cubic-bezier(0.6, 0, 0.75, 0.05);
}
.hero-demo.is-speaking .demo-bars span:nth-child(2) { animation: bar-a 0.68s ease-in-out infinite; }
.hero-demo.is-speaking .demo-bars span:nth-child(3) { animation: bar-b 0.94s ease-in-out -0.18s infinite; }
.hero-demo.is-speaking .demo-bars span:nth-child(4) { animation: bar-c 0.56s ease-in-out -0.4s infinite; }
.hero-demo.is-speaking .demo-bars span:nth-child(5) { animation: bar-d 1.08s ease-in-out -0.12s infinite; }
.hero-demo.is-speaking .demo-bars span:nth-child(6) { animation: bar-e 0.82s ease-in-out -0.3s infinite; }
@keyframes bar-a {
  0%, 100% { transform: scaleY(0.3); }
  35%      { transform: scaleY(0.85); }
  70%      { transform: scaleY(0.5); }
}
@keyframes bar-b {
  0%, 100% { transform: scaleY(0.2); }
  40%      { transform: scaleY(1); }
  80%      { transform: scaleY(0.35); }
}
@keyframes bar-c {
  0%, 100% { transform: scaleY(0.45); }
  25%      { transform: scaleY(0.7); }
  60%      { transform: scaleY(0.22); }
  85%      { transform: scaleY(0.55); }
}
@keyframes bar-d {
  0%, 100% { transform: scaleY(0.35); }
  50%      { transform: scaleY(0.95); }
}
@keyframes bar-e {
  0%, 100% { transform: scaleY(0.15); }
  40%      { transform: scaleY(0.75); }
  75%      { transform: scaleY(0.4); }
}

.demo-window {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  transition: opacity 0.35s ease;
}
.hero-demo.is-fading .demo-window { opacity: 0; }

/* --- Per-app palettes: dark defaults, light overrides below --- */
.demo-window--terminal {
  background: #1a1d24;
  color: #e8ecf4;
}
.demo-window--messages {
  background: #0b0b0e;
  color: #f5f5f7;
}
.demo-window--editor {
  background: #1d1b17;
  color: #ebe4d3;
}

@media (prefers-color-scheme: light) {
  .demo-window--terminal {
    background: #f6f6f8;
    color: #1a1d24;
  }
  .demo-window--messages {
    background: #ffffff;
    color: #0c0e12;
  }
  .demo-window--editor {
    background: #fbfaf5;
    color: #1a1611;
  }
}

/* chrome (shared) */
.demo-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.demo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.demo-dot:nth-child(1) { background: #ff5f57; }
.demo-dot:nth-child(2) { background: #febc2e; }
.demo-dot:nth-child(3) { background: #28c840; }
.demo-title {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  color: currentColor;
  opacity: 0.7;
  font-weight: 500;
  margin-right: 42px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.demo-window--messages .demo-title {
  opacity: 1;
  font-weight: 600;
}
.demo-window--editor .demo-title {
  opacity: 0.5;
}

.demo-body {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  min-height: 220px;
  font-family: var(--font);
  font-size: 0.92rem;
}
.demo-prompt {
  flex-shrink: 0;
  font-weight: 600;
}
.demo-typed {
  color: inherit;
  display: inline-block;
  transform: translateY(6px);
  opacity: 0;
  transition:
    transform 0.38s cubic-bezier(0.2, 0.8, 0.3, 1),
    opacity 0.3s ease-out;
}
.hero-demo.has-text .demo-typed {
  transform: translateY(0);
  opacity: 1;
}
/* zero-width space keeps a text baseline in the bubble even when the typed
   text is empty, so the caret sits at the exact same height before and
   after transcription lands */
.demo-typed::before { content: "\200B"; }

.demo-bubble {
  display: inline-flex;
  align-items: center;
}

.demo-convo { display: none; }

.demo-caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  background: currentColor;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: caret-blink 1s steps(1, end) infinite;
}

/* --- Terminal body --- */
.demo-window--terminal .demo-body {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Code", Consolas, monospace;
  align-items: baseline;
  padding-top: 16px;
}
.demo-window--terminal .demo-prompt { color: var(--accent); }
.demo-window--terminal .demo-caret {
  width: 8px;
  height: 1em;
  background: currentColor;
  vertical-align: middle;
}

/* --- Messages body: conversation on top, compose field on bottom --- */
.demo-window--messages .demo-body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  padding: 0;
  flex-direction: column;
  align-items: stretch;
}
.demo-window--messages .demo-prompt { display: none; }

.demo-window--messages .demo-convo {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 5px;
  padding: 12px 12px 2px;
  flex: 1;
  min-height: 0;
}
.demo-msg {
  padding: 7px 13px;
  border-radius: 18px;
  font-size: 0.92rem;
  max-width: 78%;
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.35;
}
.demo-msg--received {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
}
.demo-msg--sent {
  align-self: flex-end;
  background: var(--accent-cta);
  color: #fff;
  opacity: 0;
  transform: scale(0.6) translateY(14px);
  transform-origin: right bottom;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.2, 0.9, 0.35, 1.3);
}
.hero-demo.has-msg .demo-msg--sent {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* compose field at the bottom */
.demo-window--messages .demo-bubble {
  display: flex;
  align-items: center;
  margin: 8px 12px 12px;
  padding: 5px 5px 5px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  min-height: 30px;
}
.demo-window--messages .demo-typed { flex: 0 1 auto; }
.demo-window--messages .demo-caret {
  background: currentColor;
  width: 2px;
  flex-shrink: 0;
}

/* send button: gray while empty, accent when there's text, pulse on submit */
.demo-send {
  display: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  margin-left: auto;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  background: rgba(128, 128, 128, 0.35);
  color: rgba(255, 255, 255, 0.92);
  transition: background 0.2s ease, color 0.2s ease;
}
.demo-send svg { width: 12px; height: 12px; display: block; }
.demo-window--messages .demo-send { display: inline-flex; }
.hero-demo.has-text .demo-window--messages .demo-send {
  background: var(--accent-cta);
  color: #fff;
}
.hero-demo.is-sending .demo-window--messages .demo-send {
  animation: send-pulse 0.32s ease;
}
@keyframes send-pulse {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

@media (prefers-color-scheme: light) {
  .demo-msg--received { background: rgba(0, 0, 0, 0.07); }
  .demo-window--messages .demo-bubble {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.12);
  }
  .demo-send { background: rgba(0, 0, 0, 0.18); }
}

/* --- Editor body --- */
.demo-window--editor .demo-body {
  font-family: "Iowan Old Style", "Palatino", "Georgia", serif;
  font-size: 1.02rem;
  padding: 16px 18px;
  align-items: flex-start;
  white-space: normal;
}
.demo-window--editor .demo-prompt { display: none; }
.demo-window--editor .demo-caret {
  background: currentColor;
  width: 2px;
  height: 1.1em;
}

@keyframes caret-blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .demo-bars span { animation: none; transform: scaleY(0.6); }
  .demo-caret { animation: none; opacity: 1; }
}

@media (max-width: 640px) {
  .hero-demo { max-width: 100%; margin-top: 44px; }
  .demo-bars span { height: 16px; }
  .demo-body { padding: 12px 14px; font-size: 0.85rem; min-height: 160px; }
  .demo-window--messages .demo-body { padding: 0; }
  .demo-window--editor .demo-body { padding: 14px 16px; }
  .demo-title { font-size: 0.7rem; }
}

/* ---------- footer ---------- */
.site-footer {
  text-align: center;
  padding: 36px 20px 60px;
  color: var(--fg-muted);
  font-size: 0.9rem;
}
.site-footer p { margin: 0; }
