:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --text: #1f1e1c;
  --text-2: #5f5e5a;
  --text-3: #8c8b85;
  --border: rgba(31, 30, 28, 0.14);
  --border-strong: rgba(31, 30, 28, 0.28);
  --hover: rgba(31, 30, 28, 0.05);

  --ok: #1d9e75;
  --slow: #ba7517;
  --down: #e24b4a;
  --unknown: #888780;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a19;
    --surface: #242422;
    --text: #edece7;
    --text-2: #b4b2a9;
    --text-3: #7d7c76;
    --border: rgba(237, 236, 231, 0.12);
    --border-strong: rgba(237, 236, 231, 0.26);
    --hover: rgba(237, 236, 231, 0.06);

    --ok: #5dcaa5;
    --slow: #ef9f27;
    --down: #f09595;
    --unknown: #888780;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 16px 8vh;
}

.clock {
  font-size: clamp(64px, 11vw, 120px);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.greeting {
  margin-top: 14px;
  font-size: 18px;
  color: var(--text-2);
}

.date {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-3);
}

.search {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin-top: 40px;
}

.search input {
  width: 100%;
  height: 50px;
  padding: 0 18px;
  font: inherit;
  font-size: 17px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: none;
  transition: border-color 150ms ease;
}

.search input::placeholder { color: var(--text-3); }
.search input:hover { border-color: var(--border-strong); }
.search input:focus { border-color: var(--border-strong); }

.suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  z-index: 2;
}

.suggestions li {
  padding: 9px 14px;
  font-size: 15px;
  color: var(--text-2);
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestions li .hint { color: var(--text-3); margin-right: 6px; }
.suggestions li[aria-selected="true"],
.suggestions li:hover { background: var(--hover); color: var(--text); }

.status {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 28px;
}

.dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px; /* row gap, gap between groups */
  max-width: 720px;
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}

.dot {
  position: relative;
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  transition: background-color 600ms ease, transform 150ms ease;
}

.dot:hover, .dot:focus-visible { transform: scale(1.35); outline: none; }
.dot.slow { background: var(--slow); }
.dot.down { background: var(--down); }
.dot.pending, .dot.maintenance, .dot.unknown { background: var(--unknown); }

.dot .tip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%) scale(0.74);
  transform-origin: bottom center;
  white-space: nowrap;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  transition: opacity 120ms ease;
  pointer-events: none;
}

.dot:hover .tip, .dot:focus-visible .tip { visibility: visible; opacity: 1; }

.tip-path { display: block; }

.tip-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: var(--text-2);
}

.history {
  display: inline-flex;
  align-items: flex-end;
  gap: 1px;
  height: 12px;
}

.history i {
  display: block;
  width: 3px;
  height: 12px;
  border-radius: 1px;
  background: var(--ok);
}

.history i.slow { background: var(--slow); }
.history i.down { background: var(--down); }
.history i.pending, .history i.maintenance { background: var(--unknown); height: 8px; }

.caption {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-3);
}

@media (prefers-reduced-motion: reduce) {
  .dot, .search input { transition: none; }
}
