/* infra.eonelabs.my — hand-written stylesheet (no Tailwind, no external
   fonts) so the service CSP can stay `default-src 'self'`.
   Palette mirrors the main site's locked "Dark Nebula" theme
   (public/css/theme.css + tailwind.config.js). The page is dark-native:
   eonelabs.my deliberately has a single dark theme, so this page renders the
   same dark palette for both light and dark prefers-color-scheme. */

:root {
  color-scheme: dark;
  --ink: #FFFFFF;
  --ink-muted: #D7D7F0;
  --navy: #0A0F2C;
  --panel: rgba(255, 255, 255, .07);
  --panel-strong: rgba(10, 15, 44, .45);
  --panel-border: rgba(255, 255, 255, .18);
  --tint: rgba(255, 255, 255, .10);
  --cyan: #22D3EE;
  --violet: #A78BFA;
  --pink: #F472B6;
  --green: #34D399;
  --green-ink: #6EE7B7;
  --red: #F87171;
  --red-ink: #FCA5A5;
  --amber: #FBBF24;
  --amber-ink: #FCD34D;
  --radius: 16px;
  --gutter: 16px;
  --font-sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
}

@media (min-width: 640px) {
  :root { --gutter: 24px; }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background-color: #05061A;
  background-image:
    radial-gradient(60% 50% at 12% 0%, rgba(34, 211, 238, .14), transparent 70%),
    radial-gradient(55% 55% at 100% 100%, rgba(244, 114, 182, .20), transparent 70%),
    linear-gradient(135deg, rgba(2, 3, 10, .3), rgba(10, 4, 20, .38)),
    linear-gradient(135deg, #05061A 0%, #1E1B6E 30%, #6D28D9 62%, #B0175F 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
code { font-family: var(--font-mono); font-size: .9em; background: var(--tint); padding: .05em .35em; border-radius: 6px; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--cyan); }
a:focus-visible, button:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--ink-muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 100;
  background: var(--ink); color: var(--navy); padding: 8px 14px; border-radius: 8px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 15, 44, .72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-border);
}
.header-row { display: flex; align-items: center; gap: 12px; height: 60px; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--ink-muted); text-decoration: none;
  padding: 6px 10px; margin-left: -10px; border-radius: 999px;
}
.back-link:hover { color: var(--ink); background: var(--tint); }
.brand {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
  font-family: var(--font-display); font-weight: 700; text-decoration: none; color: var(--ink);
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 28px; height: 28px; flex: none; border-radius: 8px;
  display: grid; place-items: center; font-size: 15px; font-weight: 700;
  background: linear-gradient(135deg, var(--cyan), var(--violet), var(--pink)); color: var(--navy);
}
.header-nav { display: none; margin-left: auto; gap: 2px; font-size: 14px; }
.header-nav a { color: var(--ink-muted); text-decoration: none; padding: 6px 12px; border-radius: 999px; }
.header-nav a:hover { color: var(--ink); background: var(--tint); }
@media (max-width: 399px) { .back-text { display: none; } }
@media (min-width: 768px) { .header-nav { display: flex; } }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 56px 0 40px; overflow: hidden; }
@media (min-width: 640px) { .hero { padding: 88px 0 56px; } }
.hero-inner { position: relative; z-index: 1; }
.hero h1 { max-width: 52rem; }
.grid-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black 40%, transparent 90%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black 40%, transparent 90%);
}
.hero h1 { font-size: clamp(2rem, 7vw, 3.5rem); font-weight: 700; margin-top: 18px; }
.text-gradient {
  background: linear-gradient(90deg, var(--cyan), var(--violet) 55%, var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { color: var(--ink-muted); font-size: 1.075rem; margin-top: 18px; max-width: 44rem; }
.as-of { color: var(--ink-muted); font-size: 14px; margin-top: 18px; min-height: 1.6em; }
.as-of time { color: var(--ink); font-family: var(--font-mono); font-size: 13px; }

.live-badge {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(16, 185, 129, .16); border: 1px solid rgba(52, 211, 153, .45); color: var(--green-ink);
}
.live-dot { position: relative; display: inline-flex; width: 8px; height: 8px; flex: none; }
.live-dot::before, .live-dot::after { content: ""; position: absolute; border-radius: 999px; background: var(--green); }
.live-dot::before { inset: -4px; opacity: .55; animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite; }
.live-dot::after { inset: 0; }
@keyframes ping { 0% { transform: scale(1); opacity: .6; } 75%, 100% { transform: scale(2.6); opacity: 0; } }
.live-badge.is-offline { background: rgba(251, 191, 36, .14); border-color: rgba(251, 191, 36, .45); color: var(--amber-ink); }
.live-badge.is-offline .live-dot::before { display: none; }
.live-badge.is-offline .live-dot::after { background: var(--amber); }

.banner {
  margin-top: 16px; padding: 10px 14px; border-radius: 12px; font-size: 14px;
  background: rgba(251, 191, 36, .12); border: 1px solid rgba(251, 191, 36, .4); color: var(--amber-ink);
}
.banner[hidden] { display: none; }

/* ---------- Sections ---------- */
.section { padding: 40px 0; border-top: 1px solid var(--panel-border); }
@media (min-width: 640px) { .section { padding: 64px 0; } }
.section-head { margin-bottom: 24px; max-width: 48rem; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); margin-bottom: 8px; }
.section h2 { font-size: clamp(1.5rem, 4.5vw, 2.1rem); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.section-lead { color: var(--ink-muted); margin-top: 10px; }
.section-lead a { color: var(--ink); }

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-sans); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 9px; border-radius: 999px; line-height: 1.6; white-space: nowrap; vertical-align: middle;
}
.badge[hidden] { display: none; }
.badge-stale { background: rgba(251, 191, 36, .14); border: 1px solid rgba(251, 191, 36, .45); color: var(--amber-ink); }

/* ---------- Skeletons (reserve space — no layout shift on first paint) ---------- */
.skeleton { position: relative; overflow: hidden; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.6s ease-in-out infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------- Service cards ---------- */
.svc-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .svc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.svc { padding: 18px; min-height: 262px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.svc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.svc h3 { font-size: 1.05rem; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.svc-link {
  font-family: var(--font-mono); font-size: 13px; color: var(--cyan);
  text-decoration: none; overflow-wrap: anywhere; align-self: flex-start;
}
.svc-link:hover { text-decoration: underline; color: var(--cyan); }
.svc-nolink { font-family: var(--font-mono); font-size: 13px; color: var(--ink-muted); }
.svc-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin: 0; }
.svc-stats div { min-width: 0; }
.svc-stats dt, .stat-label { font-size: 12px; color: var(--ink-muted); }
.svc-stats dd { margin: 0; font-family: var(--font-mono); font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.svc-stats dd.is-bad { color: var(--red-ink); }
.spark-wrap { margin-top: auto; }
.spark-cap { font-size: 12px; color: var(--ink-muted); margin-bottom: 4px; }
.spark { display: block; width: 100%; height: 40px; overflow: visible; }
.spark-line { fill: none; stroke: var(--cyan); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark-area { fill: rgba(34, 211, 238, .14); stroke: none; }
.spark-base { stroke: rgba(255, 255, 255, .18); stroke-width: 1; vector-effect: non-scaling-stroke; }
.spark-empty { font-size: 12px; color: var(--ink-muted); height: 40px; display: flex; align-items: center; }

/* ---------- Uptime pills ---------- */
.pill-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; min-height: 42px; max-width: 100%;
  padding: 8px 14px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--panel-border);
}
.pill.skeleton { width: 180px; }
.pill-dot { width: 10px; height: 10px; border-radius: 999px; flex: none; background: var(--ink-muted); }
.pill.is-up .pill-dot { background: var(--green); box-shadow: 0 0 0 3px rgba(52, 211, 153, .2); }
.pill.is-down { border-color: rgba(248, 113, 113, .55); background: rgba(248, 113, 113, .12); }
.pill.is-down .pill-dot { background: var(--red); box-shadow: 0 0 0 3px rgba(248, 113, 113, .25); }
.pill-label { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.pill-pct { font-family: var(--font-mono); font-size: 13px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.pill-state { font-size: 12px; color: var(--ink-muted); }
.pill.is-down .pill-state { color: var(--red-ink); font-weight: 600; }

/* ---------- Deploys table ---------- */
.table-card { padding: 4px 0; overflow: hidden; }
.deploys { width: 100%; border-collapse: collapse; font-size: 14px; }
.deploys th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: .06em; padding: 12px 16px;
  border-bottom: 1px solid var(--panel-border);
}
.deploys td { padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); vertical-align: middle; }
.deploys tbody tr:last-child td { border-bottom: 0; }
.deploys .c-sha { font-family: var(--font-mono); font-size: 13px; }
.deploys .c-when, .deploys .c-dur { color: var(--ink-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.deploys .empty-row td { color: var(--ink-muted); text-align: center; padding: 24px 16px; }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 10px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.status-ok { background: rgba(16, 185, 129, .16); border-color: rgba(52, 211, 153, .45); color: var(--green-ink); }
.status-bad { background: rgba(248, 113, 113, .14); border-color: rgba(248, 113, 113, .5); color: var(--red-ink); }
.status-run { background: rgba(34, 211, 238, .14); border-color: rgba(34, 211, 238, .45); color: #A5F3FC; }
.status-neutral { background: var(--tint); border-color: var(--panel-border); color: var(--ink-muted); }

@media (max-width: 559px) {
  .deploys thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .deploys tbody tr {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "sha svc status" "when when dur";
    gap: 4px 12px; padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08);
  }
  .deploys tbody tr:last-child { border-bottom: 0; }
  .deploys td { padding: 0; border: 0; }
  .deploys .c-sha { grid-area: sha; }
  .deploys .c-svc { grid-area: svc; overflow-wrap: anywhere; }
  .deploys .c-status { grid-area: status; }
  .deploys .c-when { grid-area: when; font-size: 13px; }
  .deploys .c-dur { grid-area: dur; font-size: 13px; text-align: right; }
  .deploys .empty-row { display: block; }
  .deploys .empty-row td { display: block; }
}

/* ---------- Stats (GitHub) ---------- */
.stat-grid { display: grid; gap: 16px; grid-template-columns: 1fr; margin: 0; }
@media (min-width: 480px) { .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat { padding: 18px; min-width: 0; }
.stat dt { font-size: 13px; color: var(--ink-muted); }
.stat dd { margin: 6px 0 0; font-family: var(--font-display); font-size: clamp(1.5rem, 5vw, 2rem); font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-value { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---------- AI grader ---------- */
.ai-card {
  padding: 20px; display: grid; gap: 20px;
  border-color: rgba(167, 139, 250, .4); background: var(--panel-strong);
}
@media (min-width: 768px) { .ai-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: center; } }
.ai-row { display: flex; flex-wrap: wrap; gap: 24px 40px; }
.ai-status { margin-top: 8px; min-height: 26px; }
.ai-status .status-pill { font-size: 13px; padding: 3px 12px; }
.cap-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cap-value { font-family: var(--font-mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.cap-track { margin-top: 8px; height: 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.cap-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--violet) 60%, var(--pink));
  transition: width .6s ease;
}
.cap-fill.is-high { background: linear-gradient(90deg, var(--amber), var(--red)); }
.fine { font-size: 12px; color: var(--ink-muted); margin-top: 8px; }

/* ---------- Explainers ---------- */
.diagram-card { padding: 16px 4px; display: flex; justify-content: center; }
.arch { width: 100%; max-width: 460px; height: auto; display: block; }
.arch-box { fill: rgba(255, 255, 255, .06); stroke: rgba(255, 255, 255, .28); stroke-width: 1; }
.arch-accent { stroke: url(#arch-grad); stroke-width: 1.5; fill: rgba(167, 139, 250, .12); }
.arch-self { stroke: var(--cyan); fill: rgba(34, 211, 238, .12); }
.arch-group { fill: rgba(10, 15, 44, .35); stroke: rgba(255, 255, 255, .28); stroke-dasharray: 5 4; }
.arch-line { stroke: rgba(255, 255, 255, .55); stroke-width: 1.5; }
.arch-arrowhead { fill: rgba(255, 255, 255, .75); }
.arch-t { fill: #FFFFFF; font-family: var(--font-sans); font-size: 13px; font-weight: 600; }
.arch-s { fill: #D7D7F0; font-family: var(--font-sans); font-size: 11px; }
.arch-m { fill: #FFFFFF; font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.arch-group-label { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }

.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: 1fr; counter-reset: none; }
@media (min-width: 640px) { .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .flow { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.flow-step { padding: 18px; position: relative; }
.flow-n {
  width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  background: linear-gradient(135deg, var(--cyan), var(--violet), var(--pink)); color: var(--navy);
  margin-bottom: 10px;
}
.flow-step h3, .tile h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 6px; }
.flow-step p:not(.flow-n), .tile p { color: var(--ink-muted); font-size: 15px; }

.tile-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile { padding: 18px; }

.prose-card { padding: 20px; max-width: 48rem; display: grid; gap: 14px; color: var(--ink-muted); }
.prose-card code { color: var(--ink); }
.cta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 4px;
  padding: 10px 18px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 15px;
  background: var(--ink); color: var(--navy);
}
.cta:hover { color: var(--navy); opacity: .9; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--panel-border); padding: 28px 0 36px; margin-top: 24px; font-size: 14px; color: var(--ink-muted); }
.footer-row { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: var(--ink-muted); }
.site-footer a:hover { color: var(--ink); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .live-dot::before, .skeleton::after { animation: none; }
  .cap-fill { transition: none; }
}

/* "No data" (null metric) — muted so it doesn't read like a real value. */
.is-empty { color: var(--ink-muted); font-weight: 500; font-size: .9em; }
.stat dd.is-empty { font-size: clamp(1.1rem, 3.5vw, 1.35rem); }
