/* Status page ("the observation ward"). Builds on styles.css: same tokens, nav, buttons and both page states. */

.st-tag { padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 10px; }
.st { --warn: #c9820a; display: grid; gap: clamp(48px, 9vh, 104px); padding-block: clamp(22px, 4vh, 44px) 130px; }
:root[data-dose="on"] .st { --warn: #ffb020; }

@keyframes rise-in { from { opacity: 0; translate: 0 22px; } }

/* ---------- hero ---------- */
.st__hero { display: grid; gap: 18px; }
.st__hero > .eyebrow { animation: rise-in .6s cubic-bezier(.2, .8, .2, 1) backwards; }
.st__hero h1 { font: 800 clamp(44px, 9vw, 132px)/.92 "Unbounded", sans-serif; letter-spacing: -.06em; animation: rise-in .7s cubic-bezier(.2, .8, .2, 1) .05s backwards; }
:root[data-dose="on"] .st__hero h1 { color: var(--accent); text-shadow: 0 0 90px var(--glow); }

.vital { --tone: var(--signal); display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px; margin-top: 8px; padding: clamp(18px, 2.6vw, 26px); border: 1px solid color-mix(in srgb, var(--tone) 55%, var(--line)); border-radius: 24px; background: var(--bg-2); box-shadow: 0 0 80px -34px var(--tone); animation: rise-in .8s cubic-bezier(.2, .8, .2, 1) .12s backwards; transition: border-color .4s, box-shadow .4s; }
.vital[data-state="update"] { --tone: var(--warn); }
.vital[data-state="off"] { --tone: var(--muted); box-shadow: none; }
.vital__dot { position: relative; flex: none; width: 54px; height: 54px; }
.vital__dot i { position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border-radius: 50%; background: var(--tone); }
.vital__dot i:first-child { animation: beat 1s cubic-bezier(.2, .8, .2, 1) infinite; }
.vital__dot i:last-child { background: none; border: 2px solid var(--tone); animation: ripple 1s ease-out infinite; }
.vital[data-state="off"] .vital__dot i { animation: none; }
.vital[data-state="off"] .vital__dot i:last-child { display: none; }
@keyframes beat { 0%, 100% { scale: 1; } 12% { scale: 1.45; } 26% { scale: .92; } 40% { scale: 1.18; } }
@keyframes ripple { from { scale: 1; opacity: .8; } to { scale: 2.7; opacity: 0; } }
.vital__text { display: grid; gap: 6px; min-width: 0; margin-right: auto; }
.vital__text strong { font: 600 clamp(20px, 3vw, 36px)/1.05 "Unbounded", sans-serif; letter-spacing: -.045em; }
.vital__text span { color: var(--muted); font-size: 15px; }
.vital__check { display: flex; align-items: center; gap: 14px; }
.clock { position: relative; flex: none; width: 44px; height: 44px; }
.clock svg { width: 100%; height: 100%; rotate: -90deg; }
.clock circle { fill: none; stroke-width: 3; }
.clock__bg { stroke: var(--line); }
.clock__fg { stroke: var(--tone); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.clock b { position: absolute; inset: 0; display: grid; place-items: center; font: 600 11px/1 "JetBrains Mono", monospace; font-variant-numeric: tabular-nums; }
.vital__when { display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
.vital__when b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- sections ---------- */
.st__section { display: grid; gap: clamp(18px, 3vh, 28px); }
.st__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px; }
.st__head h2 { font: 600 clamp(24px, 3.6vw, 46px)/1.02 "Unbounded", sans-serif; letter-spacing: -.045em; }
.st__head p { color: var(--muted); font-size: 15px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 5px; height: 14px; border-radius: 99px; background: var(--signal); }
.legend i[data-k="update"] { background: var(--warn); }

/* ---------- the board: one monitor per product ---------- */
.board { position: relative; display: grid; gap: 12px; }
/* a scan line crosses the board on every check */
.board::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 70px; pointer-events: none; background: linear-gradient(transparent, color-mix(in srgb, var(--signal) 22%, transparent), transparent); opacity: 0; }
.board.is-scan::after { animation: scan 1s cubic-bezier(.4, 0, .6, 1); }
@keyframes scan { 0% { opacity: 1; top: -70px; } 100% { opacity: 1; top: 100%; } }

.mon { --tone: var(--signal); position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(170px, 1.1fr) minmax(0, 2.2fr) minmax(210px, 1.3fr); align-items: center; gap: clamp(14px, 2.4vw, 30px); padding: 18px 20px 18px 32px; border: 1px solid var(--line); border-radius: 20px; background: var(--bg-2); transition: border-color .25s, translate .35s cubic-bezier(.2, .8, .2, 1); }
.mon::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 12px; background: var(--tone); transition: background-color .4s; }
.mon[data-state="update"] { --tone: var(--warn); }
.mon[data-state="off"] { --tone: var(--muted); }
.mon:hover { border-color: var(--ink); translate: 0 -3px; }
.mon__who { display: grid; gap: 8px; min-width: 0; }
.mon__who > .mono { color: var(--muted); font-size: 10px; }
.mon__who a { font: 600 clamp(18px, 2vw, 24px)/1.05 "Unbounded", sans-serif; letter-spacing: -.04em; transition: color .2s; }
.mon__who a:hover { color: var(--tone); }
.status i { background: var(--tone); }
:root[data-dose="on"] .mon[data-state="ok"] .status i, :root[data-dose="on"] .svc[data-state="ok"] .status i { box-shadow: 0 0 10px var(--tone); }
.mon[data-state="off"] .status i { background: none; box-shadow: inset 0 0 0 1.5px var(--muted); }

.mon__ecg { position: relative; height: 62px; border-radius: 10px; background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 15.5px, linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 15.5px 100%; overflow: hidden; }
.mon__ecg canvas { display: block; width: 100%; height: 100%; }

.mon__days { display: grid; gap: 8px; }
.bars { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; height: 30px; }
.bars i { border-radius: 99px; background: var(--signal); transform-origin: 50% 100%; animation: bar-in .5s cubic-bezier(.2, 1.5, .4, 1) backwards; animation-delay: calc(var(--i) * 14ms + .2s); transition: scale .2s, opacity .2s; }
.bars i[data-k="update"] { background: var(--warn); }
.bars i:hover { scale: 1 1.25; }
:root[data-dose="off"] .bars i { background: var(--muted); opacity: .35; }
@keyframes bar-in { from { scale: 1 0; opacity: 0; } }
.mon__nums { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; color: var(--muted); font-size: 10px; }
.mon__nums span { white-space: nowrap; }
.mon__nums b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.mon__bell { justify-self: start; padding: 7px 12px; border: 1px solid var(--line); border-radius: 99px; background: none; color: var(--muted); font-size: 10px; transition: border-color .2s, color .2s, background-color .2s; }
.mon__bell:hover { border-color: var(--tone); color: var(--ink); }
.mon__bell[aria-pressed="true"] { border-color: var(--tone); background: color-mix(in srgb, var(--tone) 16%, transparent); color: var(--ink); }

/* ---------- services ---------- */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.svc { --tone: var(--signal); display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-2); animation: rise-in .6s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i) * 60ms); }
.svc[data-state="off"] { --tone: var(--muted); }
.svc b { font: 600 18px/1.1 "Unbounded", sans-serif; letter-spacing: -.04em; }
.svc p { color: var(--muted); font-size: 13px; }
.svc__line { height: 3px; border-radius: 99px; background: var(--line); overflow: hidden; }
.svc__line i { display: block; height: 100%; width: 40%; border-radius: inherit; background: var(--tone); animation: slide 2.4s cubic-bezier(.5, 0, .5, 1) infinite; animation-delay: calc(var(--i) * -400ms); }
.svc[data-state="off"] .svc__line i { animation: none; width: 0; }
@keyframes slide { from { translate: -100% 0; } to { translate: 250% 0; } }

/* ---------- history ---------- */
.chart { position: relative; margin: 0; padding: 0 0 0 26px; list-style: none; display: grid; }
.chart::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.chart li { position: relative; display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 4px 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.chart li:last-child { border-bottom: 0; }
.chart li::before { content: ""; position: absolute; left: -26px; top: 20px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--signal); }
.chart li[data-k="update"]::before { border-color: var(--warn); background: var(--warn); }
.chart time { color: var(--muted); font: 400 11px/1.9 "JetBrains Mono", monospace; letter-spacing: .06em; text-transform: uppercase; }
.chart b { font-weight: 600; }
.chart span { color: var(--muted); }
.chart a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- toast ---------- */
.toast { position: fixed; right: var(--gut); bottom: var(--gut); z-index: 90; max-width: min(420px, calc(100% - 2 * var(--gut))); padding: 14px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: 14px; opacity: 0; translate: 0 16px; pointer-events: none; transition: opacity .3s ease, translate .35s cubic-bezier(.2, 1.4, .4, 1); }
.toast.is-on { opacity: 1; translate: 0 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .mon { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .mon__ecg { grid-column: 1 / -1; grid-row: 2; }
  .st-tag { display: none; }
}
@media (max-width: 560px) {
  .mon { grid-template-columns: 1fr; padding: 16px 16px 16px 28px; }
  .mon__ecg { grid-row: auto; }
  .chart li { grid-template-columns: 1fr; }
  .vital__check { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .st__hero > .eyebrow, .st__hero h1, .vital, .vital__dot i, .bars i, .svc, .svc__line i, .board.is-scan::after { animation: none !important; }
  .mon, .clock__fg, .toast { transition: none; }
}
