/* Fonts are served from this site: General Sans (ITF Free Font License) for Latin text and digits,
   Saywell SC (Noto Sans SC, OFL, cut to the characters in use by tools/make_fonts.py) for Chinese. */
@font-face {
  font-family: "General Sans";
  src: url("assets/fonts/GeneralSans-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "General Sans";
  src: url("assets/fonts/GeneralSans-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "General Sans";
  src: url("assets/fonts/GeneralSans-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Saywell SC";
  src: url("assets/fonts/saywell-sc.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* Colours. The site is dark unless the visitor picks the light theme with the switch in the header
   (main.js remembers the choice; partials/head.html applies it before the page draws). Lettering,
   lines and glass are drawn in "ink" and the page in "paper", both as r, g, b so they take any
   alpha; the light theme swaps the two and adjusts the few colours that are not black or white. */
:root {
  color-scheme: dark;
  --ink: 255, 255, 255;
  --paper: 0, 0, 0;
  --bg: rgb(var(--paper));
  --text: #f5f5f7;
  --strong: #fff;
  --muted: rgba(var(--ink), 0.62);
  --faint: rgba(var(--ink), 0.4);
  --hairline: rgba(var(--ink), 0.1);
  --card: rgba(var(--ink), 0.035);
  --card-border: rgba(var(--ink), 0.08);
  /* The app icon's periwinkle, and the cyan of the hero's vortex. */
  --accent: #8fa3f8;
  --accent-rgb: 143, 163, 248;
  --accent-2: #74d4f4;
  --accent-2-rgb: 116, 212, 244;
  --red: 255, 107, 107;
  --red-text: #ff8b8b;
  --green: #4cd38a;
  /* The band of light that drifts across titles, and the streak on top of the pill buttons. */
  --sheen: rgba(255, 255, 255, 0.95);
  --glint: rgba(255, 255, 255, 0.95);
  /* Shadows are written for the dark page; the light page scales their opacity down. */
  --shadow-k: 1;
  --header-bg: rgba(0, 0, 0, 0.62);
  --overlay: rgba(0, 0, 0, 0.55);
  --hero-shade: rgba(0, 0, 0, 0.5);
  --hero-filter: none;
  --menu-bg: rgba(22, 22, 24, 0.94);
  --window-top: rgba(28, 28, 32, 0.92);
  --window-bottom: rgba(14, 14, 17, 0.94);
  --chip-bg: #121216;
  --key-top: #2a2a2f;
  --key-bottom: #18181b;
  --key-edge: #0c0c0e;
  --font: "General Sans", "Saywell SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei UI",
    "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad-x: clamp(20px, 8.3vw, 120px);
}

/* Light: Apple-style white page and near-black lettering. The hero video is inverted, so the dark
   vortex becomes pale ink on white, under a light veil instead of a dark one. */
:root[data-theme="light"] {
  color-scheme: light;
  --ink: 29, 29, 31;
  --paper: 255, 255, 255;
  --text: #1d1d1f;
  --strong: #1d1d1f;
  --muted: rgba(var(--ink), 0.7);
  --faint: rgba(var(--ink), 0.52);
  --card: rgba(var(--ink), 0.03);
  --accent: #5468e8;
  --accent-rgb: 84, 104, 232;
  --accent-2: #0e98c8;
  --accent-2-rgb: 14, 152, 200;
  --red: 222, 64, 64;
  --red-text: #d03b3b;
  --green: #16a05c;
  --sheen: rgba(var(--accent-rgb), 0.9);
  --glint: rgba(var(--accent-rgb), 0.55);
  --shadow-k: 0.2;
  --header-bg: rgba(255, 255, 255, 0.72);
  --overlay: rgba(0, 0, 0, 0.18);
  --hero-shade: rgba(255, 255, 255, 0.4);
  --hero-filter: invert(1) hue-rotate(180deg);
  --menu-bg: rgba(255, 255, 255, 0.96);
  --window-top: rgba(255, 255, 255, 0.97);
  --window-bottom: rgba(247, 247, 250, 0.97);
  --chip-bg: #fff;
  --key-top: #fff;
  --key-bottom: #ededf1;
  --key-edge: #c8c8cf;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* No scroll-behavior: smooth here: the browser would also glide when it restores the position on
   reload, and ScrollTrigger would measure the hero mid-glide. main.js smooths in-page links instead. */
html {
  scroll-padding-top: 72px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg,
video {
  display: block;
}

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
}

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

.menu-open {
  overflow: hidden;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
}

.site-header.is-scrolled {
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--hairline);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px var(--pad-x);
  transition: padding 0.4s var(--ease);
}

.is-scrolled .header-inner {
  padding-top: 12px;
  padding-bottom: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: clamp(28px, 4vw, 56px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--strong);
}

.brand img {
  width: 28px;
  height: 28px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--strong);
  opacity: 0.86;
  transition: opacity 0.2s ease;
}

.nav a:hover,
.nav a.is-active,
.nav a[aria-current="page"] {
  opacity: 1;
}

.nav a.is-active .chevron,
.nav a[aria-current="page"] .chevron {
  transform: rotate(-90deg);
}

.chevron {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--ease);
}

.nav a:hover .chevron {
  transform: translateY(2px);
}

/* An underline grows under the hovered or current link. */
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 20px;
  bottom: -7px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.nav a:hover::after,
.nav a.is-active::after,
.nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.brand img {
  transition: rotate 0.5s var(--ease), scale 0.5s var(--ease);
}

.brand:hover img {
  rotate: -8deg;
  scale: 1.08;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------- Theme switch: a sun on the dark page, a moon on the light one ---------- */

.theme-toggle {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: 0.6px solid rgba(var(--ink), 0.6);
  border-radius: 50%;
  background: transparent;
  color: var(--strong);
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, scale 0.35s var(--ease);
}

.theme-toggle:hover {
  border-color: rgba(var(--ink), 0.9);
  background: rgba(var(--ink), 0.08);
  scale: 1.06;
}

.theme-toggle:active {
  scale: 0.94;
  transition-duration: 0.12s;
}

.theme-toggle svg {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.4s ease, rotate 0.6s var(--ease), scale 0.6s var(--ease);
}

.theme-toggle .moon,
[data-theme="light"] .theme-toggle .sun {
  opacity: 0;
  rotate: -90deg;
  scale: 0.4;
}

[data-theme="light"] .theme-toggle .moon {
  opacity: 1;
  rotate: 0deg;
  scale: 1;
}

/* Switching themes: the new one grows out of the switch as a circle (main.js animates it). */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* ---------- Pills: a thin white rim around an inner pill, with a light streak on top ---------- */

.pill {
  position: relative;
  display: inline-flex;
  flex: none;
  padding: 2px;
  border: 0.6px solid rgba(var(--ink), 0.92);
  border-radius: 999px;
  isolation: isolate;
  /* --tx/--ty: the magnetic pull towards the pointer (main.js). */
  translate: var(--tx, 0px) var(--ty, 0px);
  transition: translate 0.5s var(--ease), scale 0.35s var(--ease), box-shadow 0.35s ease;
}

.pill::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  z-index: 1;
  width: 58%;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--glint), transparent);
  filter: blur(3px);
  opacity: 0.75;
  pointer-events: none;
  transition: opacity 0.35s ease, width 0.35s var(--ease);
}

.pill > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 29px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--strong);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.3s ease;
}

.pill:hover {
  scale: 1.035;
}

.pill:active {
  scale: 0.97;
  transition-duration: 0.12s;
}

/* On hover a soft light gathers under the pointer, behind the label (--gx/--gy from main.js). */
.pill > span {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.pill > span::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(90px circle at var(--gx, 50%) var(--gy, 50%), rgba(var(--ink), 0.16), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.pill-light > span::after {
  background: radial-gradient(90px circle at var(--gx, 50%) var(--gy, 50%), rgba(var(--accent-rgb), 0.2), transparent 70%);
}

.pill:hover > span::after {
  opacity: 1;
}

.pill:hover::before {
  opacity: 1;
  width: 76%;
}

.pill-light > span {
  background: rgb(var(--ink));
  color: var(--bg);
}

.pill-light {
  box-shadow: 0 0 32px rgba(var(--ink), 0.12);
}

.pill-light:hover {
  box-shadow: 0 0 40px rgba(var(--ink), 0.2), 0 0 70px rgba(var(--accent-rgb), 0.16);
}

.pill-large > span {
  padding: 15px 36px;
  font-size: 16px;
}

/* ---------- Mobile menu ---------- */

.burger {
  display: none;
  place-content: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  border: 0.6px solid rgba(var(--ink), 0.6);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.burger span {
  display: block;
  width: 16px;
  height: 1.4px;
  border-radius: 1px;
  background: rgb(var(--ink));
  transition: transform 0.35s var(--ease);
}

.menu-open .burger span:nth-child(1) {
  transform: translateY(3.7px) rotate(45deg);
}

.menu-open .burger span:nth-child(2) {
  transform: translateY(-3.7px) rotate(-45deg);
}

.menu-overlay:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease both;
}

.mobile-menu:not([hidden]) {
  position: fixed;
  top: 76px;
  left: 16px;
  right: 16px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  padding: 12px 22px 22px;
  border: 1px solid var(--card-border);
  border-radius: 24px;
  background: var(--menu-bg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, calc(0.5 * var(--shadow-k)));
  animation: menuIn 0.4s var(--ease) both;
}

.mobile-menu > a {
  padding: 15px 4px;
  border-bottom: 1px solid var(--hairline);
  font-size: 17px;
  font-weight: 500;
  animation: rise 0.45s var(--ease) calc(0.05s + var(--i) * 0.04s) both;
}

.mobile-menu > .pill {
  align-self: stretch;
  margin-top: 18px;
  padding: 2px;
  border-bottom: 0.6px solid rgba(var(--ink), 0.92);
}

.mobile-menu > .pill > span {
  flex: 1;
  padding: 14px;
  font-size: 16px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--bg);
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0;
  filter: var(--hero-filter);
  transition: opacity 1.4s ease;
  will-change: transform;
}

.hero-video.is-playing {
  opacity: 1;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background: var(--hero-shade);
}

.hero-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 280px 24px 102px;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid rgba(var(--ink), 0.2);
  border-radius: 20px;
  background: rgba(var(--ink), 0.1);
  color: var(--strong);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.3s ease;
}

.badge:hover {
  background: rgba(var(--ink), 0.16);
}

.badge-arrow {
  width: 0;
  height: 12px;
  margin-left: -8px;
  opacity: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: width 0.35s var(--ease), margin 0.35s var(--ease), opacity 0.3s ease;
}

.badge:hover .badge-arrow {
  width: 12px;
  margin-left: 0;
  opacity: 1;
}

.badge-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgb(var(--ink));
  box-shadow: 0 0 8px rgba(var(--ink), 0.9);
}

.badge .dim {
  color: rgba(var(--ink), 0.6);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* Two four-character phrases: one line on wide screens, stacked on phones. The letter spacing
   leaves a gap after the last character, so the same amount on the left keeps it centred. */
.hero-title {
  padding-left: 0.1em;
  font-size: clamp(48px, 5.4vw, 76px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.1em;
  background-image: linear-gradient(100deg, transparent 38%, var(--sheen) 50%, transparent 62%),
    linear-gradient(150deg, rgb(var(--ink)) 40%, rgba(var(--ink), 0.22) 112%);
  background-size: 250% 100%, 100% 100%;
  background-position: 100% 0, 0 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-title span {
  display: inline-block;
}

.hero-title span + span {
  margin-left: 0.55em;
}

.hero-sub {
  text-wrap: balance;
  max-width: 680px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.75;
  color: rgba(var(--ink), 0.7);
}

/* ---------- Sections ---------- */

.section {
  position: relative;
  padding: clamp(110px, 13vw, 180px) 24px;
}

.section-head {
  max-width: 760px;
  margin: 0 auto clamp(52px, 6vw, 84px);
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.h2 {
  text-wrap: balance;
  font-size: clamp(36px, 5.2vw, 64px);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.02em;
  /* Top layer: a band of light, parked off the left edge until the title is on screen (see sheen). */
  background-image: linear-gradient(100deg, transparent 38%, var(--sheen) 50%, transparent 62%),
    linear-gradient(180deg, rgba(var(--ink), 0.8) 30%, rgba(var(--ink), 0.48));
  background-size: 250% 100%, 100% 100%;
  background-position: 100% 0, 0 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  text-wrap: balance;
  max-width: 640px;
  margin: 22px auto 0;
  font-size: clamp(16px, 1.55vw, 20px);
  line-height: 1.7;
  color: var(--muted);
}

/* ---------- Demo ---------- */

.demo-stage {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
}

.demo-stage:hover .demo-window {
  border-color: rgba(var(--accent-rgb), 0.32);
  box-shadow: 0 40px 120px rgba(0, 0, 0, calc(0.6 * var(--shadow-k))), 0 0 70px rgba(var(--accent-rgb), 0.16),
    inset 0 1px 0 rgba(var(--ink), 0.1);
}

.demo-stage:hover .demo-glow {
  filter: blur(26px) brightness(1.5);
}

.demo-glow {
  transition: filter 0.6s ease;
  position: absolute;
  inset: 8% 10% 20%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(var(--accent-rgb), 0.24), rgba(var(--accent-2-rgb), 0.08) 60%, transparent);
  filter: blur(40px);
}

.demo-window {
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
  overflow: hidden;
  border: 1px solid rgba(var(--ink), 0.12);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--window-top), var(--window-bottom));
  box-shadow: 0 40px 120px rgba(0, 0, 0, calc(0.6 * var(--shadow-k))), inset 0 1px 0 rgba(var(--ink), 0.08);
}

.demo-bar {
  display: flex;
  gap: 8px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--hairline);
}

.demo-bar i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(var(--ink), 0.16);
}

.demo-body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  min-height: 280px;
}

.demo-pane {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(24px, 3.4vw, 40px);
}

.demo-label {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 22px;
  font-size: 13px;
  font-weight: 500;
  color: var(--faint);
}

.demo-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.demo-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.demo[data-phase="listen"] .demo-state {
  color: rgb(var(--red));
}

.demo[data-phase="clean"] .demo-state {
  color: var(--accent);
}

.demo[data-phase="done"] .demo-state {
  color: var(--green);
}

.wave {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
}

.wave i {
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: rgba(var(--ink), 0.5);
  transform: scaleY(0.18);
  transition: transform 0.4s var(--ease);
}

.demo[data-phase="listen"] .wave i {
  animation: wave 0.9s ease-in-out infinite;
}

.wave i:nth-child(3n) {
  animation-delay: -0.3s;
}

.wave i:nth-child(3n + 1) {
  animation-delay: -0.55s;
}

.wave i:nth-child(4n) {
  animation-duration: 0.7s;
}

.wave i:nth-child(5n) {
  animation-duration: 1.1s;
}

.demo-raw {
  min-height: 5.4em;
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.75;
  color: rgba(var(--ink), 0.92);
}

.tok {
  transition: color 0.5s ease, opacity 0.5s ease, background 0.5s ease;
}

.tok.drop.is-gone {
  color: rgba(var(--red), 0.75);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  opacity: 0.45;
}

.tok.fix {
  white-space: nowrap;
}

.tok.fix .new {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  vertical-align: bottom;
  white-space: nowrap;
  color: var(--accent);
  transition: max-width 0.6s var(--ease), margin 0.6s var(--ease);
}

.tok.fix.is-gone .old {
  color: rgba(var(--red), 0.75);
  text-decoration: line-through;
  opacity: 0.55;
}

.tok.fix.is-gone .new {
  max-width: 4em;
  margin-left: 4px;
}

.tok.cmd.is-gone {
  padding: 1px 8px;
  border-radius: 6px;
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
}

.demo-divider {
  position: relative;
  display: grid;
  place-items: center;
  width: 1px;
  margin: 28px 0;
  background: var(--hairline);
}

.demo-divider span {
  position: absolute;
  padding: 6px 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0.55;
  transition: opacity 0.4s ease, box-shadow 0.4s ease;
}

.demo[data-phase="clean"] .demo-divider span {
  opacity: 1;
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.45);
}

.demo-input {
  position: relative;
  min-height: 5.4em;
  padding: 16px 52px 16px 18px;
  border: 1px solid rgba(var(--ink), 0.12);
  border-radius: 16px;
  background: rgba(var(--ink), 0.04);
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.75;
  color: var(--strong);
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  margin-left: 1px;
  vertical-align: -0.18em;
  background: var(--accent-2);
  animation: blink 1.05s steps(1) infinite;
}

.demo-send {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(var(--ink), 0.1);
  transition: background 0.4s ease;
}

.demo[data-phase="done"] .demo-send {
  background: var(--accent);
}

.demo[data-phase="done"] .demo-send svg {
  stroke: #fff;
}

.demo-send svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--strong);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.demo-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.demo-tab {
  position: relative;
  overflow: hidden;
  padding: 9px 18px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease, translate 0.4s var(--ease);
}

.demo-tab:hover {
  translate: 0 -2px;
  border-color: rgba(var(--ink), 0.22);
  color: var(--strong);
}

.demo-tab[aria-selected="true"] {
  border-color: rgba(var(--ink), 0.28);
  background: rgba(var(--ink), 0.08);
  color: var(--strong);
}

/* A thin bar under the playing example shows how long it has left. */
.demo-tab::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
}

.demo-tab.is-timing::after {
  transform: scaleX(1);
  transition: transform var(--duration, 8s) linear;
}

.demo-note {
  margin-top: 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--faint);
}

/* ---------- Features ---------- */

.feature-lead,
.feature-grid {
  max-width: 1120px;
  margin: 0 auto;
}

/* The main feature spans the row: words on the left, the cleanup on the right. */
.card.feature-lead {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  align-items: center;
  gap: clamp(28px, 4vw, 56px);
  padding: clamp(30px, 4vw, 48px);
}

.card .card-kicker {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.card.feature-lead h3 {
  margin-top: 12px;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.feature-lead .feature-lead-text > p:last-child {
  margin-top: 18px;
  font-size: 16.5px;
}

.feature-lead .card-visual {
  height: 230px;
}

/* The other six share one size, three to a row. */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.feature-grid .card-visual {
  height: 136px;
}

.card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 30px 30px 32px;
  border: 1px solid var(--card-border);
  border-radius: 26px;
  background: var(--card);
  --mx: 50%;
  --my: 0%;
  /* --rx/--ry: a slight tilt towards the pointer (main.js). */
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.6s var(--ease), translate 0.5s var(--ease), border-color 0.4s ease, background 0.4s ease,
    box-shadow 0.5s ease;
}

.card:hover {
  translate: 0 -6px;
  border-color: rgba(var(--ink), 0.16);
  background: rgba(var(--ink), 0.05);
  box-shadow: 0 30px 80px rgba(0, 0, 0, calc(0.55 * var(--shadow-k))), 0 0 40px rgba(var(--accent-rgb), 0.08);
}

.card:hover .card-visual {
  border-color: rgba(var(--accent-rgb), 0.2);
}

/* A soft light follows the pointer across the card. */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(520px circle at var(--mx) var(--my), rgba(var(--accent-rgb), 0.11), transparent 42%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
}

.card h3 {
  margin-top: 26px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--strong);
}

.card p {
  margin-top: 10px;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--muted);
}

.card-visual {
  position: relative;
  display: grid;
  place-items: center;
  height: 150px;
  overflow: hidden;
  border: 1px solid rgba(var(--ink), 0.05);
  border-radius: 18px;
  background: radial-gradient(120% 100% at 50% 0%, rgba(var(--accent-rgb), 0.1), rgba(var(--ink), 0.015));
  transition: border-color 0.4s ease;
}

.visual-clean p {
  /* Break only after punctuation, never inside a word such as 开会. */
  word-break: keep-all;
  text-wrap: balance;
  padding: 0 24px;
  font-size: clamp(17px, 1.8vw, 22px);
  text-align: center;
  color: var(--strong);
}

.visual-clean .x {
  text-decoration: line-through transparent;
  text-decoration-thickness: 1.5px;
}

.in-view .visual-clean .x {
  animation: strike 6s ease infinite;
}

/* 三点 and 3点 share one spot and cross-fade. */
.visual-clean .swap {
  display: inline-grid;
}

.visual-clean .swap > * {
  grid-area: 1 / 1;
  font-weight: inherit;
  text-decoration: none;
}

.visual-clean .swap b {
  color: var(--accent);
  opacity: 0;
}

.in-view .visual-clean .swap s {
  animation: swapOut 6s ease infinite;
}

.in-view .visual-clean .swap b {
  animation: swapIn 6s ease infinite;
}

.chip-box {
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(var(--ink), 0.14);
  border-radius: 24px;
  background: rgba(var(--ink), 0.04);
}

.chip-box svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--strong);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.orbit {
  position: absolute;
  inset: -18px;
  border-radius: 50%;
}

.orbit::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 10px var(--accent-2);
}

.in-view .orbit {
  animation: orbit 4.5s linear infinite;
}

.in-view .orbit:nth-child(2) {
  animation-delay: -1.5s;
}

.in-view .orbit:nth-child(3) {
  animation-delay: -3s;
}

.mini-input {
  display: flex;
  align-items: center;
  width: min(240px, 80%);
  height: 50px;
  padding: 0 16px;
  border: 1px solid rgba(var(--ink), 0.14);
  border-radius: 14px;
  background: rgba(var(--ink), 0.05);
  font-size: 17px;
  color: var(--strong);
}

.mini-input .typing {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.in-view .mini-input .typing {
  animation: type 5s steps(6) infinite;
}

.visual-translate span {
  position: absolute;
  font-size: 22px;
  font-weight: 500;
  color: var(--strong);
  opacity: 0;
}

.in-view .visual-translate span {
  animation: cycle 7.5s var(--ease) infinite;
}

.in-view .visual-translate span:nth-child(2) {
  animation-delay: 2.5s;
  color: var(--accent);
}

.in-view .visual-translate span:nth-child(3) {
  animation-delay: 5s;
  color: var(--accent-2);
}

.visual-words {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 8px;
  padding: 18px;
}

.visual-words span {
  padding: 6px 12px;
  border: 1px solid rgba(var(--ink), 0.14);
  border-radius: 999px;
  background: rgba(var(--ink), 0.05);
  font-size: 14px;
  color: var(--strong);
}

.in-view .visual-words span {
  animation: pop 6s var(--ease) infinite;
}

.in-view .visual-words span:nth-child(2) {
  animation-delay: 0.2s;
}

.in-view .visual-words span:nth-child(3) {
  animation-delay: 0.4s;
}

.in-view .visual-words span:nth-child(4) {
  animation-delay: 0.6s;
}

.in-view .visual-words span:nth-child(5) {
  animation-delay: 0.8s;
}

.bars {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 70px;
}

.bars i {
  width: 8px;
  height: 70px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  transform: scaleY(0.25);
}

.in-view .bars i {
  animation: wave 1.2s ease-in-out infinite;
}

.in-view .bars i:nth-child(2) {
  animation-delay: -0.2s;
}

.in-view .bars i:nth-child(3) {
  animation-delay: -0.5s;
}

.in-view .bars i:nth-child(4) {
  animation-delay: -0.8s;
}

.in-view .bars i:nth-child(5) {
  animation-delay: -0.35s;
}

.in-view .bars i:nth-child(6) {
  animation-delay: -0.65s;
}

.in-view .bars i:nth-child(7) {
  animation-delay: -0.1s;
}

.visual-update {
  align-content: center;
  gap: 18px;
}

.update-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--strong);
  font-size: 15px;
  font-weight: 500;
}

.update-icon {
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
}

.in-view .update-icon {
  animation: spin 1.4s linear infinite;
}

.update-bar {
  width: min(320px, 70%);
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(var(--ink), 0.1);
}

.update-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
}

.in-view .update-bar i {
  animation: fill 4.5s var(--ease) infinite;
}

/* ---------- How ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 4vw, 56px);
  max-width: 1080px;
  margin: 0 auto;
}

.steps li {
  padding: 28px;
  border: 1px solid transparent;
  border-radius: 24px;
  transition: background 0.4s ease, border-color 0.4s ease, translate 0.5s var(--ease);
}

.steps li:hover {
  translate: 0 -5px;
  border-color: var(--card-border);
  background: var(--card);
}

.steps li:hover .step-number {
  background-image: linear-gradient(180deg, var(--accent-2), rgba(var(--accent-rgb), 0.12));
}

.step-number {
  display: block;
  font-size: 56px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, rgb(var(--ink)), rgba(var(--ink), 0.12));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.steps h3 {
  margin-top: 22px;
  font-size: 22px;
  font-weight: 600;
  color: var(--strong);
}

.steps p {
  margin-top: 10px;
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--muted);
}

.keyboard {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: fit-content;
  max-width: 100%;
  margin: clamp(64px, 8vw, 96px) auto 0;
}

.listening {
  margin-bottom: 18px;
  padding: 8px 16px;
  border: 1px solid rgba(var(--red), 0.35);
  border-radius: 999px;
  background: rgba(var(--red), 0.14);
  color: var(--red-text);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(8px);
}

.keys {
  display: flex;
  gap: 10px;
}

.key {
  display: grid;
  place-items: center;
  min-width: 72px;
  height: 64px;
  padding: 0 18px;
  border: 1px solid rgba(var(--ink), 0.14);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--key-top), var(--key-bottom));
  box-shadow: 0 6px 0 var(--key-edge), 0 10px 24px rgba(0, 0, 0, calc(0.6 * var(--shadow-k))), inset 0 1px 0 rgba(var(--ink), 0.12);
  font-size: 15px;
  font-weight: 500;
  color: rgba(var(--ink), 0.55);
}

.key-space {
  width: clamp(110px, 26vw, 300px);
}

.key-ctrl {
  color: var(--strong);
}

.key {
  transition: translate 0.2s var(--ease), box-shadow 0.2s ease, color 0.2s ease;
}

.key:hover {
  translate: 0 4px;
  color: var(--strong);
  box-shadow: 0 2px 0 var(--key-edge), 0 6px 16px rgba(0, 0, 0, calc(0.6 * var(--shadow-k))), inset 0 1px 0 rgba(var(--ink), 0.12);
}

.in-view .key-ctrl {
  animation: press 3.2s var(--ease) infinite;
}

.in-view .listening {
  animation: listen 3.2s var(--ease) infinite;
}

.more {
  margin-top: 56px;
  text-align: center;
  font-size: 17px;
}

.more a {
  color: var(--accent);
}

.more a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- Privacy ---------- */

.flow {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  max-width: 1080px;
  margin: 0 auto;
}

.flow-local {
  position: relative;
  display: flex;
  align-items: flex-start;
  padding: 38px 26px 26px;
  border: 1px dashed rgba(var(--accent-rgb), 0.5);
  border-radius: 28px;
  background: rgba(var(--accent-rgb), 0.04);
}

.flow-tag {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.flow-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 108px;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--strong);
}

.flow-node svg {
  width: 56px;
  height: 56px;
  padding: 14px;
  border: 1px solid rgba(var(--ink), 0.14);
  border-radius: 18px;
  background: rgba(var(--ink), 0.05);
  fill: none;
  stroke: var(--strong);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow-node svg .fill {
  fill: var(--accent);
  stroke: none;
}

.flow-node small {
  max-width: 130px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--faint);
}

.flow-node svg {
  transition: translate 0.4s var(--ease), border-color 0.4s ease, box-shadow 0.4s ease;
}

.flow-node:hover svg {
  translate: 0 -3px;
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 0 26px rgba(var(--accent-rgb), 0.35);
}

.flow-cloud svg {
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.1);
}

.flow > .flow-node {
  padding-top: 39px;
}

.flow-link {
  position: relative;
  flex: 1;
  min-width: 48px;
  max-width: 110px;
  height: 2px;
  margin: 67px 6px 0;
  background: repeating-linear-gradient(90deg, rgba(var(--ink), 0.28) 0 6px, transparent 6px 12px);
}

.flow-link i {
  position: absolute;
  top: 50%;
  left: 0;
  font-style: normal;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.flow-local .flow-link {
  margin-top: 28px;
}

.link-audio i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 12px var(--accent-2);
}

.link-text i {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgb(var(--ink));
  color: var(--bg);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.in-view .flow-link i {
  animation: travel 2.6s var(--ease) infinite;
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  max-width: 1120px;
  margin: clamp(64px, 8vw, 96px) auto 0;
}

.facts li {
  padding: 24px;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  background: var(--card);
  transition: translate 0.5s var(--ease), border-color 0.4s ease, background 0.4s ease;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--muted);
}

.facts li:hover {
  translate: 0 -4px;
  border-color: rgba(var(--accent-rgb), 0.32);
  background: rgba(var(--accent-rgb), 0.05);
}

.facts strong {
  display: block;
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--strong);
}

/* ---------- FAQ ---------- */

.faq {
  max-width: 820px;
  margin: 0 auto;
  border-top: 1px solid var(--hairline);
}

.faq details {
  border-bottom: 1px solid var(--hairline);
  transition: background 0.4s ease;
}

.faq details:hover {
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.07), transparent 75%);
}

.faq summary:hover {
  padding-left: 14px;
}

.faq summary:hover::before,
.faq summary:hover::after {
  background: var(--accent);
}

.faq summary {
  position: relative;
  padding: 26px 48px 26px 4px;
  font-size: clamp(17px, 1.7vw, 20px);
  font-weight: 500;
  color: var(--strong);
  cursor: pointer;
  list-style: none;
  transition: padding-left 0.45s var(--ease);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::before,
.faq summary::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 16px;
  height: 1.6px;
  border-radius: 1px;
  background: rgba(var(--ink), 0.7);
  transition: transform 0.4s var(--ease);
}

.faq summary::after {
  transform: rotate(90deg);
}

.faq details[open] summary::after {
  transform: rotate(0deg);
}

.answer {
  overflow: hidden;
}

.answer p {
  padding: 0 48px 28px 4px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
}

/* ---------- Download ---------- */

.download {
  overflow: hidden;
  text-align: center;
}

.download-glow {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(900px, 120vw);
  height: 600px;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(var(--accent-rgb), 0.22), rgba(var(--accent-2-rgb), 0.06) 60%, transparent);
  filter: blur(30px);
  pointer-events: none;
}

.download-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.download-icon {
  width: 104px;
  height: 104px;
  margin-bottom: 36px;
  filter: drop-shadow(0 20px 50px rgba(var(--accent-rgb), 0.45));
  animation: float 6s ease-in-out infinite;
  transition: scale 0.5s var(--ease), rotate 0.5s var(--ease);
}

.download-icon:hover {
  scale: 1.07;
  rotate: -6deg;
}

.download .pill {
  margin-top: 40px;
}

.download-meta {
  margin-top: 22px;
  font-size: 14px;
  color: var(--faint);
}

.download-meta a {
  color: var(--muted);
}

.download-meta a:hover {
  color: var(--strong);
}

.checksum {
  margin-top: 14px;
  font-size: 13px;
  color: var(--faint);
}

.checksum summary {
  cursor: pointer;
  list-style: none;
}

.checksum summary::-webkit-details-marker {
  display: none;
}

.checksum code {
  display: block;
  max-width: min(560px, 86vw);
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
  color: var(--muted);
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 64px var(--pad-x) 40px;
  border-top: 1px solid var(--hairline);
  font-size: 14px;
  color: var(--faint);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 48px;
}

.footer-brand p {
  margin-top: 14px;
  color: var(--muted);
}

.footer-columns {
  display: flex;
  gap: clamp(40px, 7vw, 96px);
}

.footer-columns div {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-columns h3 {
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--strong);
}

.footer-columns a {
  transition: color 0.2s ease, translate 0.3s var(--ease);
}

.footer-columns a:hover {
  translate: 3px 0;
  color: var(--strong);
}

.footer-bottom {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  font-size: 12.5px;
}

/* ---------- Article pages ---------- */

.article {
  max-width: 820px;
  margin: 0 auto;
  padding: 168px 24px 120px;
}

.article-head {
  margin-bottom: 56px;
}

.article-head .lead {
  margin-left: 0;
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 72px;
}

.toc a {
  transition: translate 0.35s var(--ease), color 0.2s ease, border-color 0.2s ease;
  padding: 7px 14px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--card);
  font-size: 14px;
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.toc a:hover {
  border-color: rgba(var(--ink), 0.24);
  color: var(--strong);
}

.article section {
  padding: 40px 0;
  border-top: 1px solid var(--hairline);
}

.article h2:not(.h2) {
  margin-bottom: 18px;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--strong);
}

.article h3 {
  margin: 28px 0 8px;
  font-size: 19px;
  font-weight: 600;
  color: var(--strong);
}

.article p,
.article li {
  font-size: 16.5px;
  line-height: 1.85;
  color: rgba(var(--ink), 0.72);
}

.article p + p,
.article ol + p,
.article ul + p {
  margin-top: 14px;
}

/* Page-level text rules must not repaint the label, the lead or the contents pills. */
.article .eyebrow {
  color: transparent;
}

.article .lead {
  color: var(--muted);
}

.article .toc a:not(.pill) {
  color: var(--muted);
}

.article .toc a:not(.pill):hover {
  translate: 0 -2px;
  color: var(--strong);
}

.article section ol {
  list-style: decimal;
  padding-left: 1.4em;
}

.article section ul,
.release-body ul {
  list-style: disc;
  padding-left: 1.3em;
}

.article li + li {
  margin-top: 8px;
}

.article li::marker {
  color: var(--faint);
}

.article strong {
  font-weight: 600;
  color: var(--strong);
}

.article a:not(.pill) {
  color: var(--accent);
}

.article code,
kbd {
  padding: 1px 7px;
  border: 1px solid rgba(var(--ink), 0.16);
  border-radius: 6px;
  background: rgba(var(--ink), 0.06);
  font-family: inherit;
  font-size: 0.88em;
  color: var(--strong);
}

kbd {
  box-shadow: 0 2px 0 rgba(var(--ink), 0.08);
}

.release {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 32px;
  padding: 44px 0;
  border-top: 1px solid var(--hairline);
}

.release-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.release-version {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--strong);
}

.release-latest {
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}

.release time {
  font-size: 14px;
  color: var(--faint);
}

.article .release-summary {
  font-size: 18px;
  color: var(--strong);
}

.release-body h3 {
  margin-top: 24px;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.release-body ul {
  margin-top: 8px;
}

/* ---------- Motion ---------- */

/* Titles breathe while on screen: a soft band of light drifts slowly across the lettering from
   left to right, then rests off the right edge before the next pass. */
.h2.in-view,
.hero-title.in-view {
  animation: sheen 8s linear infinite;
}

@keyframes sheen {
  0% {
    background-position: 100% 0, 0 0;
  }
  65%,
  100% {
    background-position: 0% 0, 0 0;
  }
}

@keyframes float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -10px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

@keyframes menuIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes wave {
  0%,
  100% {
    transform: scaleY(0.2);
  }
  50% {
    transform: scaleY(1);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes strike {
  0%,
  25% {
    text-decoration-color: transparent;
    opacity: 1;
  }
  40%,
  85% {
    text-decoration-color: rgba(var(--red), 0.85);
    color: rgba(var(--red), 0.8);
    opacity: 0.45;
  }
  100% {
    text-decoration-color: transparent;
    opacity: 1;
  }
}

@keyframes swapOut {
  0%,
  35% {
    opacity: 1;
  }
  45%,
  85% {
    opacity: 0;
  }
  95%,
  100% {
    opacity: 1;
  }
}

@keyframes swapIn {
  0%,
  35% {
    opacity: 0;
  }
  45%,
  85% {
    opacity: 1;
  }
  95%,
  100% {
    opacity: 0;
  }
}

@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes type {
  0% {
    max-width: 0;
  }
  55%,
  85% {
    max-width: 6em;
  }
  100% {
    max-width: 0;
  }
}

@keyframes cycle {
  0% {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(6px);
  }
  8%,
  28% {
    opacity: 1;
    transform: none;
    filter: none;
  }
  36%,
  100% {
    opacity: 0;
    transform: translateY(-14px);
    filter: blur(6px);
  }
}

@keyframes pop {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  10%,
  80% {
    opacity: 1;
    transform: none;
  }
  92%,
  100% {
    opacity: 0;
    transform: scale(0.95);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fill {
  0% {
    transform: scaleX(0);
  }
  70%,
  100% {
    transform: scaleX(1);
  }
}

@keyframes press {
  0%,
  20% {
    transform: none;
    box-shadow: 0 6px 0 var(--key-edge), 0 10px 24px rgba(0, 0, 0, calc(0.6 * var(--shadow-k))), inset 0 1px 0 rgba(var(--ink), 0.12);
  }
  28%,
  80% {
    transform: translateY(5px);
    border-color: rgba(var(--accent-2-rgb), 0.5);
    color: var(--accent-2);
    box-shadow: 0 1px 0 var(--key-edge), 0 0 30px rgba(var(--accent-2-rgb), 0.35), inset 0 1px 0 rgba(var(--ink), 0.12);
  }
  90%,
  100% {
    transform: none;
  }
}

@keyframes listen {
  0%,
  28% {
    opacity: 0;
    transform: translateY(8px);
  }
  34%,
  78% {
    opacity: 1;
    transform: none;
  }
  88%,
  100% {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@keyframes travel {
  0% {
    left: 0;
    opacity: 0;
  }
  15%,
  85% {
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

@keyframes travelDown {
  0% {
    top: 0;
    opacity: 0;
  }
  15%,
  85% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

/* ---------- Narrow screens ---------- */

@media (max-width: 1023px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card.feature-lead {
    grid-template-columns: 1fr;
  }

  .facts {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .nav {
    display: none;
  }

  .burger {
    display: grid;
  }

  .header-right .pill > span {
    padding: 9px 18px;
    font-size: 13px;
  }

  .hero-content {
    padding-top: 200px;
  }

  .hero-title {
    font-size: 46px;
  }

  .hero-title span {
    display: block;
  }

  .hero-title span + span {
    margin-left: 0;
  }

  .demo-body {
    grid-template-columns: 1fr;
  }

  .demo-divider {
    width: auto;
    height: 1px;
    margin: 0 24px;
  }

  .feature-grid,
  .facts,
  .steps {
    grid-template-columns: 1fr;
  }

  .flow {
    flex-direction: column;
    align-items: center;
  }

  .flow > .flow-node {
    padding-top: 0;
  }

  .flow-local {
    align-items: center;
  }

  .flow-local .flow-link {
    margin-top: 6px;
  }

  .flow-local {
    flex-direction: column;
    padding: 34px 32px 22px;
  }

  .flow-link {
    flex: none;
    width: 2px;
    height: 46px;
    min-width: 0;
    margin: 6px 0;
    background: repeating-linear-gradient(180deg, rgba(var(--ink), 0.28) 0 6px, transparent 6px 12px);
  }

  .flow-link i {
    top: 0;
    left: 50%;
  }

  .in-view .flow-link i {
    animation-name: travelDown;
  }

  .footer-columns {
    flex-wrap: wrap;
  }

  .release {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .release-meta {
    flex-direction: row;
    align-items: center;
  }
}

/* Brand, theme switch, download and menu share one row on phones. */
@media (max-width: 420px) {
  .header-inner {
    gap: 12px;
  }

  .header-right {
    gap: 8px;
  }

  .theme-toggle,
  .burger {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 380px) {
  .brand span {
    font-size: 19px;
  }

  .header-right .pill > span {
    padding: 8px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
