/* Cresci Code landing (design "Dopo", SPEC-design-main-20261001 §2 scene 6; MASTER-SPEC §12.14, D-29).
 * One sheet, sections: tokens · base · header · hero · composer · demo · sections · faq · footer · media.
 * Colours only through var(): literal colours live in :root. Weights 400/445/500/600; letter-spacing 0, −.02em or
 * −.025em, plus −.045em on the hero H1 only; no uppercase; font-size ≥ 12px (≥ 11px only under .app-window); one
 * structural breakpoint (700px) plus clamp() for H1/H2 and container queries for the hero tiles, the composer and
 * the demo window; media queries never shrink text. Checked by apps/landing/tests/design.test.mjs.
 *
 * Colour meaning (one colour, one meaning; surfaces stay neutral):
 *   --decision (orange)  only where the visitor's decision is asked: the approval in the demo;
 *   --ready (green)      outcomes, diff added, and the core of the brand mark;
 *   --progress (blue)    text and dots for "in progress" (plus links and the focus ring), never a background or a glow;
 *   --logo-*             the provider marks in their own colours, the only exception to the palette.
 */

/* ── tokens ─────────────────────────────────────────────────────────────────────────────────────── */
:root {
  color-scheme: dark;

  /* page neutrals (Codex gray-1000/900/800, text white at 70/50%) */
  --bg: #0d0d0d;
  --surface: #181818;
  --surface-2: #212121;
  --control: color-mix(in srgb, #ffffff 9%, var(--surface-2));
  --control-hover: color-mix(in srgb, #ffffff 14%, var(--surface-2));
  --ink: #ffffff;
  --ink-2: rgba(255, 255, 255, 0.7);
  --ink-3: rgba(255, 255, 255, 0.5);
  --line: rgba(255, 255, 255, 0.08);
  --line-heavy: rgba(255, 255, 255, 0.16);
  --line-light: rgba(255, 255, 255, 0.04);
  --header-bg: rgba(13, 13, 13, 0.82);
  --header-bg-top: rgba(13, 13, 13, 0);
  --primary-bg: #ffffff;
  --primary-fg: #0d0d0d;
  --primary-hover: rgba(255, 255, 255, 0.88);
  --accent: #339cff;
  --link: #83c3ff;
  --focus: #339cff;
  --shadow-window: 0 0 0 0.5px var(--line-heavy), 0 -40px 140px -40px rgba(255, 255, 255, 0.14), 0 40px 120px -40px rgba(0, 0, 0, 0.9);
  --shadow-overlay: 0 0 0 0.5px var(--line-heavy), 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-tile: 0 14px 34px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --shadow-card: 0 1px 2px -1px rgba(0, 0, 0, 0.08);
  --scrim: rgba(0, 0, 0, 0.4);

  /* hero atmosphere: neutral white only (no blue, no tint) */
  --hero-glow: radial-gradient(closest-side, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03) 55%, transparent 78%);
  --hero-grid-mask: radial-gradient(ellipse 60% 55% at 50% 28%, #000000 0, transparent 78%);
  --tile-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  --thread-fade: linear-gradient(to bottom, transparent 0, #000000 16px);
  --thread-fade-compact: linear-gradient(to bottom, transparent 0, transparent 6px, #000000 64px);

  /* one colour, one meaning (aliases of the app values below, not new colours) */
  --brand-core: var(--cdx-success);
  --decision: var(--cdx-warning);
  --ready: var(--cdx-success);
  --progress: var(--cdx-accent-text);

  /* provider marks in their own colours (Claude, OpenAI, xAI from apps/web/public/brand/providers; DeepSeek, Mistral
     and Gemini from the vendors' public palettes) */
  --logo-claude: #d97757;
  --logo-openai: #ffffff;
  --logo-xai: #f5f5f5;
  --logo-deepseek: #4d6bfe;
  --logo-mistral: #fa520f;
  --logo-gemini-1: #4285f4;
  --logo-gemini-2: #9b72cb;
  --logo-gemini-3: #d96570;

  /* shape */
  --r-sm: 12px;
  --r-card: 16px;
  --r-window: 22px;
  --r-tile: 22px;
  --r-pill: 9999px;

  /* type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-display: clamp(36px, 9.6vw, 80px);
  --fs-h2: clamp(28px, 3.2vw, 40px);
  --fs-lead: 18px;
  --fs-body: 16px;
  --fs-ui: 14px;
  --fs-small: 13px;
  --fs-legal: 12px;

  /* rhythm */
  --page: 1200px;
  --text: 720px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(96px, 12vw, 160px);
  --header-h: 64px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-panel: cubic-bezier(0.2, 0, 0, 1);

  /* demo tokens: mirror of apps/web/src/ui/tokens.css (dark defaults; parity checked by tests/design.test.mjs) */
  --cdx-accent: #339cff;
  --cdx-accent-text: #83c3ff;
  --cdx-success: #40c977;
  --cdx-warning: #ff8549;
  --cdx-danger: #ff6764;
  --cdx-surface: #181818;
  --cdx-surface-under: #141414;
  --cdx-surface-frame: #2b2b2b; /* app: surface + 8% ink (titlebar, rail) */
  --cdx-surface-sidebar: #202020; /* app: surface + 3.5% ink */
  --cdx-control: rgba(45, 45, 45, 0.96);
  --cdx-fg: #ffffff;
  --cdx-fg-sidebar: rgba(255, 255, 255, 0.85);
  --cdx-text-secondary: rgba(255, 255, 255, 0.65);
  --cdx-text-tertiary: rgba(255, 255, 255, 0.498);
  --cdx-text-description: rgba(255, 255, 255, 0.7);
  --cdx-icon-secondary: rgba(255, 255, 255, 0.71);
  --cdx-border: rgba(255, 255, 255, 0.084);
  --cdx-border-heavy: rgba(255, 255, 255, 0.156);
  --cdx-border-light: rgba(255, 255, 255, 0.042);
  --cdx-bubble: rgba(255, 255, 255, 0.05);
  --cdx-hover: rgba(255, 255, 255, 0.078);
  --cdx-fill-10: rgba(255, 255, 255, 0.1);
  --cdx-fill-15: rgba(255, 255, 255, 0.15);
  --cdx-code-bg: rgba(255, 255, 255, 0.052);
  --cdx-inline-code-bg: rgba(255, 255, 255, 0.107);
  --cdx-avatar-bg: #e8c02c;
  --cdx-avatar-fg: #1a1a1a;
  --cdx-diff-added: #40c977;
  --cdx-diff-removed: #fa423e;
  --cdx-diff-added-bg: rgba(64, 201, 119, 0.23);
  --cdx-diff-removed-bg: rgba(250, 66, 62, 0.23);
  --cdx-r-md: 8px;
  --cdx-r-row: 10px;
  --cdx-r-xl: 12px;
  --cdx-r-bubble: 20px; /* app: --cdx-r-2xl 16px × squircle scale 1.25 */
  --cdx-r-composer: 20px; /* app: --cdx-r-3xl; drawn × --cdx-corner-scale like the app's squircle */
  --cdx-corner-scale: 1.25;
  --cdx-toolbar-h: 46px;
  --cdx-row-h: 30px;
  --cdx-rail-w: 48px;
  --cdx-sidebar-w: 275px;
  --cdx-weight: 445;
}

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-body) / 1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

img,
svg {
  display: block;
}

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

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

h1 {
  font-size: var(--fs-display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h2 {
  font-size: var(--fs-h2);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

main:focus {
  outline: none;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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

.icon-sm {
  width: 14px;
  height: 14px;
}

/* Brand mark: the body takes the text colour, the core is the one green point (--brand-core). */
.mark {
  width: 24px;
  height: 24px;
  flex: none;
  fill: currentColor;
}

.mark-core {
  fill: var(--brand-core);
}

/* Provider marks: each in its own colour; Gemini carries its gradient in the sprite. */
.logo {
  width: 16px;
  height: 16px;
  flex: none;
  fill: currentColor;
}

.logo--claude {
  color: var(--logo-claude);
}

.logo--openai {
  color: var(--logo-openai);
}

.logo--xai {
  color: var(--logo-xai);
}

.logo--deepseek {
  color: var(--logo-deepseek);
}

.logo--mistral {
  color: var(--logo-mistral);
}

.gemini-stop-1 {
  stop-color: var(--logo-gemini-1);
}

.gemini-stop-2 {
  stop-color: var(--logo-gemini-2);
}

.gemini-stop-3 {
  stop-color: var(--logo-gemini-3);
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 50;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--primary-bg);
  color: var(--primary-fg);
  font-size: var(--fs-ui);
  font-weight: 500;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  font: 500 var(--fs-ui) / 1 var(--font);
  white-space: nowrap;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease);
}

.btn-lg {
  height: 48px;
  padding: 0 24px;
  font-size: var(--fs-body);
}

.btn-sm {
  height: 32px;
  padding: 0 14px;
  font-size: var(--fs-small);
}

.btn-primary {
  background: var(--primary-bg);
  color: var(--primary-fg);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--control);
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--control-hover);
}

.btn-outline {
  border: 1px solid var(--line-heavy);
  color: var(--cdx-fg-sidebar);
}

.btn-outline:hover {
  background: var(--cdx-hover);
  color: var(--ink);
}

.btn:disabled {
  background: var(--control);
  color: var(--ink-3);
  cursor: not-allowed;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--link);
  font-size: var(--fs-ui);
  font-weight: 500;
}

.text-link:hover {
  color: var(--ink);
}

/* Release state: app.mjs sets html[data-release]; without it the page is in the honest "unavailable" state. */
.cta-download,
.header-download,
.mobile-nav .mobile-download {
  display: none;
}

:root[data-release="available"] .cta-download,
:root[data-release="available"] .header-download {
  display: inline-flex;
}

:root[data-release="available"] .mobile-nav .mobile-download {
  display: flex;
}

/* ── header ─────────────────────────────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line-light);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

/* At the top of the page the bar is clear, so the hero glow reaches the edge; it fills in while scrolling. */
@supports (animation-timeline: scroll()) {
  .site-header {
    animation: header-fill auto linear both;
    animation-timeline: scroll(root);
    animation-range: 0 160px;
  }
}

@keyframes header-fill {
  from {
    background-color: var(--header-bg-top);
  }

  to {
    background-color: var(--header-bg);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
}

.desktop-nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
}

.desktop-nav a {
  color: var(--ink-2);
  font-size: var(--fs-ui);
  transition: color 150ms var(--ease);
}

.desktop-nav a:hover {
  color: var(--ink);
}

.menu-toggle {
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0 -8px 0 auto;
  border-radius: var(--r-pill);
  color: var(--ink);
}

.menu-toggle .icon {
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
}

.menu-toggle .icon-close,
.menu-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

.mobile-nav {
  position: fixed;
  inset: 56px 0 auto;
  z-index: 19;
  display: flex;
  flex-direction: column;
  padding: 8px var(--gutter) 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.mobile-nav a {
  display: flex;
  align-items: center;
  height: 48px;
  font-size: 20px;
  font-weight: 500;
}

/* ── hero ───────────────────────────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  isolation: isolate;
  padding-top: 54px;
  container: hero / inline-size;
  text-align: center;
}

/* Atmosphere behind the content and under the clear header: a white glow and a 64 px grid, both neutral. */
.hero-bg {
  position: absolute;
  inset: calc(-1 * var(--header-h)) 0 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  top: -260px;
  left: 50%;
  width: 1200px;
  height: 760px;
  margin-left: -600px;
  background: var(--hero-glow);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--line-light) 1px, transparent 1px), linear-gradient(90deg, var(--line-light) 1px, transparent 1px);
  background-position: center top;
  background-size: 64px 64px;
  -webkit-mask-image: var(--hero-grid-mask);
  mask-image: var(--hero-grid-mask);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Eyebrow: the release state. The dot is the "in progress" blue until a release exists, then the "ready" green. */
.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 4px 14px;
  border: 1px solid var(--cdx-border);
  border-radius: var(--r-pill);
  background: var(--cdx-bubble);
  color: var(--cdx-fg-sidebar);
  font-size: var(--fs-small);
  line-height: 20px;
}

.hero-status::before {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--progress);
  content: "";
}

:root[data-release="available"] .hero-status::before {
  background: var(--ready);
}

/* Provider tiles. In a narrow hero they are a row under the eyebrow; from 1200 px they float beside the text. */
.hero-tiles {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.tile {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-heavy);
  border-radius: 13px;
  background: var(--tile-bg);
  box-shadow: var(--shadow-tile);
}

.tile .logo {
  width: 20px;
  height: 20px;
}

/* --provider-marks=names (build.mjs): the same tiles carry the provider's name in the page's type, no vendor logo.
   In a narrow hero they are a centred grid of pills (three per row); beside the text they keep the 76 px tiles. */
.hero-tiles:has(.tile--name) {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: center;
}

.tile--name {
  width: auto;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  color: var(--ink-2);
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

@container hero (min-width: 1200px) {
  .hero-tiles {
    position: absolute;
    inset: 0;
    display: block;
    margin: 0;
    pointer-events: none;
  }

  .tile {
    position: absolute;
    width: 76px;
    height: 76px;
    border-radius: var(--r-tile);
    animation: tile-float 7s ease-in-out 2 both;
  }

  .tile .logo {
    width: 34px;
    height: 34px;
  }

  .hero-tiles:has(.tile--name) {
    display: block;
  }

  .tile--name {
    width: 76px;
    height: 76px;
    padding: 0;
    border-radius: var(--r-tile);
    font-size: var(--fs-small);
  }

  .tile--1 {
    top: 126px;
    left: max(12px, 50% - 554px);
  }

  .tile--2 {
    top: 296px;
    left: max(12px, 50% - 610px);
    animation-delay: 1.4s;
  }

  .tile--3 {
    top: 456px;
    left: max(12px, 50% - 490px);
    animation-delay: 2.6s;
  }

  .tile--4 {
    top: 116px;
    right: max(12px, 50% - 554px);
    animation-delay: 0.7s;
  }

  .tile--5 {
    top: 286px;
    right: max(12px, 50% - 610px);
    animation-delay: 2s;
  }

  .tile--6 {
    top: 456px;
    right: max(12px, 50% - 492px);
    animation-delay: 3.2s;
  }
}

/* The float runs twice and stops. */
@keyframes tile-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.hero h1 {
  margin-top: 24px;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

/* The second clause always starts its own line (monochrome: no colour change). */
.h1-line {
  display: block;
}

.hero-lead {
  max-width: 640px;
  margin-top: 24px;
  color: var(--ink-2);
  font-size: var(--fs-lead);
  line-height: 28px;
  text-wrap: balance;
}

.hero-composer {
  width: min(700px, 100%);
  margin-top: 24px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

/* Under "Email us to be notified at release": what the address is used for (security audit L-09). */
.hero-note {
  margin-top: 12px;
  color: var(--ink-3);
  font-size: var(--fs-small);
  line-height: 20px;
}

.hero-note .text-link {
  font-size: var(--fs-small);
}

.hero-fine {
  max-width: var(--text);
  margin-top: 24px;
  color: var(--ink-3);
  font-size: var(--fs-small);
  line-height: 20px;
  text-wrap: balance;
}

.fine-line {
  display: block;
}

.demo {
  width: 100%;
  margin-top: 64px;
  container: demo / inline-size;
  scroll-margin-top: 88px;
}

.demo figcaption {
  margin-top: 16px;
  color: var(--ink-3);
  font-size: var(--fs-small);
  line-height: 20px;
}

/* ── composer (the app's card: text, three labelled menus, send; the tray sits under the card) ──── */
.composer {
  container: composer / inline-size;
  color: var(--cdx-fg);
  font: var(--cdx-weight) var(--fs-ui) / 20px var(--font);
  text-align: left;
}

.composer-card {
  position: relative;
  z-index: 1;
  padding: 14px 14px 10px;
  border: 1px solid var(--cdx-border-heavy);
  border-radius: calc(var(--cdx-r-composer) * var(--cdx-corner-scale));
  background: var(--cdx-control);
  box-shadow: var(--shadow-card);
}

.composer-text {
  padding: 0 9px 22px;
  color: var(--cdx-text-tertiary);
  font-weight: 400;
  line-height: 22px;
}

.composer-text--typed {
  color: var(--cdx-fg);
}

/* A still caret after the typed request (nothing blinks on this page). */
.composer-text--typed::after {
  display: inline-block;
  width: 1.5px;
  height: 16px;
  margin-left: 2px;
  background: var(--cdx-fg-sidebar);
  vertical-align: -3px;
  content: "";
}

.composer-foot {
  display: flex;
  align-items: center;
  gap: 4px;
}

.composer-menu {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 9px;
  border-radius: calc(var(--cdx-r-md) * var(--cdx-corner-scale));
  color: var(--cdx-fg-sidebar);
  font-size: var(--fs-small);
  white-space: nowrap;
}

.composer-menu .icon {
  color: var(--cdx-text-tertiary);
}

.composer-menu .logo {
  width: 14px;
  height: 14px;
}

.composer-progress {
  color: var(--progress);
}

.composer-short {
  display: none;
}

.composer-icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--cdx-text-secondary);
}

.composer-icon--end {
  margin-left: auto;
}

.composer-send {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-pill);
  background: var(--cdx-text-tertiary);
  color: var(--primary-fg);
}

.composer-send--ready {
  background: var(--primary-bg);
}

.composer-tray {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: calc(100% - 28px);
  height: 36px;
  margin: -2px auto 0;
  padding: 4px 8px 0;
  border: 1px solid var(--cdx-border);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background: var(--cdx-bubble);
  color: var(--cdx-text-secondary);
  font-size: var(--fs-small);
  white-space: nowrap;
}

.composer-tray > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Narrow card (phone): labels stay, the effort moves into the model menu, the model name shortens. */
@container composer (max-width: 519px) {
  .composer-effort,
  .composer-long {
    display: none;
  }

  .composer-short {
    display: inline;
  }

  .composer-card {
    padding: 12px 10px 10px;
  }

  .composer-menu {
    padding: 0 7px;
  }
}

/* Under 330 px only the two labelled menus and the send button fit. */
@container composer (max-width: 329px) {
  .composer-icon {
    display: none;
  }

  .composer-send {
    margin-left: auto;
  }
}

/* ── demo (the app's thread: rail, sidebar by state, one 46 px toolbar, thread, composer, diff/terminal) ── */
.app-window {
  position: relative;
  display: grid;
  grid-template-columns: var(--cdx-rail-w) var(--cdx-sidebar-w) minmax(0, 1fr);
  max-width: var(--page);
  height: 736px;
  margin-inline: auto;
  overflow: hidden;
  border-radius: var(--r-window);
  background: var(--cdx-surface-frame);
  box-shadow: var(--shadow-window);
  color: var(--cdx-fg);
  font: var(--cdx-weight) var(--fs-ui) / 20px var(--font);
  text-align: left;
}

.demo-chrome {
  position: absolute;
  top: 9px;
  left: 8px;
  z-index: 1;
  display: flex;
  gap: 4px;
  color: var(--cdx-text-tertiary);
}

.demo-chrome span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
}

.demo-chrome .icon,
.demo-rail .icon {
  width: 18px;
  height: 18px;
}

.demo-chrome-off {
  color: var(--cdx-border-heavy);
}

.demo-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 52px 0 12px;
}

.demo-rail-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--cdx-r-row);
  color: var(--cdx-icon-secondary);
}

.demo-rail-btn--on {
  background: var(--cdx-hover);
  color: var(--cdx-fg);
}

.demo-rail-btn--end {
  margin-top: auto;
}

.demo-avatar {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 4px;
  border-radius: var(--r-pill);
  background: var(--cdx-avatar-bg);
  color: var(--cdx-avatar-fg);
  font-size: var(--fs-legal);
  font-weight: 600;
  line-height: 1;
}

.demo-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  margin-top: var(--cdx-toolbar-h);
  padding: 8px;
  overflow: hidden;
  border-top-left-radius: var(--cdx-r-xl);
  background: var(--cdx-surface-sidebar);
  color: var(--cdx-fg-sidebar);
}

.demo-side-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  padding: 2px 6px 8px 8px;
  color: var(--cdx-fg);
  font-weight: 500;
}

.demo-side-head .icon {
  color: var(--cdx-text-secondary);
}

.demo-side-head .demo-side-search {
  margin-left: auto;
}

/* The list clips what does not fit; the side padding moves inside it so a focus ring on a row is never cut. */
.demo-side-scroll {
  flex: 1;
  min-height: 0;
  margin-inline: -6px;
  padding-inline: 6px;
  overflow: hidden;
}

.demo-threads {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.demo-row {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: var(--cdx-row-h);
  padding: 0 8px;
  border-radius: var(--cdx-r-row);
  color: inherit;
  text-align: left;
  white-space: nowrap;
}

.demo-row > span:first-of-type,
.demo-row > .demo-thread-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-row .icon {
  color: var(--cdx-icon-secondary);
}

.demo-row--more {
  color: var(--cdx-text-tertiary);
}

.demo-thread {
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}

button.demo-row:hover,
.demo-row[aria-current="true"] {
  background: var(--cdx-hover);
  color: var(--cdx-fg);
}

/* Thread card (Needs you): project and time, title, state. */
.demo-thread[data-kind="card"] {
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  height: auto;
  padding: 6px 8px 7px;
  border-radius: var(--cdx-r-xl);
}

.demo-thread-top,
.demo-thread-state {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--cdx-text-tertiary);
  font-size: var(--fs-legal);
  line-height: 16px;
}

.demo-thread[data-kind="card"] > .demo-thread-top {
  flex: none;
  overflow: visible;
}

.demo-thread-top .demo-meta {
  margin-left: auto;
}

.demo-thread[data-kind="card"] > .demo-thread-title {
  flex: none;
  color: var(--cdx-fg);
}

.demo-thread-state {
  color: var(--cdx-text-secondary);
}

/* On the hovered or selected card the tertiary tier falls under 4.5:1, so it steps up to secondary. */
button.demo-thread:hover .demo-thread-top,
.demo-thread[aria-current="true"] .demo-thread-top {
  color: var(--cdx-text-secondary);
}

button.demo-thread:hover .demo-meta,
.demo-thread[aria-current="true"] .demo-meta {
  color: inherit;
}

.demo-chip {
  display: grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: var(--cdx-fill-10);
  color: var(--cdx-fg-sidebar);
  font-size: var(--fs-legal);
  font-weight: 600;
  line-height: 1;
}

.demo-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--ready);
}

.demo-dot--decision {
  background: var(--decision);
}

/* A still ring: three quarters neutral, one quarter in the "in progress" blue. */
.demo-spinner {
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid var(--cdx-fill-15);
  border-top-color: var(--progress);
  border-radius: var(--r-pill);
}

.demo-working {
  flex: none;
  color: var(--progress);
  font-size: var(--fs-legal);
}

.demo-meta {
  flex: none;
  color: var(--cdx-text-tertiary);
  font-size: var(--fs-legal);
  font-variant-numeric: tabular-nums;
}

.demo-label {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 25px;
  margin-top: 10px;
  padding: 0 2px 0 8px;
  color: var(--cdx-text-tertiary);
}

.demo-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 16px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--cdx-fill-10);
  color: var(--cdx-fg-sidebar);
  font-size: var(--fs-legal);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* 11 px exists only inside the window, as in the app (count badges, project chips, avatar initials). */
.app-window .demo-count,
.app-window .demo-chip,
.app-window .demo-avatar {
  font-size: 11px;
}

.demo-usage {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--cdx-border);
  border-radius: calc(var(--cdx-r-xl) * var(--cdx-corner-scale));
  color: var(--cdx-text-secondary);
  font-size: var(--fs-legal);
  line-height: 16px;
}

.demo-usage-top,
.demo-usage-bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  white-space: nowrap;
}

.demo-usage-top span:first-child {
  color: var(--cdx-fg-sidebar);
  font-size: var(--fs-small);
  font-weight: 500;
}

.demo-usage-bar {
  height: 3px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--cdx-fill-15);
}

.demo-usage-bar span {
  display: block;
  width: 62%;
  height: 100%;
  background: var(--cdx-fg);
}

.demo-usage-link {
  color: var(--cdx-fg);
  text-decoration: underline;
  text-decoration-color: var(--cdx-text-tertiary);
  text-underline-offset: 2px;
}

.demo-scrim {
  display: none;
}

.demo-main {
  display: grid;
  grid-template-rows: var(--cdx-toolbar-h) minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.demo-header {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 0 8px;
}

.demo-crumb {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-left: 8px;
  white-space: nowrap;
}

.demo-crumb-icon {
  color: var(--cdx-text-secondary);
}

.demo-title {
  min-width: 0;
  overflow: hidden;
  color: var(--cdx-fg);
  text-overflow: ellipsis;
}

.demo-icon-btn {
  position: relative;
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--cdx-r-md);
  color: var(--cdx-text-secondary);
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}

button.demo-icon-btn:hover,
.demo-icon-btn[aria-pressed="true"] {
  background: var(--cdx-hover);
  color: var(--cdx-fg);
}

.demo-side-toggle {
  display: none;
}

.demo-body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  background: var(--cdx-surface);
}

.app-window[data-diff="open"] .demo-body {
  grid-template-columns: minmax(0, 1fr) 45%;
}

.demo-content {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
}

.app-window[data-terminal="open"] .demo-content {
  grid-template-rows: minmax(0, 1fr) auto 40%;
}

/* The thread is anchored to the composer: what does not fit leaves from the top, like a scrolled chat. */
.demo-scroll {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 0;
  overflow: hidden;
  -webkit-mask-image: var(--thread-fade);
  mask-image: var(--thread-fade);
}

.demo-conv {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 768px;
  margin-inline: auto;
  padding: 16px 16px 12px;
}

.demo-bubble {
  align-self: flex-end;
  max-width: 78%;
  padding: 7px 14px;
  border-radius: var(--cdx-r-bubble);
  background: var(--cdx-bubble);
}

.demo-worked {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  color: var(--cdx-text-secondary);
  white-space: nowrap;
}

.demo-worked .demo-working {
  font-size: inherit;
}

.demo-rule {
  flex: 1;
  height: 1px;
  background: var(--cdx-border);
}

.demo-steps {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0 4px 2px;
}

.demo-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 26px;
  color: var(--cdx-text-secondary);
  font-size: var(--fs-small);
  white-space: nowrap;
}

.demo-steps .icon {
  color: var(--cdx-text-tertiary);
}

.demo-step-meta {
  min-width: 0;
  margin-left: auto;
  overflow: hidden;
  color: var(--cdx-text-tertiary);
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
}

.demo-answer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  line-height: 22px;
}

.demo-answer code,
.demo-steps code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--cdx-inline-code-bg);
  font: 400 var(--fs-legal) / 1 var(--mono);
}

/* Code block: keywords in the "in progress" blue of links, strings in the outcome green, types and comments grey. */
.demo-codeblock {
  padding: 10px 14px;
  overflow: hidden;
  border-radius: calc(var(--cdx-r-row) * var(--cdx-corner-scale));
  background: var(--cdx-code-bg);
  color: var(--cdx-fg-sidebar);
  font: 400 var(--fs-legal) / 19px var(--mono);
  white-space: pre;
}

.tok-k {
  color: var(--cdx-accent-text);
}

.tok-s {
  color: var(--cdx-success);
}

.tok-c {
  color: var(--cdx-text-tertiary);
}

.demo-changes {
  position: relative;
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--cdx-border-heavy);
  border-radius: var(--r-pill);
  color: var(--cdx-fg-sidebar);
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: background-color 150ms var(--ease);
}

.demo-changes:hover {
  background: var(--cdx-hover);
}

.demo-changes .icon {
  color: var(--cdx-text-tertiary);
}

.demo-add {
  color: var(--cdx-diff-added);
}

.demo-del {
  color: var(--cdx-diff-removed);
}

/* Approval: a neutral card; the kind icon is the one orange point of the thread. */
.demo-approval {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--cdx-border-heavy);
  border-radius: calc(var(--cdx-r-xl) * var(--cdx-corner-scale));
  background: var(--cdx-control);
}

.demo-approval-kind {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--cdx-text-secondary);
  font-size: var(--fs-small);
}

.demo-approval-kind .icon {
  color: var(--decision);
}

.demo-approval-title {
  font-weight: 600;
}

.demo-approval-target {
  padding: 6px 10px;
  overflow: hidden;
  border-radius: var(--cdx-r-md);
  background: var(--cdx-code-bg);
  color: var(--cdx-text-secondary);
  font: 400 var(--fs-legal) / 18px var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-approval-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.demo-btn {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 14px;
  border: 1px solid var(--cdx-border-heavy);
  border-radius: var(--r-pill);
  color: var(--cdx-fg-sidebar);
  font-size: var(--fs-small);
}

.demo-btn--solid {
  border-color: var(--primary-bg);
  background: var(--primary-bg);
  color: var(--primary-fg);
  font-weight: 500;
}

.demo-composer {
  width: calc(100% - 32px);
  max-width: 736px;
  margin: 0 auto 16px;
}

.demo-term,
.demo-diff {
  transition: opacity 180ms var(--ease-panel), transform 180ms var(--ease-panel);
}

.demo-term {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid var(--cdx-border);
  background: var(--cdx-surface-under);
}

.demo-term-head,
.demo-file {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  font-size: var(--fs-small);
  white-space: nowrap;
}

.demo-term-head {
  color: var(--cdx-fg);
  font-weight: 500;
}

.demo-term-head .icon {
  color: var(--cdx-icon-secondary);
}

.demo-term-head span {
  color: var(--cdx-text-tertiary);
  font-weight: 400;
}

.demo-code {
  padding: 4px 12px 12px;
  overflow: hidden;
  color: var(--cdx-text-secondary);
  font: 400 var(--fs-legal) / 20px var(--mono);
  white-space: pre;
}

.demo-code .icon {
  display: inline-block;
  vertical-align: -2px;
}

.demo-muted {
  color: var(--cdx-text-tertiary);
}

.demo-ok {
  color: var(--cdx-success);
}

.demo-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--cdx-text-secondary);
  vertical-align: -2px;
}

.demo-diff {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid var(--cdx-border);
  background: var(--cdx-surface);
}

.demo-diff-files {
  min-height: 0;
  overflow: hidden;
}

.demo-file {
  border-bottom: 1px solid var(--cdx-border-light);
}

.demo-file .icon {
  color: var(--cdx-icon-secondary);
}

.demo-file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
}

.demo-lines {
  padding: 4px 0;
  color: var(--cdx-fg);
}

.demo-line {
  display: grid;
  grid-template-columns: 36px 20px minmax(0, 1fr);
}

.demo-line--add {
  background: var(--cdx-diff-added-bg);
}

.demo-line--del {
  background: var(--cdx-diff-removed-bg);
}

.demo-ln {
  padding-right: 8px;
  color: var(--cdx-text-secondary);
  text-align: right;
}

.demo-sign {
  text-align: center;
}

.demo-diff-empty {
  margin: auto;
  color: var(--cdx-text-tertiary);
  font-size: var(--fs-small);
}

@starting-style {
  .demo-term,
  .demo-diff {
    opacity: 0;
    transform: translateX(8px);
  }
}

/* The demo window reflows by its own width: under 820 px only the thread shows, the rail goes away, the sidebar is
   an overlay and the diff is a sheet over the thread (mobile 358 × 520). */
@container demo (max-width: 819px) {
  .app-window {
    grid-template-columns: minmax(0, 1fr);
    height: 520px;
    border-radius: var(--r-card);
  }

  .demo-chrome,
  .demo-rail {
    display: none;
  }

  .app-window > .demo-side {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 3;
    width: min(var(--cdx-sidebar-w), 85%);
    margin-top: 0;
    border-radius: 0;
    box-shadow: var(--shadow-overlay);
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform 180ms var(--ease-panel), visibility 180ms;
  }

  .app-window[data-side="open"] > .demo-side {
    visibility: visible;
    transform: none;
  }

  .app-window[data-side="open"] > .demo-scrim {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    background: var(--scrim);
  }

  .demo-side-toggle {
    display: inline-grid;
  }

  .demo-crumb-icon {
    display: none;
  }

  .demo-crumb {
    padding-left: 4px;
  }

  .demo-title {
    color: var(--cdx-fg);
    font-weight: 500;
  }

  .app-window[data-diff="open"] .demo-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-window > .demo-main .demo-diff {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-left: 0;
  }

  /* The compact window shows the end of the thread: a longer fade, so the first line is never sliced in half. */
  .demo-scroll {
    -webkit-mask-image: var(--thread-fade-compact);
    mask-image: var(--thread-fade-compact);
  }

  .demo-conv {
    padding: 12px 12px 10px;
  }

  .demo-bubble {
    max-width: 88%;
  }

  .demo-step-meta {
    display: none;
  }

  .demo-composer {
    width: calc(100% - 24px);
    margin-bottom: 12px;
  }
}

/* ── sections ───────────────────────────────────────────────────────────────────────────────────── */
.section {
  padding-top: var(--section);
}

.section--last {
  padding-bottom: var(--section);
}

.section-head {
  max-width: var(--text);
  margin: 0 auto 56px;
  text-align: center;
}

.section-head p {
  margin-top: 16px;
  color: var(--ink-2);
  font-size: var(--fs-lead);
  line-height: 28px;
}

.works-with {
  text-align: center;
}

.works-with .works-with-label {
  color: var(--ink-3);
  font-size: var(--fs-ui);
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0;
}

.works-with-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  row-gap: 4px;
  margin-top: 16px;
  color: var(--ink-2);
  font-size: var(--fs-body);
  font-weight: 500;
}

.works-with-list li {
  display: inline-flex;
  align-items: center;
}

.works-with-list li + li::before {
  width: 3px;
  height: 3px;
  margin: 0 16px;
  border-radius: var(--r-pill);
  background: var(--ink-3);
  content: "";
}

.works-with-note {
  max-width: var(--text);
  margin: 16px auto 0;
  color: var(--ink-3);
  font-size: var(--fs-small);
  line-height: 20px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
}

.feature-media {
  position: relative;
  height: 280px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.feature-crop {
  position: absolute;
  inset: 24px -1px -1px 24px;
  display: flex;
  overflow: hidden;
  border-top-left-radius: var(--r-sm);
  background: var(--cdx-surface);
  box-shadow: 0 0 0 0.5px var(--line-heavy);
  color: var(--cdx-fg);
  font: var(--cdx-weight) var(--fs-ui) / 20px var(--font);
}

.feature-crop > * {
  flex: 1;
  min-width: 0;
}

.feature-crop > .demo-side {
  flex: none;
  width: var(--cdx-sidebar-w);
  margin-top: 0;
  border-radius: 0;
}

.feature-crop .demo-label:first-of-type {
  margin-top: 6px;
}

.feature-crop > .demo-diff {
  border-left: 0;
}

.feature-crop > .demo-term {
  border-top: 0;
}

.feature-copy {
  padding: 24px;
}

.feature-copy p {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 24px;
}

.flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 200px) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
}

.flow-node {
  height: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
}

.flow-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 24px;
}

.flow-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-pill);
  background: var(--control);
  color: var(--ink-2);
}

.flow-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.flow-items li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--line);
  color: var(--ink-2);
  font-size: var(--fs-small);
}

.flow-text {
  margin-top: 16px;
  color: var(--ink-2);
  font-size: var(--fs-ui);
  line-height: 22px;
}

.flow-link {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--ink-3);
  font-size: var(--fs-small);
  line-height: 20px;
  text-align: center;
}

.flow-arrow {
  fill: none;
  stroke: var(--line-heavy);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow-arrow--h {
  width: 100%;
  height: 12px;
}

.flow-arrow--v {
  display: none;
  width: 12px;
  height: 48px;
}

.section-link {
  margin-top: 32px;
  text-align: center;
}

.download {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: var(--text);
  text-align: center;
}

.download-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 0 0 0.5px var(--line-heavy);
}

.download-icon .mark {
  width: 40px;
  height: 40px;
}

.download h2 {
  margin-top: 24px;
}

.download-message {
  max-width: 560px;
  margin-top: 16px;
  color: var(--ink-2);
  line-height: 26px;
}

.download-actions {
  margin-top: 28px;
}

.download-reqs,
.download-note {
  margin-top: 16px;
  color: var(--ink-3);
  font-size: var(--fs-small);
  line-height: 20px;
}

.download-note {
  max-width: 560px;
  margin-top: 4px;
}

.download-note:empty {
  display: none;
}

.checksum {
  width: 100%;
  max-width: 560px;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  text-align: left;
}

.checksum summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  font-size: var(--fs-ui);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

.checksum-body {
  padding: 0 16px 16px;
  color: var(--ink-2);
  font-size: var(--fs-small);
  line-height: 20px;
}

.checksum-body code {
  display: block;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--cdx-r-md);
  background: var(--line);
  color: var(--ink);
  font: 400 var(--fs-legal) / 18px var(--mono);
  overflow-wrap: anywhere;
}

.checksum-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.copy-status {
  color: var(--ink-3);
}

/* Shown only when the manifest names the publisher's Team ID (security audit L-03). */
.checksum-team {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.checksum-team p + code,
.checksum-team code + p {
  margin-top: 8px;
}

.checksum-team strong {
  color: var(--ink);
  font-weight: 500;
}

/* ── faq ────────────────────────────────────────────────────────────────────────────────────────── */
.faq-list {
  max-width: var(--text);
  margin: 0 auto;
  border-top: 1px solid var(--line);
}

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

.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 16px 0;
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 24px;
  cursor: pointer;
  list-style: none;
}

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

.chev {
  color: var(--ink-3);
  transition: transform 150ms var(--ease);
}

details[open] > summary .chev {
  transform: rotate(180deg);
}

.faq-list details p {
  padding: 0 40px 20px 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 24px;
}

/* ── document pages (privacy and contact, not found) ────────────────────────────────────────────── */
.doc-nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
}

.doc-nav a {
  color: var(--ink-2);
  font-size: var(--fs-ui);
  transition: color 150ms var(--ease);
}

.doc-nav a:hover {
  color: var(--ink);
}

.doc {
  max-width: var(--text);
  padding-block: 72px var(--section);
}

.doc--short {
  min-height: 50vh;
}

.doc h1 {
  font-size: var(--fs-h2);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.doc-lead {
  margin-top: 16px;
  color: var(--ink-2);
  font-size: var(--fs-lead);
  line-height: 28px;
}

.doc-section {
  margin-top: 48px;
  scroll-margin-top: 80px;
}

.doc-section h2 {
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.doc-section p,
.doc-list li {
  margin-top: 12px;
  color: var(--ink-2);
  line-height: 1.65;
}

.doc-list {
  padding-left: 20px;
  list-style: disc;
}

.doc-list li::marker {
  color: var(--ink-3);
}

.doc strong {
  color: var(--ink);
  font-weight: 500;
}

.doc a {
  color: var(--link);
}

.doc a:hover {
  color: var(--ink);
}

/* ── footer ─────────────────────────────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding-block: 28px;
  color: var(--ink-3);
  font-size: var(--fs-small);
  line-height: 20px;
}

.brand--footer {
  gap: 8px;
  color: var(--ink-2);
  font-size: var(--fs-small);
  letter-spacing: 0;
}

.brand--footer .mark {
  width: 16px;
  height: 16px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-left: auto;
}

.footer-nav a:hover {
  color: var(--ink);
}

/* Non-affiliation with the providers whose marks the hero shows: its own full-width line. */
.footer-legal {
  flex-basis: 100%;
  max-width: var(--text);
}

/* ── media ──────────────────────────────────────────────────────────────────────────────────────── */
/* The one structural breakpoint: layout only, never smaller text (H1/H2 scale with clamp()). */
@media (max-width: 699px) {
  .desktop-nav,
  .header-notify,
  :root[data-release="available"] .header-download {
    display: none;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .header-inner {
    height: 56px;
  }

  .hero {
    padding-top: 36px;
  }

  .hero-bg {
    top: -56px;
  }

  .hero h1,
  .hero-lead,
  .hero-composer,
  .hero-actions,
  .hero-fine {
    margin-top: 20px;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    max-width: 320px;
  }

  .fine-line {
    display: inline;
  }

  .demo {
    margin-top: 48px;
  }

  .feature-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature-media {
    height: 240px;
  }

  .flow {
    grid-template-columns: minmax(0, 1fr);
  }

  .flow-arrow--h {
    display: none;
  }

  .flow-arrow--v {
    display: block;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-nav {
    margin-left: 0;
  }
}

/* Touch: every control keeps a 44 px hit area without changing its drawn size. */
@media (pointer: coarse) {
  .menu-toggle {
    width: 44px;
    height: 44px;
    margin-right: -10px;
  }

  .demo-icon-btn::after,
  .demo-changes::after,
  .demo-row::after {
    position: absolute;
    top: -8px;
    right: -8px;
    bottom: -8px;
    left: -8px;
    content: "";
  }

  .demo-changes::after {
    top: -6px;
    bottom: -6px;
  }

  .demo-row::after {
    top: -7px;
    right: 0;
    bottom: -7px;
    left: 0;
  }

  .demo-thread[data-kind="card"]::after {
    top: 0;
    bottom: 0;
  }

  .btn,
  .btn-sm {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .tile,
  .site-header {
    animation: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
  }
}
