/* buildwithnexus.dev — static docs. Tokyo Night palette matched to the TUI. */

:root {
  color-scheme: dark;
  --bg: #16161e;
  --surface: #1a1b26;
  --panel: #1f2335;
  --line: #2a2f45;
  --line-soft: #22273b;
  --text: #c0caf5;
  --body: #a9b1d6;
  --muted: #565f89;
  --heading: #e4e9ff;
  --accent: #bb9af7;
  --blue: #7aa2f7;
  --cyan: #7dcfff;
  --green: #9ece6a;
  --yellow: #e0af68;
  --red: #f7768e;
  --radius: 10px;
  --sidebar-w: 248px;
  --content-w: 980px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

::selection { background: rgba(122, 162, 247, 0.32); color: var(--heading); }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--cyan); }

/* ── topbar ─────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 56px;
  padding: 0 clamp(16px, 2vw, 24px);
  border-bottom: 1px solid var(--line);
  background: rgba(22, 22, 30, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding-left: max(clamp(16px, 2vw, 24px), env(safe-area-inset-left));
  padding-right: max(clamp(16px, 2vw, 24px), env(safe-area-inset-right));
}

.brand { display: flex; align-items: baseline; gap: 10px; }

.wordmark {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, #3d6de0, #7aa2f7, #9ec9ff, #cfe5ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ver {
  font: 600 11px/1 var(--mono);
  color: var(--accent);
  border: 1px solid rgba(187, 154, 247, 0.35);
  background: rgba(187, 154, 247, 0.08);
  padding: 4px 7px;
  border-radius: 99px;
}

.top-links { display: flex; gap: 20px; font-size: 14px; }
.top-links a { color: var(--body); }
.top-links a:hover { color: var(--heading); }

/* ── layout: sidebar + content ──────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 28px 14px 40px 16px;
  border-right: 1px solid var(--line-soft);
}

.nav-group { margin-bottom: 26px; }

.nav-title {
  margin: 0 0 8px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group li { margin: 1px 0; }

.nav-group a {
  display: block;
  padding: 6px 10px;
  border-radius: 7px;
  border-left: 2px solid transparent;
  color: var(--body);
  font-size: 14px;
  line-height: 1.45;
}

.nav-group a:hover { color: var(--heading); background: rgba(122, 162, 247, 0.07); }

.nav-group a.active {
  color: var(--accent);
  font-weight: 600;
  background: rgba(187, 154, 247, 0.10);
  border-left-color: var(--accent);
  border-radius: 0 7px 7px 0;
}

.mobile-nav { display: none; }

.content {
  min-width: 0;
  margin-inline: auto;
  width: 100%;
  padding: 40px clamp(20px, 3vw, 44px) 48px;
  max-width: calc(var(--content-w) + 2 * 44px);
}

/* ── typography ─────────────────────────────────────────────────────────── */
h1, h2, h3 { color: var(--heading); line-height: 1.25; letter-spacing: -0.015em; }
h1 { font-size: clamp(30px, 4.5vw, 40px); margin: 0 0 14px; }
h2 { font-size: 22px; margin: 44px 0 12px; padding-top: 8px; }
h3 { font-size: 17px; margin: 28px 0 8px; }
p { margin: 0 0 14px; }
ul { padding-left: 22px; }
li { margin: 6px 0; }
strong { color: var(--text); }
.date { font: 500 13px/1 var(--mono); color: var(--muted); margin-left: 10px; }

.lede { font-size: 17.5px; color: var(--body); max-width: 68ch; }

.eyebrow {
  font: 600 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 14px;
}

/* ── hero (home) ────────────────────────────────────────────────────────── */
.hero { padding: 28px 0 8px; }

.hero h1 { font-size: clamp(34px, 5vw, 50px); margin-bottom: 18px; }

.hero .grad {
  background: linear-gradient(90deg, #3d6de0 0%, #7aa2f7 45%, #9ec9ff 75%, #cfe5ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.actions { display: flex; gap: 12px; margin: 22px 0; flex-wrap: wrap; }

.button {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--heading);
  font-weight: 600;
  font-size: 14.5px;
  background: var(--panel);
  transition: transform 0.08s ease, border-color 0.12s ease;
}
.button:hover { border-color: var(--blue); color: var(--heading); transform: translateY(-1px); }
.button.primary {
  background: linear-gradient(135deg, rgba(187, 154, 247, 0.95), rgba(122, 162, 247, 0.95));
  border-color: transparent;
  color: #16161e;
}
.button.primary:hover { color: #16161e; filter: brightness(1.08); }

pre.install {
  display: inline-block;
  margin: 6px 0 30px;
}

.install-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: stretch;
  margin: 6px 0 30px;
}
.install-opt { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; }
.install-opt pre.install { margin: 0; flex: 1; width: 100%; }
.install-label {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── code ───────────────────────────────────────────────────────────────── */
pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  overflow-x: auto;
  margin: 14px 0 20px;
}

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

code {
  font: 0.9em var(--mono);
  color: var(--cyan);
  background: rgba(125, 207, 255, 0.08);
  border: 1px solid rgba(125, 207, 255, 0.14);
  border-radius: 5px;
  padding: 1px 5px;
}

kbd {
  font: 600 0.82em var(--mono);
  color: var(--heading);
  background: var(--panel);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 2px 6px;
}

/* ── screenshots ────────────────────────────────────────────────────────── */
.shot { margin: 26px 0; }

.shot img,
.shot video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(122, 162, 247, 0.22);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

.shot figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
.shot figcaption code { font-size: 0.95em; }

/* ── release panel ──────────────────────────────────────────────────────── */
.release {
  margin: 36px 0;
  padding: 22px 26px;
  border: 1px solid rgba(187, 154, 247, 0.28);
  border-radius: 14px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(187, 154, 247, 0.10), transparent 45%),
    radial-gradient(120% 140% at 100% 100%, rgba(122, 162, 247, 0.08), transparent 45%),
    var(--surface);
}
.release h2 { margin-top: 4px; }
.release ul { margin: 10px 0 6px; }

/* ── feature grid ───────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 30px 0;
}

.grid article {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px 18px 8px;
  transition: border-color 0.12s ease;
}
.grid article:hover { border-color: rgba(122, 162, 247, 0.4); }
.grid h3 { margin: 0 0 8px; font-size: 15.5px; }
.grid p { font-size: 14px; color: var(--body); }

/* ── tables ─────────────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 22px;
  font-size: 14.5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); }
th { color: var(--heading); font-size: 13px; background: var(--surface); }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(122, 162, 247, 0.045); }
td code { white-space: nowrap; }

/* ── notes / footer ─────────────────────────────────────────────────────── */
.note {
  border-left: 3px solid var(--accent);
  background: rgba(187, 154, 247, 0.07);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 18px;
  margin: 18px 0;
}
.note p { margin: 0; }

.foot {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13.5px;
}

/* ── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .layout { display: block; }
  .sidebar { display: none; }

  .mobile-nav {
    display: block;
    margin: 14px 16px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }
  .mobile-nav summary {
    cursor: pointer;
    padding: 11px 16px;
    color: var(--heading);
    font-weight: 600;
    font-size: 14px;
  }
  .mobile-nav .nav-group { margin: 6px 10px 16px; }

  .content { padding: 26px 18px calc(40px + env(safe-area-inset-bottom)); }
  .top-links { font-size: 13px; gap: 4px; }
  .top-links a { padding: 8px 6px; }
  .nav-group a { padding: 9px 10px; }
  .grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(29px, 8.5vw, 40px); }
  .install-opt { flex-basis: 100%; }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Tables scroll in place on narrow screens instead of widening the page. */
@media (max-width: 900px) {
  table { display: block; overflow-x: auto; white-space: nowrap; }
}
