/* slew docs — brand tokens mirror slew-web/src/styles.css */
:root {
  --bg: #060708;
  --surface: #0c0e11;
  --surface-2: #11141a;
  --border: #1c2129;
  --text: #e7eaf0;
  --muted: #8b93a3;
  --faint: #5c6472;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Geist", -apple-system, system-ui, sans-serif;
  --sidebar-w: 272px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---- layout ---- */
.shell { display: flex; min-height: 100vh; }

/* ---- sidebar: nav as the repo's file tree ---- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 28px 20px 40px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

/* mobile-only nav toggle; hidden on desktop so nothing changes there */
.nav-toggle { display: none; }
.brand svg { display: block; }
.brand .name { font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: 0.02em; }
.brand .name em { font-style: normal; color: var(--muted); font-weight: 400; }

.tree { font-family: var(--mono); font-size: 12.5px; line-height: 2.05; }
.tree .dir {
  color: var(--faint);
  margin: 18px 0 2px;
  letter-spacing: 0.03em;
}
.tree .dir:first-child { margin-top: 0; }
.tree a {
  display: block;
  color: var(--muted);
  padding: 0 8px 0 18px;
  border-left: 1px solid var(--border);
  margin-left: 5px;
  white-space: nowrap;
}
.tree a:hover { color: var(--text); text-decoration: none; }
.tree a[aria-current="page"] {
  color: var(--text);
  border-left-color: var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), transparent 70%);
}

/* ---- content ---- */
main {
  flex: 1;
  min-width: 0;
  padding: 44px 56px 120px;
}
.page { max-width: 78ch; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.eyebrow .sep { color: var(--border); padding: 0 6px; }
.eyebrow .src { color: var(--muted); }

.page h1 {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 14px;
}
.page h2 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 44px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.page h3 { font-size: 16.5px; font-weight: 600; margin: 30px 0 8px; }
.page h4 { font-size: 14.5px; font-weight: 600; margin: 22px 0 6px; color: var(--muted); }

.page p, .page li { color: #c6ccd8; }
.page li { margin: 3px 0; }
.page strong { color: var(--text); }
.page hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }

.page code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: #d7dce6;
}
.page pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  line-height: 1.55;
  margin: 14px 0 20px;
}
.page pre code {
  background: none; border: 0; padding: 0;
  font-size: 12.5px; color: #ccd3df;
}

.page table {
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0 22px;
  font-size: 13.5px;
}
.page th {
  text-align: left;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 6px 14px 6px 0;
  border-bottom: 1px solid var(--border);
}
.page td {
  padding: 7px 14px 7px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: #c6ccd8;
}
.page td code { white-space: nowrap; }

.page blockquote {
  margin: 14px 0;
  padding: 2px 18px;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 6px 6px 0;
}
.page blockquote p { color: #d7dce6; }

/* ---- footer ---- */
.foot {
  margin-top: 72px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.foot a { color: var(--muted); }

/* ---- responsive ---- */
@media (max-width: 860px) {
  .shell { flex-direction: column; }

  /* sidebar becomes a compact top bar with a collapsible menu */
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
  }
  .sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .brand { margin-bottom: 0; }
  .nav-toggle {
    display: inline-block;
    font-family: var(--mono);
    font-size: 12.5px;
    letter-spacing: 0.03em;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 7px 12px;
    cursor: pointer;
  }
  .nav-toggle[aria-expanded="true"] {
    color: var(--text);
    border-color: var(--accent);
  }
  .tree { display: none; margin-top: 14px; font-size: 13.5px; line-height: 1.5; }
  .sidebar.open .tree { display: block; }
  .tree .dir { margin: 14px 0 4px; }
  /* comfortable tap targets */
  .tree a { padding: 6px 8px 6px 18px; white-space: normal; }

  main { padding: 28px 20px 80px; }

  /* wide tables scroll within their own box instead of stretching the page */
  .page table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* long tokens (URLs, inline code) wrap instead of forcing horizontal scroll */
  .page { overflow-wrap: break-word; }
}

@media (max-width: 480px) {
  main { padding: 22px 16px 64px; }
  body { font-size: 15px; }
  .page h1 { font-size: 25px; }
  .page h2 { font-size: 19px; margin-top: 36px; }
  .page pre { padding: 12px; }
  .page blockquote { padding: 2px 14px; }
}
