/* ============================================================
   animations.css — Keyframes, cursor, transition states
   ============================================================ */

/* --- Custom Cursor --- */
.cursor {
  position: fixed; top: 0; left: 0;
  z-index: 99999; pointer-events: none;
  mix-blend-mode: difference;
}
.cursor-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #fff;
  position: absolute;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, opacity 0.3s;
}
.cursor-ring {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.5);
  position: absolute;
  transform: translate(-50%, -50%);
  transition: width 0.4s var(--ease-out-expo),
              height 0.4s var(--ease-out-expo),
              border-color 0.3s;
}

/* Cursor states */
.cursor.is-hover .cursor-ring {
  width: 64px; height: 64px;
  border-color: var(--accent-blue);
}
.cursor.is-hover .cursor-dot {
  width: 4px; height: 4px; opacity: 0.5;
}
.cursor.is-click .cursor-ring {
  width: 32px; height: 32px;
}

/* Cursor label (shown on data-cursor elements) */
.cursor-label {
  position: fixed; z-index: 99998;
  pointer-events: none;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--accent-blue);
  color: #fff; font-size: 11px; font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase;
  opacity: 0; transform: translate(-50%, -50%) scale(0.8);
  transition: opacity 0.3s, transform 0.3s var(--ease-spring);
  white-space: nowrap;
}
.cursor-label.is-visible {
  opacity: 1; transform: translate(-50%, -50%) scale(1);
}

/* --- Split Text Chars --- */
.split-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px) rotateX(-40deg);
  transform-origin: center bottom;
}
.split-word { display: inline-block; overflow: hidden; }

/* --- Fade & Slide Utility --- */
.anim-fade {
  opacity: 0; transform: translateY(24px);
}
.anim-fade.is-visible {
  opacity: 1; transform: translateY(0);
  transition: opacity 0.8s var(--ease-out-expo),
              transform 0.8s var(--ease-out-expo);
}

/* --- Scale In --- */
.anim-scale {
  opacity: 0; transform: scale(0.92);
}
.anim-scale.is-visible {
  opacity: 1; transform: scale(1);
  transition: opacity 0.7s var(--ease-out-expo),
              transform 0.7s var(--ease-out-expo);
}

/* --- Stagger children --- */
.stagger-children > * {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out-expo),
              transform 0.6s var(--ease-out-expo);
}
.stagger-children.is-visible > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: none; }
.stagger-children.is-visible > *:nth-child(2) { transition-delay: 0.10s; opacity: 1; transform: none; }
.stagger-children.is-visible > *:nth-child(3) { transition-delay: 0.15s; opacity: 1; transform: none; }
.stagger-children.is-visible > *:nth-child(4) { transition-delay: 0.20s; opacity: 1; transform: none; }
.stagger-children.is-visible > *:nth-child(5) { transition-delay: 0.25s; opacity: 1; transform: none; }
.stagger-children.is-visible > *:nth-child(6) { transition-delay: 0.30s; opacity: 1; transform: none; }

/* --- View Transition overlay --- */
.view-overlay {
  position: fixed; inset: 0; z-index: 5000;
  background: var(--bg);
  pointer-events: none;
  opacity: 0;
}

/* --- Orb float --- */
.orb--blue   { animation: orbDrift1 22s ease-in-out infinite; }
.orb--purple { animation: orbDrift2 26s ease-in-out infinite; }
.orb--green  { animation: orbDrift3 20s ease-in-out infinite; }

@keyframes orbDrift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(60px, -40px) scale(1.08); }
  66%      { transform: translate(-30px, 50px) scale(0.94); }
}
@keyframes orbDrift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(-50px, 30px) scale(1.1); }
  66%      { transform: translate(40px, -60px) scale(0.92); }
}
@keyframes orbDrift3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(30px, 40px) scale(1.06); }
  66%      { transform: translate(-40px, -20px) scale(0.96); }
}

/* --- Card enter animation (used by GSAP) --- */
.card-enter {
  opacity: 0;
  transform: translateY(40px) scale(0.95);
}

/* --- Work item hover line --- */
.work-item::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; border-radius: 3px;
  background: linear-gradient(to bottom, var(--accent-blue), var(--accent-purple));
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.5s var(--ease-out-expo);
}
.work-item:hover::before { transform: scaleY(1); }

/* --- Contact card hover glow --- */
.contact-card::after {
  content: '';
  position: absolute; inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg,
    rgba(41,151,255,0.15),
    rgba(191,90,242,0.1),
    transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  z-index: -1;
}
.contact-card:hover::after { opacity: 1; }

/* --- Stat icon bounce (used in hub stat card) --- */
.stat-icon {
  display: block;
  font-size: 28px;
  line-height: 1;
  margin-bottom: 4px;
  user-select: none;
}
.stat-icon--bounce {
  animation: statIconBounce 2.4s ease-in-out infinite;
  transform-origin: bottom center;
}
@keyframes statIconBounce {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  30%       { transform: translateY(-6px) rotate(4deg); }
  60%       { transform: translateY(-2px) rotate(-2deg); }
}

/* --- Section decorative icons --- */
.hub__greeting-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel__title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
  font-style: normal;
}

/* emoji icons (used in greetings & card h3s) */
.hub__greeting-wrap .section-icon,
h3 .section-icon {
  font-size: 1em;
  line-height: 1;
}

/* SVG icons (used in section headings) */
.panel__title-wrap .section-icon {
  width: 36px;
  height: 36px;
  padding: 6px;
  border-radius: 10px;
  background: rgba(59,158,255,0.1);
  border: 1px solid rgba(59,158,255,0.2);
  color: var(--accent-blue);
}
.panel__title-wrap .section-icon svg {
  width: 100%;
  height: 100%;
}

/* Wave animation — greeting 👋 */
.section-icon--wave {
  animation: iconWave 2s ease-in-out infinite;
  transform-origin: 70% 70%;
}
@keyframes iconWave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10%            { transform: rotate(18deg); }
  20%            { transform: rotate(-8deg); }
  30%            { transform: rotate(18deg); }
  40%            { transform: rotate(-4deg); }
  50%            { transform: rotate(10deg); }
}

/* Zap pulse — Works section ⚡ */
.section-icon--zap {
  animation: iconZap 2s ease-in-out infinite;
}
@keyframes iconZap {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.88); }
}

/* Float — About section */
.section-icon--float {
  animation: iconFloat 3s ease-in-out infinite;
}
@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-5px); }
}

/* Spin — Contact section 🌍 */
.section-icon--spin {
  animation: iconSpin 8s linear infinite;
}
@keyframes iconSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* --- Mobile: hide custom cursor --- */
@media (hover: none), (pointer: coarse) {
  .cursor, .cursor-label { display: none !important; }
}