/* Switzer, the web app's typeface (serrafi-nextjs-frontend public/Switzer-Variable.ttf), self-hosted. */
@font-face {
  font-family: 'Switzer';
  src: url('fonts/Switzer-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Colours are the web app's tokens (globals.css): warm neutrals, its pill colours for status.
   Light pill text for degraded/outage/maintenance is one step darker than the app's own
   (#B45309, #DC2626, #2563EB), which fall just under 4.5:1 on their 10% tint. */
:root {
  --bg: #fcfbf8;
  --surface: #ffffff;
  --border: #e9e7e3;
  --text: #1b1812;
  --muted: #6c6961;
  --brand: #1b1812;
  --logo-fi-stroke: #111827;

  --ok: #157a3a;
  --ok-soft: #e8f6ed;
  --warn: #a14a08;
  --warn-soft: #f8eee6;
  --bad: #b91c1c;
  --bad-soft: #fce9e9;
  --maint: #1d4ed8;
  --maint-soft: #e9effd;
  --idle: #a6a29a;
  --idle-soft: #f2f1f0;
  --bar-empty: #e9e7e3;
  /* Bars, dots and incident edges: the app's own (brighter) light status colours. They carry no
     text, so they need 3:1 against the card, not 4.5:1, and stay easier to tell apart at 8px. */
  --ok-fill: #16a34a;
  --warn-fill: #d97706;
  --bad-fill: #dc2626;
  --maint-fill: #2563eb;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #1d1c19;
    --surface: #252421;
    --border: #3b3a37;
    --text: #ffffff;
    --muted: #9d9991;
    --brand: #ffffff;
    --logo-fi-stroke: none;
    --ok: #4ade80;
    --ok-soft: #29372b;
    --warn: #facc15;
    --warn-soft: #3a3520;
    --bad: #f87171;
    --bad-soft: #3a2c29;
    --maint: #60a5fa;
    --maint-soft: #2b3137;
    --idle: #75726a;
    --idle-soft: #31302c;
    --bar-empty: #3b3a37;
    --ok-fill: #4ade80;
    --warn-fill: #facc15;
    --bad-fill: #f87171;
    --maint-fill: #60a5fa;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #1d1c19;
  --surface: #252421;
  --border: #3b3a37;
  --text: #ffffff;
  --muted: #9d9991;
  --brand: #ffffff;
  --logo-fi-stroke: none;
  --ok: #4ade80;
  --ok-soft: #29372b;
  --warn: #facc15;
  --warn-soft: #3a3520;
  --bad: #f87171;
  --bad-soft: #3a2c29;
  --maint: #60a5fa;
  --maint-soft: #2b3137;
  --idle: #75726a;
  --idle-soft: #31302c;
  --bar-empty: #3b3a37;
  --ok-fill: #4ade80;
  --warn-fill: #facc15;
  --bad-fill: #f87171;
  --maint-fill: #60a5fa;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

/* Components set display:flex etc.; `hidden` must still hide them. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 'Switzer', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3,
p {
  margin: 0;
}

/* Masthead */
.masthead {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.masthead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  text-decoration: none;
  line-height: 1;
}
/* The app's logo: "Serra" in the ink colour, "Fi" the brand gradient, outlined in light. */
.logo {
  display: block;
  flex: none;
}
.logo-serra {
  fill: var(--brand);
}
.logo-fi {
  stroke: var(--logo-fi-stroke);
  stroke-width: 1.5;
  paint-order: stroke fill;
}
.wordmark-sub {
  padding-left: 10px;
  border-left: 1px solid var(--border);
  font-size: 15px;
  font-weight: 500;
  line-height: 18px;
}
.env-badge {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
}

main.wrap {
  padding-top: 28px;
  padding-bottom: 8px;
}

/* Stale data warning */
.stale {
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--warn-soft);
  color: var(--text);
  border: 1px solid var(--warn);
  font-size: 14px;
}

/* Overall banner */
.overall {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 28px;
}
.overall-dot {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--idle);
  box-shadow: 0 0 0 5px var(--idle-soft);
}
.overall-title {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.overall-meta {
  color: var(--muted);
  font-size: 13px;
}
.overall[data-state='degraded'] .overall-dot {
  background: var(--warn-fill);
  box-shadow: 0 0 0 5px var(--warn-soft);
}
.overall[data-state='outage'] .overall-dot {
  background: var(--bad-fill);
  box-shadow: 0 0 0 5px var(--bad-soft);
}
.overall[data-state='maintenance'] .overall-dot {
  background: var(--maint-fill);
  box-shadow: 0 0 0 5px var(--maint-soft);
}

/* Incidents */
.section-title {
  font-size: 13px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 10px;
}
.incident {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--warn-fill);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
}
.incident[data-impact='outage'] {
  border-left-color: var(--bad-fill);
}
.incident[data-impact='maintenance'] {
  border-left-color: var(--maint-fill);
}
.incident[data-status='resolved'] {
  border-left-color: var(--ok-fill);
}
.incident-title {
  font-size: 16px;
  font-weight: 650;
}
.incident-meta {
  color: var(--muted);
  font-size: 13px;
  margin: 2px 0 10px;
}
.incident-update {
  font-size: 14px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.incident-update b {
  text-transform: capitalize;
}
.incident-update time {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
#active-incidents:not(:empty),
#scheduled-maintenance:not(:empty),
#past-incidents:not(:empty) {
  margin-bottom: 28px;
}

/* Components */
.group {
  margin-bottom: 28px;
}
.group-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.component {
  padding: 16px 18px;
}
.component + .component {
  border-top: 1px solid var(--border);
}
.component-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.component-head > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.component-name {
  font-size: 15px;
  font-weight: 600;
}
.component-desc {
  color: var(--muted);
  font-size: 13px;
}
.component-note {
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  margin-top: 2px;
}

.pill {
  flex: none;
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--idle-soft);
  color: var(--muted);
}
.pill[data-state='operational'] {
  background: var(--ok-soft);
  color: var(--ok);
}
.pill[data-state='degraded'] {
  background: var(--warn-soft);
  color: var(--warn);
}
.pill[data-state='outage'] {
  background: var(--bad-soft);
  color: var(--bad);
}
.pill[data-state='maintenance'] {
  background: var(--maint-soft);
  color: var(--maint);
}

/* 90-day bars */
.bars {
  list-style: none;
  display: flex;
  gap: 2px;
  height: 30px;
  margin: 14px 0 6px;
  padding: 0;
}
.bars li {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 2px;
  background: var(--bar-empty);
}
.bars li[data-state='operational'] {
  background: var(--ok-fill);
}
.bars li[data-state='degraded'] {
  background: var(--warn-fill);
}
.bars li[data-state='outage'] {
  background: var(--bad-fill);
}
.bars li[data-state='maintenance'] {
  background: var(--maint-fill);
}
.bars li:hover {
  opacity: 0.7;
}
.bars-legend {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

/* Narrow screens: last 30 days only, so each day stays tappable. */
@media (max-width: 560px) {
  .bars li:nth-child(-n + 60) {
    display: none;
  }
  .bars-start::before {
    content: '30 days ago';
  }
  .bars-start {
    font-size: 0;
  }
  .bars-start::before {
    font-size: 12px;
  }
  .overall {
    padding: 16px;
  }
}

.footer {
  padding-top: 8px;
  padding-bottom: 40px;
  color: var(--muted);
  font-size: 13px;
}
