/* ============================================================
   FrugalNova - animations.css
   Advanced animations, futuristic effects, interactive UI
   ============================================================ */

/* --- 3D CARD DECK EFFECT --- */

/* --- COMPACT REFINEMENTS --- */
.container {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

@keyframes float3D {
  0%, 100% { transform: translateY(0) rotateX(0); }
  50% { transform: translateY(-15px) rotateX(2deg); }
}


/* --- SPOTLIGHT FOLLOWER --- */
.spotlight {
  position: fixed;
  width: 600px; height: 600px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, rgba(181,36,106,.06) 0%, transparent 70%);
  transform: translate(-50%,-50%);
  transition: left .12s ease, top .12s ease;
  mix-blend-mode: multiply;
}

/* --- MAGNETIC TEXT CHARS --- */
.mag-text {
  word-spacing: 0.1em;
}
.mag-word {
  display: inline-block;
  white-space: nowrap;
}
.mag-char {
  display: inline-block;
  transition: transform .4s cubic-bezier(.22,1,.36,1), color .3s ease, text-shadow .3s ease;
  cursor: default;
  will-change: transform;
  /* Fix: Ensure chars are visible by default if parent has transparent text-fill (gradient clipping) */
  -webkit-text-fill-color: currentColor;
}
.mag-char:hover {
  color: var(--clr-accent-light);
  text-shadow: 0 0 30px rgba(181,36,106,.5), 0 4px 20px rgba(181,36,106,.3);
  transform: translateY(-6px) scale(1.12) rotate(-2deg);
}

/* --- BUBBLE TEXT HOVER (for hero-title) --- */
.bub-word {
  display: inline-block;
  white-space: nowrap;
}
.bubble-text .bub-char {
  display: inline-block;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), color .3s ease;
  cursor: default;
}
.bubble-text .bub-char:hover {
  transform: translateY(-12px) scale(1.2);
  color: var(--clr-accent-light);
  filter: drop-shadow(0 6px 14px rgba(181,36,106,.45));
}

/* --- SCRAMBLE TEXT LABEL --- */
.scramble-label {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* --- MORPHING SVG BLOB --- */
.morph-blob-wrap {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: 0.06;
}
.morph-blob-wrap--about {
  top: -80px; right: -60px;
  width: 380px; height: 380px;
}
.morph-blob-wrap--contact {
  top: 40px; right: -40px;
  width: 280px; height: 280px;
}
.morph-blob {
  width: 100%; height: 100%;
  fill: var(--clr-primary);
  animation: morphBlob 10s ease-in-out infinite alternate;
}
.morph-blob--accent { fill: var(--clr-accent); }
@keyframes morphBlob {
  0%   { d: path("M60,10 C90,-5 110,40 100,70 C90,100 50,110 20,95 C-10,80 -5,40 10,20 C25,0 30,25 60,10Z"); }
  33%  { d: path("M70,5 C105,0 115,50 100,80 C85,110 40,115 10,90 C-20,65 0,25 20,10 C40,-5 35,10 70,5Z"); }
  66%  { d: path("M50,15 C85,5 110,45 105,75 C100,105 60,115 25,95 C-10,75 -8,35 15,15 C38,-5 15,25 50,15Z"); }
  100% { d: path("M65,8 C95,-8 115,35 110,68 C105,101 58,112 22,94 C-14,76 -3,38 18,16 C39,-6 35,24 65,8Z"); }
}

/* --- PARALLAX DEPTH LAYERS --- */
[data-parallax] {
  will-change: transform;
  transition: transform 0.1s linear; /* Slight smoothing for JS-driven movement */
}

/* --- ENHANCED SECTION TRANSITIONS --- */
.section {
  position: relative;
  overflow: hidden;
  /* Ensure sections have some breathing room for transitions */
}

.reveal-zoom {
  opacity: 0;
  transform: scale(0.9) translateY(40px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
.reveal-zoom.revealed {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.reveal-skew {
  opacity: 0;
  transform: skewY(2deg) translateY(60px);
  transition: opacity 1.2s var(--ease-out), transform 1.2s var(--ease-out);
}
.reveal-skew.revealed {
  opacity: 1;
  transform: skewY(0) translateY(0);
}

/* --- STICKY BACKGROUND ACCENT --- */
.bg-sticky-accent {
  position: absolute;
  width: 100%;
  height: 100vh;
  top: 0;
  left: 0;
  z-index: -1;
  pointer-events: none;
}

/* --- SECTION HEADING GLOW ON HOVER --- */
.section-title {
  transition: text-shadow .4s ease;
  cursor: default;
}
.section-title:hover {
  text-shadow: 0 0 40px rgba(181,36,106,.18), 0 4px 24px rgba(0,0,0,.12);
}

/* --- RIPPLE BUTTON EFFECT --- */
.btn { overflow: hidden; isolation: isolate; }
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.32);
  transform: scale(0);
  animation: rippleOut .65s ease-out forwards;
  pointer-events: none;
  z-index: 1;
}
@keyframes rippleOut {
  to { transform: scale(4); opacity: 0; }
}

/* --- LOGO IMAGE: SMOOTH HOVER --- */
/* Handled in style.css via .nav-logo:hover .logo-img */

/* --- NEON GLOW NAV LINK --- */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px; left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--clr-accent), var(--clr-accent-light));
  box-shadow: 0 0 8px rgba(181,36,106,.6);
  transition: transform .3s var(--ease-out);
}
.nav-link:hover::after,
.nav-link.active::after { transform: translateX(-50%) scaleX(1); }

/* --- FLOATING PARTICLES (CSS-only decoration) --- */
@keyframes floatPar {
  0%,100% { transform: translateY(0) rotate(0deg); opacity:.5; }
  33% { transform: translateY(-18px) rotate(60deg); opacity:.8; }
  66% { transform: translateY(10px) rotate(-40deg); opacity:.4; }
}
.float-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: var(--clr-accent);
  opacity: .3;
  animation: floatPar var(--dur, 8s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}


/* --- PORTFOLIO ITEM: LEFT STRIPE INDICATOR --- */
.portfolio-item {
  position: relative;
  overflow: hidden;
}
.portfolio-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--clr-accent), var(--clr-accent-light));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .35s var(--ease-out);
  border-radius: 0 2px 2px 0;
}
.portfolio-item:hover::before,
.portfolio-item.active::before { transform: scaleY(1); }

/* --- PILLAR: 3D DEPTH SHADOW --- */
.pillar {
  transform-style: preserve-3d;
}
.pillar::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: transparent;
  box-shadow: 0 0 0 0 rgba(181,36,106,.0);
  transition: box-shadow .4s var(--ease-out);
}
.pillar:hover::before {
  box-shadow: 0 16px 48px rgba(181,36,106,.18), 0 0 0 2px rgba(181,36,106,.15);
}

/* --- CONTACT DETAIL: HOVER LIFT --- */
.contact-detail {
  padding: .85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all .3s var(--ease-out);
  cursor: default;
}
.contact-detail:hover {
  background: var(--clr-surface-2);
  border-color: var(--clr-border);
  transform: translateX(6px);
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
}

/* --- STAT ITEM: GRADIENT TEXT --- */
.stat-number {
  color: var(--clr-primary);
}

/* --- SECTION LABEL: SHINE --- */
.section-label {
  position: relative;
  overflow: hidden;
  display: inline-block;
}
.section-label::after {
  content: '';
  position: absolute;
  top: 0; left: -75%;
  width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(181,36,106,.35), transparent);
  transform: skewX(-20deg);
  transition: left .6s var(--ease-out);
}
.section-label:hover::after { left: 150%; }

/* --- FOOTER LINK HOVER --- */
.footer-links-col a {
  position: relative;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out);
}

.footer-links-col a::after {
  content: '';
  position: absolute;
  right: -18px;
  width: 12px;
  height: 2px;
  background: var(--clr-accent-light);
  border-radius: 2px;
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out);
  pointer-events: none;
}

.footer-links-col a:hover::after {
  opacity: 1;
  transform: translateX(0);
  animation: cursorBlink 1s step-end infinite;
}

/* --- BACK TO TOP: PULSE RING --- */
.back-top::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(181,36,106,.4);
  opacity: 0;
  transform: scale(0.8);
  transition: all .4s var(--ease-out);
}
.back-top:hover::before {
  opacity: 1;
  transform: scale(1);
  animation: backTopPulse 1.2s ease infinite;
}
@keyframes backTopPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(181,36,106,.4); }
  50% { box-shadow: 0 0 0 8px rgba(181,36,106,.0); }
}


/* --- ABOUT PILLAR ICON --- */
.pillar-icon {
  transition: transform .4s cubic-bezier(.34,1.56,.64,1);
}
.pillar:hover .pillar-icon {
  transform: scale(1.3) rotate(10deg);
}

/* --- FORM INPUT FOCUS GLOW --- */
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  box-shadow: 0 0 0 3px rgba(0,0,0,.08), 0 0 16px rgba(181,36,106,.12);
}

/* --- SECTION BORDERS (decorative lines) --- */
.section::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 80px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--clr-accent), transparent);
  opacity: .5;
}
.section { position: relative; }

/* --- HIGHLIGHT CARD FLOATING GLOW --- */
.service-card--highlight {
  box-shadow: 0 0 0 0 rgba(181,36,106,0);
  transition: all .5s var(--ease-out);
}
.service-card--highlight:hover {
  box-shadow:
    0 24px 60px rgba(0,0,0,.3),
    0 0 0 1px rgba(181,36,106,.3),
    0 0 60px rgba(181,36,106,.08);
}

/* --- PORTFOLIO MAIN IMG: REVEAL SHINE --- */
.portfolio-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.08) 0%, transparent 60%);
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
}

/* --- PAGE SCROLL PROGRESS BAR --- */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--clr-accent), var(--clr-accent-light), #4f8ef7);
  z-index: 9999;
  transition: width .1s linear;
  box-shadow: 0 0 10px rgba(181,36,106,.5);
}

/* --- TYPING CURSOR --- */
.typing-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--clr-accent-light);
  margin-left: 4px;
  vertical-align: text-bottom;
  animation: cursorBlink 1s step-end infinite;
  border-radius: 2px;
}
@keyframes cursorBlink {
  0%,100% { opacity: 1; }
  50% { opacity: 0; }
}




/* --- LAPTOP MOUSE TILT --- */
/* Applied via JS on mousemove inside .hero-visual */
.laptop.tilted {
  /* JS overwrites this via style attribute; this is the reset */
  transform: rotateX(4deg) rotateY(-8deg);
}

/* --- HERO RESPONSIVE (two-column \2192  single column) --- */
@media (max-width: 900px) {
  .hero-inner {
    flex-direction: column;
    gap: 3rem;
    padding-top: 7rem;
    text-align: center;
    align-items: center;
  }
  .hero-content {
    align-items: center;
    text-align: center;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero-visual {
    width: 100%;
    max-width: 440px;
  }
  .laptop-badge--bottom {
    left: -8px;
  }
  .laptop-badge--top {
    right: -8px;
  }
}

@media (max-width: 560px) {
  .hero-inner {
    padding-top: 6rem;
  }
  .hero-title {
    font-size: clamp(2rem, 7vw, 2.8rem);
  }

  .hero-visual {
    display: none; /* hide on very small screens */
  }
}

/* --- MOBILE: REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
