:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #f1efe9;
  --ink: #14130f;
  --ink-2: #4d4b43;
  --ink-3: #85827a;
  --line: rgba(20, 19, 15, 0.09);
  --line-2: rgba(20, 19, 15, 0.16);
  --good: #0ca30c;
  --good-text: #006300;
  --warn: #fab219;
  --warn-text: #6d4a00;
  --bad: #d03b3b;
  --bad-text: #a62424;
  --serious: #ec835a;
  --muted: #b5b2a8;
  --track: #e6e4dd;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 19, 15, 0.04), 0 8px 24px -16px rgba(20, 19, 15, 0.18);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211;
    --surface: #1a1a19;
    --surface-2: #222220;
    --ink: #f2f1ec;
    --ink-2: #b8b6ad;
    --ink-3: #7f7d75;
    --line: rgba(255, 255, 255, 0.08);
    --line-2: rgba(255, 255, 255, 0.16);
    --good-text: #3ec43e;
    --warn-text: #ffc83d;
    --bad-text: #ff7b7b;
    --muted: #5b5a54;
    --track: #2c2c2a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -16px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  --bg: #121211; --surface: #1a1a19; --surface-2: #222220; --ink: #f2f1ec; --ink-2: #b8b6ad;
  --ink-3: #7f7d75; --line: rgba(255,255,255,0.08); --line-2: rgba(255,255,255,0.16);
  --good-text: #3ec43e; --warn-text: #ffc83d; --bad-text: #ff7b7b; --muted: #5b5a54; --track: #2c2c2a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }

/* top bar */
.top { position: sticky; top: 0; z-index: 5; backdrop-filter: saturate(140%) blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--line); }
.row { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.brand { font-weight: 700; letter-spacing: -0.02em; font-size: 17px; display: inline-flex; align-items: center; gap: 10px; }
.brand .tld { color: var(--ink-3); font-weight: 500; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 0%, transparent); transition: background .3s; }
.dot.good { background: var(--good); box-shadow: 0 0 0 4px rgba(12,163,12,.15); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 4px rgba(250,178,25,.18); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 4px rgba(208,59,59,.18); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(208,59,59,.08); } }
.meta { display: flex; align-items: center; gap: 14px; color: var(--ink-3); font-size: 13px; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.pill-muted { background: var(--surface-2); color: var(--ink-3); }
.pill-live { background: rgba(12,163,12,.12); color: var(--good-text); }
.pill-snap { background: rgba(250,178,25,.16); color: var(--warn-text); }
.pill.up { background: rgba(12,163,12,.12); color: var(--good-text); }
.pill.grace { background: rgba(250,178,25,.18); color: var(--warn-text); }
.pill.down { background: rgba(208,59,59,.12); color: var(--bad-text); }
.pill.started { background: rgba(236,131,90,.16); color: #8a3b1c; }
.pill.new, .pill.paused, .pill.unprovisioned { background: var(--surface-2); color: var(--ink-3); }

/* hero */
.hero { padding: 56px 0 28px; }
.eyebrow { margin: 0 0 10px; color: var(--ink-3); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
h1 { margin: 0; font-size: clamp(34px, 5.2vw, 56px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 700; }
.lede { margin: 14px 0 0; max-width: 62ch; color: var(--ink-2); font-size: 17px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 28px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tile .label { font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; }
.tile .value { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; display: flex; align-items: baseline; gap: 8px; }
.tile .value small { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.tile.good .value { color: var(--good-text); }
.tile.warn .value { color: var(--warn-text); }
.tile.bad .value { color: var(--bad-text); }

/* sections */
.sec { font-size: 15px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-2); margin: 44px 0 14px; display: flex; align-items: baseline; gap: 10px; }
.sec .sub { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink-3); font-size: 13px; }
.help { margin: -6px 0 14px; color: var(--ink-3); font-size: 14px; }
.group { margin-top: 40px; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.group-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; font-weight: 700; }
.group-head p { margin: 4px 0 0; color: var(--ink-2); max-width: 70ch; font-size: 15px; }
.group-health { font-size: 13px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.group-health.good { color: var(--good-text); }
.group-health.bad { color: var(--bad-text); }
.group-health.warn { color: var(--warn-text); }

/* callout */
.callout { margin-top: 28px; padding: 16px 18px; border-radius: var(--radius); background: rgba(208,59,59,.08); border: 1px solid rgba(208,59,59,.25); color: var(--ink); font-size: 15px; }
.callout strong { color: var(--bad-text); }
.callout.warn { background: rgba(250,178,25,.12); border-color: rgba(250,178,25,.4); }
.callout.warn strong { color: var(--warn-text); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: border-color .2s; }
.card:hover { border-color: var(--line-2); }
.card.open { grid-column: 1 / -1; }
.card-head { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 14px 16px 10px; cursor: pointer; font: inherit; color: inherit; }
.card-head:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.status-ico { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); margin-left: 4px; }
.status-ico.up { background: var(--good); }
.status-ico.grace { background: var(--warn); }
.status-ico.down { background: var(--bad); }
.status-ico.started { background: var(--serious); }
.card-title { display: flex; flex-direction: column; min-width: 0; }
.card-title .name { font-weight: 600; font-size: 15.5px; letter-spacing: -0.01em; }
.card-title .cadence { color: var(--ink-3); font-size: 13px; }
.card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.card-right .last { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.bar { height: 6px; margin: 0 16px 14px; border-radius: 4px; background: var(--track); display: flex; overflow: hidden; gap: 1px; }
.bar span { height: 100%; min-width: 1px; }
.bar .u { background: var(--good); }
.bar .d { background: var(--bad); }
.bar .n { background: var(--track); }
.card-body { padding: 0 16px 18px; border-top: 1px solid var(--line); }
.card-body .cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; padding-top: 16px; }
@media (max-width: 760px) { .card-body .cols { grid-template-columns: 1fr; gap: 12px; } }
.card-body h4 { margin: 14px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; }
.card-body h4:first-child { margin-top: 0; }
.card-body p { margin: 0 0 8px; color: var(--ink-2); font-size: 15px; }
.card-body ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14.5px; }
.card-body li { margin: 2px 0; }
.card-body code { font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; color: var(--ink); }
.now { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); margin-top: 16px; font-size: 15px; }
.now.down { background: rgba(208,59,59,.08); }
.now.grace { background: rgba(250,178,25,.12); }
.now strong { font-weight: 600; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; }
.fact { font-size: 13px; color: var(--ink-2); }
.fact b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; margin-bottom: 2px; }
.incidents { list-style: none; padding: 0; margin: 0; }
.incidents li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.incidents li:last-child { border-bottom: 0; }
.incidents .dur { color: var(--bad-text); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.incidents .ongoing { color: var(--bad-text); }

/* attention cards (diagnosis first) */
.attn { background: var(--surface); border: 1px solid rgba(208,59,59,.3); border-left: 4px solid var(--bad); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.attn.grace { border-color: rgba(250,178,25,.5); border-left-color: var(--warn); }
.attn.unprovisioned, .attn.new { border-color: var(--line-2); border-left-color: var(--muted); }
.attn .head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.attn .head h3 { margin: 0; font-size: 17px; letter-spacing: -0.01em; }
.attn .since { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.attn .diag { margin: 10px 0 0; font-size: 15.5px; }
.attn .diag strong { font-weight: 600; }
.attn .means { margin: 8px 0 0; color: var(--ink-2); font-size: 14.5px; }
.attn .look { margin: 10px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 13.5px; }
.attn .jump { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line-2); }

/* day clock */
.dayclock { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px 10px; box-shadow: var(--shadow); overflow: hidden; }
.dc-axis { position: relative; height: 26px; border-bottom: 1px solid var(--line-2); }
.dc-hour { position: absolute; top: 0; font-size: 11px; color: var(--ink-3); transform: translateX(-50%); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dc-hour:first-child { transform: none; }
.dc-hour:last-child { transform: translateX(-100%); }
.dc-hour:first-child::after { left: 0; }
.dc-hour:last-child::after { left: auto; right: 0; }
.dc-hour::after { content: ""; position: absolute; left: 50%; bottom: -8px; height: 6px; width: 1px; background: var(--line-2); }
.dc-rows { position: relative; }
.dc-row { position: relative; height: 30px; }
.dc-mark { position: absolute; top: 6px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; color: var(--ink-2); }
.dc-mark i { width: 10px; height: 10px; border-radius: 50%; background: var(--good); flex: none; }
.dc-mark.down i { background: var(--bad); }
.dc-mark.grace i { background: var(--warn); }
.dc-mark.unprovisioned i, .dc-mark.new i { background: var(--muted); }
.dc-mark.right { transform: translateX(-100%); flex-direction: row-reverse; }
.dc-mark.right span { text-align: right; }
.dc-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); opacity: .7; }
.dc-now::before { content: "now"; position: absolute; top: -2px; left: 6px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.intervals { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.ivl { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; }
.ivl b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 6px; }
.ivl span { display: inline-flex; align-items: center; gap: 6px; margin: 2px 10px 2px 0; color: var(--ink-2); }
.ivl i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.ivl .down i { background: var(--bad); } .ivl .grace i { background: var(--warn); } .ivl .unprovisioned i, .ivl .new i { background: var(--muted); }

/* glossary */
.gloss { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin: 0; }
.gloss div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.gloss dt { font-weight: 600; font-size: 14px; }
.gloss dt code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }
.gloss dd { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }

.foot { padding: 48px 16px 40px; color: var(--ink-3); font-size: 13px; }
.foot p { margin: 4px 0; }

@media (max-width: 600px) {
  .hero { padding-top: 36px; }
  .card-head { grid-template-columns: 14px 1fr; }
  .card-right { grid-column: 2; flex-direction: row; align-items: center; gap: 10px; }
  .cards { grid-template-columns: 1fr; }
  .meta #clock { display: none; }
}
