:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --aw: #166534;
  --aw-soft: #ecfdf3;
  --sp: #1b2d5b;
  --sp-accent: #e8750a;
  --sp-soft: #eef2fa;
  --fp: #1e3a5f;
  --fp-accent: #2563eb;
  --fp-soft: #eff6ff;
}

:root[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #131c2e;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #1e293b;
  --aw-soft: #0f2a1b;
  --sp-soft: #18223d;
  --fp-soft: #172554;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 32px;
}

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

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--fp), var(--sp));
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.brand-name { font-weight: 700; font-size: 16px; }
.brand-sub { font-size: 12px; color: var(--muted); }
.clock { font-size: 13px; color: var(--muted); text-transform: capitalize; }

main {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

h1 { font-size: 28px; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 32px; max-width: 560px; }

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

.app {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.app:hover, .app:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
  outline: none;
}

.app-aw:hover, .app-aw:focus-visible { border-color: var(--aw); }
.app-sp:hover, .app-sp:focus-visible { border-color: var(--sp-accent); }
.app-fp:hover, .app-fp:focus-visible { border-color: var(--fp-accent); }

.app-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }

.app-head img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 12px;
  padding: 6px;
}

.app-aw .app-head img { background: var(--aw-soft); }
.app-sp .app-head img { background: var(--sp-soft); }
.app-fp .app-head img { background: var(--fp-soft); }

.app h2 { margin: 0 0 8px; font-size: 20px; }
.app p { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.5; flex: 1; }

.go { font-weight: 600; font-size: 14px; }
.app-aw .go { color: var(--aw); }
.app-sp .go { color: var(--sp-accent); }
.app-fp .go { color: var(--fp-accent); }

:root[data-theme="dark"] .app-aw .go { color: #4ade80; }

.status {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--border);
  color: var(--muted);
}

.status::before { content: '● '; }
.status[data-state="up"] { background: #dcfce7; color: #166534; }
.status[data-state="down"] { background: #fee2e2; color: #b91c1c; }

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 32px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
  .top { padding: 14px 16px; }
  .clock { display: none; }
  h1 { font-size: 22px; }
  footer { padding: 14px 16px; }
}

.top-right { display: flex; align-items: center; gap: 14px; }

.theme-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.theme-btn:hover { border-color: var(--muted); }
