/* Font smoothing */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #1A1A1A;
}

::-webkit-scrollbar-thumb {
  background: #D4AF37;
  border-radius: 4px;
}

/* Header scroll effect transitions */
.header-scrolled {
  background-color: rgba(26, 26, 26, 0.9);
  backdrop-filter: blur(4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Gallery Image Overlay */
.gallery-img {
  cursor: pointer;
  transition: transform 0.3s ease-out;
}

.gallery-img:hover {
  transform: scale(1.02);
}

/* Modal animations */
.modal-enter {
  animation: modalEnter 0.3s ease-out;
}

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

/* Section backgrounds alternating */
section:nth-child(odd) {
  background-color: #111111;
}

section:nth-child(even) {
  background-color: #1A1A1A;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #D4AF37;
  outline-offset: 2px;
}

/* ===== NEW ANIMATIONS ===== */

/* Hero section fade-in animations - triggered on scroll */
.hero-title {
  opacity: 0;
  letter-spacing: -0.02em;
}

.hero-title.animate-scroll {
  animation: fadeInUp 0.8s ease-out forwards;
}

.hero-subtitle {
  opacity: 0;
}

.hero-subtitle.animate-scroll {
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

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

/* Staggered filmography rows - triggered on scroll */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.filmography-row {
  opacity: 0;
}

.filmography-row.animate-scroll {
  animation: slideInLeft 0.6s ease-out forwards;
}

.filmography-row.animate-scroll:nth-child(1) { animation-delay: 0.1s; }
.filmography-row.animate-scroll:nth-child(2) { animation-delay: 0.2s; }
.filmography-row.animate-scroll:nth-child(3) { animation-delay: 0.3s; }
.filmography-row.animate-scroll:nth-child(4) { animation-delay: 0.4s; }
.filmography-row.animate-scroll:nth-child(5) { animation-delay: 0.5s; }
.filmography-row.animate-scroll:nth-child(6) { animation-delay: 0.6s; }
.filmography-row.animate-scroll:nth-child(7) { animation-delay: 0.7s; }
.filmography-row.animate-scroll:nth-child(8) { animation-delay: 0.8s; }
.filmography-row.animate-scroll:nth-child(9) { animation-delay: 0.9s; }

/* Gallery images fade-in on scroll - triggered on scroll */
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.gallery-img {
  opacity: 0;
}

.gallery-img.animate-scroll {
  animation: zoomIn 0.6s ease-out forwards;
}

/* Enhanced gallery hover effect */
.gallery-img {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
              filter 0.3s ease-out,
              box-shadow 0.3s ease-out;
}

.gallery-img:hover {
  transform: scale(1.05) translateZ(0);
  filter: brightness(1.1);
}

/* Smooth gradient overlays on hover */
.video-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0) 0%, rgba(212, 175, 55, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease-out;
  pointer-events: none;
}

.video-card:hover::after {
  opacity: 1;
}

/* Section reveal animation - triggered on scroll */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-title {
  opacity: 0;
}

.section-title.animate-scroll {
  animation: fadeInDown 0.6s ease-out forwards;
}

/* Smooth button animations */
.cta-button {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease-out;
}

.cta-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
}

.cta-button:hover::before {
  width: 300px;
  height: 300px;
  transition: width 0.5s, height 0.5s;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px rgba(212, 175, 55, 0.3);
}

/* Social icons animation */
.social-icon {
  display: inline-flex;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center;
}

.social-icon:hover {
  transform: scale(1.2) rotate(5deg);
}

/* About section profile image animation - triggered on scroll */
.profile-image {
  opacity: 0;
}

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

.profile-image.animate-scroll {
  animation: fadeInLeft 0.8s ease-out forwards;
}

.about-text {
  opacity: 0;
}

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

.about-text.animate-scroll {
  animation: fadeInRight 0.8s ease-out 0.2s both;
}

/* Pulse animation for gold accents */
@keyframes pulse-gold {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.pulse-accent {
  animation: pulse-gold 3s ease-in-out infinite;
}

/* Filmography year highlight */
.filmography-year {
  transition: all 0.3s ease-out;
  position: relative;
}

.filmography-row:hover .filmography-year {
  transform: scale(1.1);
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* Contact email button hover with glow */
.email-button {
  position: relative;
  transition: all 0.3s ease-out;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.email-button:hover {
  box-shadow: 0 0 40px rgba(212, 175, 55, 0.5),
              inset 0 0 20px rgba(255, 255, 255, 0.1);
  transform: translateY(-3px);
}

/* Light pulse around hero button - triggered on scroll */
@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
  }
  50% {
    box-shadow: 0 0 35px rgba(212, 175, 55, 0.6);
  }
}

.email-button-initial {
  animation: glow-pulse 2s ease-in-out 1.5s;
}

.email-button-initial.animate-scroll {
  animation: glow-pulse 2s ease-in-out 0.5s;
}

/* Smooth link and transition effects */
a {
  transition: all 0.3s ease-out;
}

/* Improved header link hover effects */
nav a {
  position: relative;
  display: inline-block;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #D4AF37;
  transition: width 0.3s ease-out;
}

nav a:hover::after {
  width: 100%;
}

/* Profile image border glow on hover */
.profile-image {
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.profile-image:hover {
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.4),
              0 0 60px rgba(212, 175, 55, 0.2),
              inset 0 0 15px rgba(212, 175, 55, 0.1);
}

/* Smooth text transitions */
.text-brand-gold {
  transition: all 0.3s ease-out;
}

/* Improved form focus states */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2),
              inset 0 0 0 2px #D4AF37;
  transition: box-shadow 0.3s ease-out;
}

/* Smooth page transitions */
html {
  scroll-behavior: smooth;
}

/* Enhanced transition for all elements */
* {
  transition: color 0.3s ease-out, background-color 0.3s ease-out;
}

/* Disable transition for animations */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
