/* Foxcore public state page.
 * The state is the object: one large readout, four square surface marks, and
 * nothing that behaves like a badge. Brand tokens only; no new palette.
 */

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

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --state-ok: #1c6b3f;
  --state-warn: #8a4b00;
  --state-bad: #a11d1d;
  --state-muted: #6e675d;
  --pad: clamp(20px, 5vw, 48px);
}

[data-theme="dark"] {
  color-scheme: dark;

  --state-ok: #7fd3a0;
  --state-warn: #f0b36a;
  --state-bad: #f08a84;
  --state-muted: #b7a99a;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(247, 103, 7, 0.18);
}

body {
  margin: 0;
  background: var(--fc-bg);
  color: var(--fc-fg);
  font-family: var(--fc-font-display);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--fc-tint);
  color: var(--fc-fg);
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover {
  color: var(--fc-accent-text);
}

:focus-visible {
  outline: 2px solid var(--fc-orange);
  outline-offset: 3px;
}

main:focus {
  outline: none;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

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

.skip {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 10;
  padding: 10px 12px;
  background: var(--fc-fg);
  color: var(--fc-bg);
  font-family: var(--fc-font-display);
  font-size: 13px;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip:focus {
  transform: translateY(0);
}

.mono {
  font-family: var(--fc-font-mono);
  font-variant-numeric: tabular-nums;
}

/* ── masthead ────────────────────────────────────────────────────── */

.topbar {
  padding: 26px 0;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.masthead {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.masthead__mark {
  display: block;
  width: 140px;
  height: auto;
}

.masthead__mark--dark {
  display: none;
}

html[data-theme="dark"] .masthead__mark--light {
  display: none;
}

html[data-theme="dark"] .masthead__mark--dark {
  display: block;
}

.host {
  margin: 0;
  font-family: var(--fc-font-mono);
  font-size: 11.5px;
  letter-spacing: 0.01em;
  color: var(--fc-muted);
  white-space: nowrap;
}

/* ── the state readout ───────────────────────────────────────────── */

.banner {
  margin: 0;
  padding: 72px 0 0;
  border-top: 4px solid var(--banner-state, var(--fc-fg));
}

.banner--ok {
  --banner-state: var(--state-ok);
}

.banner--warn {
  --banner-state: var(--state-warn);
}

.banner--muted {
  --banner-state: var(--state-muted);
}

.banner__state {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(56px, 9.4vw, 128px);
  font-weight: 640;
  line-height: 0.9;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.banner__detail {
  margin: 30px 0 0;
  max-width: 52ch;
  color: var(--fc-fg-soft);
  font-size: 18px;
  line-height: 1.5;
}

/* ── surfaces ────────────────────────────────────────────────────── */

.surfaces {
  margin: 76px 0 0;
}

.surfaces__head {
  display: grid;
  gap: 8px;
  margin-bottom: 28px;
}

.surfaces__head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.surfaces__note {
  margin: 0;
  max-width: 56ch;
  color: var(--fc-muted);
  font-size: 14px;
  line-height: 1.5;
}

.board {
  border-top: 1px solid var(--fc-fg);
}

.board table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.board caption {
  caption-side: top;
  text-align: left;
}

.board thead th {
  padding: 10px 16px 10px 0;
  border-bottom: 1px solid var(--fc-line);
  font-family: var(--fc-font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  color: var(--fc-muted);
}

.board thead th:first-child {
  padding-left: 19px;
}

.board thead th:nth-child(1) {
  width: 26%;
}
.board thead th:nth-child(2) {
  width: 18%;
}
.board thead th:nth-child(3) {
  width: 25%;
}
.board thead th:nth-child(4) {
  width: 31%;
}

.board tbody th,
.board tbody td {
  padding: 24px 16px 24px 0;
  border-bottom: 1px solid var(--fc-line);
  text-align: left;
  vertical-align: top;
}

.board tbody th {
  padding-left: 16px;
  border-left: 3px solid var(--row-state, var(--state-muted));
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.board tbody tr[data-state="operational"] {
  --row-state: var(--state-ok);
}

.board tbody tr[data-state="degraded"] {
  --row-state: var(--state-bad);
}

.board tbody tr[data-state="unknown"] {
  --row-state: var(--state-muted);
}

.board tbody td {
  color: var(--fc-fg-soft);
  font-size: 14px;
}

.board tbody td time {
  font-family: var(--fc-font-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--fc-muted);
}

.board tbody td:last-child {
  padding-right: 0;
  max-width: 36ch;
  font-size: 13.5px;
  line-height: 1.45;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fc-fg);
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
}

.state::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  background: var(--row-state, var(--state-muted));
}

.muted {
  color: var(--fc-muted);
}

/* A stale or unknown page keeps the last known rows visible but never dresses
 * them as a current claim. */
html[data-freshness="stale"] .board tbody tr,
html[data-freshness="unknown"] .board tbody tr {
  --row-state: var(--state-muted);
}

.board-collapse {
  border-bottom: 1px solid var(--fc-line);
}

.board-collapse > summary {
  padding: 14px 0;
  cursor: pointer;
  font-size: 14px;
  color: var(--fc-muted);
}

.board-collapse > summary:hover {
  color: var(--fc-fg);
}

.board-collapse[open] > summary {
  border-bottom: 1px solid var(--fc-line);
}

.board-collapse .board {
  border-top: 0;
}

/* ── footer ──────────────────────────────────────────────────────── */

.footer {
  margin-top: 96px;
  padding: 28px 0 56px;
  border-top: 1px solid var(--fc-fg);
}

.footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 32px;
  align-items: start;
}

.footer__scope {
  margin: 0;
  max-width: 52ch;
  color: var(--fc-fg-soft);
  font-size: 14px;
  line-height: 1.55;
}

.footer__console {
  margin: 0;
  font-size: 14px;
  white-space: nowrap;
}

.footer__console a {
  text-decoration: underline;
}

.footer__meta {
  grid-column: 1 / -1;
  margin: 10px 0 0;
  color: var(--fc-muted);
  font-family: var(--fc-font-mono);
  font-size: 11.5px;
  line-height: 1.7;
}

/* ── mobile ──────────────────────────────────────────────────────── */

@media (max-width: 760px) {
  .topbar {
    padding: 20px 0;
  }

  .masthead__mark {
    width: 118px;
  }

  .host {
    display: none;
  }

  .banner {
    padding-top: 52px;
  }

  .banner__state {
    max-width: 11ch;
    font-size: clamp(46px, 13.5vw, 76px);
  }

  .banner__detail {
    margin-top: 22px;
    font-size: 16px;
  }

  .surfaces {
    margin-top: 64px;
  }

  .board table,
  .board tbody {
    display: block;
  }

  .board thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .board tbody tr {
    display: block;
    padding: 20px 0 20px 16px;
    border-left: 3px solid var(--row-state, var(--state-muted));
    border-bottom: 1px solid var(--fc-line);
  }

  .board tbody th {
    display: block;
    padding: 0 0 10px;
    border: 0;
    font-size: 22px;
  }

  .board tbody td {
    display: block;
    padding: 3px 0;
    border: 0;
    font-size: 14px;
  }

  .board tbody td:last-child {
    padding-right: 0;
    max-width: none;
  }

  .board tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--fc-muted);
    font-size: 11px;
    line-height: 1.3;
  }

  .footer {
    margin-top: 64px;
  }

  .footer__inner {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .footer__meta {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
