/* Realtime Fetch design system.
   Identity: cobalt signal colour, lime "live" accent, warm paper, an engineering-grid frame,
   and monospace data labels. One light theme by design. */

@font-face { font-family: "Geist"; src: url("/fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Departure Mono"; src: url("/fonts/departure-mono.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  color-scheme: light;
  --ink: #0b0d12;
  --ink-2: #3a3f4b;
  --ink-3: #737886;
  --paper: #f4f3ee;
  --panel: #fbfaf7;
  --line: rgba(11, 13, 18, 0.12);
  --line-strong: rgba(11, 13, 18, 0.22);
  --signal: #1b3bff;
  --signal-deep: #1029c9;
  --signal-tint: #e4e8ff;
  --live: #c8ff2e;
  --warn: #b45309;
  --warn-tint: #fdf1dc;
  --bad: #c0261c;
  --bad-tint: #fde8e5;
  --ok: #0f7a3d;
  --ok-tint: #e2f6e9;
  --night: #0b0d12;
  --night-2: #151925;
  --night-line: rgba(255, 255, 255, 0.12);
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --pixel: "Departure Mono", "Geist Mono", ui-monospace, monospace;
  --frame: 1180px;
  --gutter: clamp(18px, 4vw, 44px);
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--signal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--signal-deep); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--live); color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
[hidden] { display: none !important; }

h1, h2, h3 { font-weight: 500; letter-spacing: -0.025em; line-height: 1.08; margin: 0 0 0.6em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); letter-spacing: -0.04em; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.9rem); letter-spacing: -0.035em; }
h3 { font-size: 1.2rem; line-height: 1.25; letter-spacing: -0.015em; }
p { margin: 0 0 1em; text-wrap: pretty; }
code, pre, kbd { font-family: var(--mono); font-size: 0.875em; }
:not(pre) > code { background: rgba(11, 13, 18, 0.06); border: 1px solid var(--line); border-radius: 5px; padding: 0.08em 0.36em; white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.accent { color: var(--signal); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--ink); color: #fff; padding: 0.6rem 1rem; }
.skip:focus { left: 0; }

/* ---------- Frame: the two vertical rails every section sits between ---------- */
.wrap {
  position: relative;
  width: min(var(--frame), 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: clamp(16px, 3.4vw, 48px);
  border-inline: 1px solid var(--line);
}
.wrap.narrow > * { max-width: 46rem; }
.wrap.narrow.center > * { margin-inline: auto; }

/* Crosshair marks where a horizontal rule meets the rails. */
.rule { position: relative; border-top: 1px solid var(--line); }
.rule > .wrap::before, .rule > .wrap::after {
  content: ""; position: absolute; top: -6px; width: 11px; height: 11px; pointer-events: none;
  background:
    linear-gradient(var(--tick, var(--ink)), var(--tick, var(--ink))) center / 11px 1px no-repeat,
    linear-gradient(var(--tick, var(--ink)), var(--tick, var(--ink))) center / 1px 11px no-repeat;
}
.rule > .wrap::before { left: -6px; }
.rule > .wrap::after { right: -6px; }

/* ---------- Header ---------- */
.site-header { position: relative; z-index: 20; border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: inherit; text-decoration: none; font-weight: 500; font-size: 1.06rem; letter-spacing: -0.02em; }
.brand:hover { color: inherit; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand b { font-weight: 500; opacity: 0.55; }
.mark-bg { fill: var(--ink); }
.mark-fg { fill: var(--live); }
.home .site-header .mark-bg { fill: #fff; }
.home .site-header .mark-fg { fill: var(--signal); }
.nav { display: flex; align-items: center; gap: clamp(0.9rem, 2.4vw, 2rem); font-size: 0.94rem; }
.nav a { color: inherit; text-decoration: none; opacity: 0.78; }
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; }
.nav a.btn { opacity: 1; }
.nav a.btn-primary { color: #fff; }
.nav-gh { display: inline-flex; align-items: center; gap: 0.4rem; }
.nav-gh svg { flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 46px; padding: 0 1.15rem; border-radius: var(--radius);
  border: 1px solid transparent; font: 500 0.97rem/1 var(--sans); letter-spacing: -0.01em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn-sm { min-height: 36px; padding: 0 0.85rem; font-size: 0.88rem; border-radius: 8px; }
.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16) inset, 0 6px 16px -8px rgba(11, 13, 18, 0.6); }
.btn-primary:hover { background: var(--signal); color: #fff; }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); background: rgba(11, 13, 18, 0.04); }
.btn-danger { background: transparent; color: var(--bad); border-color: rgba(192, 38, 28, 0.4); }
.btn-danger:hover { background: var(--bad-tint); color: var(--bad); }
.btn .arrow { font-family: var(--mono); transition: transform 0.15s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }
.error-text { color: var(--bad); font-size: 0.9rem; margin: 0.8rem 0 0; }
p.wrap.error-text { padding-block: 0.8rem; margin: 0 auto; background: var(--bad-tint); }

/* ---------- Labels ---------- */
.eyebrow, .marker, .label { font: 500 0.72rem/1 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; }
.eyebrow { color: var(--signal); margin: 0 0 1.1rem; display: flex; align-items: center; gap: 0.55rem; }
.eyebrow::before { content: ""; width: 7px; height: 7px; background: currentColor; }
.center > .eyebrow, .eyebrow.center { justify-content: center; }

/* Section marker strip: "01 / 05  PIPELINE ............ readout" */
.marker-strip { border-bottom: 1px solid var(--line); margin-inline: calc(-1 * clamp(16px, 3.4vw, 48px)); padding: 0 clamp(16px, 3.4vw, 48px); display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 54px; color: var(--ink-3); }
.marker { display: inline-flex; align-items: center; gap: 0.7rem; }
.marker i { font-style: normal; color: var(--signal); }
.marker i::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 0.6rem; background: var(--signal); }
.marker em { font-style: normal; opacity: 0.6; }
.marker span { color: var(--ink); }
.readout { font: 400 0.72rem/1 var(--mono); letter-spacing: 0.04em; text-align: right; }
@media (max-width: 640px) { .readout { display: none; } }

.section-body { padding-block: clamp(3.2rem, 7vw, 6rem); }
.section-head { max-width: 46rem; margin: 0 auto clamp(2.2rem, 4vw, 3.4rem); text-align: center; }
.section-head p { color: var(--ink-2); font-size: 1.08rem; margin: 0 auto; max-width: 36rem; }
.section-head.left { margin-inline: 0; text-align: left; }
.section-head.left p { margin-inline: 0; }

/* ---------- Code ---------- */
.code { background: var(--night); color: #e9ebf2; border-radius: var(--radius); overflow: hidden; margin: 1.1rem 0; border: 1px solid var(--night); box-shadow: 0 18px 40px -28px rgba(11, 13, 18, 0.7); }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 40px; padding: 0 0.6rem 0 1rem; border-bottom: 1px solid var(--night-line); font: 500 0.7rem/1 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: #8f95a6; }
.code pre { margin: 0; padding: 1rem 1.1rem 1.15rem; overflow-x: auto; font-size: 0.82rem; line-height: 1.7; tab-size: 2; }
.code pre code { font-size: inherit; }
.copy-btn { font: 500 0.68rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: #c9cedb; background: transparent; border: 1px solid var(--night-line); border-radius: 6px; padding: 0.42rem 0.6rem; cursor: pointer; }
.copy-btn:hover { color: var(--night); background: var(--live); border-color: var(--live); }
.tk-k { color: var(--live); }
.tk-s { color: #a9b8ff; }
.tk-c { color: #7c8294; }
.tk-n { color: #ffcf8a; }

/* ---------- Hero (home) ---------- */
.hero { position: relative; background: var(--signal); color: #fff; overflow: hidden; isolation: isolate; }
.home .site-header { position: absolute; inset: 0 0 auto; background: transparent; color: #fff; border-bottom-color: rgba(255, 255, 255, 0.18); }
.home .site-header .wrap, .hero .wrap { border-inline-color: rgba(255, 255, 255, 0.16); }
.home .site-header .btn-primary { background: #fff; color: var(--ink); }
.home .site-header .btn-primary:hover { background: var(--live); }
.home .site-header :focus-visible { outline-color: var(--live); }
.hero .btn-primary { background: #fff; color: var(--ink); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.55); }
.hero .btn-primary:hover { background: var(--live); color: var(--ink); }
.hero .btn-secondary { color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.hero .btn-secondary:hover { background: rgba(255, 255, 255, 0.1); border-color: #fff; color: #fff; }
.hero :focus-visible { outline-color: var(--live); }
.field-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero-body { position: relative; z-index: 2; text-align: center; padding-block: calc(68px + clamp(3.4rem, 8vw, 6.5rem)) clamp(2.6rem, 5vw, 4rem); }
.hero-body > * { margin-inline: auto; }
.pill { display: inline-flex; align-items: center; gap: 0.55rem; font: 500 0.72rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; border: 1px solid rgba(255, 255, 255, 0.32); border-radius: 999px; padding: 0.5rem 0.85rem; margin-bottom: 1.8rem; background: rgba(16, 41, 201, 0.55); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 rgba(200, 255, 46, 0.7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(200, 255, 46, 0); } 100% { box-shadow: 0 0 0 0 rgba(200, 255, 46, 0); } }
.hero h1 { max-width: 15ch; margin-bottom: 1.4rem; }
.hero h1 em { font-style: normal; color: var(--live); }
@media (min-width: 760px) { .hero h1 { max-width: 20ch; } .hero h1 em { display: block; } }
.hero .lead { max-width: 34rem; font-size: clamp(1.05rem, 1.6vw, 1.2rem); line-height: 1.55; color: rgba(255, 255, 255, 0.88); margin-bottom: 2rem; }
.hero .btn-row { justify-content: center; }
.hero .error-text { color: #fff; background: rgba(192, 38, 28, 0.85); display: inline-block; padding: 0.5rem 0.8rem; border-radius: 8px; }
.hero-note { font: 400 0.76rem/1.5 var(--mono); letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.75); margin: 1.5rem auto 0; }
.hero-note b { color: var(--live); font-weight: 500; }

/* The console sits half on the hero colour, half on the paper below. */
.hero-console { position: relative; padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.hero-console::after { content: ""; position: absolute; inset: 45% 0 0; background: var(--paper); z-index: -1; border-top: 1px solid rgba(255, 255, 255, 0.16); }
.hero-console .wrap { border-inline-color: transparent; }
.console { max-width: 60rem; margin-inline: auto; background: var(--night); color: #e9ebf2; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 40px 80px -40px rgba(4, 10, 60, 0.9), 0 0 0 6px rgba(255, 255, 255, 0.07); overflow: hidden; text-align: left; font-family: var(--mono); }
.console-bar { display: flex; align-items: center; gap: 0.9rem; padding: 0 1rem; min-height: 44px; border-bottom: 1px solid var(--night-line); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: #8f95a6; }
.console-bar .method { color: var(--night); background: var(--live); padding: 0.22rem 0.42rem; border-radius: 4px; font-weight: 600; }
.console-bar .tag { margin-left: auto; }
.console-url { display: flex; align-items: center; gap: 0.8rem; padding: 0.95rem 1rem; border-bottom: 1px solid var(--night-line); font-size: 0.9rem; min-height: 54px; overflow: hidden; white-space: nowrap; }
.console-url .k { color: #7c8294; }
.caret { display: inline-block; width: 8px; height: 1.1em; background: var(--live); vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.console-grid { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); min-height: 18.5rem; }
.tiers { list-style: none; margin: 0; padding: 0; border-right: 1px solid var(--night-line); }
.tiers li { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.7rem; padding: 0.95rem 1rem; border-bottom: 1px solid var(--night-line); font-size: 0.78rem; color: #6d7386; transition: color 0.2s, background-color 0.2s; }
.tiers li:last-child { border-bottom: 0; }
.tiers .n { color: inherit; opacity: 0.7; }
.tiers .name { letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; }
.tiers .state { grid-column: 2; font-size: 0.72rem; min-height: 1.1em; }
.tiers li[data-state="run"] { color: #fff; background: rgba(27, 59, 255, 0.28); }
.tiers li[data-state="run"] .state::after { content: "▍"; animation: blink 0.7s steps(1) infinite; margin-left: 2px; }
.tiers li[data-state="miss"] { color: #b9bfce; }
.tiers li[data-state="miss"] .state { color: #ffb86b; }
.tiers li[data-state="hit"] { color: #fff; }
.tiers li[data-state="hit"] .state { color: var(--live); }
.tiers li[data-state="skip"] .state { opacity: 0.6; }
.console-out { display: flex; flex-direction: column; min-width: 0; }
.out-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--night-line); font-size: 0.72rem; color: #8f95a6; min-height: 2.6rem; }
.out-meta b { color: #fff; font-weight: 500; }
.out-meta .ok { color: var(--live); }
.console-out pre { margin: 0; padding: 1rem; font-size: 0.8rem; line-height: 1.65; white-space: pre-wrap; word-break: break-word; color: #d5d9e4; flex: 1; }
.console-out pre .h { color: #fff; font-weight: 600; }
.console-out pre .l { color: #a9b8ff; }
@media (max-width: 720px) {
  .console-grid { grid-template-columns: 1fr; min-height: 0; }
  .console-out pre { min-height: 13rem; }
  .tiers { display: grid; grid-template-columns: repeat(3, 1fr); border-right: 0; border-bottom: 1px solid var(--night-line); }
  .tiers li { border-bottom: 0; border-right: 1px solid var(--night-line); grid-template-columns: 1fr; padding: 0.7rem; }
  .tiers li:last-child { border-right: 0; }
  .tiers .state { grid-column: 1; }
  .console-bar .tag { display: none; }
}

/* ---------- Pipeline ---------- */
.pipeline { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.stage { position: relative; padding: 1.6rem 1.5rem 1.5rem; border-right: 1px solid var(--line); }
.stage:last-child { border-right: 0; }
.stage-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 2.2rem; }
.stage-n { font: 400 2.6rem/1 var(--pixel); color: var(--signal); }
.stage-when { font: 500 0.68rem/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); text-align: right; }
.stage h3 { margin-bottom: 0.5rem; }
.stage p { color: var(--ink-2); font-size: 0.96rem; margin-bottom: 1.4rem; }
.spec { margin: 0; border-top: 1px dashed var(--line-strong); font: 400 0.76rem/1.5 var(--mono); }
.spec div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px dashed var(--line-strong); }
.spec dt { color: var(--ink-3); }
.spec dd { margin: 0; text-align: right; }
/* The arrow between stages. */
.stage:not(:last-child)::after { content: "→"; position: absolute; right: -0.8rem; top: 1.75rem; z-index: 1; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 50%; font: 500 0.8rem/1 var(--mono); color: var(--signal); }
.output-strip { margin-top: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.9rem; padding: 1rem 1.25rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); font: 400 0.8rem/1.5 var(--mono); color: var(--ink-2); }
.output-strip b { color: var(--signal); font-weight: 500; }
.chip { display: inline-block; padding: 0.18rem 0.5rem; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--panel); color: var(--ink); font: 400 0.76rem/1.4 var(--mono); }
@media (max-width: 860px) {
  .pipeline { grid-template-columns: 1fr; }
  .stage { border-right: 0; border-bottom: 1px solid var(--line); }
  .stage:last-child { border-bottom: 0; }
  .stage-top { margin-bottom: 1.2rem; }
  .stage:not(:last-child)::after { content: "↓"; right: 1.5rem; top: auto; bottom: -0.8rem; }
}

/* ---------- Install picker ---------- */
.install { display: grid; grid-template-columns: minmax(0, 15.5rem) minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.install-nav { display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.install-nav button { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; width: 100%; min-height: 54px; padding: 0 1.2rem; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink-2); font: 500 0.98rem/1.2 var(--sans); letter-spacing: -0.01em; text-align: left; cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.install-nav button:last-child { border-bottom: 0; }
.install-nav button small { font: 500 0.64rem/1 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.install-nav button:hover { color: var(--ink); background: rgba(11, 13, 18, 0.04); }
.install-nav button[aria-selected="true"] { background: var(--ink); color: #fff; }
.install-nav button[aria-selected="true"] small { color: var(--live); }
.install-nav button:focus-visible { outline-offset: -3px; }
.install-pane { padding: clamp(1.3rem, 2.6vw, 2.1rem); min-width: 0; }
.install-pane h3 { font-size: 1.55rem; letter-spacing: -0.03em; line-height: 1.12; margin-bottom: 0.5rem; }
.install-pane > p { color: var(--ink-2); max-width: 40rem; }
.install-pane > p:last-child { margin-bottom: 0; }
.steps { list-style: none; counter-reset: step; margin: 1.5rem 0 1.2rem; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 1.25rem 3rem; color: var(--ink-2); min-width: 0; }
.steps > li:last-child { padding-bottom: 0; }
.steps > li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: -0.05rem; font: 400 1.25rem/1.3 var(--pixel); color: var(--signal); }
.steps > li::after { content: ""; position: absolute; left: 0.72rem; top: 1.9rem; bottom: 0.35rem; border-left: 1px dashed var(--line-strong); }
.steps > li:last-child::after { display: none; }
.steps strong { color: var(--ink); font-weight: 500; }
.steps .code { margin: 0.7rem 0 0; }
.steps .code pre { white-space: pre-wrap; word-break: break-word; }
.install-foot { margin: 1rem 0 0; font: 400 0.8rem/1.6 var(--mono); color: var(--ink-3); text-align: center; }
@media (max-width: 860px) {
  .install { grid-template-columns: 1fr; }
  .install-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .install-nav::-webkit-scrollbar { display: none; }
  .install-nav button { width: auto; flex: none; min-height: 48px; padding: 0 1rem; border-bottom: 0; border-right: 1px solid var(--line); }
  .install-nav button small { display: none; }
  .steps > li { padding-left: 2.5rem; }
}

/* ---------- Connect dropdown ---------- */
.connect { position: relative; }
.connect-toggle { gap: 0.6rem; padding-left: 0.6rem; }
.connect-icons { display: inline-flex; }
.connect-icons i, .tool-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--live); font: 500 0.6rem/1 var(--mono); font-style: normal; letter-spacing: 0.02em; flex: none; }
.connect-icons i { border: 2px solid var(--signal); margin-left: -9px; }
.connect-icons i:first-child { margin-left: 0; }
.connect-icons i:nth-child(2) { background: #fff; color: var(--ink); }
.connect-icons i:nth-child(3) { background: var(--live); color: var(--ink); }
.chev { width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 0.15s ease; margin-left: 0.15rem; }
.connect-toggle[aria-expanded="true"] .chev { transform: translateY(2px) rotate(225deg); }
.connect-menu { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 30; width: 17.5rem; max-width: calc(100vw - 2rem); margin: 0; padding: 0.4rem; list-style: none; text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 50px -18px rgba(4, 10, 60, 0.55), 0 2px 6px rgba(4, 10, 60, 0.12); }
.connect-menu a { display: flex; align-items: center; gap: 0.75rem; min-height: 46px; padding: 0 0.65rem; border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.98rem; }
.connect-menu a:hover, .connect-menu a:focus-visible { background: var(--signal-tint); color: var(--ink); outline: none; }
.connect-menu .go { margin-left: auto; font-family: var(--mono); color: var(--ink-3); }
.connect-menu a:hover .go { color: var(--signal); }
.connect-more { margin-top: 0.4rem; padding-top: 0.4rem; border-top: 1px solid var(--line); }
.connect-more .tool-ico { background: transparent; color: var(--ink-2); border: 1px solid var(--line-strong); font-size: 0.9rem; }
.install-nav .tool-ico { display: none; }

/* ---------- Integrations ---------- */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 900px) { .duo { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.3rem, 2.4vw, 1.9rem); display: flex; flex-direction: column; min-width: 0; }
.panel-tag { display: flex; align-items: center; justify-content: space-between; font: 500 0.7rem/1 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 1.5rem; }
.panel-tag span:first-child { color: var(--signal); }
.panel h3 { font-size: 1.55rem; letter-spacing: -0.03em; line-height: 1.12; }
.panel > p { color: var(--ink-2); }
.panel .code { margin-top: auto; }
.panel .code + .small { margin: 0.9rem 0 0; }
.term { font-family: var(--mono); }
.term pre { white-space: pre-wrap; word-break: break-word; }
.term .u { color: #fff; }
.term .sys { color: var(--live); }
.term .dim { color: #7c8294; }
.tabs { display: flex; gap: 0.15rem; }
.tabs button { font: 500 0.68rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: #8f95a6; background: transparent; border: 0; border-radius: 5px; padding: 0.45rem 0.6rem; cursor: pointer; }
.tabs button:hover { color: #fff; }
.tabs button[aria-selected="true"] { color: var(--night); background: #fff; }

/* ---------- Example video ---------- */
.showcase { margin: 0; }
.showcase video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--signal); border-radius: 14px; border: 1px solid var(--line-strong); box-shadow: 0 40px 80px -48px rgba(4, 10, 60, 0.7); }
.showcase figcaption { margin: 1rem auto 0; max-width: 44rem; text-align: center; font: 400 0.8rem/1.6 var(--mono); color: var(--ink-3); }

/* Example cards under the video. Each one jumps the video to its part. */
.examples { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.examples li { border-right: 1px solid var(--line); min-width: 0; }
.examples li:nth-child(4) { border-right: 0; }
.examples .example-wide { grid-column: 1 / -1; border-right: 0; border-top: 1px solid var(--line); }
.example { display: flex; flex-direction: column; gap: 0.8rem; width: 100%; height: 100%; padding: 1.2rem 1.25rem 1.1rem; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background-color 0.15s; }
.example:hover, .example[aria-pressed="true"] { background: var(--signal-tint); }
.example:focus-visible { outline-offset: -3px; }
.example-top { display: flex; justify-content: space-between; gap: 0.6rem; font: 500 0.68rem/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.example-top span:first-child { color: var(--ink); white-space: nowrap; }
.example-top span:last-child { text-align: right; }
.example-top i { font-style: normal; color: var(--signal); margin-right: 0.6rem; }
.example-prompt { font-size: 1.12rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.3; text-wrap: balance; }
.example-note { color: var(--ink-2); font-size: 0.9rem; line-height: 1.5; }
.example-play { margin-top: auto; padding-top: 0.4rem; font: 500 0.68rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--signal); }
.example-wide .example { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; align-items: baseline; gap: 0.5rem 1.5rem; }
.example-wide .example-top { grid-column: 1 / -1; }
.example-wide .example-play { margin: 0; padding: 0; }
@media (max-width: 980px) {
  .examples { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .examples li:nth-child(2) { border-right: 0; }
  .examples li:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .example-wide .example { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav-gh span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 560px) {
  .examples { grid-template-columns: 1fr; }
  .examples li { border-right: 0; }
  .examples li + li { border-top: 1px solid var(--line); }
}

/* ---------- Response anatomy ---------- */
.anatomy { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.anatomy .code { margin: 0; border-radius: 0; border: 0; box-shadow: none; }
.anatomy .code pre { font-size: 0.8rem; }
.fields { margin: 0; }
.fields div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; padding: 0.95rem 1.3rem; border-bottom: 1px solid var(--line); align-items: baseline; }
.fields div:last-child { border-bottom: 0; }
.fields dt { font: 500 0.8rem/1.5 var(--mono); color: var(--signal); }
.fields dd { margin: 0; font-size: 0.93rem; color: var(--ink-2); }
@media (max-width: 900px) { .anatomy { grid-template-columns: 1fr; } .fields div { grid-template-columns: 1fr; gap: 0.15rem; } }

/* ---------- Pricing ---------- */
.pricing { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.price-side { background: var(--night); color: #fff; padding: clamp(1.6rem, 3vw, 2.6rem); display: flex; flex-direction: column; position: relative; overflow: hidden; isolation: isolate; }
.price-side .label { color: var(--live); }
.price { font: 400 clamp(4rem, 9vw, 6.6rem)/0.95 var(--pixel); letter-spacing: -0.03em; margin: 1.6rem 0 0.6rem; color: #fff; }
.price small { display: block; font: 400 0.8rem/1.5 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: #9aa0b2; margin-top: 0.9rem; }
.calc { margin-top: auto; padding-top: 2rem; }
.calc label { display: flex; justify-content: space-between; font: 400 0.76rem/1.5 var(--mono); color: #9aa0b2; margin-bottom: 0.7rem; }
.calc output { color: #fff; }
.calc input[type="range"] { width: 100%; accent-color: var(--live); margin: 0; }
.calc-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px dashed var(--night-line); font: 400 0.76rem/1.5 var(--mono); color: #9aa0b2; }
.calc-total b { font: 400 1.9rem/1 var(--pixel); color: var(--live); }
.price-side .btn { margin-top: 1.6rem; background: var(--live); color: var(--night); width: 100%; }
.price-side .btn:hover { background: #fff; color: var(--night); }
.price-side .error-text { color: #ffb4ad; }
.ledger { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.ledger caption { text-align: left; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line); font: 500 0.7rem/1 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.ledger th, .ledger td { text-align: left; padding: 0.82rem 1.4rem; border-bottom: 1px solid var(--line); font-weight: 400; }
.ledger td { text-align: right; font: 500 0.8rem/1.5 var(--mono); white-space: nowrap; }
.ledger .charged td { color: var(--signal); }
.ledger .free td { color: var(--ok); }
.ledger-note { padding: 1.1rem 1.4rem; margin: 0; font-size: 0.86rem; color: var(--ink-3); }
@media (max-width: 900px) { .pricing { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
@media (max-width: 860px) { .faq-grid { grid-template-columns: 1fr; } }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.15rem 0; cursor: pointer; font-weight: 500; font-size: 1.04rem; letter-spacing: -0.015em; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.2rem/1 var(--mono); color: var(--signal); transition: transform 0.2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 2.5rem 1.2rem 0; color: var(--ink-2); }

/* ---------- Closing band + footer ---------- */
.band { position: relative; background: var(--night); color: #fff; overflow: hidden; isolation: isolate; --tick: rgba(255, 255, 255, 0.6); border-top-color: var(--night-line); }
.band .wrap { border-inline-color: var(--night-line); text-align: center; padding-block: clamp(4rem, 9vw, 7.5rem); }
.band h2 { font-size: clamp(2.2rem, 5.4vw, 4rem); max-width: 16ch; margin-inline: auto; }
.band h2 em { font-style: normal; color: var(--live); }
.band p { color: #b9bfce; max-width: 32rem; margin: 0 auto 2rem; font-size: 1.08rem; }
.band .btn-row { justify-content: center; }
.band .btn-primary { background: var(--live); color: var(--night); }
.band .btn-primary:hover { background: #fff; color: var(--night); }
.band .btn-secondary { color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.band .btn-secondary:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); color: #fff; }
.band .error-text { color: #ffb4ad; }

.site-footer { background: var(--night); color: #9aa0b2; border-top: 1px solid var(--night-line); font-size: 0.9rem; --tick: rgba(255, 255, 255, 0.6); }
.site-footer .wrap { border-inline-color: var(--night-line); padding-block: 2.6rem 0; }
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; }
.site-footer strong { color: #fff; font-weight: 500; }
.site-footer a { color: #d5d9e4; text-decoration: none; }
.site-footer a:hover { color: var(--live); }
.site-footer nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem 1.5rem; font: 400 0.8rem/1.5 var(--mono); align-content: start; }
.wordmark { font: 400 clamp(2.2rem, 10.2vw, 8rem)/0.8 var(--pixel); letter-spacing: -0.04em; color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.22); white-space: nowrap; overflow: hidden; margin: 2.2rem 0 0; padding-top: 0.2em; user-select: none; }
@media (max-width: 640px) { .footer-cols { grid-template-columns: 1fr; } }

/* ---------- Inner pages ---------- */
.page { padding-block: clamp(2.6rem, 6vw, 4.6rem) clamp(3.5rem, 7vw, 6rem); min-height: 60vh; }
.page h1, .docs h1 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); }
.page h2, .prose h2 { font-size: 1.55rem; letter-spacing: -0.03em; margin-top: 2.6rem; }
.page h3, .prose h3 { margin-top: 1.9rem; }
.lead { font-size: 1.14rem; color: var(--ink-2); }
.prose p, .prose li { color: var(--ink-2); }
.prose li { margin-bottom: 0.4rem; }
.prose strong { color: var(--ink); font-weight: 500; }

.docs { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); padding-block: clamp(2.4rem, 5vw, 4rem) clamp(3.5rem, 7vw, 6rem); align-items: start; }
.toc { position: sticky; top: 1.5rem; font: 400 0.8rem/1.5 var(--mono); border-left: 1px solid var(--line); max-height: calc(100vh - 3rem); overflow: auto; }
.toc h2 { font: 500 0.7rem/1 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 0.9rem; padding-left: 1rem; }
.toc ul, .toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 0.3rem 1rem; margin-left: -1px; border-left: 1px solid transparent; color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--signal); border-left-color: var(--signal); }
.toc ul ul a { padding-left: 1.8rem; }
.docs .prose h2 { padding-top: 2.2rem; margin-top: 2.6rem; border-top: 1px solid var(--line); }
.docs .prose h2:first-of-type { border-top: 0; padding-top: 0; }
@media (max-width: 860px) { .docs { grid-template-columns: 1fr; } .toc { position: static; max-height: none; } }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin: 1.2rem 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table-wrap th { text-align: left; font: 500 0.7rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); background: rgba(11, 13, 18, 0.03); }
.table-wrap th, .table-wrap td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap td { color: var(--ink-2); }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap td:first-child code { color: var(--signal); background: transparent; border: 0; padding: 0; }

.field { display: grid; gap: 0.45rem; margin-bottom: 1rem; max-width: 34rem; }
.field label { font: 500 0.7rem/1 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.field input { font: 400 0.95rem/1 var(--mono); min-height: 48px; padding: 0 0.9rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--panel); color: var(--ink); width: 100%; }
.field input:focus { outline: 2px solid var(--signal); outline-offset: 1px; border-color: var(--signal); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); margin: 1.2rem 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.stat { padding: 1.15rem 1.25rem; border-right: 1px solid var(--line); margin: 0 -1px -1px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.stat dt { font: 500 0.68rem/1 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.8rem; }
.stat dd { margin: 0; font: 400 2rem/1.05 var(--pixel); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.stat dd.text { font: 400 1rem/1.4 var(--sans); letter-spacing: 0; }
.stat .sub { display: block; font: 400 0.74rem/1.5 var(--mono); letter-spacing: 0; color: var(--ink-3); margin-top: 0.55rem; }
.badge { display: inline-flex; align-items: center; gap: 0.45rem; font: 500 0.72rem/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 0.4rem 0.6rem; border-radius: 6px; background: rgba(11, 13, 18, 0.06); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-tint); color: var(--ok); }
.badge-warn { background: var(--warn-tint); color: var(--warn); }
.badge-bad { background: var(--bad-tint); color: var(--bad); }

.notice { border: 1px solid var(--line-strong); border-left: 3px solid var(--signal); border-radius: 0 var(--radius) var(--radius) 0; background: var(--panel); padding: 0.95rem 1.1rem; margin: 1.2rem 0; }
.notice p { margin: 0; }
.notice-warn { border-left-color: var(--warn); background: var(--warn-tint); }
.notice-error { border-left-color: var(--bad); background: var(--bad-tint); }
.key-box { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; background: var(--night); color: var(--live); border-radius: var(--radius); padding: 1rem 1.1rem; margin: 1.2rem 0; }
.key-box code { flex: 1; min-width: 12rem; font-size: 0.98rem; word-break: break-all; }
.key-box .btn-primary { background: var(--live); color: var(--night); }
.sso-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.4rem 0 0.4rem; }
.sso-row .btn { min-width: 15rem; justify-content: center; }
.key-signin { margin-top: 1.6rem; }
.key-signin summary { cursor: pointer; color: var(--ink-2); font-size: 0.94rem; }
.key-signin[open] summary { margin-bottom: 1rem; }
.key-signin.only summary { display: none; }
.spinner { display: inline-block; width: 0.9em; height: 0.9em; margin-right: 0.6em; border: 2px solid var(--line-strong); border-top-color: var(--signal); border-radius: 50%; vertical-align: -0.1em; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
  .nav a[href="/account"], .nav a[href="/#pricing"] { display: none; }
}
@media (max-width: 400px) {
  .nav a[href="/docs"] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
