/* status.nebulaelec.au. Tokens first; colour only where it means something. */
:root {
  --bg: #ffffff;
  --fg: #0b1030;
  --muted: #5b6078;
  --rule: #000099;
  --line: rgba(11, 16, 48, 0.10);
  --line-strong: rgba(11, 16, 48, 0.18);
  --none: #d9dbe3;
  --up: #059669;
  --up-soft-bg: #d1fae5; --up-soft-fg: #065f46;
  --issue: #d97706;
  --issue-soft-bg: #fef3c7; --issue-soft-fg: #92400e;
  --down: #e11d48;
  --down-soft-bg: #ffe4e6; --down-soft-fg: #9f1239;
  --unknown: #8a8fa6;
  --focus: #000099;
  --font: "Poppins", Arial, "Helvetica Neue", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000B44;
    --fg: #eef0fb;
    --muted: #a9aed0;
    --rule: #6B6BC0;
    --line: rgba(255, 255, 255, 0.10);
    --line-strong: rgba(255, 255, 255, 0.20);
    --none: rgba(255, 255, 255, 0.16);
    --up: #34d399;
    --up-soft-bg: rgba(6, 78, 59, 0.55); --up-soft-fg: #a7f3d0;
    --issue: #fbbf24;
    --issue-soft-bg: rgba(120, 53, 15, 0.55); --issue-soft-fg: #fde68a;
    --down: #fb7185;
    --down-soft-bg: rgba(136, 19, 55, 0.55); --down-soft-fg: #fecdd3;
    --unknown: #a9aed0;
    --focus: #b7b7f0;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
img { display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--bg); padding: 8px 12px; }
.skip:focus { left: 16px; z-index: 10; }

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 24px calc(env(safe-area-inset-bottom, 0px) + 48px);
}

/* Header band */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: inline-block; text-decoration: none; }
.logo { width: 150px; height: auto; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) { .logo-light { display: none; } .logo-dark { display: block; } }
.top-title { margin: 0; font-size: 13px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.hero {
  display: flex; align-items: center; gap: 20px;
  margin-top: 40px; padding-bottom: 28px;
  border-bottom: 2px solid var(--rule);
}
.hero-text { min-width: 0; }
h1 { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
.facts { margin: 6px 0 0; font-size: 13px; color: var(--muted); }

.glyph {
  flex: none; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--unknown); color: #fff;
}
.glyph svg { width: 30px; height: 30px; }
.glyph[data-state="up"] { background: var(--up); }
.glyph[data-state="issue"] { background: var(--issue); }
.glyph[data-state="down"] { background: var(--down); }
@media (prefers-color-scheme: dark) { .glyph { color: #000B44; } }

.notice {
  margin-top: 20px; padding: 10px 14px; border-left: 3px solid var(--issue);
  background: var(--issue-soft-bg); color: var(--issue-soft-fg); font-size: 13px;
}

.legend {
  list-style: none; margin: 20px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 12.5px; color: var(--muted);
}
.legend li { display: inline-flex; align-items: center; gap: 8px; }

.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--unknown); display: inline-block; }
.dot[data-state="up"] { background: var(--up); }
.dot[data-state="issue"] { background: var(--issue); }
.dot[data-state="down"] { background: var(--down); }
.dot[data-state="none"] { background: var(--none); }

main { outline: none; }

/* Groups: eyebrow + hairline, then a register of rows */
.group { margin-top: 36px; }
.group-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--line-strong); }
.eyebrow { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.hint { margin: 0; font-size: 12px; color: var(--muted); }
.incidents .hint { margin-top: 4px; }

.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) 10rem;
  align-items: center; column-gap: 20px; row-gap: 4px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.row > .who, .row > .history { grid-row: 1 / span 2; }
.row > .state { grid-column: 3; grid-row: 1 / span 2; }
.row:has(> .since) > .state { grid-row: 1; align-self: end; }
.who { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.who .dot { margin-top: 6px; }
.name { margin: 0; font-size: 14px; font-weight: 500; }
.about { margin: 0; font-size: 12px; color: var(--muted); }

.history { min-width: 0; }
.bars { display: flex; gap: 2px; height: 26px; }
.bar { flex: 1 1 0; min-width: 3px; border-radius: 2px; background: var(--none); }
.bar[data-state="up"] { background: var(--up); opacity: 0.85; }
.bar[data-state="issue"] { background: var(--issue); }
.bar[data-state="down"] { background: var(--down); }
.bar:hover { opacity: 1; outline: 1px solid var(--fg); outline-offset: 1px; }
.history-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.state { justify-self: end; text-align: right; min-width: 0; }
.chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--line); color: var(--muted);
}
.chip[data-state="up"] { background: var(--up-soft-bg); color: var(--up-soft-fg); }
.chip[data-state="issue"] { background: var(--issue-soft-bg); color: var(--issue-soft-fg); }
.chip[data-state="down"] { background: var(--down-soft-bg); color: var(--down-soft-fg); }
.since { grid-column: 3; grid-row: 2; align-self: start; margin: 0; text-align: right; font-size: 11.5px; line-height: 1.45; color: var(--muted); }

/* Recent problems */
.incidents { margin-top: 44px; }
.incidents .eyebrow { padding-bottom: 8px; border-bottom: 1px solid var(--line-strong); }
.incident-list { list-style: none; margin: 8px 0 0; padding: 0; }
.incident { display: grid; grid-template-columns: 9rem minmax(0, 1fr) auto; gap: 4px 20px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.incident-when { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.incident-what { margin: 0; font-weight: 500; }
.incident-why { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.incident-how { font-size: 12.5px; font-variant-numeric: tabular-nums; text-align: right; }
.empty { margin: 14px 0 0; color: var(--muted); }

.foot { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; }
.foot p { margin: 0; }

/* Loading skeleton, shaped like the register */
.skeleton { margin-top: 36px; }
.sk-line, .sk-row { background: var(--line); border-radius: 4px; animation: pulse 1.4s ease-in-out infinite; }
.sk-eyebrow { width: 120px; height: 12px; margin: 28px 0 14px; }
.sk-row { height: 44px; margin: 10px 0; }
@keyframes pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .sk-line, .sk-row { animation: none; } }

/* Phone: the bars go under the name, the state stays on the right of the name */
@media (max-width: 680px) {
  .page { padding-left: 16px; padding-right: 16px; }
  .hero { margin-top: 28px; gap: 14px; }
  .glyph { width: 44px; height: 44px; }
  .glyph svg { width: 24px; height: 24px; }
  h1 { font-size: 22px; }
  .row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 10px; }
  .row > .who { grid-column: 1; grid-row: 1; }
  .row > .state, .row:has(> .since) > .state { grid-column: 2; grid-row: 1; align-self: start; }
  .row > .history { grid-column: 1 / -1; grid-row: 2; }
  .row > .since { grid-column: 1 / -1; grid-row: 3; text-align: left; padding-left: 22px; }
  .incident { grid-template-columns: minmax(0, 1fr) auto; }
  .incident-when { grid-column: 1 / -1; }
}
