/* status.soundsoftware.ca. Sound Software brand tokens (from SSPS tokens.css), light first,
   dark when the device asks for it. Motion only under prefers-reduced-motion: no-preference. */

@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/rajdhani-regular.woff2") format("woff2"); }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/assets/fonts/rajdhani-semibold.woff2") format("woff2"); }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/assets/fonts/rajdhani-bold.woff2") format("woff2"); }

:root {
  --primary: #155A80;
  --primary-dark: #0E3F5A;
  --primary-light: #4689C8;
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --text: #111418;
  --muted: #5A6473;
  --border: #E1E5EB;
  --shadow: 0 1px 2px rgba(17,20,24,.06), 0 2px 6px rgba(17,20,24,.05);

  /* status: text colour on a soft tint; every one is also an icon + a word */
  --ok: #137A54;      --ok-bg: #E6F5EE;
  --warn: #8A5A00;    --warn-bg: #FDF3DC;
  --down: #B4232F;    --down-bg: #FCE8EA;
  --maint: #155A80;   --maint-bg: #E5EFF6;
  --unk: #5A6473;     --unk-bg: #EEF1F5;

  --font: "Rajdhani", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #6FA8DC;
    --primary-dark: #9CC3E8;
    --bg: #0F1318;
    --surface: #171C23;
    --text: #E7EBF0;
    --muted: #A3ADBA;
    --border: #2A313B;
    --shadow: none;

    --ok: #5BD3A1;    --ok-bg: rgba(30,166,114,.16);
    --warn: #F5C04A;  --warn-bg: rgba(242,164,19,.16);
    --down: #FF8A93;  --down-bg: rgba(220,53,69,.2);
    --maint: #8EC1EE; --maint-bg: rgba(70,137,200,.18);
    --unk: #B3BCC8;   --unk-bg: rgba(163,173,186,.14);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: .01em;
  overflow-wrap: anywhere;
}
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-dark); }
a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 3px; }
.sprite { position: absolute; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }

.top { background: var(--surface); border-bottom: 1px solid var(--border); }
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.logo img { display: block; height: 36px; width: auto; }
.back { font-weight: 600; text-decoration: none; white-space: nowrap; }
.back:hover { text-decoration: underline; }

.hero { padding: 28px 0 8px; }
h1 { font-size: 2.2rem; line-height: 1.1; margin: 0; font-weight: 700; letter-spacing: 0; }
.lede { margin: 6px 0 20px; color: var(--muted); font-size: 1.12rem; }

.ico { width: 1.15em; height: 1.15em; flex: none; }
.ico--sm { width: .8em; height: .8em; margin-left: 6px; opacity: .55; vertical-align: -.05em; }

/* the badge: icon + word on a tint */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px; border-radius: 999px;
  font-weight: 600; font-size: .95rem; line-height: 1.4; white-space: nowrap;
  color: var(--c); background: var(--cb);
  position: relative;
}
.badge--operational { --c: var(--ok);    --cb: var(--ok-bg); }
.badge--degraded    { --c: var(--warn);  --cb: var(--warn-bg); }
.badge--outage      { --c: var(--down);  --cb: var(--down-bg); }
.badge--maintenance { --c: var(--maint); --cb: var(--maint-bg); }
.badge--unknown     { --c: var(--unk);   --cb: var(--unk-bg); }
.badge--link        { --c: var(--muted); --cb: transparent; box-shadow: inset 0 0 0 1px var(--border); }

/* summary card */
.summary {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--c);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.summary--operational { --c: var(--ok); }
.summary--degraded    { --c: var(--warn); }
.summary--outage      { --c: var(--down); }
.summary--maintenance { --c: var(--maint); }
.summary--unknown     { --c: var(--unk); }
.summary__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; font-size: 1.2rem; font-weight: 600; }
.summary__list { margin: 10px 0 0; padding-left: 20px; }
.summary__list a { font-weight: 600; }
.summary__state { color: var(--muted); }
.tally { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0 0; padding: 0; color: var(--muted); }
.tally__item { display: inline-flex; align-items: center; gap: 5px; }
.tally__item b { color: var(--text); }
.tally__item--operational .ico { color: var(--ok); }
.tally__item--degraded .ico { color: var(--warn); }
.tally__item--outage .ico { color: var(--down); }
.tally__item--maintenance .ico { color: var(--maint); }
.tally__item--unknown .ico, .tally__item--link .ico { color: var(--unk); }
.summary__time { margin: 10px 0 0; color: var(--muted); font-size: .95rem; }

/* groups and rows */
.group { margin-top: 28px; }
.group h2 {
  font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  margin: 0 0 8px; font-weight: 700;
}
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.row { padding: 12px 16px; border-top: 1px solid var(--border); }
.row:first-child { border-top: 0; }
.row__main { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.row__name { margin: 0; font-size: 1.15rem; font-weight: 600; letter-spacing: 0; }
.row__name a { color: var(--text); text-decoration: none; }
.row__name a:hover { color: var(--primary); text-decoration: underline; }
.row__detail, .row__note, .row__time { margin: 4px 0 0; font-size: .95rem; }
.row__detail { color: var(--text); }
.row__note { color: var(--muted); }
.row__time { color: var(--muted); font-size: .88rem; }
.items { margin: 6px 0 0; padding: 0; list-style: none; }
.items__i { position: relative; padding: 2px 0 2px 14px; font-size: .98rem; }
.items__i::before { content: ""; position: absolute; left: 0; top: .72em; width: 6px; height: 6px; border-radius: 2px; background: var(--muted); }
.items__i--incident::before { background: var(--warn); }
.items__i--maintenance::before { background: var(--maint); }
.items__i--notice::before { background: var(--unk); }
.items__k { font-weight: 600; }
.items__more { padding-left: 14px; color: var(--muted); font-size: .95rem; }

.foot { margin-top: 40px; padding: 20px 0 32px; border-top: 1px solid var(--border); color: var(--muted); font-size: .95rem; }
.foot p { margin: 0 0 8px; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  h1 { font-size: 1.85rem; }
  .logo img { height: 30px; }
  .row { padding: 12px; }
}

/* motion: things arrive; a live problem has a ring going out from its badge */
/* stagger: the hero is section 1, groups follow (no inline styles: the CSP forbids them) */
.group:nth-of-type(2) { --gi: 1; } .group:nth-of-type(3) { --gi: 2; } .group:nth-of-type(4) { --gi: 3; }
.group:nth-of-type(5) { --gi: 4; } .group:nth-of-type(6) { --gi: 5; } .group:nth-of-type(7) { --gi: 6; }
.group:nth-of-type(n+8) { --gi: 7; }

@media (prefers-reduced-motion: no-preference) {
  .hero, .group { animation: rise .5s cubic-bezier(.2,.8,.2,1) backwards; }
  .group { animation-delay: calc(var(--gi, 1) * 60ms + 60ms); }
  .row { animation: row .45s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: calc(var(--gi, 1) * 60ms + 160ms); }
  .badge--live::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    border: 1.5px solid var(--c); opacity: 0; pointer-events: none;
    animation: halo 2.4s ease-out infinite 1s;
  }
  .row__name a .ico--sm { transition: transform .18s ease, opacity .18s ease; }
  .row__name a:hover .ico--sm { transform: translate(2px, -2px); opacity: 1; }
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes row  { from { opacity: 0; transform: translateX(-6px); } }
@keyframes halo { 0% { opacity: .7; transform: scale(1); } 80%, 100% { opacity: 0; transform: scale(1.25, 1.6); } }
