/* ========================================
   ANIMATIONS — KEYFRAMES, SCROLL TRIGGERS, TRANSITIONS
   ======================================== */

/* -------- KEYFRAMES -------- */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-down {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes scroll-bounce {
  0%, 100% {
    transform: translateY(0) translateX(-50%);
    opacity: 0.8;
  }
  50% {
    transform: translateY(8px) translateX(-50%);
    opacity: 0.4;
  }
}

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

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 16px rgba(201, 168, 76, 0.1); }
  50%       { box-shadow: 0 0 32px rgba(201, 168, 76, 0.3); }
}

@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* -------- DOT GRID BACKGROUND -------- */
.dot-grid-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    circle,
    rgba(201, 168, 76, 0.12) 1px,
    transparent 1px
  );
  background-size: 32px 32px;
  animation: fade-in 2s ease both;
  pointer-events: none;
}

.dot-grid-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 80% at 50% 50%,
    transparent 40%,
    var(--color-bg) 100%
  );
}

/* -------- SCROLL REVEAL -------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered grid items */
.reveal-grid > * {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-grid.visible > *:nth-child(1)  { transition-delay: 0ms;   opacity: 1; transform: translateY(0); }
.reveal-grid.visible > *:nth-child(2)  { transition-delay: 80ms;  opacity: 1; transform: translateY(0); }
.reveal-grid.visible > *:nth-child(3)  { transition-delay: 160ms; opacity: 1; transform: translateY(0); }
.reveal-grid.visible > *:nth-child(4)  { transition-delay: 240ms; opacity: 1; transform: translateY(0); }
.reveal-grid.visible > *:nth-child(5)  { transition-delay: 320ms; opacity: 1; transform: translateY(0); }
.reveal-grid.visible > *:nth-child(6)  { transition-delay: 400ms; opacity: 1; transform: translateY(0); }
.reveal-grid.visible > *:nth-child(7)  { transition-delay: 480ms; opacity: 1; transform: translateY(0); }
.reveal-grid.visible > *:nth-child(8)  { transition-delay: 560ms; opacity: 1; transform: translateY(0); }
.reveal-grid.visible > *:nth-child(9)  { transition-delay: 640ms; opacity: 1; transform: translateY(0); }

/* -------- HERO ENTRY ANIMATIONS -------- */
.hero-animate-1 {
  animation: fade-in-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}
.hero-animate-2 {
  animation: fade-in-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}
.hero-animate-3 {
  animation: fade-in-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}
.hero-animate-4 {
  animation: fade-in-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both;
}
.hero-animate-5 {
  animation: fade-in-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.7s both;
}
.hero-photo-animate {
  animation: scale-in 1s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

/* -------- TYPEWRITER -------- */
.typewriter-cursor {
  display: inline-block;
  color: var(--color-gold);
  margin-left: 2px;
  animation: blink-cursor 1s step-end infinite;
  font-weight: 300;
}

/* -------- SCROLL INDICATOR -------- */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  animation: fade-in 1s ease 1.5s both;
}

.scroll-indicator-arrow {
  animation: scroll-bounce 2s ease-in-out infinite;
  color: var(--color-text-faint);
}

.scroll-indicator-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* -------- PROFILE PHOTO -------- */
.hero-photo-wrapper {
  position: relative;
  will-change: transform;
}

.hero-photo-wrapper img,
.hero-photo-wrapper .placeholder-img {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-gold);
  display: block;
  margin-left: auto;
}

.hero-photo-wrapper .placeholder-img {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-2);
  color: var(--color-text-faint);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.hero-photo-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(ellipse at center, var(--color-gold-muted) 0%, transparent 70%);
  pointer-events: none;
  border-radius: var(--radius-xl);
  animation: glow-pulse 4s ease-in-out infinite;
}

/* -------- PAGE TRANSITIONS -------- */
.page-transition {
  animation: fade-in 0.4s ease both;
}

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

  .reveal,
  .reveal-grid > * {
    opacity: 1;
    transform: none;
  }
}
