/* rasip.us -- the public face of the Hub. Same design language as the control center:
   glass surfaces over slow colour fields, breaker levers for status, hazard stripes for
   maintenance. One deliberate dark look; colours are all set explicitly. */

:root {
  --bg: #0c0e12;
  --glass: rgba(22, 25, 32, 0.66);
  --glass-strong: rgba(26, 29, 37, 0.86);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #e9ebf0;
  --muted: #9aa2b1;
  --faint: #626a79;
  --ok: #4fd18b;
  --bad: #ef5b5b;
  --ice: #6cc9ff;
  --hazard: #f0b429;
  --off: #4d5461;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.orbit {
  position: fixed;
  inset: -20%;
  z-index: -1;
  background:
    radial-gradient(38% 32% at 12% 18%, hsla(250, 70%, 55%, 0.20), transparent 70%),
    radial-gradient(34% 30% at 88% 12%, hsla(178, 70%, 45%, 0.15), transparent 70%),
    radial-gradient(42% 38% at 70% 92%, hsla(30, 80%, 55%, 0.12), transparent 70%),
    radial-gradient(30% 30% at 30% 75%, hsla(310, 60%, 50%, 0.10), transparent 70%),
    var(--bg);
  animation: drift 70s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(3%, -2%, 0) rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .orbit { animation: none; } }

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
}

/* ------------------------------------------------------------ notices */
.notices {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 16px 0; max-width: 1180px; margin: 0 auto;
}
.notices:empty { display: none; }
.notice {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 14px; border-radius: 12px;
  background: var(--glass-strong); border: 1px solid var(--line-strong);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  animation: drop 0.35s ease-out;
}
@keyframes drop { from { transform: translateY(-8px); opacity: 0; } }
.notice .badge {
  flex: none; margin-top: 2px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  padding: 2px 8px; border-radius: 5px; background: rgba(110, 168, 255, 0.18); color: #9cc2ff;
}
.notice.warn .badge { background: rgba(240, 180, 41, 0.18); color: var(--hazard); }
.notice.alarm { border-color: rgba(239, 91, 91, 0.5); }
.notice.alarm .badge { background: var(--bad); color: #fff; }
.notice .text { flex: 1; min-width: 0; }
.notice .meta { display: block; font-size: 12px; color: var(--faint); margin-top: 2px; }
.notice button {
  flex: none; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 6px;
}
.notice button:hover { background: var(--line); color: var(--text); }

/* ------------------------------------------------------------ hero */
.hero { max-width: 1180px; margin: 0 auto; padding: 56px 24px 26px; }
.wordmark { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 600; letter-spacing: 0.02em; }
.wordmark b { color: var(--muted); font-weight: 600; }
.mark {
  width: 22px; height: 34px; border-radius: 6px; background: #07080b; position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--line);
}
.mark i {
  position: absolute; left: 3px; right: 3px; top: 3px; height: 13px; border-radius: 4px;
  background: var(--ok); box-shadow: 0 0 14px rgba(79, 209, 139, 0.5);
}
.hero h1 { margin: 26px 0 10px; font-size: clamp(30px, 5vw, 50px); line-height: 1.08; letter-spacing: -0.025em; font-weight: 650; }
.summary { margin: 0 0 22px; color: var(--muted); font-size: 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.summary b { color: var(--text); font-weight: 600; }
/* The verdict dot: green and breathing when all is well, red or amber when not. */
.summary .pulse { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.summary.is-ok .pulse { background: var(--ok); box-shadow: 0 0 0 4px rgba(79, 209, 139, 0.18); animation: breathe 2.6s ease-in-out infinite; }
.summary.is-bad .pulse { background: var(--bad); box-shadow: 0 0 0 4px rgba(239, 91, 91, 0.22); }
.summary.is-maint .pulse { background: var(--hazard); box-shadow: 0 0 0 4px rgba(240, 180, 41, 0.2); }
.summary.is-bad b { color: #ff8a8a; }
.summary .detail { color: var(--muted); }
@keyframes breathe { 50% { box-shadow: 0 0 0 7px rgba(79, 209, 139, 0); } }
@media (prefers-reduced-motion: reduce) { .summary .pulse { animation: none; } }

.panel { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px; border-radius: 16px; }
.breaker {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.18); border: 1px solid var(--line); color: var(--text);
  text-decoration: none; font-size: 13px; transition: border-color 0.15s, transform 0.1s;
}
.breaker:hover { border-color: hsl(var(--hue), 65%, 60%); transform: translateY(-1px); }
.breaker:focus-visible, .card:focus-visible, .door:focus-visible { outline: 2px solid hsl(var(--hue), 70%, 62%); outline-offset: 3px; }
.lever { width: 18px; height: 30px; flex: none; border-radius: 5px; background: #07080b; position: relative; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06); }
.lever::after {
  content: ""; position: absolute; left: 3px; right: 3px; height: 12px; border-radius: 3px; top: 15px;
  background: var(--off); transition: top 0.3s cubic-bezier(.3, 1.6, .5, 1), background 0.3s;
}
[data-state="online"] .lever::after { top: 3px; background: hsl(var(--hue), 70%, 60%); box-shadow: 0 0 10px hsla(var(--hue), 80%, 60%, 0.6); }
[data-state="offline"] .lever::after { background: var(--bad); }
[data-state="maintenance"] .lever::after { background: repeating-linear-gradient(-45deg, var(--hazard) 0 3px, #222 3px 6px); }
[data-state="paused"] .lever::after { top: 3px; background: var(--ice); }

/* ------------------------------------------------------------ cards */
main { max-width: 1180px; margin: 0 auto; padding: 8px 24px 40px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }

/* Groups (the Hub's Games / Tools / Business) and the chips that filter them. */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 26px; }
.filters .chip {
  position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px;
  border-radius: 999px; background: var(--glass); border: 1px solid var(--line); color: var(--muted);
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.filters .chip:hover { color: var(--text); border-color: var(--line-strong); }
.filters .chip[aria-pressed="true"] { color: #0c0e12; background: var(--text); border-color: var(--text); }
.filters .chip .count { font-size: 12px; opacity: 0.7; font-variant-numeric: tabular-nums; }
.filters .chip:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.filters .chip.has-down::after {
  content: ""; position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--bad); box-shadow: 0 0 0 2px var(--bg);
}
.sections { display: flex; flex-direction: column; gap: 34px; }
.group-title {
  display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.group-title .count { font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--faint); }

.card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 16px; text-decoration: none; color: var(--text);
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.25); -webkit-backdrop-filter: blur(18px) saturate(1.25);
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
  scroll-margin-top: 90px;
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(110% 60% at 0% 100%, hsla(var(--hue), 70%, 55%, 0.12), transparent 60%);
}
.card:hover { transform: translateY(-3px); border-color: hsla(var(--hue), 70%, 60%, 0.7); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35); }
.card.flash { border-color: hsl(var(--hue), 70%, 60%); box-shadow: 0 0 0 3px hsla(var(--hue), 70%, 60%, 0.35); }
.card .preview { width: 100%; height: 150px; display: block; background: #10131a; }
/* position: relative lifts the text above the hue glow (::before, absolute), which otherwise
   washed status colours in the card's hue -- a red card's green bars read pink. */
.card .body { position: relative; padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.card .top-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card h2, .card h3 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.card p.desc { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; flex: 1; }
.card .go { margin-top: 14px; font-size: 12.5px; font-weight: 600; color: hsl(var(--hue), 70%, 70%); display: flex; align-items: center; gap: 8px; }
.card .local { font-size: 11px; font-weight: 600; color: var(--faint); border: 1px solid var(--line-strong); padding: 0 7px; border-radius: 999px; }
.card .lockmark { font-size: 9.5px; font-weight: 800; letter-spacing: 0.12em; padding: 2px 6px; border-radius: 4px; color: #151000; background: var(--hazard); }

/* Seven day-bars and the week's figure. Hatched = not tracked that day (the Hub wasn't
   watching), never guessed as up or down. */
.uptime { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.ubars { display: flex; gap: 3px; flex: none; }
.ub { width: 7px; height: 14px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); }
.ub.ok { background: var(--ok); opacity: 0.85; }
.ub.dip { background: var(--hazard); }
.ub.down { background: var(--bad); }
.ub.none { background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.16) 0 2px, rgba(255, 255, 255, 0.03) 2px 4px); }
.ut { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.un { flex: none; color: var(--faint); font-weight: 600; }
.card[data-state="online"] .un { color: var(--ok); }
.card[data-state="offline"] .un { color: var(--bad); }
.card .band {
  display: none; padding: 6px 14px; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: #151000;
  background: repeating-linear-gradient(-45deg, var(--hazard) 0 14px, #e2a616 14px 28px);
}
.card[data-state="maintenance"] .band { display: block; }
.card[data-state="maintenance"] .preview, .card[data-state="offline"] .preview { filter: grayscale(0.8) brightness(0.7); }

.status {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); color: var(--muted); white-space: nowrap;
}
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
[data-state="online"] .status { background: rgba(79, 209, 139, 0.14); color: var(--ok); }
[data-state="online"] .status .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(79, 209, 139, 0.2); }
[data-state="offline"] .status { background: rgba(239, 91, 91, 0.14); color: var(--bad); }
[data-state="offline"] .status .dot { background: var(--bad); }
[data-state="maintenance"] .status { background: var(--hazard); color: #151000; }
[data-state="maintenance"] .status .dot { background: #151000; }
[data-state="paused"] .status { background: rgba(108, 201, 255, 0.14); color: var(--ice); }
[data-state="paused"] .status .dot { background: var(--ice); }

/* ------------------------------------------------------------ duplex tile */
/* One project, several front doors (Watto: open Storefront + locked Backroom). The
   tile is a plain box; each door is its own link with its own live status. */
.card.duplex:hover { transform: none; }
.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.door {
  position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0;
  padding: 11px 12px 11px 14px; border-radius: 12px; text-decoration: none; color: var(--text);
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line);
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}
.door:hover, .door:focus-visible {
  border-color: hsla(var(--hue), 70%, 60%, 0.75); background: hsla(var(--hue), 70%, 55%, 0.08);
  transform: translateY(-2px); outline: none;
}
.door.locked::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0;
  background: repeating-linear-gradient(-45deg, var(--hazard) 0 4px, #1b1b1b 4px 8px);
}
.door-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.door-label { font-weight: 650; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.door-kind { flex: none; font-size: 9.5px; font-weight: 800; letter-spacing: 0.12em; padding: 2px 6px; border-radius: 4px; }
.door-kind.open { color: var(--ok); background: rgba(79, 209, 139, 0.12); }
.door-kind.locked { color: #151000; background: var(--hazard); }
.door-host { font-size: 12px; font-weight: 600; color: hsl(var(--hue), 70%, 70%); overflow-wrap: anywhere; }
.door-note { font-size: 11.5px; color: var(--faint); }
.door .status { align-self: flex-start; margin-top: 5px; }
/* Door-level selectors win over the card's own [data-state], so a Backroom that is down
   never inherits a green pill from a Storefront that is up. */
.door[data-state] .status { background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.door[data-state] .status .dot { background: var(--muted); box-shadow: none; }
.door[data-state="online"] .status { background: rgba(79, 209, 139, 0.14); color: var(--ok); }
.door[data-state="online"] .status .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(79, 209, 139, 0.2); }
.door[data-state="offline"] .status { background: rgba(239, 91, 91, 0.14); color: var(--bad); }
.door[data-state="offline"] .status .dot { background: var(--bad); }
.door[data-state="maintenance"] .status { background: var(--hazard); color: #151000; }
.door[data-state="maintenance"] .status .dot { background: #151000; }
.door[data-state="paused"] .status { background: rgba(108, 201, 255, 0.14); color: var(--ice); }
.door[data-state="paused"] .status .dot { background: var(--ice); }
@media (max-width: 400px) { .doors { grid-template-columns: 1fr; } }

.foot {
  max-width: 1180px; margin: 0 auto; padding: 0 24px 40px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--faint); font-size: 12.5px;
}

@media (max-width: 640px) {
  .hero { padding: 36px 16px 18px; }
  main { padding: 6px 16px 30px; }
  .cards { grid-template-columns: 1fr; }
  /* Phones: the breaker panel keeps its names and scrolls sideways in one row, instead of
     a grid of unlabelled switches. Its right edge fades to say there is more. */
  .panel {
    flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding: 10px; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
  .panel::-webkit-scrollbar { display: none; }
  .breaker { flex: none; padding: 5px 11px 5px 5px; font-size: 12.5px; }
  .filters { gap: 6px; margin-bottom: 20px; }
  .filters .chip { padding: 6px 12px; font-size: 13px; }
  .sections { gap: 28px; }
  .foot { padding: 0 16px 30px; }
}
