/*
 * One AI Memory, the landing page (GitHub Pages, /docs).
 * Same look as the app: flat solid surfaces, hairlines, no gradients, no glass, no shadows.
 * Colors are the tokens of web/src/styles/tokens.css (light and dark), fonts are Geist and
 * Newsreader served from here.
 *
 * Motion (see main.js): only transform and opacity move. Every hidden start state lives under
 * html.js inside a prefers-reduced-motion: no-preference block, so without JavaScript or with
 * reduced motion the page shows its final state.
 */

/* ---- fonts (SIL Open Font License, see fonts/LICENSE-*.txt) ------------------------------- */

@font-face {
  font-family: "Geist Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/geist-latin-wght-normal.woff2") format("woff2-variations"),
    url("fonts/geist-latin-wght-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Geist Mono Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/geist-mono-latin-wght-normal.woff2") format("woff2-variations"),
    url("fonts/geist-mono-latin-wght-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Newsreader Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/newsreader-latin-opsz-normal.woff2") format("woff2-variations"),
    url("fonts/newsreader-latin-opsz-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Newsreader Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/newsreader-latin-opsz-italic.woff2") format("woff2-variations"),
    url("fonts/newsreader-latin-opsz-italic.woff2") format("woff2");
}

/* ---- tokens: copied from web/src/styles/tokens.css --------------------------------------- */

:root {
  color-scheme: light;
  --bg-canvas: #f1ede4;
  --surface-panel: #faf8f3;
  --surface-paper: #fcfaf5;
  --surface-raised: #fffefb;
  --surface-sunken: #ebe5d8;
  --surface-hover: rgb(27 26 23 / 0.039);
  --line-hairline: rgb(11 11 12 / 0.078);
  --line-strong: rgb(11 11 12 / 0.149);
  --text-primary: #0b0b0c;
  --text-secondary: #4d4940;
  --text-tertiary: #69645a;
  --accent: #4c57be;
  --accent-soft: #e4e6f8;
  --accent-text: #3c46a6;
  --on-accent: #ffffff;
  --ai-claude: #d97757;
  --ai-chatgpt: #12a37f;
  --ai-gemini: #4f7df3;
  --ai-code: #d9951e;
  --success: #1d7350;
  --success-soft: #e2f3ea;
  --warning: #87560f;
  --warning-soft: #fbf0dc;
  --danger: #b83a30;
  --danger-soft: #fbe6e3;
  --white: #ffffff;
  --brand-periwinkle: #6875e8;
  --brand-ivory: #efe9dc;
  --brand-ink: #0b0b0c;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg-canvas: #111114;
    --surface-panel: #18181d;
    --surface-paper: #141418;
    --surface-raised: #1e1e24;
    --surface-sunken: #1b1b21;
    --surface-hover: rgb(255 255 255 / 0.051);
    --line-hairline: rgb(239 233 220 / 0.090);
    --line-strong: rgb(239 233 220 / 0.169);
    --text-primary: #efe9dc;
    --text-secondary: #bcb5a7;
    --text-tertiary: #958f82;
    --accent: #8e99f4;
    --accent-soft: #23264b;
    --accent-text: #b7beff;
    --on-accent: #0b0b0c;
    --ai-claude: #ec9374;
    --ai-chatgpt: #43cba2;
    --ai-gemini: #86a6ff;
    --ai-code: #f0bc5e;
    --success: #5cc79e;
    --success-soft: #17322a;
    --warning: #edbe6e;
    --warning-soft: #3a2e17;
    --danger: #f28f84;
    --danger-soft: #3b1f1d;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-canvas: #111114;
  --surface-panel: #18181d;
  --surface-paper: #141418;
  --surface-raised: #1e1e24;
  --surface-sunken: #1b1b21;
  --surface-hover: rgb(255 255 255 / 0.051);
  --line-hairline: rgb(239 233 220 / 0.090);
  --line-strong: rgb(239 233 220 / 0.169);
  --text-primary: #efe9dc;
  --text-secondary: #bcb5a7;
  --text-tertiary: #958f82;
  --accent: #8e99f4;
  --accent-soft: #23264b;
  --accent-text: #b7beff;
  --on-accent: #0b0b0c;
  --ai-claude: #ec9374;
  --ai-chatgpt: #43cba2;
  --ai-gemini: #86a6ff;
  --ai-code: #f0bc5e;
  --success: #5cc79e;
  --success-soft: #17322a;
  --warning: #edbe6e;
  --warning-soft: #3a2e17;
  --danger: #f28f84;
  --danger-soft: #3b1f1d;
}

/* ---- page-level settings ------------------------------------------------------------------- */

:root {
  --font-ui: "Geist Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Newsreader Variable", ui-serif, Georgia, "Times New Roman", serif;
  --font-mono: "Geist Mono Variable", ui-monospace, "Cascadia Code", Consolas, monospace;
  --gutter: clamp(20px, 5vw, 40px);
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.25, 1);
  --feed-row: 66px; /* a commit row plus its gap: the distance the hero feed slides */
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 84px; /* anchors land below the sticky top bar */
}

/* While main.js switches the page to Italian, before the first paint. */
html.i18n-pending body {
  visibility: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.625;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

a {
  color: var(--accent-text);
}

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

::selection {
  background: var(--accent-soft);
  color: var(--text-primary);
}

code {
  font-family: var(--font-mono);
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.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;
}

/* A tap area of at least 44 × 44 px around small controls, without changing how they look. */
.hit {
  position: relative;
}

.hit::after {
  content: "";
  position: absolute;
  top: min(0px, calc(50% - 22px));
  right: min(0px, calc(50% - 22px));
  bottom: min(0px, calc(50% - 22px));
  left: min(0px, calc(50% - 22px));
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--text-primary);
  color: var(--surface-panel);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: min(1120px, calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

/* ---- shared type: eyebrows, section heads, notes ---------------------------------------------- */

.eyebrow {
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 16px;
  text-transform: uppercase;
}

h2 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 9.2vw, 48px);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.09;
  text-wrap: balance;
}

.section-head {
  max-width: 720px;
  margin-bottom: 48px;
}

.section-head h2 {
  margin-top: 16px;
}

.section-lede {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: clamp(17px, 4.4vw, 18px);
  line-height: 1.61;
  text-wrap: pretty;
}

.aside-note {
  margin-top: 32px;
  max-width: 760px;
  color: var(--text-tertiary);
  font-size: 15px;
  line-height: 24px;
}

.tag {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 16px;
  white-space: nowrap;
}

.tag-quiet {
  background: var(--surface-sunken);
  color: var(--text-secondary);
}

.tag-accent {
  background: var(--accent-soft);
  color: var(--accent-text);
}

/* Assistant avatars: initials on the assistant's color. */
.badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--badge-color, var(--text-tertiary));
  color: var(--badge-ink, var(--surface-paper));
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}

.b-claude { --badge-color: var(--ai-claude); --badge-ink: var(--brand-ink); }
.b-chatgpt { --badge-color: var(--ai-chatgpt); --badge-ink: var(--brand-ink); }
.b-code { --badge-color: var(--ai-code); --badge-ink: var(--brand-ink); font-family: var(--font-mono); }
.b-gemini { --badge-color: var(--ai-gemini); --badge-ink: var(--brand-ink); }
.b-codex { --badge-color: var(--text-primary); --badge-ink: var(--surface-paper); }
.b-cursor { --badge-color: var(--text-tertiary); --badge-ink: var(--surface-paper); }
.b-vscode { --badge-color: var(--accent); --badge-ink: var(--on-accent); }
.b-lm { --badge-color: var(--text-secondary); --badge-ink: var(--surface-paper); }
.b-other { --badge-color: var(--surface-sunken); --badge-ink: var(--text-secondary); font-size: 15px; font-weight: 600; }

.badge-xs {
  width: 22px;
  height: 22px;
  font-size: 8.5px;
}

/* Inline links in running text. */
.cta-note a,
.trust-card a,
.faq a,
.faq-readme a {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ---- 1. top bar ------------------------------------------------------------------------------- */

/* The bar stays at the top while scrolling, on a solid background (no blur). Its brand repeats
   the hero's title, so main.js shows it only once the title has scrolled away (.is-past-hero),
   together with a hairline under the bar. Without JavaScript the brand is always shown. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid transparent;
  background: var(--bg-canvas);
  transition: border-color 200ms var(--ease-out);
}

.topbar.is-past-hero {
  border-bottom-color: var(--line-hairline);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 14px;
}

.topbar .brand {
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 200ms;
}

html.js .topbar:not(.is-past-hero) .brand {
  visibility: hidden;
  opacity: 0;
  transform: translateY(-4px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 44px;
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
}

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

/* Hidden without JavaScript: they would do nothing. */
html:not(.js) .controls {
  display: none;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-sunken);
}

.segmented button {
  height: 32px;
  min-width: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.segmented button:hover {
  color: var(--text-primary);
}

/* The chosen language: a raised pill drawn with a hairline, no shadow. */
.segmented button[aria-pressed="true"] {
  border-color: var(--line-hairline);
  background: var(--surface-raised);
  color: var(--text-primary);
  font-weight: 600;
}

.segmented button:focus-visible,
.icon-btn:focus-visible {
  border-radius: 999px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line-hairline);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text-secondary);
}

.icon-btn:hover {
  border-color: var(--line-strong);
  color: var(--text-primary);
}

/* Moon in the light theme, sun in the dark one; they crossfade (A10). */
.theme-btn .icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
}

.theme-btn .icon-sun,
:root[data-theme="dark"] .theme-btn .icon-moon {
  opacity: 0;
  transform: rotate(-30deg);
}

:root[data-theme="dark"] .theme-btn .icon-sun {
  opacity: 1;
  transform: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .icon-moon {
    opacity: 0;
    transform: rotate(-30deg);
  }

  :root:not([data-theme="light"]) .theme-btn .icon-sun {
    opacity: 1;
    transform: none;
  }
}

/* ---- buttons and links shared by the hero and the closing card (A10) -------------------------- */

.btn-install {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 60px;
  padding: 14px 36px;
  border-radius: 16px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.btn-install:hover {
  background: color-mix(in srgb, var(--accent) 88%, var(--text-primary));
}

.btn-install:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  border-radius: 16px;
}

.btn-install .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

.cta-note {
  max-width: 480px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
}

.code-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--accent-text);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.code-link:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.code-link .icon {
  width: 18px;
  height: 18px;
}

/* ---- 2. hero ----------------------------------------------------------------------------------- */

.hero {
  padding: clamp(22px, calc(3vw + 10px), 54px) 0 clamp(72px, 9vw, 112px);
}

.hero-grid {
  display: grid;
  gap: 56px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  max-width: 640px;
}

/* The name, small beside the squirrel: the headline above the fold says what it does. */
.hero-brand {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3.6vw, 14px);
  font-family: var(--font-serif);
  font-size: clamp(22px, 6vw, 28px);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.hero-icon {
  width: clamp(44px, 12vw, 56px);
  height: auto;
}

/* Two lines by design: each one stays whole from 320 up, in English and in Italian. */
h1 {
  margin-top: clamp(24px, 3vw, 28px);
  font-family: var(--font-serif);
  font-size: clamp(32px, 10.2vw, 60px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.07;
}

.hero-lede {
  margin-top: 28px;
  color: var(--text-secondary);
  font-size: clamp(17px, 4.4vw, 20px);
  line-height: 1.6;
  text-wrap: pretty;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: clamp(24px, 3vw, 28px);
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
}

.hero-facts li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-facts .icon {
  color: var(--success);
  stroke-width: 2;
}

.cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  margin-top: 36px;
}

/* "See the code" and "Star on GitHub", side by side; they wrap on narrow screens. */
.code-links {
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;
}

.cta .code-links {
  margin-top: -8px;
}

@media (min-width: 1180px) {
  .hero-grid {
    grid-template-columns: minmax(0, 520px) 552px;
    justify-content: space-between;
    align-items: center;
    gap: 48px;
  }
}

/* The live memory (A2): five assistants wired to one repository card. */
.live {
  display: grid;
  grid-template-columns: 192px minmax(0, 360px);
  width: 100%;
  max-width: 552px;
  min-width: 0;
  margin-inline: auto; /* centered under the copy while the hero is one column */
}

.lanes {
  position: relative;
  z-index: 1;
  padding-top: 21px;
}

.lane {
  position: relative;
  height: 88px;
  --travel: translateX(140px);
}

.lane[data-writer="claudeWork"] { --lane-color: var(--ai-claude); }
.lane[data-writer="chatgpt"] { --lane-color: var(--ai-chatgpt); }
.lane[data-writer="codex"] { --lane-color: var(--text-primary); }
.lane[data-writer="cursor"] { --lane-color: var(--text-tertiary); }
.lane[data-writer="claudeCode"] { --lane-color: var(--ai-code); }

.lane .badge {
  position: absolute;
  top: 24px;
  left: 0;
  width: 40px;
  height: 40px;
  font-size: 12.5px;
}

.lane .badge.b-chatgpt,
.lane .badge.b-code {
  font-size: 11px;
}

.lane-label {
  position: absolute;
  top: 22px;
  left: 54px;
  max-width: 140px; /* up to the socket; no ellipsis, it would show while the status is hidden */
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
}

.lane-status {
  opacity: 0;
}

.wire {
  position: absolute;
  top: 43px;
  left: 48px;
  right: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--line-strong);
}

.wire-on {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: var(--lane-color);
  opacity: 0;
}

.socket {
  position: absolute;
  top: 39.5px;
  right: -4.5px;
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-raised);
}

.socket::after {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: 999px;
  background: var(--lane-color);
  opacity: 0;
}

.travel {
  position: absolute;
  top: 39px;
  left: 43px;
  width: 10px;
  height: 10px;
}

.dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--lane-color);
  opacity: 0;
}

.ring {
  position: absolute;
  top: 38px;
  right: -6px;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--lane-color);
  border-radius: 999px;
  opacity: 0;
}

/* The page's static picture: ChatGPT has just saved, its wire is lit. */
.lane.is-last .wire-on,
.lane.is-last .socket::after {
  opacity: 1;
}

.repo {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-hairline);
  border-radius: 20px;
  background: var(--surface-raised);
}

.repo-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px 12px 12px 16px;
  border-bottom: 1px solid var(--line-hairline);
  background: var(--surface-panel);
}

.repo-head > .icon {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.repo-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Pause / play for the two loops. */
.loop-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line-hairline);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text-secondary);
}

.loop-btn .icon {
  width: 24px;
  height: 24px;
}

.pill-btn .icon {
  width: 16px;
  height: 16px;
}

.loop-btn:hover,
.pill-btn:hover {
  border-color: var(--line-strong);
  color: var(--text-primary);
}

/* Pressed means paused: the play icon on accent-soft. The name stays "Pause". */
.loop-btn[aria-pressed="true"],
.pill-btn[aria-pressed="true"] {
  border-color: var(--accent-soft);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.loop-btn[aria-pressed="true"]:hover,
.pill-btn[aria-pressed="true"]:hover {
  border-color: var(--line-strong);
  color: var(--accent-text);
}

.loop-btn:focus-visible,
.pill-btn:focus-visible {
  border-radius: 999px;
}

.icon-play,
[aria-pressed="true"] > .icon-pause {
  display: none;
}

[aria-pressed="true"] > .icon-play {
  display: block;
}

/* Without JavaScript, or with reduced motion, nothing loops: no pause buttons. */
html:not(.js) .loop-btn,
html:not(.js) .pill-btn {
  display: none;
}

.feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 8px 20px;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 16px;
}

.feed-title {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feed-view {
  height: calc(5 * var(--feed-row));
  margin-bottom: 8px;
  padding: 0 8px;
  overflow: hidden;
}

.commit {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: calc(var(--feed-row) - 4px);
  margin-bottom: 4px;
  padding: 0 12px;
}

.commit-hl {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: var(--accent-soft);
  opacity: 0;
}

.commit.is-hl .commit-hl {
  opacity: 1;
}

.commit .badge {
  position: relative;
  width: 28px;
  height: 28px;
  font-size: 10px;
}

.commit .badge.b-chatgpt,
.commit .badge.b-code {
  font-size: 8.5px;
}

.commit-text {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.commit-msg,
.commit-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commit-msg {
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.commit-meta {
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 16px;
}

/* On the highlight (lasting, or while a new row comes in), a step darker: tertiary on
   accent-soft is only just AA in dark. */
.commit.is-hl .commit-meta,
.commit.is-entering .commit-meta {
  color: var(--text-secondary);
}

.repo-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-hairline);
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 16px;
}

.repo-foot .icon {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

/* Phones: the avatars in a row above the card, the wires vertical. */
@media (max-width: 599px) {
  .topbar-inner {
    padding-block: 10px; /* the brand and the controls already give a 44 px tap height */
  }

  .hero .btn-install {
    width: 100%;
  }

  .live {
    grid-template-columns: minmax(0, 1fr);
    max-width: none;
  }

  .lanes {
    display: flex;
    justify-content: space-between;
    height: 92px;
    padding: 0;
  }

  .lane {
    width: 40px;
    height: 92px;
    --travel: translateY(44px);
  }

  .lane .badge {
    top: 0;
  }

  .lane-label {
    display: none;
  }

  .wire {
    top: 48px;
    bottom: 0;
    left: 19px;
    right: auto;
    width: 2px;
    height: auto;
  }

  .socket {
    top: auto;
    right: auto;
    bottom: -4.5px;
    left: 15.5px;
  }

  .travel {
    top: 43px;
    left: 15px;
  }

  .ring {
    top: auto;
    right: auto;
    bottom: -6px;
    left: 14px;
  }
}

/* Narrow phones: tighter header gaps, so "your-name/ai-memory" stays whole at 360. */
@media (max-width: 399px) {
  .repo-head {
    gap: 8px;
  }
}

/* Below 360 the lock gives way to the name (the "private" tag says the same), and the rows
   tighten a little so the commit messages fit at 320. */
@media (max-width: 359px) {
  .repo-head > .icon {
    display: none;
  }

  .repo-name {
    font-size: 13px;
  }

  .commit {
    padding: 0 8px;
  }

  .commit-msg {
    font-size: 13px;
  }
}

/* ---- 3. the difference: the same request, without and with the memory ----------------------- */

.diff {
  padding: 0 0 clamp(64px, 8vw, 104px);
}

.diff .section-head {
  margin-bottom: clamp(28px, 4vw, 40px);
}

.diff-grid {
  display: grid;
  gap: 28px 24px;
}

@media (min-width: 800px) {
  .diff-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.diff-case {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  margin: 0;
}

/* The chat panels of "See it work", sized by their text; side by side, the same height. */
.panel.diff-panel {
  flex: 1;
  align-self: stretch;
  min-height: 0;
}

.diff-panel .bubble {
  max-width: min(320px, 88%);
}

.memory-read {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
}

.memory-read .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

/* ---- 4. who it's for ---------------------------------------------------------------------------- */

.who {
  padding: 0;
}

.who .section-head {
  margin-bottom: clamp(28px, 4vw, 40px);
}

.who-list {
  display: grid;
  column-gap: 48px;
}

@media (min-width: 800px) {
  .who-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.who-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 0;
  border-top: 1px solid var(--line-hairline);
}

.who-item .trust-icon {
  flex: none;
}

.who-item h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 24px;
}

.who-item p {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 24px;
}

.who-not {
  margin-top: clamp(16px, 2vw, 32px);
  padding: clamp(18px, 2vw, 20px) clamp(20px, 2.4vw, 24px);
  border: 1px solid var(--line-hairline);
  border-radius: 16px;
  background: var(--surface-panel);
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 24px;
}

.who-not-title {
  margin-bottom: 6px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
}

/* ---- 5. see it work (A3) ---------------------------------------------------------------------- */

.see {
  padding: clamp(56px, 7vw, 96px) 0 clamp(64px, 8vw, 104px);
}

.see-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
  margin-bottom: 36px;
}

.see-head .section-head {
  max-width: 640px;
  margin-bottom: 0;
}

.see-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px 0 12px;
  border: 1px solid var(--line-hairline);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr) 44px minmax(0, 1fr);
  padding: 28px;
  border: 1px solid var(--line-hairline);
  border-radius: 24px;
  background: var(--surface-panel);
}

.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 380px;
  overflow: hidden;
  border: 1px solid var(--line-hairline);
  border-radius: 16px;
  background: var(--surface-raised);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-hairline);
  font-size: 14px;
  line-height: 18px;
}

.panel-head > .icon {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.panel-app {
  font-weight: 600;
}

/* Wraps to a second line rather than losing its end. */
.panel-ctx {
  min-width: 0;
  color: var(--text-tertiary);
  font-size: 13px;
}

.file-path {
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  padding: 20px 16px 16px;
}

.bubble {
  align-self: flex-end;
  max-width: min(240px, 88%);
  padding: 12px 16px;
  border-radius: 16px 16px 4px 16px;
  background: var(--surface-sunken);
  font-size: 14.5px;
  line-height: 21px;
}

.reply {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.reply-body {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.typing {
  position: absolute;
  top: 7px;
  left: 2px;
  display: flex;
  gap: 5px;
  opacity: 0;
}

.typing i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--text-tertiary);
}

.tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 8px;
  border-radius: 8px;
  background: var(--surface-sunken);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
}

.tool .icon {
  width: 14px;
  height: 14px;
}

.answer {
  font-size: 14px;
  line-height: 21px;
}

.code-block {
  display: block;
  align-self: stretch;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--surface-sunken);
  font-size: 13px;
  font-weight: 400;
  line-height: 19px;
}

.composer {
  margin: 0 16px 16px;
  padding: 11px 12px;
  border: 1px solid var(--line-hairline);
  border-radius: 12px;
  background: var(--surface-panel);
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 20px;
}

/* The memory file. */
.doc-body {
  gap: 12px;
}

.doc-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 30px;
}

.doc-label {
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 16px;
  text-transform: uppercase;
}

.rules {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rule {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 37px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 21px;
}

.rule-n {
  flex: none;
  width: 11px;
  color: var(--accent-text);
  font-family: var(--font-serif);
  font-size: 18px;
  font-style: italic;
  font-weight: 500;
  line-height: 21px;
}

.rule-new {
  background: var(--accent-soft);
  font-weight: 500;
}

.rule-text {
  flex: 1;
  min-width: 0;
}

.rule-new .tag {
  padding-inline: 4px;
}

.rule-ring {
  position: absolute;
  inset: -3px;
  border: 2px solid var(--accent);
  border-radius: 15px;
  opacity: 0;
  pointer-events: none;
}

/* When the panel is narrow, "just now" moves to a line of its own: the "via" line stays whole. */
.doc-commit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: auto;
  padding: 12px 4px 0;
  border-top: 1px solid var(--line-hairline);
  font-size: 12px;
  line-height: 16px;
}

.doc-commit .icon {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.doc-via {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.doc-when {
  flex: none;
  margin-left: auto;
  color: var(--text-tertiary);
}

/* Arrows between the panels, and the dot that crosses them. */
.connector {
  position: relative;
  display: grid;
  place-items: center;
  color: var(--line-strong);
  --cross: translateX(24px);
}

/* A hairline arrow, 20 × 10. */
.connector > .icon {
  width: 20px;
  height: 10px;
  stroke-width: 1.5;
}

.flow {
  position: absolute;
  top: 50%;
  left: 6px;
  width: 8px;
  height: 8px;
  margin-top: -4px;
}

.flow i {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0;
}

/* The three steps under the stage: buttons that jump to a moment and pause. */
.story-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 36px;
}

.story-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 0 2px;
  border: 0;
  background: none;
  color: var(--text-secondary);
  text-align: left;
}

.story-step:not(:disabled):hover {
  color: var(--text-primary);
}

/* Without JavaScript the steps are disabled: they look the same, as a static indicator. */
.story-step:disabled {
  cursor: default;
}

.bar {
  display: block;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--line-strong);
}

.bar-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(var(--p, 1));
  transform-origin: left center;
}

.story-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
}

.story-n {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.story-step[aria-current="step"] {
  color: var(--text-primary);
}

.story-step[aria-current="step"] .story-row {
  font-weight: 600;
}

.story-step[aria-current="step"] .story-n {
  background: var(--accent);
  color: var(--on-accent);
}

/* Narrower screens: the panels stack and the arrows point down. */
@media (max-width: 959px) {
  .stage {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
    border-radius: 20px;
  }

  .panel {
    min-height: 0;
  }

  .connector {
    height: 40px;
    --cross: translateY(24px);
  }

  .connector > .icon {
    transform: rotate(90deg);
  }

  .flow {
    top: 4px;
    left: 50%;
    margin: 0 0 0 -4px;
  }

  .doc-commit {
    margin-top: 4px;
  }
}

@media (max-width: 719px) {
  .story-steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-top: 28px;
  }
}

/* ---- 6. how it works (A4-A6) ------------------------------------------------------------------ */

.how {
  padding: clamp(8px, 1.5vw, 16px) 0 clamp(72px, 9vw, 112px);
}

.steps {
  display: grid;
  gap: 32px;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.step-art {
  display: grid;
  place-items: center;
  min-height: 248px;
  padding: 28px;
  border: 1px solid var(--line-hairline);
  border-radius: 20px;
  background: var(--surface-panel);
}

.step-text h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 26px;
}

.step-mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.step-text p {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 26px;
}

.resume-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 48px;
}

.resume-note .icon {
  width: 16px;
  height: 16px;
  margin-top: 4px;
}

@media (min-width: 600px) and (max-width: 1099px) {
  .step {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 32px;
  }
}

@media (min-width: 1100px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }

  /* The three drawings share one height, so the titles line up. */
  @supports (grid-template-rows: subgrid) {
    .steps {
      row-gap: 0;
    }

    .step {
      display: grid;
      grid-row: span 2;
      grid-template-rows: subgrid;
      row-gap: 24px;
    }
  }
}

/* A tiny window of the product. */
.mini {
  width: 100%;
  max-width: 300px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-hairline);
  border-radius: 16px;
  background: var(--surface-raised);
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 1.35;
}

.mini-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 33px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-hairline);
  background: var(--surface-panel);
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 16px;
}

.mini-dots {
  display: inline-flex;
  flex: none;
  gap: 4px;
}

.mini-dots i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--line-strong);
}

.mini-url {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 16px;
}

/* Step 1: Cloudflare's deploy form. */
.mini-label {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.mini-input {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-paper);
  font-size: 14px;
}

.mini-caret {
  width: 1.5px;
  height: 17px;
  margin-left: 1px;
  background: var(--accent);
}

.mini-hint {
  color: var(--text-tertiary);
  font-size: 12px;
}

.mini-press {
  position: relative;
  align-self: flex-start;
  margin-top: 4px;
}

.mini-deploy {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 20px;
  border-radius: 8px;
  background: var(--text-primary);
  color: var(--surface-raised);
  font-size: 14px;
  font-weight: 600;
}

.pointer {
  position: absolute;
  top: 13px;
  left: 56px;
  width: 22px;
  height: 22px;
}

.pointer svg {
  width: 100%;
  height: 100%;
  fill: var(--text-primary);
  stroke: var(--surface-raised);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

/* Step 2: the guided installer's checklist. */
.mini-check {
  gap: 2px;
  padding: 12px 16px;
}

.ck {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 32px;
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
}

.ck-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ck-3 .ck-label {
  font-weight: 600;
}

.ck-4 .ck-label {
  color: var(--text-secondary);
  font-weight: 400;
}

.ck-mark {
  position: relative;
  flex: none;
  width: 22px;
  height: 22px;
}

.mk {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
}

.mk-base {
  background: var(--surface-sunken);
  color: var(--text-secondary);
}

.mk-cur {
  background: var(--accent);
  color: var(--on-accent);
}

.mk-done {
  background: var(--success);
  color: var(--on-accent);
}

.mk-done .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.6;
}

/* Step 3: the terminal. */
.term {
  position: relative;
  gap: 8px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 19px;
}

.tline {
  white-space: pre;
}

.ttext {
  position: relative;
  display: inline-block;
}

/* Typing: a block the color of the terminal slides off the text, with the caret on its edge. */
.tcover {
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: 0;
  width: 100%;
  background: var(--surface-raised);
  opacity: 0;
}

.tcaret {
  position: absolute;
  top: 1px;
  left: 0;
  width: 1ch;
  height: 17px;
  background: var(--text-primary);
}

.term-ok {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  margin-top: 4px;
  padding: 4px 12px 4px 8px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  line-height: 16px;
}

.term-ok .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

@media (max-width: 399px) {
  .step-art {
    padding: 20px 16px;
  }

  .term {
    font-size: 12px;
  }
}

/* ---- 7. assistants (A7) ------------------------------------------------------------------------- */

.assistants {
  padding: 0 0 clamp(72px, 9vw, 112px);
}

.assistants .section-head {
  margin-bottom: 32px;
}

.ai-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ai {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  max-width: 100%;
  min-height: 46px;
  padding: 8px 16px 8px 8px;
  border: 1px solid var(--line-hairline);
  border-radius: 999px;
  background: var(--surface-raised);
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
}

.ai .badge {
  width: 28px;
  height: 28px;
}

.ai-sub {
  color: var(--text-tertiary);
  font-size: 14px;
  font-weight: 400;
}

/* ---- 8. trust (A8) ----------------------------------------------------------------------------- */

.band {
  padding: clamp(64px, 8vw, 104px) 0 clamp(72px, 9vw, 112px);
  border-block: 1px solid var(--line-hairline);
  background: var(--surface-panel);
}

.trust {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

@media (min-width: 640px) {
  .trust {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .trust {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.trust-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--line-hairline);
  border-radius: 20px;
  background: var(--surface-raised);
}

.trust-card:hover,
.trust-card:focus-within {
  border-color: var(--line-strong);
}

.trust-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.trust-icon .icon {
  width: 22px;
  height: 22px;
}

.trust-card h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 24px;
}

.trust-card p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 24px;
}

/* ---- 9. FAQ (A9) ------------------------------------------------------------------------------- */

.faq-section {
  padding: clamp(72px, 9vw, 112px) 0;
}

.faq-grid {
  display: grid;
  gap: 32px;
}

@media (min-width: 1100px) {
  .faq-grid {
    grid-template-columns: 336px minmax(0, 720px);
    justify-content: space-between;
    align-items: start;
    gap: 64px;
  }
}

.faq-head h2 {
  margin-top: 16px;
}

.faq-readme {
  max-width: 480px;
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 26px;
}

.faq details {
  border-top: 1px solid var(--line-hairline);
}

.faq details:last-child {
  border-bottom: 1px solid var(--line-hairline);
}

.faq summary {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 4px 24px 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 26px;
  list-style: none;
  cursor: pointer;
}

.faq summary > span {
  flex: 1;
  min-width: 0;
}

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

.faq summary:hover {
  color: var(--accent-text);
}

.faq summary:focus-visible {
  outline-offset: 2px;
}

.chevron {
  color: var(--text-secondary);
}

.faq details[open] .chevron {
  transform: rotate(180deg);
}

.faq details p {
  padding: 0 56px 24px 0;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 26px;
}

.faq code {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-sunken);
  color: var(--text-primary);
  font-size: 0.88em;
  white-space: nowrap;
}

@media (max-width: 599px) {
  .faq summary {
    font-size: 17px;
  }

  .faq details p {
    padding-right: 0;
  }
}

/* ---- 10. closing call to action ------------------------------------------------------------------ */

.closing-section {
  padding: 0 0 clamp(72px, 9vw, 112px);
}

.closing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: clamp(48px, 7vw, 72px) clamp(20px, 5vw, 48px);
  border: 1px solid var(--line-hairline);
  border-radius: 28px;
  background: var(--surface-panel);
  text-align: center;
}

.closing-icon {
  width: clamp(64px, 17vw, 80px);
  height: auto;
}

.closing-motto {
  max-width: 560px;
  color: var(--text-secondary);
  font-family: var(--font-serif);
  font-size: clamp(20px, 5vw, 24px);
  font-style: italic;
  line-height: 1.42;
  text-wrap: balance;
}

.closing-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
}

.closing-star {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: 12px;
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 599px) {
  .closing {
    border-radius: 24px;
  }

  .closing-cta,
  .closing .btn-install {
    width: 100%;
  }

  .closing .btn-install {
    padding-inline: 20px;
  }
}

/* ---- 11. footer ---------------------------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--line-hairline);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  padding: 20px 0 36px;
}

.brand-small {
  font-size: 18px;
}

.brand-small .brand-mark {
  width: 28px;
  height: 28px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 28px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-link .icon {
  width: 16px;
  height: 16px;
}

.footer-note {
  color: var(--text-tertiary);
  font-size: 14px;
}

@media (max-width: 599px) {
  .footer-inner,
  .footer-links {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-links {
    gap: 0;
  }

  .footer-note {
    margin-top: 8px;
  }
}

/* ---- small phones -------------------------------------------------------------------------------- */

@media (max-width: 380px) {
  .brand {
    gap: 10px;
    font-size: 17px;
  }

  .topbar .brand-mark {
    width: 30px;
    height: 30px;
  }

  .segmented button {
    min-width: 38px;
    padding: 0 8px;
  }
}

/* ======================================================================================== motion */

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(-4px); }
}

/* A2: one commit, 4.2 s. The wire lights (200 ms), stays lit, then dims from 2.4 s. */
@keyframes wire-lit {
  0% { opacity: 0; }
  4.8% { opacity: 1; }
  57.1% { opacity: 1; }
  71.4% { opacity: 0; }
  100% { opacity: 0; }
}

@keyframes travel {
  from { transform: none; }
  to { transform: var(--travel); }
}

/* The dot fades in over 120 ms, arrives at 900 ms, then goes out. */
@keyframes dot-life {
  0% { opacity: 0; }
  12% { opacity: 1; }
  90% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes ring {
  from { opacity: 0.6; transform: none; }
  to { opacity: 0; transform: scale(2.2); }
}

@keyframes feed-slide {
  from { transform: translateY(calc(-1 * var(--feed-row))); }
  to { transform: none; }
}

@keyframes appear {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes vanish {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* A3 */
@keyframes typing {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes cross {
  0% { opacity: 0; transform: none; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: var(--cross); }
}

@keyframes pulse-ring {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

/* A4 */
@keyframes press {
  0% { transform: none; animation-timing-function: cubic-bezier(0.4, 0, 1, 1); }
  37.5% { transform: scale(0.96); animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1); }
  100% { transform: none; }
}

/* A5: labels hold their earlier look, then snap to the drawn one (no fade). */
@keyframes ck-current {
  from, to { color: var(--text-primary); font-weight: 600; }
}

@keyframes ck-todo {
  from, to { color: var(--text-secondary); font-weight: 400; }
}

@keyframes ck-todo-then-current {
  0% { color: var(--text-secondary); font-weight: 400; }
  42.857% { color: var(--text-primary); font-weight: 600; }
}

/* A6 */
@keyframes type-cover {
  from { opacity: 1; transform: none; }
  to { opacity: 1; transform: translateX(100%); }
}

@keyframes caret-blink {
  0% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes caret-hide {
  to { opacity: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  /* Paused loops: off screen, tab hidden, or the Pause button. */
  .is-paused *,
  .is-paused *::before,
  .is-paused *::after {
    animation-play-state: paused !important;
  }

  /* A10: buttons and the theme toggle. */
  .btn-install {
    transition: background-color 150ms ease;
  }

  .btn-install .icon {
    transition: transform 150ms var(--ease-out);
  }

  .btn-install:hover .icon {
    transform: translate(2px, -2px);
  }

  .theme-btn .icon {
    transition: opacity 200ms var(--ease-out), transform 0s linear 200ms;
  }

  /* The incoming icon turns into place while it fades in. */
  :root:not([data-theme="dark"]) .theme-btn .icon-moon,
  :root[data-theme="dark"] .theme-btn .icon-sun {
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
  }

  /* A1: the hero comes in once, on load. */
  html.js .rise {
    opacity: 0;
  }

  html.js.is-ready .rise {
    animation: rise 600ms var(--ease-out) both;
  }

  html.js.is-ready .rise-1 { animation-delay: 80ms; }
  html.js.is-ready .rise-2 { animation-delay: 160ms; }
  html.js.is-ready .rise-3 { animation-delay: 240ms; }
  html.js.is-ready .rise-4 { animation-delay: 320ms; }
  html.js.is-ready .rise-5 { animation-delay: 400ms; }

  /* A2: the live feed. main.js adds the classes; the next commit starts when the wire's
     4.2 s animation ends, so pausing the animations pauses the whole cycle. */
  .lane.is-writing .wire-on,
  .lane.is-writing .socket::after,
  .lane.is-writing .lane-status {
    animation: wire-lit 4200ms linear both;
  }

  .lane.is-writing .travel {
    animation: travel 900ms var(--ease-in-out) 200ms both;
  }

  .lane.is-writing .dot {
    animation: dot-life 1000ms linear 200ms both;
  }

  .lane.is-writing .ring {
    animation: ring 400ms var(--ease-out) 1100ms forwards;
  }

  .feed.is-shifting {
    animation: feed-slide 500ms var(--ease-out) 1100ms both;
  }

  .commit.is-entering {
    animation: appear 300ms linear 1200ms both;
  }

  .commit.is-entering .commit-hl {
    opacity: 1;
    animation: vanish 1200ms linear 2400ms both;
  }

  .commit.is-leaving {
    animation: vanish 250ms linear 1100ms both;
  }

  /* A3: every piece of the story is already in the page; main.js switches .is-on. */
  html.js .story .cue {
    transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
  }

  html.js .story .cue-fade {
    transition-duration: 200ms;
  }

  html.js .story .cue:not(.is-on) {
    opacity: 0;
    transform: translateY(8px);
  }

  html.js .story .cue-fade:not(.is-on) {
    transform: none;
  }

  html.js .story .cue-pop:not(.is-on) {
    transform: scale(0.9);
  }

  .typing.is-on {
    opacity: 1;
  }

  .typing.is-on i {
    animation: typing 600ms linear infinite;
  }

  .typing.is-on i:nth-child(2) { animation-delay: 200ms; }
  .typing.is-on i:nth-child(3) { animation-delay: 400ms; }

  .flow.is-on i {
    animation: cross 400ms var(--ease-in-out) both;
  }

  .rule-ring.is-on {
    animation: pulse-ring 800ms var(--ease-in-out) both;
  }

  .story .panel {
    transition: opacity 400ms linear;
  }

  .story.is-fading .panel {
    opacity: 0;
  }

  .story.no-anim *,
  .story.no-anim *::before,
  .story.no-anim *::after {
    animation: none !important;
    transition: none !important;
  }

  /* A4: the pointer glides onto Deploy and presses it. */
  html.js .art-deploy:not(.is-visible) .pointer {
    opacity: 0;
    transform: translate(40px, 30px);
  }

  html.js .art-deploy.is-visible .pointer {
    transition: opacity 700ms var(--ease-out) 200ms, transform 700ms var(--ease-out) 200ms;
  }

  html.js .art-deploy.is-visible .mini-press {
    animation: press 320ms linear 900ms;
  }

  /* A5: the checklist ticks itself. */
  html.js .art-check:not(.is-visible) .ck-1 .mk-done,
  html.js .art-check:not(.is-visible) .ck-2 .mk-done {
    opacity: 0;
    transform: scale(0.6);
  }

  html.js .art-check:not(.is-visible) .ck-2 .mk-cur,
  html.js .art-check:not(.is-visible) .ck-3 .mk-cur,
  html.js .art-check:not(.is-visible) .ck-tag {
    opacity: 0;
  }

  html.js .art-check:not(.is-visible) .ck-1 .ck-label {
    font-weight: 600;
  }

  html.js .art-check:not(.is-visible) .ck-2 .ck-label,
  html.js .art-check:not(.is-visible) .ck-3 .ck-label {
    color: var(--text-secondary);
    font-weight: 400;
  }

  html.js .art-check.is-visible .ck-1 .mk-done {
    transition: opacity 250ms var(--ease-out) 300ms, transform 250ms var(--ease-out) 300ms;
  }

  html.js .art-check.is-visible .ck-2 .mk-cur {
    transition: opacity 200ms linear 300ms;
  }

  html.js .art-check.is-visible .ck-2 .mk-done {
    transition: opacity 250ms var(--ease-out) 700ms, transform 250ms var(--ease-out) 700ms;
  }

  html.js .art-check.is-visible .ck-tag {
    transition: opacity 200ms linear 700ms;
  }

  html.js .art-check.is-visible .ck-3 .mk-cur {
    transition: opacity 200ms linear 1100ms;
  }

  html.js .art-check.is-visible .ck-1 .ck-label {
    animation: ck-current 300ms step-end;
  }

  html.js .art-check.is-visible .ck-2 .ck-label {
    animation: ck-todo-then-current 700ms step-end;
  }

  html.js .art-check.is-visible .ck-3 .ck-label {
    animation: ck-todo 1100ms step-end;
  }

  /* A6: the two commands type themselves, then "Connected". */
  html.js .art-term:not(.is-visible) .tcover {
    opacity: 1;
  }

  html.js .art-term:not(.is-visible) .tline-2 {
    opacity: 0;
  }

  html.js .art-term:not(.is-visible) .term-ok {
    opacity: 0;
    transform: scale(0.9);
  }

  /* The caret rests until the reveal, then blinks only until it hides: nothing keeps running. */
  html.js .art-term.is-visible .tline-1 .tcover {
    animation: type-cover 1200ms steps(28, end) 300ms both;
  }

  html.js .art-term.is-visible .tline-1 .tcaret {
    animation: caret-blink 1s step-end 2, caret-hide 1ms linear 1800ms forwards;
  }

  html.js .art-term.is-visible .tline-2 {
    transition: opacity 0s linear 1800ms;
  }

  html.js .art-term.is-visible .tline-2 .tcover {
    animation: type-cover 900ms steps(22, end) 1800ms both;
  }

  html.js .art-term.is-visible .tline-2 .tcaret {
    animation: caret-blink 1s step-end 3, caret-hide 1ms linear 2900ms forwards;
  }

  html.js .art-term.is-visible .term-ok {
    transition: opacity 250ms var(--ease-out) 2900ms, transform 250ms var(--ease-out) 2900ms;
  }

  /* A7: the assistant chips, one after the other. */
  html.js .ai-list:not(.is-visible) .ai {
    opacity: 0;
    transform: translateY(8px);
  }

  html.js .ai-list.is-visible .ai {
    transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out);
  }

  html.js .ai-list.is-visible .ai:nth-child(2) { transition-delay: 50ms; }
  html.js .ai-list.is-visible .ai:nth-child(3) { transition-delay: 100ms; }
  html.js .ai-list.is-visible .ai:nth-child(4) { transition-delay: 150ms; }
  html.js .ai-list.is-visible .ai:nth-child(5) { transition-delay: 200ms; }
  html.js .ai-list.is-visible .ai:nth-child(6) { transition-delay: 250ms; }
  html.js .ai-list.is-visible .ai:nth-child(7) { transition-delay: 300ms; }
  html.js .ai-list.is-visible .ai:nth-child(8) { transition-delay: 350ms; }
  html.js .ai-list.is-visible .ai:nth-child(9) { transition-delay: 400ms; }

  /* A8: a trust card lifts a little. */
  .trust-card {
    transition: transform 200ms var(--ease-out), border-color 200ms var(--ease-out);
  }

  .trust-card:hover,
  .trust-card:focus-within {
    transform: translateY(-3px);
  }

  /* A9: FAQ rows. The height snaps open; the answer fades in. */
  .chevron {
    transition: transform 200ms var(--ease-out);
  }

  .faq details[open] p {
    animation: fade-up 200ms var(--ease-out);
  }
}

/* Reduced motion: no loops, so no pause buttons; the story still jumps between its steps. */
@media (prefers-reduced-motion: reduce) {
  .loop-btn,
  .pill-btn {
    display: none;
  }

  html.js .story .cue:not(.is-on) {
    opacity: 0;
  }
}

/* ---- theme switch ---------------------------------------------------------------------------
 * main.js reveals the new theme as a circle growing from the theme button, inside a view
 * transition: the browser's default crossfade is turned off so only the circle moves. */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

@media (prefers-reduced-motion: reduce) {
  .topbar,
  .topbar .brand {
    transition: none;
  }
}

/* ---- install.html: the guide to Cloudflare's form ---------------------------------------------
 * A calm redrawing of the form (not a screenshot): the three places to act are numbered and
 * outlined, everything already filled in is muted. The numbers light up one after another
 * when the drawing comes into view (data-reveal in main.js); reduced motion and no-JS show
 * the final state. */

.guide {
  padding-top: clamp(24px, 4vw, 56px);
}

.guide-title {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-size: clamp(36px, 8vw, 56px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.06;
  text-wrap: balance;
}

.guide-grid {
  display: grid;
  gap: 40px;
  align-items: start;
}

@media (min-width: 960px) {
  .guide-grid {
    grid-template-columns: minmax(0, 500px) minmax(0, 1fr);
    gap: 56px;
  }
}

.gform {
  margin: 0;
}

.gf-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line-hairline);
  border-radius: 20px;
  background: var(--surface-raised);
  font-size: 13.5px;
  line-height: 1.35;
}

.gf-title {
  font-size: 16px;
  font-weight: 600;
}

.gf-sub {
  margin-top: -10px;
  color: var(--text-tertiary);
  font-size: 12.5px;
}

.gf-label {
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
}

.gf-mono {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.gf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gf-input {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-paper);
  font-size: 13.5px;
}

.gf-input-empty {
  color: var(--text-tertiary);
}

.gf-caret {
  width: 1.5px;
  height: 16px;
  margin-left: 2px;
  background: var(--accent);
}

.gf-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gf-btn {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-paper);
  font-size: 12.5px;
  font-weight: 500;
}

.gf-btn:not(.gf-btn-on) {
  color: var(--text-tertiary);
}

/* What is already filled in: muted, grouped, with a quiet label. */
.gf-muted {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
}

.gf-muted > :not(.gf-muted-label) {
  opacity: 0.5;
}

.gf-muted-label {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
}

.gf-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.gf-check i {
  width: 14px;
  height: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.gf-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  color: var(--text-secondary);
  font-size: 12.5px;
}

.gf-muted .gf-field .gf-input {
  min-height: 30px;
}

/* The three places to act: outlined in the accent, with their number. */
.gf-act {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 2px solid var(--accent);
  border-radius: 12px;
}

.gf-mark {
  position: absolute;
  top: -12px;
  left: -12px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 700;
}

.gf-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid var(--line-hairline);
}

.gf-back {
  color: var(--text-tertiary);
  font-size: 13px;
}

.gf-act-3 {
  flex-direction: row;
  padding: 4px;
}

.gf-act-3 .gf-mark {
  top: -14px;
  left: -14px;
}

.gf-deploy {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13.5px;
  font-weight: 600;
}

/* The steps next to the drawing. */
.guide-h2 {
  font-size: clamp(26px, 6vw, 32px);
}

.guide-steps,
.guide-next {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 20px;
  padding: 0;
  list-style: none;
}

.guide-steps li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 14px;
}

.guide-n {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 700;
}

.guide-steps h3 {
  font-size: 17px;
  font-weight: 600;
  line-height: 30px;
}

.guide-steps p,
.guide-next li {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
}

.guide-steps strong,
.guide-next strong {
  color: var(--text-primary);
  font-weight: 600;
}

.guide-next-title {
  margin-top: 48px;
}

.guide-next {
  gap: 10px;
  padding-left: 20px;
  list-style: decimal;
}

.guide-next li::marker {
  color: var(--text-tertiary);
}

.guide-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-top: 28px;
}

@media (max-width: 599px) {
  .gf-card {
    padding: 20px 18px;
  }

  .guide-cta,
  .guide-cta .btn-install {
    width: 100%;
  }
}

/* The numbers light up one after another (main.js adds .is-visible). */
@media (prefers-reduced-motion: no-preference) {
  html.js .gform .gf-act {
    border-color: var(--line-strong);
  }

  html.js .gform .gf-mark {
    opacity: 0;
    transform: scale(0.6);
  }

  html.js .gform.is-visible .gf-act {
    animation: gf-act-on 400ms var(--ease-out) forwards;
  }

  html.js .gform.is-visible .gf-mark {
    animation: gf-mark-on 400ms var(--ease-out) forwards;
  }

  html.js .gform.is-visible .gf-act-1,
  html.js .gform.is-visible .gf-act-1 .gf-mark {
    animation-delay: 300ms;
  }

  html.js .gform.is-visible .gf-act-2,
  html.js .gform.is-visible .gf-act-2 .gf-mark {
    animation-delay: 1000ms;
  }

  html.js .gform.is-visible .gf-act-3,
  html.js .gform.is-visible .gf-act-3 .gf-mark {
    animation-delay: 1700ms;
  }
}

@keyframes gf-act-on {
  to {
    border-color: var(--accent);
  }
}

@keyframes gf-mark-on {
  to {
    opacity: 1;
    transform: scale(1);
  }
}
