/* Public status overview with 90-day history.
   Light values follow the website, dark values the thin client surfaces; status colours are
   intentionally not the brand colour; typeface IBM Plex Sans/Mono (brand decisions in Formavis-Docs). */

@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("/brand/fonts/IBMPlexSans-Regular-Latin1.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("/brand/fonts/IBMPlexSans-Medium-Latin1.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("/brand/fonts/IBMPlexSans-SemiBold-Latin1.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("/brand/fonts/IBMPlexMono-Regular-Latin1.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("/brand/fonts/IBMPlexMono-Medium-Latin1.woff2") format("woff2"); }

:root {
  --ground: #f6f7f5;
  --surface: rgb(255 255 255 / 0.94);
  --surface-solid: #ffffff;
  --border: #e2e6e0;
  --ink: #15211c;
  --muted: #5d6b64;
  --primary: #15795a;
  --primary-strong: #0e4d3a;
  --ok: #157c37;
  --ok-soft: #6fb489;
  --ok-surface: #e7f5ec;
  --warn: #9e5e00;
  --warn-bar: #d4a017;
  --warn-surface: #fcf1df;
  --bad: #c0332b;
  --bad-surface: #fdecea;
  --info: #2563a8;
  --info-surface: #e9f1fb;
  --empty: #e2e6e0;
  --wallpaper: url("/brand/img/waben-light.svg");
  --shadow: 0 1px 2px rgb(21 33 28 / 0.05), 0 8px 24px -10px rgb(21 33 28 / 0.14);
  --radius: 16px;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0a100d;
    --surface: rgb(17 26 22 / 0.9);
    --surface-solid: #111a16;
    --border: #34443c;
    --ink: #e5e7eb;
    --muted: #a2aab8;
    --primary: #2c9c7c;
    --primary-strong: #22c58b;
    --ok: #4ecb78;
    --ok-soft: #2f7d4b;
    --ok-surface: #12291a;
    --warn: #e0a84a;
    --warn-bar: #e0a84a;
    --warn-surface: #2c2312;
    --bad: #f1837a;
    --bad-surface: #30181a;
    --info: #79abee;
    --info-surface: #16202e;
    --empty: #1f2c26;
    --wallpaper: url("/brand/img/waben-dark.svg");
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px -12px rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ground) var(--wallpaper) center top / cover no-repeat fixed;
  min-height: 100vh;
}
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-strong); }
a:focus-visible, [tabindex]:focus-visible, button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }

.frame { width: 100%; max-width: 920px; margin: 0 auto; padding: 0 20px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* Header */
.site-header { padding: 28px 0 12px; }
.header-content { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.mark { width: 36px; height: 36px; }
.mark-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .mark-light { display: none; }
  .mark-dark { display: block; filter: drop-shadow(0 0 14px rgb(44 156 124 / 0.35)); }
}
.wordmark { font-weight: 600; font-size: 1.125rem; letter-spacing: 0.12em; text-transform: uppercase; }
.divider { width: 1px; height: 22px; background: var(--border); }
.page-name { color: var(--muted); font-weight: 500; }
.header-link { font-size: 0.9rem; font-weight: 500; text-decoration: none; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.header-link:hover { border-color: var(--primary); }

main { padding-top: 20px; padding-bottom: 40px; }

/* Notices published on the Kuma status page */
.notice { padding: 18px 22px; margin-bottom: 16px; border-left: 4px solid var(--info); }
.notice[data-style="danger"] { border-left-color: var(--bad); }
.notice[data-style="warning"] { border-left-color: var(--warn); }
.notice[data-style="success"], .notice[data-style="primary"] { border-left-color: var(--ok); }
.notice h3 { font-size: 1.05rem; margin-bottom: 4px; }
.notice p { margin: 0; white-space: pre-line; }
.notice .time { color: var(--muted); font-size: 0.8rem; font-family: var(--mono); margin-top: 8px; }

/* Overall status */
.overall { display: flex; align-items: center; gap: 16px; padding: 22px 24px; margin-bottom: 28px; }
.overall-icon { width: 40px; height: 40px; border-radius: 50%; flex: none; background: var(--empty); position: relative; }
.overall-icon::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 10px; border-left: 3px solid #fff; border-bottom: 3px solid #fff; transform: translateY(-2px) rotate(-45deg); }
.overall[data-state="operational"] .overall-icon { background: var(--ok); }
.overall[data-state="degraded"] .overall-icon, .overall[data-state="partial"] .overall-icon { background: var(--warn-bar); }
.overall[data-state="major"] .overall-icon { background: var(--bad); }
.overall[data-state="maintenance"] .overall-icon { background: var(--info); }
.overall:not([data-state="operational"]) .overall-icon::after { width: 4px; height: 16px; border: 0; background: #fff; border-radius: 2px; transform: none; }
.overall[data-state="loading"] .overall-icon::after { display: none; }
.overall-title { font-size: 1.35rem; }
.overall-time { margin: 2px 0 0; color: var(--muted); font-size: 0.85rem; }

/* Groups and services */
.group { margin-bottom: 28px; }
.group-title { font-size: 1.05rem; margin: 0 4px 10px; color: var(--ink); }
.group .card { padding: 4px 0; }
.service { padding: 18px 22px; }
.service + .service { border-top: 1px solid var(--border); }
.service-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.service-name { font-weight: 500; }
.state { font-size: 0.85rem; font-weight: 500; white-space: nowrap; }
.state[data-state="up"] { color: var(--ok); }
.state[data-state="down"] { color: var(--bad); }
.state[data-state="pending"] { color: var(--warn); }
.state[data-state="maintenance"], .state[data-state="paused"], .state[data-state="unknown"] { color: var(--muted); }

.bars { display: flex; gap: 2px; height: 34px; align-items: stretch; }
.day { flex: 1 1 0; min-width: 2px; border-radius: 2px; background: var(--empty); cursor: default; transition: transform 0.1s ease, opacity 0.1s; }
.day:hover { transform: scaleY(1.12); }
.day[data-level="ok"] { background: var(--ok); }
.day[data-level="near"] { background: var(--ok-soft); }
.day[data-level="warn"] { background: var(--warn-bar); }
.day[data-level="bad"] { background: var(--bad); }
.scale { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 0.78rem; }
.scale .value { font-family: var(--mono); color: var(--ink); }
.scale .line { flex: 1; height: 1px; background: var(--border); }
.short { display: none; }
@media (max-width: 640px) {
  .day:nth-child(-n+60) { display: none; }   /* phones: last 30 days only */
  .long { display: none; }
  .short { display: inline; }
  .service { padding: 16px; }
  .overall { padding: 18px; }
  .page-name, .divider { display: none; }
}

/* Incidents */
.section { margin-top: 40px; }
.section h2 { font-size: 1.15rem; margin: 0 4px 12px; }
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.section-head h2 { margin-bottom: 0; }
.incidents { padding: 4px 0; }
.incident-day { padding: 16px 22px; }
.incident-day + .incident-day { border-top: 1px solid var(--border); }
.incident-day h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; }
.incident-day .empty { color: var(--muted); margin: 0; font-size: 0.92rem; }
.incident { display: flex; gap: 10px; align-items: baseline; margin: 6px 0 0; font-size: 0.92rem; }
.incident::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); flex: none; transform: translateY(-1px); }
.incident[data-ongoing="true"]::before { background: var(--warn-bar); }
.incident .time { font-family: var(--mono); color: var(--muted); font-size: 0.82rem; }

/* Monthly view */
.month-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.month-picker button {
  font: inherit; font-size: 0.85rem; cursor: pointer; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px;
}
.month-picker button[aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.month-table { width: 100%; border-collapse: collapse; }
.month-table th, .month-table td { text-align: left; padding: 12px 22px; border-top: 1px solid var(--border); font-size: 0.92rem; }
.month-table tr:first-child th, .month-table tr:first-child td { border-top: 0; }
.month-table th { color: var(--muted); font-weight: 500; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.month-table td.number { font-family: var(--mono); text-align: right; white-space: nowrap; }
.month-table th.number { text-align: right; }
.month-incidents { padding: 4px 22px 18px; }
.month-incidents h3 { font-size: 0.95rem; margin: 14px 0 4px; }

/* Tooltip */
.tip {
  position: fixed; z-index: 10; pointer-events: none; max-width: 260px;
  background: var(--surface-solid); color: var(--ink); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; font-size: 0.82rem;
}
.tip strong { display: block; margin-bottom: 2px; }
.tip .value { font-family: var(--mono); }

/* Footer */
.site-footer { padding: 8px 0 40px; color: var(--muted); font-size: 0.88rem; }
.footer-content { border-top: 1px solid var(--border); padding-top: 18px; }
.site-footer p { margin: 4px 0; }
.footer-meta { font-family: var(--mono); font-size: 0.78rem; }
.footer-links a { margin-right: 14px; }

@media (prefers-reduced-motion: reduce) { .day { transition: none; } .day:hover { transform: none; } }
