:root {
  color-scheme: light;
  font-family: "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  --accent: #1f4b99;
  --accent-dark: #133573;
  --background: #f8fbff;
  --text: #1e2330;
  --muted: #5f6b80;
  --surface: #ffffff;
  --surface-alt: #f1f4fb;
  --border: rgba(31, 75, 153, 0.12);
  --success: #1f8656;
  --error: #c0392b;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-size: 16px;
}

.noscript {
  background: var(--error);
  color: white;
  padding: 1rem;
  text-align: center;
}

.wrapper {
  width: min(960px, 90vw);
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.hero {
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 36vh;
  color: white;
  overflow: hidden;
}

.hero__background {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.1);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(135deg, rgba(19, 41, 82, 0.62), rgba(31, 75, 153, 0.38));
}

.hero__content {
  position: relative;
  z-index: 2;
  padding: 2rem;
  max-width: 720px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.8rem;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.8);
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.8rem, 6vw, 3.6rem);
}

.lede {
  font-size: 1.2rem;
  margin: 0 auto;
  max-width: 40ch;
}

.panel {
  background: var(--surface);
  border-radius: 24px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 20px 40px rgba(18, 38, 66, 0.08);
}

.panel--accent {
  background: var(--accent);
  color: white;
  padding-bottom: 3rem;
}

.panel--table {
  padding: 2rem;
}

.panel__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 1.5rem;
}

.panel__meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.status {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: var(--surface-alt);
  color: var(--muted);
  margin: 0 0 1.5rem;
  display: inline-flex;
}

.status--loading::before {
  content: "⏳";
  margin-right: 0.5rem;
}

.status--success {
  background: rgba(31, 134, 86, 0.12);
  color: var(--success);
}

.status--success::before {
  content: "✅";
  margin-right: 0.5rem;
}

.status--error {
  background: rgba(192, 57, 43, 0.12);
  color: var(--error);
}

.status--error::before {
  content: "⚠️";
  margin-right: 0.5rem;
}

.stats {
  display: grid;
  gap: 2rem;
}

.stats-toggle {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.stats-toggle__btn {
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.9rem;
}

.stats-toggle__btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.stats-toggle__btn--active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.stat-section {
  display: grid;
  gap: 1rem;
}

.stat-section__title {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-row {
  display: grid;
  gap: 1.5rem;
}

.stat-row--split {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.stat-row--current {
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .stat-row--current {
    grid-template-columns: 1fr;
  }
}

.stat-row--quartet {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stat-card {
  background: var(--surface-alt);
  padding: 1.5rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.75rem;
  min-height: 170px;
}

.stat-card h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  min-height: 2.4rem;
  line-height: 1.2;
}

.stat-card__value {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--accent-dark);
  line-height: 1.1;
}

.stat-card__caption {
  margin: 0;
  margin-top: -0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.stat-card__caption--live-clock {
  font-size: clamp(2rem, 4vw, 2.6rem) !important;
  font-weight: 700 !important;
  color: var(--accent-dark) !important;
  font-variant-numeric: tabular-nums;
}

.panel--accent .panel__meta {
  color: rgba(255, 255, 255, 0.7);
}

.panel--action {
  background: var(--surface);
  border: 2px solid var(--accent);
}

.action-links {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.action-link h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  color: var(--text);
  font-weight: 600;
}

.action-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.05rem;
  transition: color 0.2s ease;
  word-break: break-word;
}

.action-link a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: clamp(240px, 45vw, 360px);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1rem;
  box-sizing: border-box;
}

#monthlyChart {
  width: 100% !important;
  height: 100% !important;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  min-width: 520px;
}

th,
td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid rgba(30, 35, 48, 0.08);
}

th {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--surface-alt);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: rgba(31, 75, 153, 0.06);
}

td:nth-child(3) {
  font-variant-numeric: tabular-nums;
}

tbody tr.outage-warning td {
  background: rgba(255, 193, 7, 0.15);
}

tbody tr.outage-warning:hover td {
  background: rgba(255, 193, 7, 0.25);
}

tbody tr.outage-severe td {
  background: rgba(220, 53, 69, 0.15);
}

tbody tr.outage-severe:hover td {
  background: rgba(220, 53, 69, 0.25);
}

.footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .panel {
    padding: 2rem;
  }

  .stat-card {
    min-height: unset;
  }

  table {
    min-width: 420px;
  }
}
