/* ============================================================================
 * Nyx marketing HERO - styles
 * ----------------------------------------------------------------------------
 * 1:1 plain-CSS replica of the real app chrome + three surfaces. Scoped under
 * .nyx-hero so it never collides with the marketing site's styles. No Tailwind,
 * no build step, no web fonts (the app uses the system stack). All charts and
 * the traffic map are crisp inline SVG - no raster images anywhere.
 * ==========================================================================*/

.nyx-hero {
  /* ── Brand tokens (from the app) ── */
  --blue: #2563eb;            /* app --blue  */
  --violet: #7c3aed;          /* app --violet */
  --nyx-purple: hsl(262 83% 58%);   /* hardened edges / isolation */
  --allowed: hsl(220 90% 56%);      /* allowed edges */
  --amber: #f59e0b;
  --red: #ef4444;
  --green: #22c55e;

  /* Optional richer brand palette (used on the page backdrop, not the app UI) */
  --cyan: #2BD9FF;
  --electric: #3A7BFF;
  --brand-violet: #8A6CFF;
  --navy: #0B0F2A;

  /* Grays */
  --g900: #111827; --g700: #374151; --g500: #6b7280; --g400: #9ca3af;
  --g200: #e5e7eb; --g100: #f3f4f6; --g50: #fafafa;
  --slate900: #0f172a; --slate800: #1e293b; --slate500: #64748b;
  --slate400: #94a3b8; --slate200: #e2e8f0; --slate100: #f1f5f9; --slate50: #f8fafc;

  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--g900);
  text-align: left;
  box-sizing: border-box;
}
.nyx-hero *, .nyx-hero *::before, .nyx-hero *::after { box-sizing: border-box; }
.nyx-hero button { font-family: inherit; }

/* ── Frame (the app window) ─────────────────────────────────────────────── */
.nyx-frame {
  position: relative;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 30px 60px -20px rgba(11, 15, 42, 0.35), 0 8px 24px -12px rgba(11, 15, 42, 0.2);
  overflow: hidden;
}

/* Title bar: macOS dots + contextual caption + Live pill */
.nyx-titlebar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: #fbfbfd;
}
.nyx-dots { display: flex; gap: 7px; }
.nyx-dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.nyx-dots i:nth-child(1) { background: #ff5f57; }
.nyx-dots i:nth-child(2) { background: #febc2e; }
.nyx-dots i:nth-child(3) { background: #28c840; }
.nyx-caption { font-size: 12px; color: var(--g500); }
.nyx-caption b { color: var(--g700); font-weight: 600; }
.nyx-live { margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: #15803d;
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 9999px; padding: 3px 9px; }
.nyx-live i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; display: block; }

/* Body = sidebar + content */
.nyx-body { display: flex; height: 676px; }

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.nyx-sidebar {
  width: 220px; flex-shrink: 0;
  background: #fff; border-right: 1px solid rgba(0,0,0,0.08);
  display: flex; flex-direction: column;
  padding: 8px 10px;
}
.nyx-brand { display: flex; align-items: center; gap: 10px; padding: 7px 4px 12px; }
.nyx-brand .mark {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px;
}
.nyx-brand img.mark { width: 42px; height: 42px; object-fit: contain; background: transparent; border-radius: 0; }
.nyx-brand .name { font-size: 15px; font-weight: 700; color: var(--g900); letter-spacing: -0.01em; line-height: 1.1; }
.nyx-brand .by { font-size: 9px; font-weight: 500; color: var(--g500); text-transform: uppercase; letter-spacing: 0.12em; }

.nyx-nav { display: flex; flex-direction: column; gap: 2px; }
.nyx-nav-section { font-size: 10px; font-weight: 600; color: var(--g400);
  text-transform: uppercase; letter-spacing: 0.08em; padding: 12px 12px 4px;
  margin-top: 6px; border-top: 1px solid rgba(0,0,0,0.07); }
.nyx-navitem {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 7px;
  font-size: 13.5px; font-weight: 500; color: var(--g700);
  background: transparent; border: 0; width: 100%; cursor: pointer;
  transition: background .15s, color .15s;
}
.nyx-navitem svg { width: 15px; height: 15px; flex-shrink: 0; }
.nyx-navitem:hover { background: rgba(0,0,0,0.05); }
.nyx-navitem.active {
  color: #fff; font-weight: 600;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: inset 3px 0 0 rgba(255,255,255,0.3);
}
.nyx-navitem.active svg { stroke-width: 2.2; }

.nyx-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 8px 6px 4px; }
.nyx-user .av {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 11px;
}
.nyx-user .nm { font-size: 12px; font-weight: 600; color: var(--g900); line-height: 1.2; }
.nyx-user .em { font-size: 10.5px; font-weight: 500; color: var(--g500); }

/* ── Content area + surface crossfade ───────────────────────────────────── */
.nyx-content { flex: 1; min-width: 0; background: var(--g50); position: relative; overflow: hidden; }
/* floating AI chat mark (visual only) */
.nyx-fab { position: absolute; right: 18px; bottom: 18px; z-index: 6;
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 10px 24px -6px rgba(124,58,237,0.5), 0 4px 10px -4px rgba(37,99,235,0.4);
  display: flex; align-items: center; justify-content: center; pointer-events: none; }
.nyx-fab svg { width: 24px; height: 24px; }
.nyx-surface { position: absolute; inset: 0; overflow: auto; padding: 18px 20px;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .45s ease, transform .45s ease; }
.nyx-surface.is-active { opacity: 1; transform: none; pointer-events: auto; }

.nyx-page-title { font-size: 18px; font-weight: 600; color: var(--g900); }
.nyx-page-sub { font-size: 12px; color: var(--g400); margin-top: 2px; }

/* ── DASHBOARD surface ──────────────────────────────────────────────────── */
.nyx-dash-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.nyx-dash-range { font-size: 12px; color: var(--g700); border: 1px solid var(--g200);
  border-radius: 6px; padding: 5px 10px; background: #fff; }
.nyx-grid { display: grid; gap: 12px; }
.nyx-stats { grid-template-columns: repeat(4, 1fr); display: grid; gap: 12px; }
.nyx-card { background: #fff; border: 0.5px solid var(--g200); border-radius: 8px; padding: 14px 16px; }
.nyx-stat-title { font-size: 12px; font-weight: 500; color: var(--g700); }
.nyx-stat-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.nyx-stat-value { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--g900); line-height: 1; }
.nyx-stat-value.danger { color: var(--red); }
.nyx-stat-value.warning { color: var(--amber); }
.nyx-stat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.nyx-stat-sub { font-size: 12px; color: var(--g400); margin-top: 6px; }

.nyx-dash-row2 { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-top: 12px; }
.nyx-dash-row3 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.nyx-widget-title { font-size: 12px; font-weight: 500; color: var(--g700); margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.nyx-spike { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: #fef2f2; color: var(--red); }

/* firing list (dashboard) */
.nyx-fire-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; }
.nyx-fire-row:hover { background: #f9fafb; }
.nyx-sev { font-size: 10px; font-weight: 500; padding: 2px 6px; border-radius: 4px; flex-shrink: 0; }
.nyx-sev.critical { background: #fef2f2; color: #dc2626; }
.nyx-sev.warning  { background: #fffbeb; color: #d97706; }
.nyx-sev.info     { background: #eff6ff; color: #2563eb; }
.nyx-fire-name { font-size: 12px; font-weight: 500; color: var(--g900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nyx-fire-ns { font-size: 10px; color: var(--g400); margin-left: auto; flex-shrink: 0; }

/* decision breakdown + fqdn table */
.nyx-bar-row { display: grid; grid-template-columns: 90px 1fr 56px; align-items: center; gap: 8px; padding: 3px 0; font-size: 11px; }
.nyx-bar-label { color: var(--g500); text-align: right; }
.nyx-bar-track { height: 16px; border-radius: 0 3px 3px 0; }
.nyx-bar-val { color: var(--g500); text-align: right; font-variant-numeric: tabular-nums; }
.nyx-tbl { width: 100%; font-size: 12px; }
.nyx-tbl .h { display: grid; grid-template-columns: 1fr 96px 50px; gap: 8px; padding-bottom: 4px; margin-bottom: 4px;
  border-bottom: 1px solid var(--g100); color: var(--g500); font-weight: 500; }
.nyx-tbl .r { display: grid; grid-template-columns: 1fr 96px 50px; gap: 8px; padding: 4px 0; }
.nyx-tbl .r .fqdn { color: var(--g900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nyx-tbl .r .ns { color: var(--g500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nyx-tbl .r .n { color: var(--g500); text-align: right; font-variant-numeric: tabular-nums; }

/* ── TRAFFIC MAP surface ────────────────────────────────────────────────── */
.nyx-tm-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.nyx-tm-filter { font-size: 12px; color: var(--blue); background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 8px; padding: 5px 12px; display: inline-flex; align-items: center; gap: 6px; }
.nyx-tm-syslabel { font-size: 12px; color: var(--g400); margin-left: 2px; }
.nyx-pillgroup { display: inline-flex; border: 1px solid var(--g200); border-radius: 8px; overflow: hidden; background: #fff; }
.nyx-pillgroup button { font-size: 12px; padding: 5px 11px; border: 0; background: #fff; color: var(--g500); cursor: pointer; border-right: 1px solid var(--g200); }
.nyx-pillgroup button:last-child { border-right: 0; }
.nyx-pillgroup button.on { background: var(--g900); color: #fff; }
.nyx-tm-sys { font-size: 12px; color: var(--g500); display: inline-flex; align-items: center; gap: 6px; }
.nyx-tm-coverage { font-size: 12px; color: #fff; background: var(--g900); border-radius: 8px; padding: 5px 11px;
  display: inline-flex; align-items: center; gap: 6px; border: 0; }
.nyx-tm-updated { margin-left: auto; font-size: 11px; color: var(--g400); display: inline-flex; align-items: center; gap: 6px; }
.nyx-tm-updated i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }

.nyx-tm-canvas { position: relative; border-radius: 10px; background:
  radial-gradient(circle, rgba(15,23,42,0.05) 1px, transparent 1px) 0 0 / 22px 22px, #fbfbfd;
  border: 1px solid var(--g200); overflow: hidden; }
.nyx-tm-canvas svg { display: block; width: 100%; height: auto; }

.nyx-tm-reset { position: absolute; top: 10px; right: 10px; font-size: 11px; color: var(--g500);
  background: #fff; border: 1px solid var(--g200); border-radius: 6px; padding: 4px 10px; }
.nyx-tm-legend { position: absolute; left: 14px; bottom: 14px; background: rgba(255,255,255,0.92);
  border: 1px solid var(--g200); border-radius: 8px; padding: 8px 12px; font-size: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); display: flex; gap: 20px; }
.nyx-tm-legend .lcol { display: flex; flex-direction: column; }
.nyx-tm-legend .lh { font-weight: 500; color: var(--g700); font-size: 9px; letter-spacing: 0.02em; }
.nyx-tm-legend .li { display: flex; align-items: center; gap: 6px; color: var(--g500); margin-top: 3px; }
.nyx-tm-legend .ln { width: 16px; height: 2px; border-radius: 2px; }
.nyx-tm-legend .ld { width: 5px; height: 5px; border-radius: 50%; }
.nyx-tm-legend .lb { width: 16px; height: 11px; border-radius: 3px; border: 2px solid var(--nyx-purple); }
.nyx-tm-legend .lb.dash { border-style: dashed; }
.nyx-tm-legend .lb-ic { width: 16px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
/* edge hover tooltip */
.nyx-tm-hit { cursor: pointer; }
.nyx-tm-tip { position: absolute; z-index: 12; pointer-events: none; min-width: 200px; max-width: 270px;
  background: #fff; border: 1px solid var(--g200); border-radius: 10px; padding: 12px 14px;
  box-shadow: 0 14px 34px -10px rgba(15,23,42,0.28); font-size: 12px; color: var(--g700); }
.nyx-tm-tip[hidden] { display: none; }
.nyx-tm-tip .tt-title { font-weight: 600; color: var(--g900); font-size: 13px; }
.nyx-tm-tip .tt-sep { border-top: 1px solid var(--g100); margin: 9px 0; }
.nyx-tm-tip .tt-meta { color: var(--g500); }
.nyx-tm-tip .tt-verdict { margin-top: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.nyx-tm-tip .ok { color: #16a34a; } .nyx-tm-tip .bad { color: #dc2626; }
.nyx-tm-tip .tt-fh { color: var(--g500); margin-bottom: 3px; }
.nyx-tm-tip .tt-fq { color: var(--blue); word-break: break-all; }
.nyx-tm-legend .sep { border-top: 1px solid var(--g200); margin: 6px 0 4px; }

/* ── ALERTS surface ─────────────────────────────────────────────────────── */
.nyx-al-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 12px 0; }
.nyx-al-card { background: #fff; border-radius: 12px; box-shadow: 0 0 0 1px rgba(15,23,42,0.08); padding: 16px; }
.nyx-al-label { font-size: 12px; font-weight: 500; color: var(--slate500); text-transform: uppercase; letter-spacing: 0.05em; }
.nyx-al-value { font-size: 30px; font-weight: 700; color: var(--slate900); margin-top: 4px; font-variant-numeric: tabular-nums; }
.nyx-al-value.danger { color: #dc2626; } .nyx-al-value.warning { color: #d97706; } .nyx-al-value.muted { color: var(--slate400); }

.nyx-al-banner { border: 1px solid #fecaca; background: #fef2f2; border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.nyx-al-banner-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; }
.nyx-al-banner-head .t { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #b91c1c; }
.nyx-firing-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.nyx-al-banner-head .r { font-size: 11px; color: var(--slate400); }
.nyx-al-firing-row { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: #fff; border: 1px solid #fee2e2; border-radius: 12px; padding: 10px 16px; margin-top: 12px; }
.nyx-al-firing-row .nm { font-size: 13px; font-weight: 500; color: var(--slate800); }
.nyx-al-firing-row .sm { font-size: 11px; color: var(--slate500); margin-top: 2px; }
.nyx-pill-sev { font-size: 11px; font-weight: 500; padding: 2px 10px; border-radius: 9999px; border: 1px solid; }
.nyx-pill-sev.critical { background: #fee2e2; color: #dc2626; border-color: #fecaca; }
.nyx-pill-sev.warning  { background: #fef3c7; color: #d97706; border-color: #fde68a; }
.nyx-pill-sev.info     { background: #dbeafe; color: #2563eb; border-color: #bfdbfe; }

.nyx-al-rules { background: #fff; border-radius: 12px; box-shadow: 0 0 0 1px rgba(15,23,42,0.08); padding: 16px; }
.nyx-al-rules-title { font-size: 15px; font-weight: 500; color: var(--slate900); margin-bottom: 8px; }
.nyx-al-tbl { width: 100%; border-collapse: collapse; }
.nyx-al-tbl th { font-size: 11px; font-weight: 500; color: var(--slate400); text-transform: uppercase;
  letter-spacing: 0.05em; padding: 0 16px 8px 0; text-align: left; border-bottom: 1px solid var(--slate100); }
.nyx-al-tbl td { padding: 10px 16px 10px 0; border-bottom: 1px solid var(--slate50); vertical-align: middle; }
.nyx-al-tbl tr.disabled { opacity: 0.5; }
.nyx-al-rule-name { font-size: 13px; font-weight: 500; color: var(--slate800); }
.nyx-al-rule-sum { font-size: 11px; color: var(--slate400); margin-top: 2px; }
.nyx-via { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 4px; margin-top: 4px; }
.nyx-via.ai_chat { background: #e0e7ff; color: #4338ca; }
.nyx-via.chart   { background: #dcfce7; color: #15803d; }
.nyx-via.wizard  { background: #f1f5f9; color: #64748b; }
.nyx-pill-scope { font-size: 11px; padding: 2px 10px; border-radius: 9999px; border: 1px solid; }
.nyx-pill-scope.global    { background: #f1f5f9; color: #64748b; border-color: #cbd5e1; }
.nyx-pill-scope.namespace { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.nyx-pill-status { font-size: 11px; padding: 2px 10px; border-radius: 9999px; border: 1px solid;
  display: inline-flex; align-items: center; gap: 6px; }
.nyx-pill-status .sd { width: 6px; height: 6px; border-radius: 50%; }
.nyx-pill-status.firing   { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.nyx-pill-status.firing .sd { background: var(--red); }
.nyx-pill-status.normal   { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.nyx-pill-status.normal .sd { background: var(--green); }
.nyx-pill-status.disabled { background: #f1f5f9; color: #64748b; border-color: #cbd5e1; }
.nyx-pill-status.disabled .sd { background: var(--slate400); }
.nyx-chan { display: inline-flex; gap: 4px; }
.nyx-chan span { width: 20px; height: 20px; border-radius: 4px; font-size: 10px; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; }
.nyx-chan .S { background: #4A154B; } .nyx-chan .E { background: #0078D4; }
.nyx-chan .A { background: #e2e8f0; color: #475569; }
.nyx-al-fired { font-size: 12px; color: var(--slate400); }

/* ── Surface switcher dots ──────────────────────────────────────────────── */
.nyx-tabs { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 0 2px; }
.nyx-tabs button { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--g500);
  background: transparent; border: 0; cursor: pointer; padding: 4px 8px; border-radius: 9999px; transition: color .15s; }
.nyx-tabs button .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--g200); transition: background .15s, transform .15s; }
.nyx-tabs button:hover { color: var(--g700); }
.nyx-tabs button.on { color: var(--g900); font-weight: 600; }
.nyx-tabs button.on .dot { background: linear-gradient(135deg, var(--blue), var(--violet)); transform: scale(1.25); }

/* ── Animations (motion-safe by default) ────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .nyx-live i, .nyx-firing-dot, .nyx-stat-dot, .nyx-pill-status.firing .sd { animation: nyx-pulse 2s cubic-bezier(0.4,0,0.6,1) infinite; }
  .flow-edge { stroke-dasharray: 6 4; animation: nyx-flow 1.2s linear infinite; }
  .flow-edge.fast { animation-duration: 0.6s; }
  .flow-edge.slow { animation-duration: 2.4s; }
  .nyx-draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: nyx-draw 1.1s ease forwards; }
  .nyx-fade-up { animation: nyx-fade-up .5s ease both; }
  .nyx-blip { animation: nyx-blip 4s ease-in-out infinite; }
}
@keyframes nyx-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes nyx-flow { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
@keyframes nyx-draw { to { stroke-dashoffset: 0; } }
@keyframes nyx-fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes nyx-blip { 0%, 92%, 100% { opacity: 1; } 95% { opacity: 0.25; } }

/* ── Responsive: scale the whole frame down rather than reflow ──────────── */
@media (max-width: 920px) {
  .nyx-hero-scaler { overflow: hidden; }
  .nyx-frame { width: 1180px; transform-origin: top left; }
}
