@font-face { font-family: "Switzer"; src: url("/assets/Switzer-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("/assets/Switzer-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("/assets/Switzer-Semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  color-scheme: light;
  /* gigBench brand */
  --bench-blue: #149CEF;
  --skyscraper: #101935;
  --foliage: #6F9C37;
  --construction: #FED551;
  --critical: #FF5A5F;

  --bg: #F5F7FB;
  --surface: #FFFFFF;
  --border: #E2E7F0;
  --divider: #EDF0F6;
  --text: #101935;
  --muted: #5A6480;
  --link: #0B7BC2;
  --nodata: #D9DFEA;
  --bar-ok: var(--foliage);
  --bar-warn: var(--construction);
  --bar-down: var(--critical);
  --txt-ok: #4C7420;
  --txt-warn: #8A6500;
  --txt-down: #D2363C;
  --banner-ok-bg: var(--foliage);
  --banner-ok-fg: #FFFFFF;
  --banner-warn-bg: var(--construction);
  --banner-warn-fg: var(--skyscraper);
  --banner-down-bg: var(--critical);
  --banner-down-fg: #FFFFFF;
  --tip-bg: #101935;
  --tip-fg: #F3F5FA;
  --shadow: 0 1px 2px rgba(16, 25, 53, .06), 0 4px 16px rgba(16, 25, 53, .05);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101935;
    --surface: #16213F;
    --border: #26335C;
    --divider: #1F2A4D;
    --text: #F3F5FA;
    --muted: #A6B0C9;
    --link: #5BBDF6;
    --nodata: #2B3761;
    --txt-ok: #93C35A;
    --txt-warn: #FED551;
    --txt-down: #FF7C80;
    --banner-ok-bg: #5E8A2C;
    --tip-bg: #F3F5FA;
    --tip-fg: #101935;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101935;
  --surface: #16213F;
  --border: #26335C;
  --divider: #1F2A4D;
  --text: #F3F5FA;
  --muted: #A6B0C9;
  --link: #5BBDF6;
  --nodata: #2B3761;
  --txt-ok: #93C35A;
  --txt-warn: #FED551;
  --txt-down: #FF7C80;
  --banner-ok-bg: #5E8A2C;
  --tip-bg: #F3F5FA;
  --tip-fg: #101935;
  --shadow: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Switzer", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--bench-blue); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.logo { height: 30px; width: auto; display: block; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
.brand-suffix { font-size: 18px; font-weight: 500; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--border); line-height: 24px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer;
}
.theme-toggle svg { fill: currentColor; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: inline; }
}
.btn-app {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 8px;
  background: var(--bench-blue); color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.btn-app:hover { text-decoration: none; filter: brightness(1.05); }

main.wrap { padding-top: 32px; padding-bottom: 48px; }

/* Overall banner */
.banner {
  display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-radius: 10px;
  font-size: 20px; font-weight: 600; box-shadow: var(--shadow);
  background: var(--banner-ok-bg); color: var(--banner-ok-fg);
}
.banner-loading { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.banner.degraded { background: var(--banner-warn-bg); color: var(--banner-warn-fg); }
.banner.partial_outage, .banner.major_outage { background: var(--banner-down-bg); color: var(--banner-down-fg); }
.banner.stale { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.banner-icon { width: 22px; height: 22px; flex: none; border-radius: 50%; background: currentColor; opacity: .95;
  -webkit-mask: var(--icon) center/contain no-repeat; mask: var(--icon) center/contain no-repeat; }
.banner { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1a11 11 0 1 0 0 22 11 11 0 0 0 0-22Zm-1.5 16.2-5-5 1.8-1.8 3.2 3.2 6.8-6.8 1.8 1.8-8.6 8.6Z'/%3E%3C/svg%3E"); }
.banner.degraded, .banner.partial_outage, .banner.major_outage, .banner.stale { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1a11 11 0 1 0 0 22 11 11 0 0 0 0-22Zm1.3 17h-2.6v-2.6h2.6V18Zm0-4.6h-2.6V6h2.6v7.4Z'/%3E%3C/svg%3E"); }
.banner-loading .banner-icon { opacity: .3; }

/* Active incidents */
.active-incidents:empty { display: none; }
.active-incidents { margin-top: 16px; display: grid; gap: 12px; }
.active-card { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--critical); border-radius: 10px; padding: 14px 18px; box-shadow: var(--shadow); }
.active-card.minor { border-left-color: var(--construction); }
.active-card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.active-card h3 a { color: inherit; }
.active-card p { margin: 0; color: var(--muted); font-size: 14px; }
.active-card .upd-status { color: var(--text); font-weight: 600; }

/* Uptime header */
.uptime-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; margin: 32px 0 10px; color: var(--muted); font-size: 14px; }
.uptime-head p { margin: 0; }
.live { display: inline-flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--foliage); box-shadow: 0 0 0 0 rgba(111, 156, 55, .6); animation: pulse 2s infinite; }
.live.error .live-dot { background: var(--critical); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(111,156,55,.55); } 70% { box-shadow: 0 0 0 7px rgba(111,156,55,0); } 100% { box-shadow: 0 0 0 0 rgba(111,156,55,0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* Components */
.components { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.group-title { margin: 0; padding: 12px 20px; font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--divider); }
.group + .group .group-title { border-top: 1px solid var(--border); }
.comp { padding: 16px 20px 14px; border-bottom: 1px solid var(--divider); }
.group:last-child .comp:last-child { border-bottom: 0; }
.comp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.comp-name { font-weight: 600; font-size: 16px; }
.comp-desc { color: var(--muted); font-size: 13px; font-weight: 400; margin-left: 6px; }
.comp-status { font-size: 14px; font-weight: 500; white-space: nowrap; }
.s-operational { color: var(--txt-ok); }
.s-degraded { color: var(--txt-warn); }
.s-down { color: var(--txt-down); }
.bars { display: block; width: 100%; height: 34px; margin-top: 10px; }
.bars rect { cursor: pointer; }
.bars rect:hover, .bars rect.active { opacity: .7; }
.b-ok { fill: var(--bar-ok); }
.b-warn { fill: var(--bar-warn); }
.b-down { fill: var(--bar-down); }
.b-none { fill: var(--nodata); }
.comp-foot { display: flex; align-items: center; gap: 10px; margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.comp-foot .rule { flex: 1; height: 1px; background: var(--divider); }

/* Tooltip */
.tip { position: fixed; z-index: 20; max-width: 280px; padding: 10px 12px; border-radius: 8px; background: var(--tip-bg); color: var(--tip-fg); font-size: 13px; line-height: 1.45; box-shadow: 0 8px 24px rgba(16,25,53,.25); pointer-events: none; }
.tip strong { display: block; margin-bottom: 2px; }
.tip ul { margin: 6px 0 0; padding-left: 16px; }

/* Past incidents */
.past { margin-top: 48px; }
.past h2 { font-size: 22px; font-weight: 600; margin: 0 0 8px; }
.day { padding: 18px 0; border-bottom: 1px solid var(--border); }
.day h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.day .none { margin: 0; color: var(--muted); font-size: 14px; }
.incident { padding: 6px 0 10px; border-radius: 8px; transition: background .4s; }
.incident.flash { background: color-mix(in srgb, var(--bench-blue) 12%, transparent); }
.incident h4 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.incident h4.major { color: var(--txt-down); }
.incident h4.minor { color: var(--txt-warn); }
.incident .comp-tag { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.update { margin: 0 0 8px; font-size: 14px; }
.update b { font-weight: 600; }
.update time { display: block; color: var(--muted); font-size: 12.5px; }

.site-footer { border-top: 1px solid var(--border); padding: 20px 0 32px; color: var(--muted); font-size: 13px; }
.site-footer p { margin: 4px 0; }

@media (max-width: 600px) {
  body { font-size: 14px; }
  .header-row { min-height: 58px; }
  .logo { height: 24px; }
  .brand-suffix { font-size: 15px; padding-left: 8px; }
  .btn-app { padding: 0 10px; font-size: 13px; height: 34px; }
  .theme-toggle { width: 34px; height: 34px; }
  main.wrap { padding-top: 20px; }
  .banner { font-size: 17px; padding: 14px 16px; }
  .comp { padding: 14px 16px 12px; }
  .group-title { padding: 10px 16px; }
  .comp-desc { display: none; }
}
@media (max-width: 360px) {
  .btn-app { display: none; }
}
