/* === Edge Network — Status Dashboard === */
/* Palette: bg #0A0F1A, surface #141B2D, cyan #06B6D4, green #10B981, amber #F59E0B, gray #94A3B8, white #E2E8F0 */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

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

:root {
  --bg: #0A0F1A;
  --surface: #141B2D;
  --surface-2: #1C2540;
  --cyan: #06B6D4;
  --green: #10B981;
  --amber: #F59E0B;
  --red: #EF4444;
  --gray: #94A3B8;
  --white: #E2E8F0;
  --border: #1E293B;
  --radius: 4px;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--gray);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --- Header / Nav --- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  font-family: var(--mono);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--cyan);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--white);
}

.logo:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
  text-decoration: none;
}

/* --- Layout --- */

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-title {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray);
  margin-bottom: 0.5rem;
}

/* --- Status Banner --- */

.status-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin-bottom: 2rem;
}

.status-banner.nominal {
  border-color: rgba(16, 185, 129, 0.3);
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.pulse-dot {
  width: 12px;
  height: 12px;
  background: var(--green);
  border-radius: 50%;
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0;
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% { opacity: 0.5; transform: scale(0.8); }
  100% { opacity: 0; transform: scale(1.8); }
}

.status-text {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--green);
}

.status-sub {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--gray);
  margin-top: 0.25rem;
}

#last-checked {
  color: var(--gray);
}

/* --- Metrics Row --- */

.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.metric-label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray);
  margin-bottom: 0.5rem;
}

.metric-value {
  font-family: var(--mono);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1;
}

.metric-value .unit {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--gray);
  margin-left: 0.125rem;
}

/* --- Section Headers --- */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.section-badge {
  font-family: var(--mono);
  font-size: 0.6875rem;
  background: rgba(16, 185, 129, 0.1);
  color: var(--green);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* --- Node Grid --- */

.node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.node-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.node-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.node-dot.degraded {
  background: var(--amber);
}

.node-dot.down {
  background: var(--red);
}

.node-name {
  color: var(--white);
  flex: 1;
}

.node-label {
  font-size: 0.6875rem;
  color: var(--gray);
}

/* --- Uptime Bars --- */

.uptime-section {
  margin-bottom: 2rem;
}

.uptime-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.5rem;
}

.uptime-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.uptime-label {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--white);
}

.uptime-pct {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--green);
}

.uptime-bar {
  display: flex;
  gap: 2px;
  height: 24px;
}

.uptime-bar .day {
  flex: 1;
  background: var(--green);
  border-radius: 1px;
  opacity: 0.8;
}

.uptime-bar .day:hover {
  opacity: 1;
}

.uptime-bar .day.degraded {
  background: var(--amber);
}

.uptime-bar .day.down {
  background: var(--red);
}

.uptime-range {
  display: flex;
  justify-content: space-between;
  margin-top: 0.25rem;
}

.uptime-range span {
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--gray);
}

/* --- Incidents --- */

.incidents {
  margin-bottom: 2rem;
}

.incident {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.5rem;
}

.incident-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.incident-status {
  font-family: var(--mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
}

.incident-status.resolved {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green);
}

.incident-status.monitoring {
  background: rgba(245, 158, 11, 0.1);
  color: var(--amber);
}

.incident-title {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--white);
}

.incident-date {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--gray);
}

.incident-body {
  font-size: 0.8125rem;
  color: var(--gray);
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* --- Table --- */

.data-table-wrap {
  overflow-x: auto;
  margin-bottom: 2rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.data-table th {
  text-align: left;
  font-weight: 500;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.6875rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--white);
  white-space: nowrap;
}

.data-table tr:hover td {
  background: var(--surface-2);
}

.data-table .status-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.data-table .latency {
  color: var(--green);
}

.data-table .ip-range {
  color: var(--gray);
}

/* --- Docs --- */

.docs-content {
  max-width: 720px;
}

.docs-content h2 {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.docs-content h2:first-child {
  margin-top: 0;
}

.docs-content h3 {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cyan);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.docs-content p {
  margin-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.7;
}

.docs-content code {
  font-family: var(--mono);
  font-size: 0.8125rem;
  background: var(--surface-2);
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
  color: var(--cyan);
}

.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.code-block pre {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--white);
  margin: 0;
}

.code-block .comment {
  color: var(--gray);
}

.code-block .string {
  color: var(--green);
}

.code-block .keyword {
  color: var(--cyan);
}

.endpoint-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

.endpoint-method {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
  margin-right: 0.5rem;
}

.endpoint-method.get {
  background: rgba(6, 182, 212, 0.15);
  color: var(--cyan);
}

.endpoint-method.post {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
}

.endpoint-path {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--white);
}

.endpoint-desc {
  font-size: 0.8125rem;
  color: var(--gray);
  margin-top: 0.375rem;
}

/* --- Privacy --- */

.prose {
  max-width: 640px;
}

.prose h1 {
  font-family: var(--mono);
  font-size: 1.25rem;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.prose h2 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.prose p,
.prose li {
  font-size: 0.875rem;
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.prose ul {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.prose .updated {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--gray);
}

/* --- 404 --- */

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.error-code {
  font-family: var(--mono);
  font-size: 4rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.error-msg {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--gray);
  margin-bottom: 2rem;
}

.error-link {
  font-family: var(--mono);
  font-size: 0.8125rem;
}

/* --- Footer --- */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 1.5rem 0;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--gray);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
}

.footer-links a {
  color: var(--gray);
  font-family: var(--mono);
  font-size: 0.6875rem;
}

.footer-links a:hover {
  color: var(--white);
}

/* --- Responsive --- */

@media (max-width: 768px) {
  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .node-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .header-inner {
    height: 48px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 0.75rem;
  }

  .metric-value {
    font-size: 1.375rem;
  }
}

@media (max-width: 480px) {
  .metrics-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .node-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 0.75rem;
  }
}
