/* Orderain Status, the public page.
   The same compact, warm-neutral look as the dashboard and Felix Inbox.
   Three status colours, used for marks only and always with a word beside
   them: green = working, amber = degraded, red = outage. They were checked
   for colour-blind separation on both the light and the dark surface
   (#32d583 / #f5a524 / #d92d20: every pair apart for protan, deutan and
   tritan vision). Text never wears a status colour; it stays in ink. */
:root {
  --bg: #fafaf8; --surface: #ffffff; --raised: #ffffff;
  --ink: #1a1a1a; --text-2: #4b5563; --muted: #6b7280;
  --line: #e6e6e1; --hair: #f0f0ec; --fill: #f4f4f2;
  --ok: #32d583; --warn: #f5a524; --bad: #d92d20; --none: #e3e3de;
  --ok-wash: #e9fbf1; --warn-wash: #fff5df; --bad-wash: #fef0ee; --none-wash: #f4f4f2;
  /* The outline of a tinted panel: the tint, a step stronger. */
  --ok-edge: #c3efd5; --warn-edge: #f6dfa9; --bad-edge: #f5cdc7; --none-edge: #e6e6e1;
  /* What sits on top of a status fill: near-black or white, by how light the fill is. */
  --on-ok: #06301b; --on-warn: #3d2600; --on-bad: #ffffff; --on-none: #4b5563;
  --tip-bg: #1a1a1a; --tip-ink: #ffffff; --tip-muted: #b8b8b2;
  --shadow: 0 1px 2px rgba(26, 26, 26, 0.04), 0 12px 32px -16px rgba(26, 26, 26, 0.12);
  color-scheme: light;
}
/* The page is light for everyone, like the rest of Orderain: it does not follow
   a device's dark mode. A dark theme is drawn and checked, and is switched on
   by data-theme="dark" on <html> (nothing sets that yet). */
:root[data-theme="dark"] {
  --bg: #111110; --surface: #1a1a19; --raised: #222221;
  --ink: #f5f5f3; --text-2: #c4c4be; --muted: #94948e;
  --line: #2e2e2c; --hair: #252523; --fill: #232322;
  --none: #383836;
  --ok-wash: #12261b; --warn-wash: #2b2110; --bad-wash: #2d1614; --none-wash: #1f1f1e;
  --ok-edge: #1f4a31; --warn-edge: #54401a; --bad-edge: #5a2620; --none-edge: #2e2e2c;
  --on-none: #c4c4be;
  --tip-bg: #f5f5f3; --tip-ink: #1a1a1a; --tip-muted: #5c5c57;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -20px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* Served with the page: a status page should not depend on another site to look right. */
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/instrument-sans-latin.woff2') format('woff2');
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 22px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
svg { flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

/* Header */
.st-top { max-width: 920px; margin: 0 auto; padding: 22px 24px 6px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.st-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.st-logo { display: block; height: 26px; width: auto; }
.st-logo-dark { display: none; }
[data-theme="dark"] .st-logo-light { display: none; }
[data-theme="dark"] .st-logo-dark { display: block; }
.st-brand-tag { padding: 2px 9px; border-radius: 999px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; line-height: 18px; font-weight: 600; color: var(--text-2); }
.st-nav { display: flex; align-items: center; gap: 6px; font-size: 14px; line-height: 20px; }
.st-nav a { padding: 7px 12px; border-radius: 999px; text-decoration: none; color: var(--text-2); font-weight: 500; transition: background-color 140ms ease, color 140ms ease; }
.st-nav a:hover { background: var(--fill); color: var(--ink); }
.st-nav .st-nav-main { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); }

.st-main { max-width: 920px; margin: 0 auto; padding: 18px 24px 8px; display: flex; flex-direction: column; gap: 34px; }

/* The headline: one sentence that answers "is it working?", on a panel tinted
   all the way across in that state's colour, with "Live" at its far end. */
.st-hero {
  --mark: var(--none); --wash: var(--none-wash); --on: var(--on-none); --edge: var(--none-edge);
  display: flex; align-items: center; gap: 18px; padding: 24px 28px;
  border: 1px solid var(--edge); border-radius: 24px; background: var(--wash);
}
.st-hero.is-operational { --mark: var(--ok); --wash: var(--ok-wash); --on: var(--on-ok); --edge: var(--ok-edge); }
.st-hero.is-degraded { --mark: var(--warn); --wash: var(--warn-wash); --on: var(--on-warn); --edge: var(--warn-edge); }
.st-hero.is-outage { --mark: var(--bad); --wash: var(--bad-wash); --on: var(--on-bad); --edge: var(--bad-edge); }
.st-hero-icon { width: 46px; height: 46px; flex-shrink: 0; border-radius: 999px; background: var(--mark); color: var(--on); display: grid; place-items: center; }
.st-hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.st-hero h1 { font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
.st-hero p { font-size: 14px; line-height: 20px; color: var(--text-2); }
/* "Live", and when it was last checked. The small dot is the one thing on the page that moves. */
.st-live { flex-shrink: 0; padding-left: 22px; border-left: 1px solid var(--edge); display: flex; flex-direction: column; gap: 2px; white-space: nowrap; }
.st-live b { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; line-height: 20px; font-weight: 600; }
.st-live b i { position: relative; width: 8px; height: 8px; border-radius: 999px; background: var(--mark); }
.st-hero.is-unknown .st-live b i { background: var(--muted); }
.st-live b i::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit; animation: st-ping 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite; }
.st-hero.is-unknown .st-live b i::after { animation: none; }
@keyframes st-ping { 0% { transform: scale(1); opacity: 0.55; } 70%, 100% { transform: scale(3.2); opacity: 0; } }
.st-live span { font-size: 13px; line-height: 18px; color: var(--muted); }
.st-button { flex-shrink: 0; min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }

/* Sections */
.st-section { display: flex; flex-direction: column; gap: 12px; }
.st-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 0 4px; }
.st-section-head h2 { font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -0.01em; }
.st-note { font-size: 13px; line-height: 18px; color: var(--muted); }
.st-card { border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }

/* A word and a mark, together: the state is never carried by colour alone. */
.st-badge { display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.st-badge i { width: 18px; height: 18px; border-radius: 999px; display: grid; place-items: center; background: var(--ok); color: var(--on-ok); }
.st-badge.is-degraded i { background: var(--warn); color: var(--on-warn); }
.st-badge.is-outage i { background: var(--bad); color: var(--on-bad); }

/* One service */
.st-row { padding: 20px 24px 16px; display: flex; flex-direction: column; gap: 12px; }
.st-row + .st-row { border-top: 1px solid var(--hair); }
.st-row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.st-row-head h3 { min-width: 0; font-size: 15px; line-height: 22px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A bar per day. 2px of surface between neighbours; the bar under the pointer
   (or the arrow keys) lifts so the reader sees which day the box describes. */
.st-strip { display: flex; align-items: stretch; gap: 2px; height: 34px; border-radius: 6px; cursor: default; }
.st-bar { flex: 1 1 0; min-width: 0; border-radius: 3px; background: var(--none); transform-origin: 50% 100%; transition: transform 120ms ease, filter 120ms ease; forced-color-adjust: none; }
.st-bar.is-ok { background: var(--ok); }
.st-bar.is-degraded { background: var(--warn); }
.st-bar.is-outage { background: var(--bad); }
.st-bar.is-active { transform: scaleY(1.16); filter: brightness(0.9) saturate(1.1); }
[data-theme="dark"] .st-bar.is-active { filter: brightness(1.18); }
.st-row-foot { display: flex; align-items: center; gap: 12px; font-size: 12px; line-height: 16px; color: var(--muted); }
.st-row-foot i { flex: 1; height: 1px; background: var(--line); }

.st-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 12px; line-height: 16px; color: var(--muted); }
.st-legend li { display: inline-flex; align-items: center; gap: 6px; }
.st-legend .st-bar { flex: none; width: 6px; height: 14px; }

/* The one tooltip */
.st-tip { position: absolute; z-index: 20; top: 0; left: 0; max-width: 260px; padding: 8px 11px; border-radius: 11px; background: var(--tip-bg); color: var(--tip-ink); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.5); font-size: 13px; line-height: 18px; pointer-events: none; display: flex; flex-direction: column; }
.st-tip[hidden] { display: none; }
.st-tip strong { font-weight: 600; }
.st-tip span { font-size: 12px; line-height: 16px; color: var(--tip-muted); }

/* Incidents */
.st-incident { padding: 20px 24px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.st-incident.is-open { background: linear-gradient(120deg, var(--warn-wash) 0%, var(--surface) 55%); }
.st-incident.is-open.is-outage { background: linear-gradient(120deg, var(--bad-wash) 0%, var(--surface) 55%); }
.st-incident-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.st-incident-head h3 { font-size: 16px; line-height: 22px; font-weight: 600; text-wrap: balance; }
.st-incident-meta { font-size: 13px; line-height: 18px; color: var(--muted); }
.st-updates { margin-top: 10px; display: flex; flex-direction: column; }
.st-updates li { position: relative; padding: 0 0 14px 22px; }
.st-updates li:last-child { padding-bottom: 0; }
.st-updates li::before { content: ""; position: absolute; left: 3px; top: 7px; width: 8px; height: 8px; border-radius: 999px; background: var(--muted); box-shadow: 0 0 0 3px var(--surface); }
.st-updates li.is-resolved::before { background: var(--ok); }
.st-updates li::after { content: ""; position: absolute; left: 6.5px; top: 16px; bottom: -6px; width: 1px; background: var(--line); }
.st-updates li:last-child::after { display: none; }
.st-incident.is-open .st-updates li::before { box-shadow: none; }
.st-update-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.st-update-head b { font-size: 14px; line-height: 20px; font-weight: 600; }
.st-update-head time { font-size: 12px; line-height: 16px; color: var(--muted); }
.st-updates p { font-size: 14px; line-height: 21px; color: var(--text-2); }

.st-empty { padding: 26px 24px; display: flex; align-items: center; gap: 12px; color: var(--text-2); font-size: 14px; line-height: 20px; }
.st-empty-icon { width: 30px; height: 30px; flex-shrink: 0; border-radius: 999px; display: grid; place-items: center; background: var(--ok-wash); color: var(--ink); }

/* Footer */
.st-foot { max-width: 920px; margin: 0 auto; padding: 34px 28px 44px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 19px; color: var(--muted); }
.st-foot p:last-child { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.st-foot a { color: var(--text-2); text-decoration: none; font-weight: 500; }
.st-foot a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.st-noscript { max-width: 920px; margin: 0 auto; padding: 0 28px 30px; color: var(--muted); }

/* Loading: grey shapes that shimmer, never a blank page */
.st-skel { display: block; border-radius: 999px; background: linear-gradient(90deg, var(--fill) 0%, var(--line) 50%, var(--fill) 100%); background-size: 200% 100%; animation: st-shim 1.4s linear infinite; }
@keyframes st-shim { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.st-skel-icon { width: 46px; height: 46px; flex-shrink: 0; }
.st-skel-title { width: min(320px, 70%); height: 22px; }
.st-skel-line { width: min(220px, 50%); height: 12px; margin-top: 8px; }
.st-skel-name { width: 180px; height: 14px; }
.st-skel-strip { width: 100%; height: 34px; border-radius: 6px; }

@media (max-width: 620px) {
  .st-top { padding: 16px 16px 4px; }
  .st-nav a:not(.st-nav-main) { display: none; }
  .st-main { padding: 14px 14px 4px; gap: 28px; }
  .st-hero { padding: 20px; gap: 14px; border-radius: 22px; flex-wrap: wrap; }
  .st-hero-icon { width: 42px; height: 42px; }
  .st-hero-text { flex-basis: 0; }
  .st-hero h1 { font-size: 21px; line-height: 27px; }
  /* On a phone "Live" drops under the headline, across the full width. */
  .st-live { width: 100%; padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--edge); flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
  .st-row { padding: 18px 18px 14px; }
  .st-incident { padding: 18px; }
  .st-legend { gap: 12px; }
  .st-foot { padding: 28px 18px 36px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
