/* tokenflow.dev. Colors come from the mark (brand/README.md): ink #0B1F1E, token teal #5EEAD4, cursor cream #F4F1EA. */

/* Geist and Geist Mono, self-hosted (SIL OFL 1.1, /fonts/OFL.txt). Variable weight, latin + latin-ext subsets. */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(/fonts/geist-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(/fonts/geist-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url(/fonts/geist-mono-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url(/fonts/geist-mono-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --paper: #f4f1ea;
  --paper-2: #ece8de;
  --ink: #0b1f1e;
  --text: #14181a;
  --muted: #565d61;
  --line: #d9d4c7;
  --control-line: #8a8578;
  --link: #0d6b63;
  --teal: #5eead4;
  --cream: #f4f1ea;
  --panel: #0b1f1e;
  --panel-text: #dfe7e5;
  --panel-muted: #8ea6a2;
  --panel-line: #1c3533;
  --radius: 14px;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0a1413;
    --paper-2: #0f1c1b;
    --text: #e3e8e7;
    --muted: #9aa9a6;
    --line: #1f3331;
    --control-line: #44706b;
    --link: #5eead4;
    --panel: #0f2422;
    --panel-line: #24403d;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--link); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 4px; }

.skip-link { position: absolute; inset-inline-start: -9999px; top: 12px; }
.skip-link:focus { inset-inline-start: 16px; background: var(--paper); padding: 6px 10px; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 24px; }
@media (max-width: 480px) { .wrap { padding: 0 16px; } }

/* Header */

.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 1.125rem; letter-spacing: -0.02em; }
.brand img { display: block; }
@media (prefers-color-scheme: dark) { .brand img { box-shadow: 0 0 0 1px var(--line); border-radius: 6px; } }

.nav { display: flex; align-items: center; gap: 28px; font-size: 0.9375rem; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); }
@media (max-width: 720px) { .nav .nav-section { display: none; } }

/* Buttons and labels */

.eyebrow { font: 500 0.75rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid transparent;
  font: 500 0.875rem/1 var(--mono); letter-spacing: 0.02em;
  text-decoration: none; white-space: nowrap;
  transition-property: scale, background-color, border-color;
  transition-duration: 150ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}
.btn:active { scale: 0.96; }
@media (prefers-reduced-motion: reduce) { .btn { transition-property: background-color, border-color; } .btn:active { scale: none; } }
.btn-primary { background: var(--ink); color: var(--cream); }
.btn-secondary { border-color: var(--control-line); color: var(--text); }
.btn-small { min-height: 36px; padding: 0 14px; }
@media (prefers-color-scheme: dark) {
  .btn-primary { background: var(--teal); color: var(--ink); }
}

/* Hero */

.hero { padding: 88px 0 72px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
@media (max-width: 900px) { .hero { padding: 56px 0; } .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 40px; } }

.hero h1 {
  margin: 20px 0 20px;
  font-size: clamp(2.5rem, 5.2vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 600;
  text-wrap: balance;
}
.hero .lead { margin: 0 0 32px; max-width: 34rem; font-size: 1.1875rem; line-height: 1.55; color: var(--muted); text-wrap: pretty; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Terminal panel */

.terminal {
  margin: 0;
  background: var(--panel);
  color: var(--panel-text);
  border-radius: var(--radius);
  border: 1px solid var(--panel-line);
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 48px -24px rgba(11, 31, 30, 0.45);
}
.terminal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--panel-line); font: 400 0.75rem/1 var(--mono); color: var(--panel-muted); }
.terminal-bar .dots { display: flex; gap: 6px; }
.terminal-bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--panel-line); }
.terminal pre { margin: 0; padding: 18px 20px; overflow-x: auto; font: 400 0.8125rem/1.7 var(--mono); tab-size: 2; }
.terminal .c { color: var(--panel-muted); }
.terminal .k { color: var(--teal); }
.terminal .s { color: var(--cream); }

.stream { border-top: 1px solid var(--panel-line); padding: 18px 20px 22px; }
.stream-label { font: 400 0.75rem/1 var(--mono); color: var(--panel-muted); margin-bottom: 14px; display: flex; justify-content: space-between; }
.tokens { display: grid; gap: 8px; }
.tokens div { display: flex; gap: 6px; }
.tokens span { height: 10px; border-radius: 5px; background: var(--teal); }
.tokens div:nth-child(1) span { opacity: 0.4; }
.tokens div:nth-child(2) span { opacity: 0.7; }
.tokens .cursor { background: var(--cream); width: 10px; }
@media (prefers-reduced-motion: no-preference) {
  .tokens .cursor { animation: blink 1.1s steps(1) infinite; }
  .tokens div:nth-child(3) span:not(.cursor) { transform-origin: left; animation: grow 2.4s ease-out both; }
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Protocol strip */

.protocols { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper-2); }
.protocols .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; padding-top: 20px; padding-bottom: 20px; }
.protocols ul { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; padding: 0; list-style: none; font: 400 0.875rem/1.4 var(--mono); }
.protocols code { color: var(--muted); }

/* Sections */

.section { padding: 96px 0; }
.section-flush { padding-top: 0; }
@media (max-width: 720px) { .section { padding: 64px 0; } .section-flush { padding-top: 0; } }
.section-head { max-width: 40rem; margin-bottom: 48px; }
.section h2 { margin: 14px 0 12px; font-size: clamp(1.75rem, 3.2vw, 2.5rem); line-height: 1.1; letter-spacing: -0.035em; font-weight: 600; text-wrap: balance; }
.section-head p { margin: 0; color: var(--muted); font-size: 1.0625rem; text-wrap: pretty; }

/* Feature grid */

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid { grid-template-columns: minmax(0, 1fr); } }
.cell { padding: 28px 28px 32px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cell .num { font: 500 0.75rem/1 var(--mono); color: var(--muted); }
.cell h3 { margin: 20px 0 8px; font-size: 1.125rem; letter-spacing: -0.015em; font-weight: 600; }
.cell p { margin: 0; color: var(--muted); font-size: 0.9375rem; text-wrap: pretty; }

/* How it works */

.diagram { border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; background: var(--paper-2); }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram .d-narrow { display: none; max-width: 22rem; margin: 0 auto; }
@media (max-width: 640px) { .diagram { padding: 20px; } .diagram .d-wide { display: none; } .diagram .d-narrow { display: block; } }
.diagram .d-line { stroke: var(--line); }
.diagram .d-flow { stroke: var(--link); }
.diagram .d-box { fill: var(--paper); stroke: var(--line); }
.diagram .d-ink { fill: var(--ink); }
.diagram .d-text { fill: var(--text); font: 500 15px var(--sans); }
.diagram .d-mono { fill: var(--muted); font: 400 12px var(--mono); }
.diagram .d-teal { fill: var(--teal); }
.diagram .d-cream { fill: var(--cream); }
@media (prefers-color-scheme: dark) { .diagram .d-ink { fill: #133230; } }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin: 32px 0 0; padding: 0; list-style: none; counter-reset: step; }
@media (max-width: 720px) { .steps { grid-template-columns: minmax(0, 1fr); gap: 20px; } }
.steps li { counter-increment: step; color: var(--muted); font-size: 0.9375rem; }
.steps li::before { content: "0" counter(step); display: block; font: 500 0.75rem/1 var(--mono); margin-bottom: 10px; color: var(--link); }
.steps strong { color: var(--text); font-weight: 600; }

/* Quickstart */

.code-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .code-grid { grid-template-columns: minmax(0, 1fr); } }
.note { margin: 20px 0 0; color: var(--muted); font-size: 0.9375rem; }
code { font-family: var(--mono); font-size: 0.9em; }
p code, li code { background: var(--paper-2); border: 1px solid var(--line); padding: 0.05em 0.35em; border-radius: 5px; }

/* Access band */

.band { background: var(--ink); color: var(--cream); }
.band .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding-top: 64px; padding-bottom: 64px; }
.band h2 { margin: 0 0 8px; font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -0.035em; font-weight: 600; }
.band p { margin: 0; color: #a9bdb9; max-width: 34rem; }
.band .btn-primary { background: var(--teal); color: var(--ink); }
.band a:focus-visible { outline-color: var(--teal); }
@media (prefers-color-scheme: dark) { .band { background: #0f2422; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); } }

/* Footer */

.site-footer { padding: 40px 0 48px; font-size: 0.875rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { color: var(--muted); }

/* Legal pages */

.doc { max-width: 44rem; margin: 0 auto; padding: 64px 24px 80px; }
@media (max-width: 480px) { .doc { padding: 40px 16px 64px; } }
.doc h1 { margin: 14px 0 8px; font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.1; letter-spacing: -0.04em; font-weight: 600; }
.doc .updated { margin: 0 0 40px; color: var(--muted); }
.doc h2 { margin: 40px 0 10px; font-size: 1.1875rem; letter-spacing: -0.015em; font-weight: 600; }
.doc p, .doc li { color: var(--text); }
.doc p, .doc ul { max-width: 40rem; }
.doc ul { padding-inline-start: 1.25rem; }
.doc li + li { margin-top: 8px; }

/* Hover only where a pointer can hover, so taps don't leave it stuck. */
@media (hover: hover) {
  .nav a:hover { color: var(--text); }
  .btn-primary:hover { background: #163634; }
  .btn-secondary:hover { border-color: var(--text); }
  .band .btn-primary:hover { background: #8ff2e2; }
  .site-footer a:hover { color: var(--text); }
}
@media (hover: hover) and (prefers-color-scheme: dark) {
  .btn-primary:hover { background: #8ff2e2; }
}

/* Guide pages (agents) */

.guide { padding: 64px 0 96px; }
@media (max-width: 720px) { .guide { padding: 40px 0 64px; } }
.guide-head { max-width: 44rem; }
.guide-head h1 { margin: 14px 0 16px; font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.08; letter-spacing: -0.04em; font-weight: 600; text-wrap: balance; }
.guide-head .lead { margin: 0 0 12px; font-size: 1.125rem; color: var(--muted); text-wrap: pretty; }
.verified { margin: 0; font: 400 0.8125rem/1.5 var(--mono); color: var(--muted); }
.toc { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 40px 0 8px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font: 400 0.875rem/1.4 var(--mono); }
.toc a { color: var(--muted); text-decoration: none; }
@media (hover: hover) { .toc a:hover { color: var(--text); } }
.guide-section { max-width: 52rem; padding-top: 56px; scroll-margin-top: 16px; }
.guide-section h2 { margin: 0 0 12px; font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -0.03em; font-weight: 600; }
.guide-section h3 { margin: 32px 0 10px; font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.guide-section > p, .guide-section h3 + p { max-width: 44rem; color: var(--text); text-wrap: pretty; }
.guide-section .terminal { margin-top: 12px; }
.why { max-width: 44rem; margin: 0; padding-inline-start: 1.25rem; color: var(--muted); }
.why li + li { margin-top: 10px; }
.why strong { color: var(--text); font-weight: 600; }
.kv { max-width: 44rem; border-collapse: collapse; margin: 8px 0 0; font-size: 0.9375rem; }
.kv th, .kv td { text-align: start; vertical-align: top; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); }
.kv th { font-weight: 600; white-space: nowrap; }
.kv td { color: var(--muted); }

/* Home: agents teaser */

.agent-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 720px) { .agent-cards { grid-template-columns: minmax(0, 1fr); } }
.agent-card { display: block; padding: 24px 24px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); color: var(--text); text-decoration: none; }
.agent-card h3 { margin: 0 0 6px; font-size: 1.125rem; font-weight: 600; letter-spacing: -0.015em; }
.agent-card p { margin: 0 0 16px; color: var(--muted); font-size: 0.9375rem; }
.agent-card code { font: 400 0.8125rem/1.5 var(--mono); color: var(--link); background: none; border: 0; padding: 0; }
.agent-card .more { font: 500 0.8125rem/1 var(--mono); color: var(--link); }
@media (hover: hover) { .agent-card:hover { border-color: var(--control-line); } }
.kv code { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .kv, .kv tbody, .kv tr, .kv th, .kv td { display: block; }
  .kv th { padding: 12px 0 2px; border-bottom: 0; }
  .kv td { padding: 0 0 12px; }
}

/* API errors reference */
.problems { margin-top: 24px; border-top: 1px solid var(--line); max-width: 52rem; }
.problem { padding: 24px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 16px; }
.problem h2 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 8px; font-size: 1.0625rem; font-weight: 600; }
.problem h2 code { font-size: 1rem; background: none; border: 0; padding: 0; }
.problem .status { font: 500 0.8125rem/1 var(--mono); color: var(--muted); }
.problem p { margin: 0; max-width: 44rem; color: var(--muted); }
.problem p + p { margin-top: 6px; }
.problem strong { color: var(--text); font-weight: 600; }
.problem:target { background: var(--paper-2); box-shadow: -16px 0 0 var(--paper-2), 16px 0 0 var(--paper-2); }
