/* ===== HomeLab Portal — cyberpunk glassmorphism, water-drop backdrop ===== */
:root {
  --cyan: #22d3ee;
  --cyan-bright: #67e8f9;
  --emerald: #34d399;
  --amber: #fbbf24;
  --bg: #05070f;
  --glass: rgba(13, 20, 38, 0.55);
  --glass-strong: rgba(13, 20, 38, 0.75);
  --glass-border: rgba(34, 211, 238, 0.28);
  --text: #dbe7ff;
  --text-dim: #7f8db3;
  --radius: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  overflow-x: hidden;
}

/* ---- fixed backdrop ---- */
#bg-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}
.bg-vignette {
  position: fixed; inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(34, 211, 238, 0.12), transparent 60%),
    radial-gradient(ellipse 70% 50% at 85% 110%, rgba(52, 211, 153, 0.08), transparent 60%),
    radial-gradient(ellipse 120% 100% at 50% 50%, transparent 55%, rgba(3, 5, 12, 0.75) 100%);
}

/* ---- header ---- */
.site-header {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px clamp(20px, 5vw, 56px);
  border-bottom: 1px solid rgba(34, 211, 238, 0.14);
  background: linear-gradient(180deg, rgba(5, 7, 15, 0.85), rgba(5, 7, 15, 0.35));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.brand-mark { width: 46px; height: 46px; filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.55)); flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title {
  font-family: 'Orbitron', monospace; font-weight: 700; font-size: clamp(17px, 2.4vw, 22px);
  letter-spacing: 0.06em; color: #fff; text-shadow: 0 0 18px rgba(34, 211, 238, 0.45);
}
.brand-sub { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-dim); }
.header-status {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 16px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-border);
  font-family: 'Orbitron', monospace; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan-bright);
  white-space: nowrap;
}
.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--emerald); box-shadow: 0 0 10px var(--emerald);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.8); } }

/* ---- page ---- */
.page {
  position: relative; z-index: 2;
  max-width: 1280px; margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) clamp(20px, 5vw, 56px) 40px;
}
.hero { text-align: center; padding: 18px 0 34px; }
.hero-kicker {
  font-family: 'Orbitron', monospace; font-size: 11px; letter-spacing: 0.4em;
  color: var(--emerald); text-shadow: 0 0 12px rgba(52, 211, 153, 0.6); margin-bottom: 14px;
}
.hero-title {
  font-family: 'Orbitron', monospace; font-weight: 900;
  font-size: clamp(30px, 5.4vw, 58px); line-height: 1.12; letter-spacing: 0.02em; color: #fff;
  text-shadow: 0 0 32px rgba(34, 211, 238, 0.35);
}
.grad-text {
  background: linear-gradient(92deg, var(--cyan-bright) 0%, var(--cyan) 45%, var(--emerald) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin-top: 16px; font-size: clamp(15px, 1.8vw, 19px); font-weight: 500; color: var(--text-dim); letter-spacing: 0.04em; }

/* ---- sections ---- */
.section-head { display: flex; align-items: center; gap: 18px; margin: 26px 0 20px; }
.section-head h2 {
  font-family: 'Orbitron', monospace; font-size: clamp(15px, 2vw, 19px); font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase; color: #fff; white-space: nowrap;
}
.section-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--glass-border), transparent); }

/* ---- card grid ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 18px;
}
.card {
  position: relative;
  display: flex; flex-direction: column; gap: 12px;
  padding: 20px;
  min-height: 168px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid rgba(120, 150, 220, 0.16);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  text-decoration: none; color: inherit;
  transform-style: preserve-3d;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.18s ease-out;
  will-change: transform;
  overflow: hidden;
}
.card::before { /* sheen */
  content: ""; position: absolute; inset: -60%;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(103, 232, 249, 0.22), transparent 42%);
  opacity: 0; transition: opacity 0.25s ease; pointer-events: none;
}
.card:hover { border-color: var(--glass-border); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 0 26px rgba(34, 211, 238, 0.22); }
.card:hover::before { opacity: 1; }
.card-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center; font-size: 26px;
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.16), rgba(52, 211, 153, 0.1));
  border: 1px solid rgba(34, 211, 238, 0.3);
  box-shadow: inset 0 0 14px rgba(34, 211, 238, 0.12);
  transform: translateZ(30px);
}
.card-icon img { width: 32px; height: 32px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45)); }
.card-body { display: flex; flex-direction: column; gap: 6px; transform: translateZ(22px); }
.card-name { font-family: 'Orbitron', monospace; font-size: 15px; font-weight: 700; letter-spacing: 0.05em; color: #fff; }
.card-desc { font-size: 13.5px; line-height: 1.45; color: var(--text-dim); font-weight: 500; }
.card-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto;
  transform: translateZ(18px);
}
.ip-chip {
  font-family: 'Orbitron', monospace; font-size: 10px; letter-spacing: 0.12em;
  padding: 5px 10px; border-radius: 6px; color: var(--cyan-bright);
  background: rgba(34, 211, 238, 0.1); border: 1px solid rgba(34, 211, 238, 0.25);
}
.ext-arrow { font-size: 18px; color: var(--text-dim); transition: transform 0.25s ease, color 0.25s ease; }
.card:hover .ext-arrow { color: var(--cyan-bright); transform: translate(3px, -3px); }

/* ---- downloads ---- */
.download-list { list-style: none; display: grid; gap: 12px; }
.download-list a {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-radius: 14px;
  background: var(--glass); border: 1px solid rgba(120, 150, 220, 0.16);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  text-decoration: none; color: inherit; transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}
.download-list a:hover { border-color: var(--glass-border); box-shadow: 0 0 20px rgba(34, 211, 238, 0.18); transform: translateX(6px); }
.dl-icon { font-size: 22px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: rgba(34, 211, 238, 0.08); border: 1px solid rgba(34, 211, 238, 0.2); flex-shrink: 0; }
.dl-icon img { width: 26px; height: 26px; object-fit: contain; }
.dl-name { font-family: 'Orbitron', monospace; font-size: 13px; letter-spacing: 0.04em; color: #fff; }
.dl-meta { margin-left: auto; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); white-space: nowrap; }

/* ---- footer ---- */
.site-footer {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 22px 20px 30px; text-align: center;
  font-size: 12.5px; letter-spacing: 0.1em; color: var(--text-dim);
  border-top: 1px solid rgba(34, 211, 238, 0.12);
}
.footer-sep { color: var(--cyan); }

/* ---- responsive ---- */
@media (max-width: 560px) {
  .header-status { display: none; }
  .card-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---- portal editor card ---- */
.card-editor { border-color: rgba(103, 232, 249, 0.4); background: linear-gradient(160deg, rgba(34, 211, 238, 0.14), rgba(13, 20, 38, 0.6) 55%); }
.card-editor:hover { border-color: var(--cyan-bright); box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5), 0 0 30px rgba(34, 211, 238, 0.3); }
.card-editor .card-icon { background: linear-gradient(145deg, rgba(34, 211, 238, 0.24), rgba(34, 211, 238, 0.07)); border-color: rgba(34, 211, 238, 0.45); box-shadow: inset 0 0 16px rgba(34, 211, 238, 0.2); }
.card-editor .ip-chip { color: var(--cyan-bright); background: rgba(34, 211, 238, 0.12); border-color: rgba(34, 211, 238, 0.35); letter-spacing: 0.06em; }

/* ---- network topology ---- */
.topology { margin-top: 8px; }
.topology-frame {
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(10, 15, 30, 0.72), rgba(7, 11, 22, 0.82));
  border: 1px solid rgba(34, 211, 238, 0.18);
  box-shadow: inset 0 0 60px rgba(34, 211, 238, 0.05), 0 18px 50px rgba(0, 0, 0, 0.45);
  padding: clamp(12px, 2.4vw, 26px);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#topology-svg { width: 100%; height: auto; display: block; }
.topo-node-rect { fill: rgba(13, 20, 38, 0.85); stroke: rgba(34, 211, 238, 0.4); stroke-width: 1.5; }
.topo-node-accent .topo-node-rect, .topo-node-rect.topo-node-accent { stroke: rgba(251, 191, 36, 0.65); fill: rgba(30, 24, 10, 0.85); }
.topo-wan-rect { fill: rgba(16, 26, 44, 0.9); stroke: rgba(52, 211, 153, 0.5); }
.topo-name { font-family: 'Orbitron', monospace; font-weight: 700; fill: #ffffff; letter-spacing: 0.04em; }
.topo-sub { font-family: 'Rajdhani', sans-serif; font-weight: 600; fill: var(--text-dim); letter-spacing: 0.08em; text-transform: uppercase; }
.topo-ip { font-family: 'Orbitron', monospace; font-weight: 500; fill: var(--cyan-bright); letter-spacing: 0.1em; }
.topo-icon { font-size: 20px; }
.topo-svc { font-family: 'Rajdhani', sans-serif; font-weight: 600; fill: #b8c6ea; letter-spacing: 0.04em; }
.topo-dot { fill: var(--emerald); }
.topo-particle-outer { fill: rgba(34, 211, 238, 0.22); }
.topo-particle-inner { fill: #a5f3fc; filter: drop-shadow(0 0 4px rgba(103, 232, 249, 0.9)); }
#edges-layer path { stroke-dasharray: 7 9; animation: edge-flow 1.6s linear infinite; }
@keyframes edge-flow { to { stroke-dashoffset: -32; } }
.topology-caption {
  margin-top: 12px; text-align: center;
  font-size: 12.5px; letter-spacing: 0.06em; color: var(--text-dim);
}
@media (prefers-reduced-motion: reduce) {
  #edges-layer path { animation: none; }
}
@media (max-width: 760px) {
  .topology-frame { padding: 8px; overflow-x: auto; }
  #topology-svg { min-width: 720px; }
}

/* ---- host filter pills ---- */
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 18px; }
.pill {
  font-family: 'Orbitron', monospace; font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 7px 14px; border-radius: 999px; cursor: pointer; color: var(--text-dim);
  background: rgba(13, 20, 38, 0.55); border: 1px solid rgba(120, 150, 220, 0.22);
  transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.pill:hover { color: var(--cyan-bright); border-color: rgba(34, 211, 238, 0.4); }
.pill.is-active {
  color: #05070f; background: linear-gradient(92deg, var(--cyan-bright), var(--cyan));
  border-color: transparent; box-shadow: 0 0 18px rgba(34, 211, 238, 0.4);
}
.pill-count { opacity: 0.75; font-weight: 500; margin-left: 2px; }
.card.is-hidden { display: none; }

/* ---- per-card status dot ---- */
.card-status {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  background: #64748b; box-shadow: 0 0 6px rgba(100, 116, 139, 0.5);
}
.card-status.is-checking { background: var(--amber); animation: pulse 1.2s ease-in-out infinite; }
.card-status.is-up { background: var(--emerald); box-shadow: 0 0 8px rgba(52, 211, 153, 0.8); }
.card-status.is-down { background: #f87171; box-shadow: 0 0 8px rgba(248, 113, 113, 0.7); }
.card-status.is-unknown { background: #64748b; box-shadow: none; opacity: 0.55; }

/* ---- cube banner ---- */
.cube-banner {
  display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: clamp(20px, 4vw, 48px);
  margin: 26px 0 8px; padding: clamp(24px, 4vw, 44px);
  border-radius: var(--radius);
  background: linear-gradient(140deg, rgba(251, 191, 36, 0.1), rgba(13, 20, 38, 0.72) 55%);
  border: 1px solid rgba(251, 191, 36, 0.3);
  box-shadow: inset 0 0 60px rgba(251, 191, 36, 0.05), 0 18px 50px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
}
.cube-banner-left { display: flex; flex-direction: column; align-items: flex-start; }
.cube-kicker { font-family: 'Orbitron', monospace; font-size: 10px; letter-spacing: 0.4em; color: var(--amber); text-shadow: 0 0 12px rgba(251, 191, 36, 0.5); margin-bottom: 10px; }
.cube-title { font-family: 'Orbitron', monospace; font-weight: 900; font-size: clamp(24px, 3.4vw, 38px); color: #fff; letter-spacing: 0.03em; text-shadow: 0 0 26px rgba(251, 191, 36, 0.35); }
.cube-desc { margin: 14px 0 20px; font-size: clamp(14px, 1.6vw, 16.5px); line-height: 1.55; color: var(--text-dim); max-width: 52ch; font-weight: 500; }
.cube-cta {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Orbitron', monospace; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: #1a1204; text-decoration: none; padding: 13px 26px; border-radius: 10px;
  background: linear-gradient(92deg, #fbbf24, #fde68a);
  box-shadow: 0 0 22px rgba(251, 191, 36, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cube-cta:hover { transform: translateY(-2px); box-shadow: 0 6px 30px rgba(251, 191, 36, 0.55); }
.cube-secondary { display: inline-block; margin-top: 14px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; color: var(--text-dim); text-decoration: none; border-bottom: 1px dashed rgba(251, 191, 36, 0.4); padding-bottom: 2px; transition: color 0.2s ease, border-color 0.2s ease; }
.cube-secondary:hover { color: #fde68a; border-color: rgba(251, 191, 36, 0.8); }
.cube-stage { display: grid; place-items: center; perspective: 700px; min-height: 200px; }
.cube { position: relative; width: 120px; height: 120px; transform-style: preserve-3d; animation: cube-spin 14s linear infinite; }
@keyframes cube-spin { from { transform: rotateX(-22deg) rotateY(0deg); } to { transform: rotateX(-22deg) rotateY(360deg); } }
.cube-face {
  position: absolute; width: 120px; height: 120px; display: grid; place-items: center;
  font-family: 'Orbitron', monospace; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-align: center; color: #fde68a;
  background: linear-gradient(150deg, rgba(251, 191, 36, 0.22), rgba(30, 24, 10, 0.85));
  border: 1.5px solid rgba(251, 191, 36, 0.55); border-radius: 10px;
  box-shadow: inset 0 0 24px rgba(251, 191, 36, 0.18);
  padding: 8px; line-height: 1.4;
}
.cube-front  { transform: translateZ(60px); }
.cube-back   { transform: rotateY(180deg) translateZ(60px); }
.cube-right  { transform: rotateY(90deg) translateZ(60px); }
.cube-left   { transform: rotateY(-90deg) translateZ(60px); }
.cube-top    { transform: rotateX(90deg) translateZ(60px); }
.cube-bottom { transform: rotateX(-90deg) translateZ(60px); }
@media (prefers-reduced-motion: reduce) { .cube { animation: none; transform: rotateX(-22deg) rotateY(24deg); } }
@media (max-width: 760px) { .cube-banner { grid-template-columns: 1fr; text-align: center; } .cube-banner-left { align-items: center; } .cube-desc { margin-left: auto; margin-right: auto; } .cube-cta { justify-content: center; } }

/* ---- downloads: rows + copy buttons ---- */
.download-row { display: flex; align-items: stretch; gap: 10px; }
.download-row > a { flex: 1; min-width: 0; }
.copy-btn {
  font-family: 'Orbitron', monospace; font-size: 9.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--cyan-bright); background: rgba(34, 211, 238, 0.1); border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 10px; padding: 0 16px; cursor: pointer; white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.copy-btn:hover { background: rgba(34, 211, 238, 0.2); box-shadow: 0 0 14px rgba(34, 211, 238, 0.3); }
.copy-btn.is-copied { color: #052e1a; background: var(--emerald); border-color: transparent; box-shadow: 0 0 16px rgba(52, 211, 153, 0.5); }

/* ---- topology legend + edge labels + direction colors ---- */
.topology-legend { display: flex; justify-content: center; gap: 26px; margin-top: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); font-weight: 600; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; }
.legend-out { background: #34d399; box-shadow: 0 0 8px rgba(52, 211, 153, 0.8); }
.legend-back { background: #67e8f9; box-shadow: 0 0 8px rgba(103, 232, 249, 0.8); }
.topo-edge-label {
  font-family: 'Orbitron', monospace; font-size: 9px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  fill: #8fd8e8; paint-order: stroke; stroke: rgba(5, 7, 15, 0.9); stroke-width: 4px; stroke-linejoin: round;
}
.topo-particle-outer.topo-particle-out { fill: rgba(52, 211, 153, 0.22); }
.topo-particle-inner.topo-particle-out { fill: #a7f3d0; filter: drop-shadow(0 0 4px rgba(52, 211, 153, 0.9)); }
.topo-particle-back { fill: rgba(103, 232, 249, 0.22); }
.topo-particle-inner.topo-particle-back { fill: #a5f3fc; filter: drop-shadow(0 0 4px rgba(103, 232, 249, 0.9)); }
