/* myblinkylights (public view): a home lab drawn as a dim server room. */
@font-face { font-family: "Grotesk"; src: url(fonts/grotesk-300.woff2) format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Grotesk"; src: url(fonts/grotesk-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Mono"; src: url(fonts/mono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Mono"; src: url(fonts/mono-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bg: #030507;
  --ink: #c9d4dc;
  --ink-dim: #6d7c88;
  --ink-faint: #3b4650;
  --ok: #38f28a;
  --ok-deep: #0f8f4a;
  --warn: #ffb02e;
  --bad: #ff3f46;
  --off: #1b2127;
  --unk: #5d7da0;
  --panel: rgba(9, 13, 17, 0.86);
  --line: rgba(160, 190, 210, 0.12);
  --mono: "Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; }
body { font-family: var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
a { color: inherit; }

/* The room: back wall, a ceiling light far away, floor falloff. */
#room {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 60% 38% at 50% 2%, rgba(70, 110, 140, 0.16), transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 58%, rgba(20, 40, 52, 0.55), transparent 75%),
    linear-gradient(180deg, #05080b 0%, #070b0f 52%, #030405 100%);
}
#room::after { /* faint wall panels */
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 239px, rgba(120, 160, 190, 0.025) 239px 240px);
  mask-image: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.3) 60%, transparent 85%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.3) 60%, transparent 85%);
}
#haze, #motes { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#haze { z-index: 1; mix-blend-mode: screen; }
#motes { z-index: 3; mix-blend-mode: screen; }
#stage { position: fixed; inset: 0; z-index: 2; }
#scene { width: 100%; height: 100%; display: block; overflow: visible; }

/* ---------- devices ---------- */
.dev { cursor: pointer; outline: none; }
.dev .body { transition: filter .35s ease; }
.dev:hover .body, .dev:focus-visible .body, .dev.selected .body { filter: brightness(1.45) saturate(1.1); }
.dev:focus-visible .focus-ring, .dev.selected .focus-ring { opacity: 1; }
.focus-ring { fill: none; stroke: rgba(170, 220, 255, 0.35); stroke-width: 1; stroke-dasharray: 3 4; opacity: 0; transition: opacity .3s; pointer-events: none; }
.hit { fill: transparent; }
.caption { font-family: var(--mono); font-size: 7.2px; letter-spacing: .14em; fill: #6e808c; text-anchor: middle; text-transform: uppercase; pointer-events: none; transition: fill .3s; }
.dev:hover .caption, .dev.selected .caption, .dev:focus-visible .caption { fill: #b7c7d2; }
.etch { font-family: var(--mono); font-size: 4.2px; fill: #3a444d; letter-spacing: .1em; pointer-events: none; }

/* LEDs: core + halo. The halo is a radial gradient blended additively. */
.led .halo { mix-blend-mode: screen; opacity: 0; transition: opacity .6s; }
.led .core { transition: fill .5s; fill: var(--off); }
.led .glint { fill: #fff; opacity: .18; }
.led.ok .core { fill: var(--ok); }
.led.ok .halo { fill: url(#glow-ok); opacity: .85; animation: breathe 3.6s ease-in-out infinite; }
.led.warn .core { fill: var(--warn); }
.led.warn .halo { fill: url(#glow-warn); opacity: .9; animation: falter 2.3s steps(1, end) infinite; }
.led.bad .core { fill: var(--bad); animation: blink 0.9s steps(1, end) infinite; }
.led.bad .halo { fill: url(#glow-bad); opacity: 1; animation: blink 0.9s steps(1, end) infinite; }
.led.unk .core { fill: var(--unk); }
.led.unk .halo { fill: url(#glow-unk); opacity: .4; animation: breathe 7s ease-in-out infinite; }
.led.off .core { fill: #12171b; }
.led.off .glint { opacity: .09; }
.led.quiet .halo { animation: none; opacity: .45; }
.led.act .halo, .led.act .core { animation: none; }

@keyframes breathe { 0%, 100% { opacity: .38; } 50% { opacity: .95; } }
@keyframes falter { 0% { opacity: .9; } 14% { opacity: .25; } 18% { opacity: .85; } 46% { opacity: .55; } 52% { opacity: 1; } 78% { opacity: .3; } 84% { opacity: .9; } }
@keyframes blink { 0% { opacity: 1; } 50% { opacity: .12; } }

/* Light spilling onto the desk and the wall behind each machine. */
.spill { mix-blend-mode: screen; pointer-events: none; opacity: 0; transition: opacity 1.2s; }
.spill.ok { fill: url(#spill-ok); opacity: .5; animation: spill 3.6s ease-in-out infinite; }
.spill.warn { fill: url(#spill-warn); opacity: .6; animation: spill 2.3s ease-in-out infinite; }
.spill.bad { fill: url(#spill-bad); opacity: .7; animation: spill 1.8s steps(2, end) infinite; }
.spill.unk { fill: url(#spill-unk); opacity: .25; }
@keyframes spill { 0%, 100% { opacity: .32; } 50% { opacity: .62; } }

/* Cables and packets */
.cable { fill: none; stroke: #0a0d10; stroke-linecap: round; }
.cable-hi { fill: none; stroke: rgba(120, 150, 170, 0.11); stroke-linecap: round; }
.power { fill: none; stroke: #07090b; stroke-linecap: round; }
.packet { mix-blend-mode: screen; pointer-events: none; }

/* Holograms: VMs and containers projected above their hosts. */
.blade { cursor: pointer; outline: none; }
.blade .float { animation: hover 7s ease-in-out infinite; }
.blade .frame { fill: rgba(140, 200, 230, 0.035); stroke: rgba(150, 210, 240, 0.22); stroke-width: .6; transition: fill .4s, stroke .4s; }
.blade.ok .frame { fill: rgba(56, 242, 138, 0.05); stroke: rgba(56, 242, 138, 0.32); }
.blade.warn .frame { fill: rgba(255, 176, 46, 0.07); stroke: rgba(255, 176, 46, 0.5); }
.blade.bad .frame { fill: rgba(255, 63, 70, 0.09); stroke: rgba(255, 63, 70, 0.6); }
.blade.off .frame { fill: rgba(60, 70, 80, 0.05); stroke: rgba(90, 100, 110, 0.22); stroke-dasharray: 2 2; }
.blade:hover .frame, .blade:focus-visible .frame, .blade.selected .frame { fill: rgba(150, 220, 255, 0.1); }
.blade .corner { fill: none; stroke: rgba(190, 230, 255, 0.55); stroke-width: .7; }
.blade .scan { fill: url(#scanlines); opacity: .5; pointer-events: none; }
.blade .bname { font-family: var(--sans); font-weight: 500; font-size: 8.4px; fill: #d6e4ec; letter-spacing: .02em; }
.blade .bsub { font-family: var(--mono); font-size: 5.2px; fill: #7f949f; letter-spacing: .04em; }
.blade.off .bname { fill: #66737c; }
.blade .spark { fill: none; stroke: rgba(150, 220, 255, 0.55); stroke-width: .6; }
.blade .sparkbase { stroke: rgba(150, 220, 255, 0.12); stroke-width: .4; }
.beam { mix-blend-mode: screen; pointer-events: none; }
.beam-line { fill: none; stroke: rgba(150, 215, 245, 0.28); stroke-width: .5; stroke-dasharray: 1.5 3.5; animation: flow 2.4s linear infinite; }
.beam-line.off { animation: none; stroke: rgba(120, 130, 140, 0.12); }
@keyframes flow { to { stroke-dashoffset: -10; } }
@keyframes hover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.2px); } }

.tall .caption { font-size: 10px; }
.tall .blade .bname { font-size: 11px; }
.tall .blade .bsub { font-size: 6.8px; }

/* ---------- HUD ---------- */
#hud-top, #hud-bottom { position: fixed; left: 0; right: 0; z-index: 4; display: flex; justify-content: space-between; pointer-events: none; padding-left: calc(28px + var(--safe-l)); padding-right: calc(28px + var(--safe-r)); }
#hud-top { top: 0; padding-top: calc(22px + var(--safe-t)); align-items: flex-start; }
#hud-bottom { bottom: 0; padding-bottom: calc(18px + var(--safe-b)); align-items: flex-end; }
#hud-top a, #hud-top .chip { pointer-events: auto; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--unk); box-shadow: 0 0 12px 2px rgba(93, 125, 160, .5); transition: background .6s, box-shadow .6s; }
.brand-dot.ok { background: var(--ok); box-shadow: 0 0 14px 3px rgba(56, 242, 138, .45); animation: dot 3.6s ease-in-out infinite; }
.brand-dot.warn { background: var(--warn); box-shadow: 0 0 14px 3px rgba(255, 176, 46, .5); }
.brand-dot.bad { background: var(--bad); box-shadow: 0 0 16px 4px rgba(255, 63, 70, .55); animation: dot .9s steps(1, end) infinite; }
@keyframes dot { 50% { opacity: .45; } }
h1 { margin: 0; font-weight: 300; font-size: 21px; letter-spacing: .2em; color: #dfe9ef; text-shadow: 0 0 24px rgba(120, 200, 255, 0.18); }
.sub { margin: 3px 0 0; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--ink-dim); text-transform: lowercase; }
.summary { text-align: right; }
.clock { font-family: var(--mono); font-size: 20px; letter-spacing: .12em; color: #a9bac6; font-variant-numeric: tabular-nums; }
.chips { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.chip { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-dim); text-decoration: none; background: rgba(8, 12, 16, .5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.chip.ok { color: #9ff5c5; border-color: rgba(56, 242, 138, .25); }
.chip.warn { color: #ffd38a; border-color: rgba(255, 176, 46, .35); }
.chip.bad { color: #ff9a9e; border-color: rgba(255, 63, 70, .4); }
a.chip:hover { border-color: rgba(170, 220, 255, .4); color: var(--ink); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; gap: 16px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; color: var(--ink-dim); }
.legend li { display: flex; align-items: center; gap: 7px; }
.lg { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.lg.ok { background: var(--ok); box-shadow: 0 0 8px rgba(56, 242, 138, .6); }
.lg.warn { background: var(--warn); box-shadow: 0 0 8px rgba(255, 176, 46, .6); }
.lg.bad { background: var(--bad); box-shadow: 0 0 8px rgba(255, 63, 70, .6); }
.lg.off { background: #151a1f; box-shadow: inset 0 0 0 1px #2a323a; }
.hint { margin: 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; color: var(--ink-faint); text-transform: lowercase; }

/* ---------- panel ---------- */
#panel {
  position: fixed; z-index: 6; top: 0; right: 0; bottom: 0; width: min(400px, 100vw);
  padding: calc(26px + var(--safe-t)) calc(24px + var(--safe-r)) calc(26px + var(--safe-b)) 26px;
  background: var(--panel); border-left: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  overflow-y: auto; transform: translateX(105%); transition: transform .45s cubic-bezier(.2, .8, .2, 1);
  box-shadow: -30px 0 60px rgba(0, 0, 0, .5);
}
#panel.open { transform: none; }
.panel-grip { display: none; }
.panel-close { position: absolute; top: calc(16px + var(--safe-t)); right: calc(14px + var(--safe-r)); width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-dim); font-size: 26px; line-height: 1; cursor: pointer; }
.panel-close:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
.panel-head { display: flex; align-items: center; gap: 14px; padding-right: 36px; }
.pdot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--unk); }
.pdot.ok { background: var(--ok); box-shadow: 0 0 14px rgba(56, 242, 138, .7); }
.pdot.warn { background: var(--warn); box-shadow: 0 0 14px rgba(255, 176, 46, .7); }
.pdot.bad { background: var(--bad); box-shadow: 0 0 14px rgba(255, 63, 70, .8); }
.pdot.off { background: #151a1f; box-shadow: inset 0 0 0 1px #313a42; }
#panel h2 { margin: 0; font-weight: 500; font-size: 22px; letter-spacing: .03em; color: #e6eef3; }
.panel-kind { margin: 2px 0 0; font-family: var(--mono); font-size: 11px; color: var(--ink-dim); letter-spacing: .06em; }
.panel-state { margin: 16px 0 4px; font-size: 14px; color: #aebcc6; line-height: 1.45; }
.panel-state b { font-weight: 500; }
.panel-state .ok { color: var(--ok); } .panel-state .warn { color: var(--warn); } .panel-state .bad { color: var(--bad); } .panel-state .off { color: #8795a0; } .panel-state .unk { color: #9db6d0; }
.sect { margin-top: 22px; }
.sect h3 { margin: 0 0 8px; font-family: var(--mono); font-weight: 400; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint); }
.names { display: flex; flex-wrap: wrap; gap: 8px; }
.names a { font-family: var(--mono); font-size: 12px; text-decoration: none; padding: 7px 11px; border-radius: 8px; border: 1px solid rgba(120, 200, 255, .2); color: #a9dcff; background: rgba(60, 140, 200, .06); }
.names a:hover { border-color: rgba(120, 200, 255, .5); background: rgba(60, 140, 200, .14); }
.names a.secondary { color: var(--ink-dim); border-color: var(--line); background: transparent; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-family: var(--mono); font-size: 12px; margin: 0; }
.kv dt { color: var(--ink-faint); } .kv dd { margin: 0; color: #aebcc6; }
.runs { margin: 0; padding: 0; list-style: none; }
.runs li { font-size: 14px; line-height: 1.4; padding: 5px 0 5px 16px; position: relative; color: #b9c6cf; }
.runs li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 5px; height: 1px; background: var(--ink-faint); }
.checks { margin: 0; padding: 0; list-style: none; }
.checks li { display: grid; grid-template-columns: 12px 1fr auto; gap: 2px 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.checks li:first-child { border-top: 0; }
.checks .cdot { width: 7px; height: 7px; border-radius: 50%; background: var(--unk); }
.checks .cdot.ok { background: var(--ok); box-shadow: 0 0 8px rgba(56, 242, 138, .6); }
.checks .cdot.warn { background: var(--warn); box-shadow: 0 0 8px rgba(255, 176, 46, .6); }
.checks .cdot.bad { background: var(--bad); box-shadow: 0 0 8px rgba(255, 63, 70, .7); }
.checks .cdot.off { background: #151a1f; box-shadow: inset 0 0 0 1px #313a42; }
.checks .cname { font-size: 14px; color: #cfdbe3; }
.checks .cname a { text-decoration: none; border-bottom: 1px dotted rgba(170, 200, 220, .3); }
.checks .cname a:hover { border-bottom-color: rgba(170, 220, 255, .8); }
.checks .cdetail { grid-column: 2 / 4; font-family: var(--mono); font-size: 11px; color: var(--ink-dim); }
.hist { display: flex; gap: 2px; align-items: flex-end; height: 12px; }
.hist i { display: block; width: 3px; height: 12px; border-radius: 1px; background: rgba(56, 242, 138, .55); }
.hist i.f { background: var(--bad); }
.meter { display: grid; grid-template-columns: 54px 1fr 64px; gap: 10px; align-items: center; font-family: var(--mono); font-size: 11.5px; color: var(--ink-dim); margin: 6px 0; }
.meter .bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok-deep), var(--ok)); border-radius: 2px; }
.meter .bar i.warn { background: var(--warn); }
.meter span:last-child { text-align: right; color: #aebcc6; }
.note { font-size: 13px; line-height: 1.5; color: var(--ink-dim); margin: 0; }
.vmrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 6px 0; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: rgba(255, 255, 255, .015); width: 100%; color: inherit; font: inherit; text-align: left; }
.vmrow:hover { border-color: rgba(170, 220, 255, .3); }
.vmrow .vmname { font-size: 14px; color: #d6e2e9; }
.vmrow .vmsub { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-dim); }
.noscript { position: fixed; inset: auto 0 40% 0; text-align: center; z-index: 9; }

@media (max-width: 720px) {
  #hud-top, #hud-bottom { padding-left: calc(16px + var(--safe-l)); padding-right: calc(16px + var(--safe-r)); }
  #hud-top { padding-top: calc(14px + var(--safe-t)); }
  h1 { font-size: 16px; letter-spacing: .16em; }
  .sub { font-size: 10px; }
  .clock { font-size: 14px; }
  .chips { gap: 6px; margin-top: 6px; }
  .chip { font-size: 10px; padding: 3px 7px; }
  .legend { gap: 10px; font-size: 9.5px; }
  .hint { display: none; }
  #panel {
    top: auto; left: 0; right: 0; width: 100%; max-height: 74vh; border-left: 0; border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0; transform: translateY(105%); padding: 14px 18px calc(22px + var(--safe-b));
    box-shadow: 0 -30px 60px rgba(0, 0, 0, .55);
  }
  .panel-grip { display: block; width: 38px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .14); margin: 0 auto 14px; }
  .panel-close { top: 8px; right: 8px; }
  #panel h2 { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .led .halo, .led .core, .spill, .blade .float, .beam-line, .brand-dot { animation: none !important; }
  .led.ok .halo, .led.warn .halo { opacity: .7; }
}
.public-note { margin-top: 18px; opacity: .7; }
.chip { white-space: nowrap; }
.chips { flex-wrap: wrap; }
@media (max-width: 520px) { .sub { white-space: nowrap; } }
