:root {
  --bg-color: #05070d;
  --text-primary: #e3f7ff;
  --text-muted: #9bb8c9;
  --surface: rgba(13, 22, 38, 0.88);
  --surface-strong: rgba(10, 16, 31, 0.92);
  --border: rgba(112, 189, 252, 0.18);
  --accent: #75d0ff;
  --accent-soft: rgba(117, 208, 255, 0.18);
  --accent-neon: #84f3ff;
  --purple: #9a78ff;
  --purple-soft: rgba(154, 120, 255, 0.15);
  --orange: #ff9e5e;
  --green: #66f4bf;
  --font-family: 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--font-family);
  color: var(--text-primary);
  background: radial-gradient(circle at top, rgba(117, 208, 255, 0.08), transparent 35%),
              radial-gradient(circle at 20% 20%, rgba(154, 120, 255, 0.16), transparent 25%),
              linear-gradient(180deg, #05070d 0%, #080d18 45%, #06101f 100%);
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle at 30% 20%, rgba(117, 208, 255, 0.14), transparent 28%),
                    radial-gradient(circle at 75% 15%, rgba(255, 158, 94, 0.12), transparent 22%),
                    radial-gradient(circle at 52% 78%, rgba(154, 120, 255, 0.10), transparent 20%);
  pointer-events: none;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  padding: 2rem 1.5rem 3rem;
}

.background-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(36px);
  opacity: 0.9;
  animation: drift 18s linear infinite;
}

.nebula-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(117, 208, 255, 0.32), transparent 60%);
  top: 10%;
  left: -10%;
}

.nebula-2 {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(154, 120, 255, 0.26), transparent 58%);
  top: 40%;
  right: -12%;
  animation-duration: 22s;
}

.nebula-3 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(255, 158, 94, 0.22), transparent 56%);
  bottom: 10%;
  left: 12%;
  animation-duration: 20s;
}

.glow-ring {
  position: absolute;
  border: 1px solid rgba(117, 208, 255, 0.18);
  border-radius: 50%;
  mix-blend-mode: screen;
  opacity: 0.55;
  animation: spin 45s linear infinite;
}

.glow-ring-1 {
  width: 520px;
  height: 520px;
  top: 18%;
  left: 4%;
}

.glow-ring-2 {
  width: 620px;
  height: 620px;
  top: 8%;
  right: 14%;
  animation-direction: reverse;
}

.glow-ring-3 {
  width: 420px;
  height: 420px;
  bottom: 8%;
  left: 28%;
}

#particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-shell {
  position: relative;
  z-index: 1;
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  gap: 2.5rem;
}

.site-header {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: rgba(7, 13, 24, 0.8);
  border: 1px solid rgba(117, 208, 255, 0.12);
  backdrop-filter: blur(18px);
  border-radius: 28px;
  padding: 2.25rem 2.5rem;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.24);
}

body.variant-a .site-header {
  border-color: rgba(117, 208, 255, 0.2);
  box-shadow: 0 48px 140px rgba(117, 208, 255, 0.18);
}

body.variant-b .hero-shell::before {
  content: '';
  position: absolute;
  top: 2rem;
  right: -100px;
  width: 280px;
  height: 280px;
  background: linear-gradient(135deg, rgba(117, 208, 255, 0.12), transparent 70%);
  transform: rotate(25deg);
  pointer-events: none;
}

body.variant-c .brand-card::after {
  background: rgba(255, 158, 94, 0.1);
}

body.click-a .brand-label-link {
  color: var(--accent);
}

body.click-b .brand-label-link {
  color: #ffffff;
  text-decoration: underline dotted rgba(117, 208, 255, 0.6);
}

body.click-c .brand-label-link {
  color: var(--accent-neon);
  text-shadow: 0 0 10px rgba(117, 208, 255, 0.18);
}

.brand-label-link {
  text-decoration: none;
  transition: color 0.25s ease, text-decoration 0.25s ease, transform 0.25s ease;
}

.brand-label-link:hover {
  transform: translateY(-1px);
}

.hero-copy,
.hero-shell h1,
.brand-card,
.footer-panel {
  animation: fadeIn 1.1s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.site-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--accent);
  font-weight: 700;
}

.site-header h1 {
  font-size: clamp(2.5rem, 3.5vw, 4.25rem);
  line-height: 1.02;
  max-width: 13ch;
}

.header-brand-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.header-brand-list span {
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-copy {
  max-width: 760px;
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text-muted);
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.brand-card {
  background: rgba(10, 16, 31, 0.95);
  border: 1px solid rgba(117, 208, 255, 0.12);
  border-radius: 24px;
  padding: 2rem;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.brand-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(117, 208, 255, 0.08), transparent 28%);
  pointer-events: none;
}

.brand-card::after {
  content: '';
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(154, 120, 255, 0.1);
  top: -40px;
  right: -40px;
  pointer-events: none;
}

.brand-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.75rem;
}

.brand-link {
  margin-top: auto;
  align-self: flex-end;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.25s ease, transform 0.25s ease;
}


.brand-card h2 {
  font-size: 1.45rem;
  line-height: 1.2;
}

.brand-card p {
  color: var(--text-muted);
  line-height: 1.9;
}

.footer-panel {
  padding: 1.5rem 2rem;
  border-radius: 22px;
  background: rgba(7, 13, 24, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 1rem;
}

.footer-panel .copyright {
  margin-top: 1rem;
  color: rgba(227, 247, 255, 0.72);
  font-size: 0.95rem;
}

@media (max-width: 960px) {
  .brand-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  html, body {
    overflow-x: hidden;
    max-width: 100%;
  }

  .page-shell {
    padding: 1.25rem 0.75rem 2rem;
  }

  .site-header {
    padding: 1.5rem 1rem;
  }

  .hero-copy {
    font-size: 1rem;
  }

  /* Reduce large decorative elements and remove rings on small screens to avoid overflow */
  .nebula {
    width: 220px !important;
    height: 220px !important;
    filter: blur(28px);
  }

  .nebula-1 { top: 6%; left: 4%; }
  .nebula-2 { top: 28%; right: 6%; }
  .nebula-3 { bottom: 6%; left: 12%; }

  .glow-ring { display: none; }

  #particle-canvas {
    left: 0; right: 0; width: 100%;
  }

  .hero-shell { padding: 0 0.5rem; }
}

@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(12px, -22px) scale(1.03); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.status-running .status-indicator {
  background-color: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2s infinite;
}

.status-stopped .status-indicator {
  background-color: var(--danger);
  box-shadow: 0 0 10px var(--danger);
}

.status-idle .status-indicator {
  background-color: var(--idle);
}

.agent-id {
  font-weight: 500;
  font-size: 0.95rem;
}

.agent-status-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.agent-actions {
  display: flex;
  gap: 0.5rem;
}

.create-agent-form {
  flex-direction: row;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(102, 252, 241, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(102, 252, 241, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(102, 252, 241, 0); }
}

@keyframes fadeInY {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}
