/* vinoWhisper landing: left-aligned sections set like a README, with room to breathe */

:root {
  --bg: #fcfcfc;
  --text: #1c1d20;
  --muted: #5d6068;
  --rule: #e2e3e6;
  --code-bg: #eef0f2;
  --link: #1a7040;
  --green: #56cc78;
  --ink: #0e0e10;
  --paper: #fafafa;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Cantarell, "Noto Sans", sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121315;
    --text: #e4e5e8;
    --muted: #9a9ea6;
    --rule: #2a2c30;
    --code-bg: #1e2023;
    --link: #7bdc97;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: var(--font); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 700; text-wrap: balance; }
p, ul, dl, table, pre { margin: 0; }
a { color: var(--link); text-underline-offset: 2px; }
code { font-family: var(--mono); font-size: 0.88em; padding: 0.1em 0.3em; border-radius: 3px; background: var(--code-bg); white-space: nowrap; }
figure { margin: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.i {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}

.wrap { max-width: 1100px; margin: 0 auto; padding-inline: 20px; }

/* header and footer */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-block: 20px; border-bottom: 1px solid var(--rule); }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none; }
.brand-mark { width: 28px; height: 28px; }
.top nav, footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 15px; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 24px 40px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--rule); }
footer nav { font-size: 14px; }

/* sections */
section { padding-block: 64px; }
section + section { border-top: 1px solid var(--rule); }
section > * + *, .split > div > * + * { margin-top: 16px; }
section > p, .split p, .split ul { max-width: 64ch; }
h1 { font-size: clamp(34px, 4vw + 12px, 54px); letter-spacing: -0.035em; }
h2 { font-size: clamp(26px, 1.5vw + 16px, 32px); letter-spacing: -0.025em; }
h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.intro { padding-top: 56px; }
.intro > * { max-width: 900px; }
.intro > .mock { max-width: none; margin-top: 32px; }
.lede { font-size: 19px; max-width: 62ch; color: var(--muted); }
.small { font-size: 14px; color: var(--muted); }
ul.plain { padding-left: 1.1em; }
li + li { margin-top: 8px; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 48px; }
.cols li + li { margin-top: 0; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 56px; align-items: center; }
.split.top { align-items: start; }
#install .split { margin-top: 24px; }

/* the numbers, set large */
.figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 32px; }
.figures > div { padding-top: 12px; border-top: 1px solid var(--rule); }
.figures dt { font-size: 38px; font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.figures dd { margin: 4px 0 0; font-size: 15px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 40px; margin-top: 32px; }
.grid > div { padding-top: 16px; border-top: 1px solid var(--rule); }
.grid p { margin-top: 6px; font-size: 15px; color: var(--muted); }

.reqs { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 12px 24px; font-size: 15px; }
.reqs dt { font-weight: 600; }
.reqs dd { margin: 0; color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
caption { caption-side: bottom; padding-top: 10px; text-align: left; font-size: 14px; color: var(--muted); }
th, td { padding: 10px 16px 10px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
thead th { padding-block: 0 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
tbody th { width: 22%; font-weight: 600; }
td { color: var(--muted); }
td:last-child { width: 24%; padding-right: 0; white-space: nowrap; }
.ok { color: var(--link); font-weight: 600; }
#install pre, .distros { margin-top: 32px; }

.btn {
  display: inline-block; padding: 10px 18px; border-radius: 6px; font-weight: 600; font-size: 15px;
  color: var(--text); text-decoration: none; border: 1px solid var(--rule);
}
.btn:hover { background: var(--code-bg); }

/* commands: the one place a monospace face belongs, with the terminal UI */
pre, .terminal {
  padding: 14px 18px; overflow-x: auto; border-radius: 6px;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.6; color: var(--paper); background: var(--ink);
}
.ps { color: var(--green); user-select: none; }
.out { color: color-mix(in srgb, var(--paper) 55%, transparent); }
.install { position: relative; }
.install pre { padding-right: 56px; font-size: 13px; }
#overlay .mock { max-width: 600px; }
.copy {
  position: absolute; top: 50%; right: 10px; width: 32px; height: 32px; margin-top: -16px; padding: 0;
  display: grid; place-items: center; cursor: pointer; border-radius: 5px;
  color: color-mix(in srgb, var(--paper) 70%, transparent); background: var(--ink);
  border: 1px solid color-mix(in srgb, var(--paper) 20%, transparent);
}
.copy:hover, .copy:focus-visible { color: var(--paper); }
.copy .i { width: 15px; height: 15px; }

/* vinowhisper-caption: the transcript in scrollback, the Rich status panel under it */
.tui { font-size: 13.5px; line-height: 1.6; }
.tui b { font-weight: 700; color: #fff; }
.tui .dim { color: color-mix(in srgb, var(--paper) 50%, transparent); }
.tui .green { color: #5fd787; }
.tui .cyan { color: #5fd7d7; }
.term-lines { display: flex; flex-direction: column; justify-content: flex-end; height: 11.2em; overflow: hidden; }
.term-lines > * { flex: none; }
.para { position: relative; max-width: 96ch; margin: 0.8em 0 0; padding-left: 8ch; }
.gut { position: absolute; left: 0; }
.panel {
  position: relative; margin-top: 10px; padding: 6px 1ch 4px;
  border: 1px solid color-mix(in srgb, var(--paper) 30%, transparent); border-radius: 6px;
}
.panel-title { position: absolute; top: -0.85em; left: 1ch; padding-inline: 1ch; background: var(--ink); }
.panel-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 3ch; }
.panel-row > span, .hearing { white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.meter { display: inline-grid; }
.meter > * { grid-area: 1 / 1; }

/* pause control under each mockup */
.vctl { display: flex; justify-content: flex-end; margin-top: 6px; }
.vctl button {
  width: 32px; height: 32px; padding: 0; display: grid; place-items: center; cursor: pointer; border-radius: 5px;
  color: var(--muted); background: transparent; border: 1px solid var(--rule);
}
.vctl button:hover, .vctl button:focus-visible { color: var(--text); }
.vctl .i { width: 15px; height: 15px; }

/* ---------------------------------------------------------------------------
   Mockups. Each is the product redrawn in HTML and sized in em, with the root
   font-size tied to the figure's width (--w is the mockup's width in em), so it
   scales like an image. The overlay's colours are the ones gui/src/paint.rs draws.

   Every animation in a mockup runs on one clock (--d). Frame 0 is always a
   complete screen, because that is what a paused or reduced-motion visitor sees;
   .m-stage fades out and back in around the loop point while everything resets:
   each keyframe set holds its final state to 96% and is back at the start by 98%.
   --------------------------------------------------------------------------- */
@property --t { syntax: "<integer>"; inherits: true; initial-value: 0; }
@property --lv { syntax: "<number>"; inherits: true; initial-value: 0; }

.mock { position: relative; container-type: inline-size; }
.mock.paused * { animation-play-state: paused !important; }
.m {
  --caption: #fafafa; --pending: #a0a4ac; --dim: #8e929a; --good: #56cc78; --warn: #f5b842; --box: rgba(14, 14, 16, 0.84);
  font-size: 12px; font-size: calc(100cqw / var(--w));
  line-height: 1.35; text-align: left; cursor: default; user-select: none;
  overflow: hidden; border-radius: 6px;
}
.m, .m *, .m-term, .m-term * { animation-duration: var(--d); animation-iteration-count: infinite; }
.m-stage { position: relative; animation-name: m-loop; }
@keyframes m-loop { 0%, 94% { opacity: 1; } 96%, 98% { opacity: 0; } 100% { opacity: 1; } }

/* Breeze-style title bar: title in the middle, window buttons on the right */
.m-titlebar { display: flex; align-items: center; height: 2.6em; padding: 0 0.8em; font-size: 0.85em; color: #31363b; background: #e3e5e7; }
.m-titlebar > span:first-child { flex: 1; margin-left: 5.4em; text-align: center; }
.m-winbtns { display: flex; gap: 0.7em; color: #4b5563; }
.m-winbtns .i { width: 1.1em; height: 1.1em; stroke-width: 2; }
.m-swap { display: inline-grid; }
.m-swap > * { grid-area: 1 / 1; }

/* the captions box: status line, then the last two lines of text */
.m-caps {
  position: absolute; left: 50%; bottom: 8.6em; width: 50em; margin-left: -25em; padding: 0.75em 1.3em 0.85em;
  border-radius: 0.8em; background: var(--box);
}
.m-status { display: flex; align-items: center; gap: 0.6em; font-size: 0.95em; color: var(--dim); }
.m-status i { width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--good); }
.m-lines { display: flex; flex-direction: column; justify-content: flex-end; height: 2.7em; margin-top: 0.3em; overflow: hidden; font-size: 1.75em; }
.m-said { margin: 0; font-weight: 500; line-height: 1.35; }
/* --t counts decode cycles. Each word gives the cycle it was heard in as --i: it
   shows then, in grey, and turns white two cycles later when a second window agrees. */
.m-said i {
  font-style: normal;
  font-size: calc(clamp(0, var(--t) - var(--i) + 1, 1) * 1em);
  transition: color 0.4s;
  color: color-mix(in srgb, var(--caption) calc(clamp(0, var(--t) - var(--i) - 1, 1) * 100%), var(--pending));
}

/* hero: a video playing, the captions floating over it */
.m-desk { --tray: translate(72.6em, 43.3em); --row: translate(71em, 31em); --top: translate(56em, 33.6em); --w: 80; --d: 22s; --t: 4; animation-name: desk-clock; background: linear-gradient(135deg, #2b3440, #1b2029 60%, #262033); }
.m-desk .m-stage { height: 45em; }
@keyframes desk-clock { 0% { --t: 4; } 88%, 96% { --t: 24; } 98%, 100% { --t: 4; } }
.m-player { position: absolute; left: 5em; top: 2.4em; width: 70em; overflow: hidden; border-radius: 0.8em; box-shadow: 0 1em 3em rgba(0, 0, 0, 0.45); }
.m-video {
  position: relative; height: 36.4em; overflow: hidden;
  background:
    linear-gradient(to bottom, #2f8ca0, #145566 55%, #0a3340);
}
.m-ray { position: absolute; top: -10em; width: 6em; height: 60em; transform-origin: top; background: linear-gradient(to bottom, rgba(255, 255, 255, 0.18), transparent 70%); filter: blur(0.6em); }
.m-ray:nth-child(1) { left: 18em; transform: rotate(18deg); }
.m-ray:nth-child(2) { left: 36em; width: 4em; transform: rotate(10deg); }
.m-ray:nth-child(3) { left: 52em; transform: rotate(4deg); }
.m-ray { animation-name: desk-shimmer; }
.m-ray:nth-child(2) { animation-delay: -7s; }
.m-ray:nth-child(3) { animation-delay: -14s; }
@keyframes desk-shimmer { 0%, 100% { opacity: 1; } 25% { opacity: 0.55; } 50% { opacity: 0.9; } 75% { opacity: 0.6; } }

/* The octopus acts out the caption: it feels the crack between the rocks with one
   arm at 12%, squeezes in behind the near rock by 26%, and climbs out on top of it
   by 42%. Everything is in the reef's own units (the video is 700 by 364). */
.m-reef { position: absolute; inset: 0; width: 100%; height: 100%; }
.m-rock { fill: #0a2a30; }
.m-rock.front { fill: #0d3238; }
.m-octo { fill: #d4704a; animation-name: desk-bob; }
.m-arm { fill: none; stroke: #d4704a; stroke-width: 7; stroke-linecap: round; transform-origin: 0 12px; animation-name: desk-sway; }
.m-arm:nth-child(2) { animation-delay: -1.3s; }
.m-arm:nth-child(3) { animation-delay: -2.1s; }
.m-arm:nth-child(4) { animation-delay: -0.6s; }
.m-arm:nth-child(5) { animation-delay: -1.7s; }
.m-eye { fill: #fdf3e7; }
.m-pupil { fill: #1b1512; }
.desk-octopus { transform: translate(290px, 172px); animation-name: desk-octopus; }
.desk-reach { transform-origin: 16px 10px; animation-name: desk-reach; }
@keyframes desk-octopus {
  0%, 20% { transform: translate(290px, 172px); animation-timing-function: ease-in; }
  26% { transform: translate(405px, 200px) scale(0.2, 1); }
  34% { transform: translate(480px, 240px) scale(0.6, 1); animation-timing-function: ease-out; }
  42%, 96% { transform: translate(480px, 120px); }
  98%, 100% { transform: translate(290px, 172px); }
}
@keyframes desk-reach {
  0%, 11% { transform: none; animation-timing-function: ease-out; }
  17%, 22% { transform: scale(2.6, 1.1); }
  28%, 100% { transform: none; }
}
@keyframes desk-bob { 0%, 100% { translate: 0 0; } 25% { translate: 0 -3px; } 50% { translate: 0 1px; } 75% { translate: 0 -2px; } }
@keyframes desk-sway {
  0%, 100% { rotate: 0deg; } 5% { rotate: 6deg; } 10% { rotate: -4deg; } 15% { rotate: 5deg; } 20% { rotate: -5deg; }
  25% { rotate: 4deg; } 30% { rotate: -6deg; } 35% { rotate: 3deg; } 40% { rotate: -4deg; } 45% { rotate: 6deg; }
  50% { rotate: -3deg; } 55% { rotate: 5deg; } 60% { rotate: -5deg; } 65% { rotate: 4deg; } 70% { rotate: -6deg; }
  75% { rotate: 3deg; } 80% { rotate: -4deg; } 85% { rotate: 6deg; } 90% { rotate: -3deg; } 95% { rotate: 4deg; }
}
.m-bubble { position: absolute; width: 1em; height: 1em; border: 0.12em solid rgba(255, 255, 255, 0.45); border-radius: 50%; animation-name: desk-bubble; animation-timing-function: linear; }
.m-bubble:nth-of-type(4) { left: 24em; bottom: 8em; }
.m-bubble:nth-of-type(5) { left: 26em; bottom: 5em; width: 0.7em; height: 0.7em; }
.m-bubble:nth-of-type(6) { left: 58em; bottom: 10em; width: 1.4em; height: 1.4em; }
@keyframes desk-bubble { 0% { transform: none; opacity: 1; } 90%, 96% { transform: translateY(-24em); opacity: 0; } 98%, 100% { transform: none; opacity: 0; } }
.m-seek { position: absolute; left: 1.4em; right: 1.4em; bottom: 1.2em; display: flex; align-items: center; gap: 1em; font-size: 0.85em; color: #fff; }
.m-seek .i { width: 1.4em; height: 1.4em; fill: #fff; stroke: none; }
.m-bar { flex: 1; height: 0.35em; border-radius: 99px; background: rgba(255, 255, 255, 0.3); }
.m-bar i { display: block; width: 29.3%; height: 100%; border-radius: inherit; background: #fff; animation-name: desk-progress; animation-timing-function: linear; }
@keyframes desk-progress { 0% { width: 29.3%; } 96% { width: 29.9%; } 98%, 100% { width: 29.3%; } }
.m-panel {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3em; display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.2em; background: rgba(14, 14, 16, 0.7); color: #e5e7eb;
}
.m-launch { width: 1.6em; height: 1.6em; border-radius: 0.4em; background: rgba(255, 255, 255, 0.2); }
.m-tray { display: flex; align-items: center; gap: 1em; font-size: 0.9em; }
.m-tray .i { width: 1.2em; height: 1.2em; }
.m-trayicon { width: 1.6em; height: 1.6em; }

/* voice typing */
.m-dict { --click-box: translate(14em, 21.3em); --click-send: translate(41.3em, 22.2em); --w: 50; --d: 14s; --lv: 0; animation-name: dict-level; background: linear-gradient(135deg, #2b3440, #1b2029 60%, #262033); }
.m-dict .m-stage { height: 34em; }
.m-chat { position: absolute; left: 4em; right: 4em; top: 4.2em; overflow: hidden; border-radius: 0.8em; background: #fff; color: #11181c; box-shadow: 0 1em 3em rgba(0, 0, 0, 0.45); }
.m-thread { display: flex; flex-direction: column; align-items: flex-start; gap: 0.6em; height: 12.5em; padding: 1.4em; justify-content: flex-end; }
.m-msg { margin: 0; padding: 0.6em 0.9em; font-size: 0.95em; border-radius: 1em 1em 1em 0.3em; background: #eef0f3; }
.m-compose { min-height: 5.6em; margin: 0 1.4em 1.4em; padding: 0.8em 1em; font-size: 0.95em; border: 1px solid #d5d9de; border-radius: 0.8em; }
.m-placeholder { color: #8e949a; }
.m-keys { position: absolute; top: 1.1em; right: 4em; display: flex; align-items: center; gap: 0.4em; color: #c5c9d0; font-size: 0.9em; }
.m-keys kbd {
  min-width: 2.4em; padding: 0.3em 0.6em; text-align: center; font: 600 1em var(--font); color: #e5e7eb;
  background: #2b2f36; border: 1px solid #4b515a; border-bottom-width: 0.25em; border-radius: 0.45em;
}
.m-pill {
  position: absolute; left: 50%; bottom: 2.2em; transform: translateX(-50%); display: flex; align-items: center;
  height: 3.2em; padding: 0 1.3em; white-space: nowrap; border-radius: 99px; background: var(--box); color: var(--caption); font-weight: 500;
}
.m-pill .m-swap > * { display: flex; align-items: center; gap: 0.8em; }
.m-dot { width: 0.8em; height: 0.8em; margin-inline: 0.25em; border-radius: 50%; }
.m-dot.good { background: var(--good); }
.m-dot.warn { background: var(--warn); }
/* the four level bars, sized from --lv the way paint_pill sizes them from the mic's rms */
.m-level { display: flex; align-items: center; gap: 0.2em; height: 1.3em; }
.m-level i { width: 0.2em; height: calc(1.3em * (0.25 + 0.75 * min(1, var(--lv) * var(--k) * 1.4))); border-radius: 99px; background: var(--good); }

.m-send { flex: none; align-self: flex-end; padding: 0.4em 1em; font-size: 0.9em; font-weight: 600; color: #fff; background: #2563eb; border-radius: 0.6em; }
.m-compose { position: relative; display: flex; gap: 1em; }
.m-compose > .m-swap { flex: 1; }
.m-caret { position: absolute; left: 0.95em; top: 0.85em; width: 0.1em; height: 1.3em; background: #11181c; opacity: 0; }
.m-msg.out { align-self: flex-end; max-width: 80%; overflow: hidden; color: #fff; background: #2563eb; border-radius: 1em 1em 0.3em 1em; }
.m-cursor {
  position: absolute; left: 0; top: 0; width: 1.9em; height: 1.9em; fill: #11181c; stroke: #fff; stroke-width: 1.5;
  stroke-linejoin: round; filter: drop-shadow(0 0.15em 0.2em rgba(0, 0, 0, 0.3)); opacity: 0;
}

/* click into the box at 7%, keys down 12% to 46%, typed at 56%, sent at 67% */
.dict-key { animation-name: dict-key; }
.dict-pill { animation-name: dict-pill; }
.dict-listen { animation-name: dict-listen; }
.dict-busy { animation-name: dict-busy; }
.dict-done { animation-name: dict-done; }
.dict-empty { animation-name: dict-empty; }
.dict-typed { animation-name: dict-typed; }
.dict-compose { animation-name: dict-compose; }
.dict-caret { animation-name: dict-caret; }
.dict-send { animation-name: dict-send; }
.dict-sent { animation-name: dict-sent; }
.dict-cursor { animation-name: dict-cursor; }
@keyframes dict-level {
  0%, 12% { --lv: 0; } 15% { --lv: 0.5; } 18% { --lv: 0.85; } 21% { --lv: 0.4; } 24% { --lv: 0.75; } 27% { --lv: 0.55; }
  30% { --lv: 0.95; } 33% { --lv: 0.3; } 36% { --lv: 0.7; } 39% { --lv: 0.85; } 42% { --lv: 0.45; } 45% { --lv: 0.6; } 46%, 100% { --lv: 0; }
}
@keyframes dict-key {
  0%, 12% { transform: none; border-bottom-width: 0.25em; color: #e5e7eb; }
  12.5%, 46% { transform: translateY(0.15em); border-bottom-width: 0.1em; color: var(--good); }
  47%, 100% { transform: none; border-bottom-width: 0.25em; color: #e5e7eb; }
}
@keyframes dict-pill {
  0%, 12% { opacity: 0; transform: translate(-50%, 0.8em); }
  14%, 82% { opacity: 1; transform: translateX(-50%); }
  85%, 100% { opacity: 0; transform: translate(-50%, 0.8em); }
}
@keyframes dict-listen { 0%, 46% { opacity: 1; } 47%, 100% { opacity: 0; } }
@keyframes dict-busy { 0%, 46% { opacity: 0; } 47%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }
@keyframes dict-done { 0%, 55% { opacity: 0; } 56%, 96% { opacity: 1; } 98%, 100% { opacity: 0; } }
@keyframes dict-empty { 0%, 55% { opacity: 1; } 56%, 67% { opacity: 0; } 68%, 100% { opacity: 1; } }
@keyframes dict-typed { 0%, 55% { opacity: 0; } 56%, 67% { opacity: 1; } 68%, 100% { opacity: 0; } }
@keyframes dict-compose {
  0%, 7% { border-color: #d5d9de; box-shadow: none; }
  7.5%, 96% { border-color: #2563eb; box-shadow: 0 0 0 0.2em rgba(37, 99, 235, 0.15); }
  98%, 100% { border-color: #d5d9de; box-shadow: none; }
}
@keyframes dict-caret { 0%, 7% { opacity: 0; } 7.5%, 55% { opacity: 1; } 56%, 67% { opacity: 0; } 68%, 96% { opacity: 1; } 98%, 100% { opacity: 0; } }
@keyframes dict-send { 0%, 66% { transform: none; filter: none; } 67% { transform: scale(0.94); filter: brightness(0.85); } 68%, 100% { transform: none; filter: none; } }
@keyframes dict-sent {
  0%, 67.5% { max-height: 0; padding-block: 0; margin-top: -0.6em; opacity: 0; }
  70%, 96% { max-height: 6em; padding-block: 0.6em; margin-top: 0; opacity: 1; }
  98%, 100% { max-height: 0; padding-block: 0; margin-top: -0.6em; opacity: 0; }
}
@keyframes dict-cursor {
  0%, 1% { transform: translate(30em, 30em); opacity: 0; }
  3% { opacity: 1; }
  6% { transform: var(--click-box); }
  7% { transform: var(--click-box) scale(0.85); }
  8%, 60% { transform: var(--click-box); }
  65% { transform: var(--click-send); }
  67% { transform: var(--click-send) scale(0.85); }
  68%, 72% { transform: var(--click-send); opacity: 1; }
  78%, 100% { transform: var(--click-send) translate(3em, 6em); opacity: 0; }
}

/* the tray menu, drawn as a KDE popup; picks Top of the screen at 66% */
.m-menu {
  position: absolute; right: 1em; bottom: 3.4em; width: 21em; padding: 0.35em; display: flex; flex-direction: column;
  font-size: 0.85em; color: #11181c; background: #fff; border-radius: 0.6em; box-shadow: 0 0.6em 2em rgba(0, 0, 0, 0.35); opacity: 0;
}
.m-menu > span { position: relative; display: flex; align-items: center; padding: 0.4em 0.7em 0.4em 2.4em; border-radius: 0.4em; white-space: nowrap; }
.m-menu > span > .i:not(.m-chev) { position: absolute; left: 0.7em; width: 1.1em; height: 1.1em; }
.m-menu .m-chev { margin-left: auto; width: 1em; height: 1em; color: #6b7280; }
.m-menu .off { color: #9aa0a6; }
.m-menu hr { width: 100%; margin: 0.3em 0; border: 0; border-top: 1px solid #e4e7eb; }
.m-sub { right: calc(100% + 0.3em); bottom: auto; top: 5.9em; width: 14em; font-size: 1em; }
.m-radio { position: absolute; left: 0.8em; width: 0.95em; height: 0.95em; border: 0.12em solid #9aa0a6; border-radius: 50%; }
.desk-caps { animation-name: desk-caps; }
.desk-menu { animation-name: desk-menu; }
.desk-sub { animation-name: desk-sub; }
.desk-row { animation-name: desk-row; }
.desk-top-row { animation-name: desk-top-row; }
.desk-bottom { animation-name: desk-bottom; }
.desk-top { animation-name: desk-top; }
.desk-cursor { animation-name: desk-cursor; }
@keyframes desk-menu {
  0%, 56.5% { opacity: 0; transform: translateY(0.6em); }
  57.5%, 66.5% { opacity: 1; transform: none; }
  67.5%, 100% { opacity: 0; transform: none; }
}
@keyframes desk-sub { 0%, 60.5% { opacity: 0; } 61.5%, 66.5% { opacity: 1; } 67.5%, 100% { opacity: 0; } }
@keyframes desk-row { 0%, 59.5% { background: transparent; } 60%, 63% { background: #e7f5ec; } 63.5%, 100% { background: transparent; } }
@keyframes desk-top-row { 0%, 63% { background: transparent; } 63.5%, 66.5% { background: #e7f5ec; } 67%, 100% { background: transparent; } }
@keyframes desk-bottom {
  0%, 65.5% { border-color: #1e7f45; background: #1e7f45; box-shadow: inset 0 0 0 0.18em #fff; }
  66%, 96% { border-color: #9aa0a6; background: transparent; box-shadow: none; }
  98%, 100% { border-color: #1e7f45; background: #1e7f45; box-shadow: inset 0 0 0 0.18em #fff; }
}
@keyframes desk-top {
  0%, 65.5% { border-color: #9aa0a6; background: transparent; box-shadow: none; }
  66%, 96% { border-color: #1e7f45; background: #1e7f45; box-shadow: inset 0 0 0 0.18em #fff; }
  98%, 100% { border-color: #9aa0a6; background: transparent; box-shadow: none; }
}
@keyframes desk-caps {
  0%, 67.5% { transform: none; animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1); }
  71%, 96% { transform: translateY(-23.4em); }
  98%, 100% { transform: none; }
}
@keyframes desk-cursor {
  0%, 48% { transform: translate(50em, 20em); opacity: 0; }
  50% { opacity: 1; }
  55.5% { transform: var(--tray); }
  56.5% { transform: var(--tray) scale(0.85); }
  57.5% { transform: var(--tray); }
  60%, 62.5% { transform: var(--row); }
  64.5% { transform: var(--top); }
  65.5% { transform: var(--top) scale(0.85); }
  66.5%, 72% { transform: var(--top); opacity: 1; }
  78%, 100% { transform: var(--top) translate(-4em, -6em); opacity: 0; }
}

/* the terminal runs on the same kind of clock: a word shows on the hearing line
   when it is heard (--i) and moves up into the transcript two cycles later */
.m-term { --d: 16s; --t: 3; --lv: 0.75; animation-name: term-clock, term-level; counter-reset: words 196; }
@keyframes term-clock { 0% { --t: 3; } 90%, 96% { --t: 17; } 98%, 100% { --t: 3; } }
@keyframes term-level {
  0% { --lv: 0.75; } 8% { --lv: 0.6; } 16% { --lv: 0.85; } 24% { --lv: 0.65; } 32% { --lv: 0.8; } 40% { --lv: 0.55; }
  48% { --lv: 0.85; } 56% { --lv: 0.7; } 64% { --lv: 0.8; } 72% { --lv: 0.6; } 80% { --lv: 0.85; } 88%, 100% { --lv: 0.75; }
}
.term-said i {
  font-style: normal; font-size: calc(clamp(0, var(--t) - var(--i) - 1, 1) * 1em);
  counter-increment: words calc(clamp(0, var(--t) - var(--i) - 1, 1));
}
.term-heard i { font-style: italic; font-size: calc(clamp(0, var(--t) - var(--i) + 1, 1) * clamp(0, var(--i) + 2 - var(--t), 1) * 1em); }
.term-meter { clip-path: inset(0 calc((1 - var(--lv)) * 100%) 0 0); }
.term-count { counter-reset: s calc(mod(224 + var(--t), 60)) m calc(round(down, (224 + var(--t)) / 60, 1)); }
.term-count::before { content: counter(words) " words  " counter(m) ":" counter(s, decimal-leading-zero); }

/* a11y */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 10; padding: 10px 16px; border-radius: 10px;
  background: var(--ink); color: var(--paper); font-weight: 500; text-decoration: none;
}
.skip:focus { top: 12px; }
.skip:hover { color: var(--paper); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* narrow screens */
@media (max-width: 900px) {
  .split, .grid { grid-template-columns: minmax(0, 1fr); }
  .grid { gap: 24px; }
}
@media (max-width: 640px) {
  section { padding-block: 48px; }
  .lede { font-size: 17px; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .reqs { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .reqs dd + dt { margin-top: 10px; }
  .figures dt { font-size: 30px; }
  .distros td:first-of-type, .distros thead th:nth-child(2) { display: none; }

  /* Too small to read at phone width, so the desktop is cropped to the middle
     around the captions box, which is what the mockup is about. */
  .m-desk { --w: 52; }
  .m-desk .m-stage { width: 80em; margin-left: -14em; }
  /* The tray is out of frame there, so the box stays at the bottom and the
     menu beat is dropped. */
  .desk-menu, .desk-cursor { display: none; }
  .desk-caps { animation-name: none; }
  /* Voice typing loses its margins instead, so the text stays readable. */
  .m-dict { --w: 38; --click-box: translate(10em, 21.3em); --click-send: translate(32.4em, 22.2em); }
  .m-chat { left: 0.8em; right: 0.8em; }
  .m-keys { right: 0.8em; }
  /* Under 60 columns the terminal UI drops its timestamp gutter, and so does this. */
  .tui { font-size: 12px; }
  .para { padding-left: 0; }
  .gut, .spark { display: none; }
}
