/* =========================================================================
   homelab.badawy — design system
   "Server room control panel": near-black cool canvas, electric-blue accent,
   semantic status colors, Inter Tight + JetBrains Mono.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ---------- tokens ---------- */
:root {
  /* canvas + surfaces (cool near-black) */
  --bg:        oklch(0.165 0.012 255);
  --bg-2:      oklch(0.195 0.014 255);
  --surface:   oklch(0.214 0.015 255);
  --surface-2: oklch(0.244 0.016 255);
  --inset:     oklch(0.150 0.012 255);

  /* hairlines */
  --line:      oklch(0.285 0.016 255);
  --line-2:    oklch(0.345 0.018 255);

  /* text */
  --fg:        oklch(0.948 0.006 255);
  --fg-muted:  oklch(0.745 0.018 255);
  --fg-dim:    oklch(0.585 0.020 255);
  --fg-faint:  oklch(0.470 0.020 255);

  /* primary accent — electric blue */
  --accent:        oklch(0.685 0.168 256);
  --accent-bright: oklch(0.760 0.150 256);
  --accent-dim:    oklch(0.560 0.130 256);
  --accent-wash:   oklch(0.685 0.168 256 / 0.12);
  --accent-line:   oklch(0.685 0.168 256 / 0.35);

  /* semantic status */
  --ok:       oklch(0.760 0.150 158);
  --ok-wash:  oklch(0.760 0.150 158 / 0.13);
  --warn:     oklch(0.800 0.140 78);
  --warn-wash:oklch(0.800 0.140 78 / 0.13);
  --bad:      oklch(0.680 0.180 25);
  --bad-wash: oklch(0.680 0.180 25 / 0.13);
  --info:     var(--accent);

  /* syntax */
  --c-key:     oklch(0.760 0.130 256);
  --c-str:     oklch(0.790 0.130 145);
  --c-num:     oklch(0.810 0.130 78);
  --c-comment: oklch(0.560 0.020 255);
  --c-punc:    oklch(0.680 0.015 255);
  --c-flag:    oklch(0.780 0.140 320);
  --c-cmd:     oklch(0.800 0.140 78);

  /* type */
  --sans: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* layout */
  --topbar-h: 56px;
  --sidebar-w: 280px;
  --toc-w: 230px;
  --content-max: 760px;
  --radius: 10px;
  --radius-sm: 7px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 24px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 78% -8%, oklch(0.685 0.168 256 / 0.08), transparent 60%),
    radial-gradient(700px 400px at 12% 4%, oklch(0.760 0.150 158 / 0.045), transparent 55%),
    linear-gradient(var(--bg), var(--bg));
}
a { color: var(--accent-bright); text-decoration: none; }
a:hover { color: var(--fg); }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--accent-wash); color: var(--fg); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--fg-faint); }

/* ---------- shared atoms ---------- */
.mono { font-family: var(--mono); }
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.kbd {
  font-family: var(--mono); font-size: 12px;
  background: var(--surface); border: 1px solid var(--line-2);
  border-bottom-width: 2px; border-radius: 5px;
  padding: 1px 6px; color: var(--fg-muted);
}

/* status dot + pill */
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; box-shadow: 0 0 0 0 currentColor; }
.dot.ok   { background: var(--ok);   color: var(--ok); }
.dot.warn { background: var(--warn); color: var(--warn); }
.dot.bad  { background: var(--bad);  color: var(--bad); }
.dot.live { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50%      { box-shadow: 0 0 0 4px transparent; opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) { .dot.live { animation: none; } }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  padding: 4px 10px; border-radius: 100px;
  border: 1px solid var(--line-2); background: var(--surface);
  color: var(--fg-muted); white-space: nowrap;
}
.pill.ok   { color: var(--ok);   border-color: oklch(0.760 0.150 158 / 0.4); background: var(--ok-wash); }
.pill.warn { color: var(--warn); border-color: oklch(0.800 0.140 78 / 0.4);  background: var(--warn-wash); }
.pill.accent { color: var(--accent-bright); border-color: var(--accent-line); background: var(--accent-wash); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-size: 14.5px; font-weight: 600;
  padding: 10px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--fg);
  cursor: pointer; transition: border-color .15s, background .15s, transform .08s;
}
.btn:hover { border-color: var(--fg-faint); background: var(--surface-2); color: var(--fg); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--accent); border-color: var(--accent);
  color: oklch(0.16 0.012 255); font-weight: 700;
}
.btn.primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); color: oklch(0.16 0.012 255); }
.btn .arrow { transition: transform .15s; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--topbar-h);
  display: flex; align-items: center; gap: 22px;
  padding: 0 24px;
  background: oklch(0.165 0.012 255 / 0.82);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--fg); white-space: nowrap; flex: none; }
.brand .glyph {
  width: 28px; height: 28px; border-radius: 7px; flex: none;
  border: 1px solid var(--accent-line); background: var(--accent-wash);
  display: grid; place-items: center;
}
.brand .glyph span { width: 9px; height: 9px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.brand b { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand .sep { color: var(--fg-faint); font-weight: 400; }
.brand .sub { color: var(--fg-dim); font-family: var(--mono); font-size: 13px; font-weight: 500; }

.topnav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.topnav a {
  font-size: 14px; font-weight: 500; color: var(--fg-muted);
  padding: 7px 12px; border-radius: 6px; transition: color .15s, background .15s;
}
.topnav a:hover { color: var(--fg); background: var(--surface); }
.topnav a.active { color: var(--fg); background: var(--surface); }
.topbar .spacer { flex: 1; }
.topbar .right { display: flex; align-items: center; gap: 12px; }
.status-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--ok);
  padding: 5px 11px; border-radius: 100px; white-space: nowrap; flex: none;
  background: var(--ok-wash); border: 1px solid oklch(0.760 0.150 158 / 0.3);
}
.icon-link {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 7px; color: var(--fg-muted); border: 1px solid transparent;
}
.icon-link:hover { color: var(--fg); background: var(--surface); border-color: var(--line); }
.nav-toggle { display: none; background: none; cursor: pointer; }

/* ---------- code blocks ---------- */
.code {
  position: relative;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 22px 0;
  overflow: hidden;
}
.code-head {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-bottom: 1px solid var(--line);
  background: oklch(0.185 0.013 255);
  font-family: var(--mono); font-size: 12px; color: var(--fg-dim);
}
.code-head .fname { color: var(--fg-muted); }
.code-head .lang { margin-left: auto; color: var(--fg-faint); text-transform: lowercase; }
.code-head .dots { display: flex; gap: 6px; margin-right: 4px; }
.code-head .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.copy-btn {
  font-family: var(--mono); font-size: 11px; color: var(--fg-dim);
  background: transparent; border: 1px solid var(--line-2); border-radius: 5px;
  padding: 3px 8px; cursor: pointer; transition: color .15s, border-color .15s;
}
.copy-btn:hover { color: var(--fg); border-color: var(--fg-faint); }
.copy-btn.done { color: var(--ok); border-color: oklch(0.760 0.150 158 / 0.5); }
pre {
  margin: 0; padding: 16px 18px; overflow-x: auto;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.75; color: var(--fg);
  tab-size: 2;
}
pre code { font-family: inherit; }
/* inline code */
:not(pre) > code {
  font-family: var(--mono); font-size: 0.86em;
  background: var(--surface); border: 1px solid var(--line);
  padding: 1.5px 6px; border-radius: 5px; color: var(--accent-bright);
}
/* syntax tokens */
.t-key  { color: var(--c-key); }
.t-str  { color: var(--c-str); }
.t-num  { color: var(--c-num); }
.t-com  { color: var(--c-comment); font-style: italic; }
.t-punc { color: var(--c-punc); }
.t-flag { color: var(--c-flag); }
.t-cmd  { color: var(--c-cmd); font-weight: 600; }
.t-path { color: var(--fg); }
.t-prompt { color: var(--ok); user-select: none; }
.t-out  { color: var(--fg-dim); }

/* ---------- callouts ---------- */
.callout {
  display: flex; gap: 13px; margin: 22px 0;
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--bg-2); border: 1px solid var(--line);
  border-left: 3px solid var(--fg-faint);
  font-size: 14.5px; line-height: 1.6; color: var(--fg-muted);
}
.callout .ic { flex: none; margin-top: 1px; }
.callout b { color: var(--fg); font-weight: 600; }
.callout.info { border-left-color: var(--accent); }
.callout.info .ic { color: var(--accent); }
.callout.warn { border-left-color: var(--warn); background: var(--warn-wash); }
.callout.warn .ic { color: var(--warn); }
.callout.ok   { border-left-color: var(--ok); }
.callout.ok .ic { color: var(--ok); }
.callout code { background: oklch(0.165 0.012 255 / 0.6); }

/* generic card */
.card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
}

/* utility */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--fg-muted); }
.dim { color: var(--fg-dim); }

/* ==========================================================================
   HOME PAGE
   ========================================================================== */
.home-main { padding-bottom: 96px; }

/* hero */
.hero { padding: 86px 0 64px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero h1 {
  font-size: clamp(38px, 5vw, 62px); line-height: 1.02; font-weight: 800;
  letter-spacing: -0.03em; margin: 18px 0 0;
}
.hero h1 .blue { color: var(--accent-bright); }
.hero .lede { font-size: 19px; line-height: 1.6; color: var(--fg-muted); margin: 22px 0 0; max-width: 540px; }
.hero-cta { display: flex; gap: 13px; margin-top: 32px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 30px; margin-top: 40px; flex-wrap: wrap; }
.hero-stats .s { display: flex; flex-direction: column; gap: 2px; }
.hero-stats .s b { font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--fg); letter-spacing: -0.02em; }
.hero-stats .s span { font-size: 12.5px; font-family: var(--mono); color: var(--fg-dim); letter-spacing: 0.04em; }
.hero-stats .s b em { font-style: normal; color: var(--ok); }

/* terminal flourish card */
.term {
  background: var(--inset); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 30px 70px -30px oklch(0 0 0 / 0.7), 0 0 0 1px oklch(0.685 0.168 256 / 0.05);
  overflow: hidden; font-family: var(--mono);
}
.term-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: oklch(0.185 0.013 255); }
.term-head i { width: 11px; height: 11px; border-radius: 50%; }
.term-head .r { background: oklch(0.66 0.16 25); } .term-head .y { background: oklch(0.80 0.13 78); } .term-head .g { background: oklch(0.74 0.14 150); }
.term-head .tt { margin-left: 8px; font-size: 12px; color: var(--fg-dim); white-space: nowrap; }
.term-body { padding: 18px 18px 20px; font-size: 13px; line-height: 1.9; }
.term-body .ln { white-space: pre-wrap; }
.term-body .p { color: var(--ok); } .term-body .c { color: var(--fg); }
.term-body .o { color: var(--fg-dim); } .term-body .ok { color: var(--ok); } .term-body .bl { color: var(--accent-bright); }
.cursor { display: inline-block; width: 8px; height: 15px; background: var(--accent-bright); vertical-align: -2px; margin-left: 2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

/* section heading */
.sec { margin-top: 84px; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.sec-head h2 { font-size: 27px; font-weight: 700; letter-spacing: -0.02em; margin: 8px 0 0; }
.sec-head p { color: var(--fg-muted); margin: 6px 0 0; font-size: 15px; max-width: 540px; }
.sec-head .seclink { font-family: var(--mono); font-size: 13px; color: var(--fg-dim); display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; }
.sec-head .seclink:hover { color: var(--accent-bright); }

/* architecture diagram */
.arch {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 26px; position: relative; overflow: hidden;
}
.arch::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 26px 26px; mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 75%);
}
.arch-inner { position: relative; }
.arch-flow { display: grid; grid-template-columns: 200px 1fr; gap: 22px; align-items: stretch; }
.panel {
  background: var(--inset); border: 1px solid var(--line-2); border-radius: 10px;
  position: relative;
}
.panel .ph {
  display: flex; align-items: center; gap: 8px; padding: 9px 13px;
  border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--fg-dim);
}
.panel .ph .tag { margin-left: auto; font-size: 10.5px; color: var(--fg-faint); }
.panel.edge .ph { color: var(--warn); }
.panel.cluster { border-color: var(--accent-line); box-shadow: inset 0 0 60px oklch(0.685 0.168 256 / 0.05); }
.panel.cluster .ph { color: var(--accent-bright); }

.edge-col { display: flex; flex-direction: column; gap: 18px; }
.node {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px;
  font-family: var(--mono); font-size: 12.5px; color: var(--fg-muted);
}
.node + .node { border-top: 1px solid var(--line); }
.node .nm { color: var(--fg); }
.node .meta { margin-left: auto; font-size: 11px; color: var(--fg-faint); }
.node .si { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); flex: none; }

.ns-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 14px; }
.svc {
  display: flex; align-items: center; gap: 9px; padding: 10px 11px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--fg-muted);
  transition: border-color .15s, transform .1s; cursor: default;
}
.svc:hover { border-color: var(--accent-line); transform: translateY(-1px); color: var(--fg); }
.svc .si { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); flex: none; }
.svc.gitops .si { background: var(--ok); }
.gitops-bar {
  display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 12px 14px;
  background: var(--inset); border: 1px dashed var(--accent-line); border-radius: 9px;
  font-family: var(--mono); font-size: 12px; color: var(--fg-muted); flex-wrap: wrap;
}
.gitops-bar .glabel { color: var(--ok); display: inline-flex; align-items: center; gap: 7px; }
.gitops-bar .arrowflow { color: var(--fg-faint); }
.gitops-bar .repo { color: var(--accent-bright); }
.conn { color: var(--fg-faint); align-self: center; text-align: center; font-family: var(--mono); }
.arch-legend { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 20px; font-family: var(--mono); font-size: 11.5px; color: var(--fg-dim); }
.arch-legend span { display: inline-flex; align-items: center; gap: 7px; }
.arch-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* two big section cards */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.bigcard {
  display: flex; flex-direction: column; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 14px; padding: 26px; text-decoration: none;
  transition: border-color .18s, transform .18s, background .18s; position: relative; overflow: hidden;
}
.bigcard:hover { border-color: var(--accent-line); transform: translateY(-3px); background: var(--surface); }
.bigcard .bc-no { font-family: var(--mono); font-size: 12px; color: var(--fg-faint); letter-spacing: 0.1em; }
.bigcard h3 { font-size: 22px; font-weight: 700; color: var(--fg); margin: 12px 0 8px; letter-spacing: -0.02em; }
.bigcard .bc-desc { color: var(--fg-muted); font-size: 14.5px; line-height: 1.6; margin: 0 0 18px; }
.bigcard ul { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.bigcard ul li {
  font-family: var(--mono); font-size: 12px; color: var(--fg-muted);
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px;
}
.bigcard .bc-go { margin-top: auto; font-family: var(--mono); font-size: 13px; color: var(--accent-bright); display: inline-flex; align-items: center; gap: 8px; }
.bigcard:hover .bc-go .arrow { transform: translateX(4px); }
.bc-go .arrow { transition: transform .18s; }

/* status dashboard */
.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.stat-tile {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 11px; padding: 15px 16px;
  display: flex; flex-direction: column; gap: 10px; transition: border-color .15s; text-decoration: none;
}
.stat-tile:hover { border-color: var(--line-2); }
.stat-tile .st-top { display: flex; align-items: center; justify-content: space-between; }
.stat-tile .st-name { font-weight: 600; font-size: 14px; color: var(--fg); }
.stat-tile .st-sub { font-family: var(--mono); font-size: 11px; color: var(--fg-dim); }
.stat-tile .st-state { font-family: var(--mono); font-size: 11.5px; display: inline-flex; align-items: center; gap: 6px; }
.stat-tile .st-state.ok { color: var(--ok); } .stat-tile .st-state.warn { color: var(--warn); }
.stat-tile .meter { height: 4px; border-radius: 3px; background: var(--inset); overflow: hidden; }
.stat-tile .meter i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.stat-tile .meter i.ok { background: var(--ok); } .stat-tile .meter i.warn { background: var(--warn); }

/* footer */
.foot { margin-top: 90px; border-top: 1px solid var(--line); padding: 30px 0 10px; }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; font-family: var(--mono); font-size: 12.5px; color: var(--fg-dim); }
.foot-row a { color: var(--fg-muted); } .foot-row a:hover { color: var(--accent-bright); }
.foot-row .deploy { display: inline-flex; align-items: center; gap: 8px; }

/* ==========================================================================
   DOCS LAYOUT
   ========================================================================== */
.read-bar { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; background: transparent; }
.read-bar i { display: block; height: 100%; background: var(--accent-bright); transform: scaleX(0); transform-origin: 0 50%; transition: transform .05s linear; box-shadow: 0 0 8px var(--accent); }

.docs {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  align-items: start;
  max-width: 1500px; margin: 0 auto;
}

/* sidebar */
.sidebar {
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  border-right: 1px solid var(--line);
  padding: 22px 16px 60px;
}
.side-search { display: none; }
.side-search .kbd { margin-left: auto; }
.nav-group { margin-bottom: 8px; }
.nav-grouphead {
  display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-dim); padding: 8px 10px;
}
.nav-grouphead .chev { margin-left: auto; transition: transform .15s; color: var(--fg-faint); font-size: 10px; }
.nav-group.collapsed .chev { transform: rotate(-90deg); }
.nav-group.collapsed .nav-items { display: none; }
.nav-items { list-style: none; margin: 0 0 6px; padding: 0; }
.nav-items li a {
  display: flex; align-items: center; gap: 9px;
  padding: 6.5px 10px 6.5px 22px; border-radius: 7px; margin: 1px 0;
  font-size: 14px; color: var(--fg-muted); position: relative; transition: color .12s, background .12s;
}
.nav-items li a:hover { color: var(--fg); background: var(--surface); }
.nav-items li a.active { color: var(--accent-bright); background: var(--accent-wash); font-weight: 600; }
.nav-items li a.active::before {
  content: ""; position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 2px; background: var(--accent);
}
.nav-items li a .sd { margin-left: auto; }

/* content */
.doc-main { padding: 38px 56px 100px; min-width: 0; }
.breadcrumb { display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 12.5px; color: var(--fg-dim); margin-bottom: 22px; }
.breadcrumb a { color: var(--fg-dim); } .breadcrumb a:hover { color: var(--accent-bright); }
.breadcrumb .s { color: var(--fg-faint); }

.doc-header { border-bottom: 1px solid var(--line); padding-bottom: 26px; margin-bottom: 8px; }
.doc-header .htop { display: flex; align-items: center; gap: 14px; }
.doc-logo {
  width: 46px; height: 46px; border-radius: 11px; flex: none; display: grid; place-items: center;
  background: var(--accent-wash); border: 1px solid var(--accent-line);
}
.doc-logo svg { color: var(--accent-bright); }
.doc-header h1 { font-size: 36px; font-weight: 800; letter-spacing: -0.03em; margin: 0; }
.doc-header .tagline { color: var(--fg-muted); font-size: 17px; margin: 14px 0 18px; max-width: 600px; line-height: 1.55; }
.doc-pills { display: flex; gap: 9px; flex-wrap: wrap; }

.doc-article { max-width: var(--content-max); }
.doc-article h2 {
  font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 52px 0 4px;
  scroll-margin-top: 80px; display: flex; align-items: center; gap: 11px;
}
.doc-article h2 .hn { font-family: var(--mono); font-size: 13px; color: var(--accent); font-weight: 600; }
.doc-article h3 { font-size: 17.5px; font-weight: 600; margin: 34px 0 2px; color: var(--fg); scroll-margin-top: 80px; }
.doc-article p { color: var(--fg-muted); margin: 14px 0; font-size: 15.5px; line-height: 1.72; }
.doc-article p strong, .doc-article li strong { color: var(--fg); font-weight: 600; }
.doc-article ul, .doc-article ol { color: var(--fg-muted); padding-left: 22px; margin: 14px 0; line-height: 1.7; font-size: 15.5px; }
.doc-article li { margin: 7px 0; }
.doc-article li::marker { color: var(--fg-faint); }
.lead { font-size: 17px !important; color: var(--fg) !important; line-height: 1.7 !important; }

/* spec table */
.spec-table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 14px; }
.spec-table th, .spec-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.spec-table th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-dim); font-weight: 600; }
.spec-table td { color: var(--fg-muted); }
.spec-table td.k { font-family: var(--mono); color: var(--fg); font-size: 13px; }
.spec-table tr:last-child td { border-bottom: none; }
.spec-table .mono { color: var(--accent-bright); }

/* app-of-apps mini diagram */
.aoa {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 22px; margin: 26px 0;
}
.aoa-root {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 auto 6px; padding: 11px 16px;
  background: var(--accent-wash); border: 1px solid var(--accent-line); border-radius: 9px;
  font-family: var(--mono); font-size: 13px; color: var(--accent-bright); font-weight: 600;
}
.aoa-wrap { display: flex; flex-direction: column; align-items: center; }
.aoa-stem { width: 1px; height: 18px; background: var(--line-2); }
.aoa-children { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; margin-top: 6px; }
.aoa-child {
  display: flex; flex-direction: column; gap: 6px; padding: 11px; border-radius: 8px;
  background: var(--inset); border: 1px solid var(--line); font-family: var(--mono); font-size: 12px;
}
.aoa-child .cn { color: var(--fg); }
.aoa-child .cs { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ok); }
.aoa-child.warn .cs { color: var(--warn); }

/* prev/next */
.doc-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 64px; }
.doc-nav a {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; transition: border-color .15s, background .15s;
}
.doc-nav a:hover { border-color: var(--accent-line); background: var(--surface); }
.doc-nav .dir { font-family: var(--mono); font-size: 11.5px; color: var(--fg-dim); }
.doc-nav .ttl { color: var(--fg); font-weight: 600; font-size: 15px; }
.doc-nav a.next { text-align: right; }

/* edit footer */
.doc-foot { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12.5px; color: var(--fg-dim); flex-wrap: wrap; gap: 10px; }
.doc-foot a { color: var(--fg-muted); } .doc-foot a:hover { color: var(--accent-bright); }

/* TOC */
.toc {
  position: sticky; top: var(--topbar-h);
  max-height: calc(100vh - var(--topbar-h));
  overflow-y: auto; padding: 38px 20px 60px 8px;
}
.toc .toc-title { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-dim); margin-bottom: 14px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a {
  display: block; padding: 5px 0 5px 14px; margin-left: -1px;
  font-size: 13px; color: var(--fg-dim); border-left: 2px solid transparent; transition: color .12s, border-color .12s;
}
.toc li a:hover { color: var(--fg-muted); }
.toc li a.active { color: var(--accent-bright); border-left-color: var(--accent); }
.toc .sub a { padding-left: 26px; font-size: 12.5px; }
.toc-meta { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; color: var(--fg-dim); }
.toc-meta .row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.toc-meta .row span:last-child { color: var(--fg-muted); }

/* ==========================================================================
   CLUSTER OVERVIEW — component grid
   ========================================================================== */
.comp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 26px 0; }
.comp-card {
  display: flex; flex-direction: column; gap: 9px; padding: 18px 20px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 11px;
  text-decoration: none; transition: border-color .15s, transform .12s, background .15s;
}
.comp-card:hover { border-color: var(--accent-line); transform: translateY(-2px); background: var(--surface); }
.comp-card .cc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.comp-card .cc-name { font-weight: 700; font-size: 15px; color: var(--fg); }
.comp-card .cc-ns { font-family: var(--mono); font-size: 11px; color: var(--fg-faint); background: var(--inset); border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px; white-space: nowrap; }
.comp-card .cc-desc { font-size: 13.5px; color: var(--fg-muted); line-height: 1.55; flex: 1; }
.comp-card .cc-go { font-family: var(--mono); font-size: 12px; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; }
.comp-card:hover .cc-go .arrow { transform: translateX(3px); }
.cc-go .arrow { transition: transform .15s; }

/* namespace anatomy table */
.ns-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 13.5px; }
.ns-table th, .ns-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ns-table th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-dim); }
.ns-table td { color: var(--fg-muted); }
.ns-table td.k { font-family: var(--mono); color: var(--fg); font-size: 12.5px; }
.ns-table td.apps { font-family: var(--mono); font-size: 12px; color: var(--fg-dim); }
.ns-table tr:last-child td { border-bottom: none; }

@media (max-width: 900px) { .comp-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .comp-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .arch-flow { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .status-grid { grid-template-columns: repeat(2, 1fr); }
  .topnav { display: none; }
  .status-chip { display: none; }
}
@media (max-width: 560px) {
  .status-grid { grid-template-columns: 1fr; }
  .ns-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1240px) {
  .docs { grid-template-columns: var(--sidebar-w) minmax(0,1fr); }
  .toc { display: none; }
  .doc-main { padding-right: 40px; }
}
@media (max-width: 1080px) {
  .docs { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: var(--topbar-h); z-index: 45; width: 86%; max-width: 320px;
    background: var(--bg); transform: translateX(-100%); transition: transform .22s ease; box-shadow: 30px 0 60px -30px #000;
  }
  .sidebar.open { transform: translateX(0); }
  .nav-toggle { display: grid !important; }
  .doc-main { padding: 30px 22px 80px; }
  .aoa-children { grid-template-columns: repeat(2, 1fr); }
  .topnav { display: none; }
}
@media (min-width: 1081px) {
  .sidebar { display: none; }
  .docs .sidebar { display: block; }
}
