/* qlim8 Developer Portal — shared styles */

:root {
  --bg:           hsl(210, 40%, 98%);
  --bg-alt:       hsl(210, 20%, 96%);
  --fg:           hsl(220, 15%, 25%);
  --muted:        hsl(220, 10%, 55%);
  --border:       hsl(210, 20%, 92%);
  --card:         hsl(0, 0%, 100%);
  --primary:      hsl(220, 15%, 20%);
  --green:        hsl(160, 35%, 42%);
  --green-bg:     hsl(160, 40%, 95%);
  --purple:       hsl(280, 35%, 58%);
  --purple-bg:    hsl(280, 40%, 96%);
  --orange:       hsl(35, 80%, 58%);
  --orange-bg:    hsl(35, 80%, 96%);
  --code-bg:      hsl(220, 20%, 14%);
  --code-fg:      hsl(210, 30%, 88%);
  --radius:       12px;
  --radius-sm:    8px;
  --nav-h:        60px;
  --sidebar-w:    240px;
  --content-max:  760px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 2rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--primary);
  font-family: 'Manrope', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.nav-logo-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--fg);
  background: var(--bg-alt);
}

.nav-links a .badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--purple-bg);
  color: var(--purple);
  line-height: 1.4;
}

.nav-spacer { flex: 1; }

.nav-cta {
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  transition: opacity 0.15s;
}
.nav-cta:hover { opacity: 0.85; }

/* ── HERO ── */
.hero {
  padding: 5rem 2rem 4rem;
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--green-bg);
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 540px;
  margin: 0 auto 2rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  transition: opacity 0.15s, transform 0.1s;
}
.btn:hover { opacity: 0.85; transform: translateY(-1px); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--card); color: var(--fg); border: 1px solid var(--border); }

/* ── CARDS GRID ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: box-shadow 0.2s, transform 0.15s, border-color 0.2s;
}
.card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
  transform: translateY(-2px);
  border-color: hsl(210, 20%, 85%);
}

.card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.card-icon.green  { background: var(--green-bg); }
.card-icon.purple { background: var(--purple-bg); }
.card-icon.orange { background: var(--orange-bg); }
.card-icon.dark   { background: var(--bg-alt); }

.card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}

.card-arrow {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ── SECTION HEADER ── */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-header {
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.section-header p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ── CODE SNIPPET ── */
.snippet-block {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
}

.snippet-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.snippet-tab {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: transparent;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}
.snippet-tab.active {
  background: var(--code-bg);
  color: var(--code-fg);
  border-color: var(--border);
  border-bottom: 1px solid var(--code-bg);
  margin-bottom: -1px;
}

/* ── CODE BLOCKS ── */
pre, .code-block {
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.825rem;
  line-height: 1.7;
}

code:not([class]) {
  background: var(--bg-alt);
  color: var(--fg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
}

pre code { background: none; color: inherit; padding: 0; font-size: inherit; }

/* Token colours (minimal, hand-rolled) */
.tok-comment  { color: hsl(210, 15%, 55%); }
.tok-string   { color: hsl(90, 50%, 68%); }
.tok-key      { color: hsl(200, 70%, 72%); }
.tok-number   { color: hsl(35, 80%, 70%); }
.tok-keyword  { color: hsl(280, 50%, 75%); }
.tok-fn       { color: hsl(200, 60%, 75%); }
.tok-punct    { color: hsl(210, 25%, 65%); }

/* ── DOCS LAYOUT ── */
.docs-layout {
  display: flex;
  min-height: calc(100vh - var(--nav-h));
  max-width: 1280px;
  margin: 0 auto;
}

.docs-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  padding: 2rem 1rem 4rem 1.5rem;
  border-right: 1px solid var(--border);
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 1.75rem;
}

.sidebar-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0.5rem;
  margin-bottom: 0.4rem;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-nav a {
  display: block;
  text-decoration: none;
  font-size: 0.84rem;
  color: var(--muted);
  padding: 0.32rem 0.5rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--fg);
  background: var(--bg-alt);
}

.sidebar-nav a.active {
  color: var(--primary);
  font-weight: 600;
}

/* ── DOCS CONTENT ── */
.docs-content {
  flex: 1;
  min-width: 0;
  padding: 2.5rem 3rem 6rem;
  max-width: calc(var(--content-max) + 6rem);
}

.docs-content h1 {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.docs-content .page-desc {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
}

.docs-content h2 {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--primary);
  margin: 3rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.docs-content h2:first-of-type { margin-top: 0; border-top: none; padding-top: 0; }

.docs-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 2rem 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.docs-content h3 code {
  font-size: 0.9em;
  background: var(--bg-alt);
  padding: 0.1em 0.4em;
  border-radius: 5px;
}

.docs-content p { margin-bottom: 1rem; font-size: 0.925rem; }

.docs-content ul, .docs-content ol {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
  font-size: 0.925rem;
}

.docs-content li { margin-bottom: 0.3rem; }

.docs-content pre { margin: 1rem 0 1.5rem; }

.docs-content a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.docs-content a:hover { border-bottom-color: var(--green); }

/* ── CALLOUT ── */
.callout {
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
  font-size: 0.875rem;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.callout-icon { flex-shrink: 0; margin-top: 0.05rem; }

.callout.info  { background: hsl(210, 60%, 96%); color: hsl(210, 50%, 35%); }
.callout.warn  { background: hsl(45, 90%, 95%); color: hsl(35, 70%, 30%); }
.callout.green { background: var(--green-bg); color: hsl(160, 40%, 28%); }

/* ── BADGE ── */
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.tag.green  { background: var(--green-bg);  color: var(--green); }
.tag.purple { background: var(--purple-bg); color: var(--purple); }
.tag.orange { background: var(--orange-bg); color: var(--orange); }
.tag.dark   { background: var(--bg-alt);    color: var(--muted); }

/* ── TABLE ── */
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 1rem 0 1.5rem;
}

.docs-content th {
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.docs-content td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.docs-content tr:last-child td { border-bottom: none; }

/* ── TOOL CARD ── */
.tool-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1.5rem 0;
  overflow: hidden;
}

.tool-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.2rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
}

.tool-card-header h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-card-tags { display: flex; gap: 0.4rem; flex-shrink: 0; }

.tool-card-desc {
  padding: 0.85rem 1.2rem;
  font-size: 0.875rem;
  color: var(--muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-style: italic;
}

.tool-card-body { padding: 1.2rem; }

/* ── DIVIDER ── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ── FOOTER ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .docs-sidebar { display: none; }
  .docs-content { padding: 1.5rem 1.25rem 4rem; }
}

@media (max-width: 640px) {
  .nav { padding: 0 1rem; gap: 0.75rem; }
  .nav-links { display: none; }
  .hero { padding: 3rem 1.25rem 2.5rem; }
  .cards { padding: 0 1.25rem 3rem; }
  .snippet-block { padding: 0 1.25rem 3rem; }
  .section { padding: 0 1.25rem; }
}
