/* ---- Design tokens ---------------------------------------------------
   Continues #mue's existing RetroGeek theme (dark ground, phosphor green,
   monospace), carried over from the k3s-homelab mockup. */
:root {
  --bg: #10130f;
  --bg-panel: #171c15;
  --bg-panel-alt: #1d241a;
  --bg-inset: #0c0e0a;
  --fg: #a9e6b4;
  --fg-bright: #7dffb0;
  --fg-dim: #587a5f;
  --fg-faint: #3d5a42;
  --amber: #ffb454;
  --amber-dim: #8c6a3a;
  --border: rgba(140, 255, 170, 0.16);
  --border-bright: rgba(140, 255, 170, 0.32);
  --selection: rgba(125, 255, 176, 0.25);
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  --measure: 68ch;
}

* { box-sizing: border-box; }
::selection { background: var(--selection); color: #041006; }

html, body {
  background: var(--bg);
  color: var(--fg);
}

body {
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-image:
    radial-gradient(ellipse at top, rgba(125,255,176,0.05), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0px, rgba(255,255,255,0.012) 1px, transparent 1px, transparent 3px);
}

a { color: var(--fg-bright); text-decoration: underline dotted var(--fg-dim); text-underline-offset: 3px; }
a:hover { color: var(--amber); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

h1, h2, h3 { text-wrap: balance; font-weight: 700; color: var(--fg-bright); margin: 0; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ---- Nav -------------------------------------------------------- */
.site-nav {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
}
.site-nav nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin: 10px 0 0;
  padding: 0;
}
.site-nav nav a {
  text-decoration: none;
  color: var(--fg-dim);
  font-size: 0.92rem;
}
.site-nav nav a:hover { color: var(--amber); }
.site-nav nav a[aria-current="page"] { color: var(--fg-bright); border-bottom: 1px solid var(--amber); }

.prompt-line {
  color: var(--fg-dim);
  font-size: 0.9rem;
  margin: 0 0 6px;
}
.prompt-line .user { color: var(--fg-bright); }
.prompt-line .path { color: var(--amber); }

/* ---- Hero / article header ---------------------------------------- */
.hero, main article { padding: 48px 0 56px; }
main h1, .hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--fg-bright);
  transform: translateY(0.15em);
  animation: blink 1.1s steps(1) infinite;
}
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; opacity: 1; } }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.hero-lede, .content {
  max-width: var(--measure);
  color: var(--fg);
  margin-top: 18px;
  font-size: 1.02rem;
}
.content h2 { font-size: 1.15rem; margin-top: 28px; margin-bottom: 10px; }
.content ul { padding-left: 1.2em; }
.content li { margin: 4px 0; }

.back-link-top, .back-link-bottom { font-family: var(--mono); font-size: 0.85rem; }
.back-link-top { margin-bottom: 14px; }
.back-link-bottom { margin-top: 32px; }
.back-link-top a, .back-link-bottom a {
  color: var(--fg-dim);
  text-decoration: none;
}
.back-link-top a::before, .back-link-bottom a::before { content: "$ "; color: var(--amber); }
.back-link-top a:hover, .back-link-bottom a:hover { color: var(--amber); }
.back-link-bottom a .dim { color: var(--fg-dim); }

p { max-width: var(--measure); }
.lead { color: var(--fg); }
.note { color: var(--fg-dim); font-size: 0.88rem; }

/* ---- Panels ---------------------------------------------------------- */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.panel-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-panel-alt);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--fg-dim);
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--fg-faint); }
.panel-titlebar .fname { margin-left: 6px; }
.panel-body { padding: 22px; }

.expand-btn {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-dim);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  box-shadow: none;
}
.expand-btn:hover { color: var(--fg-bright); border-color: var(--border-bright); background: var(--bg-inset); }
.expand-btn:focus-visible { border-color: var(--fg-bright); }
.expand-btn::-moz-focus-inner { border: 0; }
.panel:fullscreen,
.panel:-webkit-full-screen {
  display: flex;
  flex-direction: column;
  border-radius: 0;
}
.panel:fullscreen .panel-body,
.panel:-webkit-full-screen .panel-body {
  flex: 1;
  padding: 0;
}
.panel:fullscreen .panel-body iframe,
.panel:-webkit-full-screen .panel-body iframe {
  height: 100% !important;
}

/* ---- Gallery grid ------------------------------------------------------ */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.gallery-grid-lg { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.gallery-item { display: block; text-decoration: none; cursor: zoom-in; }
.gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.gallery-item:hover img { border-color: var(--border-bright); transform: translateY(-1px); }

#lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 16, 6, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  cursor: zoom-out;
}
#lightbox-overlay.open { display: flex; }
#lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  border: 1px solid var(--border-bright);
  border-radius: 4px;
  cursor: default;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-radius: 4px;
  color: var(--fg-bright);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-nav:hover { color: var(--amber); border-color: var(--amber); }
#lightbox-prev { left: 16px; }
#lightbox-next { right: 16px; }

#lightbox-count {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--fg-dim);
  font-size: 0.8rem;
}

@media (max-width: 560px) {
  .lightbox-nav { width: 36px; height: 36px; font-size: 1.3rem; }
  #lightbox-prev { left: 6px; }
  #lightbox-next { right: 6px; }
}

/* ---- k3s-homelab page: command headers, specs, tables, flow, cards ---- */
section { padding: 52px 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: none; }
.hero-lede .dim, .hero-lede.content .dim { color: var(--fg-dim); }

.cmd-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.cmd-header .glyph { color: var(--fg-dim); }
.cmd-header code { font-size: 0.95rem; color: var(--fg-bright); background: none; }
.cmd-header .eyebrow {
  color: var(--fg-dim);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-left: auto;
}

.diagram-scroll { overflow-x: auto; }
.diagram-scroll svg { display: block; min-width: 640px; }

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 24px;
}
.spec { border: 1px solid var(--border); border-radius: 4px; padding: 12px 14px; background: var(--bg-inset); }
.spec dt { color: var(--fg-dim); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; }
.spec dd { margin: 4px 0 0; color: var(--fg-bright); font-size: 0.95rem; }
.spec dd .sub { display: block; color: var(--fg-dim); font-size: 0.78rem; margin-top: 2px; }

.hw-table-scroll { overflow-x: auto; margin-top: 28px; }
.hw-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; min-width: 620px; }
.hw-table caption {
  text-align: left; color: var(--fg-dim); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px;
}
.hw-table th, .hw-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.hw-table thead th {
  color: var(--fg-dim); font-weight: 400; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border-bright);
}
.hw-table tbody th { color: var(--fg-bright); font-weight: 700; white-space: nowrap; }
.hw-table td { color: var(--fg); font-variant-numeric: tabular-nums; }
.hw-table td .dim { color: var(--fg-dim); }
.hw-table .gpu-yes { color: var(--amber); }
.hw-table .gpu-no { color: var(--fg-faint); }
.hw-table tbody tr:last-child th, .hw-table tbody tr:last-child td { border-bottom: none; }

.stack-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.stack-list li {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-inset);
  align-items: baseline;
}
.stack-list .k { color: var(--amber); font-weight: 700; font-size: 0.85rem; }
.stack-list .v { color: var(--fg); font-size: 0.92rem; }
.stack-list .v .dim { color: var(--fg-dim); }

.flow { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; margin-top: 22px; }
.flow-step { flex: 1 1 150px; border: 1px solid var(--border); background: var(--bg-inset); padding: 14px 16px; position: relative; border-radius: 4px; }
.flow-step + .flow-step { margin-left: 22px; }
.flow-step + .flow-step::before {
  content: "→"; position: absolute; left: -20px; top: 50%;
  transform: translateY(-50%); color: var(--fg-dim);
}
.flow-step .t { color: var(--fg-bright); font-weight: 700; font-size: 0.88rem; }
.flow-step .d { color: var(--fg-dim); font-size: 0.78rem; margin-top: 4px; }

@media (max-width: 720px) {
  .flow-step + .flow-step { margin-left: 0; margin-top: 22px; }
  .flow-step + .flow-step::before { content: "↓"; left: 50%; top: -20px; transform: translateX(-50%); }
}

.renovate-line {
  margin-top: 20px;
  padding: 12px 14px;
  border-left: 2px solid var(--amber);
  background: var(--bg-inset);
  color: var(--fg);
  font-size: 0.9rem;
}

.app-card {
  display: block;
  border: 1px solid var(--border);
  background: var(--bg-inset);
  border-radius: 4px;
  padding: 12px 14px;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.app-card:hover { border-color: var(--amber); transform: translateY(-1px); }
.app-card:not([href]) { cursor: default; }
.app-card:not([href]):hover { border-color: var(--border-bright); }
.app-card .tag {
  display: inline-block;
  color: var(--bg);
  background: var(--fg-bright);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 3px;
  margin-bottom: 8px;
}
.app-card .name { color: var(--fg-bright); font-weight: 700; font-size: 0.92rem; }
.app-card .desc { color: var(--fg-dim); font-size: 0.78rem; margin-top: 3px; }

.status-line { margin-top: 18px; color: var(--fg-dim); font-size: 0.8rem; }
.status-line .ok { color: var(--fg-bright); }

@media (max-width: 560px) {
  .stack-list li { grid-template-columns: 1fr; gap: 4px; }
}

/* ---- Tagline / footer ------------------------------------------------- */
.tagline {
  margin-top: 22px;
  color: var(--fg-dim);
  font-size: 0.85rem;
  border-left: 2px solid var(--border-bright);
  padding-left: 12px;
}

footer {
  padding: 40px 0 64px;
  border-top: 1px solid var(--border);
  color: var(--fg-dim);
  font-size: 0.82rem;
}
footer .prompt-line { margin-bottom: 10px; }

.tool-links-block {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.tool-links-label {
  margin-top: 0;
  margin-bottom: 6px;
  color: var(--fg-dim);
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.tool-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.tool-links a {
  color: var(--fg-dim);
  font-size: 0.82rem;
  text-decoration: underline dotted var(--border-bright);
  text-underline-offset: 3px;
}
.tool-links a:hover { color: var(--amber); }
