/* ============================================================
   INFRASTRUCTURE STANDARD — Deployment Guarantees Section
   Built by Cerebro for King Kyle
   
   Positioned between Deployment Record and Mission Protocol.
   Four pillars of Sentinel infrastructure — no fluff.
   ============================================================ */

/* ── Section Container ── */
.infra-section {
  position: relative;
  padding: clamp(5rem, 10vw, 8rem) 0;
  overflow: hidden;
  background: var(--bg);
}

/* Subtle ambient glow */
.infra-section::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(ellipse at center, rgba(var(--emerald-rgb), 0.04), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Grid background pattern */
.infra-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 100%);
}

.infra-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

/* ── Section Header ── */
.infra-header {
  text-align: center;
  margin-bottom: clamp(3rem, 6vw, 4.5rem);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.infra-header.infra-visible {
  opacity: 1;
  transform: translateY(0);
}

.infra-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--emerald);
  margin-bottom: var(--space-4);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}

.infra-label::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--emerald);
  border-radius: 50%;
  animation: infra-pulse 2s ease-in-out infinite;
}

@keyframes infra-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
  50% { opacity: 0.6; box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}

.infra-title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  margin: 0 0 var(--space-4);
}

.infra-title-accent {
  background: linear-gradient(135deg, #10b981, #3B82F6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.infra-subtitle {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Four Pillars Grid ── */
.infra-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.infra-pillar {
  background: var(--surface);
  padding: clamp(2rem, 3.5vw, 3rem) clamp(1.25rem, 2.5vw, 2rem);
  text-align: center;
  position: relative;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  opacity: 0;
  transform: translateY(24px);
}

.infra-pillar.infra-visible {
  opacity: 1;
  transform: translateY(0);
}

.infra-pillar:nth-child(2) { transition-delay: 0.1s; }
.infra-pillar:nth-child(3) { transition-delay: 0.2s; }
.infra-pillar:nth-child(4) { transition-delay: 0.3s; }

.infra-pillar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  transition: width 0.5s ease;
}

.infra-pillar:hover::before {
  width: 100%;
}

.infra-pillar:nth-child(1)::before { background: linear-gradient(90deg, transparent, var(--emerald), transparent); }
.infra-pillar:nth-child(2)::before { background: linear-gradient(90deg, transparent, #3B82F6, transparent); }
.infra-pillar:nth-child(3)::before { background: linear-gradient(90deg, transparent, #8B5CF6, transparent); }
.infra-pillar:nth-child(4)::before { background: linear-gradient(90deg, transparent, #EC4899, transparent); }

.infra-pillar:hover {
  background: var(--surface-2);
}

/* Icon container */
.infra-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto clamp(1rem, 2vw, 1.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  position: relative;
}

.infra-pillar:nth-child(1) .infra-icon {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
}
.infra-pillar:nth-child(2) .infra-icon {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
}
.infra-pillar:nth-child(3) .infra-icon {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.15);
}
.infra-pillar:nth-child(4) .infra-icon {
  background: rgba(236, 72, 153, 0.08);
  border: 1px solid rgba(236, 72, 153, 0.15);
}

.infra-icon svg {
  width: 24px;
  height: 24px;
}

.infra-pillar:nth-child(1) .infra-icon svg { stroke: var(--emerald); }
.infra-pillar:nth-child(2) .infra-icon svg { stroke: #3B82F6; }
.infra-pillar:nth-child(3) .infra-icon svg { stroke: #8B5CF6; }
.infra-pillar:nth-child(4) .infra-icon svg { stroke: #EC4899; }

/* Pillar text */
.infra-pillar-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

.infra-pillar-desc {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.65;
  letter-spacing: 0.02em;
}

/* ── Status bar below pillars ── */
.infra-status-bar {
  margin-top: clamp(2rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 3vw, 3rem);
  opacity: 0;
  transition: opacity 0.6s ease 0.5s;
}

.infra-status-bar.infra-visible {
  opacity: 1;
}

.infra-status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.05em;
}

.infra-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  animation: infra-pulse 2s ease-in-out infinite;
}

.infra-status-dot--blue {
  background: #3B82F6;
}

.infra-status-value {
  color: var(--emerald);
  font-weight: 600;
}

/* ══════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .infra-pillars {
    grid-template-columns: repeat(2, 1fr);
  }

  .infra-status-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 2rem;
  }
}

@media (max-width: 520px) {
  .infra-pillars {
    grid-template-columns: 1fr;
  }

  .infra-pillar {
    text-align: left;
    display: grid;
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto;
    gap: 0 16px;
    padding: clamp(1.25rem, 2.5vw, 1.75rem);
  }

  .infra-icon {
    margin: 0;
    width: 48px;
    height: 48px;
    grid-row: 1 / 3;
    align-self: center;
  }

  .infra-pillar-title {
    align-self: end;
    margin-bottom: 2px;
  }

  .infra-pillar-desc {
    align-self: start;
  }

  .infra-status-bar {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .infra-header,
  .infra-pillar,
  .infra-status-bar {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }

  .infra-label::before,
  .infra-status-dot {
    animation: none !important;
  }
}
