:root {
  --bg: #0b0f1a;
  --surface: rgba(23, 29, 46, 0.66);
  --surface-2: rgba(23, 29, 46, 0.9);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(124, 108, 255, 0.45);
  --text: #eaecf5;
  --muted: #8a91a8;
  --dim: #5b6178;
  --accent: #7c6cff;
  --accent-2: #22d3ee;
  --up: #34d399;
  --down: #f87171;
  --checking: #fbbf24;
  --unknown: #6b7280;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  min-height: 100vh;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(900px 520px at 50% -12%, rgba(124, 108, 255, 0.22), transparent 70%),
    radial-gradient(680px 460px at 86% -4%, rgba(34, 211, 238, 0.12), transparent 62%),
    var(--bg);
  background-attachment: fixed;
}

.wrap { max-width: 960px; margin: 0 auto; padding: clamp(24px, 6vw, 64px) clamp(16px, 4vw, 32px) 64px; }

.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 40px; }
#greeting { margin: 0; font-size: clamp(24px, 4vw, 34px); font-weight: 600; letter-spacing: -0.02em; }
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.clock { text-align: right; line-height: 1.2; }
.time { font-size: clamp(20px, 3vw, 26px); font-variant-numeric: tabular-nums; font-weight: 600; }
.date { color: var(--muted); font-size: 13px; margin-top: 2px; }

.group { margin-bottom: 30px; }
.group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--muted); }
.group-head i { font-size: 18px; color: var(--accent); }
.group-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.group-head .rule { flex: 1; height: 1px; background: linear-gradient(to right, var(--border), transparent); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }

.card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: rgba(23, 29, 46, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card {
    background: var(--surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
}
.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: var(--surface-2);
  box-shadow: 0 18px 40px -20px rgba(124, 108, 255, 0.55);
}

.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(124, 108, 255, 0.14); color: #b3a9ff; font-size: 23px;
}
.card-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.card-sub { margin-top: 4px; color: var(--muted); font-size: 13px; }

.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--unknown); }
.status.up { color: var(--up); }
.status.up .dot { background: var(--up); box-shadow: 0 0 10px 1px rgba(52, 211, 153, 0.8); }
.status.down { color: var(--down); }
.status.down .dot { background: var(--down); box-shadow: 0 0 10px 1px rgba(248, 113, 113, 0.7); }
.status.unknown { color: var(--dim); }
.status.unknown .dot { background: var(--unknown); }
.status.checking { color: var(--checking); }
.status.checking .dot { background: var(--checking); animation: pulse 1.1s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.6); }
  50% { opacity: 0.55; box-shadow: 0 0 8px 2px rgba(251, 191, 36, 0.5); }
}

.fallback { list-style: none; padding: 0; }
.fallback a { color: var(--accent-2); font-size: 16px; line-height: 2; }

@media (max-width: 560px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .clock { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .status.checking .dot { animation: none; }
}
