:root {
  --bg: #eceef9;
  --surface: #fbfcff;
  --surface-2: #eff2ff;
  --ink: #171a2f;
  --muted: #646c95;
  --line: #d8ddf8;
  --brand: #5d6dff;
  --brand-ink: #f4f6ff;
  --accent: #7f8dff;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #ef4444;
  --shadow-soft: 0 16px 40px rgba(41, 55, 136, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Manrope", "Segoe UI", sans-serif;
  line-height: 1.45;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background: repeating-linear-gradient(90deg,
    rgba(93,109,255,.06) 0, rgba(93,109,255,.06) 1px,
    transparent 1px, transparent 58px);
}

.background-layer {
  position: fixed; inset: 0; z-index: -4;
  background:
    radial-gradient(46rem 28rem at 8% 3%, rgba(93,109,255,.26), transparent 65%),
    radial-gradient(38rem 20rem at 96% 8%, rgba(127,141,255,.24), transparent 72%),
    radial-gradient(36rem 20rem at 55% 95%, rgba(58,72,158,.19), transparent 72%);
}

a { color: inherit; text-decoration: none; }

main, .topbar, .footer {
  width: min(900px, 92vw);
  margin-inline: auto;
}

/* ===================== Topbar ===================== */
.topbar {
  margin-top: 18px; padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(19,38,63,.14);
  background: rgba(251,252,255,.95);
  backdrop-filter: blur(9px);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  position: sticky; top: 10px; z-index: 70;
}

.brand { display: inline-flex; align-items: center; gap: 11px; }

.brand-mark {
  width: 42px; height: 42px;
  display: inline-block; position: relative;
  clip-path: polygon(50% 0,94% 23%,94% 77%,50% 100%,6% 77%,6% 23%);
  background: linear-gradient(160deg,#7087ff,#4f61ec);
  box-shadow: 0 12px 28px rgba(84,98,241,.45);
}

.brand-mark::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(170deg,rgba(255,255,255,.34),rgba(255,255,255,0));
  clip-path: polygon(50% 0,94% 23%,50% 46%,6% 23%);
}

.brand-mark::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg,rgba(0,0,0,.18),rgba(0,0,0,0));
  clip-path: polygon(50% 46%,94% 23%,94% 77%,50% 100%);
}

.brand-text {
  font-size: 1.04rem;
  font-family: "IBM Plex Mono","Consolas",monospace;
  text-transform: lowercase; font-weight: 700;
}

.nav-links { display: flex; align-items: center; gap: 14px; }
.nav-links > a:not(.btn) { font-size: .95rem; color: var(--muted); font-weight: 700; transition: color .2s; }
.nav-links > a:not(.btn):hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; padding: 11px 16px;
  font-weight: 800; font-size: .92rem;
  transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-solid {
  color: var(--brand-ink);
  background: linear-gradient(140deg,var(--brand),#7b8fff);
  box-shadow: 0 14px 32px rgba(93,109,255,.42);
}

/* ===================== Hero ===================== */
.hero-status { margin-top: 54px; text-align: center; }

.hero-status h1 {
  margin: 16px 0 0;
  font-family: "Russo One","Trebuchet MS",sans-serif;
  font-size: clamp(1.8rem,4vw,2.8rem); line-height: 1.1;
}

.hero-status .subtitle { margin: 10px 0 0; color: var(--muted); font-size: .95rem; }

.status-indicator {
  display: inline-flex; align-items: center; gap: 10px;
  border-radius: 999px; padding: 8px 22px;
  background: var(--surface); border: 1px solid var(--line);
  font-weight: 800; font-size: 1rem;
}

.status-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--muted); transition: background .3s;
}

.status-dot.ok {
  background: var(--success);
  animation: pulse-g 1.8s ease-out infinite;
}
.status-dot.fail {
  background: var(--danger);
  animation: pulse-r 1.8s ease-out infinite;
}

@keyframes pulse-g {
  0%  { box-shadow: 0 0 0 0 rgba(52,211,153,.7); }
  70% { box-shadow: 0 0 0 10px rgba(52,211,153,0); }
  100%{ box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}
@keyframes pulse-r {
  0%  { box-shadow: 0 0 0 0 rgba(239,68,68,.7); }
  70% { box-shadow: 0 0 0 10px rgba(239,68,68,0); }
  100%{ box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

/* ===================== Overall bar ===================== */
.overall-bar {
  margin-top: 28px;
  border-radius: 16px;
  border: 1px solid rgba(19,38,63,.11);
  background: var(--surface);
  padding: 16px 22px;
  display: flex; align-items: center; justify-content: space-between;
}

.overall-label {
  font-weight: 700; color: var(--muted);
  font-size: .9rem; text-transform: uppercase; letter-spacing: .06em;
}

.overall-value {
  font-family: "Russo One","Trebuchet MS",sans-serif;
  font-size: 1.6rem;
}

.uptime-great { color: #059669; }
.uptime-ok    { color: #d97706; }
.uptime-bad   { color: var(--danger); }

/* ===================== Filter ===================== */
.filter-bar {
  margin-top: 24px;
  display: flex; gap: 6px; justify-content: center;
}

.filter-btn {
  appearance: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  padding: 8px 20px; border-radius: 10px;
  font-family: "Manrope",sans-serif; font-size: .88rem; font-weight: 700;
  cursor: pointer; transition: all .2s;
}
.filter-btn:hover { border-color: var(--accent); color: var(--ink); }
.filter-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ===================== Service cards ===================== */
.services-list {
  margin-top: 28px;
  display: grid; gap: 14px;
  margin-bottom: 60px;
}

.service-card {
  border-radius: 16px;
  border: 1px solid rgba(19,38,63,.11);
  background: var(--surface);
  padding: 18px 20px;
  transition: box-shadow .2s;
}

.service-card:hover { box-shadow: var(--shadow-soft); }

.svc-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}

.svc-left { display: flex; align-items: center; gap: 10px; }

.svc-dot {
  width: 12px; height: 12px; border-radius: 50%;
  flex-shrink: 0;
}
.svc-dot.svc-online  { background: var(--success); box-shadow: 0 0 8px rgba(52,211,153,.5); }
.svc-dot.svc-offline { background: var(--danger); box-shadow: 0 0 8px rgba(239,68,68,.5); }

.svc-name {
  font-weight: 800; font-size: 1.05rem;
}

.svc-badge {
  border-radius: 999px; padding: 4px 14px;
  font-size: .75rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em;
}
.svc-badge.svc-online  { background: rgba(16,185,129,.12); color: #059669; }
.svc-badge.svc-offline { background: rgba(239,68,68,.12); color: var(--danger); }

.svc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.svc-stat {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 4px;
  border-radius: 10px;
  background: var(--surface-2);
}

.svc-stat-label {
  font-size: .7rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
}

.svc-stat-value {
  font-family: "IBM Plex Mono",monospace;
  font-size: .92rem; font-weight: 700;
  margin-top: 2px;
}

/* History ticks */
.svc-history {
  display: flex; gap: 2px; height: 28px; align-items: stretch;
}

.history-empty {
  width: 100%; text-align: center; color: var(--muted); font-size: .82rem;
  display: flex; align-items: center; justify-content: center;
}

.h-tick {
  flex: 1; border-radius: 3px;
  background: var(--surface-2);
  transition: background .2s;
  position: relative; min-width: 2px;
}
.h-tick.ok   { background: var(--success); }
.h-tick.fail { background: var(--danger); }
.h-tick:hover { opacity: .8; cursor: default; }

.h-tick::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 4px 10px; border-radius: 6px;
  font-size: .7rem; font-family: "IBM Plex Mono",monospace;
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .15s; z-index: 10;
}
.h-tick:hover::after { opacity: 1; }

/* ===================== Footer ===================== */
.footer {
  border-top: 1px solid rgba(19,38,63,.14);
  padding: 15px 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; color: var(--muted); font-weight: 700; flex-wrap: wrap;
}
.footer a { color: #4c5ee0; }

/* ===================== Responsive ===================== */
@media (max-width: 700px) {
  .hero-status h1 { font-size: 1.6rem; }
  .nav-links > a:not(.btn) { display: none; }
  .filter-bar { flex-wrap: wrap; }
  .filter-btn { padding: 7px 14px; font-size: .82rem; }
  .svc-stats { grid-template-columns: repeat(2, 1fr); }
  .overall-bar { flex-direction: column; gap: 6px; text-align: center; }
}
