/* ThunderStats docs — shares the design tokens of the landing page (index.html).
   Kept as a separate stylesheet because the docs are multi-page; index.html
   keeps its own inline styles so nothing here can regress the marketing page. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0b0f1a;
  --bg-2: #101524;
  --bg-3: #161d30;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #e7eaf2;
  --mute: #9aa4bd;
  --dim: #6b7490;
  --accent: #a5b4fc;
  --accent-2: #fbbf24;
  --accent-3: #6ee7b7;
  --red: #fb7185;
}

html { scroll-behavior: smooth; background: var(--bg); }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11';
  line-height: 1.65;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(800px 500px at 15% -10%, rgba(165, 180, 252, 0.10), transparent 60%),
    radial-gradient(700px 400px at 90% 10%, rgba(251, 191, 36, 0.05), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

/* ---------- Navigation (mirrors index.html) ---------- */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px) saturate(140%);
  background: rgba(11, 15, 26, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}
.brand-mark { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }
.brand-mark svg { width: 100%; height: 100%; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 14px; }
.nav-links a { color: var(--mute); transition: color 0.15s; }
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }
.nav-links a.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--accent-2);
  color: #1a1205;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.4), 0 8px 20px -8px rgba(251, 191, 36, 0.5);
}
.nav-links a.nav-cta:hover { transform: translateY(-1px); background: #fcd34d; }
@media (max-width: 860px) { .nav-links .hide-m { display: none; } }

/* ---------- Docs layout ---------- */
.docs-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 56px;
  padding: 48px 0 96px;
  align-items: start;
}
.sidebar { position: sticky; top: 78px; font-size: 14px; }
.sidebar h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--dim);
  font-weight: 600;
  margin: 24px 0 10px;
}
.sidebar h4:first-child { margin-top: 0; }
.sidebar a {
  display: block;
  padding: 6px 12px;
  margin-left: -12px;
  color: var(--mute);
  border-radius: 8px;
  transition: all 0.15s;
}
.sidebar a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.sidebar a.current {
  color: var(--text);
  background: rgba(165, 180, 252, 0.10);
  box-shadow: inset 2px 0 0 var(--accent);
}
@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; gap: 32px; padding-top: 32px; }
  .sidebar { position: static; border-bottom: 1px solid var(--line); padding-bottom: 24px; }
}

/* ---------- Docs content ---------- */
.content { max-width: 780px; min-width: 0; }
.content .kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}
.content h1 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.content h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 27px;
  letter-spacing: -0.02em;
  margin: 56px 0 16px;
  padding-top: 8px;
  scroll-margin-top: 90px;
}
.content h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 32px 0 10px;
  letter-spacing: -0.01em;
  scroll-margin-top: 90px;
}
.content p { color: var(--mute); margin-bottom: 16px; }
.content .lead { font-size: 18px; color: var(--text); margin-bottom: 32px; }
.content ul, .content ol { color: var(--mute); margin: 0 0 16px 20px; }
.content li { margin-bottom: 8px; }
.content a:not(.card):not(.next-link) {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.content a:not(.card):not(.next-link):hover { color: var(--text); }
.content strong { color: var(--text); font-weight: 600; }
.content hr { border: none; border-top: 1px solid var(--line); margin: 48px 0; }

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875em;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 2px 6px;
  border-radius: 5px;
}

/* ---------- Code blocks ---------- */
.code-card {
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
  margin: 0 0 24px;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.code-head .file { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--mute); }
.code-card pre {
  padding: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  overflow-x: auto;
}
.code-card pre code { background: none; padding: 0; font-size: inherit; }
.tok-cmt { color: var(--dim); }
.tok-tag { color: #f9a8d4; }
.tok-attr { color: var(--accent-2); }
.tok-str { color: var(--accent-3); }
.tok-kw { color: var(--accent); }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dim);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--mute); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td:first-child { white-space: nowrap; color: var(--text); }

/* ---------- Callouts ---------- */
.note {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 12px;
  margin: 0 0 24px;
  font-size: 14.5px;
  background: rgba(165, 180, 252, 0.07);
  border: 1px solid rgba(165, 180, 252, 0.22);
}
.note.warn { background: rgba(251, 191, 36, 0.07); border-color: rgba(251, 191, 36, 0.25); }
.note.good { background: rgba(110, 231, 183, 0.07); border-color: rgba(110, 231, 183, 0.22); }
.note-title { color: var(--text); font-weight: 600; display: block; margin-bottom: 3px; }
.note p { margin: 0; font-size: 14.5px; }
.note-icon { flex-shrink: 0; font-size: 16px; line-height: 1.5; }

/* ---------- Endpoint header ---------- */
.endpoint {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  margin-bottom: 20px;
}
.method {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  letter-spacing: 0.04em;
}
.method.post { background: rgba(110, 231, 183, 0.16); color: var(--accent-3); }
.method.get { background: rgba(165, 180, 252, 0.16); color: var(--accent); }
.endpoint .path { font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--text); }

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 32px 0;
}
.card {
  display: block;
  padding: 22px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: all 0.15s;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); background: var(--bg-3); }
.card h3 { margin: 0 0 6px; font-size: 16px; color: var(--text); font-weight: 600; }
.card p { margin: 0; font-size: 14px; color: var(--mute); }

/* ---------- Next link ---------- */
.next-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 12px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}
.next-link:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Footer (mirrors index.html) ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 40px;
  background: rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
}
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.foot-brand .brand { margin-bottom: 12px; }
.foot-brand p { font-size: 14px; color: var(--mute); max-width: 320px; }
.foot-col h5 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--dim);
  font-weight: 600;
  margin-bottom: 14px;
}
.foot-col a { display: block; font-size: 14px; color: var(--mute); margin-bottom: 9px; transition: color 0.15s; }
.foot-col a:hover { color: var(--text); }
.foot-bottom {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--dim);
}
@media (max-width: 720px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
