:root {
  --bg: #0b1220;
  --bg-2: #121c2f;
  --panel: rgba(18, 28, 47, 0.82);
  --line: rgba(148, 163, 184, 0.18);
  --text: #e8eef8;
  --muted: #93a4bd;
  --own: #2dd4bf;
  --own-dim: rgba(45, 212, 191, 0.12);
  --up: #34d399;
  --down: #f87171;
  --accent: #f59e0b;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --font-display: "Space Grotesk", "IBM Plex Sans", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(148,163,184,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}
.bg-glow {
  position: fixed; inset: auto auto 10% -10%; width: 55vw; height: 55vw; z-index: 0;
  background: radial-gradient(circle, rgba(245,158,11,0.18), transparent 60%);
  filter: blur(10px); pointer-events: none;
  animation: drift 14s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate(0, 0); }
  to { transform: translate(12%, -8%); }
}

.topbar, main, footer { position: relative; z-index: 1; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 18px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  background: rgba(11, 18, 32, 0.7);
  position: sticky; top: 0;
  z-index: 100; /* keep above hero transforms so nav links stay clickable */
}
.brand {
  display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit;
  min-width: 0;
  flex-shrink: 0;
}
.brand img {
  border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--line);
}
.brand strong {
  display: block; font-family: var(--font-display); font-size: 1.2rem; letter-spacing: 0.02em;
}
.brand span { color: var(--muted); font-size: 0.8rem; }

.top-actions {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
  pointer-events: auto;
}
.top-actions .btn {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--up);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.meta-chip {
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted);
  border: 1px solid var(--line); padding: 6px 10px; border-radius: 999px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(18, 28, 47, 0.65);
}
.lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active,
.lang-btn[aria-pressed="true"] {
  background: rgba(45, 212, 191, 0.18);
  color: var(--own);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 0.9rem;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--own); color: #06241f; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.tiny { padding: 4px 10px; font-size: 0.78rem; }

main { padding: 28px clamp(16px, 4vw, 48px) 64px; max-width: 1200px; margin: 0 auto; }

.hero { margin-bottom: 36px; animation: rise .7s ease both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.eyebrow {
  font-family: var(--font-mono); color: var(--accent); letter-spacing: 0.14em;
  font-size: 0.75rem; margin: 0 0 10px;
}
.hero h1 {
  font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.05; margin: 0 0 12px; max-width: 14ch;
}
.hero h1 em { font-style: normal; color: var(--own); }
.lede { color: var(--muted); max-width: 42ch; margin: 0 0 24px; font-size: 1.05rem; }

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat {
  min-width: 120px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.stat span {
  display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700;
}
.stat label { color: var(--muted); font-size: 0.8rem; }

.board, .sources {
  background: var(--panel); border: 1px solid var(--line); border-radius: 24px;
  box-shadow: var(--shadow); overflow: hidden; margin-bottom: 20px;
  animation: rise .8s ease both .1s;
}
.board-head {
  display: flex; justify-content: space-between; align-items: end; gap: 12px;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.board-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.2rem; }
.board-head p { margin: 0; color: var(--muted); font-size: 0.85rem; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td {
  text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line);
  font-size: 0.92rem; vertical-align: middle;
}
th {
  color: var(--muted); font-weight: 500; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}
th.own, td.own-cell { color: var(--own); }
tbody tr { transition: background .2s ease; }
tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody tr.own-row { background: var(--own-dim); }
.model-name { font-weight: 600; }
.model-family { display: block; color: var(--muted); font-size: 0.75rem; margin-top: 2px; }
.mono { font-family: var(--font-mono); }
.discount.good { color: var(--up); }
.discount.bad { color: var(--down); }
.loading, .empty { text-align: center; color: var(--muted); padding: 36px !important; }

.uptime {
  background: var(--panel); border: 1px solid var(--line); border-radius: 24px;
  box-shadow: var(--shadow); overflow: hidden; margin-bottom: 20px;
  animation: rise .85s ease both .15s;
  padding-bottom: 8px;
}
.uptime-summary {
  text-align: right;
}
.uptime-summary strong {
  display: block; font-family: var(--font-display); font-size: 1.8rem;
  color: var(--own); line-height: 1.1;
}
.uptime-summary span { color: var(--muted); font-size: 0.78rem; }
.uptime-stats {
  display: flex; gap: 10px; flex-wrap: wrap; padding: 0 20px 14px;
}
.uptime-stats .chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted);
}
.uptime-stats .chip b { color: var(--text); font-weight: 600; }
.uptime-months { padding: 4px 20px 8px; display: grid; gap: 12px; }
.uptime-month-row { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: start; }
.uptime-month-label {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted);
  padding-top: 2px;
}
.uptime-days {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.day-cell {
  width: 12px; height: 12px; border-radius: 3px;
  background: rgba(52, 211, 153, 0.85);
  transition: transform .15s ease, box-shadow .15s ease;
}
.day-cell:hover { transform: scale(1.35); box-shadow: 0 0 0 2px rgba(255,255,255,0.12); }
.day-cell.degraded { background: #fbbf24; }
.day-cell.maintenance { background: #60a5fa; }
.day-cell.down { background: #f87171; }
.uptime-legend {
  display: flex; gap: 14px; flex-wrap: wrap; padding: 8px 20px 14px;
  color: var(--muted); font-size: 0.78rem;
}
.uptime-legend .dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 6px; vertical-align: -1px;
}
.uptime-legend .dot.ok { background: rgba(52, 211, 153, 0.85); }
.uptime-legend .dot.degraded { background: #fbbf24; }
.uptime-legend .dot.maintenance { background: #60a5fa; }
.uptime-legend .dot.down { background: #f87171; }
.uptime-incidents { padding: 0 20px 18px; display: grid; gap: 10px; }
.incident {
  border-top: 1px solid var(--line); padding-top: 12px;
}
.incident time {
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted);
}
.incident h3 {
  margin: 4px 0 4px; font-size: 0.95rem; font-family: var(--font-display); font-weight: 600;
}
.incident p { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.5; }

.foot {
  padding: 24px clamp(16px, 4vw, 48px) 40px; color: var(--muted);
  border-top: 1px solid var(--line); font-size: 0.82rem;
}
.foot p { max-width: 900px; margin: 0 0 8px; }

@media (max-width: 720px) {
  .hero h1 { max-width: none; }
  .top-actions .meta-chip { display: none; }
  .uptime-month-row { grid-template-columns: 56px 1fr; gap: 8px; }
  .day-cell { width: 10px; height: 10px; }
}
