/* =========================================
   DICTO ADY PORTFOLIO — ANIMATIONS
   ========================================= */

/* ---- KEYFRAMES ---- */

@keyframes heroGlowPulse {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -55%) scale(1); }
  50%       { opacity: 1;   transform: translate(-50%, -58%) scale(1.08); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

@keyframes ripple {
  0%   { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(2.5); opacity: 0; }
}

@keyframes scrollLine {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 1; }
  50%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  51%  { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

/* ---- HERO STAGGER ANIMATIONS ---- */

.hero-label {
  animation: fadeUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-delay: 0.15s;
}

.hero-heading {
  animation: fadeUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-delay: 0.3s;
}

.hero-subheading {
  animation: fadeUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-delay: 0.45s;
}

.hero-actions {
  animation: fadeUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-delay: 0.6s;
}

.hero-status {
  animation: fadeIn 0.7s ease both;
  animation-delay: 0.8s;
}

.hero-scroll {
  animation: fadeIn 1s ease both;
  animation-delay: 1.2s;
}

/* ---- SCROLL REVEAL BASE ---- */
/*
  Elements with [data-reveal] start hidden.
  JS adds .is-revealed when they enter the viewport.
*/

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-reveal="left"] {
  transform: translateX(-24px);
}

[data-reveal="right"] {
  transform: translateX(24px);
}

[data-reveal="scale"] {
  transform: scale(0.94);
  transform-origin: center;
}

[data-reveal="fade"] {
  transform: none;
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* Stagger children via --stagger-delay custom prop set in HTML */
[data-stagger-children] > * {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-stagger-children].is-revealed > * {
  opacity: 1;
  transform: none;
}

/* Generate stagger delays for up to 12 children */
[data-stagger-children].is-revealed > *:nth-child(1)  { transition-delay: 0s; }
[data-stagger-children].is-revealed > *:nth-child(2)  { transition-delay: 0.08s; }
[data-stagger-children].is-revealed > *:nth-child(3)  { transition-delay: 0.16s; }
[data-stagger-children].is-revealed > *:nth-child(4)  { transition-delay: 0.24s; }
[data-stagger-children].is-revealed > *:nth-child(5)  { transition-delay: 0.32s; }
[data-stagger-children].is-revealed > *:nth-child(6)  { transition-delay: 0.40s; }
[data-stagger-children].is-revealed > *:nth-child(7)  { transition-delay: 0.48s; }
[data-stagger-children].is-revealed > *:nth-child(8)  { transition-delay: 0.56s; }
[data-stagger-children].is-revealed > *:nth-child(9)  { transition-delay: 0.64s; }
[data-stagger-children].is-revealed > *:nth-child(10) { transition-delay: 0.72s; }
[data-stagger-children].is-revealed > *:nth-child(11) { transition-delay: 0.80s; }
[data-stagger-children].is-revealed > *:nth-child(12) { transition-delay: 0.88s; }

/* ---- GRADIENT TEXT ---- */
.gradient-text {
  background: linear-gradient(135deg, var(--blue-bright), var(--blue-light), #c4d9ff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 5s ease infinite;
}

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

  html {
    scroll-behavior: auto;
  }

  [data-reveal],
  [data-stagger-children] > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .hero-label,
  .hero-heading,
  .hero-subheading,
  .hero-actions,
  .hero-status,
  .hero-scroll {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ============================================
   SAKURA PETAL — Navbar Hover Effect
   ============================================ */

/* Single petal element (spawned by JS) */
.sakura-petal {
  position: fixed;
  pointer-events: none;
  z-index: 9990;
  width: 7px;
  height: 9px;
  border-radius: 100% 0 100% 0;
  background: linear-gradient(
    135deg,
    #ffd6e0 0%,
    #ffb7c5 45%,
    #ff9eb5 100%
  );
  opacity: 0;
  will-change: transform, opacity;
  animation: sakuraDrift var(--petal-dur, 0.9s) var(--petal-ease, ease-out) forwards;
  animation-delay: var(--petal-delay, 0s);
}

@keyframes sakuraDrift {
  0% {
    opacity: 0;
    transform:
      translateY(0px)
      translateX(0px)
      rotate(var(--petal-rot, 0deg))
      scale(1);
  }
  12% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform:
      translateY(var(--petal-y, 36px))
      translateX(var(--petal-x, 0px))
      rotate(calc(var(--petal-rot, 0deg) + var(--petal-spin, 180deg)))
      scale(0.4);
  }
}

/* ============================================
   TYPEWRITER — Hero Name Cursor
   ============================================ */

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes cursorFadeOut {
  to { opacity: 0; }
}

/* Cursor span — sits AFTER .highlight, fully outside gradient clip */
.hero-cursor {
  display: inline-block;
  margin-left: 3px;
  color: #60a5fa;
  font-weight: 300;
  font-size: inherit;
  line-height: inherit;
  vertical-align: baseline;
  animation: cursorBlink 0.55s step-end infinite;
  user-select: none;
}

/* Typing done — blink 6×  then fade out */
.hero-cursor.typing-done {
  animation:
    cursorBlink   0.55s step-end 6,
    cursorFadeOut 0.5s  3.3s ease forwards;
}


