/* margin — landing page
   Pure Google-inspired editorial architecture: Google Sans, generous air,
   flat full-bleed tonal bands, zero cards, zero eyebrows, hairline structure. */

:root {
  color-scheme: light;

  --font-sans: "Google Sans", "Product Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Google Sans Code", "Roboto Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  /* surfaces — flat, luminous, architectural */
  --bg: #ffffff;
  --surface: #f8f9fa;
  --surface-tint: #f0f4f9;
  --surface-hover: #f1f3f4;

  /* ink */
  --ink: #1f1f1f;
  --ink-2: #5f6368;
  --ink-3: #747775;
  --on-blue: #ffffff;

  /* hairlines */
  --hairline: #e3e3e3;
  --hairline-strong: #c4c7c5;

  /* semantic accents: Google blue (verified/action) + Google red (flagged/margin rule) */
  --blue: #1a73e8;
  --blue-hover: #1557b0;
  --blue-tint: #e8f0fe;

  --red: #d93025;
  --red-tint: #fce8e6;
  --margin-rule: rgb(217 48 37 / 0.34);

  --container: 1240px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --fast: 150ms;
  --med: 260ms;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #000000;
  --surface: #09090b;
  --surface-tint: #111318;
  --surface-hover: #141417;

  --ink: #f5f5f7;
  --ink-2: #a1a1a6;
  --ink-3: #6e6e73;
  --on-blue: #041e49;

  --hairline: #1e1e22;
  --hairline-strong: #323238;

  --blue: #8ab4f8;
  --blue-hover: #aecbfa;
  --blue-tint: rgb(138 180 248 / 0.14);

  --red: #f28b82;
  --red-tint: rgb(242 139 130 / 0.14);
  --margin-rule: rgb(242 139 130 / 0.34);
}

/* ---- Base ------------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.58;
  color: var(--ink);
  background: var(--bg);
  overflow-x: clip;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

a {
  color: inherit;
}

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

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  text-decoration: none;
  transition: top var(--fast) var(--ease);
}

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

.wrap {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
}

/* ---- Top Bar (clean Google product bar) ------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}

.topbar-inner {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 36px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 3px;
}

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

.nav a {
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-2);
  text-decoration: none;
  transition: color var(--fast) var(--ease);
}

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

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.theme-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.theme-btn:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.nav-ext {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--fast) var(--ease);
}

.nav-ext:hover {
  color: var(--blue);
}

/* ---- Hero (Pure white / deep black, centered monumental Google Sans) -------------------- */

.hero {
  padding: clamp(72px, 10vw, 132px) 0 clamp(64px, 8vw, 96px);
  text-align: center;
}

.hero-title {
  margin: 0 auto;
  max-width: 980px;
  font-size: clamp(3.1rem, 6.6vw, 5.6rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.042em;
  color: var(--ink);
  text-wrap: balance;
}

.hero-lead {
  margin: 26px auto 0;
  max-width: 780px;
  font-size: clamp(1.12rem, 1.65vw, 1.32rem);
  font-weight: 400;
  line-height: 1.52;
  color: var(--ink-2);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease),
    color var(--fast) var(--ease);
}

.btn-primary {
  background: var(--blue);
  color: var(--on-blue);
}

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

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline-strong);
}

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

.btn-icon {
  flex-shrink: 0;
  display: block;
}

.download-meta {
  margin: 16px auto 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
}

/* Flat architectural install line — centered, no card, no scrollbar */
.install-line {
  margin: 24px auto 0;
  max-width: 540px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  text-align: left;
}

.install-line code {
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}

.install-line code::-webkit-scrollbar,
.tabs::-webkit-scrollbar,
.file-switch::-webkit-scrollbar,
.run-rail::-webkit-scrollbar,
.agent-cmd code::-webkit-scrollbar,
.code-surface pre::-webkit-scrollbar {
  display: none;
}

.install-line .prompt {
  color: var(--ink-3);
  margin-right: 8px;
  user-select: none;
}

.copy-link {
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--blue);
  flex-shrink: 0;
  transition: background-color var(--fast) var(--ease);
}

.copy-link:hover {
  background: var(--blue-tint);
}

.copy-link[data-copied="true"] {
  background: var(--blue-tint);
}

/* ---- Full-Bleed Interactive Workbench Band (Zero cards!) -------------------------------- */

.band-surface {
  background: var(--surface);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.wb-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  border-bottom: 1px solid var(--hairline);
}

/* Google Material-style flat underline tabs — never shows a scrollbar */
.tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  overflow: visible;
}

.tab-btn {
  position: relative;
  padding: 18px 0;
  border: 0;
  background: transparent;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color var(--fast) var(--ease);
}

.tab-btn:hover {
  color: var(--ink);
}

.tab-btn[aria-selected="true"] {
  color: var(--blue);
}

.tab-btn[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--blue);
}

.wb-cmd {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 10px 0;
}

/* Architectural 2-column split separated by ONE red margin hairline */
.wb-split {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
}

.wb-split[hidden] {
  display: none;
}

.wb-stage {
  min-width: 0;
  padding: 40px 48px 48px 0;
  border-right: 1px solid var(--margin-rule);
}

.wb-margin {
  min-width: 0;
  padding: 40px 0 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Data Storyteller live stat + crosshair chart */
.metric-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 20px;
}

.metric-big {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.metric-num {
  font-size: clamp(2.4rem, 4vw, 3.35rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric-date {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--ink-2);
}

.metric-meta {
  font-size: 13.5px;
  color: var(--ink-3);
}

.chart-stage {
  position: relative;
  margin: 0 0 32px;
}

.chart-svg {
  width: 100%;
  height: auto;
  overflow: visible;
  cursor: crosshair;
}

.chart-grid {
  stroke: var(--hairline);
  stroke-width: 1;
}

.chart-axis {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--ink-3);
}

.chart-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-fill {
  fill: var(--blue);
  opacity: 0.08;
}

.chart-crosshair {
  stroke: var(--hairline-strong);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.chart-dot {
  fill: var(--bg);
  stroke: var(--blue);
  stroke-width: 2.5;
}

/* Interactive Storyteller Prose */
.story-prose {
  font-size: clamp(1.14rem, 1.55vw, 1.32rem);
  font-weight: 400;
  line-height: 1.64;
  letter-spacing: -0.012em;
  color: var(--ink);
}

.story-prose p {
  margin: 0 0 18px;
}

.story-prose p:last-child {
  margin-bottom: 0;
}

.story-hint {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--ink-3);
}

.fact {
  display: inline;
  padding: 1px 5px;
  margin: 0 -1px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--blue) 45%, transparent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition: background-color var(--fast) var(--ease);
}

.fact:hover,
.fact[aria-pressed="true"] {
  background: var(--blue-tint);
  text-decoration-color: var(--blue);
}

.fact[data-tone="red"] {
  color: var(--red);
  text-decoration-color: color-mix(in srgb, var(--red) 55%, transparent);
  text-decoration-style: dashed;
}

.fact[data-tone="red"]:hover,
.fact[data-tone="red"][aria-pressed="true"] {
  background: var(--red-tint);
  text-decoration-color: var(--red);
}

.export-line {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-2);
}

/* Flat Margin Receipt Column — zero boxes/cards, pure hairlines */
.margin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--blue);
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-dot[data-tone="red"] {
  color: var(--red);
}

.margin-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}

.margin-figure {
  margin: 22px 0 6px;
  font-size: clamp(2rem, 3vw, 2.6rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.margin-desc {
  margin: 0 0 24px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

.proof-row {
  padding: 16px 0;
  border-top: 1px solid var(--hairline);
}

.proof-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.proof-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.proof-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.proof-code {
  margin: 0;
  font-size: 12px;
  line-height: 1.62;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.margin-foot {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}

/* AI Code Detector inside Workbench */
.det-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.det-score {
  font-size: clamp(3.4rem, 5.6vw, 4.75rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.det-band {
  margin-top: 8px;
  font-size: 15px;
  color: var(--ink-2);
}

.det-band code {
  font-size: 14px;
  color: var(--ink);
}

/* Precision animated 0-to-1 ruler */
.ruler-box {
  margin: 18px 0 24px;
}

.ruler-track {
  position: relative;
  height: 44px;
}

.ruler-svg {
  width: 100%;
  height: 44px;
}

.ruler-range-bar {
  position: absolute;
  top: 18px;
  height: 18px;
  background: var(--blue-tint);
  transition: left var(--med) var(--ease), width var(--med) var(--ease),
    background-color var(--med) var(--ease), opacity var(--med) var(--ease);
}

.ruler-range-bar[data-tone="red"] {
  background: var(--red-tint);
}

.ruler-needle {
  position: absolute;
  top: 6px;
  width: 2px;
  height: 30px;
  background: var(--ink);
  transform: translateX(-1px);
  transition: left var(--med) var(--ease), opacity var(--med) var(--ease);
}

.ruler-needle::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink);
}

.ruler-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 500;
}

.ruler-ends .human {
  color: var(--blue);
}

.ruler-ends .ai {
  color: var(--red);
}

.file-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 26px 0 18px;
  border-bottom: 1px solid var(--hairline);
}

.file-btn {
  position: relative;
  padding: 10px 0;
  border: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-2);
  transition: color var(--fast) var(--ease);
}

.file-btn:hover {
  color: var(--ink);
}

.file-btn[aria-selected="true"] {
  color: var(--blue);
}

.file-btn[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--blue);
}

/* Flat borderless code lines with left margin annotations */
.code-lines {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
}

.code-line {
  display: grid;
  grid-template-columns: 120px 36px minmax(0, 1fr);
  padding: 2px 0;
}

.code-line[data-tone="red"] {
  background: var(--red-tint);
}

.code-line[data-tone="blue"] {
  background: var(--blue-tint);
}

.cl-note {
  padding-right: 12px;
  text-align: right;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-3);
  border-right: 1px solid var(--margin-rule);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-line[data-tone="red"] .cl-note {
  color: var(--red);
}

.code-line[data-tone="blue"] .cl-note {
  color: var(--blue);
}

.cl-num {
  padding: 0 10px;
  text-align: right;
  color: var(--ink-3);
  user-select: none;
}

.cl-src {
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Commit Graph inside Workbench */
.cg-filters {
  display: flex;
  gap: 20px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
}

.cg-rows {
  display: flex;
  flex-direction: column;
}

.cg-row {
  display: grid;
  grid-template-columns: 52px 76px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  text-align: left;
  transition: background-color var(--fast) var(--ease);
}

.cg-row:hover {
  background: var(--surface-hover);
}

.cg-row[aria-selected="true"] {
  background: var(--surface-tint);
}

.cg-sha {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-3);
}

.cg-row[data-flagged="true"] .cg-sha {
  color: var(--red);
}

.cg-msg {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

.cg-sub {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

/* ---- Standard Editorial Sections -------------------------------------------------------- */

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

.section-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px 64px;
  align-items: end;
  margin-bottom: clamp(40px, 5vw, 64px);
}

.section-title {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.25rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.036em;
  color: var(--ink);
}

.section-sub {
  margin: 0;
  max-width: 520px;
  font-size: 17px;
  line-height: 1.56;
  color: var(--ink-2);
}

/* ---- Guarantees: Pure Architectural Ruled Table (Zero Cards) ---------------------------- */

.guarantees {
  border-top: 1px solid var(--ink);
}

.g-row {
  display: grid;
  grid-template-columns: minmax(200px, 0.7fr) minmax(0, 1.3fr) minmax(240px, 0.85fr);
  gap: 16px 44px;
  padding: 36px 0;
  border-bottom: 1px solid var(--hairline);
  align-items: start;
}

.g-title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.g-body {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
}

.g-proof {
  padding-left: 16px;
  border-left: 2px solid var(--blue);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

.g-proof[data-tone="red"] {
  border-left-color: var(--red);
}

.g-proof .accent-blue {
  color: var(--blue);
  font-weight: 500;
}

.g-proof .accent-red {
  color: var(--red);
  font-weight: 500;
}

/* ---- Agents Directory (Flat Band, Zero Cards) ------------------------------------------- */

.agents-list {
  border-top: 1px solid var(--ink);
}

.agent-row {
  display: grid;
  grid-template-columns: minmax(175px, 0.52fr) minmax(0, 1.05fr) minmax(420px, 1.05fr);
  gap: 16px 36px;
  padding: 30px 12px;
  margin: 0 -12px;
  border-bottom: 1px solid var(--hairline);
  align-items: start;
  transition: background-color var(--fast) var(--ease);
}

.agent-row:hover {
  background: var(--surface-tint);
}

.agent-name {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.agent-meta {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-3);
}

.agent-meta .live {
  color: var(--blue);
  font-weight: 500;
}

.agent-desc {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.58;
  color: var(--ink-2);
}

.agent-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.agent-cmd {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hairline-strong);
}

.agent-cmd code {
  font-size: 12.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}

.agent-doc {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--blue);
  text-decoration: none;
}

.agent-doc:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- Local Web UI Showcase (Clean Full-Width, Zero Fake Chrome) ------------------------- */

.ui-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 40px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--hairline);
}

.ui-head-copy {
  padding-bottom: 20px;
}

.ui-head-copy p {
  margin: 10px 0 0;
  font-size: 16px;
  color: var(--ink-2);
}

.ui-figure {
  margin: 0;
}

.ui-shot {
  width: 100%;
  height: auto;
  border: 1px solid var(--hairline);
  background: #121211;
}

.ui-caption {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 14px;
  color: var(--ink-2);
}

.ui-caption code {
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ---- Run It Anywhere (Google Docs-style left rail + flat code surface) ------------------ */

.run-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 32px 56px;
  align-items: start;
}

.run-rail {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--hairline);
}

.run-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 14px 0 14px 20px;
  border: 0;
  background: transparent;
  text-align: left;
  transition: color var(--fast) var(--ease);
}

.run-item-name {
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.run-item-sub {
  font-size: 13px;
  color: var(--ink-3);
}

.run-item:hover .run-item-name {
  color: var(--ink);
}

.run-item[aria-selected="true"]::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--blue);
}

.run-item[aria-selected="true"] .run-item-name {
  color: var(--blue);
}

.code-surface {
  min-width: 0;
  background: transparent;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--hairline);
}

.code-surface-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-3);
}

.code-surface pre {
  margin: 0;
  padding: 24px 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  font-size: 13.5px;
  line-height: 1.72;
  color: var(--ink);
}

.code-surface .c-cm {
  color: var(--ink-3);
}

.code-surface .c-kw {
  color: var(--blue);
  font-weight: 500;
}

.code-surface .c-str {
  color: var(--red);
}

.code-surface-note {
  padding: 14px 0 16px;
  border-top: 1px solid var(--hairline);
  font-size: 14px;
  color: var(--ink-2);
}

/* ---- Closing & Footer ------------------------------------------------------------------- */

.closing {
  max-width: 1520px;
  padding: clamp(128px, 16vw, 220px) clamp(24px, 4.5vw, 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 36px;
}

.closing h2 {
  margin: 0;
  font-size: clamp(2.4rem, 4.8vw, 3.85rem);
  font-weight: 400;
  letter-spacing: -0.038em;
  line-height: 1.06;
}

.closing .hero-actions {
  margin-top: 0;
  justify-content: center;
}

.closing-meta {
  margin: -14px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-3);
}

.closing-meta a {
  color: var(--ink-2);
  text-decoration: none;
  transition: color var(--fast) var(--ease);
}

.closing-meta a:hover {
  color: var(--blue);
}

.footer {
  border-top: 1px solid var(--hairline);
  padding: 32px 0 44px;
  font-size: 13.5px;
  color: var(--ink-2);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.footer-links a {
  text-decoration: none;
  color: var(--ink-2);
  transition: color var(--fast) var(--ease);
}

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

/* ---- Responsive (Tablets & Phones) ------------------------------------------------------ */

@media (max-width: 1140px) {
  .agent-row {
    grid-template-columns: minmax(180px, 0.44fr) minmax(0, 1fr);
    gap: 14px 36px;
  }

  .agent-right {
    grid-column: 2;
    align-items: flex-start;
  }

  .agent-cmd {
    max-width: 520px;
  }
}

@media (max-width: 1020px) {
  .topbar-left {
    gap: 24px;
  }

  .nav {
    gap: 18px;
  }

  .wb-cmd {
    display: none;
  }

  .section-header,
  .wb-split,
  .run-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .g-row {
    grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.85fr);
    gap: 12px 32px;
  }

  .g-title {
    grid-column: 1 / -1;
  }

  .wb-stage {
    padding: 32px 0;
    border-right: 0;
    border-bottom: 1px solid var(--margin-rule);
  }

  .wb-margin {
    padding: 32px 0 40px;
  }

  .run-rail {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-left: 0;
    border-bottom: 1px solid var(--hairline);
    gap: 24px;
  }

  .run-item {
    padding: 14px 0;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .run-item-sub {
    display: none;
  }

  .run-item[aria-selected="true"]::before {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    height: 2px;
  }

  .ui-head {
    gap: 8px 32px;
  }

  .ui-head-copy {
    padding-bottom: 12px;
  }
}

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

  .agent-row {
    grid-template-columns: minmax(0, 1fr);
    margin: 0;
    padding: 24px 0;
    gap: 12px;
  }

  .agent-right {
    grid-column: 1;
  }

  .agent-cmd {
    max-width: none;
  }

  .hero {
    padding: 58px 0 48px;
  }

  .hero-title {
    font-size: clamp(2.85rem, 12.2vw, 3.85rem);
    line-height: 1.02;
    letter-spacing: -0.044em;
  }

  .hero-lead {
    margin-top: 20px;
    max-width: 34ch;
    font-size: 15px;
    line-height: 1.54;
  }

  .hero-actions {
    margin-top: 26px;
    gap: 10px;
  }

  .install-line {
    margin-top: 24px;
    gap: 10px;
    padding: 10px 0;
  }

  .install-line code {
    font-size: 12px;
  }

  .section {
    padding: 56px 0;
  }

  .section-header {
    gap: 14px;
    margin-bottom: 32px;
  }

  .section-sub {
    font-size: 15.5px;
  }

  .wb-cmd {
    display: none;
  }

  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 18px;
    width: 100%;
  }

  .tab-btn {
    font-size: 13.5px;
    padding: 15px 0;
    flex-shrink: 0;
  }

  .wb-stage {
    padding: 26px 0 28px;
  }

  .wb-margin {
    padding: 26px 0 32px;
  }

  .metric-strip {
    gap: 6px 16px;
    margin-bottom: 16px;
  }

  .metric-meta {
    font-size: 12.5px;
  }

  .chart-stage {
    margin-bottom: 24px;
  }

  .story-prose {
    font-size: 1.06rem;
    line-height: 1.62;
  }

  .export-line {
    margin-top: 20px;
    gap: 6px 14px;
    font-size: 12px;
  }

  .margin-top,
  .margin-foot {
    flex-wrap: wrap;
    gap: 6px 12px;
  }

  .file-switch {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 18px;
    margin: 22px 0 16px;
  }

  .file-btn {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .ruler-ends {
    font-size: 11.5px;
    gap: 12px;
  }

  .g-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 28px 0;
  }

  .g-body {
    font-size: 15px;
  }

  .agent-row:hover {
    background: transparent;
  }

  .agent-desc {
    font-size: 15px;
  }

  .agent-cmd code {
    font-size: 12px;
  }

  .ui-head-copy p {
    font-size: 15px;
  }

  .ui-caption {
    font-size: 13.5px;
  }

  .run-rail {
    gap: 18px;
  }

  .run-item-name {
    font-size: 14px;
  }

  .code-surface pre {
    padding: 18px 0;
    font-size: 12px;
    line-height: 1.65;
  }

  .closing {
    padding: 96px 28px;
    gap: 28px;
  }

  .closing h2 {
    font-size: clamp(1.85rem, 6.6vw, 2.45rem);
    max-width: 17ch;
    text-wrap: balance;
    line-height: 1.12;
  }

  .footer {
    padding: 32px 0 40px;
  }

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

  .footer-links {
    gap: 10px 18px;
  }
}

@media (max-width: 520px) {
  .wrap {
    padding: 0 22px;
  }

  .closing {
    padding: 88px 28px;
    gap: 26px;
  }

  .closing-meta {
    margin-top: -10px;
    flex-direction: column;
    gap: 6px;
  }

  .closing-sep {
    display: none;
  }

  .btn {
    height: 42px;
    padding: 0 18px;
    font-size: 14px;
  }

  .tabs {
    gap: 14px;
  }

  .tab-btn {
    font-size: 13px;
  }

  /* Fold the code margin above its line on small phones, matching margin's design rules */
  .code-line {
    grid-template-columns: 28px minmax(0, 1fr);
    padding: 4px 0;
    font-size: 11.5px;
  }

  .cl-note {
    grid-column: 1 / -1;
    border-right: 0;
    text-align: left;
    padding: 0 0 2px 28px;
    font-size: 11px;
  }

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

  .cl-num {
    padding: 0 8px 0 0;
  }

  .cg-row {
    grid-template-columns: 44px 62px minmax(0, 1fr);
    gap: 8px;
    padding: 12px 4px;
  }

  .cg-msg {
    font-size: 14px;
  }
}

@media (max-width: 350px) {
  .hero-actions .btn,
  .closing .hero-actions .btn {
    width: 100%;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
