/* ═══════════════════════════════════════════════════════
   INFRALYTICS — Custom Styles
   ═══════════════════════════════════════════════════════ */

/* ─── CSS Variables ─── */
:root {
  --bg-primary: #FCFBFA;
  --bg-surface: #F5F3F0;
  --bg-elevated: #E8E4DF;
  --text-primary: #1A1D25;
  --text-secondary: #5C5F6A;
  --accent-blue: #7F1D1D;
  --accent-cyan: #92400E;
  --accent-green: #475569;
  --accent-amber: #B45309;
  --gradient: linear-gradient(135deg, #7F1D1D, #92400E);
}

/* ─── Base ─── */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  overflow-x: hidden;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.008) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.008) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ─── Grid Cursor Glow ─── */
section {
  position: relative;
}

section > .grid-glow-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(127, 29, 29, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 29, 29, 0.13) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(circle 300px at var(--gx) var(--gy), black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle 300px at var(--gx) var(--gy), black 0%, transparent 70%);
  opacity: var(--grid-glow-opacity, 0);
  transition: opacity 0.5s ease;
}


::selection {
  background: rgba(127, 29, 29, 0.15);
  color: var(--text-primary);
}

/* ─── Gradient Text ─── */
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Nav ─── */
#navbar {
  border-bottom: 1px solid transparent;
  transition: background-color 0.5s, backdrop-filter 0.5s, border-color 0.5s;
}

#navbar.scrolled {
  background: rgba(252, 251, 250, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

/* ─── Hero ─── */
.hero-grid {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

.hero-glow {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(127, 29, 29, 0.07) 0%, rgba(146, 64, 14, 0.04) 40%, transparent 70%);
  pointer-events: none;
}

/* ─── Scroll indicator ─── */
.scroll-line {
  animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.7); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ─── CTA Shimmer ─── */
.cta-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%
  );
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}

/* ─── Section Labels ─── */
.section-label {
  position: relative;
}

.section-label::before,
.section-label::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  vertical-align: middle;
  margin: 0 12px;
}

.section-label::before {
  background: linear-gradient(to right, transparent, currentColor);
}

.section-label::after {
  background: linear-gradient(to left, transparent, currentColor);
}

/* ─── Stat Cards ─── */
.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-glow {
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(127, 29, 29, 0.06);
  filter: blur(40px);
  opacity: 0;
  transition: opacity 0.7s ease;
}

.stat-card:hover .stat-glow {
  opacity: 1;
}

/* ─── Query Demo ─── */
.query-demo {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 20px 60px rgba(0, 0, 0, 0.08),
    0 0 120px rgba(127, 29, 29, 0.04);
}

/* ─── Flow Line ─── */
.flow-line {
  background-image: linear-gradient(to right, transparent, rgba(0,0,0,0.08) 30%, rgba(0,0,0,0.08) 70%, transparent);
  border: none;
  height: 2px;
  position: relative;
}

.flow-line::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 40px;
  height: 4px;
  background: var(--gradient);
  border-radius: 2px;
  animation: flow-pulse 3s ease-in-out infinite;
}

@keyframes flow-pulse {
  0% { left: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: calc(100% - 40px); opacity: 0; }
}

/* ─── Validation Card ─── */
.validation-card {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.04),
    0 10px 40px rgba(0, 0, 0, 0.06);
}

/* ─── Team Cards ─── */
.team-card {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.team-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

/* ─── LOI Cards ─── */
.loi-card {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.loi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* ─── Pipeline Cards ─── */

/* ─── Flow Connectors ─── */
.flow-connector {
  position: relative;
}

.flow-connector::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  opacity: 0.4;
}

/* ─── Format Badges ─── */
.format-badge {
  transition: all 0.3s ease;
}

.format-badge:hover {
  background: var(--bg-elevated);
  border-color: rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* ─── Animations — initial states ─── */
.hero-eyebrow,
.hero-headline,
.hero-sub,
.hero-ctas,
.hero-trust {
  opacity: 0;
  transform: translateY(24px);
}

/* ─── Scroll Reveal (CSS-driven) ─── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Responsive ─── */
@media (max-width: 767px) {
  .hero-glow {
    width: 400px;
    height: 300px;
  }

  .section-label::before,
  .section-label::after {
    width: 12px;
    margin: 0 8px;
  }

  h1 {
    font-size: 2.25rem !important;
  }
}

@media (max-width: 640px) {
  .hero-grid {
    background-size: 40px 40px;
  }
}

/* ─── Noise Overlay ─── */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ─── Custom Scrollbar ─── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(92, 95, 106, 0.3);
}
