/* ============================================================
   docs.sibyllabs.org — Sibyl Labs wiki-style documentation
   Warm-paper aesthetic. Matches sibyllabs.org root site.
   Fraunces + IBM Plex Mono per rule 46.
   ============================================================ */

:root {
  /* === light-mode lab palette === */
  --paper:        #f5f1e6;
  --paper-deep:   #ede6d3;
  --card:         #fdfbf5;
  --code-bg:      #ede6d3;
  --ink:          #15110a;
  --ink-soft:     #2c271d;
  --ink-mute:     #6a6356;
  --ink-faint:    #98917f;
  --rule:         #d8d0bb;
  --rule-strong:  #b8ae93;
  --accent:       #8a6a2a;
  --accent-warm:  #a08438;
  --accent-faint: rgba(138, 106, 42, 0.10);
  --accent-line:  rgba(138, 106, 42, 0.30);
  --jade:         #2d6e6a;
  --jade-faint:   rgba(45, 110, 106, 0.08);
  --pulse:        #1d8a82;
  --warn:         #a87526;
  --warn-faint:   rgba(168, 117, 38, 0.08);
  --error:        #a23a2a;
  --error-faint:  rgba(162, 58, 42, 0.08);

  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;
  --ease:         cubic-bezier(0.19, 1, 0.22, 1);

  --topbar-h:     56px;
  --sidebar-w:    260px;
  --toc-w:        220px;
  --content-max:  760px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.7;
  font-feature-settings: 'ss01' on, 'cv01' on, 'liga' on;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 8% 0%, rgba(138,106,42,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 100% 100%, rgba(45,110,106,0.03) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}
a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
a:hover { color: var(--accent-warm); border-bottom-color: var(--accent-warm); }
::selection { background: var(--accent); color: var(--paper); }

/* ============================================================
   TOPBAR — sticky, contains brand + search + GitHub link
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: rgba(245, 241, 230, 0.92);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0 1.5rem;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  border: none;
  color: var(--ink);
}
.brand:hover { color: var(--ink); border: none; }
.brand .mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: 'opsz' 14, 'SOFT' 30, 'WONK' 0;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}
.brand .sub {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.95rem;
  color: var(--accent);
}
.search-wrap { flex: 1; max-width: 380px; position: relative; }
#docs-search {
  width: 100%;
  padding: 8px 12px 8px 32px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}
#docs-search:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--paper);
}
.search-wrap::before {
  content: '';
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px;
  border: 1.5px solid var(--ink-mute);
  border-radius: 50%;
}
.search-wrap::after {
  content: '';
  position: absolute; left: 21px; top: 23px;
  width: 5px; height: 1.5px; background: var(--ink-mute);
  transform: rotate(45deg);
}
.search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--card);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  max-height: 360px; overflow-y: auto;
  display: none;
  box-shadow: 0 8px 32px rgba(26, 24, 20, 0.08);
}
.search-results.show { display: block; }
.search-results a {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  font-size: 13px;
}
.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--accent-faint); color: var(--ink); border-color: var(--rule); }
.search-results .r-title { font-weight: 500; color: var(--ink); }
.search-results .r-meta { font-size: 11px; color: var(--ink-mute); margin-top: 2px; }
.search-results .r-empty { padding: 12px 14px; font-size: 13px; color: var(--ink-mute); font-style: italic; }

.topbar-links { display: flex; align-items: center; gap: 1rem; }
.topbar-links a {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--ink-mute);
  border: none;
  padding: 4px 0;
}
.topbar-links a:hover { color: var(--accent); border: none; }
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink);
  width: 36px; height: 36px;
  font-size: 18px;
  border-radius: 4px;
  cursor: pointer;
}

/* ============================================================
   LAYOUT — three-column grid: sidebar | content | TOC
   ============================================================ */
.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  gap: 2rem;
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 1.5rem;
  min-height: calc(100vh - var(--topbar-h));
}

/* ============================================================
   SIDEBAR — persistent left navigation
   ============================================================ */
.sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 1rem);
  align-self: start;
  height: calc(100vh - var(--topbar-h) - 2rem);
  overflow-y: auto;
  padding: 1.5rem 0.5rem 2rem 0;
  font-size: 13.5px;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }
.sidebar h3 {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 1.4rem 0 0.5rem;
  padding-left: 0.75rem;
}
.sidebar h3:first-child { margin-top: 0; }
.sidebar ul { list-style: none; }
.sidebar li { margin: 0; }
.sidebar li a {
  display: block;
  padding: 5px 12px 5px 18px;
  color: var(--ink-soft);
  border: none;
  border-left: 2px solid transparent;
  font-size: 13.5px;
  border-radius: 0 4px 4px 0;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.sidebar li a:hover {
  color: var(--ink);
  background: var(--accent-faint);
  border-left-color: var(--accent-line);
}
.sidebar li a.active {
  color: var(--ink);
  background: var(--accent-faint);
  border-left-color: var(--accent);
  font-weight: 500;
}
.sidebar li.coming-soon a {
  color: var(--ink-faint);
  font-style: italic;
}
.sidebar li.coming-soon a::after {
  content: ' soon';
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.5px;
}

/* ============================================================
   CONTENT — article area
   ============================================================ */
.content {
  padding: 2.5rem 0 4rem;
  max-width: var(--content-max);
  min-width: 0;
}
.breadcrumbs {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1.5rem;
}
.breadcrumbs a {
  color: var(--ink-mute);
  border: none;
}
.breadcrumbs a:hover { color: var(--accent); border: none; }
.breadcrumbs span.sep { margin: 0 0.5rem; color: var(--ink-faint); }

h1.page-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.5px;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 0.8rem;
  font-variation-settings: 'opsz' 48, 'SOFT' 30;
}
p.lede {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 2.5rem;
  max-width: 60ch;
}

.content h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.65rem;
  letter-spacing: -0.3px;
  color: var(--ink);
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
  font-variation-settings: 'opsz' 36;
}
.content h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  color: var(--ink);
  margin-top: 2rem;
  margin-bottom: 0.6rem;
  font-variation-settings: 'opsz' 24;
}
.content h4 {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.content p {
  margin-bottom: 1rem;
  max-width: 65ch;
}
.content ul, .content ol {
  margin: 0.5rem 0 1.2rem 1.5rem;
  max-width: 65ch;
}
.content li { margin-bottom: 0.35rem; color: var(--ink-soft); }
.content li::marker { color: var(--ink-faint); }

.content strong { color: var(--ink); font-weight: 600; }
.content em { color: var(--accent); font-style: normal; }

/* heading anchor — visible on hover */
.content h2, .content h3 { scroll-margin-top: 80px; position: relative; }
.heading-anchor {
  position: absolute; left: -1.2em; top: 0; bottom: 0;
  display: flex; align-items: center;
  opacity: 0; transition: opacity 0.15s;
  font-family: var(--font-mono);
  color: var(--ink-faint);
  border: none; padding: 0 0.3em;
  font-size: 0.85em;
}
.content h2:hover .heading-anchor,
.content h3:hover .heading-anchor { opacity: 1; }
.heading-anchor:hover { color: var(--accent); border: none; }

/* ============================================================
   CODE BLOCKS — with copy button
   ============================================================ */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--accent-faint);
  color: var(--ink);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  white-space: nowrap;
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 14px 16px;
  margin: 1rem 0 1.5rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  position: relative;
}
pre code {
  background: transparent;
  padding: 0;
  white-space: pre;
  font-size: inherit;
  border-radius: 0;
  color: var(--ink-soft);
}
pre .tok-kw { color: var(--accent); font-weight: 500; }
pre .tok-str { color: var(--jade); }
pre .tok-comment { color: var(--ink-faint); font-style: italic; }
pre .tok-fn { color: var(--accent-warm); }
pre .prompt { color: var(--ink-faint); user-select: none; }
.copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-mute);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}
pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: var(--paper); color: var(--accent); }
.copy-btn.copied { color: var(--jade); }

/* ============================================================
   CALLOUTS — note / tip / warning / danger
   ============================================================ */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-faint);
  padding: 14px 18px;
  border-radius: 0 4px 4px 0;
  margin: 1.2rem 0;
  font-size: 0.95rem;
}
.callout .callout-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.callout p { margin-bottom: 0.3rem; }
.callout p:last-child { margin-bottom: 0; }
.callout.tip { border-left-color: var(--jade); background: var(--jade-faint); }
.callout.tip .callout-label { color: var(--jade); }
.callout.warning { border-left-color: var(--warn); background: var(--warn-faint); }
.callout.warning .callout-label { color: var(--warn); }
.callout.danger { border-left-color: var(--error); background: var(--error-faint); }
.callout.danger .callout-label { color: var(--error); }

/* ============================================================
   TABLES
   ============================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 13.5px;
}
th, td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1.5px solid var(--rule-strong);
  background: var(--accent-faint);
}
td { color: var(--ink-soft); }
td strong { color: var(--ink); }
tr:hover td { background: var(--accent-faint); }

/* ============================================================
   ON-THIS-PAGE TOC (right rail)
   ============================================================ */
.toc {
  position: sticky;
  top: calc(var(--topbar-h) + 1rem);
  align-self: start;
  padding: 2.5rem 0 2rem 0.5rem;
  max-height: calc(100vh - var(--topbar-h) - 2rem);
  overflow-y: auto;
  font-size: 12.5px;
  border-left: 1px solid var(--rule);
  padding-left: 1rem;
}
.toc::-webkit-scrollbar { width: 4px; }
.toc::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 2px; }
.toc h4 {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 0.6rem;
}
.toc ul { list-style: none; margin: 0; }
.toc li { margin: 0; }
.toc li a {
  display: block;
  padding: 3px 0;
  color: var(--ink-mute);
  border: none;
  line-height: 1.45;
}
.toc li a:hover { color: var(--accent); border: none; }
.toc li a.active { color: var(--accent); font-weight: 500; }
.toc li.toc-h3 a { padding-left: 1rem; font-size: 12px; color: var(--ink-faint); }

/* ============================================================
   CARDS (used on hub pages)
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.25rem;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0 0 0.4rem;
  color: var(--ink);
}
.card h3 a { color: inherit; border: none; }
.card h3 a:hover { color: var(--accent); }
.card p { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 0.5rem; }
.card .card-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.card .card-meta.live { color: var(--pulse); }
.card .card-meta.soon { color: var(--accent); }

/* ============================================================
   PAGE FOOTER (each article)
   ============================================================ */
.page-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 0.5px;
}
.page-footer a { color: var(--ink-mute); border: none; }
.page-footer a:hover { color: var(--accent); border: none; }

/* ============================================================
   NEXT / PREVIOUS
   ============================================================ */
.pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2rem 0 0;
}
.pagination a {
  display: block;
  padding: 1rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--card);
  color: var(--ink);
}
.pagination a:hover { border-color: var(--accent-line); background: var(--accent-faint); }
.pagination .nav-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.2rem;
}
.pagination .nav-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
}
.pagination .nav-prev { text-align: left; }
.pagination .nav-next { text-align: right; }
.pagination a:only-child.nav-next { grid-column: 2; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .toc { display: none; }
  .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
}
@media (max-width: 800px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 0 1rem;
  }
  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    width: 280px;
    height: calc(100vh - var(--topbar-h));
    background: var(--paper);
    border-right: 1px solid var(--rule);
    padding: 1.5rem 1rem 2rem 1rem;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease);
    box-shadow: 4px 0 16px rgba(26, 24, 20, 0.05);
  }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 1.5rem 0 3rem; }
  .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }
  .topbar { padding: 0 1rem; gap: 0.75rem; }
  .topbar-links a { display: none; }
  .topbar-links a.github-link { display: inline; }
  h1.page-title { font-size: 1.85rem; }
  p.lede { font-size: 1.05rem; }
}
@media (max-width: 480px) {
  .search-wrap { display: none; }
}

/* ============================================================
   HOMEPAGE-SPECIFIC (introduction page)
   ============================================================ */
.intro-hero {
  padding: 1rem 0 1.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
}
.intro-hero .eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.intro-hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  letter-spacing: -0.5px;
  line-height: 1.05;
  margin-bottom: 1rem;
  color: var(--ink);
  font-variation-settings: 'opsz' 80, 'SOFT' 30;
}
.intro-hero h1 em {
  color: var(--accent);
  font-style: italic;
  font-weight: 300;
  font-variation-settings: 'opsz' 80, 'SOFT' 60;
}
.intro-hero .hero-sub {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.25rem;
  color: var(--ink-soft);
  line-height: 1.5;
  max-width: 58ch;
  margin-bottom: 1.5rem;
}
.intro-hero .hero-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.5px;
  color: var(--ink-mute);
  display: flex; gap: 1.5rem; flex-wrap: wrap;
}
.intro-hero .hero-meta .pulse {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--pulse);
  margin-right: 0.5rem; vertical-align: middle;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
.problem-block {
  border: 1px solid var(--rule);
  background: var(--card);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
}
.problem-block h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  color: var(--ink);
  display: flex; align-items: baseline; gap: 0.6rem;
}
.problem-block .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 1.5px;
  font-weight: 600;
}
.problem-block p { font-size: 14px; color: var(--ink-soft); margin: 0; }

/* =========================================================
   V3 DOCS — diagrams, animations, hero video, terminal demos
   Added 2026-05-17 to support /memory/{authentication,payment,account,cli}
   ========================================================= */

/* Hero video block — used at the top of feature pages */
.hero-video {
  margin: 1.5rem 0 2.5rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--rule);
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  position: relative;
  background: var(--paper-deep);
}
.hero-video video {
  display: block;
  width: 100%;
  height: auto;
}
.hero-video .hero-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(21,17,10,0.78), rgba(21,17,10,0));
  color: var(--paper);
  padding: 1.5rem 1.25rem 1rem;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.4px;
}
.hero-video .hero-caption strong {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0;
  color: #f4eddc;
}

/* SVG diagram container — frames every inline diagram on the docs */
.diagram {
  margin: 2rem 0;
  padding: 1.75rem 1.5rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  position: relative;
}
.diagram-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.diagram-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: 1.1rem;
  margin: 0 0 1.25rem;
  color: var(--ink);
}
.diagram svg {
  display: block;
  max-width: 100%;
  height: auto;
  font-family: var(--font-mono);
}
.diagram-caption {
  margin-top: 1rem;
  font-size: 12.5px;
  color: var(--ink-mute);
  font-style: italic;
  text-align: center;
}

/* SVG token shorthands — keep diagrams consistent */
.diagram svg .d-rect { fill: var(--paper); stroke: var(--ink-soft); stroke-width: 1.4; }
.diagram svg .d-rect-accent { fill: #f9f0d8; stroke: var(--accent); stroke-width: 1.6; }
.diagram svg .d-rect-jade { fill: rgba(45,110,106,0.08); stroke: var(--jade); stroke-width: 1.6; }
.diagram svg .d-rect-warn { fill: rgba(166,74,42,0.08); stroke: var(--warn); stroke-width: 1.6; }
.diagram svg .d-line { stroke: var(--ink-soft); stroke-width: 1.4; fill: none; }
.diagram svg .d-line-accent { stroke: var(--accent); stroke-width: 1.6; fill: none; }
.diagram svg .d-line-dash { stroke: var(--ink-mute); stroke-width: 1.2; stroke-dasharray: 4 3; fill: none; }
.diagram svg .d-label { font-family: var(--font-mono); font-size: 12px; fill: var(--ink); }
.diagram svg .d-label-eyebrow { font-family: var(--font-mono); font-size: 10px; fill: var(--accent); letter-spacing: 1.5px; text-transform: uppercase; }
.diagram svg .d-label-sub { font-family: var(--font-mono); font-size: 10.5px; fill: var(--ink-mute); }
.diagram svg .d-title-italic { font-family: var(--font-display); font-style: italic; font-size: 13px; fill: var(--ink); }
.diagram svg .d-arrow { fill: var(--ink-soft); }
.diagram svg .d-arrow-accent { fill: var(--accent); }

/* Animated pulse on diagram nodes (for "active" state hints) */
@keyframes diagPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
.diagram svg .d-pulse { animation: diagPulse 2.2s ease-in-out infinite; }

/* Capacity meter — used on account page */
.capacity-meter {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
}
.capacity-meter-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.capacity-meter-bar {
  height: 14px;
  background: var(--paper-deep);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--rule);
}
.capacity-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--jade) 0%, var(--accent) 70%, var(--warn) 100%);
  border-radius: 3px;
  width: 0%;
  animation: capacityFill 3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes capacityFill {
  0%   { width: 0%; }
  20%  { width: 18%; }
  50%  { width: 52%; }
  80%  { width: 78%; }
  100% { width: 92%; }
}
.capacity-meter-labels {
  display: flex; justify-content: space-between;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
}
.capacity-meter-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1rem; margin-top: 1.25rem;
  font-family: var(--font-mono); font-size: 12px;
}
.capacity-meter-stats .stat { padding: 0.5rem 0.75rem; background: var(--paper); border-radius: 4px; border: 1px solid var(--rule); }
.capacity-meter-stats .stat .val { font-size: 1.4rem; color: var(--ink); font-family: var(--font-display); font-weight: 500; display: block; }
.capacity-meter-stats .stat .lbl { color: var(--ink-mute); font-size: 10.5px; letter-spacing: 0.8px; text-transform: uppercase; margin-top: 0.25rem; }

/* Terminal demo — animated typing for CLI page + showcase */
.term-demo {
  margin: 2rem 0;
  background: #1a1610;
  border: 1px solid #2a241a;
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  color: #e8dcc0;
  box-shadow: 0 6px 28px rgba(0,0,0,0.18);
}
.term-demo-bar {
  background: #100c08;
  padding: 0.55rem 0.9rem;
  font-size: 11px;
  color: #8a8175;
  display: flex; align-items: center; gap: 0.6rem;
  border-bottom: 1px solid #2a241a;
}
.term-demo-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: #3a3328; }
.term-demo-bar .dot:nth-child(1) { background: #d96152; }
.term-demo-bar .dot:nth-child(2) { background: #d9b452; }
.term-demo-bar .dot:nth-child(3) { background: #6fb56a; }
.term-demo-bar .ttitle { margin-left: 0.5rem; flex: 1; }
.term-demo-body {
  padding: 1.1rem 1.3rem 1.3rem;
  min-height: 90px;
  white-space: pre-wrap;
  word-break: break-word;
}
.term-demo-body .prompt { color: #8a6a2a; }
.term-demo-body .cmd { color: #f4eddc; }
.term-demo-body .out { color: #b8ad94; }
.term-demo-body .ok { color: #6fb56a; }
.term-demo-body .warn { color: #d9b452; }
.term-demo-body .err { color: #d96152; }
.term-demo-body .accent { color: #d9b452; }
.term-demo-body .dim { color: #6a6356; }
.term-cursor {
  display: inline-block; width: 7px; height: 14px; background: #f4eddc;
  vertical-align: text-bottom; margin-left: 2px;
  animation: termCursor 1s steps(2) infinite;
}
@keyframes termCursor { 50% { opacity: 0; } }

/* Pairing code visual — auth page */
.pairing-code {
  display: inline-flex;
  gap: 0.4rem;
  margin: 1.5rem 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 2rem;
  letter-spacing: 0.15em;
}
.pairing-code span {
  display: inline-block;
  width: 2.4rem; height: 2.8rem;
  line-height: 2.8rem;
  text-align: center;
  background: var(--paper-deep);
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  color: var(--ink);
  font-weight: 500;
  animation: codeReveal 2s ease-out forwards;
  opacity: 0;
}
.pairing-code span:nth-child(1) { animation-delay: 0.0s; }
.pairing-code span:nth-child(2) { animation-delay: 0.15s; }
.pairing-code span:nth-child(3) { animation-delay: 0.30s; }
.pairing-code span:nth-child(4) { animation-delay: 0.45s; }
.pairing-code span:nth-child(5) { animation-delay: 0.60s; }
.pairing-code span:nth-child(6) { animation-delay: 0.75s; }
@keyframes codeReveal {
  0%   { opacity: 0; transform: translateY(8px); }
  60%  { opacity: 1; transform: translateY(0); background: #f9e8c2; }
  100% { opacity: 1; transform: translateY(0); }
}

/* Tier card grid — payment page */
.tier-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.tier-card {
  border: 1px solid var(--rule);
  background: var(--card);
  border-radius: 8px;
  padding: 1.25rem;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.tier-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(138,106,42,0.10);
}
.tier-card .tier-name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}
.tier-card .tier-price {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.tier-card .tier-unlocks {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.tier-card.featured {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--card) 0%, #f9f0d8 100%);
}
.tier-card.featured::before {
  content: "RECOMMENDED";
  position: absolute;
  top: -8px; right: 12px;
  background: var(--accent); color: var(--paper);
  font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 1.5px; padding: 2px 8px;
  border-radius: 3px;
}

/* Stat-row strip — used on multiple pages */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--card);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
}
.stat-strip .stat-item { padding: 0.25rem 0.5rem; }
.stat-strip .stat-item .v {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--ink);
}
.stat-strip .stat-item .l {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-mute);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* Inline annotation chips */
.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.8px;
  padding: 1px 7px;
  border-radius: 3px;
  vertical-align: 1px;
}
.chip.live    { background: rgba(45,110,106,0.10); color: var(--jade); }
.chip.new     { background: rgba(138,106,42,0.12); color: var(--accent); }
.chip.gated   { background: rgba(166,74,42,0.10); color: var(--warn); }
.chip.dim     { background: var(--paper-deep); color: var(--ink-mute); }

/* =========================================================
   V3 DOCS · PAGE 2 — payment page additions
   Tufte margin notes, animated path-draw, illustrated rail
   ========================================================= */

/* Tufte-style margin notes — pulled from main body into right margin */
.with-margin {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 2.5rem;
  align-items: start;
  margin: 1.5rem 0;
}
.with-margin .body p { margin-bottom: 1rem; }
.margin-note {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-mute);
  padding-left: 0.9rem;
  border-left: 2px solid var(--accent-line);
  position: relative;
}
.margin-note::before {
  content: attr(data-num);
  position: absolute;
  top: -2px; left: -28px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--accent);
  font-style: normal;
  letter-spacing: 0.5px;
}
.margin-note strong {
  color: var(--ink-soft);
  font-style: normal;
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.3px;
}

/* Animated SVG path-draw for payment flow */
@keyframes pathDraw {
  to { stroke-dashoffset: 0; }
}
@keyframes settleGlow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(45,110,106,0)); }
  50%      { filter: drop-shadow(0 0 6px rgba(45,110,106,0.55)); }
}
.path-draw {
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: pathDraw 3.5s ease-out 0.4s forwards;
}
.path-draw-fast {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: pathDraw 1.6s ease-out 0.2s forwards;
}
.settle-glow { animation: settleGlow 2s ease-in-out 4s infinite; }
.fade-in-late {
  opacity: 0;
  animation: fadeIn 0.6s ease-out 3.8s forwards;
}
@keyframes fadeIn { to { opacity: 1; } }

/* Pictorial x402 rail — stylized cross-section illustration */
.rail-illustration {
  margin: 2rem 0;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  position: relative;
  overflow: hidden;
}
.rail-illustration::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}
.rail-illustration .rail-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 1.4rem;
  text-align: center;
  margin: 0 0 0.4rem;
  color: var(--ink);
}
.rail-illustration .rail-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

/* Animated USDC counter */
.counter-block {
  text-align: center;
  margin: 2rem 0;
  padding: 1.5rem;
  border: 1px dashed var(--accent-line);
  border-radius: 8px;
  background: var(--accent-faint);
}
.counter-num {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 3rem;
  color: var(--accent);
  font-feature-settings: 'tnum' on;
  display: inline-block;
  min-width: 5ch;
  text-align: right;
}
.counter-unit {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink-mute);
  margin-left: 0.4rem;
  letter-spacing: 1px;
}
.counter-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-top: 0.5rem;
}

/* Mobile fallback for with-margin */
@media (max-width: 800px) {
  .with-margin {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .margin-note {
    border-left-width: 3px;
    margin: 0.5rem 0 1rem 0.5rem;
  }
}

/* =========================================================
   V3 DOCS · PAGE 3 — account page
   Conic-gradient gauge, state machine, ASCII telemetry
   ========================================================= */

/* Circular conic-gradient capacity gauge */
.gauge-wrap {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: center;
  margin: 2rem 0 2.5rem;
  padding: 2rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.gauge {
  --pct: 62;
  width: 240px; height: 240px;
  border-radius: 50%;
  background:
    conic-gradient(
      from -90deg,
      var(--jade)  0%,
      var(--accent) calc(var(--pct) * 0.85%),
      var(--warn)  calc(var(--pct) * 1%),
      var(--paper-deep) calc(var(--pct) * 1%) 100%
    );
  position: relative;
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px var(--rule), 0 4px 20px rgba(138,106,42,0.08);
  animation: gaugeFill 2.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes gaugeFill {
  0%   { --pct: 0; }
  50%  { --pct: 35; }
  100% { --pct: 62; }
}
.gauge::before {
  content: "";
  position: absolute;
  inset: 16px;
  background: var(--card);
  border-radius: 50%;
  z-index: 0;
}
.gauge-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  font-family: var(--font-mono);
}
.gauge-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 3.2rem;
  line-height: 1;
  color: var(--ink);
  font-variation-settings: 'opsz' 100, 'SOFT' 30;
}
.gauge-unit { font-size: 13px; color: var(--ink-mute); letter-spacing: 1.5px; }
.gauge-label {
  display: block;
  margin-top: 0.5rem;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
}
.gauge-side h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}
.gauge-side .gauge-readout {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-top: 1rem;
}
.gauge-side .gauge-readout strong { color: var(--ink); font-weight: 600; }
@media (max-width: 720px) {
  .gauge-wrap { grid-template-columns: 1fr; text-align: center; }
  .gauge { margin: 0 auto; }
}

/* ASCII telemetry readout — feels like a system terminal */
.telemetry {
  margin: 2rem 0;
  background: #14110a;
  border: 1px solid #2a241a;
  border-radius: 8px;
  padding: 1.4rem 1.6rem;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: #d8c89a;
  overflow-x: auto;
}
.telemetry .t-header {
  color: #8a6a2a;
  font-size: 10.5px;
  letter-spacing: 1.5px;
  margin-bottom: 0.8rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px dashed #2a241a;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
}
.telemetry .t-header .pulse-dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: #6fb56a;
  margin-right: 0.5rem; vertical-align: 1px;
  animation: telPulse 1.6s ease-in-out infinite;
}
@keyframes telPulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
.telemetry pre {
  margin: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
}
.telemetry .v-num { color: #f4eddc; }
.telemetry .v-ok  { color: #6fb56a; }
.telemetry .v-warn { color: #d9b452; }
.telemetry .v-err  { color: #d96152; }
.telemetry .v-dim  { color: #5f5640; }
.telemetry .v-accent { color: #d9b452; }

/* State machine SVG arrows + nodes use existing tokens */
.tier-machine {
  margin: 2rem 0;
  padding: 1.5rem 1rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
}
.tier-machine-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  text-align: center;
}
.tier-machine-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.15rem;
  text-align: center;
  margin: 0 0 1.5rem;
  color: var(--ink);
}

/* Disclosure-stack — interactive layers */
.stack-disclosure {
  margin: 2rem 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--rule);
}
.stack-disclosure details {
  border-bottom: 1px solid var(--rule);
  background: var(--card);
}
.stack-disclosure details:last-child { border-bottom: none; }
.stack-disclosure summary {
  cursor: pointer;
  padding: 0.9rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  background: var(--card);
  transition: background 0.15s ease;
  position: relative;
  padding-left: 2.5rem;
  list-style: none;
}
.stack-disclosure summary::-webkit-details-marker { display: none; }
.stack-disclosure summary::before {
  content: "▸";
  position: absolute;
  left: 1rem; top: 50%; transform: translateY(-50%);
  color: var(--accent);
  font-size: 11px;
  transition: transform 0.15s ease;
}
.stack-disclosure details[open] summary::before { transform: translateY(-50%) rotate(90deg); }
.stack-disclosure summary:hover { background: var(--paper-deep); }
.stack-disclosure details[open] summary {
  background: var(--accent-faint);
  color: var(--ink);
  font-weight: 500;
}
.stack-disclosure .stack-body {
  padding: 0.6rem 1.5rem 1.2rem 2.5rem;
  font-size: 14px;
  color: var(--ink-soft);
  background: var(--card);
}
.stack-disclosure .stack-body pre {
  margin: 0.6rem 0;
  background: var(--paper-deep);
  font-size: 12px;
  padding: 0.7rem 0.9rem;
  border-radius: 4px;
}
.stack-disclosure summary .chip {
  margin-left: 0.6rem;
  vertical-align: 1px;
}

/* =========================================================
   V3 DOCS · PAGE 4 — CLI reference
   Drop cap, man-page marginalia, command topology
   ========================================================= */

/* Drop cap — used on the lede of the CLI page */
.dropcap::first-letter {
  initial-letter: 3;
  -webkit-initial-letter: 3;
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  color: var(--accent);
  font-variation-settings: 'opsz' 144, 'SOFT' 70, 'WONK' 1;
  margin-right: 0.4rem;
  padding-top: 0.1rem;
}

/* Man-page command block */
.manpage {
  margin: 2rem 0;
  padding: 0;
  border-left: 3px solid var(--accent);
  background: var(--card);
  border-radius: 0 6px 6px 0;
}
.manpage-head {
  padding: 0.7rem 1rem 0.4rem;
  border-bottom: 1px dashed var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--ink-mute);
  text-transform: uppercase;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
}
.manpage-head .cmd-name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.6rem;
  letter-spacing: 0;
  color: var(--ink);
  text-transform: none;
  margin-right: auto;
}
.manpage-head .cmd-since {
  background: var(--paper-deep);
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 10.5px;
}
.manpage-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 1.5rem;
  padding: 1rem 1rem 1.25rem;
}
.manpage-body .manpage-main p {
  margin: 0.4rem 0 0.9rem;
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.65;
}
.manpage-body .manpage-aside {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-mute);
  line-height: 1.6;
  border-left: 1px solid var(--rule);
  padding-left: 1rem;
}
.manpage-body .manpage-aside .marg {
  margin-bottom: 1rem;
}
.manpage-body .manpage-aside .marg .lbl {
  display: block;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.manpage-synopsis {
  margin: 0.5rem 0;
  background: var(--paper-deep);
  border-radius: 4px;
  padding: 0.65rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 13px;
}
.manpage-synopsis .sub { color: var(--accent); }
.manpage-synopsis .opt { color: var(--ink-mute); }
@media (max-width: 720px) {
  .manpage-body { grid-template-columns: 1fr; gap: 0.5rem; }
  .manpage-body .manpage-aside { border-left: none; border-top: 1px dashed var(--rule); padding-left: 0; padding-top: 0.8rem; }
}

/* Command topology — radial tree of the sibyl command */
.command-tree {
  margin: 2rem 0;
  padding: 1.5rem 1rem 1rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
}

/* Inline flag table */
.flag-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.8rem 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.flag-table thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--rule);
}
.flag-table tbody td {
  padding: 0.4rem 0.6rem;
  vertical-align: top;
  border-bottom: 1px dashed var(--rule);
}
.flag-table tbody td:first-child { color: var(--ink); font-weight: 500; white-space: nowrap; }
.flag-table tbody td:last-child  { color: var(--ink-soft); font-family: var(--font-display); font-size: 14px; }

/* Typing animation — varies cadence per demo */
@keyframes typeRoll {
  from { width: 0; }
  to   { width: 100%; }
}
.type-demo {
  margin: 1rem 0;
  padding: 1rem 1.2rem;
  background: #1a1610;
  color: #e8dcc0;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  border: 1px solid #2a241a;
  overflow: hidden;
}
.type-demo .typed {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid #d9b452;
  vertical-align: bottom;
  animation: typeRoll var(--dur, 2s) steps(36, end) forwards,
             termCursor 1s steps(2) infinite;
}
.type-demo .prompt { color: #8a6a2a; }
.type-demo .out { display: block; color: #b8ad94; margin-top: 0.4rem; opacity: 0; animation: fadeIn 0.4s ease-out var(--dur, 2s) forwards; }
.type-demo .ok { color: #6fb56a; }


/* =========================================================
   Sidebar — collapsible sections
   Added 2026-05-17 — operator directive: each section should
   be compatible to expand/minimize independently
   ========================================================= */

.sidebar .sb-section {
  margin: 0;
  padding: 0;
  border: 0;
}
.sidebar .sb-section summary {
  list-style: none;
  cursor: pointer;
  padding: 0;
  margin: 1.5rem 0 0.6rem;
  position: relative;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sidebar .sb-section:first-child summary { margin-top: 0; }
.sidebar .sb-section summary::-webkit-details-marker,
.sidebar .sb-section summary::marker { display: none; }
.sidebar .sb-section summary h3 {
  /* Preserve the existing h3 typographic identity */
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0;
  flex: 1;
  font-weight: 500;
}
.sidebar .sb-section summary::before {
  content: "›";
  display: inline-block;
  width: 12px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  text-align: center;
  transition: transform 0.15s ease, color 0.15s ease;
  transform: rotate(0deg);
  line-height: 1;
}
.sidebar .sb-section[open] > summary::before { transform: rotate(90deg); }
.sidebar .sb-section summary:hover h3 { color: var(--ink); }
.sidebar .sb-section summary:hover::before { color: var(--accent-warm); }
.sidebar .sb-section summary:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}
.sidebar .sb-section ul {
  margin: 0;
  padding: 0;
  animation: sbReveal 0.18s ease-out;
}
@keyframes sbReveal {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Section containing the active page gets a subtle ochre marker */
.sidebar .sb-section.has-active > summary::after {
  content: "";
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent);
  margin-left: auto;
  flex: 0 0 auto;
}

/* Collapse-all / expand-all controls */
.sidebar .sb-controls {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px dashed var(--rule);
}
.sidebar .sb-controls button {
  background: transparent;
  border: 0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-mute);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: color 0.15s ease, background 0.15s ease;
}
.sidebar .sb-controls button:hover { color: var(--accent); background: var(--accent-faint); }

/* =========================================================
   V3 DOCS · integrations page
   New technique: client-card grid + namespaced config blocks
   ========================================================= */

/* Client logo / framing grid */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0 2rem;
}
.client-tile {
  border: 1px solid var(--rule);
  background: var(--card);
  border-radius: 8px;
  padding: 1rem 0.9rem;
  text-align: center;
  position: relative;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.client-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.client-tile .sym {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.8rem;
  color: var(--accent);
  display: block;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.client-tile .name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink);
  display: block;
}
.client-tile .meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-top: 0.3rem;
}
.client-tile.shipped::after {
  content: "live";
  position: absolute;
  top: -8px; right: 12px;
  background: var(--jade);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  padding: 1px 7px;
  border-radius: 3px;
}
.client-tile.via-mcp::after {
  content: "via MCP";
  position: absolute;
  top: -8px; right: 12px;
  background: var(--accent);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  padding: 1px 7px;
  border-radius: 3px;
}
.client-tile.via-sdk::after {
  content: "via SDK";
  position: absolute;
  top: -8px; right: 12px;
  background: var(--ink-mute);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  padding: 1px 7px;
  border-radius: 3px;
}

/* Namespaced config block — header with client label + filename */
.config-block {
  margin: 1.25rem 0 2rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card);
}
.config-block-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.95rem;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-deep);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--ink-mute);
}
.config-block-bar .who {
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
.config-block-bar .where {
  margin-left: auto;
  color: var(--ink-soft);
  font-size: 11.5px;
  letter-spacing: 0;
}
.config-block pre {
  margin: 0;
  padding: 0.95rem 1.1rem;
  font-size: 12.5px;
  line-height: 1.6;
  background: var(--card);
  border-radius: 0;
}

/* Compatibility matrix — for the bottom of the page */
.compat-matrix {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 13px;
}
.compat-matrix thead th {
  text-align: left;
  padding: 0.55rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
  border-bottom: 1px solid var(--accent-line);
}
.compat-matrix tbody td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px dashed var(--rule);
  vertical-align: top;
  color: var(--ink-soft);
}
.compat-matrix tbody td:first-child {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
}
.compat-matrix tbody td .yes { color: var(--jade); font-weight: 500; }
.compat-matrix tbody td .no  { color: var(--ink-faint); }
