/* ==========================================================================
   Home Page Animations
   Hero entrance effects, floating badges, and responsive overrides.
   Used only by index.html.
   ========================================================================== */

button.mobile-nav-toggle {
  background: transparent;
  border: 0;
  padding: 0;
  line-height: 0;
}

img.hero-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 50%;
}

img.header-logo,
img.hero-underline {
  height: auto;
}

/* --- 1. Text clip-reveal from left --- */
@keyframes clipReveal {
  from {
    clip-path: inset(0 100% 0 0);
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    clip-path: inset(0 0 0 0);
    opacity: 1;
    transform: translateX(0);
  }
}

.hero-left .title.subtitle {
  animation: clipReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.hero-left .title.home-hero {
  animation: clipReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.45s both;
}

/* --- 2. Gradient shimmer on main heading --- */
.hero-left .title.home-hero {
  background: linear-gradient(
    90deg,
    var(--color-dark, #14142b) 0%,
    var(--color-dark, #14142b) 40%,
    #5b5fc7 50%,
    var(--color-dark, #14142b) 60%,
    var(--color-dark, #14142b) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation:
    clipReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.45s both,
    textShimmer 4s ease-in-out 1.5s infinite;
}

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

/* --- 3. Underline draw-in --- */
.image.hero-underline {
  animation: underlineDraw 1s cubic-bezier(0.16, 1, 0.3, 1) 0.7s both;
}

@keyframes underlineDraw {
  from {
    clip-path: inset(0 100% 0 0);
    opacity: 0;
  }
  to {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}

/* --- 4. Buttons pop-in with bounce --- */
._2-column-grid > div:nth-child(1) {
  animation: buttonPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.9s both;
}

._2-column-grid > div:nth-child(2) {
  animation: buttonPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 1.05s both;
}

@keyframes buttonPop {
  from {
    opacity: 0;
    transform: scale(0.5) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* --- 5. Hero image — scale-in + continuous float + glow ring --- */
.image-wrapper.hero-image {
  overflow: visible !important;
  position: relative;
  border-radius: 0 !important;
  clip-path: none !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  animation:
    heroImageIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both,
    heroFloat 5s ease-in-out 1.5s infinite,
    glowRing 5s ease-in-out 1.5s infinite;
}

@keyframes heroImageIn {
  from {
    opacity: 0;
    transform: scale(0.7) rotate(-5deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@keyframes glowRing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91, 95, 199, 0.15); }
  50% { box-shadow: 0 0 30px 8px rgba(91, 95, 199, 0.08); }
}

/* --- 6. Footer fade-in on load --- */
.footer {
  animation: fadeUp 0.6s ease 1.2s both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- 7. Hero section overflow for floating badges --- */
.section.hero-section,
.section.hero-section .container-default,
.section.hero-section .hero-wrapper {
  overflow: visible !important;
}

/* --- 8. Floating project badges around hero image --- */
.hero-badge {
  position: absolute;
  z-index: 2;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(20, 20, 43, 0.15);
  opacity: 0;
  background: #fff;
  padding: 4px;
}

.hero-badge img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.hero-badge-1 {
  width: 140px;
  top: 2%;
  left: -12%;
  animation: badgePop 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards,
             badgeFloat1 4s ease-in-out 1.6s infinite;
}

.hero-badge-2 {
  width: 130px;
  top: 8%;
  right: -10%;
  animation: badgePop 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1s forwards,
             badgeFloat2 4.5s ease-in-out 1.8s infinite;
}

.hero-badge-3 {
  width: 120px;
  bottom: 25%;
  left: -10%;
  animation: badgePop 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1.2s forwards,
             badgeFloat3 5s ease-in-out 2s infinite;
}

.hero-badge-4 {
  width: 135px;
  bottom: 8%;
  right: -8%;
  animation: badgePop 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1.4s forwards,
             badgeFloat4 3.8s ease-in-out 2.2s infinite;
}

@keyframes badgePop {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes badgeFloat1 {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-10px) rotate(0deg); }
}
@keyframes badgeFloat2 {
  0%, 100% { transform: translateY(0) rotate(2deg); }
  50% { transform: translateY(-12px) rotate(-1deg); }
}
@keyframes badgeFloat3 {
  0%, 100% { transform: translateY(0) rotate(3deg); }
  50% { transform: translateY(-8px) rotate(0deg); }
}
@keyframes badgeFloat4 {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-11px) rotate(1deg); }
}

/* --- Responsive --- */
@media (max-width: 991px) {
  .hero-badge-1 { width: 110px; left: -4%; top: 0; }
  .hero-badge-2 { width: 100px; right: -4%; top: 5%; }
  .hero-badge-3 { width: 95px; left: -4%; }
  .hero-badge-4 { width: 105px; right: -3%; }
}

@media (max-width: 767px) {
  .hero-badge { border-width: 2px; border-radius: 10px; }
  .hero-badge-1 { width: 80px; top: -2%; left: 2%; }
  .hero-badge-2 { width: 75px; top: 3%; right: 2%; }
  .hero-badge-3 { width: 70px; bottom: 20%; left: 2%; }
  .hero-badge-4 { width: 78px; bottom: 5%; right: 2%; }
}

@media (max-width: 479px) {
  .hero-badge-1 { width: 60px; }
  .hero-badge-2 { width: 55px; }
  .hero-badge-3 { width: 52px; }
  .hero-badge-4 { width: 58px; }
}

/* --- Respect reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
