:root {
  --bg: #07080d;
  --text: #f3f5fa;
  --muted: #c3c9d8;
  --faint: #8d95aa;
  --glass: rgba(12, 14, 22, 0.48);
  --glass-hi: rgba(20, 24, 38, 0.58);
  --border: rgba(255, 255, 255, 0.1);
  --border-hi: rgba(255, 255, 255, 0.22);
  --accent: #7c9cff;
  --accent-2: #c084fc;
  --good: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 20px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
[hidden] { display: none !important; }

/* ---------- backdrop: photo stays visible, light aurora on top ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.photo {
  position: absolute; inset: -24px;
  background-size: cover; background-position: center;
  filter: blur(7px) saturate(1.15) brightness(.68);
  opacity: 0; transition: opacity 1.2s ease;
  animation: zoom 40s ease-in-out infinite alternate;
}
.photo.on { opacity: 1; }
@keyframes zoom { to { transform: scale(1.06); } }
.blob {
  position: absolute; width: 50vmax; height: 50vmax; border-radius: 50%;
  filter: blur(100px); mix-blend-mode: screen; will-change: transform;
}
.b1 { background: #4f46e5; top: -22vmax; left: -15vmax; opacity: .26; animation: drift1 26s ease-in-out infinite alternate; }
.b2 { background: #a21caf; bottom: -25vmax; right: -15vmax; opacity: .2; animation: drift2 32s ease-in-out infinite alternate; }
.b3 { background: #0d9488; top: 30%; left: 40%; width: 32vmax; height: 32vmax; opacity: .16; animation: drift3 22s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(18vmax, 12vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-20vmax, -10vmax) scale(.9); } }
@keyframes drift3 { to { transform: translate(-25vmax, 15vmax) scale(1.2); } }
.veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7,8,13,.25), rgba(7,8,13,.62)); }

/* ---------- layout ---------- */
main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px 20px 40px;
  display: flex; flex-direction: column; gap: 16px;
}

.glass {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 10px 40px -14px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
  isolation: isolate;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
/* spotlight that follows the pointer */
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: radial-gradient(420px circle at var(--mx, -999px) var(--my, -999px), rgba(124,156,255,.14), transparent 45%);
  opacity: 0; transition: opacity .35s; pointer-events: none;
}
.glass::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  padding: 1px;
  background: radial-gradient(260px circle at var(--mx, -999px) var(--my, -999px), rgba(170,190,255,.6), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .35s;
}
.glass:hover::before, .glass:hover::after { opacity: 1; }

.reveal { animation: rise .7s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); filter: blur(4px); } }

/* ---------- hero: date + clock | weather, same height ---------- */
.hero { display: grid; grid-template-columns: 1.45fr 1fr; gap: 16px; align-items: stretch; }
.hero-main { padding: 20px 30px; display: flex; flex-direction: column; justify-content: center; }
.date { font-size: clamp(14px, 1.4vw, 17px); font-weight: 500; color: var(--muted); letter-spacing: .01em; }
.clock {
  font-family: var(--mono); font-weight: 500;
  font-size: clamp(52px, 7vw, 86px); line-height: 1; letter-spacing: -.05em;
  margin-top: 6px; display: flex; align-items: flex-start; gap: 6px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff 30%, #c7d2fe);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 30px rgba(124,156,255,.35));
  text-shadow: none;
}
.clock .sec { font-size: .3em; margin-top: .35em; letter-spacing: 0; opacity: .6; }

/* weather */
.weather { padding: 16px 22px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.w-place { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.w-main { display: flex; align-items: center; gap: 12px; margin: 6px 0 2px; }
.w-icon svg { width: 42px; height: 42px; stroke-width: 1.4; color: #fde68a; filter: drop-shadow(0 0 16px rgba(253,230,138,.45)); animation: float 6s ease-in-out infinite; }
.w-icon.cloudy svg { color: #e2e8f0; filter: drop-shadow(0 0 12px rgba(226,232,240,.3)); }
.w-icon.wet svg { color: #93c5fd; filter: drop-shadow(0 0 14px rgba(147,197,253,.4)); }
.w-icon.night svg { color: #c4b5fd; filter: drop-shadow(0 0 16px rgba(196,181,253,.45)); }
@keyframes float { 50% { transform: translateY(-4px); } }
.w-temp { font-family: var(--mono); font-size: 42px; font-weight: 500; letter-spacing: -.04em; line-height: 1; }
.w-label { font-size: 15px; font-weight: 500; }
.w-meta { color: var(--faint); font-size: 12.5px; margin-top: 4px; }
.w-days { display: flex; flex-direction: column; gap: 6px; padding-left: 20px; border-left: 1px solid var(--border); }
.w-day { display: grid; grid-template-columns: 34px 22px auto; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.w-day svg { width: 20px; height: 20px; color: var(--text); }
.w-day .t { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.w-day .t b { color: var(--text); font-weight: 500; }
.w-day .t span { color: var(--faint); }

/* ---------- stats (values only) ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { padding: 13px 18px; }
.stat header { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.stat header svg { color: var(--tone); }
.stat .big { font-family: var(--mono); font-size: 26px; font-weight: 500; letter-spacing: -.03em; margin-top: 4px; line-height: 1.1; transition: color .4s; }
.sub { margin-top: 3px; color: var(--faint); font-size: 12.5px; font-family: var(--mono); }
.stat.hot .big { color: var(--warn); }
.stat.crit .big { color: var(--bad); }

/* ---------- search ---------- */
.search {
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px; height: 48px; cursor: text;
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.search svg { color: var(--muted); width: 20px; height: 20px; }
.search input {
  flex: 1; min-width: 0; height: 100%;
  background: none; border: 0; outline: 0; color: var(--text);
  font: inherit; font-size: 16px;
}
.search input::placeholder { color: var(--faint); }
.search:focus-within {
  border-color: rgba(124,156,255,.55); background: var(--glass-hi);
  box-shadow: 0 0 0 4px rgba(124,156,255,.14), 0 10px 40px -14px rgba(0,0,0,.55);
}
.hint { color: var(--faint); font-size: 12px; white-space: nowrap; }
kbd {
  font-family: var(--mono); font-size: 11.5px; padding: 2px 7px; border-radius: 6px;
  border: 1px solid var(--border-hi); background: rgba(255,255,255,.08); color: var(--muted);
}

/* ---------- groups / services ---------- */
#groups { display: flex; flex-direction: column; gap: 18px; }
.group { display: flex; flex-direction: column; gap: 10px; }
.group-title {
  margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text); display: flex; align-items: center; gap: 10px;
  text-shadow: 0 1px 6px rgba(0,0,0,.7);
}
.group-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255,255,255,.3), transparent); }
.group-title .count { font-family: var(--mono); color: var(--muted); letter-spacing: 0; font-weight: 400; }
/* all cards in the grid share the height of the tallest one */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); grid-auto-rows: 1fr; gap: 10px; }

.svc {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 16px;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .25s, background .25s, opacity .25s;
}
.svc:hover { transform: translateY(-3px); border-color: var(--border-hi); background: var(--glass-hi); }
.svc:active { transform: translateY(-1px) scale(.99); }
.svc.active { border-color: rgba(124,156,255,.65); box-shadow: 0 0 0 3px rgba(124,156,255,.18), 0 10px 40px -14px rgba(0,0,0,.55); }
.ico {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; align-self: start;
  background: linear-gradient(145deg, rgba(255,255,255,.14), rgba(255,255,255,.03));
  border: 1px solid var(--border);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.svc:hover .ico { transform: scale(1.08) rotate(-4deg); }
.ico img { width: 26px; height: 26px; object-fit: contain; }
.letter { font-weight: 700; font-size: 18px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.meta { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.name { font-weight: 600; font-size: 15.5px; }
.desc { color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.state { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; font-family: var(--mono); font-size: 11px; color: var(--faint); align-self: start; padding-top: 4px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); position: relative; }
.dot.up { background: var(--good); box-shadow: 0 0 10px rgba(74,222,128,.7); }
.dot.up::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: halo 2.4s ease-out infinite; }
.dot.down { background: var(--bad); box-shadow: 0 0 10px rgba(248,113,113,.7); }
.dot.slow { background: var(--warn); box-shadow: 0 0 10px rgba(251,191,36,.6); }
@keyframes halo { to { transform: scale(2.6); opacity: 0; } }
.dim { opacity: .15; filter: grayscale(1); pointer-events: none; }
.gone { display: none !important; }

/* ---------- bookmarks ---------- */
.bm-list { display: flex; flex-wrap: wrap; gap: 10px; }
.bm {
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px 9px 10px; border-radius: 999px;
  font-size: 14px; font-weight: 500; transition: transform .2s, border-color .2s, background .2s;
}
.bm:hover { transform: translateY(-2px); border-color: var(--border-hi); background: var(--glass-hi); }
.bm img { width: 20px; height: 20px; object-fit: contain; }
.bm .letter { width: 20px; text-align: center; }

/* ---------- version ---------- */
.version { text-align: center; font-family: var(--mono); font-size: 11px; color: var(--faint); opacity: .7; margin-top: 4px; text-shadow: 0 1px 2px rgba(0,0,0,.5); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  main { padding: 20px 16px 40px; gap: 16px; }
  .hero-main { padding: 22px; }
  .weather { grid-template-columns: 1fr; }
  .w-days { flex-direction: row; justify-content: space-between; padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--border); }
  .w-day { grid-template-columns: auto; justify-items: center; text-align: center; gap: 4px; }
  .stats { gap: 12px; }
  .stat .big { font-size: 26px; }
  .hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
