:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --ink: #1c2026;
  --muted: #5d6673;
  --line: #e3e1da;
  --teal: #2f9e8f;
  --teal-soft: #d9efeb;
  --purple: #7c3aed;
  --purple-soft: #ede5fd;
  --select: #b9e3dc;
  --shadow: 0 1px 2px rgba(28, 32, 38, .06), 0 12px 32px rgba(28, 32, 38, .08);
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171b;
    --surface: #1c2026;
    --ink: #f2f4f7;
    --muted: #9aa4b0;
    --line: #2c333c;
    --teal: #5ec8b8;
    --teal-soft: #1b3b37;
    --purple: #a78bfa;
    --purple-soft: #2a2140;
    --select: #245a53;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.7 var(--mono);
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--teal); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
code { font-family: var(--mono); background: var(--teal-soft); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.03em; margin: 0; }
h2 { font-size: clamp(26px, 4vw, 40px); font-weight: 800; text-align: center; margin-bottom: 20px; }
h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
section { max-width: 1120px; margin: 0 auto; padding: 96px 20px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: 14px; }

/* Scroll progress */
.progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 30; }
.progress span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--teal), var(--purple)); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px max(20px, calc((100vw - 1120px) / 2));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.scrolled { border-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; }
.brand img { border-radius: 7px; }
.nav nav { display: flex; gap: 22px; align-items: center; font-size: 14px; }
.nav nav a { color: var(--muted); text-decoration: none; transition: color .2s; }
.nav nav a:hover { color: var(--ink); }
.nav .nav-cta { color: var(--ink); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; background: var(--surface); }
@media (max-width: 720px) { .nav nav a:not(.nav-cta) { display: none; } }

/* Reveal on scroll */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* Hero */
.hero { padding-top: 72px; text-align: center; }
.eyebrow { display: inline-block; font-size: 13px; color: var(--purple); background: var(--purple-soft); padding: 4px 14px; border-radius: 999px; margin: 0 0 24px; }
.hero h1 { font-size: clamp(44px, 9vw, 104px); font-weight: 800; letter-spacing: -.06em; }
.hero h1 .word { display: inline-block; }
.hero h1.in .word { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
.hero h1.in .word:nth-child(2) { animation-delay: .12s; }
.hero h1.in .word:nth-child(3) { animation-delay: .24s; }
.hero h1 .accent { color: var(--teal); }
@keyframes rise { from { opacity: 0; transform: translateY(40%); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.lede { max-width: 640px; margin: 24px auto 32px; font-size: 18px; color: var(--muted); }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.button {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 12px;
  font: 500 15px var(--mono); color: var(--ink); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.button:hover { transform: translateY(-2px); }
.button.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
@media (prefers-color-scheme: dark) { .button.primary { color: #0e2622; } }

/* Hero demo */
.demo { margin: 64px auto 0; max-width: 760px; position: relative; }
.window { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-align: left; overflow: hidden; }
.window-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.window-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.window-bar span { margin-left: 8px; }
.demo-text { margin: 0; padding: 28px 30px 34px; font-size: clamp(16px, 2.2vw, 21px); line-height: 1.8; }
.demo-text .w { border-radius: 4px; transition: background-color .15s, color .15s; }
.demo-text .w.sel { background: var(--select); }
.demo-text .w.now { background: var(--teal); color: #fff; }
.demo-controls { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 28px; }
.key {
  width: 64px; height: 64px; border-radius: 14px; display: grid; place-items: center; position: relative;
  font-size: 26px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 4px 0 var(--line), var(--shadow); transition: transform .12s, box-shadow .12s;
}
.key small { position: absolute; top: 6px; left: 8px; font-size: 9px; color: var(--muted); }
.key.down { transform: translateY(4px); box-shadow: 0 0 0 var(--line), var(--shadow); background: var(--teal-soft); }
.pill {
  display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px; border-radius: 999px;
  background: #181c21; color: #f2f4f7; border: 1px solid #46505c; font-size: 13px; min-width: 210px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18); transition: opacity .3s, transform .3s;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #8a96a3; transition: background .3s; }
.pill .bars { display: inline-flex; align-items: center; gap: 3px; height: 18px; }
.pill .bars b { width: 3px; height: 4px; border-radius: 2px; background: #5ec8b8; opacity: .35; transition: opacity .3s; }
.pill.speaking .dot { background: #5ec8b8; }
.pill.speaking .bars b { opacity: 1; animation: meter .9s ease-in-out infinite; }
.pill .bars b:nth-child(2) { animation-delay: -.2s; } .pill .bars b:nth-child(3) { animation-delay: -.5s; }
.pill .bars b:nth-child(4) { animation-delay: -.1s; } .pill .bars b:nth-child(5) { animation-delay: -.7s; }
.pill .bars b:nth-child(6) { animation-delay: -.3s; } .pill .bars b:nth-child(7) { animation-delay: -.6s; }
.pill .bars b:nth-child(8) { animation-delay: -.4s; } .pill .bars b:nth-child(9) { animation-delay: -.8s; }
@keyframes meter { 0%, 100% { height: 4px; } 50% { height: 18px; } }
.pill-label { color: #9aa4b0; }

/* Audience */
.audience { text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 12px auto 24px; max-width: 820px; }
.chip { padding: 8px 16px; border-radius: 999px; background: var(--purple-soft); color: var(--purple); font-size: 14px; font-weight: 500; }

/* Features */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 40px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s, border-color .3s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--teal) 40%, var(--line)); }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.card .icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); font-weight: 700; margin-bottom: 16px; }

/* How it works: sticky stage */
.how-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 48px; }
.steps .step { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; opacity: .3; transition: opacity .5s; }
.steps .step.active { opacity: 1; }
.step-n { color: var(--teal); font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.step p { color: var(--muted); max-width: 420px; margin: 0; }
.stage { position: relative; }
.stage-inner { position: sticky; top: calc(50vh - 170px); height: 340px; display: grid; place-items: center; }
.window.small { width: 100%; max-width: 440px; }
.stage-text { margin: 0; padding: 22px 24px 28px; font-size: 17px; }
.stage-text .sel { border-radius: 4px; background-image: linear-gradient(var(--select), var(--select)); background-repeat: no-repeat; background-size: 0% 100%; transition: background-size 1.2s ease; }
.stage-inner[data-active] .sel { background-size: 100% 100%; }
.stage-key, .stage-esc {
  position: absolute; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 4px 0 var(--line), var(--shadow);
  font-size: 24px; opacity: 0; transform: scale(.8); transition: opacity .4s, transform .4s;
}
.stage-key { right: 8%; top: 8%; }
.stage-esc { left: 8%; top: 8%; font-size: 15px; }
.stage-pill { position: absolute; bottom: 4%; opacity: 0; transform: translateY(16px); }
.stage-inner[data-active="1"] .stage-key { opacity: 1; transform: scale(1); animation: press 1.2s ease-in-out infinite; }
.stage-inner[data-active="2"] .stage-pill { opacity: 1; transform: none; }
.stage-inner[data-active="2"] .stage-pill .dot { background: #5ec8b8; }
.stage-inner[data-active="2"] .stage-pill .bars b { opacity: 1; animation: meter .9s ease-in-out infinite; }
.stage-inner[data-active="3"] .stage-esc { opacity: 1; transform: scale(1); animation: press 1.2s ease-in-out infinite; }
.stage-inner[data-active="3"] .stage-pill { opacity: 0; transform: translateY(16px) scale(.9); }
@keyframes press { 0%, 60%, 100% { translate: 0 0; box-shadow: 0 4px 0 var(--line), var(--shadow); } 30% { translate: 0 4px; box-shadow: 0 0 0 var(--line), var(--shadow); } }
@media (max-width: 820px) {
  .how-layout { grid-template-columns: 1fr; }
  .stage { order: -1; position: sticky; top: 60px; z-index: 2; background: var(--bg); }
  .stage-inner { position: relative; top: 0; height: 260px; }
  .steps .step { min-height: 46vh; }
}

/* Recording */
.frame { margin: 32px auto 0; max-width: 800px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.frame img { border-radius: 10px; width: 100%; }
.frame figcaption { font-size: 13px; color: var(--muted); text-align: center; padding: 10px 0 2px; }
.zoom { transform: scale(var(--z, .88)); opacity: var(--o, .5); transition: transform .1s linear, opacity .1s linear; }

/* Screenshots */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; margin-top: 40px; }
.shot { margin: 0; }
.shot img { border-radius: 12px; box-shadow: var(--shadow); transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.shot:hover img { transform: scale(1.02) rotate(-.3deg); }
.shot figcaption { text-align: center; font-size: 13px; color: var(--muted); margin-top: 12px; }
.shot:nth-child(even) { --d: .12s; }
@media (max-width: 720px) { .gallery { grid-template-columns: 1fr; } }

/* Numbers */
.numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding-top: 48px; padding-bottom: 48px; }
.stat { text-align: center; padding: 24px 12px; border-top: 2px solid var(--teal); }
.stat strong { display: block; font-size: clamp(32px, 5vw, 52px); font-weight: 800; letter-spacing: -.05em; }
.stat span { color: var(--muted); font-size: 13px; }
@media (max-width: 720px) { .numbers { grid-template-columns: repeat(2, 1fr); } }

/* Install */
.install { max-width: 820px; }
.tabs { display: flex; gap: 6px; padding: 5px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); width: fit-content; margin: 32px auto 20px; flex-wrap: wrap; justify-content: center; }
.tabs button { font: 500 14px var(--mono); padding: 8px 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--teal); color: #fff; }
.panel p { color: var(--muted); }
.code { position: relative; background: #181c21; color: #e6eaee; border-radius: 12px; padding: 18px 20px; overflow-x: auto; }
.code pre { margin: 0; font-size: 14px; line-height: 1.75; }
.code code { background: none; padding: 0; color: inherit; }
.copy { position: absolute; top: 10px; right: 10px; font: 500 12px var(--mono); padding: 5px 10px; border-radius: 7px; border: 1px solid #46505c; background: #232931; color: #e6eaee; cursor: pointer; }
.warning { border: 1px solid #e3b341; background: color-mix(in srgb, #e3b341 14%, var(--surface)); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; font-size: 14px; }
.warning strong { display: block; margin-bottom: 4px; }
.after { margin: 32px auto 0; padding-left: 24px; color: var(--muted); }
.after li { margin: 6px 0; }
.after b { color: var(--ink); }

/* Thanks */
.thanks { max-width: 760px; text-align: center; }
.thanks p { margin: 0 0 16px; }

.footer { display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; padding: 40px 20px 56px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.footer a { color: var(--muted); }

:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .zoom { transform: none; opacity: 1; }
}
