/* S8 — stack8.tech
   Visual language: nodejs.org structure + MDN documentation chrome. */

:root {
  --green: #5fa04a;
  --green-hover: #73c55c;
  --green-ink: #8fd47a;
  --green-soft: rgba(95, 160, 74, 0.16);
  --blue: #6cb6ff;
  --blue-soft: rgba(88, 166, 255, 0.12);
  --ink: #f2f4f7;
  --ink-2: #d5dae0;
  --muted: #9aa3ad;
  --line: #2a313a;
  --line-soft: #1e232a;
  --bg: #0b0d10;
  --page-bg: #0d1a12;
  --surface: #12151b;
  --header-h: 64px;
  --docs-nav-w: 268px;
  --toc-w: 220px;
  --max: 1200px;
  --radius: 8px;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Open Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --code-bg: #0e1116;
  --code-fg: #e6edf3;
  --focus: 0 0 0 3px rgba(95, 160, 74, 0.45);
}

html {
  color-scheme: dark;
  background: var(--page-bg);
  scroll-behavior: smooth;
}

html:has(body.home) {
  background: var(--bg);
}

*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--page-bg);
  min-height: 100vh;
  position: relative;
  isolation: isolate;
}

body.home {
  background: transparent;
}

.site-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.site-bg-img {
  position: absolute;
  left: 50%;
  top: 0;
  display: block;
  width: max(100vw, calc(100vh * 475 / 797));
  height: auto;
  min-height: 100vh;
  max-width: none;
  object-fit: cover;
  object-position: center top;
  filter: blur(64px);
  transform: translate3d(-50%, 0, 0);
  will-change: transform;
  animation: site-bg-pan linear both;
  animation-timeline: scroll(root);
}

.site-bg-veil {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 14, 0.38);
}

@keyframes site-bg-pan {
  from { transform: translate3d(-50%, 0, 0); }
  to { transform: translate3d(-50%, calc(100vh - 100%), 0); }
}

.site-header,
main,
.docs-shell,
.site-footer {
  position: relative;
  z-index: 1;
}

.card,
.codebox,
.download-card,
.os-card,
.post {
  position: relative;
  z-index: 2;
}

img { max-width: 100%; height: auto; }
a { color: var(--green-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--green-hover); }
button, input, select { font: inherit; }
code, kbd { font-family: var(--mono); font-size: 0.9em; }

:focus-visible { outline: none; box-shadow: var(--focus); }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--green);
  color: #fff;
  padding: 8px 12px;
  z-index: 100;
  border-radius: 4px;
}
.skip:focus { top: 12px; color: #fff; }

.wrap {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
}

/* ---------- Header (nodejs.org-like) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(11, 13, 16, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.brand:hover { color: var(--ink); }
.brand img {
  width: 44px;
  height: 44px;
  display: block;
  border-radius: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav a {
  color: var(--ink-2);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
}
.nav a:hover,
.nav a.is-active { background: var(--bg); color: var(--ink); }

.nav-extra {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}
.nav-extra a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.nav-extra a:hover { color: var(--ink); }

.menu-btn {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 42px;
  height: 42px;
  cursor: pointer;
}
.menu-btn span,
.menu-btn span::before,
.menu-btn span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  position: relative;
  margin: 0 auto;
}
.menu-btn span::before,
.menu-btn span::after {
  content: "";
  position: absolute;
  left: 0;
}
.menu-btn span::before { top: -6px; }
.menu-btn span::after { top: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1.2;
}
.btn-primary {
  background: var(--green);
  color: #fff;
}
.btn-primary:hover { background: var(--green-hover); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--bg); color: var(--ink); }

.btn-download {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 220px;
  min-height: 72px;
  padding: 12px 22px 12px 16px;
  background: var(--green);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 2px 0 #3d7a30;
}
.btn-download:hover { background: var(--green-hover); color: #fff; }
.btn-download-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: block;
}
.btn-download-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}
.btn-download .label {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.btn-download .ver {
  font-size: 0.85rem;
  opacity: 0.92;
  font-weight: 600;
}

/* ---------- Home ---------- */
.home-sky {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: transparent;
}

.hero {
  padding: 72px 0 24px;
  background: transparent;
}

.hero-title {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0 0 20px;
}

.hero-logo {
  width: clamp(7.5rem, 16vw, 13.5rem);
  height: auto;
  max-width: none;
  flex-shrink: 0;
  display: block;
  border-radius: 0;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--ink);
  font-weight: 800;
  max-width: 16ch;
}

.hero .lead {
  margin: 0 0 28px;
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 42rem;
}

.mission {
  margin: 0 0 36px;
  padding: 16px 18px;
  border-left: 4px solid var(--green);
  background: var(--green-soft);
  max-width: 46rem;
  color: var(--ink-2);
}
.mission strong { color: var(--ink); }

.home-split {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 28px;
  align-items: stretch;
  padding: 12px 0 64px;
}

.home-sky .download-card,
.home-sky .codebox {
  background: rgba(12, 14, 18, 0.72);
  backdrop-filter: blur(14px);
  border-color: rgba(255, 255, 255, 0.08);
}
.home-sky .codebox-bar {
  background: rgba(16, 18, 24, 0.55);
}
.download-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.download-card h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--ink);
}
.download-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.download-card .actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.other-dl {
  text-align: center;
  font-weight: 700;
  color: var(--green-ink);
  text-decoration: none;
}
.other-dl:hover { text-decoration: underline; }

.home-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}
.pill {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
}

/* ---------- Code box ---------- */
.codebox {
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.codebox-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 8px 0;
  background: #161b22;
  border-bottom: 1px solid #2a313a;
  overflow-x: auto;
}
.codebox-bar button.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: #c8c8c8;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  white-space: nowrap;
}
.codebox-bar button.tab.is-active {
  background: var(--code-bg);
  color: #fff;
}
.codebox-bar .copy {
  margin-left: auto;
  margin-right: 6px;
  margin-bottom: 6px;
  background: transparent;
  border: 1px solid #666;
  color: #eee;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.codebox-bar .copy:hover { background: #21262d; }
.codebox-bar .filename {
  color: #bbb;
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 10px 12px;
}
.codebox pre {
  margin: 0;
  padding: 20px 22px 24px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.55;
  flex: 1;
}
.codebox pre[hidden] { display: none; }
.codebox .kw { color: #c792ea; }
.codebox .type { color: #82aaff; }
.codebox .str { color: #c3e88d; }
.codebox .com { color: #9e9e9e; font-style: italic; }
.codebox .ann { color: #ffcb6b; }
.codebox .num { color: #f78c6c; }

.inline-code,
.prose code:not(pre code),
.docs-main code:not(pre code) {
  background: #1c2128;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  font-size: 0.88em;
}

/* ---------- Sections ---------- */
.band {
  padding: 72px 0;
  border-top: 1px solid var(--line-soft);
}
.band-muted { background: transparent; }
.band h2 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3vw, 2rem);
  letter-spacing: -0.03em;
  color: var(--ink);
}
.band .section-lead {
  margin: 0 0 36px;
  color: var(--muted);
  max-width: 46rem;
  font-size: 1.05rem;
}

.grid-3,
.grid-4 {
  display: grid;
  gap: 20px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
}
.card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--ink);
}
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card a { font-weight: 700; text-decoration: none; }
.kicker {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-ink);
  margin-bottom: 6px;
}

/* ---------- Alphaventor square-grid (dark) ---------- */
.stack-principles .square-grid-deck {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px;
  width: 100%;
}

.square-grid-card {
  box-sizing: border-box;
  position: relative;
  padding: 0;
  margin: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
  font-weight: 400;
  line-height: normal;
}

.square-grid-card[size="std"] {
  width: 100%;
  aspect-ratio: 1;
}

.square-grid-card > img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  position: absolute;
  inset: 0;
  filter: brightness(0.48) saturate(1.35) contrast(1.12);
}

.square-grid-card-content {
  display: flex;
  flex-direction: column;
  padding: 8px;
  position: absolute;
  inset: 0;
  box-sizing: border-box;
}

.square-grid-card h3 {
  font-size: 36px;
  padding: 2px 0;
  margin: 8px 8px 4px;
  width: fit-content;
  font-weight: 700;
  letter-spacing: 0;
  line-height: normal;
  color: var(--ink);
}

.square-grid-card .s-hl {
  font-weight: 800;
}

.square-grid-card[data-tile="0"] .s-hl { color: #ee586f; }
.square-grid-card[data-tile="1"] .s-hl { color: #b058ee; }
.square-grid-card[data-tile="2"] .s-hl { color: #58c1ee; }
.square-grid-card[data-tile="3"] .s-hl { color: #58dfee; }
.square-grid-card[data-tile="4"] .s-hl { color: #58ee94; }
.square-grid-card[data-tile="5"] .s-hl { color: #5862ee; }
.square-grid-card[data-tile="6"] .s-hl { color: #eec158; }
.square-grid-card[data-tile="7"] .s-hl { color: #ee6f58; }

.square-grid-card h4 {
  font-size: 18px;
  padding: 2px 0;
  margin: 6px 0 4px 8px;
  width: fit-content;
  font-weight: 700;
  letter-spacing: 0;
  line-height: normal;
  color: #cde6ff;
}

.square-grid-card[theme="dark"] h3 {
  color: #fff;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.82);
}

.square-grid-card[theme="dark"] .s-hl {
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.82);
}

.square-grid-card p {
  font-size: 14px;
  padding: 0;
  margin: 4px 16px 8px 8px;
  max-width: calc(100% - 24px);
  line-height: 1.4;
  color: #cde6ff;
  text-shadow: none;
}

.square-grid-card[theme="dark"] h4 {
  color: #cde6ff;
  text-shadow: none;
}

.square-grid-card[theme="dark"] p {
  color: #cde6ff;
  text-shadow: none;
}

.square-grid-card-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: auto 0 10px 8px;
  padding: 2px 12px 2px 2px;
  width: fit-content;
  background: rgb(11 13 16 / 31%);
  border: 1px solid rgba(205, 230, 255, 0.28);
  border-radius: 20px;
  color: #cde6ff8c;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.square-grid-card-link:hover {
  background: rgb(11 13 16 / 48%);
  border-color: rgba(205, 230, 255, 0.4);
  color: #cde6ff;
}

.square-grid-card-link-pic {
  display: flex;
  align-items: center;
}

.square-grid-card-link-pic svg {
  display: block;
  stroke: currentColor;
}

.square-grid-card-link-text {
  padding: 0 8px 0 4px;
}

@media (max-width: 860px) {
  .stack-principles .square-grid-deck {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }
}

@media (max-width: 619px) {
  .square-grid-card-content { padding: 6px; }
  .square-grid-card h3 { font-size: 18px; margin: 4px 4px 2px; }
  .square-grid-card h4 { font-size: 12px; font-weight: 600; margin: 2px 0 2px 4px; }
  .square-grid-card p { font-size: 10px; line-height: 1.3; margin: 2px 6px 4px 4px; }
  .square-grid-card-link { font-size: 11px; margin: auto 0 6px 4px; padding: 1px 8px 1px 2px; }
  .square-grid-card-link-pic svg { width: 14px; height: 14px; }
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.step-n {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  margin-bottom: 12px;
}

.stack-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.stack-table th,
.stack-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.stack-table th {
  background: #161b22;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.stack-table tr:last-child td { border-bottom: 0; }
.stack-table code { font-size: 0.82rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: #08130e;
  color: #c8cdd2;
  padding: 48px 0 28px;
  margin-top: 0;
  border-top: 1px solid var(--line);
}
body.home .site-footer {
  background: rgba(7, 8, 10, 0.62);
}
.site-footer a { color: #eee; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
}
.site-footer h3 {
  margin: 0 0 12px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #aaa;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 8px; }
.foot-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
}
.foot-brand img { width: 36px; height: 36px; display: block; }
.legal {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: #8b949e;
}

/* ---------- Inner pages ---------- */
.page-hero {
  padding: 48px 0 28px;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
}
.page-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 2.6rem);
  letter-spacing: -0.03em;
  color: var(--ink);
}
.page-hero p { margin: 0; color: var(--muted); max-width: 46rem; font-size: 1.1rem; }

.prose { padding: 40px 0 72px; max-width: 820px; }
.prose h2 { margin: 2em 0 0.6em; letter-spacing: -0.02em; color: var(--ink); scroll-margin-top: calc(var(--header-h) + 16px); }
.prose h3 { margin: 1.6em 0 0.5em; color: var(--ink); }
.prose p { margin: 0 0 1em; }
.prose .principle-sub {
  margin: -0.25em 0 0.7em;
  color: #cde6ff;
  font-weight: 700;
  font-size: 1.05rem;
}
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.2em; }
.prose li { margin: 0.3em 0; }
.prose .codebox { margin: 1.2em 0 1.6em; }

.note, .warn, .intent {
  border-radius: 8px;
  padding: 14px 16px;
  margin: 1.2em 0;
}
.note { background: var(--blue-soft); border-left: 4px solid var(--blue); }
.warn { background: rgba(196, 123, 23, 0.16); border-left: 4px solid #d29922; }
.intent { background: var(--green-soft); border-left: 4px solid var(--green); }
.note strong, .warn strong, .intent strong { display: block; margin-bottom: 4px; }

/* ---------- MDN-style docs ---------- */
.docs-shell {
  display: grid;
  grid-template-columns: var(--docs-nav-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h));
  border-top: 1px solid var(--line-soft);
}

.docs-nav {
  border-right: 1px solid var(--line);
  background: #0e1116;
  position: sticky;
  top: var(--header-h);
  z-index: 2;
  height: calc(100vh - var(--header-h));
  overflow: auto;
  padding: 16px 12px 48px;
}
.docs-nav input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 14px;
  background: var(--surface);
  color: var(--ink);
}
.docs-nav h4 {
  margin: 16px 8px 6px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8b949e;
}
.docs-nav a {
  display: block;
  color: var(--ink-2);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}
.docs-nav a:hover { background: #161b22; }
.docs-nav a.is-active {
  background: #161b22;
  border-left-color: var(--green);
  font-weight: 700;
  color: var(--ink);
}
.docs-nav a[hidden],
.docs-nav h4[hidden] { display: none !important; }

.docs-main {
  padding: 28px 40px 80px;
  max-width: 980px;
}
.crumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.crumb a { color: var(--blue); text-decoration: none; }
.docs-main h1 {
  margin: 0 0 8px;
  font-size: 2.1rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 600;
}
.docs-main h1.plain { font-family: var(--sans); font-weight: 800; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.badge {
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.badge-api { background: var(--green-soft); border-color: #2f5a28; color: var(--green-ink); }

.docs-main h2 {
  margin: 2.2em 0 0.7em;
  padding-top: 0.4em;
  border-top: 1px solid var(--line-soft);
  font-size: 1.35rem;
  color: var(--ink);
}
.docs-main h3 { margin: 1.4em 0 0.5em; font-size: 1.08rem; }
.docs-main p { margin: 0 0 1em; max-width: 70ch; }
.docs-main ul, .docs-main ol { max-width: 70ch; }

.deflist {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin: 1em 0 1.6em;
}
.deflist dt {
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 12px 16px 4px;
  background: #161b22;
  border-top: 1px solid var(--line-soft);
}
.deflist dt:first-child { border-top: 0; }
.deflist dt a { color: var(--blue); text-decoration: none; }
.deflist dd {
  margin: 0;
  padding: 0 16px 14px;
  color: var(--muted);
}
.deflist .sig {
  display: block;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: #8b949e;
  margin-top: 4px;
}

.params {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0 1.6em;
  font-size: 0.95rem;
}
.params th, .params td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.params th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.params code { font-size: 0.82rem; }

.toc {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  z-index: 2;
  align-self: start;
  font-size: 0.85rem;
  background: rgba(14, 17, 22, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.toc strong { display: block; margin-bottom: 8px; color: var(--ink); }
.toc a { display: block; color: var(--muted); text-decoration: none; padding: 3px 0; }
.toc a:hover { color: var(--ink); }

.docs-wide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--toc-w);
  gap: 32px;
}

/* Download matrix */
.os-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0 40px;
}
.os-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  background: var(--surface);
}
.os-card h3 { margin: 0 0 12px; }
.os-card .btn { width: 100%; margin-bottom: 8px; }

.placeholder-note {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Blog list */
.post-list { display: grid; gap: 16px; padding: 32px 0 72px; }
.post {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  background: var(--surface);
}
.post time { color: var(--muted); font-size: 0.85rem; }
.post h2 { margin: 6px 0 8px; font-size: 1.25rem; }
.post h2 a { color: var(--ink); text-decoration: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .docs-wide { grid-template-columns: 1fr; }
  .toc { display: none; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .nav, .nav-extra { display: none; }
  .nav.is-open, .nav-extra.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: #0e1116;
    border-bottom: 1px solid var(--line);
    padding: 12px;
    align-items: stretch;
  }
  .nav-extra.is-open { border-left: 0; margin: 0; padding-top: 0; }
  .menu-btn { display: inline-grid; place-items: center; }
  .home-split,
  .grid-3,
  .steps,
  .footer-grid,
  .os-grid,
  .docs-shell { grid-template-columns: 1fr; }
  .docs-nav {
    position: relative;
    top: 0;
    height: auto;
    max-height: 280px;
  }
  .docs-main { padding: 20px 18px 64px; }
  .wrap { width: min(var(--max), calc(100% - 32px)); }
  .hero { padding-top: 40px; }
  .hero-title { gap: 18px; }
  .hero-logo { width: 5.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site-bg-img { animation: none; }
}
