/* status.<portal_domain>. Loosely follows the portal's tokens
   (apps/portal/src/app/globals.css): Sora for headings, Inter for text, the
   teal brand colour, light by default and dark when the visitor prefers it.
   Colour is never the only signal: every state also has a text label, and
   every bar has a table row. */

@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Sora';
  src: url('/fonts/sora-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page: #f6f7fb;
  --surface: #ffffff;
  --border: #e2e5f0;
  --border-subtle: #eef0f7;
  --text: #1a1f36;
  --text-2: #4f566e;
  --text-3: #5f6780;
  --brand: #0d9488;
  --link: #0e7490;
  --focus: #0e7490;
  --up: #0f766e;
  --up-bg: #e6f4f1;
  --up-bar: #0d9488;
  --partial: #92400e;
  --partial-bg: #fcf0e8;
  --partial-bar: #d97706;
  --down: #be123c;
  --down-bg: #fdeaef;
  --down-bar: #be123c;
  --unknown: #4f566e;
  --unknown-bg: #eef0f8;
  --none-bar: #cfd3e3;
  --font-display: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #11141f;
    --surface: #181c2b;
    --border: #2c3350;
    --border-subtle: #232944;
    --text: #eef0fb;
    --text-2: #b6bdda;
    --text-3: #9aa0c0;
    --brand: #14b8a6;
    --link: #67e8f9;
    --focus: #67e8f9;
    --up: #5eead4;
    --up-bg: #10312c;
    --up-bar: #14b8a6;
    --partial: #fcd34d;
    --partial-bg: #2f2411;
    --partial-bar: #fbbf24;
    --down: #fda4af;
    --down-bg: #3a1722;
    --down-bar: #fb7185;
    --unknown: #b6bdda;
    --unknown-bg: #2a3047;
    --none-bar: #3a4160;
  }
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
}

a {
  color: var(--link);
  text-underline-offset: 2px;
}

a:focus-visible,
summary:focus-visible,
main:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

main:focus:not(:focus-visible) {
  outline: none;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0;
}

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

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  z-index: 10;
}

.skip:focus {
  top: 12px;
}

/* ── Header ── */

.top {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.top-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
}

.mark {
  color: var(--brand);
  flex-shrink: 0;
}

.mark-check {
  stroke: var(--surface);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.wordmark .cm {
  color: var(--brand);
}

.tag {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
}

/* ── Main ── */

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 16px 32px;
}

h1 {
  font-size: 1.875rem;
  margin-bottom: 8px;
}

h2 {
  font-size: 1.125rem;
  margin: 40px 0 12px;
}

.lede {
  color: var(--text-2);
  margin: 0 0 24px;
  max-width: 62ch;
}

.banner {
  border-radius: 12px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  background: var(--unknown-bg);
  color: var(--unknown);
}

.banner[data-tone='up'] {
  background: var(--up-bg);
  color: var(--up);
}

.banner[data-tone='down'] {
  background: var(--down-bg);
  color: var(--down);
}

.banner-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
}

.banner-detail {
  margin: 4px 0 0;
  font-size: 0.875rem;
  color: var(--text-2);
}

.banner-detail:empty {
  display: none;
}

.components {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.component {
  padding: 18px 20px;
}

.component + .component {
  border-top: 1px solid var(--border-subtle);
}

.component-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 12px;
}

.component h3 {
  font-size: 1rem;
  font-weight: 600;
}

.host {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--text-3);
}

.state {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--unknown);
}

.state .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
}

.state-up {
  color: var(--up);
}

.state-down {
  color: var(--down);
}

/* Down gets a square, so the state differs in shape as well as colour. */
.state-down .dot {
  border-radius: 2px;
}

.state-unknown .dot {
  background: transparent;
  border: 2px solid currentColor;
}

.bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2px;
  height: 28px;
}

.bar {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 2px;
  background: var(--none-bar);
}

.bar-up {
  background: var(--up-bar);
}

.bar-partial {
  background: var(--partial-bar);
}

.bar-down {
  background: var(--down-bar);
}

.bars-legend {
  display: flex;
  justify-content: space-between;
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: var(--text-3);
}

.figures {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text-2);
}

.checked {
  margin: 6px 0 0;
  font-size: 0.8125rem;
  color: var(--text-3);
}

.daily {
  margin-top: 10px;
  font-size: 0.875rem;
}

.daily summary {
  cursor: pointer;
  color: var(--link);
  width: fit-content;
}

.check {
  color: var(--text-2);
  margin: 10px 0;
  overflow-wrap: anywhere;
}

.table-wrap {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-variant-numeric: tabular-nums;
}

caption {
  text-align: left;
  padding: 8px 10px;
  color: var(--text-3);
}

th,
td {
  text-align: left;
  padding: 4px 10px;
  border-top: 1px solid var(--border-subtle);
  font-weight: 400;
}

thead th {
  font-weight: 600;
  position: sticky;
  top: 0;
  background: var(--surface);
}

.method ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-2);
  font-size: 0.9375rem;
}

.method li + li {
  margin-top: 8px;
}

.notice {
  color: var(--text-2);
}

.foot {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px 48px;
  color: var(--text-3);
  font-size: 0.875rem;
}

@media (max-width: 480px) {
  main {
    padding-top: 28px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .component {
    padding: 16px 14px;
  }

  .bars {
    gap: 1px;
  }
}
