/* ─── Design Tokens ─────────────────────────────────────────────────── */
:root {
  color-scheme: dark;

  --sidebar-w:  220px;
  --mobile-h:   52px;

  --bg:         #07090e;
  --bg-surface: #0d1117;
  --bg-alt:     #0a0d14;
  --bg-sidebar: #080b10;
  --border:     rgba(255, 255, 255, 0.07);
  --border-md:  rgba(255, 255, 255, 0.12);

  --text:       #dde8f4;
  --text-muted: rgba(221, 232, 244, 0.55);
  --text-dim:   rgba(221, 232, 244, 0.28);

  --cyan:       #00d4ff;
  --amber:      #f0a444;
  --green:      #00c896;

  --font-sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:  'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

  --max:        780px;
  --r:          8px;
}

/* ─── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ─── Layout Shell ───────────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-header {
  padding: 24px 20px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-brand {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}
.sidebar-brand:hover { color: #fff; }

.sidebar-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.sidebar-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-group-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 8px 8px;
}

.sidebar-link {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 8px;
  border-radius: 5px;
  border-left: 2px solid transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.sidebar-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.sidebar-link.active {
  color: var(--cyan);
  background: rgba(0, 212, 255, 0.06);
  border-left-color: var(--cyan);
}

/* ─── Content Column ─────────────────────────────────────────────────── */
.content-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ─── Mobile Bar (hidden on desktop) ────────────────────────────────── */
.mobile-bar {
  display: none;
}

/* ─── Sidebar Overlay (mobile) ───────────────────────────────────────── */
.sidebar-overlay {
  display: none;
}

/* ─── Container ──────────────────────────────────────────────────────── */
.container {
  max-width: var(--max);
  padding: 0 48px;
}

/* ─── Sections ───────────────────────────────────────────────────────── */
.section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}
.section--alt { background: var(--bg-alt); }

/* ─── Section Headings ───────────────────────────────────────────────── */
.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.2;
}

.section-lead {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 36px;
}

h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ─── Problem ────────────────────────────────────────────────────────── */
.block-text p { margin-bottom: 12px; }

.inset-block {
  margin-top: 32px;
  padding: 24px 28px;
  background: var(--bg-surface);
  border-radius: var(--r);
  border: 1px solid var(--border);
}

.inset-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.dash-list { list-style: none; }
.dash-list li {
  font-size: 14px;
  color: var(--text-muted);
  padding-left: 18px;
  position: relative;
  line-height: 1.6;
}
.dash-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-dim);
}
.dash-list--cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 32px;
}

/* ─── Card Grid ──────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  gap: 2px;
  background: var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.card-grid--2 { grid-template-columns: 1fr 1fr; }
.card-grid--1 { grid-template-columns: 1fr; }

.card {
  background: var(--bg-surface);
  padding: 24px 26px 22px;
}
.card--accent { background: rgba(0, 212, 255, 0.04); }

.card-index {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

.card h3 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}

.card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}

.aside-note {
  margin-top: 16px;
  padding: 14px 20px;
  border-left: 2px solid var(--amber);
  font-size: 14px;
  color: var(--text-muted);
}

/* ─── Stack ──────────────────────────────────────────────────────────── */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 2px;
  background: var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.stack-cat {
  background: var(--bg-surface);
  padding: 18px 18px 16px;
}

.stack-cat-heading {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 12px;
}

.stack-cat ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.stack-cat li {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}

.tool-name { font-size: 14px; color: var(--text); font-weight: 500; }
.tool-note { font-size: 12px; color: var(--text-dim); }

/* ─── Deployment ─────────────────────────────────────────────────────── */
.deploy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 16px;
}

.deploy-card {
  background: var(--bg-surface);
  padding: 24px 26px 22px;
}

.deploy-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 12px;
}
.deploy-badge--preview    { background: rgba(0, 212, 255, 0.1); color: var(--cyan); }
.deploy-badge--production { background: rgba(0, 200, 150, 0.1); color: var(--green); }

.deploy-card h3 { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 8px; }
.deploy-card p  { font-size: 14px; color: var(--text-muted); margin-bottom: 16px; }

.deploy-card code,
.aside-note code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  padding: 1px 5px;
  border-radius: 3px;
}

.deploy-steps {
  list-style: none;
  counter-reset: steps;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.deploy-steps li {
  counter-increment: steps;
  font-size: 13px;
  color: var(--text-muted);
  padding-left: 20px;
  position: relative;
  line-height: 1.5;
}
.deploy-steps li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* ─── Workflow ───────────────────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.col-heading {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

.step-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.step-list li { display: flex; gap: 12px; align-items: flex-start; }
.step-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  background: rgba(0, 212, 255, 0.09);
  border-radius: 4px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.step-list li div { font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.step-list li strong { color: var(--text); font-weight: 500; }

.q-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.q-list li {
  font-size: 14px;
  color: var(--text-muted);
  padding-left: 20px;
  position: relative;
  line-height: 1.55;
}
.q-list li::before {
  content: '?';
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--amber);
  font-weight: 600;
}

/* ─── Vocabulary ─────────────────────────────────────────────────────── */
.vocab-list {
  display: grid;
  gap: 2px;
  background: var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.vocab-row {
  background: var(--bg-surface);
  padding: 16px 24px;
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 24px;
  align-items: start;
}

.vocab-row dt {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  padding-top: 1px;
}

.vocab-row dd {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ─── Footer ─────────────────────────────────────────────────────────── */
.footer { padding: 32px 0 44px; margin-top: auto; }

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-brand { font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); }
.footer-note  { font-size: 13px; color: var(--text-dim); }

/* ─── Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-w);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 200;
  }
  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.5);
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .sidebar-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: var(--mobile-h);
    background: rgba(8, 11, 16, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
  }

  .menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .menu-toggle span {
    display: block;
    width: 18px;
    height: 1.5px;
    background: var(--text-muted);
    border-radius: 1px;
  }

  .container { padding: 0 20px; }
  .section   { padding: 48px 0; }

  .card-grid--2  { grid-template-columns: 1fr; }
  .two-col       { grid-template-columns: 1fr; gap: 36px; }
  .deploy-grid   { grid-template-columns: 1fr; }
  .dash-list--cols { grid-template-columns: 1fr; }

  .vocab-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .footer-note { display: none; }
}
