/* EclipseLink Uptime — «космический пульт»: стеклянные bento-карточки на звёздном фоне. */
:root {
  --bg: #08070c;
  --bg-2: #0b0813;
  --glass: rgba(18, 14, 28, 0.65);
  --glass-2: rgba(28, 22, 42, 0.6);
  --line: rgba(139, 92, 246, 0.2);
  --text: #ffffff;
  --text-2: #b9b5cc;
  --text-3: #7f7a96;
  --violet: #8b5cf6;
  --pink: #ec4899;
  --lilac: #c4b5fd;
  --ok: #10b981;
  --warn: #f59e0b;
  --bad: #ef4444;
  --none: #2a2538;
  --radius: 22px;
  --font: Inter, "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* --- Фон: звёзды (canvas) и туманности ------------------------------------------------------------------ */
.stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.nebula {
  position: fixed; inset: -20%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(40% 35% at 78% 12%, rgba(139, 92, 246, 0.22), transparent 70%),
    radial-gradient(35% 30% at 12% 85%, rgba(236, 72, 153, 0.14), transparent 70%),
    radial-gradient(30% 25% at 45% 50%, rgba(67, 56, 202, 0.10), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  animation: drift 40s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(2%, -2%, 0) scale(1.04); } }

.shell { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 22px 20px 40px; }

/* --- Стекло --------------------------------------------------------------------------------------------- */
.glass {
  position: relative; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(16px) saturate(130%); -webkit-backdrop-filter: blur(16px) saturate(130%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.glass::before { /* неоновая кромка при наведении */
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0;
  background: linear-gradient(135deg, var(--violet), var(--pink));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  transition: opacity .25s ease;
}
.glass:hover { transform: translateY(-3px); box-shadow: 0 26px 70px rgba(0, 0, 0, 0.45), 0 0 40px rgba(139, 92, 246, 0.12); }
.glass:hover::before { opacity: 1; }
.hero.glass:hover, .chart-card.glass:hover { transform: none; }

/* --- Появление ------------------------------------------------------------------------------------------ */
.reveal { opacity: 0; transform: translateY(14px); animation: rise .6s cubic-bezier(.2, .8, .2, 1) forwards; }
.reveal:nth-child(2) { animation-delay: .06s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* --- Шапка ---------------------------------------------------------------------------------------------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.brand img { display: block; filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.6)); }
.brand b { font-weight: 800; background: linear-gradient(90deg, var(--lilac), #f0abfc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 12px var(--ok); animation: blink 2.4s ease-in-out infinite; }
body[data-overall="degraded"] .brand-dot { background: var(--warn); box-shadow: 0 0 12px var(--warn); }
body[data-overall="down"] .brand-dot { background: var(--bad); box-shadow: 0 0 12px var(--bad); }
@keyframes blink { 50% { opacity: .35; } }
.top-actions { display: flex; align-items: center; gap: 10px; }
.ghost-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(12px); text-decoration: none; font-size: 14px; color: var(--text-2);
  transition: border-color .2s, color .2s, background .2s;
}
.ghost-btn:hover { color: var(--text); border-color: rgba(236, 72, 153, 0.5); }
.ghost-btn.is-spinning .ic { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }

/* --- Главный баннер ------------------------------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; padding: 22px 28px; margin-bottom: 16px; }
.mascot { width: 150px; height: 150px; }
.mascot svg { width: 100%; height: 100%; overflow: visible; }
.m-corona { fill: none; stroke: var(--ok); stroke-width: 3; opacity: .55; filter: blur(6px); transform-origin: 100px 100px; animation: corona 2.6s ease-in-out infinite; }
@keyframes corona { 50% { opacity: .95; transform: scale(1.06); } }
.m-rim { fill: none; stroke: rgba(196, 181, 253, 0.55); stroke-width: 1.5; }
.m-ring ellipse { fill: none; stroke-width: 4; stroke-linecap: round; }
.m-ring--b ellipse { stroke-width: 2.5; opacity: .75; }
.m-ring { animation: ring-glow 2.6s ease-in-out infinite; }
@keyframes ring-glow { 50% { filter: drop-shadow(0 0 6px rgba(236, 72, 153, 0.9)); } }
.m-moon { fill: #f0abfc; filter: drop-shadow(0 0 6px #ec4899); }
.m-face path { fill: none; stroke: #e9fff6; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.m-face { color: var(--ok); }
.m-face path { stroke: #c9ffe9; filter: drop-shadow(0 0 4px var(--ok)); }
.m-eye--warn, .m-eye--down { display: none; }
body[data-overall="degraded"] .m-corona { stroke: var(--warn); }
body[data-overall="degraded"] .m-eye--ok, body[data-overall="down"] .m-eye--ok { display: none; }
body[data-overall="degraded"] .m-eye--warn { display: inline; }
body[data-overall="degraded"] .m-face path { stroke: #ffe8b8; filter: drop-shadow(0 0 4px var(--warn)); }
body[data-overall="down"] .m-corona { stroke: var(--bad); animation-duration: 1s; }
body[data-overall="down"] .m-eye--down { display: inline; }
body[data-overall="down"] .m-face path { stroke: #ffd0d0; filter: drop-shadow(0 0 4px var(--bad)); }
body[data-overall="down"] .m-mouth { transform: translateY(8px) scaleY(-1); transform-origin: 100px 114px; transform-box: view-box; }

.eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--lilac); }
.hero h1 { margin: 0; font-size: clamp(22px, 3vw, 32px); line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; text-shadow: 0 0 30px rgba(255, 255, 255, 0.18); }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.state-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: 13px; letter-spacing: .08em;
  color: var(--ok); background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.4);
}
.pulse-dot { position: relative; width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.pulse-dot::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; animation: ping 1.8s ease-out infinite; }
@keyframes ping { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
body[data-overall="degraded"] .state-pill { color: var(--warn); background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.45); }
body[data-overall="down"] .state-pill { color: var(--bad); background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.45); }
.uptime-badge { padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--text-2); background: var(--glass-2); border: 1px solid var(--line); }
.uptime-badge b { color: var(--text); }
.hero-facts { display: grid; gap: 10px; margin: 0; min-width: 190px; }
.hero-facts div { padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); }
.hero-facts dt { font-size: 12px; color: var(--text-3); }
.hero-facts dd { margin: 0; font-weight: 600; color: var(--text-2); }

/* --- Bento ---------------------------------------------------------------------------------------------- */
.bento { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.services { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.svc { padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; opacity: 0; animation: rise .6s cubic-bezier(.2, .8, .2, 1) forwards; }
.svc-head { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; align-items: start; }
.svc-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; flex: none; color: var(--lilac);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(236, 72, 153, 0.15)); border: 1px solid var(--line); }
.svc-title { min-width: 0; display: grid; gap: 6px; }
/* Названия короткие и в одну строку — статус под ними стоит одинаково во всех карточках. */
.svc-title h3 { margin: 0; font-size: 15px; line-height: 1.3; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.svc-state i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.svc-state--up { color: var(--ok); }
.svc-state--degraded { color: var(--warn); }
.svc-state--down { color: var(--bad); }
.svc-state--unknown { color: var(--text-3); }
.badge { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.badge--up { color: var(--ok); background: rgba(16, 185, 129, 0.12); box-shadow: 0 0 14px rgba(16, 185, 129, 0.25); }
.badge--degraded { color: var(--warn); background: rgba(245, 158, 11, 0.12); }
.badge--down { color: var(--bad); background: rgba(239, 68, 68, 0.14); box-shadow: 0 0 14px rgba(239, 68, 68, 0.3); }
.badge--unknown { color: var(--text-3); background: rgba(255, 255, 255, 0.06); }
.svc-nums { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.badge { flex: none; }
.svc-nums b { display: block; font-size: 21px; white-space: nowrap; font-weight: 800; letter-spacing: -0.02em; }
.svc-nums span { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.svc-history { margin-top: auto; display: grid; gap: 6px; }
.svc-ms { text-align: right; }
.svc-ms b { background: linear-gradient(90deg, var(--lilac), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; height: 30px; align-items: stretch; }
.bar { border-radius: 3px; background: var(--none); transition: transform .15s, filter .15s; cursor: default; }
.bar--ok { background: linear-gradient(180deg, #34d399, var(--ok)); box-shadow: 0 0 6px rgba(16, 185, 129, 0.35); }
.bar--warn { background: var(--warn); }
.bar--bad { background: var(--bad); box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
.bar:hover { transform: scaleY(1.15); filter: brightness(1.25); }
.bars-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); }

/* --- График --------------------------------------------------------------------------------------------- */
.chart-card { padding: 18px 20px 14px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2 { margin: 0; font-size: 16px; font-weight: 700; flex: 1; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--text-2); }
.lg::before { content: ""; display: inline-block; width: 18px; height: 3px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.lg--site::before { background: var(--violet); box-shadow: 0 0 8px var(--violet); }
.lg--api::before { background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 9px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.seg button[aria-selected="true"] { color: var(--text); background: linear-gradient(135deg, rgba(139, 92, 246, 0.45), rgba(236, 72, 153, 0.3)); }
.chart { position: relative; height: 280px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid line { stroke: rgba(255, 255, 255, 0.06); }
.chart .axis text { fill: var(--text-3); font-size: 11px; }
.chart .line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .line--site { stroke: var(--violet); filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.8)); }
.chart .line--api { stroke: var(--pink); filter: drop-shadow(0 0 6px rgba(236, 72, 153, 0.8)); }
.chart .cursor { stroke: rgba(255, 255, 255, 0.25); stroke-dasharray: 3 4; }
.chart .dot { stroke: #fff; stroke-width: 2; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 14px; }

/* --- Инциденты ------------------------------------------------------------------------------------------ */
.incidents-card { padding: 18px 18px 8px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; position: relative; display: grid; gap: 14px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, var(--violet), var(--pink)); box-shadow: 0 0 10px rgba(236, 72, 153, 0.6); }
.tl-item { position: relative; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.05); }
.tl-item::before { content: ""; position: absolute; left: -19px; top: 14px; /* −19 = отступ списка + рамка карточки: центр точки на линии */ width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--pink); box-shadow: 0 0 10px var(--pink); }
.tl-item[data-open="true"]::before { border-color: var(--bad); box-shadow: 0 0 12px var(--bad); }
.tl-item time { font-size: 12px; color: var(--text-3); }
.tl-item h3 { margin: 2px 0; font-size: 14px; font-weight: 700; }
.tl-item p { margin: 0; font-size: 13px; color: var(--text-2); }
.tl-item .badge { display: inline-block; margin-top: 6px; }
.tl-calm { position: relative; padding: 14px; border-radius: 14px; background: rgba(16, 185, 129, 0.07); border: 1px solid rgba(16, 185, 129, 0.25); color: var(--text-2); font-size: 14px; }
.tl-calm::before { content: ""; position: absolute; left: -19px; top: 50%; margin-top: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 12px var(--ok); }
.tl-calm .ic { color: var(--ok); vertical-align: -3px; margin-right: 6px; }

/* --- Точки мониторинга ---------------------------------------------------------------------------------- */
.nodes { margin-top: 16px; padding: 16px 20px; }
.nodes h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.nodes h2 .ic { color: var(--lilac); }
.nodes ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.node { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.06); }
.node-globe { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff;
  background: radial-gradient(circle at 35% 30%, #a78bfa, #4c1d95); box-shadow: 0 0 14px rgba(139, 92, 246, 0.5); }
.node-name { flex: 1; min-width: 0; }
.node-name b { display: block; font-size: 14px; }
.node-name span { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.node-name b, .node-ms { white-space: nowrap; }
.node-ms { font-size: 13px; color: var(--text-2); }
.nodes-note { margin: 12px 0 0; font-size: 12px; color: var(--text-3); }

.foot { display: flex; justify-content: center; gap: 10px; margin-top: 22px; font-size: 12px; color: var(--text-3); }
.foot a { color: var(--lilac); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* --- Подсказка ------------------------------------------------------------------------------------------ */
.tip {
  position: fixed; z-index: 10; pointer-events: none; padding: 8px 11px; border-radius: 12px; font-size: 12px; line-height: 1.45;
  background: rgba(20, 16, 32, 0.95); border: 1px solid rgba(196, 181, 253, 0.35); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  color: var(--text-2); white-space: nowrap; transform: translate(-50%, calc(-100% - 12px));
}
.tip b { color: var(--text); }

/* --- Адаптив -------------------------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .bento { grid-template-columns: 1fr; }
  .hero { grid-template-columns: auto 1fr; }
  .hero-facts { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); min-width: 0; }
}
@media (max-width: 600px) {
  .shell { padding: 16px 16px 32px; }
  .top { flex-wrap: wrap; }
  .top-actions { width: 100%; }
  .top-actions > * { flex: 1; justify-content: center; }
  .hero { grid-template-columns: 1fr; text-align: center; padding: 20px 16px; }
  .mascot { margin: 0 auto; width: 128px; height: 128px; }
  .hero-meta { justify-content: center; }
  .hero-facts { grid-template-columns: 1fr; }
  .chart { height: 220px; }
  .card-head h2 { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .svc { opacity: 1; transform: none; }
}
