/* CLQ docs — shared styles */

:root {
  --bg: #0f0f0f;
  --bg-raised: #1a1a1a;
  --bg-code: #161616;
  --border: #2a2a2a;
  --text: #e8e8e8;
  --text-muted: #888;
  --accent: #d4d4d4;
  --link: #a8c4ff;
  --link-hover: #c8daff;
  --green: #4ade80;
  --red: #f87171;
  --yellow: #fbbf24;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", ui-monospace,
    "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --max-width: 820px;
  --radius: 6px;
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  min-height: 100vh;
}

/* ── Nav ── */
nav {
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 52px;
  position: sticky;
  top: 0;
  background: rgba(15, 15, 15, 0.95);
  backdrop-filter: blur(8px);
  z-index: 100;
}

nav .brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s;
}

nav a:hover,
nav a.active {
  color: var(--text);
}

nav .nav-links {
  display: flex;
  gap: 1.5rem;
}

nav .nav-right {
  margin-left: auto;
  display: flex;
  gap: 1rem;
  align-items: center;
}

nav .github-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── Main layout ── */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* ── Typography ── */
h1 {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin: 1.75rem 0 0.5rem;
  font-family: var(--font-mono);
}

h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 1.25rem 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

p {
  margin-bottom: 1rem;
  color: var(--text);
}
p:last-child {
  margin-bottom: 0;
}

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

ul,
ol {
  margin: 0.5rem 0 1rem 1.5rem;
  color: var(--text);
}
li {
  margin-bottom: 0.3rem;
}

strong {
  color: var(--accent);
  font-weight: 600;
}

/* ── Code ── */
code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-code);
  border: 1px solid var(--border);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  color: #d4d4d4;
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1rem 0;
  line-height: 1.55;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text);
}

/* Minimal syntax tinting */
.token-kw {
  color: #c792ea;
}
.token-str {
  color: #c3e88d;
}
.token-cmt {
  color: #546e7a;
  font-style: italic;
}
.token-fn {
  color: #82aaff;
}
.token-num {
  color: #f78c6c;
}
.token-type {
  color: #ffcb6b;
}

/* ── Terminal output blocks ── */
.terminal {
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  margin: 1rem 0;
  overflow-x: auto;
}

.terminal .prompt {
  color: var(--text-muted);
}
.terminal .cmd {
  color: var(--text);
}
.terminal .ok {
  color: var(--green);
}
.terminal .err {
  color: var(--red);
}
.terminal .warn {
  color: var(--yellow);
}
.terminal .dim {
  color: #555;
}

/* ── Cards / callouts ── */
.callout {
  border-left: 3px solid var(--border);
  padding: 0.75rem 1rem;
  background: var(--bg-raised);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.25rem 0;
}

.callout.warn {
  border-color: var(--yellow);
}
.callout.info {
  border-color: var(--link);
}
.callout.ok {
  border-color: var(--green);
}
.callout.err {
  border-color: var(--red);
}

.callout p {
  margin-bottom: 0;
  font-size: 0.9rem;
}
.callout p:not(:last-child) {
  margin-bottom: 0.5rem;
}

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

/* ── Hero section ── */
.hero {
  margin-bottom: 2.5rem;
}

.hero .tagline {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 560px;
}

.hero .badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

/* ── Install strip ── */
.install-strip {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin: 1rem 0;
}

.install-strip .dollar {
  color: var(--text-muted);
}

/* ── Command cards (CLI page) ── */
.cmd-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--bg-raised);
}

.cmd-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}
.cmd-card .syntax {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

/* ── Security page ── */
.finding {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1.5rem 0;
  overflow: hidden;
}

.finding .finding-header {
  padding: 0.75rem 1rem;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  align-items: center;
}

.finding .finding-header .badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.2em 0.6em;
  border-radius: 3px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-fixed {
  background: #1a3a1a;
  color: var(--green);
}
.badge-medium {
  background: #2a2a0a;
  color: var(--yellow);
}
.badge-low {
  background: #1a1a2a;
  color: var(--link);
}
.badge-open {
  background: #2a1a1a;
  color: var(--red);
}

.finding .finding-body {
  padding: 1rem 1rem 1.25rem;
}
.finding .finding-body p:first-child {
  margin-top: 0;
}

/* ── Changelog page ── */
#releases-list .release {
  border-bottom: 1px solid var(--border);
  padding: 2rem 0;
}

#releases-list .release:last-child {
  border-bottom: none;
}

#releases-list .release-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

#releases-list .release-tag {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

#releases-list .release-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

#releases-list .release-body h3 {
  margin-top: 1rem;
  border-bottom: none;
}
#releases-list .release-body ul {
  margin-left: 1.25rem;
}
#releases-list .release-body p {
  font-size: 0.95rem;
}

.loading {
  color: var(--text-muted);
  font-style: italic;
  padding: 2rem 0;
}

/* ── Table ── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1rem 0;
}

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

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

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

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

footer a {
  color: var(--text-muted);
}
footer a:hover {
  color: var(--text);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  main {
    padding: 2rem 1rem 4rem;
  }
  nav {
    gap: 1rem;
    padding: 0 1rem;
  }
  .nav-links a:not(:first-child) {
    display: none;
  }
  h1 {
    font-size: 1.4rem;
  }
  .install-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}
