@font-face {
  font-family: 'Geist';
  src: url('../fonts/geist-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('../fonts/geist-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('../fonts/geist-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #09090b;
  --surface: #18181b;
  --surface2: #27272a;
  --border: #27272a;
  --border-subtle: rgba(255,255,255,0.06);
  --text: #fafafa;
  --dim: #71717a;
  --blue: #3b82f6;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --violet: #8b5cf6;
}

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

body {
  font-family: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--dim); }

a { color: var(--blue); text-decoration: none; transition: color 150ms; }
a:hover { color: #60a5fa; }

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Header ---- */
.header {
  padding: 48px 0 0;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.logo-mark {
  width: 22px;
  height: 26px;
  background: var(--text);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  flex-shrink: 0;
}

.header-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.header-subtitle {
  font-size: 13px;
  color: var(--dim);
  font-weight: 400;
}

/* ---- Overall Status Banner ---- */
.status-banner {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: border-color 150ms;
}

.status-banner.operational { border-color: rgba(34,197,94,0.3); }
.status-banner.degraded { border-color: rgba(245,158,11,0.3); }
.status-banner.outage { border-color: rgba(239,68,68,0.3); }

.status-banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.status-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  opacity: 0.3;
}

.status-dot.green { background: var(--green); }
.status-dot.green::after { border: 2px solid var(--green); }
.status-dot.amber { background: var(--amber); }
.status-dot.amber::after { border: 2px solid var(--amber); }
.status-dot.red { background: var(--red); }
.status-dot.red::after { border: 2px solid var(--red); }

.status-banner-text {
  font-size: 15px;
  font-weight: 600;
}

.status-banner-time {
  font-size: 12px;
  color: var(--dim);
  white-space: nowrap;
}

/* ---- Section ---- */
.section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--dim);
  margin-bottom: 16px;
}

/* ---- Service Cards Grid ---- */
.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.service-card {
  background: var(--surface);
  padding: 20px;
  transition: background 150ms;
}

.service-card:hover {
  background: #1f1f23;
}

.service-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.service-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}

.service-name .status-dot {
  width: 8px;
  height: 8px;
}

.service-name .status-dot::after {
  inset: -2px;
}

.service-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1.4;
}

.service-badge.operational { background: rgba(34,197,94,0.12); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.service-badge.degraded { background: rgba(245,158,11,0.12); color: var(--amber); border: 1px solid rgba(245,158,11,0.2); }
.service-badge.outage { background: rgba(239,68,68,0.12); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }

.service-metrics {
  display: flex;
  gap: 24px;
}

.service-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-label {
  font-size: 11px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.metric-value.green { color: var(--green); }
.metric-value.amber { color: var(--amber); }
.metric-value.red { color: var(--red); }

.metric-unit {
  font-size: 12px;
  font-weight: 400;
  color: var(--dim);
  margin-left: 2px;
}

/* ---- 90-Day Uptime ---- */
.uptime-section {
  margin-bottom: 40px;
}

.uptime-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.uptime-row:last-child { border-bottom: none; }

.uptime-label {
  width: 120px;
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
}

.uptime-bar-container {
  flex: 1;
  display: flex;
  gap: 1.5px;
  height: 28px;
  align-items: stretch;
}

.uptime-day {
  flex: 1;
  border-radius: 2px;
  min-width: 2px;
  transition: opacity 150ms;
  position: relative;
}

.uptime-day.up { background: var(--green); opacity: 0.7; }
.uptime-day.up:hover { opacity: 1; }
.uptime-day.degraded { background: var(--amber); opacity: 0.85; }
.uptime-day.degraded:hover { opacity: 1; }
.uptime-day.down { background: var(--red); opacity: 0.85; }
.uptime-day.down:hover { opacity: 1; }
.uptime-day.no-data { background: var(--surface2); opacity: 0.4; }

.uptime-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
  color: var(--text);
}

.uptime-day:hover .uptime-tooltip {
  display: block;
}

.uptime-pct {
  width: 64px;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.uptime-pct.green { color: var(--green); }
.uptime-pct.amber { color: var(--amber); }
.uptime-pct.red { color: var(--red); }

.uptime-legend {
  display: flex;
  justify-content: space-between;
  padding: 8px 0 0;
  margin-left: 136px;
  margin-right: 80px;
}

.uptime-legend span {
  font-size: 11px;
  color: var(--dim);
}

/* ---- Incidents ---- */
.incident-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.incident-date-group {
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 0;
}

.incident-date-group:last-child { border-bottom: none; }

.incident-date {
  font-size: 12px;
  color: var(--dim);
  font-weight: 500;
  margin-bottom: 10px;
}

.incident-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 0;
}

.incident-icon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 7px;
  flex-shrink: 0;
}

.incident-icon.resolved { background: var(--green); }
.incident-icon.investigating { background: var(--amber); }
.incident-icon.identified { background: var(--blue); }

.incident-body {
  flex: 1;
}

.incident-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.incident-desc {
  font-size: 12px;
  color: var(--dim);
  line-height: 1.5;
}

.incident-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.incident-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.incident-badge.resolved { background: rgba(34,197,94,0.12); color: var(--green); }
.incident-badge.investigating { background: rgba(245,158,11,0.12); color: var(--amber); }
.incident-badge.identified { background: rgba(59,130,246,0.12); color: var(--blue); }

.incident-time {
  font-size: 11px;
  color: var(--dim);
}

.no-incidents {
  padding: 24px 0;
  text-align: center;
  color: var(--dim);
  font-size: 13px;
}

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--dim);
}

.footer-logo {
  width: 12px;
  height: 14px;
  background: var(--dim);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.footer-right {
  font-size: 12px;
  color: var(--dim);
}

/* ---- Page load animation ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeUp 300ms ease forwards;
  opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0ms; }
.animate-in:nth-child(2) { animation-delay: 60ms; }
.animate-in:nth-child(3) { animation-delay: 120ms; }
.animate-in:nth-child(4) { animation-delay: 180ms; }
.animate-in:nth-child(5) { animation-delay: 240ms; }

/* ---- Skeleton loading ---- */
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-text { height: 14px; width: 80px; }
.skeleton-number { height: 24px; width: 60px; }
.skeleton-bar { height: 28px; width: 100%; border-radius: 2px; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .container { padding: 0 16px; }

  .header { padding: 32px 0 0; }

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

  .service-metrics { gap: 16px; }

  .uptime-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .uptime-label { width: auto; }

  .uptime-bar-container { width: 100%; }

  .uptime-pct {
    width: auto;
    align-self: flex-end;
    margin-top: -28px;
  }

  .uptime-legend {
    margin-left: 0;
    margin-right: 0;
  }

  .status-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .footer {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .metric-value { font-size: 18px; }
}
