/* status.strazzo.com
 *
 * Strazzo's own tokens (web/src/index.css: warm neutrals, near-black ink, colour only for
 * status) and the wordmark's own face, Instrument Sans 600, for the headline and names.
 *
 * One idea carries the page: QUIET UNLESS SOMETHING HAPPENED. A good day is a short grey
 * tick, not a green bar; a bad day stands up in colour. A calm page with nothing raised
 * is the answer, read before a single word. When something is wrong, the answer moves
 * into a tinted card with the owner's words beside it.
 *
 * test/brand.test.js holds the colour tokens to the app's. */

@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans.woff2") format("woff2-variations"), url("/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: oklch(0.985 0.004 80);
  --fg: oklch(0.22 0.006 75);
  --card: oklch(1 0 0);
  --muted: oklch(0.53 0.01 75);
  --line: oklch(0.91 0.005 80);
  --primary: oklch(0.245 0.006 75);
  --primary-fg: oklch(0.985 0.004 80);
  --ok: oklch(0.62 0.16 150);
  --warn: oklch(0.75 0.15 80);
  --down: oklch(0.585 0.2 27);
  --soft: oklch(0.96 0.005 80);
  --ring: oklch(0.65 0.01 75);
  --maint: oklch(0.62 0.11 245);
  --ok-ink: oklch(0.5 0.13 150);
  --warn-ink: oklch(0.5 0.11 70);
  --down-ink: oklch(0.52 0.19 27);
  --maint-ink: oklch(0.5 0.11 245);
  --tick: color-mix(in oklab, var(--fg) 17%, transparent);
  --gap: color-mix(in oklab, var(--fg) 7%, transparent);
  --display: "Instrument Sans", -apple-system, BlinkMacSystemFont, ui-sans-serif, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Geist", "Instrument Sans", ui-sans-serif, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* --dark-tokens (the app's .dark block) */
    --bg: oklch(0.17 0.005 75);
    --fg: oklch(0.955 0.003 80);
    --card: oklch(0.21 0.005 75);
    --muted: oklch(0.71 0.01 75);
    --line: oklch(1 0 0 / 9%);
    --primary: oklch(0.92 0.004 80);
    --primary-fg: oklch(0.22 0.006 75);
    --ok: oklch(0.7 0.15 150);
    --warn: oklch(0.8 0.14 80);
    --down: oklch(0.65 0.2 25);
    --soft: oklch(0.27 0.006 75);
    --ring: oklch(0.55 0.01 75);
    --maint: oklch(0.7 0.1 245);
    --ok-ink: oklch(0.76 0.13 150);
    --warn-ink: oklch(0.83 0.13 80);
    --down-ink: oklch(0.74 0.16 25);
    --maint-ink: oklch(0.76 0.09 245);
    --tick: color-mix(in oklab, var(--fg) 20%, transparent);
    --gap: color-mix(in oklab, var(--fg) 8%, transparent);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
:where(a, button, summary, input, select, textarea):focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }

.page { max-width: 720px; margin: 0 auto; padding: 28px 24px 56px; }

/* ── top ─────────────────────────────────────────────────────────────────────── */
.top { display: flex; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--primary); color: var(--primary-fg); }
.brand-mark .mark { height: 13px; width: auto; }
.brand .wordmark { height: 15px; width: auto; }
.top-label { color: var(--muted); font-size: 14px; padding-left: 12px; border-left: 1px solid var(--line); line-height: 18px; }
.top-link { margin-left: auto; font-size: 14px; color: var(--muted); }

/* ── the answer ──────────────────────────────────────────────────────────────── */
.now { margin-top: 72px; }
.pulse {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 13px 5px 10px; font-size: 13px; color: var(--muted);
}
.dot { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ok) 22%, transparent); }
.now[data-status="degraded"] .dot { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in oklab, var(--warn) 26%, transparent); }
.now[data-status="down"] .dot { background: var(--down); box-shadow: 0 0 0 3px color-mix(in oklab, var(--down) 22%, transparent); }
.now[data-status="maintenance"] .dot { background: var(--maint); box-shadow: 0 0 0 3px color-mix(in oklab, var(--maint) 22%, transparent); }
.now[data-status="unknown"] .dot { background: var(--muted); box-shadow: 0 0 0 3px color-mix(in oklab, var(--muted) 20%, transparent); }

h1 {
  font-family: var(--display); font-weight: 600; letter-spacing: -0.035em;
  font-size: clamp(2.1rem, 1.35rem + 3.3vw, 3.35rem); line-height: 1.04;
  margin: 20px 0 0; text-wrap: balance;
}
.detail { margin: 14px 0 0; font-size: 17px; line-height: 1.5; color: var(--muted); max-width: 34em; text-wrap: pretty; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 16px 0 0; font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.facts .none { color: var(--muted); font-weight: 400; }

/* Something is wrong: the answer moves into a card in its colour. */
.now:not([data-status="operational"]) {
  --tone: var(--muted);
  margin-top: 56px; padding: 24px 28px 26px; border-radius: 18px;
  background: color-mix(in oklab, var(--tone) 7%, var(--card));
  border: 1px solid color-mix(in oklab, var(--tone) 26%, var(--line));
}
.now[data-status="degraded"] { --tone: var(--warn); }
.now[data-status="down"] { --tone: var(--down); }
.now[data-status="maintenance"] { --tone: var(--maint); }
.now:not([data-status="operational"]) .pulse { background: var(--card); border-color: color-mix(in oklab, var(--tone) 22%, var(--line)); }
.now:not([data-status="operational"]) h1 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 2.8rem); }

.hero-updates { margin-top: 22px; padding-top: 4px; border-top: 1px solid color-mix(in oklab, var(--tone, var(--line)) 22%, var(--line)); }
.affects { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.hero-body { margin-top: 6px; }
.detail a { color: var(--fg); text-underline-offset: 3px; }

.updates { list-style: none; margin: 6px 0 0; padding: 0; }
.updates li { display: grid; grid-template-columns: 9.5rem 1fr; gap: 2px 18px; padding: 12px 0; }
.updates li + li { border-top: 1px solid var(--line); }
.u-meta { margin: 0; display: flex; flex-direction: column; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.u-state { color: var(--fg); font-weight: 600; }
.u-body { margin: 0; font-size: 15px; text-wrap: pretty; white-space: pre-line; }

/* ── sections ────────────────────────────────────────────────────────────────── */
.block { margin-top: 60px; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.block > .block-h:first-child { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.block-h { margin: 0; font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.block-note { margin: 0; font-size: 13px; color: var(--muted); }
.empty { margin: 16px 0 0; color: var(--muted); }

h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: -0.018em; line-height: 1.3; }
.about { margin: 2px 0 0; font-size: 14px; color: var(--muted); }

/* ── Strazzo's parts and their 90 days ───────────────────────────────────────── */
.parts, .services, .past { list-style: none; margin: 0; padding: 0; }
.part { padding: 22px 0 18px; border-bottom: 1px solid var(--line); }
.part-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }

.state { display: inline-flex; align-items: center; gap: 8px; flex: none; font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap; }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); transform: translateY(-1px); }
[data-status="degraded"] > * > .state, [data-status="degraded"] > .state, [data-status="slow"] > .state, [data-status="partial"] > .state { color: var(--warn-ink); }
[data-status="degraded"] > * > .state::before, [data-status="degraded"] > .state::before, [data-status="slow"] > .state::before, [data-status="partial"] > .state::before { background: var(--warn); }
[data-status="down"] > * > .state, [data-status="outage"] > .state { color: var(--down-ink); }
[data-status="down"] > * > .state::before, [data-status="outage"] > .state::before { background: var(--down); }
[data-status="maintenance"] > * > .state, [data-status="maintenance"] > .state { color: var(--maint-ink); }
[data-status="maintenance"] > * > .state::before, [data-status="maintenance"] > .state::before { background: var(--maint); }
[data-status="unknown"] > * > .state::before, [data-status="unknown"] > .state::before { background: var(--muted); opacity: 0.5; }

.note { margin: 12px 0 0; padding: 9px 12px; border-radius: 10px; background: var(--soft); font-size: 14px; }

.strip {
  display: grid; grid-template-columns: repeat(90, minmax(0, 1fr)); gap: 2px; align-items: end;
  height: 30px; margin-top: 16px;
}
.strip i { display: block; height: 8px; border-radius: 1.5px; background: var(--tick); }
.strip i[data-l="none"] { height: 2px; background: var(--gap); }
.strip i[data-l="maint"] { height: 14px; background: var(--maint); }
.strip i[data-l="degraded"] { height: 19px; background: var(--warn); }
.strip i[data-l="down"] { height: 30px; background: var(--down); }
.strip i:hover { background: var(--muted); }
.strip i[data-l="maint"]:hover, .strip i[data-l="degraded"]:hover, .strip i[data-l="down"]:hover { filter: brightness(0.88); }

.strip-foot { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.strip-foot .sum[data-bad] { color: var(--fg); }

/* ── services we connect to ──────────────────────────────────────────────────── */
.service { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.service h3 { font-size: 15px; }
.service .state:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }

/* ── incidents ───────────────────────────────────────────────────────────────── */
.incident { padding: 20px 0; border-bottom: 1px solid var(--line); }
.incident h3 { font-size: 18px; }
.i-meta { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.incident > .u-body { margin-top: 10px; }
.m-when { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--maint-ink); font-variant-numeric: tabular-nums; }

.past details { border-bottom: 1px solid var(--line); }
.past summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; padding: 14px 0; cursor: pointer; list-style: none; }
.past summary::-webkit-details-marker { display: none; }
.past summary:hover .p-title { text-decoration: underline; text-underline-offset: 3px; }
.p-title { font-weight: 500; }
.p-when { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.past details[open] { padding-bottom: 8px; }

/* ── footer ──────────────────────────────────────────────────────────────────── */
.foot { margin-top: 72px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.foot p { margin: 0 0 8px; max-width: 40em; }
.foot a { margin-right: 18px; text-underline-offset: 3px; }
.foot a:hover { color: var(--fg); }

/* ── admin ───────────────────────────────────────────────────────────────────── */
.admin-h1 { margin: 44px 0 0; font-size: 30px; }
.admin .block { margin-top: 40px; }
.admin-facts p { margin: 0 0 6px; font-size: 14px; }
.muted { color: var(--muted); font-size: 13px; }
.card { margin-top: 14px; padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.card > .muted:first-child { margin: 0 0 4px; }
.card summary { cursor: pointer; font-size: 14px; color: var(--muted); margin-top: 12px; }
details.card > summary { margin-top: 0; }
.form { display: grid; gap: 14px; margin-top: 18px; }
.form.inline { grid-template-columns: 1fr auto; align-items: end; }
.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.f-label { font-size: 13px; font-weight: 600; padding: 0; }
.f-hint { font-size: 12px; color: var(--muted); }
input, select, textarea {
  font: inherit; font-size: 14px; color: var(--fg); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%;
}
textarea { resize: vertical; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; }
.check input { width: auto; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.btn { justify-self: start; font: 600 14px/1 var(--sans); padding: 11px 16px; border-radius: 8px; border: 1px solid var(--primary); background: var(--primary); color: var(--primary-fg); cursor: pointer; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.danger { margin-top: 14px; display: grid; gap: 8px; }

/* ── phones ──────────────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .page { padding: 20px 16px 44px; }
  .now { margin-top: 44px; }
  .now:not([data-status="operational"]) { margin-top: 32px; padding: 20px 18px 22px; border-radius: 16px; }
  .detail { font-size: 16px; }
  .block { margin-top: 48px; }
  .updates li { grid-template-columns: 1fr; }
  .u-meta { flex-direction: row; gap: 10px; }
  .strip { gap: 1px; height: 26px; }
  .strip i[data-l="down"] { height: 26px; }
  .strip i[data-l="degraded"] { height: 17px; }
  .strip i[data-l="maint"] { height: 12px; }
  .row2, .form.inline { grid-template-columns: 1fr; }
}
