/* 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;

  /* chart fills (brand status colours); a day with no reading is the plain track */
  --f-ok: #1EA672; --f-warn: #F2A413; --f-down: #DC3545; --f-maint: #4689C8;
  --f-unk: #9AA3B0; --f-none: #E1E5EB; --track: #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);
    --f-ok: #34C38A; --f-warn: #F2B33D; --f-down: #F0606D; --f-maint: #6FA8DC;
    --f-unk: #6B7686; --f-none: #2A313B; --track: #222831;
    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); }


/* state -> colour, for anything charted or keyed (fill colour via --c) */
.st-operational { --c: var(--f-ok); }
.st-degraded    { --c: var(--f-warn); }
.st-outage      { --c: var(--f-down); }
.st-maintenance { --c: var(--f-maint); }
.st-unknown     { --c: var(--f-unk); }
.st-link, .st-none { --c: var(--f-none); }

/* the hero: ring + words */
.summary {
  display: grid; grid-template-columns: 168px 1fr; gap: 8px 22px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--t);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.summary--operational { --t: var(--f-ok); }
.summary--degraded    { --t: var(--f-warn); }
.summary--outage      { --t: var(--f-down); }
.summary--maintenance { --t: var(--f-maint); }
.summary--unknown     { --t: var(--f-unk); }
.summary__ring .chart { width: 168px; height: 168px; display: block; }
.summary__head { margin: 0; }
.summary__line { margin: 8px 0 0; font-size: 1.2rem; font-weight: 600; line-height: 1.3; }
.summary__list { margin: 8px 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: 4px 14px; margin: 10px 0 0; padding: 0; color: var(--muted); }
.tally__item { display: inline-flex; align-items: center; gap: 5px; }
.tally__item .ico { color: var(--c); }
.tally__item.st-link .ico, .tally__item.st-unknown .ico { color: var(--unk); }
.tally__item b { color: var(--text); }
.summary__time { margin: 10px 0 0; color: var(--muted); font-size: .92rem; }

/* charts: colour only through --c; butt caps (never paint past the value) */
.chart { overflow: visible; }
.chart .track { fill: none; stroke: var(--track); }
.ring .seg { fill: none; stroke: var(--c); stroke-linecap: butt; filter: drop-shadow(0 0 3px color-mix(in oklab, var(--c) 45%, transparent)); }
.ring .seg.st-link { filter: none; stroke: var(--f-none); }
.ring .num { font: 700 26px/1 var(--font); fill: var(--text); }
.ring .of { font-size: 15px; font-weight: 600; fill: var(--muted); }
.ring .sub { font: 600 12px/1 var(--font); fill: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

.legend { margin: 14px 2px 0; color: var(--muted); font-size: .92rem; }
.legend__line { margin: 4px 0 0; }
.legend__key { display: inline-flex; align-items: center; gap: 5px; margin-right: 12px; white-space: nowrap; }
.kbox { display: inline-block; width: 10px; height: 14px; border-radius: 2px; background: var(--c); }

/* groups and rows */
.group { margin-top: 28px; }
.group h2 {
  display: flex; align-items: center; gap: 8px;
  font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  margin: 0 0 8px; font-weight: 700;
}
.gico { width: 20px; height: 20px; color: var(--primary); flex: none; }
.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 14px; 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 { display: flex; align-items: center; gap: 10px; 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; }
.mark {
  display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 8px;
  background: var(--unk-bg); color: var(--primary); font-size: .82rem; font-weight: 700; letter-spacing: 0;
  box-shadow: inset 0 0 0 1px var(--border);
}
.said { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin: 6px 0 0 40px; font-size: .97rem; }
.said__who { flex: none; min-width: 74px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.said__what { flex: 1 1 220px; display: inline; }
.said__what .ico--in { width: 1em; height: 1em; vertical-align: -.14em; margin-right: 5px; }
.said__what.st-operational .ico, .ck-ok .ico { color: var(--ok); }
.said__what.st-degraded .ico, .ck-missed .ico, .ck-late .ico, .ck-partial .ico, .ck-failed .ico { color: var(--warn); }
.said__what.st-outage .ico, .ck-down .ico { color: var(--down); }
.said__what.st-maintenance .ico { color: var(--maint); }
.said__what.st-unknown .ico, .ck-challenged .ico, .ck-unknown .ico { color: var(--unk); }
.said__at { color: var(--muted); font-size: .9rem; }
.said__chart { flex: none; display: inline-flex; }
.spark { width: 120px; height: 28px; }
.spark .floor { stroke: var(--border); stroke-width: 1; }
.spark .line { fill: none; stroke: var(--primary-light); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.spark .dot { fill: var(--primary-light); }
.spark .miss { fill: var(--f-down); }
.dial { width: 96px; height: 58px; }
.dial .value { fill: none; stroke: var(--c); stroke-linecap: butt; filter: drop-shadow(0 0 3px color-mix(in oklab, var(--c) 45%, transparent)); }
.dial .notch { stroke: var(--muted); stroke-width: 1.5; }
.dial .num { font: 700 15px/1 var(--font); fill: var(--text); }
.dial .sub, .dial .tick { font: 600 8px/1 var(--font); fill: var(--muted); }

.items { margin: 6px 0 0 40px; padding: 0; list-style: none; }
.items__i { position: relative; padding: 2px 0 2px 14px; font-size: .97rem; }
.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(--f-warn); }
.items__i--maintenance::before { background: var(--f-maint); }
.items__i--notice::before { background: var(--f-unk); }
.items__k { font-weight: 600; }
.items__more { padding-left: 14px; color: var(--muted); font-size: .95rem; }
.row__note, .row__time { margin: 6px 0 0 40px; font-size: .92rem; color: var(--muted); }
.row__time { font-size: .86rem; margin-top: 2px; }
.row__strip { margin: 10px 0 0 40px; }
.strip { display: block; width: 100%; height: 22px; }
.strip .day { fill: var(--c); }

.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: 560px) {
  body { font-size: 16px; }
  h1 { font-size: 1.85rem; }
  .logo img { height: 30px; }
  .summary { grid-template-columns: 1fr; justify-items: start; padding: 16px; }
  .summary__ring { justify-self: center; }
  .summary__ring .chart { width: 150px; height: 150px; }
  .row { padding: 12px; }
  .said, .items, .row__note, .row__time, .row__strip { margin-left: 0; }
  .said__who { min-width: 0; width: 100%; }
}

/* motion: things arrive, the ring and dial draw themselves on, a live problem pulses.
   Nothing is hidden or part-drawn without motion: the keyframes own every starting frame. */
.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); }
  .ring .seg, .dial .value, .spark .line { stroke-dasharray: 100 101; animation: draw 1.05s cubic-bezier(.2,.75,.25,1) both; animation-delay: .1s; }
  .ring .seg { animation-delay: calc(.1s + var(--i, 0) * 45ms); }
  .ring .num, .ring .sub, .dial .num, .dial .sub { animation: fade .6s ease both; animation-delay: .45s; }
  .spark .line { animation-duration: 1.4s; animation-delay: .5s; }
  .strip .day { animation: fade .5s ease both; animation-delay: .4s; }
  .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 draw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes halo { 0% { opacity: .7; transform: scale(1); } 80%, 100% { opacity: 0; transform: scale(1.25, 1.6); } }
.ring path.seg:nth-of-type(1) { --i: 0; }
.ring path.seg:nth-of-type(2) { --i: 1; }
.ring path.seg:nth-of-type(3) { --i: 2; }
.ring path.seg:nth-of-type(4) { --i: 3; }
.ring path.seg:nth-of-type(5) { --i: 4; }
.ring path.seg:nth-of-type(6) { --i: 5; }
.ring path.seg:nth-of-type(7) { --i: 6; }
.ring path.seg:nth-of-type(8) { --i: 7; }
.ring path.seg:nth-of-type(9) { --i: 8; }
.ring path.seg:nth-of-type(10) { --i: 9; }
.ring path.seg:nth-of-type(11) { --i: 10; }
.ring path.seg:nth-of-type(12) { --i: 11; }
.ring path.seg:nth-of-type(13) { --i: 12; }
.ring path.seg:nth-of-type(14) { --i: 13; }
.ring path.seg:nth-of-type(15) { --i: 14; }
.ring path.seg:nth-of-type(16) { --i: 15; }
.ring path.seg:nth-of-type(17) { --i: 16; }
.ring path.seg:nth-of-type(18) { --i: 17; }
.ring path.seg:nth-of-type(19) { --i: 18; }
.ring path.seg:nth-of-type(20) { --i: 19; }
.ring path.seg:nth-of-type(21) { --i: 20; }
.ring path.seg:nth-of-type(22) { --i: 21; }
.ring path.seg:nth-of-type(23) { --i: 22; }
.ring path.seg:nth-of-type(24) { --i: 23; }
.ring path.seg:nth-of-type(25) { --i: 24; }
.ring path.seg:nth-of-type(26) { --i: 25; }
.ring path.seg:nth-of-type(27) { --i: 26; }
.ring path.seg:nth-of-type(28) { --i: 27; }
.ring path.seg:nth-of-type(29) { --i: 28; }
.ring path.seg:nth-of-type(30) { --i: 29; }
.ring path.seg:nth-of-type(31) { --i: 30; }
.ring path.seg:nth-of-type(32) { --i: 31; }
