:root {
  --bg: #fbfaf7; --fg: #1d1c1a; --muted: #5f5b54; --line: #e4e0d8; --accent: #b4462b; --card: #ffffff;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141312; --fg: #ece9e3; --muted: #a39e95; --line: #2c2a27; --accent: #e57a5c; --card: #1c1b19; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  overflow-x: clip;
  margin: 0; background: var(--bg); color: var(--fg);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }
header.top { border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: -0.01em; color: var(--fg); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand img { width: 28px; height: 28px; }
nav a { color: var(--muted); text-decoration: none; margin-left: 18px; font-size: 15px; }
nav a:first-child { margin-left: 0; }
nav a:hover, nav a[aria-current="page"] { color: var(--fg); }
main { padding: 32px 0 64px; }
h1 { font-size: clamp(30px, 6vw, 46px); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 16px; }
h2 { font-size: 22px; margin: 40px 0 10px; letter-spacing: -0.01em; }
h3 { font-size: 18px; margin: 24px 0 6px; }
.lede { font-size: 20px; color: var(--muted); margin: 0 0 32px; }
.updated { color: var(--muted); font-size: 15px; margin-top: -8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin: 28px 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.card b { display: block; margin-bottom: 4px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.note { border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; color: var(--muted); }
table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 12px 0; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap { overflow-x: auto; }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer .wrap { padding: 20px; display: flex; gap: 18px; flex-wrap: wrap; }
footer a { color: var(--muted); }

/* The race: one typed sentence against four spoken ones in the same 10 s loop, then it rewinds.
   Each line is monospace and grows one character a step. */
.race { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px 18px; margin: 8px 0 28px; display: grid; gap: 22px; }
.lane { display: grid; grid-template-columns: 210px 1fr; align-items: center; gap: 12px; }
.who { display: flex; align-items: center; gap: 10px; }
.monkey { font-size: 52px; line-height: 1; display: inline-block; transform-origin: 50% 100%; }
.label { font-weight: 600; font-size: 15px; display: flex; flex-direction: column; }
.label small { font-weight: 400; color: var(--muted); font-size: 12px; white-space: nowrap; }
.line { position: relative; display: flex; align-items: center; gap: 6px; min-height: 40px; overflow: hidden; border-radius: 10px; background: var(--bg); padding: 0 10px; }
.line.many { align-items: flex-start; padding: 8px 10px; min-height: 104px; }
.lines { display: flex; flex-direction: column; }
.txt { font: 15px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; overflow: hidden; width: 0; }
.txt.slow { border-right: 2px solid var(--accent); animation: type-slow 10s steps(36, end) infinite, caret 0.8s step-end infinite; }
.txt.fast.l1 { animation: type-l1 10s infinite; }
.txt.fast.l2 { animation: type-l2 10s infinite; }
.txt.fast.l3 { animation: type-l3 10s infinite; }
.txt.fast.l4 { animation: type-l4 10s infinite; }
.bubble { font-size: 18px; }
.score { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; opacity: 0; animation: done 10s infinite; }
.score.win { color: #fff; background: var(--accent); border-color: var(--accent); top: 12px; transform: none; }
.typist { animation: peck 0.35s ease-in-out infinite alternate; }
.speaker { animation: hop 1.2s ease-in-out infinite; }
@keyframes type-slow { 0% { width: 0; } 92%, 100% { width: 36ch; } }
@keyframes type-l1 { 0% { width: 0; animation-timing-function: steps(36, end); } 23%, 100% { width: 36ch; } }
@keyframes type-l2 { 0%, 23% { width: 0; animation-timing-function: steps(35, end); } 46%, 100% { width: 35ch; } }
@keyframes type-l3 { 0%, 46% { width: 0; animation-timing-function: steps(35, end); } 69%, 100% { width: 35ch; } }
@keyframes type-l4 { 0%, 69% { width: 0; animation-timing-function: steps(32, end); } 92%, 100% { width: 32ch; } }
@keyframes caret { 50% { border-color: transparent; } }
@keyframes done { 0%, 91% { opacity: 0; } 93%, 99% { opacity: 1; } 100% { opacity: 0; } }
@keyframes peck { from { transform: rotate(-4deg) translateY(0); } to { transform: rotate(4deg) translateY(2px); } }
@keyframes hop {
  0%, 50%, 100% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(-6px, -14px) rotate(-10deg); }
  75% { transform: translate(6px, -14px) rotate(10deg); }
}

@media (max-width: 560px) {
  .lane { grid-template-columns: 1fr; gap: 6px; }
  .txt { font-size: 12px; }
  .monkey { font-size: 40px; }
  .bubble { display: none; }
  .race { padding: 18px 14px; }
  .line { padding: 0 8px; gap: 4px; }
  .line.many { padding: 8px; min-height: 90px; }
  .line { flex-direction: column; align-items: flex-start; padding: 8px; }
  .score, .score.win { position: static; transform: none; align-self: flex-end; margin-top: 6px; }
  header.top .wrap { flex-wrap: nowrap; }
  .brand { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .txt { animation: none !important; width: auto; }
  .typist, .speaker { animation: none; }
  .score { animation: none; opacity: 1; }
  .bars i, .timer i { animation: none; }
}

/* Fine print. */

/* Home: one headline, one sentence, one button. */
.hero { text-align: center; padding: 40px 0 34px; position: relative; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: -40px 0 0; z-index: -1; background: radial-gradient(closest-side at 50% 45%, rgba(242, 166, 90, 0.28), transparent 70%); pointer-events: none; }
.hero h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(44px, 9vw, 80px); line-height: 1.02; letter-spacing: -0.02em; margin: 0 0 22px; }
.hero h1 em { font-style: italic; }
.hero .lede { max-width: 30ch; margin: 0 auto 28px; font-size: clamp(19px, 2.6vw, 23px); color: var(--fg); }
.btn { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; border-radius: 12px; }
.btn:hover { filter: brightness(1.08); }
.btn.big { font-size: 20px; padding: 16px 30px; box-shadow: 0 6px 18px rgba(180, 70, 43, 0.28); }
.btn.small { font-size: 14px; padding: 8px 14px; color: #fff; margin-left: 0; }
nav a.btn.small:hover { color: #fff; }
.small-print { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.how { list-style: none; counter-reset: step; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.how li { counter-increment: step; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.how li::before { content: counter(step); width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: grid; place-items: center; margin-bottom: 6px; }
.how span { color: var(--muted); font-size: 15px; }

/* Sound bars after "Speak," */
.bars { display: inline-flex; align-items: center; gap: 0.05em; height: 0.7em; margin-left: 0.18em; vertical-align: 0.05em; }
.bars i { display: block; width: 0.075em; height: 100%; border-radius: 0.04em; background: var(--accent); transform-origin: 50% 50%; animation: bar 0.9s ease-in-out infinite; }
.bars i:nth-child(2) { animation-delay: -0.6s; } .bars i:nth-child(3) { animation-delay: -0.3s; }
.bars i:nth-child(4) { animation-delay: -0.75s; } .bars i:nth-child(5) { animation-delay: -0.45s; }
@keyframes bar { 0%, 100% { transform: scaleY(0.25); } 50% { transform: scaleY(1); } }
/* The race as a timed duel */
.race { box-shadow: 0 10px 30px rgba(60, 40, 20, 0.08); }
.clock { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.timer { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.timer i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: 0 50%; animation: timer 10s linear infinite; }
@keyframes timer { 0% { transform: scaleX(0); } 92%, 100% { transform: scaleX(1); } }

/* Account pages (account.<domain>): one task per page, big targets. */
.account { max-width: 560px; }
.account h1 { font-size: clamp(28px, 6vw, 38px); }
.stack { display: grid; gap: 14px; margin: 20px 0; }
.stack label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
.stack input:not([type="checkbox"]) { font: inherit; font-weight: 400; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--fg); }
.stack .tick { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.stack .tick input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); }
button.btn { border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.btn.quiet { background: transparent; color: var(--muted); box-shadow: none; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 20px 0; }
.devices { list-style: none; padding: 0; display: grid; gap: 10px; }
.devices li { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.devices form { margin: 0; }
.account .note { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 14px; }

/* Download page (one-click wave 1) and the account page's code box. */
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin: 8px 0 24px; }
.dl-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 12px; align-content: start; }
.dl-card h2 { margin: 0; font-size: 20px; }
.dl-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dl-meta { color: var(--muted); font-size: 14px; }
.btn.off { background: var(--line); color: var(--muted); cursor: default; box-shadow: none; }
.steps-list { padding-left: 22px; } .steps-list li { margin: 6px 0; }
code.sum { font-size: 12px; word-break: break-all; }
.code-box code { display: inline-block; font-size: 18px; padding: 10px 14px; word-break: break-all; user-select: all; }
nav a.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent, #c9643f); color: #fff; font-weight: 700; font-size: 15px; text-decoration: none; vertical-align: middle; }
nav a.avatar:hover { color: #fff; }
/* account pages (D192): avatar menu, downloads, allowance */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 15px; }
.menu-panel { position: absolute; right: 0; top: 40px; z-index: 10; min-width: 200px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 0; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12); }
.menu-panel .who { display: block; padding: 4px 16px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; font-size: 14px; color: var(--muted); }
.menu-panel a, .menu-signout button { display: block; width: 100%; text-align: left; padding: 7px 16px; margin: 0; color: var(--fg); text-decoration: none; font: inherit; font-size: 15px; background: none; border: 0; cursor: pointer; }
.menu-panel a:hover, .menu-signout button:hover { background: var(--line); }
.menu-signout { margin: 0; }
.downloads { list-style: none; padding: 0; display: grid; gap: 14px; margin: 16px 0; }
.downloads li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.downloads .btn.big { font-size: 17px; padding: 12px 22px; }
.downloads .size { color: var(--muted); font-size: 14px; margin-left: 10px; }
.downloads .soon { color: var(--muted); }
.fingerprint { margin-top: 8px; font-size: 14px; color: var(--muted); }
.fingerprint code { word-break: break-all; }
.allowance { width: 100%; max-width: 360px; height: 12px; }
@media (max-width: 520px) { .menu-panel { right: -8px; } .downloads .size { display: block; margin: 6px 0 0; } }
