/* Yomikaze TV — status page. Same dark purple/pink family as the rest of the site. */
:root {
  --bg: #0b0b12;
  --panel: #16161f;
  --panel2: #1c1c28;
  --line: #2a2a3d;
  --txt: #ecedf5;
  --txt2: #c3c3d6;
  --muted: #8f8fab;
  --grad: linear-gradient(90deg, #7c3aed, #db2777);
  /* One colour per state, used for the dot, the pill and the hero. */
  --ok: #34d399;
  --slow: #fbbf24;
  --down: #f87171;
  --idle: #6b6b85;
  --radius: 16px;
  /* Everything that changes with the status glides instead of jumping. */
  --ease: .45s cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: "Segoe UI", Roboto, system-ui, Arial, sans-serif;
  min-height: 100vh;
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38vw 38vw at 14% 8%, rgba(124, 58, 237, .22), transparent 60%),
    radial-gradient(34vw 34vw at 86% 10%, rgba(219, 39, 119, .16), transparent 60%);
  filter: blur(8px);
}
a { color: #c4b5fd; text-decoration: none; }
a:hover { color: #ddd6fe; }
[hidden] { display: none !important; }

/* The state decides one variable; the pieces below just use it. */
[data-state="ok"]      { --c: var(--ok); }
[data-state="slow"],
[data-state="degraded"] { --c: var(--slow); }
[data-state="down"],
[data-state="partial"],
[data-state="unreachable"] { --c: var(--down); }
[data-state="unknown"],
[data-state="off"],
[data-state="pending"] { --c: var(--idle); }

/* ---------- header ---------- */
.st-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px clamp(16px, 4vw, 32px);
  border-bottom: 1px solid var(--line);
}
.st-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--txt); font-size: 18px; font-weight: 600; }
.st-brand:hover { color: var(--txt); }
.st-brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.st-brand-mark { width: 30px; height: 30px; display: block; }

.st-live {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--muted); letter-spacing: .3px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
}
.st-live i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--idle));
  transition: background-color var(--ease);
}
.st-live[data-state="ok"] i { animation: pulse 2.4s ease-out infinite; }

/* ---------- layout ---------- */
.st-main { flex: 1; width: 100%; max-width: 820px; margin: 0 auto; padding: clamp(22px, 5vw, 48px) clamp(16px, 4vw, 32px) 56px; }
.st-section { margin-top: 34px; }
.st-title { margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.st-note { margin: -4px 0 14px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }

/* ---------- hero: the one-line answer ---------- */
.st-hero {
  display: flex; align-items: center; gap: 18px;
  padding: clamp(18px, 4vw, 28px);
  border-radius: var(--radius);
  /* Plain values first: browsers without color-mix() keep these. */
  background: var(--panel);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--c, var(--idle)) 9%, var(--panel));
  border-color: color-mix(in srgb, var(--c, var(--idle)) 38%, var(--line));
  transition: background-color var(--ease), border-color var(--ease);
}
.st-hero-icon {
  flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c, var(--idle)) 20%, transparent);
  transition: background-color var(--ease);
}
.st-hero-icon span {
  width: 18px; height: 18px; border-radius: 50%; background: var(--c, var(--idle));
  transition: background-color var(--ease);
}
.st-hero[data-state="ok"] .st-hero-icon span { animation: pulse 2.4s ease-out infinite; }
.st-headline { margin: 0; font-size: clamp(20px, 3.4vw, 27px); font-weight: 700; line-height: 1.25; }
.st-updated { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* ---------- system rows ---------- */
.st-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.st-row {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px;
  padding: 15px 18px;
  transition: background-color var(--ease), opacity var(--ease);
}
.st-row + .st-row { border-top: 1px solid var(--line); }
.st-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--idle));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c, var(--idle)) 18%, transparent);
  transition: background-color var(--ease), box-shadow var(--ease);
}
.st-name { display: block; font-size: 15px; font-weight: 600; }
.st-desc { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.st-ms { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-pill {
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  padding: 5px 11px; border-radius: 999px;
  color: var(--c, var(--idle));
  background: var(--panel2);
  background: color-mix(in srgb, var(--c, var(--idle)) 14%, transparent);
  transition: color var(--ease), background-color var(--ease);
}
/* A row whose state just changed lights up once, so a change is not missed. */
.st-row.changed, .st-server.changed { animation: flash 1.6s ease-out; }
/* While the server cannot be reached, the last known values are shown — dimmed. */
.stale .st-row:not([data-id="site"]), .stale .st-server { opacity: .45; }

/* ---------- streaming servers ---------- */
.st-servers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.st-server {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel);
  transition: opacity var(--ease), border-color var(--ease);
}
.st-server b { display: block; font-size: 14.5px; font-weight: 600; }
.st-server small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--c, var(--idle)); transition: color var(--ease); }

/* ---------- footer ---------- */
.st-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px 32px; border-top: 1px solid var(--line); }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c, var(--ok)) 55%, transparent); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes flash {
  0%   { background-color: color-mix(in srgb, var(--c, var(--idle)) 22%, var(--panel)); }
  100% { background-color: var(--panel); }
}

@media (max-width: 560px) {
  .st-row { grid-template-columns: auto 1fr auto; row-gap: 6px; }
  .st-ms { display: none; }
  .st-hero { gap: 14px; }
  .st-hero-icon { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
