/* Pyrix web · the Status page (/status, server/views/status.js) and the announcement bar on the public pages
   (server/views/layout.js). Linked only on /status and while an announcement is active.
   The page is one screen: head, the overall readout line, then a ruled table - every row shares one column grid
   (--st-cols) with the column heads and the bar axis, so bars, uptime and states line up down the page. */

/* ---------- state colours: annunciators and tags ---------- */
.site .st-ann.st-warn,
.site .st-tag.st-warn { color: var(--amber-ink); border-color: rgba(245, 165, 36, 0.45); }
.site .st-ann.st-warn i { background: var(--amber); }
.site .st-ann.st-down,
.site .st-tag.st-down { color: var(--red-ink); border-color: rgba(239, 68, 68, 0.5); }
.site .st-ann.st-down i { background: var(--red); }
.site .st-ann.st-maint,
.site .st-ann.st-info,
.site .st-tag.st-maint,
.site .st-tag.st-info { color: var(--blue-ink); border-color: var(--line-blue); }
.site .st-ann.st-maint i,
.site .st-ann.st-info i { background: var(--blue-2); }
.site .st-ann.st-none,
.site .st-tag.st-none { color: var(--text-3); border-color: var(--edge-2); }
.site .st-ann.st-none i { background: var(--text-3); }

.site .st-vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- the page ---------- */
.site .st-page {
  --st-cols: minmax(220px, 1.2fr) minmax(0, 3fr) 72px 72px 136px;
  --st-gap: clamp(16px, 2vw, 28px);
  display: grid;
  align-content: start;
  gap: 20px;
  padding-block: clamp(24px, 3vw, 40px) clamp(48px, 6vw, 80px);
}

/* head: the title and one line, the Discord key at the end */
.site .st-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; }
.site .st-lede { color: var(--text-2); font-size: 0.9375rem; }

/* the overall state: one framed readout line in the state colour, no fill */
.site .st-overall {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 12px 18px;
  border: 1px solid rgba(34, 197, 94, 0.42);
  border-radius: var(--r-box);
}
.site .st-overall-lamp { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.site .st-overall-t { flex: 1 1 auto; min-width: 0; font-size: 1.25rem; font-weight: 680; line-height: 1.2; letter-spacing: -0.015em; text-wrap: balance; }
.site .st-overall-m { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 18px; color: var(--text-2); font-size: 0.8125rem; font-variant-numeric: tabular-nums; text-align: right; }
.site .st-count { color: var(--text); font-weight: 600; }
.site .st-overall.st-warn { border-color: rgba(245, 165, 36, 0.5); }
.site .st-overall.st-warn .st-overall-lamp { background: var(--amber); }
.site .st-overall.st-down { border-color: rgba(239, 68, 68, 0.55); }
.site .st-overall.st-down .st-overall-lamp { background: var(--red); }
.site .st-overall.st-maint { border-color: var(--line-blue); }
.site .st-overall.st-maint .st-overall-lamp { background: var(--blue-2); }
.site .st-overall.st-none { border-color: var(--edge-2); }
.site .st-overall.st-none .st-overall-lamp { background: var(--text-3); }
.site .st-offline { margin-top: -8px; }

.site .st-sec { display: grid; gap: 10px; min-width: 0; }
.site .st-h2 { color: var(--text-3); font-size: 11px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; }
.site .st-past { margin-top: 20px; }

/* announcements: ruled rows - the severity tag in a fixed column, then title, text and when */
.site .st-notes { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--edge); }
.site .st-note { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 6px 16px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--edge); }
.site .st-note .st-tag { justify-self: start; margin-top: 1px; }
.site .st-note-b { display: grid; gap: 4px; min-width: 0; }
.site .st-note h3 { font-size: 15px; font-weight: 650; letter-spacing: -0.005em; overflow-wrap: anywhere; }
.site .st-text { max-width: 70ch; color: var(--text-2); font-size: 0.875rem; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.site .st-meta { color: var(--text-3); font-size: 0.8125rem; }

/* the table: column heads, one row per component, the bar axis */
.site .st-cols,
.site .st-row,
.site .st-axis { display: grid; grid-template-columns: var(--st-cols); column-gap: var(--st-gap); align-items: center; }
.site .st-cols { padding-bottom: 8px; color: var(--text-3); font-size: 11px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; }
.site .st-c-u { text-align: right; }
.site .st-c-now { text-align: left; }
.site .st-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--edge); }
.site .st-row { min-height: 54px; padding: 7px 0; border-bottom: 1px solid var(--edge); transition: background-color var(--t1); }
.site .st-row:hover { background: var(--hover); }
.site .st-name { display: grid; gap: 2px; min-width: 0; }
.site .st-name h3 { font-size: 0.9375rem; font-weight: 650; letter-spacing: -0.005em; line-height: 1.3; }
.site .st-desc { overflow: hidden; color: var(--text-3); font-size: 0.8125rem; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.site .st-desc-now { color: var(--text-2); }
.site .st-row[data-state="down"] .st-desc-now { color: var(--red-ink); }
.site .st-row[data-state="degraded"] .st-desc-now { color: var(--amber-ink); }
.site .st-row[data-state="maintenance"] .st-desc-now { color: var(--blue-ink); }

/* 90 day bars: square-ended marks; a good day stays quiet so a bad one stands out */
.site .st-bars { display: flex; gap: 2px; height: 26px; min-width: 0; }
.site .st-b { flex: 1 1 0; min-width: 1px; border-radius: 1px; background: var(--green); opacity: 0.62; transition: opacity var(--t1); }
.site .st-b:hover { opacity: 1; }
.site .st-b-degraded { background: var(--amber); opacity: 0.95; }
.site .st-b-down { background: var(--red); opacity: 1; }
.site .st-b-maintenance { background: var(--blue-2); opacity: 0.9; }
.site .st-b-none { background: rgba(255, 255, 255, 0.08); opacity: 1; }

.site .st-u { display: flex; justify-content: flex-end; color: var(--text); font-size: 0.8125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.site .st-u-k { display: none; }
.site .st-now { min-width: 0; }

.site .st-axis { padding-top: 8px; color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.site .st-axis-bars { display: flex; justify-content: space-between; }
.site .st-axis-mid { display: none; }

.site .st-foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 32px; padding-top: 10px; }
.site .st-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--text-2); font-size: 0.8125rem; }
.site .st-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.site .st-legend .st-b { display: inline-block; flex: none; width: 6px; height: 12px; opacity: 1; }
.site .st-legend .st-b-ok { opacity: 0.62; }
.site .st-how { max-width: 64ch; }
.site .st-empty { padding: 16px 0; border-top: 1px solid var(--edge); }

/* narrower windows: the 24 h column goes, the description stays one line */
@media (max-width: 1080px) {
  .site .st-page { --st-cols: minmax(170px, 1.1fr) minmax(0, 2.4fr) 68px 128px; }
  .site .st-u1,
  .site .st-cols .st-c-u1 { display: none; }
}

/* phones: each row is name + state, the last 30 days below, uptime under the bars */
@media (max-width: 760px) {
  .site .st-page { gap: 16px; }
  .site .st-overall { flex-wrap: wrap; align-items: center; row-gap: 6px; padding: 12px 14px; }
  .site .st-overall-t { flex: 1 1 calc(100% - 30px); font-size: 1.0625rem; }
  .site .st-overall-m { flex: 1 0 100%; justify-content: flex-start; padding-left: 24px; text-align: left; }
  .site .st-cols { display: none; }
  .site .st-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name now" "bars bars" "u1 u90";
    row-gap: 8px;
    padding: 12px 0;
  }
  .site .st-name { grid-area: name; }
  .site .st-now { grid-area: now; justify-self: end; }
  .site .st-bars { grid-area: bars; height: 24px; gap: 3px; }
  .site .st-bars .st-b:nth-child(-n + 60) { display: none; }
  .site .st-u { gap: 6px; font-size: 0.75rem; }
  .site .st-u-k { display: inline; color: var(--text-3); font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; }
  .site .st-u1 { display: flex; grid-area: u1; justify-content: flex-start; }
  .site .st-u90 { grid-area: u90; }
  .site .st-desc-now { white-space: normal; }
  .site .st-axis { grid-template-columns: minmax(0, 1fr); }
  .site .st-axis > span:first-child { display: none; }
  .site .st-axis-old { display: none; }
  .site .st-axis-mid { display: inline; }
  .site .st-note { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- the announcement bar on the public pages ---------- */
.site .st-banner { border-bottom: 1px solid var(--line-blue); background: rgba(59, 130, 246, 0.08); }
.site .st-banner-in { display: flex; align-items: center; gap: 12px; min-height: 40px; padding-block: 8px; font-size: 0.8125rem; }
.site .st-banner-k { flex: none; color: var(--blue-ink); font-size: 11px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; }
.site .st-banner-t { flex: 1 1 auto; min-width: 0; overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.site .st-banner-more { color: var(--text-3); }
.site .st-banner-a {
  flex: none;
  color: var(--blue-2);
  text-decoration: underline;
  text-decoration-color: rgba(96, 165, 250, 0.4);
  text-underline-offset: 3px;
}
.site .st-banner-a:hover { color: #fff; }
.site .st-banner-warn { border-bottom-color: rgba(245, 165, 36, 0.45); background: rgba(245, 165, 36, 0.08); }
.site .st-banner-warn .st-banner-k { color: var(--amber-ink); }
.site .st-banner-down { border-bottom-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.09); }
.site .st-banner-down .st-banner-k { color: var(--red-ink); }
