/* Ten-foot UI: this is furniture in a room, on for hours.
 *
 * Sized for a TV viewed from a sofa, not a monitor at arm's length — big type,
 * high contrast, dim background, and generous overscan padding (TVs still crop
 * the edges). No web fonts: a packaged TV app must not fetch anything.
 */

:root {
  --navy: #0b1120;
  --navy-deep: #060a14;
  --canary: #f5b301;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --card: #14192a;
  --ok: #34d399;
  --warn: #fbbf24;
  --alarm: #fb923c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--text);
  min-height: 100vh;
  /* Overscan: TVs crop the outer ~5%. Nothing important lives there. */
  padding: 5vh 5vw;
  line-height: 1.5;
}

h1 { font-size: clamp(2rem, 4.4vw, 4rem); font-weight: 700; letter-spacing: -0.02em; }
.lede { font-size: clamp(1rem, 1.6vw, 1.6rem); color: var(--muted); margin-top: 0.4em; }
.fine { font-size: clamp(0.8rem, 1vw, 1.05rem); color: var(--muted); margin-top: 2em; max-width: 60ch; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--canary); }

/* ── setup ─────────────────────────────────────────────────────────────── */
.row { display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }

input[type="url"] {
  flex: 1 1 24rem;
  font: inherit;
  font-size: clamp(1rem, 1.6vw, 1.5rem);
  padding: 0.7em 0.9em;
  border-radius: 0.6rem;
  border: 2px solid #2a3350;
  background: var(--card);
  color: var(--text);
}
input[type="url"]:focus { outline: none; border-color: var(--canary); }

button {
  font: inherit;
  font-size: clamp(1rem, 1.6vw, 1.5rem);
  font-weight: 600;
  padding: 0.7em 1.6em;
  border-radius: 0.6rem;
  border: 2px solid transparent;
  background: var(--canary);
  color: #1a1300;
  cursor: pointer;
}
/* The remote moves focus; make it unmistakable from across the room. */
button:focus-visible, input:focus-visible { outline: 4px solid var(--canary); outline-offset: 3px; }
button:hover { filter: brightness(1.08); }

.err { color: var(--alarm); margin-top: 1.2rem; font-size: clamp(0.95rem, 1.3vw, 1.3rem); max-width: 70ch; }

/* ── the wall ──────────────────────────────────────────────────────────── */
header { margin-bottom: 3vh; }

.banner {
  margin-top: 1.2rem;
  padding: 0.9em 1.1em;
  border-radius: 0.7rem;
  font-size: clamp(0.95rem, 1.35vw, 1.4rem);
  max-width: 90ch;
}
/* Four tones, and the default is the honest one: "not verified" is a NOTE,
   never a green tick. Color is never the only signal — the text always says
   what happened, for anyone who can't distinguish these. */
.banner.calm  { background: rgba(52, 211, 153, 0.14); border-left: 6px solid var(--ok); }
.banner.note  { background: rgba(161, 161, 170, 0.14); border-left: 6px solid var(--muted); }
.banner.warn  { background: rgba(251, 191, 36, 0.16); border-left: 6px solid var(--warn); }
.banner.alarm { background: rgba(251, 146, 60, 0.20); border-left: 6px solid var(--alarm); }

.grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 1.4rem;
}

.card {
  background: var(--card);
  border-radius: 1rem;
  padding: 1.4rem 1.6rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 1rem;
  align-items: center;
}
.card .dot { width: 0.9rem; height: 0.9rem; border-radius: 50%; grid-row: 1 / span 1; }
.card.online .dot  { background: var(--ok); }
.card.offline .dot { background: #52525b; }
.card.trouble .dot { background: var(--alarm); }
.card.trouble { outline: 2px solid rgba(251, 146, 60, 0.5); }

.card .name    { font-size: clamp(1.1rem, 1.7vw, 1.7rem); font-weight: 600; }
.card .status  { grid-column: 2; color: var(--muted); font-size: clamp(0.9rem, 1.15vw, 1.15rem); }
.card .product { grid-column: 2; color: #71717a; font-size: clamp(0.8rem, 1vw, 1rem); }
.card .product:empty { display: none; }

footer {
  margin-top: 4vh;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: clamp(0.8rem, 1.05vw, 1.05rem);
}
.tag { color: #71717a; }

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