/* ═══════════════════════════════════════════════════════════
   iKnowhy - Cinematic Animations v2
   ═══════════════════════════════════════════════════════════ */

html, body { overflow-x: hidden; }

/* ─── Z-index stack ─────────────────────────────────────── */
.geo-anim      { z-index: 0; }
main, footer   { position: relative; z-index: 1; }
.topbar        { z-index: 100; }
.page-fade     { z-index: 9999; }

/* ─── Floating Geo Overlay (base.html layer) ────────────── */
.geo-anim {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.geo-anim svg { width: 100%; height: 100%; display: block; }
.geo-dark { display: block; }
.geo-light { display: none; }
html.light .geo-dark { display: none; }
html.light .geo-light { display: block; }

@keyframes geoFloat1 {
  0%,100% { transform: translate(0,0) rotate(0deg); }
  33%     { transform: translate(-18px,12px) rotate(2deg); }
  66%     { transform: translate(10px,-8px) rotate(-1deg); }
}
@keyframes geoFloat2 {
  0%,100% { transform: translate(0,0); }
  50%     { transform: translate(14px,-16px); }
}
@keyframes geoPulse {
  0%,100% { opacity: 0.07; }
  50%     { opacity: 0.16; }
}
.geo-f1 { animation: geoFloat1 18s ease-in-out infinite; }
.geo-f2 { animation: geoFloat2 24s ease-in-out infinite; }
.geo-f3 { animation: geoPulse  10s ease-in-out infinite; }
.geo-f4 { animation: geoFloat2 28s ease-in-out infinite reverse; }
.geo-f5 { animation: geoFloat1 22s ease-in-out infinite reverse; }

/* ─── Noise / Grain Overlay ─────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  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");
  background-repeat: repeat;
  background-size: 128px 128px;
  opacity: 0.025;
}
html.light body::after { opacity: 0.018; }

/* ─── Scroll Progress Bar ────────────────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, #0B3D7A, #1E8ACB, #3BA6E0);
  z-index: 10000;
  transition: width 0.08s linear;
  box-shadow: 0 0 8px rgba(30,138,203,0.7);
}

/* ─── Hero - Full Bleed ──────────────────────────────────── */
.hero-full {
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  margin-top: -2rem;
}

.particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* Glowing orbs */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.hero-orb-1 {
  width: 700px; height: 700px;
  top: -250px; right: -150px;
  background: radial-gradient(circle, rgba(30,138,203,0.18), transparent 65%);
  filter: blur(40px);
  animation: orbDrift1 18s ease-in-out infinite;
}
.hero-orb-2 {
  width: 500px; height: 500px;
  bottom: -150px; left: -80px;
  background: radial-gradient(circle, rgba(11,61,122,0.22), transparent 65%);
  filter: blur(60px);
  animation: orbDrift2 22s ease-in-out infinite;
}
.hero-orb-3 {
  width: 300px; height: 300px;
  top: 30%; left: 55%;
  background: radial-gradient(circle, rgba(12,143,213,0.1), transparent 65%);
  filter: blur(50px);
  animation: orbDrift1 26s ease-in-out infinite reverse;
}

@keyframes orbDrift1 {
  0%,100% { transform: translate(0,0) scale(1); }
  33%     { transform: translate(40px,-30px) scale(1.05); }
  66%     { transform: translate(-20px,20px) scale(0.97); }
}
@keyframes orbDrift2 {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(30px,-40px) scale(1.08); }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 6rem 2rem 5rem;
  max-width: 820px;
  width: 100%;
}

/* ─── Animated Gradient Text ─────────────────────────────── */
.gradient-text {
  background: linear-gradient(100deg, #1E8ACB 0%, #3BA6E0 30%, #0C8FD5 60%, #1E8ACB 100%);
  background-size: 250% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradShift 4s linear infinite;
}

@keyframes gradShift {
  0%   { background-position: 0% center; }
  100% { background-position: 250% center; }
}

/* ─── Typewriter ─────────────────────────────────────────── */
.tw-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-size: 1rem;
  color: var(--muted);
  margin: 1rem auto 1.75rem;
  font-family: var(--font-mono);
  min-height: 1.6em;
}
.tw-prefix { color: var(--muted); opacity: 0.7; white-space: nowrap; }
.tw-text   { color: #1E8ACB; font-weight: 600; }
.tw-cursor {
  display: inline-block;
  width: 2px; height: 1.1em;
  background: #1E8ACB;
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 0.9s step-end infinite;
}
@keyframes blink {
  0%,100% { opacity: 1; }
  50%     { opacity: 0; }
}

/* ─── Ticker / Marquee ───────────────────────────────────── */
.ticker {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0;
  margin: 0;
  background: transparent;
  position: relative;
  z-index: 1;
}
.ticker::before, .ticker::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 80px;
  z-index: 2;
}
.ticker::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.ticker::after  { right: 0; background: linear-gradient(-90deg, var(--bg), transparent); }

.ticker-track {
  display: flex;
  gap: 0;
  white-space: nowrap;
  animation: tickerScroll 28s linear infinite;
  will-change: transform;
}
.ticker-track:hover { animation-play-state: paused; }

@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  padding: 0 2rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.ticker-dot {
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #1E8ACB;
  margin: 0 0.5rem;
  flex-shrink: 0;
}

/* ─── Stats Counter Row ──────────────────────────────────── */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 4rem;
  padding: 3.5rem 2rem;
  text-align: center;
  flex-wrap: wrap;
}
.stat-block { display: flex; flex-direction: column; align-items: center; }
.stat-number {
  font-size: 3rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.03em;
}
.stat-number .stat-suffix {
  font-size: 1.4rem;
  font-weight: 600;
  color: #1E8ACB;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.4rem;
}

/* ─── Page Fade ──────────────────────────────────────────── */
.page-fade {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.page-fade.out { opacity: 1; pointer-events: all; }

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
main { animation: pageFadeIn 0.45s ease both; }

/* ─── Scroll Reveal ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1),
              transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.18s; }
.reveal-d3 { transition-delay: 0.28s; }
.reveal-d4 { transition-delay: 0.38s; }

/* ─── Hero Text Entrance ─────────────────────────────────── */
@keyframes heroFadeIn  { from{opacity:0} to{opacity:1} }
@keyframes heroSlideUp {
  from { opacity:0; transform:translateY(26px); }
  to   { opacity:1; transform:translateY(0); }
}
.hero-anim-logo  { opacity:0; animation: heroFadeIn  0.8s ease 0.1s both; }
.hero-anim-hbeat { opacity:0; animation: heroFadeIn  0.8s ease 0.3s both; }
.hero-anim-h1    { opacity:0; animation: heroSlideUp 0.75s cubic-bezier(0.16,1,0.3,1) 0.45s both; }
.hero-anim-tw    { opacity:0; animation: heroFadeIn  0.6s ease 0.7s both; }
.hero-anim-sub   { opacity:0; animation: heroSlideUp 0.7s cubic-bezier(0.16,1,0.3,1) 0.85s both; }
.hero-anim-cta   { opacity:0; animation: heroSlideUp 0.7s cubic-bezier(0.16,1,0.3,1) 1.0s both; }

/* ─── Heartbeat SVG ──────────────────────────────────────── */
.heartbeat-wrap {
  width: 100%; max-width: 380px;
  height: 46px; margin: 0 auto 0.75rem;
}
.heartbeat-wrap svg { width:100%; height:100%; overflow:visible; }
.hbeat-line {
  fill: none; stroke: #1E8ACB; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 520; stroke-dashoffset: 520;
  filter: drop-shadow(0 0 6px rgba(30,138,203,0.6));
  animation: drawHbeat 2.0s cubic-bezier(0.4,0,0.2,1) 0.4s both,
             hbeatGlow 2.4s ease-in-out 2.5s infinite;
}
@keyframes drawHbeat { to { stroke-dashoffset: 0; } }
@keyframes hbeatGlow {
  0%,100% { filter:drop-shadow(0 0 4px rgba(30,138,203,0.5)); stroke-opacity:1; }
  50%     { filter:drop-shadow(0 0 14px rgba(30,138,203,1)); stroke-opacity:0.8; }
}

/* ─── Glassmorphism ──────────────────────────────────────── */
.glass {
  background: rgba(14,14,14,0.58) !important;
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(255,255,255,0.07) !important;
}
html.light .glass {
  background: rgba(255,255,255,0.65) !important;
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border: 1px solid rgba(0,0,0,0.07) !important;
}
.glass.featured {
  background: rgba(11,61,122,0.25) !important;
  border: 1px solid rgba(30,138,203,0.4) !important;
}
html.light .glass.featured {
  background: rgba(30,138,203,0.07) !important;
  border: 1px solid rgba(30,138,203,0.3) !important;
}

/* ─── 3D Tilt Cards ──────────────────────────────────────── */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.08s ease, box-shadow 0.25s ease;
  will-change: transform;
}
.tilt-card .tilt-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--shine-x, 50%) var(--shine-y, 50%),
    rgba(255,255,255,0.08) 0%,
    transparent 60%
  );
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.3s;
  opacity: 0;
}
.tilt-card:hover .tilt-shine { opacity: 1; }

/* ─── Button Microinteractions ───────────────────────────── */
.btn { position: relative; overflow: hidden; }

.btn-primary {
  transition: background 0.22s ease, color 0.22s ease,
              box-shadow 0.22s ease, transform 0.15s ease !important;
}
.btn-primary:hover {
  opacity: 1 !important;
  background: #1E8ACB !important;
  color: #ffffff !important;
  box-shadow: 0 0 28px rgba(30,138,203,0.55), 0 4px 16px rgba(0,0,0,0.4) !important;
}

.btn-secondary {
  transition: border-color 0.22s ease, color 0.22s ease,
              box-shadow 0.22s ease, transform 0.15s ease !important;
}
.btn-secondary:hover {
  border-color: #1E8ACB !important;
  color: #1E8ACB !important;
  box-shadow: 0 0 18px rgba(30,138,203,0.25) !important;
  background: transparent !important;
}

.btn-ripple {
  position: absolute; border-radius: 50%;
  transform: scale(0);
  background: rgba(255,255,255,0.25);
  pointer-events: none;
  animation: rippleOut 0.55s ease-out forwards;
}
html.light .btn-primary .btn-ripple { background: rgba(0,0,0,0.1); }
@keyframes rippleOut { to { transform: scale(5); opacity: 0; } }

/* Magnetic button wrapper */
.btn-magnetic { display: inline-block; }

/* ─── Feature/Usecase card hover ─────────────────────────── */
.feature-card, .usecase-card {
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease !important;
}
.feature-card:hover, .usecase-card:hover {
  border-color: rgba(30,138,203,0.5) !important;
  box-shadow: 0 8px 32px rgba(30,138,203,0.15);
}

/* ─── Nav underline ──────────────────────────────────────── */
.nav-links a { position: relative; }
.nav-links a::after {
  content: ''; position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px; background: #1E8ACB;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.22s ease;
}
.nav-links a:hover::after { transform: scaleX(1); }

/* ─── Topbar scroll blur ─────────────────────────────────── */
.topbar { transition: background 0.3s ease, box-shadow 0.3s ease; }
.topbar.scrolled {
  background: rgba(10,10,10,0.78) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05);
}
html.light .topbar.scrolled {
  background: rgba(255,255,255,0.78) !important;
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

/* ─── Input focus glow ───────────────────────────────────── */
.form-group input:focus {
  border-color: #1E8ACB !important;
  box-shadow: 0 0 0 3px rgba(30,138,203,0.15) !important;
}

/* ─── Step hover ─────────────────────────────────────────── */
.step { transition: transform 0.25s ease; }
.step:hover { transform: translateY(-4px); }
.step:hover .step-num {
  background: #1E8ACB; color: #fff;
  transition: background 0.2s, color 0.2s;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-full { min-height: 80vh; }
  .stats-bar { gap: 2rem; }
  .stat-number { font-size: 2.2rem; }
}
