/* The Signal API docs — Return on Security brand system.
   Tokens mirror the app (src/index.css / tailwind.config):
   Electric Purple #633FF3 · Energy Green #CFF204 · slate ink · Barlow/Inter/JetBrains Mono. */

:root {
  --ros-purple: #633ff3;
  --ros-purple-700: #4a2fb8;
  --ros-green: #cff204;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #64748b;
  --line: #e5e7eb;
  --bg: #ffffff;
  --bg-2: #f8f8fb;
  --bg-3: #f1f0f6;
  --code-bg: #0f1320;
  --code-ink: #e2e8f0;
  --radius: 10px;
  --radius-sm: 7px;
  --maxw: 1180px;
  --sidebar-w: 248px;
  --header-h: 60px;
  --font-display: 'Barlow Semi Condensed', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--ros-purple); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-transform: uppercase;
}
.brand:hover { text-decoration: none; }
.brand .diamond {
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  border-radius: 3px;
  background: linear-gradient(135deg, var(--ros-purple) 0%, var(--ros-purple-700) 100%);
  box-shadow: 0 0 0 3px rgba(99, 63, 243, 0.14);
}
.brand .api-tag { color: var(--ros-purple); }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.site-nav a { color: var(--ink-2); font-size: 14px; font-weight: 500; }
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.btn-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  background: var(--ros-purple);
  color: #fff !important;
  font-weight: 600;
  font-size: 13.5px;
  transition: background 0.15s ease;
}
.btn-key:hover { background: var(--ros-purple-700); text-decoration: none; }

/* ---------- Layout ---------- */
.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 48px;
  padding: 0 24px;
}

.sidebar {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 32px 0 48px;
}
.sidebar .group {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  margin: 22px 0 8px;
}
.sidebar .group:first-child { margin-top: 0; }
.sidebar a {
  display: block;
  padding: 6px 12px;
  margin: 1px 0;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 14px;
  border-left: 2px solid transparent;
}
.sidebar a:hover { background: var(--bg-2); color: var(--ink); text-decoration: none; }
.sidebar a.active {
  color: var(--ros-purple);
  background: rgba(99, 63, 243, 0.07);
  border-left-color: var(--ros-purple);
  font-weight: 600;
}
.sidebar .ref-link { color: var(--ink); font-weight: 600; }

/* ---------- Content ---------- */
.content { padding: 40px 0 96px; min-width: 0; }

.hero { padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 36px; }
.eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ros-purple);
  margin-bottom: 10px;
}
h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 46px;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
}
.lede { font-size: 18px; color: var(--ink-2); max-width: 60ch; margin: 0; }

section { scroll-margin-top: calc(var(--header-h) + 16px); padding-top: 18px; margin-bottom: 28px; }
h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.01em;
  margin: 16px 0 12px;
  padding-top: 12px;
}
h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; margin: 22px 0 8px; }
p { margin: 10px 0; }
.content p, .content li { color: #25303f; }
ul, ol { padding-left: 22px; }
li { margin: 5px 0; }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-3);
  color: var(--ros-purple-700);
  padding: 2px 6px;
  border-radius: 5px;
}

pre {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 18px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.65;
  margin: 14px 0;
  border: 1px solid #1e293b;
}
pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
pre .tok-cmd { color: var(--ros-green); }
pre .tok-flag { color: #93c5fd; }
pre .tok-str { color: #fcd34d; }
pre .tok-var { color: #c4b5fd; }

/* Callouts */
.note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--ros-purple);
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  margin: 16px 0;
  font-size: 14.5px;
}
.note.warn { border-left-color: #d97706; }
.note strong { font-weight: 600; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 18px 0; }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { border-color: rgba(99, 63, 243, 0.4); box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05); }
.card .k { font-family: var(--font-display); font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.card .v { font-size: 13.5px; color: var(--ink-3); }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 600;
}
td code { font-size: 13px; }
.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(99, 63, 243, 0.1);
  color: var(--ros-purple-700);
}

/* Clickable "get started" cards */
.card.link { display: block; }
.card.link:hover { text-decoration: none; }
.card.link .k { color: var(--ros-purple); display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* "What you can build" — audience-grouped use cases */
.audience { margin: 6px 0 24px; }
.audience > h3 {
  margin: 0 0 6px;
  padding-bottom: 7px;
  border-bottom: 2px solid var(--bg-3);
  display: flex;
  align-items: center;
  gap: 9px;
}
.audience > h3::before {
  content: '';
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
  border-radius: 2px;
  background: linear-gradient(135deg, var(--ros-purple), var(--ros-purple-700));
}
.build-list { list-style: none; padding: 0; margin: 0; }
.build-list li { padding: 10px 0; border-bottom: 1px solid var(--bg-3); }
.build-list li:last-child { border-bottom: none; }
.build-list strong { font-weight: 600; color: var(--ink); }
.eps {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ros-purple-700);
  margin-top: 4px;
  opacity: 0.85;
}

/* "Why The Signal API" */
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin: 18px 0; }
.why-item .k { font-family: var(--font-display); font-weight: 600; font-size: 16.5px; margin-bottom: 5px; }
.why-item .v { color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }

.footer { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 20px; color: var(--ink-3); font-size: 13.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; gap: 0; }
  .sidebar { display: none; }
  .site-nav a:not(.btn-key) { display: none; }
  h1 { font-size: 36px; }
}
