:root {
  --bg: #0b0e14;
  --surface: #131826;
  --surface-2: #1b2233;
  --border: #283349;
  --text: #d7dee8;
  --muted: #8b97a8;
  --accent: #45b3e0;
  --accent-soft: rgba(69, 179, 224, 0.14);
  --ok: #3fb950;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* guard against any horizontal scroll; sticky-safe (unlike overflow:hidden) */
}

img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.9em; color: #a9e0f7; background: var(--accent-soft); padding: 0.1em 0.4em; border-radius: 4px; overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.2; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.8rem 1.5rem;
  background: rgba(11, 14, 20, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 1.2rem; align-items: center; font-size: 0.92rem; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links .ghost { color: var(--accent); }

/* Layout */
main { max-width: 920px; margin: 0 auto; padding: 0 1.25rem; }
section { padding: 3.5rem 0; border-bottom: 1px solid var(--border); }
section:last-child { border-bottom: none; }
h2 { font-size: 1.8rem; margin: 0 0 1rem; }
.prose { max-width: 70ch; color: var(--text); }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.comment { color: var(--muted); }

/* Hero: comic → buttons → logo + pitch */
.hero { text-align: center; padding-top: 2rem; border-bottom: none; }
.hero-comic { display: block; width: 100%; max-width: 600px; height: auto; margin: 0 auto 1.8rem; border-radius: 12px; border: 1px solid var(--border); }

.hero-cta { display: flex; gap: 0.8rem; justify-content: center; align-items: center; flex-wrap: wrap; margin-bottom: 2.2rem; }
.hero-cta .install-banner { margin: 0; }   /* in a flex row, auto-margins would push the buttons apart */
.hero-cta .btn { padding-top: 0.7rem; padding-bottom: 0.7rem; }   /* ~match the install banner's height */
.btn { display: inline-flex; align-items: center; padding: 0.62rem 1.3rem; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; font-size: 0.98rem; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); color: #04222e; border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }

.hero-id { display: flex; align-items: center; justify-content: center; gap: 1.5rem; max-width: 760px; margin: 0 auto; text-align: left; }
.hero-logo { image-rendering: pixelated; border-radius: 18px; flex: none; }
.hero-id h1 { font-size: clamp(1.6rem, 3.6vw, 2.5rem); margin: 0 0 0.6rem; letter-spacing: -0.02em; }
.hero-id .lede { margin: 0; }
.lede { max-width: 60ch; margin: 0 auto 1.8rem; font-size: 1.12rem; color: var(--text); }
/* Install banner (hero, macOS-primary) */
.install-banner {
  display: inline-flex; align-items: center; gap: 0.6rem;
  background: #0a0d15; border: 1px solid var(--border); border-radius: 10px;
  padding: 0.55rem 0.6rem 0.55rem 0.9rem; margin: 0 auto;
  font-family: var(--mono); font-size: 0.95rem; max-width: 100%;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.ib-prompt { color: var(--accent); }
.ib-cmd { background: none; color: #e7edf5; padding: 0; white-space: nowrap; overflow-x: auto; min-width: 0; }
.copy-btn {
  font-family: var(--mono); font-size: 0.78rem; cursor: pointer;
  background: var(--surface); color: var(--accent); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.3rem 0.7rem; white-space: nowrap;
}
.copy-btn:hover { border-color: var(--accent); }
.copy-btn.copied { color: var(--ok); border-color: var(--ok); }
.hero-sub { color: var(--muted); font-size: 0.92rem; margin: 1rem 0 1.4rem; }
.hero-sub .dot { color: var(--border); margin: 0 0.3rem; }

.badges { margin-top: 1.6rem; display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.pill { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0.2rem 0.7rem; }

/* Bands */
.band h2 { text-align: left; }
.two-col, .grid, .install-grid, .dev-links { display: grid; gap: 1rem; }
.two-col { grid-template-columns: 1fr 1fr; margin-top: 1.5rem; }
.grid { grid-template-columns: repeat(3, 1fr); margin-top: 1.5rem; }
.install-grid { grid-template-columns: repeat(3, 1fr); margin: 1.2rem 0 2rem; }
.dev-links { grid-template-columns: repeat(2, 1fr); margin-top: 1.5rem; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.2rem;
}
.card h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); }
a.card { color: var(--text); display: block; }
a.card:hover { border-color: var(--accent); text-decoration: none; }

.feature { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem; }
.feature h3 { margin: 0 0 0.4rem; font-size: 1.02rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.94rem; }

.security .checks { list-style: none; padding: 0; margin: 1rem 0 1.5rem; max-width: 75ch; }
.security .checks li { position: relative; padding-left: 1.6rem; margin-bottom: 0.6rem; }
.security .checks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }

/* Code / pipeline blocks */
.pipeline {
  font-family: var(--mono); font-size: 0.85rem; line-height: 1.7;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 1rem 1.2rem; overflow-x: auto; margin-top: 1.4rem; color: var(--text);
}
.install { min-width: 0; }   /* let 1fr columns shrink; don't widen the grid to fit a long line */
.install pre {
  font-family: var(--mono); font-size: 0.85rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 0.8rem; margin: 0;
  white-space: pre-wrap; overflow-wrap: anywhere;   /* wrap long commands/links instead of overflowing */
}
.install h3 { font-size: 1rem; margin: 0 0 0.6rem; }
.qs { margin: 0.5rem 0 0; font-size: 1.1rem; }

/* Terminal demo */
.demo { text-align: left; }
.terminal {
  background: #0a0d15; border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; margin-top: 1.3rem; box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}
.term-bar { display: flex; align-items: center; gap: 0.45rem; padding: 0.6rem 0.9rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.term-bar > span:not(.term-title) { width: 11px; height: 11px; border-radius: 50%; background: #3a4356; }
.term-bar > span:nth-child(1) { background: #ff5f56; }
.term-bar > span:nth-child(2) { background: #ffbd2e; }
.term-bar > span:nth-child(3) { background: #27c93f; }
.term-title { margin-left: auto; font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.term-body {
  margin: 0; padding: 1.1rem 1.2rem; font-family: var(--mono); font-size: 0.86rem;
  line-height: 1.7; min-height: 17rem; white-space: pre-wrap; word-break: break-word;
}
.term-body .cmd { color: #e7edf5; }
.term-body .prompt { color: var(--accent); }
.term-body .out { color: var(--muted); }
.term-body .comment { color: #5f6b7e; }
.term-body .ok { color: var(--ok); font-weight: 600; }
.term-body .cursor { color: var(--accent); }
.demo-note { color: var(--muted); font-size: 0.85rem; margin-top: 0.8rem; }
.replay { font-family: var(--mono); font-size: 0.82rem; background: var(--surface); color: var(--accent); border: 1px solid var(--border); border-radius: 6px; padding: 0.2rem 0.6rem; cursor: pointer; }
.replay:hover { border-color: var(--accent); }

/* Guide page */
.guide-intro { text-align: center; padding-top: 2.5rem; border-bottom: none; }
.guide-intro h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0.3rem 0 1rem; letter-spacing: -0.02em; }
.scenario-pick { grid-template-columns: repeat(3, 1fr); display: grid; gap: 1rem; margin-top: 1.6rem; text-align: left; }
.scenario-pick .card span { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 0.3rem; }
.callout { border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 0.8rem 1rem; margin: 1.2rem 0; }
.callout.warn { border-left-color: #e0a23c; background: rgba(224, 162, 60, 0.12); }
.subhead { font-size: 1.1rem; margin: 1.6rem 0 0.4rem; color: var(--text); }

/* Command reference */
.toc { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin-top: 1.6rem; text-align: left; }
.toc h4 { margin: 0 0 0.5rem; font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0.25rem 0; font-family: var(--mono); font-size: 0.85rem; }
.cmdref .cmd { border-top: 1px solid var(--border); padding: 1.5rem 0 0.4rem; }
.cmdref > .cmd:first-of-type, .cmdref .muted + .cmd { border-top: none; }
.cmd h3 { font-family: var(--mono); font-size: 1.05rem; margin: 0 0 0.5rem; color: var(--text); scroll-margin-top: 72px; }
.cmd .desc { color: var(--text); max-width: 78ch; margin: 0 0 0.7rem; }
.cmd .meta { color: var(--muted); font-size: 0.9rem; margin: 0.5rem 0 0; }
.cmd .callout { margin: 0.9rem 0 0; }
.cmd table { margin: 0.4rem 0; }

/* Tables (guide reference + troubleshooting) */
table { border-collapse: collapse; width: 100%; margin-top: 1.2rem; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }

/* Footer */
.footer {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem; flex-wrap: wrap;
  padding: 2rem 1rem; color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--border);
}
.footer img { image-rendering: pixelated; border-radius: 6px; }
.footer .dot { color: var(--border); }

/* Responsive */
@media (max-width: 720px) {
  .nav-links { gap: 0.8rem; font-size: 0.82rem; }
  .nav-links a:not(.ghost) { display: none; }
  .two-col, .grid, .install-grid, .dev-links { grid-template-columns: 1fr; }
  .hero-id { flex-direction: column; text-align: center; gap: 0.9rem; }
  .hero-id .lede { margin: 0 auto; }
}
