:root {
  color-scheme: light dark;
  --fg: #111; --bg: #fff; --muted: #6b6b6b; --line: #e6e6e6;
  --key-line: #cfcfcf;
  --k: clamp(30px, 8vw, 46px);
}
@media (prefers-color-scheme: dark) {
  :root { --fg: #f2f2f2; --bg: #0b0b0b; --muted: #9a9a9a; --line: #222; --key-line: #333; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--fg); background: var(--bg); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--fg); }
main { max-width: 760px; margin: 0 auto; padding: 44px 24px 0; }

.hero { text-align: center; }
.mark { width: 64px; height: 64px; margin: 0 auto 14px; display: block; border-radius: 15px; }
h1 { font-size: 40px; line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 10px; font-weight: 700; }
.lede { font-size: 18px; color: var(--muted); max-width: 560px; margin: 0 auto 20px; }
.cta { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0 0 10px; }
.button { display: inline-block; background: var(--fg); color: var(--bg); text-decoration: none; padding: 13px 24px; border-radius: 10px; font-weight: 600; font-size: 17px; }
.source { font-size: 15px; color: var(--muted); text-decoration: none; }
.source:hover { color: var(--fg); text-decoration: underline; }
.fine { color: var(--muted); font-size: 13px; margin: 0; }

.demo { margin: 28px 0 0; text-align: center; }
.stage { position: relative; max-width: 560px; margin: 0 auto; }
.caption { color: var(--muted); font-size: 14px; margin: 16px 0 0; }
kbd { font: inherit; font-size: 13px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; }

/* keyboard: bottom-left corner of a Mac keyboard */
.kbd {
  --gap: calc(var(--k) * 0.16);
  border: 1px solid var(--key-line); border-right: 0; border-top: 0;
  border-radius: 0 0 0 calc(var(--k) * 0.4);
  padding: calc(var(--gap) * 2) 0 calc(var(--gap) * 1.6) calc(var(--gap) * 1.6);
  display: flex; flex-direction: column; gap: var(--gap);
  overflow: hidden; text-align: left;
  -webkit-mask-image: linear-gradient(to right, #000 60%, transparent 98%), linear-gradient(to bottom, transparent, #000 40%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, #000 60%, transparent 98%), linear-gradient(to bottom, transparent, #000 40%);
  mask-composite: intersect;
}
.row { display: flex; gap: var(--gap); }
.key {
  flex: 0 0 auto; width: var(--k); height: var(--k);
  background: transparent; border-radius: calc(var(--k) * 0.18);
  border: 1px solid var(--key-line);
  display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--k) * 0.3); font-weight: 500; color: var(--muted);
  transition: transform .12s ease, background .12s ease, color .12s ease;
}
.key.mod { font-size: calc(var(--k) * 0.22); align-items: flex-end; padding-bottom: calc(var(--k) * 0.14); color: var(--muted); }
.key.w125 { width: calc(var(--k) * 1.25 + var(--gap) * 0.25); }
.key.w175 { width: calc(var(--k) * 1.75 + var(--gap) * 0.75); }
.key.w225 { width: calc(var(--k) * 2.25 + var(--gap) * 1.25); }
.key.space { width: calc(var(--k) * 5 + var(--gap) * 4); }
.key.fn { position: relative; justify-content: flex-end; padding-right: calc(var(--k) * 0.14); background: var(--fg); border-color: var(--fg); color: var(--bg); box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.key.fn .globe, .key.fn .globe::before, .key.fn .globe::after { border-color: var(--bg); }
.globe {
  position: absolute; top: calc(var(--k) * 0.14); left: calc(var(--k) * 0.14);
  width: calc(var(--k) * 0.3); height: calc(var(--k) * 0.3);
  border: 1.5px solid var(--muted); border-radius: 50%;
}
.globe::before, .globe::after { content: ""; position: absolute; border: 1.5px solid var(--muted); }
.globe::before { inset: -1.5px 25%; border-radius: 50%; }
.globe::after { left: -1.5px; right: -1.5px; top: 50%; height: 0; border-width: 1.5px 0 0; }
.pressed .key.fn { transform: translateY(2px) scale(.96); background: var(--accent, #0a84ff); border-color: var(--accent, #0a84ff); color: #fff; box-shadow: none; }
.pressed .key.fn .globe, .pressed .key.fn .globe::before, .pressed .key.fn .globe::after { border-color: #fff; }

/* the listening bar */
.bar {
  position: absolute; left: 50%; top: calc(var(--k) * 0.75); z-index: 2; transform: translate(-50%, 8px);
  display: inline-flex; align-items: center; gap: 12px; white-space: nowrap;
  padding: 12px 20px; border-radius: 999px;
  background: color-mix(in srgb, var(--fg) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);
  box-shadow: 0 10px 40px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.25);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  font-size: 15px; font-weight: 500;
  opacity: 0; transition: opacity .25s ease, transform .25s ease;
}
.listening .bar, .transcribing .bar { opacity: 1; transform: translate(-50%, 0); }
.hiding .bar { opacity: 0; transform: translate(-50%, 8px); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #e5484d; box-shadow: 0 0 0 5px rgba(229,72,77,.25); flex: none; transition: background .2s, box-shadow .2s; }
.transcribing .dot { background: var(--muted); box-shadow: 0 0 0 5px color-mix(in srgb, var(--muted) 25%, transparent); }
.wave { display: inline-flex; align-items: center; gap: 3px; height: 22px; }
.wave i { display: block; width: 3px; border-radius: 2px; background: var(--fg); height: 5px; animation: wave 1.1s ease-in-out infinite paused; }
.listening .wave i { animation-play-state: running; }
.wave i:nth-child(2n) { animation-delay: -.15s; } .wave i:nth-child(3n) { animation-delay: -.3s; } .wave i:nth-child(5n) { animation-delay: -.45s; } .wave i:nth-child(7n) { animation-delay: -.6s; }
@keyframes wave { 0%, 100% { height: 5px; } 50% { height: 20px; } }
.transcribing .wave { display: none; }
.state .transcribing { display: none; }
.transcribing .state .listening { display: none; }
.transcribing .state .transcribing { display: inline; }
.mic { color: var(--muted); font-weight: 400; }
.transcribing .mic { display: none; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 32px; margin: 72px 0 80px; text-align: center; }
.features h2 { font-size: 17px; margin: 0 0 6px; }
.features p { margin: 0; color: var(--muted); font-size: 15px; }

footer { border-top: 1px solid var(--line); padding: 24px; color: var(--muted); font-size: 14px; text-align: center; }
footer p { margin: 0; }

@media (max-width: 640px) {
  main { padding: 36px 20px 0; }
  .mark { width: 72px; height: 72px; border-radius: 16px; }
  h1 { font-size: 36px; }
  .lede { font-size: 18px; }
  .cta { align-items: stretch; }
  .button { text-align: center; padding: 15px 20px; }
  .source { text-align: center; }
  .demo { margin-top: 24px; }
  .bar { font-size: 14px; padding: 11px 16px; gap: 10px; }
  .mic { display: none; }
  .features { grid-template-columns: 1fr; gap: 24px; margin: 56px 0 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .key, .bar, .dot { transition: none; }
  .wave i { animation: none; }
  .wave i:nth-child(odd) { height: 12px; } .wave i:nth-child(3n) { height: 18px; } .wave i:nth-child(4n) { height: 8px; }
}
