/* OpenFactory — openfactory.digital
   Design system: near-black ink, white, three grays. Inter for text,
   a monospace stack for anything that is a literal command. No color
   beyond the brand's own — credibility here comes from precision, not decoration. */

:root {
  --ink: #0B0F14;
  --ink-soft: #1A2029;
  --white: #FFFFFF;
  --gray-100: #F5F5F5;
  --gray-200: #E9EBEE;
  --gray-300: #D1D5DB;
  --gray-500: #6B7280;
  --gray-600: #4B5563;

  --font-sans: "Inter", Arial, Helvetica, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;

  --max: 1120px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 96px;

  --radius: 6px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
}

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

a {
  color: inherit;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

/* ---------- Type scale ---------- */

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 { font-size: clamp(2.1rem, 4vw, 3.4rem); line-height: 1.12; }
h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.2; }
h3 { font-size: 1.15rem; line-height: 1.35; }

p {
  margin: 0;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-600);
}

.lede {
  font-size: 1.15rem;
  color: var(--gray-600);
  max-width: 62ch;
}

.lede p + p {
  margin-top: var(--space-2);
}

.section-head {
  max-width: 68ch;
  margin-bottom: var(--space-4);
}

.section-head .eyebrow {
  margin-bottom: var(--space-2);
  display: block;
}

.section-head p {
  margin-top: var(--space-2);
  color: var(--gray-600);
  font-size: 1.05rem;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--white);
}

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

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--gray-300);
}

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

.btn svg { width: 16px; height: 16px; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--gray-200);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

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

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--gray-600);
  transition: color 0.15s ease;
}

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

.nav-links {
  display: flex;
}

.nav-cta {
  display: flex;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

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

.hero {
  position: relative;
  padding: var(--space-6) 0 var(--space-5);
  overflow: hidden;
  border-bottom: 1px solid var(--gray-200);
}

.hero::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 420px;
  height: 420px;
  background-image: radial-gradient(var(--gray-300) 1.6px, transparent 1.6px);
  background-size: 24px 24px;
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(circle, black, transparent 72%);
  mask-image: radial-gradient(circle, black, transparent 72%);
}

.hero .container {
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-5);
  align-items: center;
}

.hero-copy .eyebrow {
  margin-bottom: var(--space-2);
}

.hero-copy h1 {
  margin-bottom: var(--space-3);
}

.hero-copy .lede {
  margin-bottom: var(--space-4);
}

.hero-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.hero-badges {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
  border-radius: 999px;
  padding: 5px 12px;
}

/* A badge that is a link, not a claim. A test count typed here would be a number with a second
   home; docs/STATUS.md is its only one, so the badge points at it instead of repeating it. */
a.badge {
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

a.badge:hover {
  border-color: var(--gray-500);
  color: var(--ink);
}

/* ---------- Terminal / code blocks ---------- */

.terminal {
  background: var(--ink);
  color: #E7EAEE;
  border-radius: 10px;
  padding: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  overflow-x: auto;
  box-shadow: 0 20px 50px -20px rgba(11, 15, 20, 0.45);
}

.terminal .label {
  display: block;
  color: #8A93A3;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-1);
}

.terminal pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* The prompt is decoration and must never land in the clipboard: these blocks carry the install
   one-liner, and a pasted "$ curl …" is a command that fails. Generated content is copied by
   some engines (Chromium has done so for years) and excluded by others; `user-select: none` is
   what makes the answer the same everywhere. */
.terminal .cmd::before {
  content: "$ ";
  color: #6EE7B7;
  user-select: none;
  -webkit-user-select: none;
}

.terminal .out {
  color: #8A93A3;
}

.code-block {
  margin: var(--space-2) 0 0;
}

.code-block .label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  margin-bottom: 6px;
  display: block;
}

.code-block pre {
  background: var(--ink);
  color: #E7EAEE;
  border-radius: 8px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  overflow-x: auto;
  margin: 0;
}

.code-block pre .cmd::before {
  content: "$ ";
  color: #6EE7B7;
  user-select: none;
  -webkit-user-select: none;
}

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

section {
  padding: var(--space-6) 0;
}

section + section {
  border-top: 1px solid var(--gray-200);
}

.section-muted {
  background: var(--gray-100);
}

/* The header is sticky and 72px tall, so a bare `#install` jump parks the heading underneath it.
   openfactory.digital/#install is a link people paste; it has to land on something readable. */
section[id] {
  scroll-margin-top: 88px;
}

/* ---------- Install block ---------- */

.install-table a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gray-300);
  text-underline-offset: 2px;
}

.install-table td:first-child {
  white-space: nowrap;
  color: var(--gray-600);
}

/* The "read it first" command is one long token; it breaks visually so the row fits, and a soft
   break puts no character in the clipboard — what is copied is still one line. */
.install-table td code {
  overflow-wrap: anywhere;
}

/* Carried word for word from the core README. Set apart the way the README sets them apart,
   because a reader who finds these on Hacker News first should find them here first too. */
.install-note {
  max-width: 78ch;
  margin: var(--space-3) 0 0;
  padding-left: var(--space-2);
  border-left: 2px solid var(--gray-300);
  color: var(--gray-600);
  font-size: 0.95rem;
}

.install-after {
  max-width: 78ch;
  margin-top: var(--space-3);
  font-size: 0.9rem;
  color: var(--gray-600);
}

#install .code-block {
  margin-top: var(--space-3);
}

/* The one-liner is 53 characters and a 320px phone gives a code block 272px of room: left to the
   default `.code-block` rules it would sit in a sideways scroller, i.e. the most important string
   on the page half-hidden on the device most likely to meet it first. Wrapping is what `.terminal
   pre` already does. A soft wrap puts no character into the selection, so the command still
   copies as one line — measured, not assumed. */
#install .code-block pre,
.cta-band .code-block pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- Technical page intro (how-it-works.html) ---------- */

.tech-hero {
  padding: var(--space-5) 0 var(--space-4);
  border-bottom: 1px solid var(--gray-200);
}

.back-link {
  display: inline-block;
  margin-bottom: var(--space-3);
  font-size: 0.88rem;
  color: var(--gray-600);
  text-decoration: none;
}

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

.tech-hero .eyebrow {
  display: block;
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
}

.tech-hero h1 {
  margin-bottom: var(--space-2);
}

.tech-hero .lede {
  max-width: 68ch;
}

/* ---------- Autonomy: the tech-lead's risk boundary ---------- */

.incident-box {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-left: 3px solid var(--ink);
  border-radius: 6px;
  padding: var(--space-3);
}

.incident-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  margin-bottom: var(--space-2);
}

.incident-box p {
  color: var(--gray-600);
  font-size: 0.95rem;
}

.incident-box p + p {
  margin-top: var(--space-2);
}

.incident-box strong {
  color: var(--ink);
}

.autonomy-table td:first-child {
  white-space: nowrap;
}

.autonomy-cols {
  margin-top: var(--space-4);
}

.autonomy-cols h3 {
  margin-bottom: var(--space-2);
}

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

.never-list li {
  position: relative;
  padding-left: 18px;
  color: var(--gray-600);
  font-size: 0.95rem;
}

.never-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
}

.auth-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--gray-200);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: var(--space-4);
}

.auth-step {
  background: var(--white);
  padding: var(--space-3);
}

.auth-step-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: var(--gray-100);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 10px;
}

.auth-step p {
  color: var(--gray-600);
  font-size: 0.88rem;
}

/* ---------- Product media (video + screenshots) ---------- */

.media-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: var(--ink);
  border: 1px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.media-video.placeholder {
  background:
    radial-gradient(var(--ink-soft) 1.6px, transparent 1.6px) 0 0 / 22px 22px,
    var(--ink);
}

.media-video video,
.media-video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-video .media-video-static {
  display: none;
}

.placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--gray-300);
  text-align: center;
  padding: var(--space-3);
}

.play-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-badge svg {
  width: 18px;
  height: 18px;
  fill: var(--white);
  margin-left: 2px;
}

.placeholder-inner .placeholder-title {
  font-weight: 600;
  color: var(--white);
  font-size: 0.98rem;
}

.placeholder-inner .placeholder-note {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--gray-500);
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.screenshot-placeholder {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  border: 1px dashed var(--gray-300);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.screenshot-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screenshot-placeholder .placeholder-label {
  text-align: center;
  padding: var(--space-2);
  font-size: 0.82rem;
  color: var(--gray-500);
}

.screenshot-placeholder .placeholder-label strong {
  display: block;
  color: var(--gray-600);
  font-size: 0.86rem;
  margin-bottom: 4px;
}

/* ---------- Integrations: hub-and-spoke SVG diagram ---------- */

.diagram-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.diagram-figure {
  margin: 0;
}

.diagram-figure svg {
  display: block;
}

/* Two-panel comparison: side by side on desktop, stacked on narrow screens. */

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  align-items: start;
}

.compare-panel {
  min-width: 0;
}

.compare-panel svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 460px;
}

.compare-caption {
  margin-top: var(--space-3);
  font-size: 0.88rem;
  color: var(--gray-600);
  max-width: 68ch;
}

.dev-footnote {
  margin-top: var(--space-4);
  font-size: 0.9rem;
  color: var(--gray-600);
}

.dev-footnote a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gray-300);
  text-underline-offset: 2px;
}

.diagram-figure figcaption {
  margin-top: var(--space-2);
  font-size: 0.88rem;
  color: var(--gray-600);
  max-width: 68ch;
}

.diagram-figure figcaption em {
  color: var(--ink);
  font-style: normal;
  font-weight: 600;
}

.dg-box {
  fill: var(--white);
  stroke: var(--gray-300);
  stroke-width: 1;
}

.dg-box-hub {
  stroke: var(--ink);
  stroke-width: 1.5;
}

.dg-eyebrow {
  fill: var(--gray-500);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.dg-hr {
  stroke: var(--gray-200);
  stroke-width: 1;
}

.dg-icon {
  fill: var(--ink);
}

.dg-row-label {
  fill: var(--gray-600);
  font-family: var(--font-sans);
  font-size: 13px;
}

.dg-hub-title {
  fill: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.dg-hub-sub {
  fill: var(--gray-500);
  font-family: var(--font-sans);
  font-size: 11px;
}

.dg-pill {
  fill: var(--gray-100);
  stroke: var(--gray-200);
  stroke-width: 1;
}

.dg-pill-human {
  fill: var(--ink);
  stroke: var(--ink);
}

.dg-pill-text.dg-pill-human-text {
  fill: var(--white);
  font-weight: 600;
}

.dg-pill-text {
  fill: var(--gray-600);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
}

.dg-line {
  stroke: var(--gray-500);
  stroke-width: 1.5;
  fill: none;
}

.dg-line-observe {
  stroke: var(--gray-500);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  fill: none;
}

.dg-line-label {
  fill: var(--gray-600);
  font-family: var(--font-sans);
  font-size: 10.5px;
}

.dg-arrowhead {
  fill: var(--gray-500);
}

/* Capacity diagram: isolated lanes vs one shared line */

.dg-lane {
  stroke-dasharray: 5 4;
}

.dg-tether {
  stroke: var(--gray-500);
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
  fill: none;
}

.dg-foot {
  fill: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
}

.dg-foot-sub {
  fill: var(--gray-500);
  font-family: var(--font-sans);
  font-size: 11.5px;
}

.pipeline-branches {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.branch-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: var(--space-3);
}

.branch-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  margin-bottom: 6px;
}

.branch-card h3 {
  margin-bottom: 6px;
}

.branch-card p {
  color: var(--gray-600);
  font-size: 0.92rem;
}

.branch-card a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gray-300);
  text-underline-offset: 2px;
}

/* ---------- Roles ---------- */

.roles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.role-card {
  border-top: 2px solid var(--ink);
  padding-top: var(--space-2);
  min-width: 0;
}

.role-card h3 {
  margin-bottom: var(--space-2);
}

.role-card p {
  color: var(--gray-600);
  font-size: 0.95rem;
}

/* ---------- Token efficiency: without/with comparison ---------- */

.token-compare {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: var(--space-3) var(--space-3) var(--space-2);
  margin: var(--space-3) 0;
}

.token-compare-legend {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: 0.8rem;
  color: var(--gray-600);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.legend-without {
  background: var(--gray-300);
}

.legend-with {
  background: var(--ink);
}

.token-metric {
  margin-bottom: var(--space-3);
}

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

.token-metric-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}

.token-delta {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 999px;
  padding: 2px 10px;
}

/* The measure that did not move. Muted rather than red: +1.1% on wall-clock is a NULL result, not
   a regression, and colouring it as a failure would overstate it in the opposite direction from
   the one this block exists to correct. */
.token-delta-null {
  color: var(--gray-500);
  background: var(--gray-100);
  border-color: var(--gray-200);
  font-weight: 600;
}

.token-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}

.token-bar-track {
  flex: 1;
  height: 10px;
  background: var(--white);
  border-radius: 5px;
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.token-bar-fill {
  height: 100%;
  border-radius: 5px;
}

.fill-without {
  background: var(--gray-300);
}

.fill-with {
  background: var(--ink);
}

/* 54px fitted "20.5" and "$0.52". The measured medians are wider — "75,175" and "3,309 s" — and a
   value column that wraps turns a bar chart into a ragged list. */
.token-bar-value {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--gray-600);
  width: 64px;
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
}

/* The null result reads as prose, not as a caveat — it is a finding, and it sits above the
   sample-size line rather than inside it. */
.token-compare-null {
  margin: var(--space-3) 0 0;
  font-size: 0.9rem;
  color: var(--gray-600);
  max-width: 68ch;
}

.token-compare-caveat {
  margin-top: var(--space-1);
  font-size: 0.84rem;
  color: var(--gray-500);
}

.token-compare-caveat a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gray-300);
  text-underline-offset: 2px;
}

/* ---------- Claim blocks (proof section) ---------- */

.claim {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: var(--space-3);
  padding: var(--space-4) 0;
}

.claim > div,
.hero-grid > *,
.two-col > * {
  min-width: 0;
}

.claim + .claim {
  border-top: 1px solid var(--gray-200);
}

.claim-index {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--gray-300);
  font-weight: 700;
}

.claim h3 {
  margin-bottom: var(--space-2);
}

.claim p {
  color: var(--gray-600);
  max-width: 72ch;
}

.claim p + p {
  margin-top: var(--space-2);
}

.claim-note {
  margin-top: var(--space-2);
  font-size: 0.92rem;
  color: var(--gray-600);
  border-left: 2px solid var(--gray-300);
  padding-left: var(--space-2);
}

.claim-note strong {
  color: var(--ink);
}

/* The axis paragraph links out to docs/STATUS.md instead of typing a count; without this the
   link inherits `a { color: inherit }` and reads as plain body text. */
.claim > div > p a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gray-300);
  text-underline-offset: 2px;
}

.claim-note a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gray-300);
  text-underline-offset: 2px;
}

#numbers .claim-note {
  margin-top: var(--space-3);
}

.numbers-footnote {
  margin-top: var(--space-3);
  font-size: 0.84rem;
  color: var(--gray-500);
}

.numbers-footnote a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gray-300);
  text-underline-offset: 2px;
}

.numbers-footnote code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 1px 6px;
}

.table-source {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--gray-500);
}

.table-source code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 1px 6px;
}

.table-scroll {
  overflow-x: auto;
  margin-top: var(--space-2);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 480px;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--gray-200);
}

th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  font-weight: 600;
}

td {
  color: var(--gray-600);
}

td code, p code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 1px 6px;
}

/* ---------- Feature grid (what makes it different) ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.feature {
  border-top: 2px solid var(--ink);
  padding-top: var(--space-2);
}

.feature h3 {
  margin-bottom: var(--space-2);
}

.feature p {
  color: var(--gray-600);
  font-size: 0.95rem;
}

.feature .quote {
  display: block;
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink);
  background: var(--gray-100);
  border-radius: 6px;
  padding: 10px 12px;
}

/* ---------- Numbers ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--gray-200);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat {
  background: var(--white);
  padding: var(--space-3);
}

.stat .value {
  font-family: var(--font-mono);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat .label {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--gray-600);
}

/* ---------- Limits ---------- */

.limits-intro {
  max-width: 72ch;
  color: var(--gray-600);
  margin-bottom: var(--space-3);
}

.limits-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--gray-200);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.limits-list li {
  background: var(--white);
  padding: var(--space-3);
  color: var(--gray-600);
  font-size: 0.95rem;
}

.limits-list strong {
  color: var(--ink);
}

/* ---------- Extending ---------- */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  align-items: start;
}

.two-col p {
  color: var(--gray-600);
}

.two-col p + p {
  margin-top: var(--space-2);
}

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--ink);
  color: var(--white);
}

.cta-band .container {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.cta-band h2 {
  color: var(--white);
}

.cta-band p {
  color: var(--gray-300);
  max-width: 56ch;
}

.cta-band .btn-secondary {
  border-color: rgba(255,255,255,0.3);
  color: var(--white);
}

.cta-band .btn-secondary:hover {
  border-color: var(--white);
}

.cta-band .btn-primary {
  background: var(--white);
  color: var(--ink);
}

.cta-band .btn-primary:hover {
  background: var(--gray-100);
}

/* `.container` here is a centred flex column, so a flex item sizes to its content — an unbounded
   `pre` would push the page wider than the viewport. The width cap is what keeps the one-liner
   scrolling inside its own box instead of scrolling the document. The band is already ink, so the
   block lifts one step rather than disappearing into it. */
.cta-band .code-block {
  width: 100%;
  max-width: 640px;
  margin-top: 0;
}

.cta-band .code-block pre {
  background: var(--ink-soft);
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-align: left;
}

.cta-band .code-block .label {
  color: var(--gray-500);
}

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

.site-footer {
  background: var(--ink);
  color: var(--gray-300);
  padding: var(--space-5) 0 var(--space-4);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
  font-size: 1.05rem;
}

.footer-brand img { width: 24px; height: 24px; }

.footer-tagline {
  margin-top: var(--space-2);
  max-width: 40ch;
  font-size: 0.9rem;
  color: var(--gray-300);
}

.footer-links {
  display: flex;
  gap: var(--space-5);
}

.footer-col h4 {
  color: var(--white);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--gray-300);
}

.footer-col a {
  text-decoration: none;
  color: var(--gray-300);
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

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

.footer-bottom {
  padding-top: var(--space-3);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--gray-500);
  font-family: var(--font-mono);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

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

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

  .two-col {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .roles-grid {
    grid-template-columns: 1fr;
  }

  .compare-grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 16px 28px -18px rgba(11, 15, 20, 0.25);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.22s ease;
  }

  .site-nav.is-open {
    max-height: 480px;
    visibility: visible;
  }

  .nav-links {
    display: flex;
  }

  .nav-links ul {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 14px var(--space-3);
    border-bottom: 1px solid var(--gray-100);
    font-size: 1rem;
  }

  .nav-cta {
    padding: var(--space-3);
  }

  .nav-cta .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .media-video .media-video-motion {
    display: none;
  }

  .media-video .media-video-static {
    display: block;
  }

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

  .pipeline-branches {
    grid-template-columns: 1fr;
  }

  .auth-strip {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .claim {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }

  .footer-links {
    flex-wrap: wrap;
    row-gap: var(--space-3);
    column-gap: var(--space-4);
  }

  section {
    padding: var(--space-5) 0;
  }
}
