:root {
  --radius: 14px;
  --background: #ffffff;
  --canvas: #fafaf8;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --ink: #0a0a0a;
  --ink-secondary: #2a2a2a;
  --ink-tertiary: #8a8a8a;
  --ink-muted: #b8b8b8;
  --border: #e8e8e6;
  --border-strong: #d7ddd8;
  --lettie: #173822;
  --lettie-hover: #1f4a2d;
  --lettie-soft: #e6ede8;
  --success: #173822;
  --warning: #e5a100;
  --danger: #dc3545;
  --shadow-soft: 0 14px 34px rgba(23, 56, 34, 0.08);
  --shadow-hard: 0 22px 46px rgba(23, 56, 34, 0.12);
}

html.dark {
  --background: #0e0e0e;
  --canvas: #121212;
  --surface: #161616;
  --surface-raised: #1c1c1c;
  --ink: #e8e8e6;
  --ink-secondary: #c8c8c6;
  --ink-tertiary: #7a7a7a;
  --ink-muted: #4a4a4a;
  --border: #222222;
  --border-strong: #2a2a2a;
  --lettie: #27b857;
  --lettie-hover: #32d66b;
  --lettie-soft: #1a2e1f;
  --success: #27b857;
  --warning: #f7d571;
  --danger: #ff6b6b;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.35);
  --shadow-hard: 0 24px 52px rgba(0, 0, 0, 0.46);
}

html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, opacity 0.35s ease, box-shadow 0.35s ease !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  position: relative;
  line-height: 1.55;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.texture {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.035;
  background-image: url("/brand/chat-tile-bg.png");
  background-repeat: repeat;
  background-size: 600px;
  filter: invert(1);
}

html.dark .texture {
  opacity: 0.025;
  filter: invert(0);
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  z-index: 100;
  background: #27b857;
}

.site-header {
  position: fixed;
  top: 6px;
  left: 0;
  right: 0;
  height: 56px;
  z-index: 95;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(8px);
}

.nav-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  height: 56px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  height: 24px;
  flex-shrink: 0;
}

.logo {
  height: 24px;
  width: auto;
  display: block;
}

.logo-dark {
  display: none;
  position: absolute;
  left: 0;
  top: 0;
}

html.dark .logo-light {
  display: none;
}

html.dark .logo-dark {
  display: block;
}

.nav-actions {
  display: flex;
  align-items: center;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--ink-tertiary);
  cursor: pointer;
  padding: 0;
}

.theme-toggle:hover {
  color: var(--ink);
}

.theme-icon {
  width: 20px;
  height: 20px;
}

.theme-icon-sun {
  display: none;
}

html.dark .theme-icon-moon {
  display: none;
}

html.dark .theme-icon-sun {
  display: block;
}

.page-content {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding-top: 92px;
  padding-bottom: 56px;
}

.reveal {
  opacity: 1;
  transform: translateY(0);
}

.reveal.revealed {
  animation: reveal-fade-up 0.75s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes reveal-fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

#status-title {
  margin: 0;
  font-family: "Lora", Georgia, serif;
  font-size: clamp(2.5rem, 5vw, 4.25rem);
  line-height: 1.08;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.hero-description {
  margin: 14px 0 0;
  max-width: 780px;
  font-size: 16px;
  color: var(--ink-secondary);
}

.hero-metrics {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  border: 1px solid var(--border);
  background: var(--surface-raised);
  padding: 14px 16px;
}

.metric-label {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-tertiary);
  font-weight: 600;
}

.metric-value {
  margin: 6px 0 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--ink);
}

.metric-value.up {
  color: var(--success);
}

.metric-value.warn {
  color: var(--warning);
}

.metric-value.down {
  color: var(--danger);
}

.section {
  margin-top: 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  padding: 28px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-family: "Lora", Georgia, serif;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 500;
  letter-spacing: -0.015em;
}

.section-meta {
  margin: 0;
  font-size: 13px;
  color: var(--ink-tertiary);
}

.services-container {
  display: grid;
  gap: 22px;
}

.group-block {
  border: 0;
  background: transparent;
  padding: 0;
}

.group-head {
  display: none;
}

.group-title {
  margin: 0;
  font-family: "Lora", Georgia, serif;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.group-subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-tertiary);
}

.group-health {
  font-size: 13px;
  color: var(--ink-tertiary);
  font-weight: 600;
}

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.monitor-card {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.monitor-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hard);
}

.monitor-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.monitor-name {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--ink);
}

.monitor-type {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--ink-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.status-pill {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-pill.up {
  background: color-mix(in srgb, var(--success) 16%, transparent);
  border-color: color-mix(in srgb, var(--success) 40%, transparent);
  color: var(--success);
}

.status-pill.warn {
  background: color-mix(in srgb, var(--warning) 20%, transparent);
  border-color: color-mix(in srgb, var(--warning) 40%, transparent);
  color: var(--warning);
}

.status-pill.down {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  color: var(--danger);
}

.monitor-meta {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.meta-item {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, var(--lettie-soft));
  padding: 8px;
}

.meta-item-label {
  margin: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-tertiary);
  font-weight: 600;
}

.meta-item-value {
  margin: 3px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.sparkline {
  margin-top: 10px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  align-items: end;
  height: 26px;
}

.sparkline span {
  display: block;
  border-radius: 3px;
  min-height: 4px;
  opacity: 0.9;
}

.sparkline .up {
  background: var(--success);
}

.sparkline .warn {
  background: var(--warning);
}

.sparkline .down {
  background: var(--danger);
}

.sparkline .unknown {
  background: var(--border);
}

.incidents-container {
  display: grid;
  gap: 12px;
}

.incident-card {
  border: 1px solid var(--border);
  background: var(--surface-raised);
  padding: 14px;
}

.incident-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.incident-meta {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--ink-tertiary);
}

.incident-content {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--ink-secondary);
}

.status-message {
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--surface) 85%, var(--lettie-soft));
  padding: 12px 14px;
  font-size: 14px;
  color: var(--ink-secondary);
}

.status-message.error {
  border-color: color-mix(in srgb, var(--danger) 50%, var(--border));
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
}

@media (max-width: 1024px) {
  .monitor-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .nav-shell,
  .page-content {
    width: calc(100% - 24px);
  }

  .nav-shell {
    height: 56px;
    min-height: 56px;
  }

  .page-content {
    padding-top: 92px;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 20px;
  }
}

@media (max-width: 640px) {
  .section-head {
    flex-direction: column;
    align-items: start;
  }

  .group-head {
    flex-direction: column;
    align-items: start;
  }
}
