/* ============================================
   Projekt — Developers wiki
   Public-facing API docs. Shares the landing
   palette (ink + accent + Inter/Space Grotesk)
   but uses a sidebar + content layout instead
   of the cinematic hero one.
   ============================================ */

:root {
  --ink:           #0D0D0D;
  --ink-2:         #141418;
  --ink-3:         #1C1C22;
  --ink-4:         #25252D;
  --accent:        #FF214E;
  --accent-soft:   rgba(255, 33, 78, 0.14);
  --accent-glow:   rgba(255, 33, 78, 0.55);
  --text:          #F5F5F7;
  --text-2:        rgba(255, 255, 255, 0.62);
  --text-3:        rgba(255, 255, 255, 0.42);
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --code-bg:       #0A0A0E;
  --green:         #34d399;
  --amber:         #fbbf24;
  --red:           #f87171;
  --blue:          #60a5fa;
  --purple:        #a78bfa;
  --gutter:        clamp(20px, 4vw, 40px);
  --content-max:   880px;
  --sidebar-w:     260px;
  --font-sans:     'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  --font-display:  'Space Grotesk', 'Inter', sans-serif;
  --font-mono:     'JetBrains Mono', 'SF Mono', Menlo, Monaco, Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--ink);
  color: var(--text);
  line-height: 1.6;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: #ff476b; }

/* ── Topbar ─────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.topbar-brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 700; font-size: 17px; letter-spacing: -0.01em;
}
.topbar-brand img { width: 28px; height: 28px; border-radius: 7px; }
.topbar-brand .badge {
  margin-left: 10px;
  padding: 3px 10px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--accent-soft);
  color: #ffb3c4;
  border: 1px solid rgba(255, 33, 78, 0.30);
  border-radius: 999px;
}
.topbar-nav { display: flex; align-items: center; gap: 6px; }
.topbar-nav a {
  color: var(--text-2); font-size: 14px; font-weight: 500;
  padding: 8px 14px; border-radius: 999px;
  transition: color .2s, background .2s;
}
.topbar-nav a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.topbar-nav .cta {
  background: var(--accent); color: #fff; font-weight: 600;
}
.topbar-nav .cta:hover { background: #ff3a64; color: #fff; }
@media (max-width: 720px) {
  .topbar-nav a:not(.cta):not(.app-link) { display: none; }
}

/* ── Layout ────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 0;
  min-height: calc(100vh - 64px);
}
@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static !important; height: auto !important; border-right: none !important; border-bottom: 1px solid var(--border); }
}

.sidebar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 32px 20px 32px var(--gutter);
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
}
.sidebar-group { margin-bottom: 28px; }
.sidebar-group-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3);
  padding: 0 12px; margin-bottom: 8px;
}
.sidebar-item {
  display: block;
  padding: 7px 12px;
  margin-bottom: 1px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 14px; font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.sidebar-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.sidebar-item.active {
  background: var(--accent-soft);
  color: #ffb3c4;
  border-left: 2px solid var(--accent);
  border-top-left-radius: 0; border-bottom-left-radius: 0;
}

.main {
  padding: 48px var(--gutter) 96px;
  max-width: calc(var(--content-max) + var(--gutter) * 2);
}
.main > * { max-width: var(--content-max); }

/* ── Typography ───────────────────────────────── */
.eyebrow {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: #ffb3c4;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 33, 78, 0.28);
  border-radius: 999px;
  margin-bottom: 16px;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}
h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 56px;
  margin-bottom: 14px;
  scroll-margin-top: 96px;
}
h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 32px;
  margin-bottom: 10px;
  scroll-margin-top: 96px;
}
h4 {
  font-size: 15px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--text-2);
}

.lead {
  font-size: 19px;
  line-height: 1.55;
  color: var(--text-2);
  margin-bottom: 32px;
  max-width: 720px;
}

p { margin-bottom: 14px; color: var(--text-2); }
p strong, li strong { color: var(--text); font-weight: 600; }

ul, ol { margin: 0 0 18px 20px; color: var(--text-2); }
li { margin-bottom: 6px; }
li > code { margin: 0 1px; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

/* ── Code ─────────────────────────────────────── */
code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--ink-3);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
  color: #ffd1da;
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 16px 0 22px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.55;
  position: relative;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: inherit;
}
pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 10px; right: 14px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3);
}
.tok-key  { color: var(--purple); }
.tok-str  { color: var(--green); }
.tok-num  { color: var(--amber); }
.tok-com  { color: var(--text-3); font-style: italic; }
.tok-fn   { color: var(--blue); }
.tok-op   { color: #f0abfc; }
.tok-meth { color: var(--accent); font-weight: 600; }

/* ── Callouts ─────────────────────────────────── */
.callout {
  margin: 22px 0;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--ink-2);
  display: flex; gap: 14px; align-items: flex-start;
}
.callout-icon {
  flex: 0 0 24px;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  font-family: var(--font-display);
}
.callout-body { color: var(--text); font-size: 14.5px; line-height: 1.55; }
.callout-body strong { display: block; margin-bottom: 4px; }
.callout-body p { color: var(--text-2); margin-bottom: 0; }

.callout-note    { border-color: rgba(96, 165, 250, 0.30); background: rgba(96, 165, 250, 0.06); }
.callout-note    .callout-icon { background: rgba(96, 165, 250, 0.25); color: var(--blue); }
.callout-warn    { border-color: rgba(251, 191, 36, 0.30); background: rgba(251, 191, 36, 0.06); }
.callout-warn    .callout-icon { background: rgba(251, 191, 36, 0.25); color: var(--amber); }
.callout-danger  { border-color: rgba(248, 113, 113, 0.30); background: rgba(248, 113, 113, 0.06); }
.callout-danger  .callout-icon { background: rgba(248, 113, 113, 0.25); color: var(--red); }
.callout-tip     { border-color: rgba(52, 211, 153, 0.30); background: rgba(52, 211, 153, 0.06); }
.callout-tip     .callout-icon { background: rgba(52, 211, 153, 0.25); color: var(--green); }

/* ── Tables ───────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 18px 0 24px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  font-weight: 600;
  color: var(--text-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--ink-2);
  border-bottom: 1px solid var(--border-strong);
}
td { color: var(--text-2); }
td code, td.method { font-size: 12.5px; }

/* HTTP method pills */
.method {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--ink-3);
  border: 1px solid var(--border);
}
.method.get    { color: var(--blue);   border-color: rgba(96, 165, 250, 0.35); background: rgba(96, 165, 250, 0.08); }
.method.post   { color: var(--green);  border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.method.put,
.method.patch  { color: var(--amber);  border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.method.delete { color: var(--red);    border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }

.status-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--ink-3);
}
.status-2xx { color: var(--green);  background: rgba(52, 211, 153, 0.08); }
.status-3xx { color: var(--blue);   background: rgba(96, 165, 250, 0.08); }
.status-4xx { color: var(--amber);  background: rgba(251, 191, 36, 0.08); }
.status-5xx { color: var(--red);    background: rgba(248, 113, 113, 0.08); }

/* ── Hub cards (index page) ───────────────────── */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 36px 0 48px;
}
.hub-card {
  display: block;
  padding: 24px;
  border-radius: 16px;
  background: var(--ink-2);
  border: 1px solid var(--border);
  color: var(--text);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.hub-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 33, 78, 0.40);
  background: linear-gradient(135deg, var(--ink-2) 0%, var(--ink-3) 100%);
  color: var(--text);
}
.hub-card .hub-card-tag {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.hub-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
.hub-card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
}

/* ── Anchors on headings ──────────────────────── */
h2 a.anchor,
h3 a.anchor {
  color: var(--text-3);
  font-size: 0.7em;
  margin-left: 8px;
  opacity: 0;
  transition: opacity .15s ease;
}
h2:hover a.anchor,
h3:hover a.anchor { opacity: 1; }

/* ── Footer ───────────────────────────────────── */
.footer {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer a { color: var(--text-2); }
.footer a:hover { color: var(--text); }

/* ── Scalar reference page overrides ──────────── */
.reference-shell {
  margin: 0;
  padding: 0;
  max-width: none;
}
.reference-shell .scalar-app { min-height: calc(100vh - 64px); }
