:root {
  --bg: #0b0f17;
  --bg-glow-1: rgba(20, 184, 166, .16);
  --bg-glow-2: rgba(99, 102, 241, .14);
  --card: rgba(255, 255, 255, .045);
  --card-hover: rgba(255, 255, 255, .08);
  --border: rgba(255, 255, 255, .08);
  --border-hover: rgba(255, 255, 255, .18);
  --text: #e8ecf4;
  --muted: #8b94a7;
  --faint: #5b6476;
  --ok: #34d399;
  --bad: #f87171;
  --shadow: 0 20px 40px -24px rgba(0, 0, 0, .8);
  --emblem: #b48cff;
  --emblem-water: #22e4ff;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6fb;
    --bg-glow-1: rgba(20, 184, 166, .14);
    --bg-glow-2: rgba(99, 102, 241, .12);
    --card: rgba(255, 255, 255, .75);
    --card-hover: #fff;
    --border: rgba(15, 23, 42, .08);
    --border-hover: rgba(15, 23, 42, .18);
    --text: #0f172a;
    --muted: #5b6476;
    --faint: #94a3b8;
    --ok: #059669;
    --bad: #dc2626;
    --shadow: 0 18px 36px -24px rgba(15, 23, 42, .35);
    --emblem: #7c4dde;
    --emblem-water: #0aa5c0;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(60rem 40rem at 10% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(50rem 36rem at 100% 0%, var(--bg-glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 1040px; margin: 0 auto; padding: clamp(28px, 6vw, 72px) 16px 48px; }

header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 40px; }
.brand { display: flex; align-items: center; gap: clamp(12px, 2.5vw, 20px); min-width: 0; }
.emblem { flex: none; width: clamp(64px, 11vw, 92px); aspect-ratio: 40 / 24; max-width: 100%; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.emblem .em-h { stroke: var(--emblem); stroke-width: 1.5; }
.emblem .em-b { stroke: var(--emblem); stroke-width: .8; opacity: .55; }
.emblem .em-w { stroke: var(--emblem-water); stroke-width: 1.6; opacity: .85; }
.eyebrow { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.1; letter-spacing: -.02em; margin: 0; font-weight: 700; }
.clock { text-align: right; }
@media (max-width: 560px) { .clock { text-align: left; width: 100%; } }
.clock .time { font-size: clamp(26px, 4vw, 34px); font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.clock .date { color: var(--muted); font-size: 14px; }

section { margin-bottom: 36px; }
h2 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 14px 2px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }

a.card {
  --accent: #14b8a6;
  position: relative; display: flex; align-items: center; gap: 16px;
  padding: 18px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--border);
  color: inherit; text-decoration: none;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
  overflow: hidden;
}
a.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(24rem 10rem at 0% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
  opacity: .7; transition: opacity .18s ease;
}
a.card:hover, a.card:focus-visible { transform: translateY(-2px); background: var(--card-hover); border-color: color-mix(in srgb, var(--accent) 45%, var(--border-hover)); outline: none; }
a.card:hover::before, a.card:focus-visible::before { opacity: 1; }
a.card:active { transform: translateY(0); }

.icon {
  flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 95%, #fff 5%), color-mix(in srgb, var(--accent) 70%, #000 30%));
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent), inset 0 1px 0 rgba(255,255,255,.25);
  position: relative;
}
.icon svg { width: 26px; height: 26px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.body { min-width: 0; flex: 1; position: relative; }
.name { font-weight: 650; font-size: 17px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.desc { display: block; color: var(--muted); font-size: 14px; margin-top: 1px; }
.host { display: block; color: var(--faint); font-size: 12px; margin-top: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arrow { flex: none; position: relative; color: var(--faint); transition: transform .18s ease, color .18s ease; }
.arrow svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
a.card:hover .arrow { transform: translateX(3px); color: var(--accent); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; transition: background .3s ease; }
.dot.up { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.dot.down { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 22%, transparent); }

footer { margin-top: 12px; color: var(--faint); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; }
footer code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* hidden until layout.json (Ally's tile arrangement) is applied, max ~1.5 s */

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.icon .emoji { font-size: 22px; line-height: 1; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
button.link:hover { color: var(--text); }

/* sign-in page */
main.signin { max-width: 420px; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 32px 16px; }
main.signin .emblem { width: 120px; margin-bottom: 18px; }
main.signin .muted { color: var(--muted); margin: 12px 0 0; }
main.signin .note { color: var(--bad); min-height: 1.5em; margin: 12px 0; }
a.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 22px; border-radius: 14px; font-weight: 600; text-decoration: none;
  color: #fff; background: linear-gradient(145deg, #8b5cf6, #6366f1);
  box-shadow: 0 12px 28px -12px rgba(99, 102, 241, .8);
}
a.button:hover { filter: brightness(1.08); }
