:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --accent: #4f46e5;
  --online: #059669;
  --waking: #d97706;
  --offline: #94a3b8;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #111827;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --border: #1f2937;
    --accent: #818cf8;
    --online: #34d399;
    --waking: #fbbf24;
    --offline: #64748b;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 56rem;
  margin: 0 auto;
  padding: 4rem 1rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: -0.02em;
}

.lead {
  max-width: 38rem;
  margin: 0.75rem 0 2.5rem;
  color: var(--muted);
}

.apps {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  height: 100%;
  flex-direction: column;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 150ms, transform 150ms;
}

.card:hover,
.card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card h2 {
  margin: 0.75rem 0 0.25rem;
  font-size: 1.25rem;
}

.card p {
  flex: 1;
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.open {
  color: var(--accent);
  font-weight: 600;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--offline);
}

.status[data-state='online'] .dot {
  background: var(--online);
}

.status[data-state='waking'] .dot,
.status[data-state='checking'] .dot {
  background: var(--waking);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .status .dot {
    animation: none;
    transition: none;
  }
}
