/* Tremorline user manual (docs.tremorline.com): same palette and type as the website and the app. */
/* Self-hosted (no requests to font services): Space Grotesk for headings, Inter for text, JetBrains Mono for code. */
@font-face { font-family: "Space Grotesk"; src: url("fonts/space-grotesk-latin-wght-normal.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-2: #eff0f6;
  --line: #dcdee8;
  --fg: #14182b;
  --muted: #5b6078;
  --accent: #4338ca;
  --accent-fg: #ffffff;
  --accent-soft: #eae8fb;
  --ok: #1d7a46;
  --ok-bg: #e2f3e9;
  --warn: #8a5a00;
  --warn-bg: #fdf0d5;
  --bad: #b3261e;
  --bad-bg: #fbe4e2;
  --neutral-bg: #e9eaf2;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1220;
    --surface: #171b2e;
    --surface-2: #1e2338;
    --line: #2c3250;
    --fg: #e8eaf3;
    --muted: #9aa0ba;
    --accent: #a5a0ff;
    --accent-fg: #0f1220;
    --accent-soft: #25234a;
    --ok: #6fd39b;
    --ok-bg: #173527;
    --warn: #f2c260;
    --warn-bg: #3a2e12;
    --bad: #ff8b82;
    --bad-bg: #3e1d1b;
    --neutral-bg: #252a42;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.65 var(--font); }
h1, h2, h3 { line-height: 1.25; text-wrap: balance; font-family: var(--font-display); }
a { color: var(--accent); }
code, pre, kbd { font-family: var(--mono); font-size: 0.86em; }
:not(pre) > code { padding: 1px 5px; border-radius: 4px; background: var(--surface-2); overflow-wrap: anywhere; }
pre { margin: 16px 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; line-height: 1.55; }
img { max-width: 100%; height: auto; }

.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 600 1.15rem var(--font-display); letter-spacing: -0.01em; color: var(--fg); text-decoration: none; }
.brand small { font: 500 0.95rem var(--font); color: var(--muted); }
.top nav { display: flex; align-items: center; gap: 20px; }
.top nav a:not(.button) { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.top nav a:not(.button):hover { color: var(--fg); }
@media (max-width: 640px) { .top nav a:not(.button) { display: none; } }
.button { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 8px; background: var(--accent); color: var(--accent-fg); font: 600 0.9rem var(--font); text-decoration: none; white-space: nowrap; }
.button:hover { filter: brightness(1.08); }
a:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

/* Two columns: contents on the left, text on the right; one column on small screens. */
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.toc { position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 64px); overflow-y: auto; padding: 32px 0; font-size: 0.92rem; }
.toc p { margin: 0 0 8px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc ol ol { padding-left: 14px; margin-bottom: 6px; }
.toc a { display: block; padding: 3px 0; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--fg); }
@media (max-width: 900px) {
  .toc { position: static; max-height: none; padding: 24px 0 0; }
  .toc ol ol { display: none; }
  .toc > ol { columns: 2; column-gap: 24px; }
}

article { max-width: 760px; padding: 32px 0 48px; }
article h1 { margin: 0; font-size: clamp(2rem, 4vw, 2.6rem); letter-spacing: -0.02em; }
article .lead { font-size: 1.12rem; color: var(--muted); margin-top: 12px; }
article h2 { margin: 64px 0 0; padding-top: 24px; border-top: 1px solid var(--line); font-size: 1.6rem; letter-spacing: -0.01em; }
article h3 { margin: 36px 0 0; font-size: 1.18rem; }
article h4 { margin: 24px 0 0; font-size: 1rem; }
article p, article ul, article ol { margin: 12px 0 0; }
article li + li { margin-top: 4px; }
article figure { margin: 20px 0 0; }
article figure img { display: block; border: 1px solid var(--line); border-radius: var(--radius); }
article figcaption { margin-top: 8px; font-size: 0.88rem; color: var(--muted); }
.muted { color: var(--muted); }
.ui { font-weight: 600; }

.note { margin: 20px 0 0; padding: 12px 16px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--radius) var(--radius) 0; }
.note.warn { border-color: var(--warn); background: var(--warn-bg); }
.note p:first-child { margin-top: 0; }

.table-scroll { margin: 16px 0 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }

.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; background: var(--neutral-bg); color: var(--fg); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 40px; }
.steps > li + li { margin-top: 12px; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 1px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 0.85rem; }

dl.terms { margin: 16px 0 0; }
dl.terms dt { font-weight: 600; margin-top: 14px; }
dl.terms dd { margin: 2px 0 0; color: var(--muted); }

footer { border-top: 1px solid var(--line); padding: 28px 16px 40px; color: var(--muted); font-size: 0.9rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; max-width: 1200px; margin: 0 auto; }
footer nav { display: flex; gap: 20px; }
footer a { color: var(--muted); }
