/* homelab.css - styles for the /homelab mini-site.
   Reuses the CV design tokens from styles.css. Two parts:
   (1) the bespoke services-tour LANDING (showcase components), and
   (2) the GENERATED doc pages (documentation layout + markdown prose). */

/* ============================================================
   PART 0 - homelab nav overrides (scoped: only loaded on /homelab)
   ============================================================ */
/* center the top nav links; logo stays left, in flow */
.nav-links {
  position: absolute; left: 50%; transform: translateX(-50%);
}
/* shell-style breadcrumb: current page title as the path leaf */
.nav-logo .path-leaf { color: var(--accent); }

/* ============================================================
   PART 1 - showcase landing
   ============================================================ */
.lab-hero { margin-top: 62px; padding: 0 0 8px; } /* clear 52px fixed nav + 10px */
.lab-hero .terminal-line {
  font-family: var(--mono); font-size: 13px; color: var(--text-dim);
  margin-bottom: 10px;
}
.lab-title {
  font-family: var(--mono); font-weight: 400; line-height: 1.05;
  font-size: clamp(40px, 8vw, 72px); color: var(--text); margin: 0;
  letter-spacing: 0.01em;
}
.lab-title em { color: var(--accent); font-style: normal; }
.lab-prompt { color: var(--accent-dim); margin-right: 2px; }
.lab-tagline {
  font-size: 18px; color: var(--text-muted); line-height: 1.6;
  margin: 16px 0 0;
}

/* wide topology diagram */
.lab-diagram {
  margin: 26px 0 0; border: 1px solid var(--border);
  background: var(--surface2); padding: 14px;
}
.lab-diagram img { display: block; width: 100%; height: auto; }
.lab-diagram figcaption {
  font-family: var(--mono); font-size: 12px; color: var(--text-dim);
  margin-top: 10px;
}

/* stat counters */
.stat-row {
  display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 6px;
}
.stat {
  flex: 1 1 0; min-width: 120px; border: 1px solid var(--border);
  background: var(--surface2); padding: 14px 16px;
}
.stat-num {
  font-family: var(--mono); font-size: 28px; color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-family: var(--mono); font-size: 12px; color: var(--text-muted);
  margin-top: 6px; text-transform: uppercase; letter-spacing: 0.04em;
}

.lab-section { margin-top: 48px; }
.lab-intro { color: var(--text-muted); line-height: 1.7; max-width: 70ch;
  margin: 0 0 20px; }

/* service-tile grid, grouped by area */
.svc-group { margin-bottom: 26px; }
.svc-group-label {
  font-family: var(--mono); font-size: 12px; color: var(--accent-dim);
  text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 10px;
}
.stack-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.svc-tile {
  display: block; text-decoration: none; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface2);
  padding: 14px 16px; transition: border-color .2s, transform .2s;
}
.svc-tile:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.svc-name {
  font-family: var(--mono); font-size: 15px; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.svc-open { margin-left: auto; font-family: var(--mono); font-size: 11px;
  color: var(--text-dim); }
.svc-tile:hover .svc-open { color: var(--accent); }
.svc-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow); flex: none;
}
.svc-role {
  font-family: var(--mono); font-size: 11px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.05em; margin: 4px 0 0 15px;
}
.svc-desc { font-size: 13.5px; color: var(--text-muted); line-height: 1.55;
  margin: 8px 0 0; }

/* lab VMs: fastfetch screenshot gallery (each tile is a link) */
.vm-gallery {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
}
@media (max-width: 760px) { .vm-gallery { grid-template-columns: repeat(2, 1fr); } }
.vm-shot { display: block; cursor: pointer; text-decoration: none; border: 1px solid var(--border);
  background: var(--surface2); transition: border-color .2s, transform .2s; }
.vm-shot:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
/* art tile: a cropped/rescaled official asset, uniform across VMs */
.vm-art {
  aspect-ratio: 16 / 10; overflow: hidden; display: flex;
  align-items: center; justify-content: center; background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.vm-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vm-art--logo { background: var(--surface2); }
.vm-art--logo img { object-fit: contain; padding: 24px; }
.vm-cap {
  display: flex; align-items: center; font-family: var(--mono); font-size: 12px;
  color: var(--text-muted); padding: 8px 12px;
}
.vm-open { margin-left: auto; font-size: 11px; color: var(--text-dim); }
.vm-shot:hover .vm-cap, .vm-shot:hover .vm-open { color: var(--accent); }

/* terminal-window console modal (pure CSS checkbox toggle, no JS, no hash
   navigation - so opening/closing never scrolls the page) */
/* kept inside the viewport (fixed, 1px, transparent) so the focus the label
   moves to it on click can never scroll the page */
.modal-toggle { position: fixed; top: 0; left: 0; width: 1px; height: 1px;
  opacity: 0; pointer-events: none; }
.term-modal { display: none; }
.modal-toggle:checked + .term-modal {
  display: flex; align-items: center; justify-content: center;
  position: fixed; inset: 0; z-index: 200; padding: 20px;
}
.term-backdrop {
  position: absolute; inset: 0; background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(2px);
}
.term-window {
  position: relative; width: min(900px, 95vw); max-height: 86vh;
  display: flex; flex-direction: column; background: var(--bg);
  border: 1px solid var(--accent-dim);
  box-shadow: 0 0 40px rgba(0, 255, 157, 0.12), 0 24px 70px rgba(0, 0, 0, 0.6);
  animation: term-open 0.16s ease-out;
}
@keyframes term-open {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to   { opacity: 1; transform: none; }
}
.term-bar {
  position: relative; display: flex; align-items: center; gap: 9px;
  padding: 11px 14px; background: var(--surface2);
  border-bottom: 1px solid var(--border); flex: none;
}
.tb-dots { display: flex; align-items: center; gap: 9px; }
.tb-dots i { width: 13px; height: 13px; border-radius: 50%; display: block; flex: none; }
.tb-dots i:nth-of-type(1) { background: #ffbd2e; }   /* yellow (decorative) */
.tb-dots i:nth-of-type(2) { background: #27c93f; }   /* green (decorative)  */
/* the red dot IS the close button, with a generous invisible hit area */
.tb-close {
  position: relative; width: 13px; height: 13px; border-radius: 50%;
  background: #ff5f56; border: 0; padding: 0; cursor: pointer; flex: none;
  transition: box-shadow .15s, background .15s;
}
.tb-close::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; }
.tb-close:hover { background: #ff453a; box-shadow: 0 0 0 4px rgba(255,69,58,.28); }
.tb-title {
  position: absolute; left: 0; right: 0; text-align: center; pointer-events: none;
  font-family: var(--mono); font-size: 13px; color: var(--text-muted);
}
.term-body {
  padding: 18px 22px 22px; overflow-y: auto; font-size: 16px;
  color: var(--text-muted); line-height: 1.7;
}
.con-prompt {
  font-family: var(--mono); font-size: 12.5px; color: var(--accent);
  margin-bottom: 14px; word-break: break-all;
}
.con-h {
  font-family: var(--mono); font-size: 14px; color: var(--accent-dim);
  text-transform: uppercase; letter-spacing: 0.05em; margin: 18px 0 6px;
}
/* concrete artifacts: a command + its real output/config */
.con-note { font-family: var(--mono); font-size: 14px; color: var(--text-dim);
  margin: 4px 0 10px; }
.con-cmd { font-family: var(--mono); font-size: 14.5px; color: var(--text);
  margin: 14px 0 6px; word-break: break-all; }
.con-cmd::before { content: "bogdan@noxlab:~$ "; color: var(--accent); }
.con-out {
  font-family: var(--mono); font-size: 14px; line-height: 1.55;
  color: var(--text-muted); background: var(--surface2);
  border: 1px solid var(--border); border-left: 2px solid var(--accent-dim);
  padding: 10px 12px; margin: 0 0 12px; overflow-x: auto; white-space: pre;
}
.con-out .k { color: var(--accent); }
.con-out .c { color: var(--text-dim); }
.term-body p { margin: 0 0 10px; }
.term-body p:last-of-type { margin-bottom: 0; }
.term-body strong { color: var(--text); font-weight: 600; }
.term-body code {
  font-family: var(--mono); font-size: 14px; background: var(--surface2);
  color: var(--accent-dim); padding: 1px 5px; border: 1px solid var(--border);
  border-radius: 3px;
}
.con-doc {
  display: inline-block; margin-top: 16px; font-family: var(--mono);
  font-size: 14.5px; color: var(--accent); text-decoration: none;
  border: 1px solid var(--border); padding: 8px 14px;
}
.con-doc:hover { border-color: var(--accent-dim); background: rgba(0,255,157,.05); }

/* "the box" hardware spec */
.box-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.box-spec { border: 1px solid var(--border); background: var(--surface2);
  padding: 4px 18px; }
.spec-row { display: flex; justify-content: space-between; gap: 16px;
  padding: 11px 0; border-bottom: 1px solid var(--border); }
.spec-row:last-child { border-bottom: 0; }
.spec-k { font-family: var(--mono); font-size: 12px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.04em; }
.spec-v { font-family: var(--mono); font-size: 13px; color: var(--text);
  text-align: right; }
.box-note { color: var(--text-muted); line-height: 1.7; margin: 0 0 14px; }
.box-note:last-child { margin-bottom: 0; }
.box-note strong { color: var(--text); font-weight: 600; }
@media (max-width: 760px) { .box-grid { grid-template-columns: 1fr; } }

/* roadmap */
.roadmap { list-style: none; margin: 0; padding: 0; }
.road-item { display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border); }
.road-item:last-child { border-bottom: 0; }
.road-tag { font-family: var(--mono); font-size: 11px; color: var(--accent-dim);
  border: 1px solid var(--border); padding: 2px 8px; height: fit-content;
  white-space: nowrap; }
.road-body { color: var(--text-muted); line-height: 1.6; }
.road-body strong { color: var(--text); font-weight: 600; }

/* docs index cards */
.doc-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr));
  gap: 10px; }
.doc-card { display: block; border: 1px solid var(--border);
  background: var(--surface2); padding: 14px 16px; text-decoration: none;
  transition: border-color .2s, background .2s; }
.doc-card:hover { border-color: var(--accent-dim); background: rgba(0,255,157,.05); }
.doc-card .dc-name { font-family: var(--mono); font-size: 14px; color: var(--accent); }
.doc-card .dc-desc { font-size: 13px; color: var(--text-muted); margin-top: 6px;
  line-height: 1.5; }

.lab-cta { margin-top: 18px; }
.lab-cta a { font-family: var(--mono); font-size: 13px; color: var(--text-muted);
  text-decoration: none; border: 1px solid var(--border); padding: 9px 16px;
  display: inline-block; }
.lab-cta a:hover { color: var(--accent); border-color: var(--accent-dim); }

/* capability index - the employer-facing "what this demonstrates" cards */
.cap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .cap-grid { grid-template-columns: 1fr; } }
.cap-card {
  display: block; text-decoration: none; border: 1px solid var(--border);
  background: var(--surface2); padding: 16px 18px;
  transition: border-color .2s, transform .2s, background .2s;
}
.cap-card:hover { border-color: var(--accent-dim); transform: translateY(-2px);
  background: rgba(0, 255, 157, 0.04); }
.cap-tag { font-family: var(--mono); font-size: 11px; color: var(--accent-dim);
  text-transform: uppercase; letter-spacing: 0.06em; }
.cap-claim { font-family: var(--mono); font-size: 17px; color: var(--text);
  margin: 6px 0 8px; }
.cap-proof { font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.cap-link { font-family: var(--mono); font-size: 12.5px; color: var(--accent);
  margin-top: 11px; }
.cap-card:hover .cap-link { text-decoration: underline; }

/* ============================================================
   PART 2 - generated doc pages
   ============================================================ */

/* doc layout: contents rail + article */
.doc-layout {
  display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 40px;
  align-items: start; margin-top: 62px; /* clear 52px fixed nav + 10px */
}
.doc-sidebar { position: relative; }
.doc-rail { position: relative; }
.doc-rail .rail-label {
  font-family: var(--mono); font-size: 12px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px;
}
.rail-repo {
  display: inline-block; margin-top: 18px; font-family: var(--mono);
  font-size: 12px; color: var(--text-muted); text-decoration: none;
}
.rail-repo:hover { color: var(--accent); }
@media (max-width: 820px) {
  .doc-layout { grid-template-columns: 1fr; gap: 18px; }
  .doc-sidebar { position: static; }
}

/* ---- contents nav ---- */
.toc-nav { list-style: none; margin: 0; padding: 0; }
.toc-nav li { margin: 0; }
.toc-nav a {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 0 5px 14px;
  border-left: 1px solid var(--border);
  transition: color .2s, border-color .2s;
}
.toc-nav a:hover { color: var(--accent); border-left-color: var(--accent-dim); }
.toc-nav a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}
.toc-nav a.active::before { content: '> '; color: var(--accent); }
/* deep-dive sub-pages: indented, faintly tagged under their topic */
.toc-nav li.toc-sub a {
  padding-left: 28px;
  font-size: 12px;
  color: var(--text-dim);
}
.toc-nav li.toc-sub a::before { content: '└ '; color: var(--text-dim); }
.toc-nav li.toc-sub a:hover { color: var(--accent); }
.toc-nav li.toc-sub a.active { color: var(--accent); border-left-color: var(--accent); }
.toc-nav li.toc-sub a.active::before { content: '└ '; color: var(--accent); }

/* breadcrumb back to a topic overview, atop a deep-dive page */
.doc-breadcrumb {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 20px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: color .2s, border-color .2s;
}
.doc-breadcrumb:hover { color: var(--accent); border-color: var(--accent-dim); }

/* "read the deep-dive" call-to-action at the foot of an overview */
.doc-content a.deep-dive-cta {
  display: block;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
  margin: 26px 0 8px;
  padding: 14px 18px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  transition: border-color .2s, background .2s;
}
.doc-content a.deep-dive-cta:hover {
  border-color: var(--accent-dim);
  border-left-color: var(--accent);
  background: #161b22;
}

/* ---- prose ---- */
.doc-content { color: var(--text-muted); line-height: 1.75; font-size: 15px; }
.doc-content > *:first-child { margin-top: 0; }

.doc-content h1 {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.02em;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.doc-content h2 {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 400;
  color: var(--accent);
  margin: 34px 0 12px;
  letter-spacing: 0.02em;
}
.doc-content h2::before { content: '## '; color: var(--text-dim); }
.doc-content h2 em { color: var(--text); font-style: normal; }  /* white emphasis in headings */
.doc-content h3 {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  margin: 24px 0 8px;
}
.doc-content h3::before { content: '### '; color: var(--text-dim); }
.doc-content h4 {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  margin: 18px 0 6px;
}

.doc-content p { margin: 0 0 14px; }
.doc-content a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
.doc-content a:hover { border-bottom-color: var(--accent-dim); }

.doc-content ul, .doc-content ol { margin: 0 0 14px; padding-left: 22px; }
.doc-content li { margin: 4px 0; }
.doc-content ul li::marker { color: var(--accent-dim); }
.doc-content ol li::marker { color: var(--text-dim); font-family: var(--mono); }

.doc-content strong { color: var(--text); font-weight: 600; }
.doc-content em { color: var(--text-muted); }
.doc-content hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }

/* inline + block code */
.doc-content code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface2);
  color: var(--accent-dim);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.doc-content pre {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 16px;
  line-height: 1.5;
}
.doc-content pre code {
  background: none;
  border: 0;
  padding: 0;
  color: var(--text);
  font-size: 12.5px;
}

/* tables */
.doc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 18px;
  font-size: 14px;
}
.doc-content th {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-dim);
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--accent-dim);
}
.doc-content td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
}
.doc-content tr:hover td { background: var(--surface2); }
/* table emphasis is uniform: first column always bold, other columns never
   (neutralises any stray inline **bold** in the markdown) */
.doc-content td:first-child { font-weight: 600; color: var(--text); }
.doc-content td:not(:first-child) strong { font-weight: 400; color: inherit; }

/* blockquote */
.doc-content blockquote {
  margin: 0 0 16px;
  padding: 10px 16px;
  border-left: 2px solid var(--accent-dim);
  background: var(--surface2);
  color: var(--text-muted);
}
.doc-content blockquote p:last-child { margin-bottom: 0; }

/* task-list items (- [x] / - [ ]) */
.doc-content ul.tasklist { list-style: none; padding-left: 4px; }
.doc-content .task { display: inline; }
.doc-content .task::before {
  font-family: var(--mono);
  margin-right: 8px;
}
.doc-content .task.done::before { content: '[x]'; color: var(--accent); }
.doc-content .task.todo::before { content: '[ ]'; color: var(--text-dim); }

/* diagrams (rendered from mermaid blocks -> author SVG + collapsible source) */
.doc-content figure.diagram {
  margin: 0 0 20px;
  border: 1px solid var(--border);
  background: var(--surface2);
  padding: 12px;
}
.doc-content figure.diagram img { display: block; width: 100%; height: auto; }
/* mermaid renders into this <pre>; strip the default code-block styling */
.doc-content figure.diagram .mermaid {
  background: none; border: 0; padding: 0; margin: 0;
  text-align: center; line-height: normal; overflow-x: auto;
}
.doc-content figure.diagram .mermaid svg { max-width: 100%; height: auto; }
.doc-content figure.diagram figcaption {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
}
.doc-content details.diagram-src { margin-top: 10px; }
.doc-content details.diagram-src summary {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}
.doc-content details.diagram-src summary:hover { color: var(--accent); }

/* tongue-in-cheek footer credit line */
.footer-credit {
  flex-basis: 100%; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border);
  font-family: var(--mono); font-size: 12px; color: var(--text-dim); line-height: 1.55;
  text-align: center;
}
.footer-claude {
  width: 20px; height: 20px; flex-shrink: 0;
  filter: hue-rotate(135deg) saturate(1.6) brightness(1.05);
}
.footer-credit code { font-family: var(--mono); color: var(--text-muted); }
.footer-xd { color: var(--accent); font-weight: 600; letter-spacing: 0.04em; }
.doc-content details.diagram-src pre { margin-top: 8px; }

/* static console card — inline command+output evidence on section pages.
   Reuses .con-cmd/.con-out (and their bogdan@noxlab:~$ prompt + .k/.c spans);
   only the window shell + title bar are styled here. No modal, no JS. */
.console-card {
  margin: 22px 0; background: var(--bg);
  border: 1px solid var(--accent-dim);
  box-shadow: 0 0 22px rgba(0, 255, 157, 0.07);
}
.console-card .cc-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 13px; background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.console-card .cc-bar i {
  width: 11px; height: 11px; border-radius: 50%; display: block; flex: none;
}
.console-card .cc-bar i:nth-of-type(1) { background: #ff5f56; }
.console-card .cc-bar i:nth-of-type(2) { background: #ffbd2e; }
.console-card .cc-bar i:nth-of-type(3) { background: #27c93f; }
.console-card .cc-title {
  margin-left: 6px; font-family: var(--mono); font-size: 12.5px;
  color: var(--text-muted);
}
.console-card .cc-body { padding: 15px 16px 16px; }
.console-card .cc-body .con-cmd:first-child { margin-top: 0; }
.console-card .cc-body .con-out:last-child,
.console-card .cc-body .con-note:last-child { margin-bottom: 0; }
