/* ============================================================
   Docker Knowledge Base — shared styles
   ============================================================ */

/* ----- Tokens ----- */
:root {
  color-scheme: light;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #eef3fa;
  --surface-3: #e5edf7;
  --text: #0d1b2a;
  --text-soft: #35485e;
  --muted: #5d7288;
  --border: #dde6f0;
  --border-strong: #c7d5e5;
  --accent: #0284c7;
  --accent-bright: #06b6d4;
  --accent-soft: #e2f3fd;
  --accent-text: #075985;
  --indigo: #6366f1;
  --green: #059669;
  --amber: #b45309;
  --red: #dc2626;
  --code-bg: #0b1626;
  --code-text: #d7e5f6;
  --code-muted: #7f95ae;
  --shadow-sm: 0 1px 2px rgba(13, 27, 42, 0.06);
  --shadow-md: 0 18px 40px -24px rgba(13, 27, 42, 0.35);
  --shadow-lg: 0 30px 70px -30px rgba(2, 40, 80, 0.4);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 66px;
  --max: 1200px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1220;
  --surface: #0f1a2c;
  --surface-2: #142138;
  --surface-3: #1b2b46;
  --text: #e8f0fa;
  --text-soft: #c2d2e4;
  --muted: #8fa3bc;
  --border: #1d2c44;
  --border-strong: #2a3d5a;
  --accent: #38bdf8;
  --accent-bright: #67e8f9;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --accent-text: #7dd3fc;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --code-bg: #08111f;
  --code-text: #d7e5f6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 20px 44px -26px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 34px 80px -34px rgba(0, 0, 0, 0.9);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ----- Header ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--header-h);
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  flex-shrink: 0;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #0ea5e9, #2563eb 55%, #4338ca);
  box-shadow: 0 6px 14px -6px rgba(37, 99, 235, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  color: #fff;
  flex-shrink: 0;
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text b {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.brand-text small {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 10px;
}

.header-nav a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s ease, background 0.15s ease;
}

.header-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}

.header-nav a[aria-current="page"] {
  color: var(--accent-text);
  background: var(--accent-soft);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Search */
.search {
  position: relative;
  width: min(280px, 28vw);
}

.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background 0.15s ease;
}

.search input::placeholder {
  color: var(--muted);
}

.search input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.nav-toggle {
  display: none;
}

.icon-sun {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

/* ----- Hero ----- */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
      ellipse 60% 55% at 12% 0%,
      rgba(14, 165, 233, 0.16),
      transparent 65%
    ),
    radial-gradient(
      ellipse 45% 50% at 88% 8%,
      rgba(99, 102, 241, 0.14),
      transparent 65%
    );
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      to right,
      rgba(100, 130, 170, 0.08) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, rgba(100, 130, 170, 0.08) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 75% 70% at 50% 0%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(
    ellipse 75% 70% at 50% 0%,
    #000 30%,
    transparent 78%
  );
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 56px;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: 78px 20px 72px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px 6px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  box-shadow: var(--shadow-sm);
}

.hero-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent);
}

.hero h1 {
  margin: 22px 0 18px;
  font-size: clamp(2.3rem, 4.8vw, 3.45rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.gradient-text {
  background: linear-gradient(100deg, #0284c7 0%, #06b6d4 45%, #6366f1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

[data-theme="dark"] .gradient-text {
  background: linear-gradient(100deg, #38bdf8 0%, #67e8f9 45%, #a5b4fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-lead {
  margin: 0;
  max-width: 54ch;
  font-size: clamp(1.02rem, 1.4vw, 1.15rem);
  line-height: 1.65;
  color: var(--muted);
}

.hero-search {
  display: flex;
  gap: 8px;
  margin-top: 28px;
  max-width: 520px;
}

.hero-search .field {
  position: relative;
  flex: 1;
}

.hero-search .field svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.hero-search input {
  width: 100%;
  height: 50px;
  padding: 0 16px 0 46px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hero-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    background 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff;
  box-shadow: 0 12px 26px -14px rgba(37, 99, 235, 0.8);
}

.btn-primary:hover {
  box-shadow: 0 16px 30px -14px rgba(37, 99, 235, 0.9);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text-soft);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  font-size: 13px;
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.15s ease, color 0.15s ease,
    background 0.15s ease;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent-text);
  background: var(--accent-soft);
  text-decoration: none;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 38px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  max-width: 520px;
}

.hero-stats div {
  flex: 1;
  padding-right: 18px;
}

.hero-stats div + div {
  padding-left: 22px;
  border-left: 1px solid var(--border);
}

.hero-stats strong {
  display: block;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero-stats span {
  font-size: 12.5px;
  color: var(--muted);
}

/* Hero terminal */
.hero-terminal {
  position: relative;
  border-radius: 14px;
  background: linear-gradient(160deg, #101d31, #0a1424 70%);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  color: #d7e5f6;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  overflow: hidden;
  transform: perspective(1200px) rotateY(-3deg) rotateX(1deg);
}

.hero-terminal::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 200px;
  background: radial-gradient(
    circle at 70% 0%,
    rgba(56, 189, 248, 0.25),
    transparent 70%
  );
  pointer-events: none;
}

.terminal-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 15px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(148, 163, 184, 0.06);
}

.terminal-head .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red {
  background: #f87171;
}
.dot-yellow {
  background: #fbbf24;
}
.dot-green {
  background: #34d399;
}

.terminal-head span:last-child {
  margin-left: 6px;
  font-size: 11px;
  color: #7f95ae;
  letter-spacing: 0.02em;
}

.terminal-body {
  padding: 18px 18px 20px;
  overflow-x: auto;
}

.terminal-body p {
  margin: 0 0 4px;
  white-space: pre;
}

.terminal-body .prompt {
  color: #38bdf8;
  user-select: none;
}

.terminal-body .out {
  color: #7f95ae;
}

.terminal-body .ok {
  color: #34d399;
}

.terminal-body .cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: #38bdf8;
  vertical-align: -2px;
  animation: blink 1.15s steps(2, start) infinite;
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

/* ----- Sections ----- */
.section {
  padding: 64px 0;
}

.section + .section {
  border-top: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.section-head p {
  margin: 8px 0 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 15px;
}

.section-link {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

/* Learning path */
.path {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.path-step {
  position: relative;
  padding: 26px 22px 24px;
  color: var(--text);
  transition: background 0.18s ease;
}

.path-step + .path-step {
  border-left: 1px solid var(--border);
}

.path-step:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.path-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}

.path-step h3 {
  margin: 0 0 6px;
  font-size: 15.5px;
  letter-spacing: -0.01em;
}

.path-step p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
}

.path-step .arrow {
  position: absolute;
  right: 18px;
  top: 26px;
  color: var(--border-strong);
  transition: transform 0.18s ease, color 0.18s ease;
}

.path-step:hover .arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* Category cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease,
    transform 0.18s ease;
}

.cat-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.cat-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-text);
  margin-bottom: 16px;
}

.cat-icon svg {
  width: 21px;
  height: 21px;
}

.cat-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
  letter-spacing: -0.015em;
}

.cat-card > p {
  margin: 0 0 16px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

.cat-links {
  list-style: none;
  margin: auto 0 0;
  padding: 0;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.cat-links li + li {
  margin-top: 2px;
}

.cat-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-soft);
}

.cat-links a::after {
  content: "→";
  color: var(--muted);
  font-size: 13px;
  transition: transform 0.15s ease, color 0.15s ease;
}

.cat-links a:hover {
  color: var(--accent-text);
  text-decoration: none;
}

.cat-links a:hover::after {
  transform: translateX(3px);
  color: var(--accent);
}

/* Article cards */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.article-card {
  display: flex;
  flex-direction: column;
  padding: 22px 22px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease,
    transform 0.18s ease;
}

.article-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.article-card[hidden] {
  display: none;
}

.card-tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.card-tag.tag-build {
  background: rgba(99, 102, 241, 0.12);
  color: var(--indigo);
}

[data-theme="dark"] .card-tag.tag-build {
  color: #a5b4fc;
}

.card-tag.tag-ops {
  background: rgba(16, 185, 129, 0.13);
  color: var(--green);
}

.article-card h3 {
  margin: 0 0 8px;
  font-size: 16.5px;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.article-card h3 a {
  color: var(--text);
}

.article-card h3 a:hover {
  color: var(--accent-text);
  text-decoration: none;
}

.article-card > p {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.card-meta svg {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
  display: inline-block;
}

.empty-state {
  display: none;
  padding: 42px 24px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
}

.empty-state.visible {
  display: block;
}

.empty-state strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
}

/* Callout / CTA */
.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 34px 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(
    120deg,
    var(--surface) 0%,
    var(--accent-soft) 120%
  );
  box-shadow: var(--shadow-sm);
}

.cta h2 {
  margin: 0 0 6px;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.cta p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

.cta-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ----- Docs layout ----- */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 20px 0;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumbs a {
  color: var(--muted);
}

.breadcrumbs a:hover {
  color: var(--accent-text);
  text-decoration: none;
}

.breadcrumbs .sep {
  color: var(--border-strong);
}

.breadcrumbs .current {
  color: var(--text-soft);
  font-weight: 500;
}

.docs-layout {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 46px;
  align-items: start;
  max-width: var(--max);
  margin: 0 auto;
  padding: 26px 20px 76px;
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 22px);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 18px 14px;
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - var(--header-h) - 44px);
  overflow-y: auto;
}

.sidebar-close {
  display: none;
  position: absolute;
  top: 14px;
  right: 12px;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-soft);
  cursor: pointer;
  z-index: 1;
}

.sidebar-close:hover {
  color: var(--text);
  background: var(--surface-3);
}

.sidebar-close svg {
  width: 16px;
  height: 16px;
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-title svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.docs-nav-group + .docs-nav-group {
  margin-top: 16px;
}

.docs-nav-group b {
  display: block;
  padding: 0 10px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.85;
}

.docs-nav-group a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text-soft);
  transition: background 0.14s ease, color 0.14s ease;
}

.docs-nav-group a + a {
  margin-top: 1px;
}

.docs-nav-group a:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.docs-nav-group a.active {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}

.docs-main {
  min-width: 0;
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.page-title {
  margin: 0 0 14px;
  font-size: clamp(1.85rem, 3.6vw, 2.55rem);
  line-height: 1.14;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding-bottom: 22px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.page-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-meta svg {
  width: 14px;
  height: 14px;
}

.page-meta .level {
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-soft);
}

/* Prose */
.prose {
  font-size: 16px;
  line-height: 1.72;
  color: var(--text-soft);
  max-width: 74ch;
}

.prose > :first-child {
  margin-top: 0;
}

.prose p {
  margin: 0 0 1.1em;
}

.prose h2 {
  margin: 2.1em 0 0.7em;
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--border);
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--text);
  scroll-margin-top: calc(var(--header-h) + 22px);
}

.prose h3 {
  margin: 1.7em 0 0.5em;
  font-size: 1.16rem;
  letter-spacing: -0.015em;
  color: var(--text);
  scroll-margin-top: calc(var(--header-h) + 22px);
}

.prose h4 {
  margin: 1.4em 0 0.4em;
  font-size: 1rem;
  color: var(--text);
}

.prose h2:first-child,
.prose h3:first-child {
  margin-top: 0;
}

.prose ul,
.prose ol {
  margin: 0 0 1.15em;
  padding-left: 1.35em;
}

.prose li {
  margin-bottom: 0.42em;
}

.prose li::marker {
  color: var(--accent);
}

.prose strong {
  color: var(--text);
  font-weight: 650;
}

.prose a {
  color: var(--accent-text);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-underline-offset: 3px;
}

.prose a:hover {
  text-decoration-color: var(--accent);
}

.prose code {
  font-family: var(--mono);
  font-size: 0.855em;
  padding: 0.14em 0.4em;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent-text);
  word-break: break-word;
}

.prose pre {
  margin: 1.4em 0;
  padding: 18px 20px;
  border-radius: 12px;
  background: var(--code-bg);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: var(--code-text);
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.65;
  tab-size: 2;
}

.prose pre code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  white-space: pre;
}

.prose blockquote {
  margin: 1.3em 0;
  padding: 2px 0 2px 18px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.prose blockquote p {
  margin: 0;
}

.prose hr {
  margin: 2em 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.prose kbd {
  display: inline-block;
  padding: 0.1em 0.42em;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.78em;
  color: var(--text-soft);
}

/* Tables */
.table-wrap {
  margin: 1.4em 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.55;
}

.prose th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 650;
  color: var(--text);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.prose td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
  vertical-align: top;
}

.prose tr:last-child td {
  border-bottom: 0;
}

.prose tbody tr:hover td {
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
}

.prose td code {
  white-space: normal;
  overflow-wrap: break-word;
}

/* Callouts */
.callout {
  margin: 1.4em 0;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface));
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--text-soft);
}

.callout p {
  margin: 0;
}

.callout p + p {
  margin-top: 0.5em;
}

.callout strong:first-child {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.callout.tip {
  border-left-color: var(--green);
  background: color-mix(in srgb, rgba(16, 185, 129, 0.1) 70%, var(--surface));
}

.callout.warn {
  border-left-color: var(--amber);
  background: color-mix(in srgb, rgba(245, 158, 11, 0.11) 70%, var(--surface));
}

.callout.danger {
  border-left-color: var(--red);
  background: color-mix(in srgb, rgba(239, 68, 68, 0.1) 70%, var(--surface));
}

/* Code shells (added by JS) */
.code-shell {
  margin: 1.4em 0;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: var(--code-bg);
  overflow: hidden;
  box-shadow: 0 8px 22px -18px rgba(3, 15, 32, 0.9);
}

.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px 7px 16px;
  background: rgba(148, 163, 184, 0.07);
  border-bottom: 1px solid rgba(148, 163, 184, 0.13);
}

.code-bar .lang {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--code-muted);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.06);
  color: #a9bdd4;
  font-size: 11.5px;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

.copy-btn:hover {
  background: rgba(148, 163, 184, 0.14);
  color: #e2edf9;
}

.copy-btn.copied {
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.4);
}

.copy-btn svg {
  width: 12px;
  height: 12px;
}

.code-shell pre {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 18px 20px;
  box-shadow: none;
}

.code-shell pre:focus-visible {
  outline-offset: -4px;
}

/* TOC */
.docs-toc {
  display: none;
}

.toc-inner {
  border-left: 1px solid var(--border);
  padding-left: 16px;
}

.toc-inner b {
  display: block;
  margin-bottom: 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc-inner a {
  display: block;
  padding: 4px 0 4px 10px;
  margin-left: -17px;
  border-left: 2px solid transparent;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  transition: color 0.14s ease, border-color 0.14s ease;
}

.toc-inner a:hover {
  color: var(--text);
  text-decoration: none;
}

.toc-inner a.active {
  color: var(--accent-text);
  border-left-color: var(--accent);
  font-weight: 600;
}

.toc-inner a.lvl-3 {
  padding-left: 22px;
  font-size: 12px;
}

/* Pager */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 52px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  max-width: 74ch;
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.pager a:hover {
  border-color: var(--accent);
  background: var(--surface-2);
  text-decoration: none;
}

.pager a.next {
  text-align: right;
  align-items: flex-end;
}

.pager span {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.pager b {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.pager a:hover b {
  color: var(--accent-text);
}

/* ----- Footer ----- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 52px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 36px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

.footer-brand p {
  margin: 14px 0 0;
  max-width: 34ch;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--muted);
}

.footer-col h4 {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li + li {
  margin-top: 7px;
}

.footer-col a {
  font-size: 13.5px;
  color: var(--muted);
}

.footer-col a:hover {
  color: var(--accent-text);
  text-decoration: none;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: var(--max);
  margin: 36px auto 0;
  padding: 22px 20px 0;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}

.footer-bottom .made {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.footer-bottom .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

/* ----- Scrim (mobile sidebar) ----- */
.scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(4, 12, 24, 0.55);
  backdrop-filter: blur(2px);
}

/* ----- Responsive ----- */
@media (max-width: 1080px) {
  .hero-inner {
    gap: 40px;
    padding-top: 64px;
    padding-bottom: 60px;
  }

  .articles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1280px) {
  .docs-toc {
    display: none;
  }
}

@media (min-width: 1280px) {
  .docs-layout {
    grid-template-columns: 238px minmax(0, 1fr) 206px;
    gap: 40px;
  }

  .docs-toc {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + 26px);
  }
}

@media (max-width: 960px) {
  .header-nav {
    display: none;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
    padding-top: 52px;
    padding-bottom: 56px;
  }

  .hero-terminal {
    transform: none;
    max-width: 560px;
  }

  .path {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .path-step:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .path-step:nth-child(4) {
    border-top: 1px solid var(--border);
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 28px;
  }
}

@media (max-width: 900px) {
  body.docs {
    overflow-x: hidden;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .docs-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding-top: 20px;
  }

  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 80;
    width: 292px;
    max-height: none;
    border-radius: 0;
    border: 0;
    border-right: 1px solid var(--border);
    padding: 22px 16px 40px;
    padding-top: 76px;
    transform: translateX(-104%);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: none;
  }

  .sidebar-close {
    display: inline-flex;
    top: 18px;
    right: 14px;
  }

  .sidebar-title {
    padding-right: 38px;
  }

  body.nav-open .docs-sidebar {
    transform: translateX(0);
    box-shadow: 24px 0 60px -30px rgba(0, 0, 0, 0.55);
  }

  body.nav-open .scrim {
    display: block;
  }

  body.nav-open {
    overflow: hidden;
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 60px;
  }

  .header-inner {
    gap: 10px;
  }

  .brand-text small {
    display: none;
  }

  .search {
    width: auto;
    flex: 1;
    min-width: 0;
  }

  .search input {
    height: 36px;
  }

  .hero-search {
    flex-direction: column;
  }

  .hero-search .btn {
    width: 100%;
  }

  .hero-stats {
    gap: 0;
  }

  .hero-stats strong {
    font-size: 1.15rem;
  }

  .hero-stats span {
    font-size: 11.5px;
  }

  .articles-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 48px 0;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .path {
    grid-template-columns: 1fr;
  }

  .path-step + .path-step {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .path-step:nth-child(3),
  .path-step:nth-child(4) {
    border-top: 1px solid var(--border);
  }

  .pager {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .breadcrumbs {
    padding-top: 16px;
    font-size: 12px;
  }

  .page-title {
    font-size: clamp(1.7rem, 7vw, 2.1rem);
  }

  .prose {
    font-size: 15.2px;
  }

  .prose h2 {
    font-size: 1.32rem;
  }

  .cta-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .cta-actions .btn {
    flex: 1;
  }
}

@media (max-width: 440px) {
  .header-actions {
    gap: 6px;
  }

  .brand-text b {
    font-size: 14px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .hero h1 {
    font-size: 2.05rem;
  }

  .hero-stats div {
    padding-right: 10px;
  }

  .hero-stats div + div {
    padding-left: 12px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .site-header,
  .docs-sidebar,
  .docs-toc,
  .pager,
  .site-footer,
  .copy-btn,
  .breadcrumbs {
    display: none !important;
  }

  .docs-layout {
    display: block;
    padding: 0;
  }

  .prose {
    max-width: none;
    color: #000;
  }

  .prose a {
    color: #000;
  }
}
