/* =========================================================
   HSS MUNDUR — ADVANCED 3D EFFECTS & ANIMATIONS
   Premium Visual Enhancements
   ========================================================= */

/* ── ADVANCED 3D CARD ANIMATIONS ── */
.feature-card {
  perspective: 900px !important;
  transform-style: preserve-3d !important;
  position: relative;
  z-index: 0;
  transform-origin: center center;
  will-change: transform, box-shadow, opacity;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.6s var(--ease-soft);
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
  border-radius: 14px;
}

.feature-card:hover {
  z-index: 60;
  transform: perspective(900px) rotateX(6deg) rotateY(-6deg) scale(1.04);
  box-shadow: 0 18px 40px rgba(27, 122, 120, 0.2), 0 8px 24px rgba(201, 168, 76, 0.12), inset 0 1px 0 rgba(255,255,255,0.18);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  display: inline-block;
  transform-style: preserve-3d;
}

.feature-card:hover .feature-icon {
  transform: rotateY(360deg) scale(1.15) translateZ(12px);
  filter: drop-shadow(0 8px 18px rgba(255, 138, 61, 0.35));
}

/* ── GALLERY ITEMS 3D FLIP ── */
.g-item {
  perspective: 1000px;
  transform-style: preserve-3d;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  border-radius: 12px;
}

.g-item img {
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: scale(1);
}

.g-item:hover img {
  transform: 
    scale(1.15)
    rotateY(5deg)
    rotateX(-3deg);
  filter: brightness(0.8);
}

.g-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(27,122,120,0.65), rgba(255,138,61,0.45));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: white;
  opacity: 0;
  transition: opacity 0.45s ease, backdrop-filter 0.45s ease;
  backdrop-filter: blur(0px);
  transform: translateZ(8px);
  pointer-events: none;
}


.g-item:hover .g-overlay {
  opacity: 1;
  backdrop-filter: blur(8px);
}

/* ── HERO SECTION 3D PARALLAX ── */
.hero {
  perspective: 1200px;
  transform-style: preserve-3d;
  position: relative;
  overflow: hidden;
}

.hero-pattern {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(27, 122, 120, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 138, 61, 0.08) 0%, transparent 50%);
  animation: 
    patternShift 8s ease-in-out infinite,
    patternRotate 15s linear infinite;
  transform-style: preserve-3d;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  animation: 
    orbFloat 6s ease-in-out infinite,
    orbRotate 12s linear infinite,
    orbPulse 3s ease-in-out infinite;
  filter: blur(40px);
  mix-blend-mode: screen;
}

.hero-orb.o1 {
  width: 300px;
  height: 300px;
  top: -100px;
  left: -100px;
  background: radial-gradient(circle, rgba(27, 122, 120, 0.3), transparent 70%);
  transform: translate3d(0, 0, -100px);
}

.hero-orb.o2 {
  width: 250px;
  height: 250px;
  bottom: -80px;
  right: -80px;
  background: radial-gradient(circle, rgba(255, 138, 61, 0.2), transparent 70%);
  transform: translate3d(0, 0, -50px);
}

@keyframes patternShift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(20px, 15px, 0) scale(1.05); }
}

@keyframes patternRotate {
  0% { transform: rotateZ(0deg); }
  100% { transform: rotateZ(360deg); }
}

@keyframes orbFloat {
  0%, 100% { transform: translate3d(0, 0, -100px) translateY(0); }
  50% { transform: translate3d(0, 0, -100px) translateY(-40px); }
}

@keyframes orbRotate {
  0% { transform: translate3d(0, 0, -100px) rotateY(0deg); }
  100% { transform: translate3d(0, 0, -100px) rotateY(360deg); }
}

@keyframes orbPulse {
  0%, 100% { transform: scale(1); filter: blur(40px); }
  50% { transform: scale(1.2); filter: blur(50px); }
}

/* ── HERO CONTENT STAGGER ANIMATION ── */
.hero-content {
  animation: slideUpContent 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
}

.hero-badge {
  animation: slideUpContent 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s forwards;
  opacity: 0;
  transform-origin: center;
}

.hero-content h2 {
  animation: slideUpContent 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
  opacity: 0;
  perspective: 1200px;
}

.hero-content p {
  animation: slideUpContent 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards;
  opacity: 0;
}

.hero-btns {
  animation: slideUpContent 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s forwards;
  opacity: 0;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

@keyframes slideUpContent {
  from {
    opacity: 0;
    transform: translate3d(0, 60px, 0) rotateX(20deg);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotateX(0deg);
  }
}

/* ── 3D BUTTON EFFECTS ── */
.btn {
  perspective: 1200px;
  transform-style: preserve-3d;
  position: relative;
  overflow: visible;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  border-radius: inherit;
  transform: translateZ(-2px);
  opacity: 0.5;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn:hover::before {
  transform: translateZ(-8px) scale(1.05);
  opacity: 0.8;
}

.btn:hover {
  transform: 
    perspective(1200px)
    rotateX(-5deg)
    rotateY(5deg)
    translateZ(15px)
    scale(1.05);
  filter: drop-shadow(0 20px 40px rgba(27, 122, 120, 0.4));
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1b7a78 0%, #2aada9 100%) !important;
  box-shadow: 
    0 20px 50px rgba(27, 122, 120, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 30px rgba(27, 122, 120, 0.3);
}

/* ── SCROLL REVEAL WITH 3D ── */
.reveal {
  perspective: 1200px;
  transform-style: preserve-3d;
}

.reveal[data-reveal="left"] {
  animation: revealFromLeft 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
  transform: translateX(-100px) rotateY(45deg);
}

.reveal[data-reveal="right"] {
  animation: revealFromRight 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
  transform: translateX(100px) rotateY(-45deg);
}

.reveal[data-reveal="up"] {
  animation: revealFromUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
  transform: translateY(80px) rotateX(30deg);
}

.reveal.visible,
.reveal.in-view {
  animation: none;
  opacity: 1;
  transform: translate(0) rotate(0deg) rotateX(0deg) rotateY(0deg);
}

@keyframes revealFromLeft {
  from {
    opacity: 0;
    transform: translateX(-100px) rotateY(45deg);
  }
  to {
    opacity: 1;
    transform: translateX(0) rotateY(0deg);
  }
}

@keyframes revealFromRight {
  from {
    opacity: 0;
    transform: translateX(100px) rotateY(-45deg);
  }
  to {
    opacity: 1;
    transform: translateX(0) rotateY(0deg);
  }
}

@keyframes revealFromUp {
  from {
    opacity: 0;
    transform: translateY(80px) rotateX(30deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
  }
}

/* ── FADE-IN WITH SCALE ANIMATIONS ── */
.fade-in {
  animation: fadeInScale 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
  transform: scale(0.95);
}

.fade-in.visible,
.fade-in.in-view {
  opacity: 1;
  transform: scale(1);
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ── MARQUEE ADVANCED ANIMATION ── */
.marquee {
  overflow: hidden;
  perspective: 1200px;
}

.marquee-track {
  animation: 
    marqueeScroll 20s linear infinite,
    marqueeDepth 8s ease-in-out infinite;
  display: flex;
  gap: 30px;
  transform-style: preserve-3d;
}

@keyframes marqueeScroll {
  0% { transform: translateX(0) translateZ(0); }
  100% { transform: translateX(-50%) translateZ(0); }
}

@keyframes marqueeDepth {
  0%, 100% { transform: translateZ(-50px) scaleZ(0.8); }
  50% { transform: translateZ(50px) scaleZ(1); }
}

/* ── STAT COUNTERS WITH GLOW ── */
.stat-item {
  position: relative;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.stat-item::before {
  content: '';
  position: absolute;
  inset: -8px;
  background: radial-gradient(circle, rgba(27, 122, 120, 0.1), transparent 70%);
  border-radius: 50%;
  animation: counterGlow 3s ease-in-out infinite;
  opacity: 0;
  z-index: -1;
}

.stat-item.animate-in::before {
  animation: counterGlow 3s ease-in-out infinite;
  opacity: 1;
}

.stat-number {
  display: inline-block;
  animation: counterPulse 0.6s ease-out;
  transform-style: preserve-3d;
}

@keyframes counterGlow {
  0%, 100% { 
    transform: scale(1) translateZ(0);
    filter: drop-shadow(0 0 0 rgba(27, 122, 120, 0));
  }
  50% { 
    transform: scale(1.2) translateZ(10px);
    filter: drop-shadow(0 0 20px rgba(27, 122, 120, 0.4));
  }
}

@keyframes counterPulse {
  0% { transform: scale(0.5) rotateX(90deg); opacity: 0; }
  50% { transform: scale(1.1) rotateX(0deg); }
  100% { transform: scale(1) rotateX(0deg); opacity: 1; }
}

/* ── TEXT GRADIENT ANIMATION ── */
.text-gradient {
  background: linear-gradient(
    135deg,
    #1b7a78 0%,
    #2aada9 25%,
    #c9a84c 50%,
    #ff8a3d 75%,
    #1b7a78 100%
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 6s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ── ABOUT BADGE FLOAT ENHANCED ── */
.about-badge-float {
  animation: 
    badgeFloat 4s ease-in-out infinite,
    badgeRotate 8s linear infinite,
    badgeGlow 2s ease-in-out infinite;
  transform-style: preserve-3d;
}

@keyframes badgeFloat {
  0%, 100% { transform: translateY(0) translateZ(0); }
  50% { transform: translateY(-20px) translateZ(40px); }
}

@keyframes badgeRotate {
  0% { transform: rotateX(0deg) rotateY(0deg); }
  100% { transform: rotateX(360deg) rotateY(360deg); }
}

@keyframes badgeGlow {
  0%, 100% { filter: drop-shadow(0 10px 20px rgba(201, 168, 76, 0.3)); }
  50% { filter: drop-shadow(0 15px 35px rgba(201, 168, 76, 0.6)); }
}

/* ── FEATURE CARD GRID STAGGER ── */
.features-grid {
  perspective: 1200px;
}

.features-grid .feature-card:nth-child(1) { animation-delay: 0ms; }
.features-grid .feature-card:nth-child(2) { animation-delay: 100ms; }
.features-grid .feature-card:nth-child(3) { animation-delay: 200ms; }
.features-grid .feature-card:nth-child(4) { animation-delay: 300ms; }
.features-grid .feature-card:nth-child(5) { animation-delay: 400ms; }
.features-grid .feature-card:nth-child(6) { animation-delay: 500ms; }

/* ── CTA SECTION ANIMATED GRADIENT ── */
.cta-section {
  perspective: 1200px;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(135deg, rgba(27, 122, 120, 0.1) 0%, transparent 50%),
    linear-gradient(-135deg, rgba(255, 138, 61, 0.1) 50%, transparent 100%);
  animation: 
    ctaGradientShift 8s ease-in-out infinite,
    ctaRotate 15s linear infinite;
  pointer-events: none;
}

@keyframes ctaGradientShift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, 20px); }
}

@keyframes ctaRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ── HEADER SCROLL ANIMATION ── */
header {
  backdrop-filter: blur(0px);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-style: preserve-3d;
}

header.scrolled {
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 40px rgba(10, 21, 38, 0.15);
  transform: translateZ(20px);
}

/* ── LINK HOVER UNDERLINE 3D ── */
a {
  position: relative;
  transition: color 0.4s ease;
}

nav a::after,
.btn::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--teal-light), var(--gold-light), var(--flame-light));
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: left;
  box-shadow: 0 0 10px rgba(255, 138, 61, 0.3);
}

nav a:hover::after,
.btn:hover::after {
  width: 100%;
}

/* ── SMOOTH SCROLL PERFORMANCE ── */
@supports (scroll-behavior: smooth) {
  html {
    scroll-behavior: smooth;
  }
}

/* ── WILL-CHANGE FOR PERFORMANCE ── */
.feature-card,
.g-item,
.hero-orb,
.reveal,
.marquee-track,
.fade-in {
  will-change: transform, opacity;
}

/* ── ENHANCED MOBILE RESPONSIVENESS ── */
@media (max-width: 768px) {
  .feature-card:hover {
    transform: 
      perspective(800px)
      rotateX(4deg) 
      rotateY(-6deg) 
      rotateZ(2deg)
      translateZ(30px)
      scale(1.04) !important;
  }

  .btn:hover {
    transform: 
      perspective(800px)
      rotateX(-3deg)
      rotateY(3deg)
      translateZ(8px)
      scale(1.03);
  }

  .hero-orb.o1 { width: 200px; height: 200px; }
  .hero-orb.o2 { width: 150px; height: 150px; }

  .marquee-track {
    animation: marqueeScroll 15s linear infinite;
  }
}
