/* /homelab/homelab.css: styles for the homelab page only.
   Loaded after /styles.css, which supplies the design tokens, base type,
   skip link, focus rings, header and footer. Rules here that share a
   selector with styles.css override it for this page only.
   No inline styles anywhere on the page, so the CSP (style-src 'self') holds. */
:root {
  --plate: #1F2F3B;
  --plate-edge: #2C3F4D;
  --plate-text: #E7ECEA;
  --plate-muted: #9FB0B8;
}

/* Hero */
.hero { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3.5rem; align-items: center; padding: 3rem 0 5rem; }
.crumb { font-size: 0.9375rem; color: var(--muted); margin: 0 0 1rem; }
.crumb a { color: var(--muted); }
h1 { font-size: clamp(2.4rem, 5vw, 3.9rem); line-height: 1.02; letter-spacing: -0.035em; font-weight: 800; margin: 0 0 1.5rem; max-width: 14ch; }
.lede { font-size: 1.1875rem; color: var(--muted); max-width: 34rem; margin: 0 0 1.25rem; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1.25rem; margin: 1.75rem 0 0; font-size: 0.98rem; max-width: 30rem; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; color: var(--muted); }

/* The stack: each layer drawn as an equipment faceplate */
.stack { list-style: none; margin: 0; padding: 14px 0; background: #CBD2CF; border-radius: 6px; border: 1px solid #B9C2BE; }
.unit {
  position: relative; display: grid; grid-template-columns: 6.25rem 1fr auto; align-items: center; gap: 1rem;
  margin: 6px 10px; padding: 0.7rem 1.1rem 0.7rem 2.6rem; min-height: 3.2rem;
  background: var(--plate); color: var(--plate-text); border-radius: 3px;
  border-top: 1px solid var(--plate-edge); border-bottom: 2px solid #121C24;
}
/* rack ears with screw holes */
.unit::before, .unit::after {
  content: ""; position: absolute; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%;
  background: #CBD2CF; box-shadow: inset 0 1px 1px rgba(0,0,0,0.45);
}
.unit::before { left: 12px; }
.unit::after { right: 12px; }
.unit.tall { min-height: 6.6rem; align-items: start; padding-top: 0.95rem; }
.unit .layer { font-size: 0.875rem; font-weight: 700; color: var(--plate-muted); }
.unit .what { font-weight: 700; font-size: 1rem; line-height: 1.3; }
.unit .what small { display: block; font-weight: 400; color: var(--plate-muted); font-size: 0.875rem; }
.unit .chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.chip { font-family: var(--mono); font-size: 0.75rem; padding: 0.12rem 0.45rem; border: 1px solid #50687A; border-radius: 2px; color: var(--plate-text); white-space: nowrap; }
.leds { display: flex; gap: 6px; margin-right: 0.75rem; }
.led { width: 7px; height: 7px; border-radius: 50%; background: #3A4C59; }
.led.link { background: var(--signal); box-shadow: 0 0 6px rgba(47,111,176,0.8); }
.led.act { background: var(--cable); box-shadow: 0 0 6px rgba(242,194,48,0.8); animation: blink 2.6s steps(1, end) infinite; }
.unit:nth-child(2) .led.act { animation-delay: 0.7s; animation-duration: 1.9s; }
.unit:nth-child(3) .led.act { animation-delay: 1.3s; animation-duration: 3.1s; }
.unit:nth-child(5) .led.act { animation-delay: 0.3s; animation-duration: 1.3s; }
.unit:nth-child(6) .led.act { animation-delay: 2s; animation-duration: 4s; }
.unit:nth-child(7) .led.act { animation-delay: 0.9s; animation-duration: 2.2s; }
@keyframes blink { 0% { opacity: 1; } 12% { opacity: 0.25; } 20% { opacity: 1; } 55% { opacity: 0.3; } 62% { opacity: 1; } }
.stack-cap { font-size: 0.9375rem; color: var(--muted); margin: 0.75rem 0 0; max-width: none; }

/* Sections */
section { padding: 4rem 0; border-top: 1px solid var(--rule); }
h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -0.025em; line-height: 1.1; margin: 0 0 1rem; font-weight: 800; }
.split { display: grid; grid-template-columns: 1fr 1.6fr; gap: 3rem; }
.prose p { margin: 0 0 1rem; max-width: 40rem; }
.note { color: var(--muted); margin: 0 0 2rem; max-width: 40rem; }

/* Hardware table */
table { width: 100%; border-collapse: collapse; font-size: 1rem; }
thead th { text-align: left; font-size: 0.875rem; font-weight: 600; color: var(--muted); padding: 0 1rem 0.75rem 0; border-bottom: 2px solid var(--ink); }
tbody th { text-align: left; font-weight: 700; padding: 1rem 1rem 1rem 0; vertical-align: top; width: 38%; }
tbody td { padding: 1rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
tbody th { border-bottom: 1px solid var(--rule); }

/* Workloads table */
.workloads tbody th { width: 24%; }
.workloads td:nth-child(2) { width: 5.5rem; }
.workloads td:last-child { width: 7rem; color: var(--muted); font-size: 0.95rem; }
.type { font-family: var(--mono); font-size: 0.75rem; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: 2px; background: var(--ink); color: var(--paper); }
.type.lxc { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }

/* AD lab segment */
.segment { margin-top: 1.5rem; padding: 1.25rem; border: 2px dashed var(--signal); border-radius: 6px; max-width: 26rem; }
.seg-node { background: var(--plate); color: var(--plate-text); border-radius: 3px; padding: 0.7rem 0.9rem; font-weight: 700; font-size: 0.98rem; line-height: 1.3; }
.seg-node small { display: block; font-weight: 400; color: var(--plate-muted); font-size: 0.85rem; }
.seg-node.fw { border-left: 5px solid var(--cable); }
.seg-link { width: 2px; height: 1.25rem; background: var(--ink); margin: 0 auto; }
.seg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; border-top: 2px solid var(--ink); padding-top: 1.25rem; position: relative; }
.practice { margin: 0 0 1rem; padding-left: 1.2rem; max-width: 40rem; }
.practice li { margin-bottom: 0.35rem; }

/* Services */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem 2rem; margin-top: 1.5rem; }
.svc { border-left: 4px solid var(--ink); padding-left: 1.25rem; }
.svc h3 { font-size: 1.1875rem; margin: 0 0 0.4rem; letter-spacing: -0.01em; }
.svc ul { margin: 0; padding-left: 1.1rem; }
.svc li { margin-bottom: 0.25rem; }
.svc p { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.95rem; }

/* Lessons */
.lesson { border-left: 4px solid var(--cable); padding: 0.25rem 0 0.25rem 1.5rem; margin: 0 0 2rem; max-width: 46rem; }
.lesson h3 { font-size: 1.25rem; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
.lesson p { margin: 0 0 0.75rem; }

/* Next */
.next { margin: 0; padding-left: 1.25rem; max-width: 40rem; }
.next li { margin-bottom: 0.6rem; }

.back { display: inline-block; margin-top: 1rem; font-weight: 600; }

/* Network map */
.mapfig { margin: 0; }
.mappanel:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }
.mappanel { background: var(--plate); border-radius: 6px; padding: 1rem; border-bottom: 3px solid #121C24; }
.netmap { display: block; width: 100%; height: auto; }
.netmap text { font-family: var(--sans); font-size: 13px; fill: var(--plate-text); paint-order: stroke; stroke: var(--plate); stroke-width: 5px; stroke-linejoin: round; }
.netmap .lbl.strong { font-weight: 700; font-size: 14px; }
.netmap .lbl.dim { fill: var(--plate-muted); font-size: 12px; }
.netmap .lbl.vm { fill: #BFD3E6; font-size: 12.5px; }
.netmap .lbl.ad { fill: #7FA9D6; font-weight: 700; font-size: 12px; }
.netmap line { stroke-linecap: round; }
.l-client { stroke: #3A4C59; stroke-width: 1; }
.l-infra { stroke: #6B8394; stroke-width: 2; }
.l-vm { stroke: #3F79B5; stroke-width: 1.5; }
.l-path { fill: none; stroke: #6B8394; stroke-width: 2.5; stroke-linejoin: round; }
.l-flow { fill: none; stroke: var(--cable); stroke-width: 2.5; stroke-dasharray: 2 14; stroke-linecap: round; animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -32; } }
.adbox { fill: none; stroke: #3F79B5; stroke-width: 1.5; stroke-dasharray: 5 5; }
.n-client { fill: #9FB0B8; }
.n-infra, .n-dev { fill: var(--plate); stroke: var(--plate-text); stroke-width: 2; }
.n-net { fill: var(--plate); stroke: var(--cable); stroke-width: 2.5; }
.n-switch { fill: var(--plate-text); stroke: var(--plate); stroke-width: 3; }
.n-host { fill: var(--cable); stroke: var(--plate); stroke-width: 3; }
.n-vm { fill: var(--signal); stroke: #BFD3E6; stroke-width: 1.5; }
.n-vm.off { fill: var(--plate); }
.maplegend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; margin-top: 0.85rem; max-width: none; font-size: 0.9375rem; color: var(--muted); }
.key { display: inline-flex; align-items: center; gap: 0.5rem; }
.key i { display: inline-block; width: 22px; height: 4px; border-radius: 2px; }
.k-path { background: var(--cable); }
.k-vm { background: var(--signal); }
.k-client { background: #9FB0B8; }

/* Services */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem 2rem; margin-top: 1.5rem; }
.svc { border-left: 4px solid var(--ink); padding-left: 1.25rem; }
.svc h3 { font-size: 1.1875rem; margin: 0 0 0.4rem; letter-spacing: -0.01em; }
.svc ul { margin: 0; padding-left: 1.1rem; }
.svc li { margin-bottom: 0.25rem; }
.svc p { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.95rem; }

/* Lessons */
.lesson { border-left: 4px solid var(--cable); padding: 0.25rem 0 0.25rem 1.5rem; margin: 0 0 2rem; max-width: 46rem; }
.lesson h3 { font-size: 1.25rem; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
.lesson p { margin: 0 0 0.75rem; }

/* Next */
.next { margin: 0; padding-left: 1.25rem; max-width: 40rem; }
.next li { margin-bottom: 0.6rem; }

.back { display: inline-block; margin-top: 1rem; font-weight: 600; }

@media (prefers-reduced-motion: reduce) { .led.act, .l-flow { animation: none; } }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 1rem; }
  .split { grid-template-columns: 1fr; gap: 1rem; }
  .services { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .services { grid-template-columns: 1fr; }
  .unit { grid-template-columns: 1fr auto; padding-left: 2.2rem; padding-right: 2rem; }
  .unit .layer { grid-column: 1 / -1; margin-bottom: -0.6rem; }
  tbody th { width: auto; }
  .workloads thead { display: none; }
  .workloads tr { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--rule); }
  .workloads th, .workloads td { border: 0; padding: 0; width: auto !important; }
  .workloads td:nth-child(3) { grid-column: 1 / -1; }
  .workloads td:last-child { grid-column: 1 / -1; font-size: 0.875rem; }
  .seg-row { grid-template-columns: 1fr; }
  .mappanel { overflow-x: auto; }
  .netmap { min-width: 720px; }
}
