/* =====================================================================
   Varanic Status — styles
   Brand tokens mirror dashboard/src/App.css so the page reads as Varanic,
   not a generic status template. Light + dark via prefers-color-scheme.
   No emojis: status is conveyed by color + text labels only.
   ===================================================================== */

:root {
  /* Brand */
  --midnight: #0d0d0d;
  --slate: #3d3d3d;
  --golden-ring: #c9a956;
  --olive: #5c6b4a; /* operational green (on-brand, readable) */
  --moss: #7a8b5c;
  --amber: #d4883b; /* partial / warning */
  --red: #c43c3c; /* major / error */

  /* Surfaces (light) */
  --bg: #f8f8f8;
  --card: #ffffff;
  --card-2: #fbfbfb;
  --border: #e6e4df;
  --border-strong: #d6d3cc;

  /* Text (light) */
  --text: #0d0d0d;
  --text-2: #3d3d3d;
  --text-muted: #6b6b6b;

  /* Bars */
  --bar-up: #5c6b4a;
  --bar-partial: #d4883b;
  --bar-down: #c43c3c;
  --bar-nodata: #dcdad4;

  /* Banner text on solid color */
  --on-color: #ffffff;

  --radius: 10px;
  --radius-sm: 6px;
  --maxw: 880px;
  --shadow: 0 1px 2px rgba(13, 13, 13, 0.04), 0 1px 8px rgba(13, 13, 13, 0.03);
}

@media (prefers-color-scheme: dark) {
  :root {
    --midnight: #e8e8e8;
    --slate: #c0c0c0;

    --bg: #121212;
    --card: #1a1a1a;
    --card-2: #161616;
    --border: #2a2a2a;
    --border-strong: #353535;

    --text: #e8e8e8;
    --text-2: #c0c0c0;
    --text-muted: #8a8a8a;

    --bar-up: #7a8b5c;
    --bar-partial: #d4883b;
    --bar-down: #c43c3c;
    --bar-nodata: #2f2f2f;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 10px rgba(0, 0, 0, 0.25);
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--border-strong);
}
a:hover {
  color: var(--golden-ring);
  text-decoration-color: var(--golden-ring);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05em 0.35em;
}

/* ── Header ──────────────────────────────────────────────────────────── */

.site-header {
  display: flex;
  justify-content: center;
  padding: 44px 20px 28px;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.wordmark-name {
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.wordmark-sub {
  font-family: "Oswald", sans-serif;
  font-weight: 500;
  font-size: 30px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Layout ──────────────────────────────────────────────────────────── */

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Overall banner ──────────────────────────────────────────────────── */

.overall {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-radius: var(--radius);
  color: var(--on-color);
  font-size: 18px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.overall.is-loading {
  background: var(--card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-weight: 600;
}

.overall.state-operational {
  background: var(--olive);
}
.overall.state-partial {
  background: var(--amber);
}
.overall.state-major {
  background: var(--red);
}
.overall.state-unknown {
  background: var(--card);
  color: var(--text-2);
  border: 1px solid var(--border);
}

.overall-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
}
.overall.is-loading .overall-dot,
.overall.state-unknown .overall-dot {
  box-shadow: none;
  background: var(--text-muted);
}

/* ── Incident cards ──────────────────────────────────────────────────── */

.incidents {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.incidents:not(:empty) {
  margin-top: 16px;
}

.incident {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.incident.sev-minor {
  border-left-color: var(--amber);
}
.incident.sev-major,
.incident.sev-critical {
  border-left-color: var(--red);
}

.incident-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px 6px;
}
.incident-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.incident-affected {
  font-size: 12.5px;
  color: var(--text-muted);
}

.incident-updates {
  list-style: none;
  margin: 0;
  padding: 6px 18px 16px;
}
.incident-update {
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.incident-update:first-child {
  border-top: none;
}
.incident-update-status {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text);
  margin-right: 8px;
  text-transform: capitalize;
}
.incident-update-time {
  font-size: 12.5px;
  color: var(--text-muted);
}
.incident-update-body {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-2);
}

/* ── Uptime section ──────────────────────────────────────────────────── */

.uptime {
  margin: 34px 0 10px;
}
.uptime-head {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 10px;
}
.uptime-title {
  margin: 0;
  font-family: "Source Sans Pro", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.services {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.service {
  padding: 18px 22px;
  border-top: 1px solid var(--border);
}
.service:first-child {
  border-top: none;
}

.service-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.service-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.service-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 8px;
}
.service-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
}
.service-state .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bar-nodata);
}
.service-state.state-operational {
  color: var(--olive);
}
.service-state.state-operational .dot {
  background: var(--olive);
}
.service-state.state-partial {
  color: var(--amber);
}
.service-state.state-partial .dot {
  background: var(--amber);
}
.service-state.state-major {
  color: var(--red);
}
.service-state.state-major .dot {
  background: var(--red);
}
.service-state.state-unknown {
  color: var(--text-muted);
}

/* 90-day bar chart */
.bars {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 34px;
  width: 100%;
}
.bar {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 2px;
  background: var(--bar-nodata);
  transition: transform 0.08s ease;
}
.bar.up {
  background: var(--bar-up);
}
.bar.partial {
  background: var(--bar-partial);
}
.bar.down {
  background: var(--bar-down);
}
.bar.nodata {
  background: var(--bar-nodata);
}
.bar:hover {
  transform: scaleY(1.12);
}

.bars-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-size: 12px;
  color: var(--text-muted);
}
.bars-legend .pct {
  color: var(--text-2);
  font-weight: 600;
}

/* Loading skeleton */
.services-skeleton {
  padding: 18px 22px;
}
.skeleton-row {
  height: 52px;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    var(--card-2) 25%,
    var(--border) 37%,
    var(--card-2) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  margin-bottom: 12px;
}
.skeleton-row:last-child {
  margin-bottom: 0;
}
@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

/* Error / empty notice */
.notice {
  padding: 22px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ── Footer ──────────────────────────────────────────────────────────── */

.site-footer {
  max-width: var(--maxw);
  margin: 40px auto 56px;
  padding: 0 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.site-footer p {
  margin: 6px 0;
}
.footer-meta {
  color: var(--text-2);
}
.dot-sep {
  margin: 0 8px;
  color: var(--border-strong);
}

@media (max-width: 540px) {
  .bars {
    height: 30px;
  }
  .service-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .wordmark-name,
  .wordmark-sub {
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-row {
    animation: none;
  }
  .bar {
    transition: none;
  }
}
