*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100vw;
  background: var(--background);
  color: var(--foreground);
  transition: background 0.3s, color 0.3s;
}
html, body { width: 100%; }

/* ========== DESIGN TOKENS — verbatim from landing-page ========== */
:root {
  /* Brand */
  --primary: #8200db;
  --primary-foreground: #ffffff;
  --complementary: #4f39f6;
  --complementary-foreground: #ffffff;

  /* Surfaces */
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --destructive: oklch(0.577 0.245 27.325);

  /* Radius */
  --radius: 0.625rem;

  /* Glass */
  --glass-bg: rgba(0,0,0,0.02);
  --glass-border: rgba(0,0,0,0.06);
  --glass-bg-hover: rgba(0,0,0,0.04);

  /* Layout */
  --max-w: 860px;
  --section-py: 80px;
}

.dark {
  --background: #181a1b;
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --destructive: oklch(0.704 0.191 22.216);

  --glass-bg: rgba(255,255,255,0.03);
  --glass-border: rgba(255,255,255,0.06);
  --glass-bg-hover: rgba(255,255,255,0.06);
}

/* ========== BASE ========== */
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--foreground);
  background: transparent;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
}
/* Purple/indigo aurora mesh — exactly matches landing-page .hero-mesh */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 15% 10%, color-mix(in srgb, var(--primary) 9%, transparent) 0%, transparent 60%),
    radial-gradient(ellipse 60% 45% at 85% 30%, color-mix(in srgb, var(--complementary) 7%, transparent) 0%, transparent 60%),
    radial-gradient(ellipse 55% 40% at 50% 90%, color-mix(in srgb, var(--primary) 5%, transparent) 0%, transparent 60%);
  pointer-events: none;
  z-index: -2;
}
.dark body::before {
  background:
    radial-gradient(ellipse 70% 50% at 15% 10%, color-mix(in srgb, var(--primary) 18%, transparent) 0%, transparent 60%),
    radial-gradient(ellipse 60% 45% at 85% 30%, color-mix(in srgb, var(--complementary) 14%, transparent) 0%, transparent 60%),
    radial-gradient(ellipse 55% 40% at 50% 90%, color-mix(in srgb, var(--primary) 10%, transparent) 0%, transparent 60%);
}
/* Subtle grid overlay, masked to fade out at edges */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--foreground) 3%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--foreground) 3%, transparent) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black, transparent);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black, transparent);
  pointer-events: none;
  z-index: -1;
}
.theme-transitioning, .theme-transitioning * {
  transition: background 0.3s, color 0.3s, border-color 0.3s !important;
}
h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ========== FLOATING GLASS PILL (landing-page aesthetic) ========== */
.top-pill-wrap {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  pointer-events: none;             /* so taps outside the pill pass through */
}
.top-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 9px 18px 9px 14px;
  /* Glassmorphism — matches landing-page navbar exactly */
  background: color-mix(in srgb, var(--background) 72%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  box-shadow:
    0 1px 0 0 color-mix(in srgb, #fff 50%, transparent) inset,
    0 8px 24px -8px rgba(0, 0, 0, 0.18),
    0 2px 6px -2px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s;
}
.dark .top-pill {
  background: color-mix(in srgb, var(--background) 60%, transparent);
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 24px -8px rgba(0, 0, 0, 0.6),
    0 2px 6px -2px rgba(0, 0, 0, 0.45);
}
.top-pill:hover {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 0 color-mix(in srgb, #fff 60%, transparent) inset,
    0 14px 32px -10px rgba(0, 0, 0, 0.22),
    0 3px 8px -2px rgba(0, 0, 0, 0.1);
}
.dark .top-pill:hover {
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.05) inset,
    0 14px 32px -10px rgba(0, 0, 0, 0.7),
    0 3px 8px -2px rgba(0, 0, 0, 0.55);
}

.top-pill-logo {
  display: inline-flex;
  align-items: center;
  height: 28px;
}
.top-pill-logo img { height: 28px; width: auto; display: block; }
.top-pill-logo .logo-dark { display: none; }
.dark .top-pill-logo .logo-light { display: none; }
.dark .top-pill-logo .logo-dark { display: block; }

.top-pill-divider {
  width: 1px;
  height: 18px;
  background: linear-gradient(
    to bottom,
    transparent,
    color-mix(in srgb, var(--foreground) 20%, transparent),
    transparent
  );
}

.top-pill-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--foreground);
  line-height: 1;
}

/* Live indicator — pulsing emerald dot. Color is changed by JS based on overall status */
.top-pill-live {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 2px;
}
.top-pill-live-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;             /* emerald — default. JS overrides on degraded/down */
  box-shadow: 0 0 8px color-mix(in srgb, #10b981 60%, transparent);
  z-index: 2;
}
.top-pill-live-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #10b981;
  opacity: 0.4;
  animation: pillPulse 2.2s cubic-bezier(0,0,.2,1) infinite;
}
.top-pill-live.warn .top-pill-live-dot,
.top-pill-live.warn .top-pill-live-ring { background: #f59e0b; }
.top-pill-live.warn .top-pill-live-dot { box-shadow: 0 0 8px color-mix(in srgb, #f59e0b 60%, transparent); }
.top-pill-live.err  .top-pill-live-dot,
.top-pill-live.err  .top-pill-live-ring { background: #ef4444; }
.top-pill-live.err  .top-pill-live-dot { box-shadow: 0 0 8px color-mix(in srgb, #ef4444 60%, transparent); }

@keyframes pillPulse {
  0%   { transform: scale(1);   opacity: 0.55; }
  70%  { transform: scale(2.6); opacity: 0;    }
  100% { transform: scale(2.6); opacity: 0;    }
}

@media (max-width: 480px) {
  .top-pill-wrap { top: 14px; }
  .top-pill { padding: 8px 14px 8px 12px; gap: 10px; }
  .top-pill-logo, .top-pill-logo img { height: 18px; }
  .top-pill-text { font-size: 0.8125rem; }
  .top-pill-divider { height: 14px; }
}

/* ========== THEME TOGGLE (top-right, matches landing-page component) ========== */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 1001;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--background) 72%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  color: var(--muted-foreground);
  transition: all 0.2s;
  box-shadow:
    0 1px 0 0 color-mix(in srgb, #fff 50%, transparent) inset,
    0 4px 12px -4px rgba(0, 0, 0, 0.08);
}
.theme-toggle:hover {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
  transform: translateY(-1px);
}
.dark .theme-toggle {
  background: color-mix(in srgb, var(--background) 60%, transparent);
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.04) inset,
    0 4px 12px -4px rgba(0, 0, 0, 0.45);
}
@media (max-width: 640px) {
  .theme-toggle { width: 32px; height: 32px; top: 14px; right: 14px; }
}

/* ========== PAGE FOOTER (subtle, centered) ========== */
.page-footer {
  text-align: center;
  padding: 40px 24px 56px;
  position: relative;
}
.page-footer p {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  opacity: 0.75;
  letter-spacing: 0.01em;
}
.footer-heart { display: inline-block; transform: translateY(1px); }

/* ========== PAGE LAYOUT ========== */
.page-main {
  min-height: 100vh;
  padding: 104px 24px 120px;
  max-width: 920px;
  margin: 0 auto;
}

/* ========== HERO ========== */
.hero-section {
  text-align: center;
  padding: 48px 32px 56px;
  margin-bottom: 32px;
  position: relative;
  border-radius: 20px;
  background: color-mix(in srgb, var(--card) 68%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid color-mix(in srgb, var(--primary) 14%, transparent);
  box-shadow:
    0 1px 0 0 color-mix(in srgb, #fff 50%, transparent) inset,
    0 12px 32px -12px color-mix(in srgb, var(--primary) 20%, transparent),
    0 4px 12px -4px rgba(0, 0, 0, 0.06);
}
.dark .hero-section {
  background: color-mix(in srgb, var(--card) 50%, transparent);
  border-color: color-mix(in srgb, var(--primary) 22%, transparent);
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.04) inset,
    0 12px 32px -12px color-mix(in srgb, var(--primary) 35%, transparent),
    0 4px 12px -4px rgba(0, 0, 0, 0.4);
}

.hero-status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

/* 12px filled dot with soft glow */
.hero-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.3s, box-shadow 0.3s;
}
.hero-dot.operational {
  background: #22c55e;
  box-shadow: 0 0 0 3px color-mix(in srgb, #22c55e 22%, transparent);
}
.hero-dot.degraded {
  background: #f59e0b;
  box-shadow: 0 0 0 3px color-mix(in srgb, #f59e0b 22%, transparent);
}
.hero-dot.down {
  background: #ef4444;
  box-shadow: 0 0 0 3px color-mix(in srgb, #ef4444 22%, transparent);
}
.hero-dot.unknown {
  background: var(--muted-foreground);
  box-shadow: none;
}

.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--foreground);
}

.hero-subtitle {
  margin-top: 10px;
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  font-weight: 400;
}

/* Last-updated sits in the hero, right-aligned, absolute on wide screens */
.hero-updated {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}
.hero-updated-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-foreground);
  flex-shrink: 0;
  transition: background 0.3s;
}
.hero-updated-dot.pulsing {
  background: #22c55e;
  animation: pulse-dot 1s ease-out;
}
@keyframes pulse-dot {
  0%   { transform: scale(1); opacity: 1; }
  50%  { transform: scale(1.7); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

/* ========== COMPONENT SECTIONS ========== */
.components-section {
  max-width: 920px;
  margin: 0 auto;
}
.component-sections {
  display: flex;
  flex-direction: column;
}

/* Each group is a glass card */
.group-block {
  padding: 24px 24px 8px;
  margin-bottom: 20px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--card) 62%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid color-mix(in srgb, var(--primary) 10%, transparent);
  box-shadow:
    0 1px 0 0 color-mix(in srgb, #fff 40%, transparent) inset,
    0 8px 24px -10px color-mix(in srgb, var(--primary) 15%, transparent),
    0 2px 6px -2px rgba(0, 0, 0, 0.04);
}
.dark .group-block {
  background: color-mix(in srgb, var(--card) 45%, transparent);
  border-color: color-mix(in srgb, var(--primary) 18%, transparent);
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.03) inset,
    0 8px 24px -10px color-mix(in srgb, var(--primary) 30%, transparent),
    0 2px 6px -2px rgba(0, 0, 0, 0.35);
}
.group-block + .group-block { margin-top: 0; }

.group-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 14px;
}

/* Row list — clean lines, no card wrapper */
.component-list { list-style: none; }

.component-row {
  display: grid;
  grid-template-columns: auto 1fr 340px auto;
  align-items: center;
  gap: 14px;
  padding: 13px 2px;
  border-top: 1px solid color-mix(in srgb, var(--primary) 8%, transparent);
  transition: background 0.15s;
}
.component-row:first-child { border-top: none; }
.component-row:hover {
  background: color-mix(in srgb, var(--primary) 3%, transparent);
}

.comp-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========== COMPONENT ICON ========== */
.comp-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--secondary);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  transition: transform 0.18s ease;
}
.component-row:hover .comp-icon {
  transform: scale(1.04);
}

/* Brand logos — white bg always for legibility */
.comp-icon--brand {
  background: #ffffff;
  border-color: color-mix(in srgb, var(--foreground) 8%, transparent);
}
.comp-icon--brand img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dark .comp-icon--brand {
  background: #ffffff;
}

/* Generic connector PNGs (api/sftp/webhook) — fill full circle */
.comp-icon--asset {
  background: #ffffff;
  border-color: color-mix(in srgb, var(--foreground) 8%, transparent);
}
.comp-icon--asset img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dark .comp-icon--asset {
  background: #ffffff;
}

/* SVG icons (lucide) — purple-tinted glass */
.comp-icon--svg {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  border-color: color-mix(in srgb, var(--primary) 18%, transparent);
}
.comp-icon--svg svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}
.dark .comp-icon--svg {
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  border-color: color-mix(in srgb, var(--primary) 28%, transparent);
}
.dark .comp-icon--svg svg {
  color: color-mix(in srgb, var(--primary) 70%, #ffffff);
}

/* ========== UPTIME BAR ========== */
.comp-bar-col { width: 340px; flex-shrink: 0; }

.uptime-bar {
  display: flex;
  gap: 1px;
  align-items: center;
  height: 26px;
}

.uptime-seg {
  flex: 1;
  height: 24px;
  border-radius: 1px;
  position: relative;
  cursor: default;
  min-width: 0;
  transition: opacity 0.15s;
}
.uptime-seg:hover { opacity: 0.75; }

/* Segment colors — subdued */
.uptime-seg.status-operational { background: #22c55e; }
.uptime-seg.status-degraded    { background: #f59e0b; }
.uptime-seg.status-down        { background: #ef4444; }
.uptime-seg.status-unknown     { background: var(--border); }

/* Tooltip — dark floating box */
.uptime-seg[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--foreground);
  color: var(--background);
  font-size: 0.6875rem;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 5px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  pointer-events: none;
  z-index: 100;
  letter-spacing: 0.01em;
}

/* ========== STATUS INDICATOR (replaces tinted pills) ========== */
.comp-status-col {
  text-align: right;
  white-space: nowrap;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-indicator__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  outline: 1px solid transparent;
  outline-offset: 1px;
}

.status-indicator__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}

/* Latency appended after status label */
.comp-latency {
  font-size: 0.8rem;
  color: var(--muted-foreground);
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

/* Colors per status */
.status-indicator.operational .status-indicator__dot {
  background: #22c55e;
  outline-color: color-mix(in srgb, #22c55e 30%, transparent);
}
.status-indicator.degraded .status-indicator__dot {
  background: #f59e0b;
  outline-color: color-mix(in srgb, #f59e0b 30%, transparent);
}
.status-indicator.down .status-indicator__dot {
  background: #ef4444;
  outline-color: color-mix(in srgb, #ef4444 30%, transparent);
}
.status-indicator.unknown .status-indicator__dot {
  background: var(--muted-foreground);
  outline-color: transparent;
}

/* ========== SKELETON ========== */
.skel {
  background: var(--border);
  border-radius: var(--radius);
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}
.hero-skeleton {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
}
.skel-dot   { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.skel-title { height: 34px; width: 300px; border-radius: 8px; }
.skel-sub   { height: 16px; width: 200px; border-radius: 6px; }
.components-skeleton { display: flex; flex-direction: column; gap: 0; padding: 48px 0 0; }
.skel-group-title { height: 12px; width: 120px; border-radius: 4px; margin-bottom: 18px; }
.skel-row { height: 50px; border-radius: 0; border-top: 1px solid var(--border); background: transparent; }
.skel-row.skel { background: transparent; animation: none; }
.skel-row::after {
  content: '';
  display: block;
  height: 100%;
  background: var(--border);
  border-radius: 4px;
  animation: shimmer 1.4s ease-in-out infinite;
  opacity: 0.4;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 700px) {
  .component-row {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 8px 12px;
  }
  .comp-bar-col {
    grid-column: 1 / -1;
    width: 100%;
  }
  .comp-bar-col .uptime-bar { width: 100%; }
  .page-main { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 420px) {
  .comp-bar-col { display: none; }
  .component-row { grid-template-columns: auto 1fr auto; }
}
