/* Equinox docs: the terminal's tokens (app/globals.css), dark by default. */

:root {
  --t-bg: #141715;
  --t-surface: #191c1a;
  --t-surface-2: #1b1e1c;
  --t-surface-3: #1e211f;
  --t-border: #252826;
  --t-border-strong: #6f6967;
  --t-text: #f8f4f3;
  --t-text-2: #989493;
  --t-text-3: #8f8a88;
  --t-up: #3abf72;
  --t-down: #e86666;
  --t-accent: #e7963d;
  --t-code: #1e211f;
  --font-ui: "Poppins", ui-sans-serif, system-ui, sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --t-bg: #fcf7f6;
  --t-surface: #ffffff;
  --t-surface-2: #f5f1ef;
  --t-surface-3: #ebe7e5;
  --t-border: #e1dddb;
  --t-border-strong: #8a827f;
  --t-text: #110c0a;
  --t-text-2: #5d5654;
  --t-text-3: #645d5b;
  --t-up: #136b33;
  --t-down: #b92c26;
  --t-accent: #7f4900;
  --t-code: #f5f1ef;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--t-bg);
  color: var(--t-text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--t-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--font-data); font-size: 0.86em; }
:not(pre) > code { padding: 1px 5px; border-radius: 5px; background: var(--t-code); border: 1px solid var(--t-border); }
:focus-visible { outline: 2px solid var(--t-accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- top bar (the app's) ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid var(--t-border);
  background: color-mix(in srgb, var(--t-bg) 88%, transparent);
  backdrop-filter: blur(10px);
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--t-text); font-size: 19px; font-weight: 600; letter-spacing: -0.03em; }
.brand:hover { text-decoration: none; }
.brand img { width: 24px; height: 24px; border-radius: 50%; }
.badge { border: 1px solid var(--t-border); border-radius: 5px; padding: 0 6px; font-size: 11px; font-weight: 500; color: var(--t-text-3); }
.topbar .spacer { flex: 1; }
.iconbtn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--t-text-2);
  cursor: pointer;
}
.iconbtn:hover { background: var(--t-surface-3); color: var(--t-text); }
.openapp {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--t-text);
  color: var(--t-bg);
  font-size: 13px;
  font-weight: 600;
}
.openapp:hover { opacity: 0.88; text-decoration: none; }
.menubtn { display: none; }

/* ---------- layout ---------- */

.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); max-width: 1280px; margin: 0 auto; }
.sidebar {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 24px 16px 40px 20px;
  border-right: 1px solid var(--t-border);
  scrollbar-width: thin;
}
.sidebar h4 { margin: 18px 0 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t-text-3); }
.sidebar h4:first-child { margin-top: 0; }
.sidebar a { display: block; padding: 4px 10px; margin: 1px 0; border-radius: 6px; color: var(--t-text-2); font-size: 13.5px; }
.sidebar a:hover { background: var(--t-surface-3); color: var(--t-text); text-decoration: none; }
.sidebar a.active { background: var(--t-surface-3); color: var(--t-text); box-shadow: inset 2px 0 0 var(--t-accent); }

main { min-width: 0; padding: 40px 48px 120px; }
.content { max-width: 860px; }

/* ---------- type ---------- */

.hero { margin-bottom: 40px; padding-bottom: 32px; border-bottom: 1px solid var(--t-border); }
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--t-accent); }
h1 { margin: 6px 0 10px; font-size: 36px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.lede { margin: 0; font-size: 17px; color: var(--t-text-2); }
.logos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.logos span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px 0 6px;
  border: 1px solid var(--t-border);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--t-text-2);
}
.logos img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }

section { padding-top: 12px; margin-bottom: 44px; }
h2 { margin: 0 0 6px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
h2 .num { margin-right: 10px; font-family: var(--font-data); font-size: 15px; font-weight: 500; color: var(--t-text-3); }
h3 { margin: 28px 0 8px; font-size: 16.5px; font-weight: 600; }
p, li { color: color-mix(in srgb, var(--t-text) 86%, var(--t-text-2)); }
ul, ol { padding-left: 22px; }
li { margin: 4px 0; }
.sub { margin: 0 0 18px; color: var(--t-text-2); }

/* ---------- diagram cards ---------- */

figure {
  margin: 18px 0 22px;
  border: 1px solid var(--t-border);
  border-radius: 12px;
  background: var(--t-surface);
  overflow: hidden;
}
figure .diagram { padding: 22px 18px; overflow-x: auto; text-align: center; min-height: 80px; }
figure .diagram svg { max-width: 100%; height: auto; }
figcaption {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-top: 1px solid var(--t-border);
  font-size: 12.5px;
  color: var(--t-text-3);
}
figcaption b { color: var(--t-text-2); font-weight: 500; }
.mermaid-src { display: none; }
.diagram[data-state="loading"]::before { content: "Rendering diagram…"; font-size: 12px; color: var(--t-text-3); }

/* ---------- tables, callouts, facts ---------- */

.table { overflow-x: auto; margin: 14px 0 22px; border: 1px solid var(--t-border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 9px 14px; border-bottom: 1px solid var(--t-border); text-align: left; vertical-align: top; }
th { background: var(--t-surface-2); font-size: 12px; font-weight: 600; color: var(--t-text-2); }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

.callout {
  margin: 16px 0;
  padding: 12px 16px;
  border: 1px solid var(--t-border);
  border-left: 3px solid var(--t-accent);
  border-radius: 8px;
  background: var(--t-surface);
  font-size: 14px;
}
.callout p { margin: 0; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 18px 0 8px; }
.fact { padding: 14px; border: 1px solid var(--t-border); border-radius: 10px; background: var(--t-surface); }
.fact b { display: block; font-family: var(--font-data); font-size: 20px; font-weight: 500; color: var(--t-text); }
.fact span { font-size: 12px; color: var(--t-text-3); }
.fact b.up { color: var(--t-up); }

footer { margin-top: 60px; padding-top: 20px; border-top: 1px solid var(--t-border); font-size: 13px; color: var(--t-text-3); }

/* ---------- small screens ---------- */

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menubtn { display: inline-grid; }
  .sidebar {
    position: fixed;
    inset: 56px 0 0 0;
    z-index: 9;
    height: auto;
    background: var(--t-bg);
    border-right: 0;
    transform: translateX(-100%);
    transition: transform 220ms ease;
  }
  body.nav-open .sidebar { transform: none; }
  main { padding: 28px 16px 80px; }
  h1 { font-size: 28px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .badge { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sidebar { transition: none; }
}
