/* deploy/status/public/app.css: status.inspekt.gg.
 *
 * The palette is inspekt.gg's own (web/public/site.css), redeclared here
 * because this page is served from a different host and loads nothing from
 * the main site. System fonts only: the CSP in _headers allows styles and
 * scripts from this origin and nothing else. */

:root {
  color-scheme: dark;

  --bg-0: #0a0b0e;
  --bg-1: #0e1014;
  --bg-2: #131620;
  --surface-raise: rgba(255, 255, 255, 0.045);
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.16);

  --text-hi: #f3f5f9;
  --text-mid: #b9bfcb;
  --text-dim: #8a91a1;

  --accent: #ff6b2c;
  --accent-hot: #ff8f55;
  --accent-ring: rgba(255, 107, 44, 0.45);
  --on-accent: #140a04;
  --focus-ring: var(--accent);

  --ok: #7fce96;
  --ok-dim: rgba(127, 206, 150, 0.12);
  --ok-ring: rgba(127, 206, 150, 0.35);
  --warn: #e4ae39;
  --warn-dim: rgba(228, 174, 57, 0.12);
  --warn-ring: rgba(228, 174, 57, 0.35);
  --danger: #f2766b;
  --danger-dim: rgba(242, 118, 107, 0.12);
  --danger-ring: rgba(242, 118, 107, 0.35);

  /* The day bars. Down splits in two by that day's uptime, so a day with one
     failed check reads differently from a day that was mostly down. */
  --bar-up: #7fce96;
  --bar-degraded: #e4ae39;
  --bar-minor: #f08a4b;
  --bar-down: #ea4e45;
  --bar-none: rgba(255, 255, 255, 0.1);

  --r-2: 4px;
  --r-3: 6px;
  --r-4: 8px;
  --r-pill: 999px;

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text-mid);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-ring); color: var(--text-hi); }

[hidden] { display: none !important; }

a { color: var(--accent-hot); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 { color: var(--text-hi); line-height: 1.25; }
p { margin: 0; }

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Off-canvas until focused, so it stays focusable. */
.skip-link {
  position: fixed;
  left: 12px;
  top: -100%;
  z-index: 60;
  padding: 8px 16px;
  border-radius: var(--r-2);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 8px; outline: 2px solid var(--focus-ring); outline-offset: 2px; color: var(--on-accent); }
#main:focus { outline: none; }

/* ================================================================ header */

.top {
  border-bottom: 1px solid var(--hairline);
  background: var(--bg-0);
}
.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.brand-mark {
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 4px;
  background: var(--accent);
}
.top-link {
  font-size: 14px;
  color: var(--text-mid);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--r-3);
  white-space: nowrap;
}
.top-link:hover { color: var(--text-hi); background: var(--surface-raise); }

main.wrap { padding-top: 32px; padding-bottom: 48px; }

/* ================================================================ state colours */
/* One vocabulary for the banner, the pills and the incident tags. */

.state-ok   { --state: var(--ok);        --state-dim: var(--ok-dim);     --state-ring: var(--ok-ring); }
.state-warn { --state: var(--warn);      --state-dim: var(--warn-dim);   --state-ring: var(--warn-ring); }
.state-down { --state: var(--danger);    --state-dim: var(--danger-dim); --state-ring: var(--danger-ring); }
.state-none { --state: var(--text-dim);  --state-dim: var(--surface-raise); --state-ring: var(--hairline-strong); }

/* ================================================================ banner */

.banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border: 1px solid var(--state-ring);
  border-radius: var(--r-4);
  background: var(--state-dim);
}
.banner-dot {
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 50%;
  background: var(--state);
  box-shadow: 0 0 0 5px var(--state-dim);
}
.banner-title { margin: 0; font-size: 22px; font-weight: 650; }
.banner-note { margin-top: 4px; font-size: 14px; color: var(--text-mid); }

.meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-dim);
}

.notice {
  margin-top: 16px;
  padding: 10px 14px;
  border: 1px solid var(--warn-ring);
  border-radius: var(--r-3);
  background: var(--warn-dim);
  color: var(--text-hi);
  font-size: 14px;
}

/* ================================================================ sections */

.section { margin-top: 40px; }
.section > h2 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.empty { color: var(--text-dim); font-size: 14px; }
.fine { margin-top: 10px; font-size: 13px; color: var(--text-dim); }

/* ================================================================ components */

.comp {
  padding: 18px 20px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-4);
  background: var(--bg-1);
}
.comp + .comp { margin-top: 12px; }

.comp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.comp-name { margin: 0; font-size: 16px; font-weight: 600; }
.comp-desc { margin-top: 2px; font-size: 13px; color: var(--text-dim); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 3px 10px;
  border: 1px solid var(--state-ring);
  border-radius: var(--r-pill);
  background: var(--state-dim);
  color: var(--state);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.bars-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-dim);
}
.bars-uptime { font-family: var(--font-mono); font-size: 13px; color: var(--text-hi); }

.bars {
  display: flex;
  gap: 2px;
  height: 34px;
  margin-top: 8px;
}
.bar {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 2px;
  background: var(--bar-none);
  cursor: default;
}
.bar.is-up       { background: var(--bar-up); }
.bar.is-degraded { background: var(--bar-degraded); }
.bar.is-minor    { background: var(--bar-minor); }
.bar.is-down     { background: var(--bar-down); }
.bar:hover       { filter: brightness(1.25); }
.bar:focus       { outline: none; }
.bar:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

.bars-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-dim);
}
.scale-narrow { display: none; }

/* Phones: the last 30 days, so each bar stays wide enough to see and tap. */
@media (max-width: 599px) {
  .bar.old { display: none; }
  .scale-wide { display: none; }
  .scale-narrow { display: inline; }
  .comp { padding: 16px 14px 12px; }
  .banner { padding: 16px; gap: 14px; }
  .banner-title { font-size: 19px; }
  .meta { justify-content: flex-start; }
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--text-dim);
}
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.sw-up       { background: var(--bar-up); }
.sw-degraded { background: var(--bar-degraded); }
.sw-minor    { background: var(--bar-minor); }
.sw-down     { background: var(--bar-down); }
.sw-none     { background: var(--bar-none); }

/* ================================================================ tooltip */

.tip {
  position: fixed;
  z-index: 50;
  left: 0;
  top: 0;
  max-width: 240px;
  padding: 8px 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-3);
  background: var(--bg-2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-mid);
  pointer-events: none;
}
.tip-date { color: var(--text-hi); font-weight: 600; }

/* ================================================================ uptime table */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--hairline);
  border-radius: var(--r-4);
  background: var(--bg-1);
}
.uptime {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.uptime th,
.uptime td {
  padding: 10px 14px;
  text-align: right;
  border-bottom: 1px solid var(--hairline);
}
.uptime tr:last-child td { border-bottom: 0; }
.uptime th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}
.uptime th:first-child { text-align: left; }
.uptime tbody th {
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-hi);
  white-space: normal;
}
.uptime td { font-family: var(--font-mono); font-size: 13px; color: var(--text-mid); white-space: nowrap; }
.uptime td.empty { text-align: left; font-family: var(--font-ui); }

@media (max-width: 599px) {
  .uptime th,
  .uptime td { padding: 9px 7px; }
  .uptime td { font-size: 12px; }
  .uptime tbody th { font-size: 13px; }
}

/* ================================================================ incidents */

.incidents { margin: 0; padding: 0; list-style: none; }
.incidents > li + li { margin-top: 10px; }
.incident {
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-4);
  background: var(--bg-1);
}
.incident-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.incident-title { margin: 0; font-size: 15px; font-weight: 600; }
.incident-when { margin-top: 6px; font-size: 13px; color: var(--text-mid); }
.incident-long { margin-top: 2px; font-size: 13px; color: var(--text-dim); }

/* ================================================================ footer */

.foot {
  border-top: 1px solid var(--hairline);
  padding: 24px 0 40px;
  font-size: 13px;
  color: var(--text-dim);
}
.foot p + p { margin-top: 6px; }
.foot a { color: var(--text-mid); }
.foot a:hover { color: var(--text-hi); }

/* ================================================================ 404 */

.lost { padding-top: 72px; padding-bottom: 96px; }
.lost h1 { margin: 0; font-size: 24px; }
.lost p { margin-top: 10px; }

@media (prefers-reduced-motion: no-preference) {
  .top-link,
  .bar { transition: background-color 120ms ease, filter 120ms ease; }
}
