.cx-section {
  position: relative;
  padding: 8rem 2rem;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  overflow: hidden;
}

/* --- BACKGROUND FX --- */
.cx-backdrop { position: absolute; inset: 0; pointer-events: none; }

.cx-glow-source {
  position: absolute; top: 15%; left: 50%; transform: translateX(-50%);
  width: 800px; height: 600px;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 8%, transparent), transparent 70%);
  filter: blur(100px);
}

.cx-container { max-width: 1000px; margin: 0 auto; position: relative; z-index: 2; }

/* --- HEADER --- */
.cx-header { text-align: center; margin-bottom: 5rem; }

.cx-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 50px;
  background: var(--glass-bg-light); border: 1px solid var(--glass-border);
  font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;
  margin-bottom: 1.5rem; backdrop-filter: blur(10px);
}
.cx-icon-shield { width: 14px; color: var(--brand); display: flex; }

.cx-header h2 { font-size: 3rem; font-weight: 700; margin: 0; letter-spacing: -0.03em; }
.cx-gradient-text {
  background: linear-gradient(135deg, #fff 30%, var(--brand));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.cx-header p { font-size: 1.1rem; color: var(--text-muted); margin-top: 1rem; }

/* --- GRID --- */
.cx-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}

/* --- CARD SYSTEM --- */
.cx-card {
  position: relative;
  background: var(--elev-2);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  min-height: 280px;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex; flex-direction: column;
  
  /* Spotlight Vars (Updated by JS) */
  --mouse-x: -100px;
  --mouse-y: -100px;
}

.cx-card:hover { transform: translateY(-4px); border-color: var(--stroke-strong); }

/* Spotlight Effect */
.cx-spotlight {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(
    600px circle at var(--mouse-x) var(--mouse-y), 
    var(--glass-highlight), 
    transparent 40%
  );
  opacity: 0; transition: opacity 0.5s;
}
.cx-card:hover .cx-spotlight { opacity: 1; }

.cx-content {
  padding: 32px; height: 100%; display: flex; flex-direction: column;
  position: relative; z-index: 2;
}

/* Icons & Badges */
.cx-top-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 3rem; }

.cx-icon-box {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent; background: var(--glass-bg-light);
  color: var(--text-muted); transition: 0.3s;
}
.cx-icon-box svg { width: 24px; }
/* Semantic Colors */
.cx-icon-box.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 5%, transparent); }
.cx-icon-box.alert { color: var(--alert); background: color-mix(in srgb, var(--alert) 5%, transparent); }

.cx-card:hover .cx-icon-box.warn,
.cx-card:hover .cx-icon-box.alert {
  background: var(--ok); color: var(--text-inverse); /* Turns Green on solve */
  transform: scale(1.1);
}

.cx-status-badge {
  font-size: 0.7rem; font-weight: 600; padding: 4px 10px; border-radius: 20px;
  display: flex; align-items: center; gap: 6px;
  background: var(--glass-bg-light); border: 1px solid var(--glass-border);
}
.cx-status-badge.warn { color: var(--warn); }
.cx-status-badge.alert { color: var(--alert); }

.cx-pulse { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: cx-blink 2s infinite; }

/* Info Flip Layer */
.cx-info-layer { position: relative; flex-grow: 1; }

.cx-view {
  position: absolute; top: 0; left: 0; width: 100%;
  transition: 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cx-view h3 { font-size: 1.25rem; margin: 0 0 8px; color: var(--text); }
.cx-view p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; margin: 0; }

/* Problem State (Visible by default) */
.cx-view.problem { opacity: 1; transform: translateY(0); }
.cx-card:hover .cx-view.problem { opacity: 0; transform: translateY(-10px); }

/* Solution State (Hidden by default) */
.cx-view.solution { opacity: 0; transform: translateY(20px); pointer-events: none; }
.cx-card:hover .cx-view.solution { opacity: 1; transform: translateY(0); }
.cx-view.solution h3 { color: var(--ok); }

.cx-resolution-tag {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 16px; padding: 6px 12px; border-radius: 8px;
  background: color-mix(in srgb, var(--ok) 10%, transparent); color: var(--ok);
  font-size: 0.75rem; font-weight: 600;
}
.cx-resolution-tag svg { width: 14px; stroke-width: 3; }

/* --- HUD CARD (Bottom) --- */
.cx-card.wide { grid-column: span 3; min-height: 160px; }
.cx-content.row-layout { flex-direction: row; align-items: center; justify-content: space-between; padding: 0 40px; }

.cx-chart-container { position: relative; width: 80px; height: 80px; }
.cx-chart-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--glass-border); stroke-width: 3; }
.ring-fill {
  fill: none; stroke: var(--ok); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 0 100; animation: cx-draw 1.5s ease-out forwards;
}
.cx-chart-label {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--ok); font-weight: 700; font-size: 1rem;
}
.cx-chart-label small { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; font-weight: 500; }

.cx-hud-metrics { display: flex; align-items: center; gap: 40px; }
.cx-hud-item { text-align: left; }
.cx-val { display: block; font-size: 2rem; font-weight: 700; color: var(--text); line-height: 1; letter-spacing: -0.02em; }
.cx-key { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; margin-top: 6px; display: block; }
.cx-hud-sep { width: 1px; height: 40px; background: var(--glass-border); }

/* --- ANIMATIONS --- */
@keyframes cx-blink { 50% { opacity: 0.3; } }
@keyframes cx-draw { to { stroke-dasharray: 100 100; } }

.cx-reveal { opacity: 0; transform: translateY(20px); transition: 0.6s ease; }
.cx-reveal.visible { opacity: 1; transform: translateY(0); }

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .cx-grid { grid-template-columns: 1fr; }
  .cx-card.wide { grid-column: span 1; min-height: auto; }
  .cx-content.row-layout { flex-direction: column; gap: 32px; align-items: flex-start; padding: 32px; }
  .cx-hud-metrics { flex-direction: column; gap: 24px; align-items: flex-start; }
  .cx-hud-sep { display: none; }
}