/* ===================================================
   LIQUID GLASS & BUBBLE SYSTEM — TodayInTech
   =================================================== */

/* ── SVG filter (injected once via JS) ── */
.liquid-glass-filter { position: absolute; width: 0; height: 0; }

/* ── CSS Variables ── */
:root {
  --lg-blur: 22px;
  --lg-sat: 200%;
  --lg-shine: rgba(255,255,255,0.18);
  --lg-border: rgba(255,255,255,0.22);
  --lg-shadow: 0 8px 40px rgba(0,0,0,0.35);
  --lg-iridescent: linear-gradient(
    130deg,
    rgba(255,255,255,0.22) 0%,
    rgba(139,92,246,0.18) 20%,
    rgba(192,132,252,0.14) 40%,
    rgba(236,72,153,0.12) 60%,
    rgba(255,255,255,0.20) 80%,
    rgba(99,202,253,0.15) 100%
  );
  --lg-iridescent-hover: linear-gradient(
    130deg,
    rgba(255,255,255,0.30) 0%,
    rgba(139,92,246,0.28) 20%,
    rgba(192,132,252,0.22) 40%,
    rgba(236,72,153,0.20) 60%,
    rgba(255,255,255,0.28) 80%,
    rgba(99,202,253,0.22) 100%
  );
  --bubble-hue: 260deg;
}

html.light-mode {
  --lg-shine: rgba(255,255,255,0.55);
  --lg-border: rgba(139,92,246,0.25);
  --lg-shadow: 0 8px 40px rgba(139,92,246,0.12);
}

/* =============================================
   GLOBAL BUBBLE CANVAS
   ============================================= */
#lg-bubble-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

/* =============================================
   LIQUID GLASS CARD ENHANCEMENT
   ============================================= */
.liquid-glass,
.service-card,
.feature-card,
.pricing-card,
.hero-badge,
.floating-badge,
.hero-float-icon,
.stat-card,
.process-step,
.testimonial-card,
.portfolio-card,
.tech-card,
.blog-card,
.contact-form,
.faq-item {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.4s cubic-bezier(0.34,1.56,0.64,1),
    box-shadow 0.4s ease,
    border-color 0.3s ease;
}

/* Iridescent shimmer layer */
.liquid-glass::before,
.service-card::before,
.feature-card::before,
.pricing-card::before,
.stat-card::before,
.process-step::before,
.testimonial-card::before,
.portfolio-card::before,
.tech-card::before,
.blog-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--lg-iridescent);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}

.liquid-glass:hover::before,
.service-card:hover::before,
.feature-card:hover::before,
.pricing-card:hover::before,
.stat-card:hover::before,
.process-step:hover::before,
.testimonial-card:hover::before,
.portfolio-card:hover::before,
.tech-card:hover::before,
.blog-card:hover::before {
  opacity: 1;
}

/* Moving shine streak */
.liquid-glass::after,
.service-card::after,
.feature-card::after,
.pricing-card::after,
.stat-card::after,
.process-step::after,
.testimonial-card::after,
.portfolio-card::after,
.tech-card::after,
.blog-card::after {
  content: '';
  position: absolute;
  top: -60%;
  left: -80%;
  width: 60%;
  height: 200%;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255,255,255,0.12) 50%,
    transparent 60%
  );
  transform: skewX(-15deg);
  transition: left 0.6s ease;
  pointer-events: none;
  z-index: 1;
}

.liquid-glass:hover::after,
.service-card:hover::after,
.feature-card:hover::after,
.pricing-card:hover::after,
.stat-card:hover::after,
.process-step:hover::after,
.testimonial-card:hover::after,
.portfolio-card:hover::after,
.tech-card:hover::after,
.blog-card:hover::after {
  left: 130%;
}

/* Hover lift */
.service-card:hover,
.feature-card:hover,
.pricing-card:hover,
.stat-card:hover,
.process-step:hover,
.testimonial-card:hover,
.portfolio-card:hover,
.tech-card:hover,
.blog-card:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow:
    var(--lg-shadow),
    0 0 0 1px rgba(139,92,246,0.3),
    inset 0 1px 0 rgba(255,255,255,0.15);
}

/* =============================================
   NAVBAR LIQUID GLASS
   ============================================= */
.navbar.scrolled {
  border: 1px solid var(--lg-border) !important;
  box-shadow:
    0 4px 32px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.09),
    0 0 0 1px rgba(139,92,246,0.08) !important;
}

/* =============================================
   BUTTON LIQUID GLASS
   ============================================= */
.btn-primary,
.btn-secondary,
.nav-cta {
  position: relative;
  overflow: hidden;
}

.btn-primary::before,
.btn-secondary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--lg-iridescent);
  opacity: 0;
  transition: opacity 0.35s ease;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
}

.btn-primary:hover::before,
.btn-secondary:hover::before {
  opacity: 1;
}

.btn-primary > *,
.btn-secondary > * {
  position: relative;
  z-index: 1;
}

/* Ripple effect on buttons */
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transform: scale(0);
  animation: lg-ripple 0.7s linear;
  pointer-events: none;
  z-index: 2;
}

@keyframes lg-ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* =============================================
   LIQUID MORPH BLOBS (Background)
   ============================================= */
.lg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  animation: lg-blob-appear 1.5s ease forwards, lg-blob-float linear infinite;
  mix-blend-mode: screen;
}

.lg-blob-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(139,92,246,0.35), transparent 70%);
  top: -200px;
  right: -100px;
  animation-duration: 1.5s, 18s;
  animation-delay: 0s, 0s;
}

.lg-blob-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(236,72,153,0.25), transparent 70%);
  bottom: -100px;
  left: -100px;
  animation-duration: 1.5s, 22s;
  animation-delay: 0.3s, 0s;
}

.lg-blob-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99,202,253,0.20), transparent 70%);
  top: 40%;
  left: 40%;
  animation-duration: 1.5s, 26s;
  animation-delay: 0.6s, 0s;
}

@keyframes lg-blob-appear {
  to { opacity: 1; }
}

@keyframes lg-blob-float {
  0%   { transform: translate(0, 0) scale(1); }
  20%  { transform: translate(40px, -60px) scale(1.05); }
  40%  { transform: translate(-30px, 40px) scale(0.95); }
  60%  { transform: translate(60px, 30px) scale(1.08); }
  80%  { transform: translate(-40px, -30px) scale(0.97); }
  100% { transform: translate(0, 0) scale(1); }
}

/* =============================================
   BUBBLE PARTICLES (CSS-only fallback layer)
   ============================================= */
.lg-bubble-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.lg-css-bubble {
  position: absolute;
  bottom: -120px;
  border-radius: 50%;
  animation: lg-bubble-rise linear infinite;
  opacity: 0;
}

.lg-css-bubble::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 35%,
    rgba(255,255,255,0.55) 0%,
    rgba(139,92,246,0.20) 30%,
    rgba(192,132,252,0.12) 60%,
    transparent 100%
  );
}

.lg-css-bubble::after {
  content: '';
  position: absolute;
  top: 10%;
  left: 15%;
  width: 30%;
  height: 20%;
  background: rgba(255,255,255,0.6);
  border-radius: 50%;
  filter: blur(3px);
  transform: rotate(-30deg);
}

/* Generate 20 CSS bubbles via nth-child */
.lg-css-bubble:nth-child(1)  { left: 5%;  width: 28px;  height: 28px;  animation-duration: 9s;  animation-delay: 0s;    border: 1px solid rgba(255,255,255,0.25); }
.lg-css-bubble:nth-child(2)  { left: 12%; width: 18px;  height: 18px;  animation-duration: 12s; animation-delay: 1.5s;  border: 1px solid rgba(139,92,246,0.35); }
.lg-css-bubble:nth-child(3)  { left: 20%; width: 42px;  height: 42px;  animation-duration: 15s; animation-delay: 3s;    border: 1px solid rgba(255,255,255,0.20); }
.lg-css-bubble:nth-child(4)  { left: 28%; width: 22px;  height: 22px;  animation-duration: 11s; animation-delay: 0.8s;  border: 1px solid rgba(192,132,252,0.40); }
.lg-css-bubble:nth-child(5)  { left: 37%; width: 35px;  height: 35px;  animation-duration: 14s; animation-delay: 2.2s;  border: 1px solid rgba(255,255,255,0.18); }
.lg-css-bubble:nth-child(6)  { left: 45%; width: 16px;  height: 16px;  animation-duration: 8s;  animation-delay: 4.1s;  border: 1px solid rgba(236,72,153,0.35); }
.lg-css-bubble:nth-child(7)  { left: 53%; width: 48px;  height: 48px;  animation-duration: 18s; animation-delay: 0.5s;  border: 1px solid rgba(255,255,255,0.15); }
.lg-css-bubble:nth-child(8)  { left: 62%; width: 24px;  height: 24px;  animation-duration: 10s; animation-delay: 3.5s;  border: 1px solid rgba(99,202,253,0.35); }
.lg-css-bubble:nth-child(9)  { left: 70%; width: 32px;  height: 32px;  animation-duration: 13s; animation-delay: 1.8s;  border: 1px solid rgba(255,255,255,0.22); }
.lg-css-bubble:nth-child(10) { left: 78%; width: 20px;  height: 20px;  animation-duration: 9s;  animation-delay: 6s;    border: 1px solid rgba(139,92,246,0.30); }
.lg-css-bubble:nth-child(11) { left: 85%; width: 38px;  height: 38px;  animation-duration: 16s; animation-delay: 2.8s;  border: 1px solid rgba(255,255,255,0.17); }
.lg-css-bubble:nth-child(12) { left: 93%; width: 14px;  height: 14px;  animation-duration: 7s;  animation-delay: 5s;    border: 1px solid rgba(192,132,252,0.45); }
.lg-css-bubble:nth-child(13) { left: 8%;  width: 54px;  height: 54px;  animation-duration: 20s; animation-delay: 7s;    border: 1px solid rgba(255,255,255,0.12); }
.lg-css-bubble:nth-child(14) { left: 17%; width: 19px;  height: 19px;  animation-duration: 10s; animation-delay: 4.5s;  border: 1px solid rgba(236,72,153,0.28); }
.lg-css-bubble:nth-child(15) { left: 33%; width: 29px;  height: 29px;  animation-duration: 12s; animation-delay: 9s;    border: 1px solid rgba(255,255,255,0.20); }
.lg-css-bubble:nth-child(16) { left: 50%; width: 44px;  height: 44px;  animation-duration: 17s; animation-delay: 1.2s;  border: 1px solid rgba(99,202,253,0.25); }
.lg-css-bubble:nth-child(17) { left: 65%; width: 17px;  height: 17px;  animation-duration: 8s;  animation-delay: 8s;    border: 1px solid rgba(139,92,246,0.40); }
.lg-css-bubble:nth-child(18) { left: 75%; width: 36px;  height: 36px;  animation-duration: 14s; animation-delay: 3.8s;  border: 1px solid rgba(255,255,255,0.16); }
.lg-css-bubble:nth-child(19) { left: 88%; width: 25px;  height: 25px;  animation-duration: 11s; animation-delay: 6.5s;  border: 1px solid rgba(192,132,252,0.32); }
.lg-css-bubble:nth-child(20) { left: 42%; width: 60px;  height: 60px;  animation-duration: 22s; animation-delay: 4.8s;  border: 1px solid rgba(255,255,255,0.10); }

@keyframes lg-bubble-rise {
  0%   { transform: translateY(0)   translateX(0)   scale(0.8); opacity: 0; }
  10%  { opacity: 0.7; }
  50%  { transform: translateY(-50vh) translateX(25px)  scale(1.05); opacity: 0.55; }
  85%  { opacity: 0.4; }
  100% { transform: translateY(-105vh) translateX(-15px) scale(0.9);  opacity: 0; }
}

/* =============================================
   MOUSE-FOLLOW BUBBLE TRAIL
   ============================================= */
.lg-cursor-bubble {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: screen;
  animation: lg-cursor-pop 0.8s ease forwards;
  transform: translate(-50%, -50%);
}

@keyframes lg-cursor-pop {
  0%   { transform: translate(-50%,-50%) scale(0);   opacity: 0.9; }
  50%  { transform: translate(-50%,-50%) scale(1);   opacity: 0.6; }
  100% { transform: translate(-50%,-50%) scale(1.5); opacity: 0; }
}

/* =============================================
   CANVAS BUBBLE STYLES
   ============================================= */
#lg-bubble-canvas {
  mix-blend-mode: screen;
}

html.light-mode #lg-bubble-canvas {
  mix-blend-mode: multiply;
  opacity: 0.35;
}

/* =============================================
   SECTION DIVIDERS — LIQUID WAVE
   ============================================= */
.lg-wave-divider {
  position: relative;
  height: 60px;
  overflow: hidden;
  pointer-events: none;
}

.lg-wave-divider svg {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
}

/* =============================================
   LIQUID GLASS INPUT FIELDS
   ============================================= */
.contact-form input,
.contact-form textarea,
.contact-form select,
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat));
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat));
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
  border-color: rgba(139,92,246,0.6) !important;
  box-shadow:
    0 0 0 3px rgba(139,92,246,0.15),
    inset 0 1px 0 rgba(255,255,255,0.12) !important;
  outline: none;
}

/* =============================================
   LIQUID GLASS SCROLL INDICATOR
   ============================================= */
.lg-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(
    90deg,
    #8b5cf6,
    #c084fc,
    #ec4899,
    #63cafd,
    #8b5cf6
  );
  background-size: 200% 100%;
  z-index: 9999;
  animation: lg-progress-shimmer 2s linear infinite;
  box-shadow: 0 0 12px rgba(139,92,246,0.6);
  transition: width 0.1s linear;
}

@keyframes lg-progress-shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* =============================================
   HERO FLOAT ICONS — ENHANCED GLASS
   ============================================= */
.hero-float-icon {
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    0 8px 24px rgba(0,0,0,0.3),
    0 0 0 1px rgba(139,92,246,0.15) !important;
}

/* =============================================
   CARD TILT — 3D PARALLAX
   ============================================= */
[data-tilt] {
  transform-style: preserve-3d;
  transform: perspective(1000px);
  transition: transform 0.1s ease;
}

[data-tilt] > * {
  transform: translateZ(20px);
}

/* =============================================
   GLOW CURSOR
   ============================================= */
.lg-cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(139,92,246,0.08) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  mix-blend-mode: screen;
}

/* =============================================
   PULSE RINGS ON STAT NUMBERS
   ============================================= */
.hero-stat-number,
.stat-number {
  position: relative;
  display: inline-block;
}

/* =============================================
   FOOTER GLASS
   ============================================= */
footer,
.footer {
  position: relative;
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
}

/* =============================================
   REDUCED MOTION RESPECT
   ============================================= */
@media (prefers-reduced-motion: reduce) {
  .lg-css-bubble,
  .lg-blob,
  .lg-cursor-bubble,
  #lg-bubble-canvas {
    display: none !important;
  }

  .liquid-glass::after,
  .service-card::after,
  .feature-card::after,
  .pricing-card::after,
  .stat-card::after,
  .process-step::after,
  .testimonial-card::after,
  .portfolio-card::after,
  .tech-card::after,
  .blog-card::after {
    display: none;
  }
}

/* =============================================
   LIGHT MODE OVERRIDES
   ============================================= */
html.light-mode .lg-blob {
  mix-blend-mode: multiply;
  opacity: 0.5 !important;
}

html.light-mode .lg-css-bubble::before {
  background: radial-gradient(
    circle at 35% 35%,
    rgba(255,255,255,0.85) 0%,
    rgba(139,92,246,0.15) 30%,
    rgba(192,132,252,0.08) 60%,
    transparent 100%
  );
}

html.light-mode .lg-css-bubble {
  border-color: rgba(139,92,246,0.25) !important;
  opacity: 0.6;
}

html.light-mode .service-card:hover,
html.light-mode .feature-card:hover,
html.light-mode .pricing-card:hover,
html.light-mode .stat-card:hover,
html.light-mode .process-step:hover,
html.light-mode .testimonial-card:hover,
html.light-mode .portfolio-card:hover,
html.light-mode .tech-card:hover,
html.light-mode .blog-card:hover {
  box-shadow:
    0 12px 40px rgba(139,92,246,0.18),
    0 0 0 1px rgba(139,92,246,0.2),
    inset 0 1px 0 rgba(255,255,255,0.8);
}
