/* ferryGL website. One stylesheet for the home page and the documentation. */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f5f8fb;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --border: #e2e8ef;
  --border-strong: #cdd7e2;
  --text: #0c2137;
  --text-muted: #45566b;
  --text-subtle: #66778c;
  --link: #0a7c6c;
  --brand: #24d5bb;
  --brand-soft: rgba(36, 213, 187, 0.12);
  --navy: #0c2137;
  --accent-from: #0a7c6c;
  --accent-to: #0b6aa6;
  --code-bg: #f2f5f9;
  --code-text: #17304d;
  --term-bg: #0c2137;
  --term-border: rgba(255, 255, 255, 0.08);
  --button-bg: #0c2137;
  --button-text: #ffffff;
  --button-hover: #183453;
  --header-bg: rgba(255, 255, 255, 0.82);
  --shadow-sm: 0 1px 2px rgba(12, 33, 55, 0.06);
  --shadow-md: 0 1px 2px rgba(12, 33, 55, 0.05), 0 8px 24px -8px rgba(12, 33, 55, 0.12);
  --shadow-lg: 0 2px 4px rgba(12, 33, 55, 0.04), 0 24px 64px -16px rgba(12, 33, 55, 0.28);
  --grid-line: rgba(12, 33, 55, 0.05);

  --status-todo: #8592a3;
  --status-progress: #e2a336;
  --status-review: #1fa37a;
  --status-done: #4f72e8;
  --status-canceled: #8592a3;

  --hl-comment: #66778c;
  --hl-string: #0a7c6c;
  --hl-entity: #7a3cc8;
  --hl-constant: #1d63c2;
  --hl-keyword: #c2185b;
  --hl-variable: #0c2137;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "SF Mono", "JetBrains Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --radius: 14px;
  --radius-sm: 8px;
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #07111d;
    --bg-soft: #0a1726;
    --surface: #0c1a2b;
    --surface-2: #10223a;
    --border: #1b2f47;
    --border-strong: #2a4262;
    --text: #e7eef6;
    --text-muted: #a5b4c6;
    --text-subtle: #8194aa;
    --link: #3ddcc4;
    --brand-soft: rgba(36, 213, 187, 0.12);
    --accent-from: #3ddcc4;
    --accent-to: #6bd1fc;
    --code-bg: #0b1828;
    --code-text: #d5e2ef;
    --term-bg: #081523;
    --term-border: rgba(255, 255, 255, 0.09);
    --button-bg: #24d5bb;
    --button-text: #062019;
    --button-hover: #4fe0ca;
    --header-bg: rgba(7, 17, 29, 0.78);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 64px -16px rgba(0, 0, 0, 0.7);
    --grid-line: rgba(255, 255, 255, 0.04);
    --status-todo: #8d9bad;
    --status-canceled: #8d9bad;
    --status-done: #7b95ff;
    --hl-comment: #8194aa;
    --hl-string: #6be3cf;
    --hl-entity: #c6a5ff;
    --hl-constant: #7cc4ff;
    --hl-keyword: #ff7ab2;
    --hl-variable: #e7eef6;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07111d;
  --bg-soft: #0a1726;
  --surface: #0c1a2b;
  --surface-2: #10223a;
  --border: #1b2f47;
  --border-strong: #2a4262;
  --text: #e7eef6;
  --text-muted: #a5b4c6;
  --text-subtle: #8194aa;
  --link: #3ddcc4;
  --brand-soft: rgba(36, 213, 187, 0.12);
  --accent-from: #3ddcc4;
  --accent-to: #6bd1fc;
  --code-bg: #0b1828;
  --code-text: #d5e2ef;
  --term-bg: #081523;
  --term-border: rgba(255, 255, 255, 0.09);
  --button-bg: #24d5bb;
  --button-text: #062019;
  --button-hover: #4fe0ca;
  --header-bg: rgba(7, 17, 29, 0.78);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 64px -16px rgba(0, 0, 0, 0.7);
  --grid-line: rgba(255, 255, 255, 0.04);
  --status-todo: #8d9bad;
  --status-canceled: #8d9bad;
  --status-done: #7b95ff;
  --hl-comment: #8194aa;
  --hl-string: #6be3cf;
  --hl-entity: #c6a5ff;
  --hl-constant: #7cc4ff;
  --hl-keyword: #ff7ab2;
  --hl-variable: #e7eef6;
}

/* Base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

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

a {
  color: var(--link);
  text-decoration: none;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

[id] {
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 600;
}

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

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.site-header.is-scrolled,
body[data-page="docs"] .site-header {
  border-bottom-color: var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}

body[data-page="docs"] .header-inner {
  max-width: 1440px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.brand:hover {
  text-decoration: none;
}

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

.brand-gl {
  color: var(--brand);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.site-nav a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.94rem;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--bg-soft);
  text-decoration: none;
}

body[data-page="docs"] .site-nav .nav-docs {
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.icon-button:hover {
  color: var(--text);
  background: var(--bg-soft);
  text-decoration: none;
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: block;
  }

  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: none;
  }
}

.menu-toggle {
  display: none;
}

@media (max-width: 760px) {
  .menu-toggle {
    display: inline-grid;
  }

  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 12px 16px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 10px 12px;
  }

  .header-actions {
    margin-left: auto;
  }
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.97rem;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.button:hover {
  text-decoration: none;
}

.button svg {
  width: 18px;
  height: 18px;
}

.button-primary {
  background: var(--button-bg);
  color: var(--button-text);
}

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

.button-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--text-subtle);
}

/* Home: hero */

.hero {
  position: relative;
  overflow: hidden;
  padding: 88px 0 96px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 40%, transparent 100%);
}

.hero::after {
  content: "";
  position: absolute;
  z-index: -2;
  top: -240px;
  right: -160px;
  width: 760px;
  height: 760px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(36, 213, 187, 0.22), rgba(107, 209, 252, 0.1) 55%, transparent);
  filter: blur(8px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: center;
  gap: 56px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 5px 12px 5px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.badge:hover {
  text-decoration: none;
  border-color: var(--border-strong);
}

.badge-tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--link);
  font-weight: 700;
  font-size: 0.78rem;
}

.hero h1 {
  margin: 0 0 22px;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.accent {
  background: linear-gradient(100deg, var(--accent-from), var(--accent-to));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  margin: 0 0 32px;
  max-width: 34em;
  color: var(--text-muted);
  font-size: 1.18rem;
  line-height: 1.65;
}

.install {
  max-width: 460px;
  margin-bottom: 28px;
}

.install-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.install-tabs button {
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-subtle);
  font: 500 0.85rem var(--font-mono);
  cursor: pointer;
}

.install-tabs button:hover {
  color: var(--text);
}

.install-tabs button[aria-selected="true"] {
  background: var(--bg-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}

.command {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 8px 0 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-mono);
  font-size: 0.98rem;
}

.command .prompt {
  color: var(--text-subtle);
  user-select: none;
}

.command code {
  flex: 1;
  font-size: inherit;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.copy-button {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-subtle);
  cursor: pointer;
}

.copy-button:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.copy-button svg {
  width: 18px;
  height: 18px;
}

.copy-button .icon-check,
.copy-button.is-copied .icon-copy {
  display: none;
}

.copy-button.is-copied .icon-check {
  display: block;
  color: var(--link);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-subtle);
  font-size: 0.9rem;
}

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

.hero-meta svg {
  width: 16px;
  height: 16px;
  color: var(--link);
}

/* Terminal and issue card */

.hero-visual {
  position: relative;
  padding-bottom: 100px;
}

.terminal {
  overflow: hidden;
  border: 1px solid var(--term-border);
  border-radius: var(--radius);
  background: var(--term-bg);
  box-shadow: var(--shadow-lg);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.terminal-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.terminal-bar p {
  margin: 0 auto;
  padding-right: 46px;
  color: rgba(255, 255, 255, 0.42);
  font: 500 0.78rem var(--font-mono);
}

.terminal pre {
  margin: 0;
  padding: 20px 20px 24px;
  overflow-x: auto;
  color: #b9cadc;
  font-size: 0.75rem;
  line-height: 1.85;
}

.t-prompt {
  color: var(--brand);
  user-select: none;
}

.t-cmd {
  color: #ffffff;
  font-weight: 600;
}

.t-dim {
  color: #7d92aa;
}

.t-ok {
  color: var(--brand);
}

.issue-card {
  position: absolute;
  right: -12px;
  bottom: 0;
  width: min(330px, 86%);
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.issue-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: var(--text-subtle);
  font: 600 0.78rem var(--font-mono);
}

.issue-card h3 {
  margin: 0 0 12px;
  font-size: 0.98rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.issue-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
}

.chip svg {
  width: 13px;
  height: 13px;
}

/* Status pills, drawn as small circles in the style of a workflow state */

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.status::before {
  content: "";
  flex: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid currentColor;
  color: var(--dot);
}

.status-todo {
  --dot: var(--status-todo);
}

.status-progress {
  --dot: var(--status-progress);
}

.status-progress::before {
  background: linear-gradient(90deg, transparent 50%, currentColor 50%);
}

.status-review {
  --dot: var(--status-review);
}

.status-review::before {
  background: conic-gradient(currentColor 0 75%, transparent 75% 100%);
}

.status-done {
  --dot: var(--status-done);
}

.status-done::before {
  background: currentColor;
  box-shadow: inset 0 0 0 2px var(--surface);
}

.status-canceled {
  --dot: var(--status-canceled);
}

.status-canceled::before {
  border-style: dashed;
}

/* Sections */

.section {
  padding: 104px 0;
}

.section-soft {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

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

.section-head.left {
  margin-left: 0;
  text-align: left;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--link);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section h2 {
  margin: 0 0 16px;
  font-size: clamp(1.85rem, 3.4vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.section-head p:not(.eyebrow) {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

/* Why */

.why-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
}

.why-grid .section-head {
  margin-bottom: 0;
}

.why-grid .section-head p + p {
  margin-top: 16px;
}

.why-list {
  display: grid;
  gap: 14px;
}

.why-item {
  display: flex;
  gap: 16px;
  padding: 20px 22px;
}

.why-item h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.why-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.why-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text-subtle);
}

.why-icon svg {
  width: 19px;
  height: 19px;
}

.why-item.is-answer {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  background: linear-gradient(135deg, var(--brand-soft), transparent 70%), var(--surface);
}

.why-item.is-answer .why-icon {
  background: var(--brand);
  color: #062019;
}

/* What it does */

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

.feature {
  padding: 28px;
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 20px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--link);
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature h3 {
  margin: 0 0 8px;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
}

.feature p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.97rem;
}

/* Status rules */

.status-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.card-title {
  margin: 0;
  padding: 20px 24px 0;
  font-size: 1.05rem;
}

.card-sub {
  margin: 4px 0 0;
  padding: 0 24px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.mapping {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.mapping li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 128px;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}

.mapping .arrow {
  width: 16px;
  height: 16px;
  color: var(--text-subtle);
}

.card-foot {
  margin: 0;
  padding: 14px 24px 18px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.timeline {
  margin: 16px 0 0;
  padding: 0 24px 8px;
  list-style: none;
}

.timeline li {
  position: relative;
  padding: 0 0 22px 34px;
}

.timeline li::before {
  content: counter(list-item);
  position: absolute;
  left: 0;
  top: 1px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--navy);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
}

:root[data-theme="dark"] .timeline li::before {
  background: var(--brand);
  color: #062019;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .timeline li::before {
    background: var(--brand);
    color: #062019;
  }
}

.timeline li::after {
  content: "";
  position: absolute;
  left: 10.5px;
  top: 28px;
  bottom: 4px;
  width: 1px;
  background: var(--border-strong);
}

.timeline li:last-child::after {
  display: none;
}

.timeline p {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.timeline strong {
  color: var(--text);
}

/* How it works */

.flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1.15fr) 72px minmax(0, 1fr);
  align-items: center;
  margin-bottom: 48px;
}

.flow-node {
  padding: 22px 22px 20px;
  text-align: center;
}

.flow-node.is-center {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--border));
  box-shadow: 0 0 0 4px var(--brand-soft), var(--shadow-md);
}

.flow-logo {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--text);
}

.flow-logo svg {
  width: 24px;
  height: 24px;
}

.flow-logo img {
  width: 48px;
  height: 48px;
}

.flow-node h3 {
  margin: 0 0 4px;
  font-size: 1.02rem;
}

.flow-node p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.flow-link {
  position: relative;
  height: 2px;
  margin: 0 6px;
  background: repeating-linear-gradient(90deg, var(--border-strong) 0 6px, transparent 6px 12px);
}

.flow-link::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -4px;
  border: 5px solid transparent;
  border-left: 7px solid var(--border-strong);
  border-right: 0;
}

.flow-link span {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  color: var(--text-subtle);
  font: 600 0.7rem var(--font-mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.steps-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps-4 li {
  padding: 24px;
  counter-increment: step;
}

.steps-4 li::before {
  content: "0" counter(step);
  display: block;
  margin-bottom: 14px;
  color: var(--link);
  font: 700 0.85rem var(--font-mono);
}

.steps-4 h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
}

.steps-4 p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.93rem;
}

.note {
  max-width: 760px;
  margin: 40px auto 0;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.97rem;
}

/* Safety */

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

.safety-grid .feature {
  padding: 26px;
}

.safety-grid code,
.feature code,
.steps-4 code,
.timeline code,
.mapping code,
.why-item code,
.qs-step p code,
.limits code {
  padding: 0.1em 0.38em;
  border-radius: 5px;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 0.86em;
}

/* Quick start */

.quickstart {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: qs;
}

.qs-step {
  display: flex;
  flex-direction: column;
  padding: 24px;
  counter-increment: qs;
}

.qs-step h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.qs-step h3::before {
  content: counter(qs);
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--link);
  font-size: 0.85rem;
  font-weight: 800;
}

.qs-step > p {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.code-block {
  position: relative;
}

.code-block pre {
  margin: 0;
  padding: 16px 52px 16px 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 0.84rem;
  line-height: 1.7;
}

.code-block .copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: var(--code-bg);
}

.code-block .copy-button:hover {
  background: var(--surface);
}

.c-prompt {
  color: var(--text-subtle);
  user-select: none;
}

.c-comment {
  color: var(--hl-comment);
}

.c-key {
  color: var(--hl-variable);
}

.c-table {
  color: var(--hl-entity);
}

.c-string {
  color: var(--hl-string);
}

.c-num {
  color: var(--hl-constant);
}

.section-cta {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

/* Docs teaser */

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

.doc-card {
  display: block;
  padding: 22px 24px;
  color: inherit;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.doc-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  transform: translateY(-2px);
}

.doc-card h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 6px;
  font-size: 1.02rem;
}

.doc-card h3 svg {
  width: 16px;
  height: 16px;
  color: var(--text-subtle);
  transition: transform 0.15s ease;
}

.doc-card:hover h3 svg {
  color: var(--link);
  transform: translateX(3px);
}

.doc-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.93rem;
}

.limits {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 32px;
  margin-top: 56px;
  padding: 28px 32px;
}

.limits h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.limits > div > p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.limits ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.limits li {
  display: flex;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.limits li svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  color: var(--text-subtle);
}

/* Closing call to action */

.cta-band {
  position: relative;
  overflow: hidden;
  padding: 64px 48px;
  border-radius: 20px;
  background: var(--navy);
  color: #ffffff;
  text-align: center;
}

.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 240px at 15% 0%, rgba(36, 213, 187, 0.28), transparent 70%),
    radial-gradient(600px 260px at 90% 100%, rgba(107, 209, 252, 0.22), transparent 70%);
}

.cta-band > * {
  position: relative;
}

.cta-band h2 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  letter-spacing: -0.03em;
}

.cta-band p {
  margin: 0 auto 28px;
  max-width: 34em;
  color: #b9cadc;
  font-size: 1.08rem;
}

.cta-band .cta-row {
  justify-content: center;
  margin: 0;
}

.cta-band .button-primary {
  background: var(--brand);
  color: #062019;
}

.cta-band .button-primary:hover {
  background: #4fe0ca;
}

.cta-band .button-secondary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.cta-band .button-secondary:hover {
  border-color: rgba(255, 255, 255, 0.6);
}

/* Footer */

.site-footer {
  padding: 56px 0 40px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
  gap: 40px;
}

.footer-brand p {
  max-width: 26em;
  margin: 14px 0 0;
}

.footer-col h2 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.footer-col ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col a {
  color: var(--text-muted);
}

.footer-col a:hover {
  color: var(--text);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-subtle);
  font-size: 0.85rem;
}

.footer-bottom p {
  margin: 0;
}

/* Documentation layout */

.docs-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 220px;
  gap: 48px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

.docs-sidebar {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 32px 0 40px;
}

.docs-sidebar h2,
.docs-toc h2 {
  margin: 0 0 10px;
  padding: 0 12px;
  color: var(--text-subtle);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docs-sidebar ul,
.docs-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-sidebar a {
  display: block;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.94rem;
  font-weight: 500;
}

.docs-sidebar a:hover {
  background: var(--bg-soft);
  color: var(--text);
  text-decoration: none;
}

.docs-sidebar a[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--link);
  font-weight: 600;
}

.sidebar-links {
  margin-top: 28px !important;
  padding-top: 20px !important;
  border-top: 1px solid var(--border);
}

.sidebar-links a {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-links svg {
  width: 15px;
  height: 15px;
}

.docs-main {
  min-width: 0;
  padding: 40px 0 72px;
}

.docs-toc {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 40px 0;
}

.docs-toc a {
  display: block;
  padding: 4px 12px;
  border-left: 1px solid var(--border);
  color: var(--text-subtle);
  font-size: 0.85rem;
  line-height: 1.45;
}

.docs-toc a:hover {
  color: var(--text);
  text-decoration: none;
}

.docs-toc .toc-3 a {
  padding-left: 24px;
}

.docs-toc a.is-active {
  border-left-color: var(--brand);
  color: var(--link);
  font-weight: 600;
}

.docs-menu {
  display: none;
}

.page-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.page-foot .edit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-subtle);
}

.page-foot .edit svg {
  width: 15px;
  height: 15px;
}

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.pager a {
  display: block;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
}

.pager a:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.pager span {
  display: block;
  margin-bottom: 2px;
  color: var(--text-subtle);
  font-size: 0.8rem;
  font-weight: 500;
}

.pager .next {
  grid-column: 2;
  text-align: right;
}

@media (max-width: 1200px) {
  .docs-layout {
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 40px;
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 900px) {
  .docs-layout {
    display: block;
    padding: 0 16px;
  }

  .docs-menu {
    position: sticky;
    top: var(--header-h);
    z-index: 40;
    display: block;
    margin: 0 -16px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--header-bg);
    backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
  }

  .docs-menu button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: 600 0.9rem var(--font-sans);
    cursor: pointer;
  }

  .docs-menu svg {
    width: 16px;
    height: 16px;
  }

  .docs-sidebar {
    position: static;
    display: none;
    max-height: none;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
  }

  .docs-sidebar.is-open {
    display: block;
  }

  .docs-main {
    padding-top: 28px;
  }
}

/* Rendered Markdown */

.prose {
  max-width: 780px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.72;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  position: relative;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.prose h1 {
  margin: 0 0 20px;
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.prose h1 + p {
  color: var(--text-muted);
  font-size: 1.12rem;
}

.prose h2 {
  margin: 56px 0 16px;
  padding-top: 8px;
  font-size: 1.55rem;
  font-weight: 750;
}

.prose h3 {
  margin: 36px 0 12px;
  font-size: 1.2rem;
  font-weight: 700;
}

.prose h4 {
  margin: 28px 0 10px;
  font-size: 1.02rem;
}

.prose .anchor {
  margin-left: 8px;
  color: var(--text-subtle);
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.prose .anchor::before {
  content: "#";
}

.prose h2:hover .anchor,
.prose h3:hover .anchor,
.prose h4:hover .anchor,
.prose .anchor:focus-visible {
  opacity: 1;
  text-decoration: none;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose .table-wrap,
.prose .highlight,
.prose > pre {
  margin: 0 0 18px;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose li {
  margin: 6px 0;
}

.prose li > p {
  margin: 0 0 10px;
}

.prose li::marker {
  color: var(--text-subtle);
}

.prose strong {
  font-weight: 650;
}

.prose a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent);
  text-underline-offset: 3px;
}

.prose a:hover {
  text-decoration-color: currentColor;
}

.prose :not(pre) > code {
  padding: 0.12em 0.4em;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.prose a code {
  color: inherit;
}

.prose h2 code,
.prose h3 code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: 0.92em;
}

.prose pre {
  position: relative;
  padding: 16px 52px 16px 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 0.85rem;
  line-height: 1.7;
}

.prose .highlight {
  position: relative;
}

.prose .highlight pre {
  margin: 0;
}

.prose .highlight .copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: var(--code-bg);
}

.prose .highlight .copy-button:hover {
  background: var(--surface);
}

.prose blockquote {
  padding: 4px 18px;
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 10px 10px 0;
  color: var(--text-muted);
}

.prose blockquote p {
  margin: 10px 0;
}

.prose hr {
  margin: 40px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.55;
}

.prose th,
.prose td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 650;
  white-space: nowrap;
}

.prose tr:last-child td {
  border-bottom: 0;
}

.prose td code {
  white-space: nowrap;
}

.prose td:last-child code {
  white-space: normal;
}

/* GitHub's syntax highlighting classes */

.pl-c {
  color: var(--hl-comment);
}

.pl-s,
.pl-pds,
.pl-sr {
  color: var(--hl-string);
}

.pl-en,
.pl-ent {
  color: var(--hl-entity);
}

.pl-c1,
.pl-v,
.pl-mi1 {
  color: var(--hl-constant);
}

.pl-k,
.pl-kos {
  color: var(--hl-keyword);
}

.pl-smi,
.pl-s1 {
  color: var(--hl-variable);
}

.highlight-text-shell-session pre {
  color: var(--text-muted);
}

.highlight-text-shell-session .pl-s1 {
  color: var(--text);
  font-weight: 600;
}

.highlight-text-shell-session .pl-c1 {
  color: var(--text-muted);
}

/* Run diagram (site/_runflow.html, drawn by main.js) */

.runflow {
  --runflow-step: var(--text-subtle);
  --runflow-read: var(--accent-to);
  --runflow-write: var(--status-progress);
  margin: 28px 0 32px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.runflow-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.runflow-play {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: 600 0.86rem/1.2 var(--font-sans);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}

.runflow-play:hover {
  border-color: var(--brand);
}

.runflow-play:focus-visible,
.runflow-switch input:focus-visible + .runflow-switch-track {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.runflow-play svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

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

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

.runflow-play[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.runflow-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.86rem;
  cursor: pointer;
}

.runflow-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.runflow-switch-track {
  position: relative;
  flex: none;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background-color 0.2s ease;
}

.runflow-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.runflow-switch input:checked + .runflow-switch-track {
  background: var(--brand);
}

.runflow-switch input:checked + .runflow-switch-track::after {
  transform: translateX(14px);
}

.prose .runflow-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
  color: var(--text-subtle);
  font-size: 0.8rem;
}

.prose .runflow-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.runflow-legend li::before {
  content: "";
  width: 16px;
  border-top: 2px dashed var(--runflow-step);
}

.runflow-legend .is-read::before {
  border-color: var(--runflow-read);
}

.runflow-legend .is-write::before {
  border-color: var(--runflow-write);
}

.runflow-canvas {
  padding: 14px 12px 6px;
}

.runflow-canvas svg {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  overflow: visible;
}

.runflow-canvas.is-narrow svg {
  max-width: 420px;
}

.runflow-group {
  fill: var(--brand-soft);
  fill-opacity: 0.35;
  stroke: var(--border-strong);
  stroke-dasharray: 4 5;
}

.runflow-group-label {
  fill: var(--text-subtle);
  font: 600 11px var(--font-mono);
}

.runflow-node {
  cursor: pointer;
  outline: none;
  transition: opacity 0.2s ease;
}

.runflow-node rect {
  fill: var(--surface);
  stroke: var(--border-strong);
  stroke-width: 1.25;
  transition:
    fill 0.2s ease,
    stroke 0.2s ease,
    stroke-width 0.2s ease;
}

.runflow-node--external rect {
  fill: var(--surface-2);
}

.runflow-node:hover rect,
.runflow-node.is-current rect {
  fill: var(--brand-soft);
  stroke: var(--brand);
  stroke-width: 2;
}

.runflow-node:focus-visible rect {
  stroke: var(--link);
  stroke-width: 2.5;
}

.runflow-node-title {
  fill: var(--text);
  font: 700 15px var(--font-sans);
}

.runflow-node-sub {
  fill: var(--text-subtle);
  font: 500 12px var(--font-sans);
}

.runflow-badge circle {
  fill: var(--surface);
  stroke: var(--border-strong);
}

.runflow-badge text {
  fill: var(--text-muted);
  font: 700 10px var(--font-sans);
}

.runflow-node.is-current .runflow-badge circle {
  fill: var(--brand);
  stroke: var(--brand);
}

.runflow-node.is-current .runflow-badge text {
  fill: var(--navy);
}

.runflow-edge {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.runflow-edge-line {
  stroke: var(--runflow-step);
  stroke-width: 1.75;
  stroke-dasharray: 5 5;
  animation: runflow-dash 1.1s linear infinite;
  transition: stroke-width 0.2s ease;
}

.runflow-edge-head {
  fill: var(--runflow-step);
}

.runflow-edge--read .runflow-edge-line {
  stroke: var(--runflow-read);
}

.runflow-edge--read .runflow-edge-head {
  fill: var(--runflow-read);
}

.runflow-edge--write .runflow-edge-line {
  stroke: var(--runflow-write);
}

.runflow-edge--write .runflow-edge-head {
  fill: var(--runflow-write);
}

.runflow-edge:hover .runflow-edge-line,
.runflow-edge.is-related .runflow-edge-line {
  stroke-width: 2.75;
}

.runflow-edge-hit {
  stroke: transparent;
  stroke-width: 18;
  pointer-events: stroke;
}

.runflow-edge-label {
  fill: var(--text-muted);
  font: 500 11.5px var(--font-sans);
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 4px;
  stroke-linejoin: round;
}

@keyframes runflow-dash {
  to {
    stroke-dashoffset: -10;
  }
}

.runflow.has-focus .runflow-node:not(.is-related),
.runflow.has-focus .runflow-edge:not(.is-related) {
  opacity: 0.25;
}

.runflow-node.is-off rect {
  stroke-dasharray: 4 4;
}

.runflow-node.is-off,
.runflow-edge.is-off {
  opacity: 0.4;
}

.runflow-edge.is-off .runflow-edge-line {
  animation: none;
}

.runflow-packet {
  fill: var(--brand);
  stroke: var(--surface);
  stroke-width: 2;
}

.runflow-packet--read {
  fill: var(--runflow-read);
}

.runflow-packet--write {
  fill: var(--runflow-write);
}

.runflow-panel {
  min-height: 148px;
  padding: 14px 18px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
  line-height: 1.6;
}

.runflow-panel.is-fresh {
  animation: runflow-fade 0.25s ease;
}

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

.prose .runflow-panel p {
  margin: 0 0 8px;
  color: var(--text-muted);
}

.prose .runflow-panel .runflow-title {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 700;
}

.prose .runflow-panel .runflow-hint {
  margin: 0;
  color: var(--text-subtle);
}

.runflow-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.prose .runflow-panel .runflow-kicker {
  margin-bottom: 6px;
}

.runflow-kicker span {
  margin-right: 4px;
  color: var(--link);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.prose .runflow-kicker code {
  font-size: 0.76rem;
}

.prose .runflow-panel .runflow-off {
  color: var(--status-progress);
  font-weight: 600;
}

.runflow-io {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 14px;
  margin: 8px 0 0;
  font-size: 0.86rem;
}

.runflow-io dt {
  color: var(--text);
  font-weight: 650;
}

.runflow-io dd {
  margin: 0;
  color: var(--text-muted);
}

.prose .runflow-noscript {
  margin: 0;
  padding: 0 18px 16px;
  color: var(--text-subtle);
}

@media (max-width: 640px) {
  .prose .runflow-legend {
    margin-left: 0;
  }

  .runflow-panel {
    min-height: 0;
    padding: 12px 14px 14px;
  }
}

/* Responsive */

@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
  }

  .hero-copy {
    text-align: center;
  }

  .lead,
  .install {
    margin-left: auto;
    margin-right: auto;
  }

  .install-tabs,
  .cta-row,
  .hero-meta {
    justify-content: center;
  }

  .install .command {
    text-align: left;
  }

  .hero-visual {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
  }

  .issue-card {
    right: -24px;
  }

  .steps-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }

  .flow-link {
    width: 2px;
    height: 48px;
    margin: 6px auto;
    background: repeating-linear-gradient(180deg, var(--border-strong) 0 6px, transparent 6px 12px);
  }

  .flow-link::after {
    right: -4px;
    top: auto;
    bottom: -2px;
    border: 5px solid transparent;
    border-top: 7px solid var(--border-strong);
    border-bottom: 0;
  }

  .flow-link span {
    left: 14px;
    bottom: 50%;
    transform: translateY(50%);
  }
}

@media (max-width: 900px) {
  .why-grid,
  .status-grid,
  .limits {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .steps-3,
  .safety-grid,
  .docs-grid,
  .quickstart {
    grid-template-columns: minmax(0, 1fr);
  }

  .safety-grid,
  .docs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }

  .hero {
    padding: 56px 0 64px;
  }

  .hero-copy {
    text-align: left;
  }

  .install-tabs,
  .cta-row,
  .hero-meta {
    justify-content: flex-start;
  }

  .lead {
    font-size: 1.08rem;
  }

  .section {
    padding: 72px 0;
  }

  .section-head {
    margin-bottom: 40px;
  }

  .steps-4,
  .safety-grid,
  .docs-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-visual {
    padding-bottom: 0;
  }

  .issue-card {
    position: relative;
    right: auto;
    width: auto;
    margin: -24px 12px 0;
  }

  .mapping li {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 14px 18px;
  }

  .mapping .arrow {
    display: none;
  }

  .card-title,
  .card-sub {
    padding-left: 18px;
    padding-right: 18px;
  }

  .card-foot,
  .timeline {
    padding-left: 18px;
    padding-right: 18px;
  }

  .limits {
    padding: 24px;
  }

  .cta-band {
    padding: 48px 24px;
  }

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

  .pager .next {
    grid-column: 1;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .runflow-edge-line,
  .runflow-panel.is-fresh {
    animation: none;
  }
}
