/* Course Manager status page. Tokens are the product's (DESIGN.md): plum ink, gold, paper. No webfont, no third-party request. */
:root {
  --plum: #2d1c3d;
  --plum-soft: #efe8f6;
  --ink-2: #4d3f5a;
  --dim: #6b6175;
  --gold: #b27b0e;
  --gold-ink: #85590a;
  --gold-soft: #f7edd6;
  --paper: #f6f2ea;
  --card: #ffffff;
  --line: #e7e0e4;
  --line-strong: #d5cbd5;
  --ok: #067647;
  --ok-soft: #e4f4ea;
  --rose: #9c3550;
  --rose-soft: #f8e6eb;
  --focus: #2d1c3d;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--plum);
  font: 16px/1.5 "Host Grotesk", Inter, system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--plum); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.muted { color: var(--dim); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--plum); color: #fff; padding: 10px 14px; border-radius: 10px; z-index: 5; }
.skip:focus { left: 8px; }

.top, main, .foot { width: min(760px, 100% - 40px); margin-inline: auto; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 0 6px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -0.02em; font-size: 1.1rem; }
.lang { display: flex; gap: 4px; }
.lang a { text-decoration: none; font-weight: 600; font-size: 0.8rem; letter-spacing: 0.04em; padding: 7px 11px; border-radius: 999px; color: var(--ink-2); }
.lang a[aria-current="true"] { background: var(--plum); color: #fff; }
.lang a:not([aria-current="true"]):hover { background: var(--plum-soft); }

main { flex: 1; padding-bottom: 28px; }
h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem); line-height: 1.1; letter-spacing: -0.03em; margin: 22px 0 18px; }
h2 { font-size: 1.15rem; letter-spacing: -0.015em; margin: 34px 0 12px; }

.overall { display: flex; gap: 16px; align-items: center; padding: 20px 22px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.overall-mark { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; color: #fff; background: var(--dim); }
.overall-title { margin: 0; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; }
.overall-sub { margin: 2px 0 0; color: var(--ink-2); }
.overall.is-operational { background: var(--ok-soft); border-color: #b9e0c8; }
.overall.is-operational .overall-mark { background: var(--ok); }
.overall.is-partial { background: var(--gold-soft); border-color: #ecd6a0; }
.overall.is-partial .overall-mark { background: var(--gold-ink); }
.overall.is-outage { background: var(--rose-soft); border-color: #eec3cf; }
.overall.is-outage .overall-mark { background: var(--rose); }

.notice { margin-top: 14px; padding: 16px 20px; border-radius: 14px; background: var(--plum-soft); border: 1px solid var(--line-strong); }
.notice[data-level="incident"] { background: var(--rose-soft); border-color: #eec3cf; }
.notice[data-level="maintenance"] { background: var(--gold-soft); border-color: #ecd6a0; }
.notice-title { margin: 0; font-weight: 700; }
.notice-body { margin: 4px 0 0; color: var(--ink-2); white-space: pre-line; }

.components, .incidents { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.components { margin-top: 14px; }
.component { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; }
.component-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.component-head > div { min-width: 0; }
.component-name { margin: 0; font-weight: 700; letter-spacing: -0.015em; }
.component-desc { margin: 0; color: var(--dim); font-size: 0.9rem; }
.pill { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 700; padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.s-up { color: var(--ok); background: var(--ok-soft); }
.pill.s-degraded { color: var(--gold-ink); background: var(--gold-soft); }
.pill.s-down { color: var(--rose); background: var(--rose-soft); }
.pill.s-unknown, .pill.s-paused { color: var(--dim); background: #efeaf0; }

.bars { display: flex; gap: 2px; height: 34px; margin-top: 14px; align-items: stretch; }
.bar { flex: 1 1 0; min-width: 2px; border-radius: 3px; background: #e9e3ea; }
.bar.d-ok { background: var(--ok); }
.bar.d-minor { background: #7db38f; }
.bar.d-warn { background: var(--gold); }
.bar.d-bad { background: var(--rose); }
.bar.d-none { background: #e9e3ea; }
.bars-legend { display: flex; justify-content: space-between; margin-top: 6px; font-size: 0.78rem; color: var(--dim); }
.component-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 4px; font-size: 0.85rem; color: var(--ink-2); }

.incident { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.incident-what { font-weight: 600; }
.incident-when { color: var(--dim); font-size: 0.9rem; }
.updated { margin: 26px 0 0; font-size: 0.85rem; }
.load-error { margin-top: 12px; padding: 12px 16px; border-radius: 12px; background: var(--rose-soft); color: var(--rose); font-weight: 600; }

.foot { padding: 6px 0 34px; font-size: 0.88rem; }
.foot p { margin: 4px 0; }
.foot a { white-space: nowrap; }

@media (max-width: 520px) {
  .overall { padding: 16px; }
  .component { padding: 16px; }
  .bars { height: 28px; gap: 1px; }
}
@media (prefers-reduced-motion: no-preference) {
  .overall, .pill, .bar { transition: background-color 0.3s ease, color 0.3s ease; }
}
