
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:        #060b14;
  --bg-1:      #0a1322;
  --bg-2:      #0d1a2e;
  --bg-3:      #111f36;
  --border:    rgba(41, 71, 120, 0.45);
  --border-hi: rgba(59, 130, 246, 0.35);
  --accent:    #3b82f6;
  --accent-lo: rgba(59, 130, 246, 0.08);
  --accent-md: rgba(59, 130, 246, 0.18);
  --green:     #22c55e;
  --green-lo:  rgba(34, 197, 94, 0.10);
  --amber:     #f59e0b;
  --amber-lo:  rgba(245, 158, 11, 0.10);
  --red:       #ef4444;
  --red-lo:    rgba(239, 68, 68, 0.10);
  --text:      #dde6f0;
  --text-2:    #8ba0b8;
  --text-3:    #4a6480;
  --mono:      'JetBrains Mono', 'Courier New', monospace;
  --sans:      'Inter', system-ui, sans-serif;
  --r:         6px;
  --r-lg:      10px;
}
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(41,71,120,0.22) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

/* ── Nav ─────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(6,11,20,0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; max-width: 900px; margin: 0 auto; padding: 0 24px;
}
.nav-logo {
  font-family: var(--mono); font-size: 14px; font-weight: 700;
  color: var(--text); text-decoration: none; letter-spacing: .02em;
  display: flex; align-items: center; gap: 8px;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  animation: pulse 2.5s ease-in-out infinite;
}
.pulse-dot.amber { background: var(--amber); }
.pulse-dot.red   { background: var(--red); }
@keyframes pulse {
  0%,100% { opacity:1; box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  50%      { opacity:.7; box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-family: var(--mono); font-size: 12px; color: var(--text-2);
  text-decoration: none; padding: 5px 10px; border-radius: var(--r);
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-2); }
.nav-links .btn-sm {
  color: var(--accent); border: 1px solid var(--border-hi); background: var(--accent-lo);
}
.nav-links .btn-sm:hover { background: var(--accent-md); color: #93c5fd; }

/* ── Layout ──────────────────────────────────── */
.container { max-width: 900px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* ── Hero ────────────────────────────────────── */
.hero { padding: 72px 0 48px; }
.hero-status {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; color: var(--text-3);
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 12px; margin-bottom: 24px;
  transition: color .3s, background .3s, border-color .3s;
}
.hero-status.operational {
  color: var(--green); background: var(--green-lo); border-color: rgba(34,197,94,.25);
}
.hero-status.degraded {
  color: var(--amber); background: var(--amber-lo); border-color: rgba(245,158,11,.25);
}
.hero-status.error {
  color: var(--red); background: var(--red-lo); border-color: rgba(239,68,68,.25);
}
.status-blink {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}
.hero-status.checking .status-blink {
  animation: blink 1s step-end infinite;
}
.hero-status.operational .status-blink { animation: blink 1.8s step-end infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.15} }
h1 {
  font-family: var(--mono); font-size: clamp(48px, 8vw, 82px);
  font-weight: 700; line-height: 1; letter-spacing: -.02em; color: #f0f6ff; margin-bottom: 8px;
}
h1 span { color: var(--accent); }
.hero-sub {
  font-size: 17px; color: var(--text-2); max-width: 480px;
  margin-bottom: 32px; line-height: 1.65;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--r);
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  text-decoration: none; transition: all .15s; cursor: pointer; border: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-ghost {
  background: var(--bg-2); color: var(--text-2); border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-hi); background: var(--bg-3); }

/* ── Route Ticker ────────────────────────────── */
.route-ticker {
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
}
.ticker-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 0;
}
.ticker-label {
  font-family: var(--mono); font-size: 10px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .12em;
}
.ticker-meta {
  display: flex; align-items: center; gap: 10px;
}
.ticker-source {
  font-family: var(--mono); font-size: 10px; color: var(--text-3);
}
.ticker-source a { color: var(--text-3); text-decoration: none; }
.ticker-source a:hover { color: var(--text-2); }
.ticker-refresh {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  color: var(--text-3); font-family: var(--mono); font-size: 10px;
  padding: 2px 7px; cursor: pointer; transition: all .15s;
}
.ticker-refresh:hover { border-color: var(--border-hi); color: var(--accent); }
.ticker-refresh:disabled { opacity: .4; cursor: not-allowed; }
.route-lines {
  display: flex; flex-direction: column;
  font-family: var(--mono); font-size: 11px;
  min-height: 88px; padding: 10px 16px 14px;
  gap: 0;
}
.route-line {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-3); padding: 4px 6px;
  border-bottom: 1px solid rgba(41,71,120,.12);
  white-space: nowrap; overflow: hidden; border-radius: 4px;
  transition: background .3s;
}
.route-line:last-child { border-bottom: none; }
.route-line.hl { background: rgba(59,130,246,.06); }
.route-pfx { color: var(--accent); min-width: 180px; }
.route-metric { color: var(--text-3); min-width: 64px; font-size: 10px; }
.route-peer { color: var(--text-2); flex: 1; overflow: hidden; text-overflow: ellipsis; }
.route-via { color: var(--amber); white-space: nowrap; }
.route-skeleton {
  height: 22px; background: rgba(41,71,120,.18); border-radius: 4px;
  margin-bottom: 6px; animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0%,100%{opacity:.5} 50%{opacity:.9} }
.route-empty {
  font-family: var(--mono); font-size: 11px; color: var(--text-3);
  padding: 12px 0; text-align: center;
}

/* ── Status page / Cachet ────────────────────── */
.cachet-panel { margin-top: 16px; }
.status-link {
  font-family: var(--mono); font-size: 10px; color: var(--text-3);
  text-decoration: none;
}
.status-link:hover { color: var(--text-2); }
.cachet-summary {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.cachet-summary-text { font-size: 13px; color: var(--text-2); }
.cachet-summary-text strong { color: var(--text); font-weight: 600; }
.cachet-incidents { display: flex; flex-direction: column; gap: 10px; }
.cachet-incident {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r); transition: border-color .15s, background .15s;
}
.cachet-incident:hover { border-color: var(--border-hi); background: var(--bg-3); }
.cachet-incident-link {
  font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none;
}
.cachet-incident-link:hover { color: #fff; }
.cachet-incident-meta {
  font-family: var(--mono); font-size: 10px; color: var(--text-3);
  display: flex; flex-wrap: wrap; gap: 8px;
}
.cachet-incident-detail {
  font-family: var(--mono); font-size: 10px; color: var(--text-3);
  margin-top: 2px;
}
.cachet-incident-message {
  font-size: 12px; color: var(--text-2);
  line-clamp: 2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.cachet-empty {
  font-family: var(--mono); font-size: 11px; color: var(--text-3);
  padding: 2px 0;
}
.cachet-skeleton {
  height: 18px; border-radius: 4px; background: rgba(41,71,120,.18);
  animation: shimmer 1.4s ease infinite;
}

/* ── Stats Bar ───────────────────────────────── */
.stats-bar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; margin-bottom: 48px;
}
.stat-item { background: var(--bg-1); padding: 18px 20px; }
.stat-num {
  font-family: var(--mono); font-size: 26px; font-weight: 700;
  color: var(--text); line-height: 1; margin-bottom: 4px;
}
.stat-num .sa { color: var(--accent); }
.stat-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; font-family: var(--mono); }
.stat-skeleton { display: inline-block; width: 40px; height: 22px; background: rgba(41,71,120,.25); border-radius: 3px; vertical-align: middle; animation: shimmer 1.4s ease infinite; }

/* ── Grid / Cards ────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px,1fr)); gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 16px; margin-bottom: 16px; }
.card { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; transition: border-color .2s; }
.card:hover { border-color: var(--border-hi); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-family: var(--mono); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--text-2); }

/* ── Section ─────────────────────────────────── */
.section { margin-bottom: 48px; }
.section-label {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .15em; color: var(--text-3); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.section-label::before { content: ''; width: 24px; height: 1px; background: var(--border-hi); }

/* ── Badges ──────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 4px; font-family: var(--mono);
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  transition: background .3s, color .3s;
}
.badge-blue  { background: var(--accent-lo); color: #93c5fd; border: 1px solid rgba(59,130,246,.25); }
.badge-green { background: var(--green-lo);  color: #86efac; border: 1px solid rgba(34,197,94,.25); }
.badge-amber { background: var(--amber-lo);  color: #fcd34d; border: 1px solid rgba(245,158,11,.25); }
.badge-red   { background: var(--red-lo);    color: #fca5a5; border: 1px solid rgba(239,68,68,.25); }
.badge-gray  { background: rgba(74,100,128,.12); color: var(--text-2); border: 1px solid rgba(74,100,128,.3); }
.badge-skeleton { background: rgba(41,71,120,.2); color: transparent; border: 1px solid transparent; animation: shimmer 1.4s ease infinite; }

/* ── PoP items ───────────────────────────────── */
.pop-item { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.pop-item:last-child { border-bottom: none; padding-bottom: 0; }
.pop-icon { width: 36px; height: 36px; border-radius: var(--r); background: var(--accent-lo); border: 1px solid var(--border-hi); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--accent); flex-shrink: 0; }
.pop-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.pop-detail { font-size: 12px; color: var(--text-2); font-family: var(--mono); }
.pop-ip { font-size: 11px; color: var(--text-3); font-family: var(--mono); margin-top: 2px; min-height: 14px; }
.pop-badge { margin-left: auto; flex-shrink: 0; }

/* ── Policies ────────────────────────────────── */
.policy-rule { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.policy-rule:last-child { border-bottom: none; padding-bottom: 0; }
.policy-check { color: var(--green); font-family: var(--mono); font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.policy-cross { color: var(--red); font-family: var(--mono); font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.policy-text { color: var(--text-2); line-height: 1.5; }

/* ── Resource links ──────────────────────────── */
.resource-link { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r); text-decoration: none; transition: all .15s; margin-bottom: 8px; }
.resource-link:hover { border-color: var(--border-hi); background: var(--bg-3); }
.resource-link:last-child { margin-bottom: 0; }
.resource-title { font-size: 13px; font-weight: 500; color: var(--text); }
.resource-desc { font-size: 11px; font-family: var(--mono); color: var(--text-3); margin-top: 2px; }
.resource-arrow { color: var(--text-3); font-size: 12px; }

/* ── Footer ──────────────────────────────────── */
footer { border-top: 1px solid var(--border); padding: 28px 0; position: relative; z-index: 1; }
.footer-inner { max-width: 900px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-left { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.footer-links { display: flex; gap: 16px; }
.footer-links a { font-family: var(--mono); font-size: 11px; color: var(--text-3); text-decoration: none; }
.footer-links a:hover { color: var(--text-2); }

/* ── Misc ────────────────────────────────────── */
.security-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.security-note { font-size: 12px; color: var(--text-3); font-family: var(--mono); margin-top: 8px; }

@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  h1 { font-size: 48px; }
  .nav-links a:not(.btn-sm) { display: none; }
  .route-pfx { min-width: 140px; }
}
