:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-secondary: #8b949e;
  --text-heading: #c9d1d9;
  --link: #58a6ff;
  --badge-bg: #1f6feb;
  --code-bg: #161b22;
  --btn-bg: #21262d;
  --btn-border: #30363d;
  --btn-hover: #8b949e;
  --accent: #3fb950;
  --warn-bg: #3b2607;
  --warn-border: #9e6a03;
  --warn-text: #e3b341;
  --tip-bg: #0b2e13;
  --tip-border: #238636;
  --tip-text: #3fb950;
}
[data-theme="light"] {
  --bg: #ffffff;
  --bg-card: #f6f8fa;
  --border: #d0d7de;
  --text: #1f2328;
  --text-secondary: #656d76;
  --text-heading: #1f2328;
  --link: #0969da;
  --badge-bg: #0969da;
  --code-bg: #f6f8fa;
  --btn-bg: #f3f4f6;
  --btn-border: #d0d7de;
  --btn-hover: #656d76;
  --accent: #1a7f37;
  --warn-bg: #fff8c5;
  --warn-border: #d4a72c;
  --warn-text: #9a6700;
  --tip-bg: #dafbe1;
  --tip-border: #2da44e;
  --tip-text: #1a7f37;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  padding: 2rem 1.5rem 3rem;
  max-width: 720px;
  margin: 0 auto;
  transition: background 0.2s, color 0.2s;
}

/* Logo header */
.logo-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin: -2rem -1.5rem 1.5rem;
  padding: 1.5rem;
  background: var(--bg);
  transition: background 0.2s;
}
.logo-icon { height: 160px; width: auto; }
:root:not([data-theme="light"]) .logo-icon { filter: invert(1); }
.header-right {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-left: auto;
  text-align: right;
}
.header-right a { font-size: 0.875rem; }
.header-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}
@media (max-width: 480px) {
  .logo-header {
    flex-direction: column;
    align-items: flex-start;
    margin: -2rem -1.5rem 1.5rem;
    padding: 1.5rem;
  }
  .header-right { text-align: left; margin-left: 0; }
  .header-meta { justify-content: flex-start; }
}

/* Version badge */
.version-badge {
  display: none;
  font-size: 0.75rem;
  background: var(--badge-bg);
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
}

/* Typography */
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin-bottom: 0.25rem; color: var(--text-heading); }
h2 { font-size: 1.2rem; margin: 2rem 0 0.75rem; color: var(--text-heading); }
h3 { font-size: 1rem; margin: 1.5rem 0 0.5rem; color: var(--text-heading); }
p { margin-bottom: 0.75rem; }
ul, ol { margin-bottom: 0.75rem; padding-left: 1.5rem; }
li { margin-bottom: 0.35rem; }
section { margin-bottom: 2rem; }
.note { color: var(--text-secondary); font-size: 0.8rem; margin-top: 0.25rem; }

/* Code */
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  transition: background 0.2s, border-color 0.2s;
}
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  color: var(--text);
}
p code, li code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
  font-size: 0.85em;
}

/* Theme toggle */
.theme-toggle {
  background: var(--btn-bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s, background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.theme-toggle:hover { color: var(--text); border-color: var(--btn-hover); }
.theme-toggle svg { width: 14px; height: 14px; fill: currentColor; }

/* Copy button */
.code-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.code-row pre { flex: 1; min-width: 0; margin-bottom: 0; }
.copy-btn {
  flex-shrink: 0;
  align-self: stretch;
  background: var(--btn-bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  line-height: 0;
  transition: color 0.15s, border-color 0.15s, background 0.2s;
}
.copy-btn:hover { color: var(--text); border-color: var(--btn-hover); }
.copy-btn.copied { color: var(--accent); border-color: var(--accent); }
.copy-btn svg { width: 16px; height: 16px; fill: currentColor; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  transition: background 0.2s, border-color 0.2s;
}
.card:hover { border-color: var(--link); }
.card h3 { font-size: 1rem; color: var(--text); margin: 0 0 0.15rem; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--link); text-decoration: none; }
.card p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 0; }
.card .distros { color: var(--text-secondary); font-size: 0.8rem; margin-bottom: 0.75rem; }
.card .deps { color: var(--text-secondary); font-size: 0.8rem; margin-bottom: 0.75rem; }
.card .deps strong { color: var(--text-heading); font-weight: 600; }
.card .code-row { margin-top: 0.75rem; margin-bottom: 0; }
.card .code-row pre { margin-bottom: 0; }

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  font-weight: 600;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.badge-soon { background: var(--border); color: var(--text-secondary); }

/* Downloads */
.asset-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
}
.asset-row .size { color: var(--text-secondary); font-size: 0.8rem; white-space: nowrap; }
.checksum-link { text-align: center; margin-top: 0.5rem; font-size: 0.85rem; }
#downloads { display: none; }
#fallback a { color: var(--link); }

/* Breadcrumb */
.breadcrumb { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1.5rem; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--link); }
.subtitle { color: var(--text-secondary); margin-bottom: 1.5rem; }

/* Callout boxes */
.callout {
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.callout-warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-text);
}
.callout-tip {
  background: var(--tip-bg);
  border: 1px solid var(--tip-border);
  color: var(--tip-text);
}
.callout strong { display: block; margin-bottom: 0.25rem; }
.callout p { margin-bottom: 0; }
.callout p + p { margin-top: 0.5rem; }

/* Navigation */
.nav-links {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}
.nav-links .next { margin-left: auto; }

/* Divider */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
  transition: border-color 0.2s;
}

/* Doc links */
.doc-links { list-style: none; margin-left: 0; }
.doc-links li { margin-bottom: 0.5rem; }
.doc-links .desc { color: var(--text-secondary); }

/* Anchor links on headings */
h2 a.zola-anchor, h3 a.zola-anchor {
  text-decoration: none;
  color: var(--text-secondary);
  cursor: pointer;
}
h2 a.zola-anchor:hover, h3 a.zola-anchor:hover {
  color: var(--link);
}

/* Shell prompt */
.prompt { color: var(--text-secondary); user-select: none; }

/* Coming soon */
.coming-soon {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-secondary);
}
.coming-soon p { font-size: 1.1rem; }

footer { margin-top: 2rem; }
