/*
 * Premium Hero Section - Museum Quality
 * Paul Aizpiri Catalogue Raisonné
 * Inspired by Mediterranean vibrancy and brushstroke dynamism
 */

/* ============================================
   HERO SECTION - FULL VIEWPORT
   ============================================ */

.hero-section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
}

/* ============================================
   PARALLAX BACKGROUND LAYERS
   ============================================ */

.hero-parallax-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

/* Animated Mediterranean Gradient Mesh */
.hero-gradient-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(37, 99, 235, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(249, 115, 22, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(139, 92, 246, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse at 10% 80%, rgba(20, 184, 166, 0.25) 0%, transparent 50%),
    linear-gradient(135deg,
      #2563EB 0%,
      #3B82F6 25%,
      #8B5CF6 50%,
      #F97316 75%,
      #FB923C 100%
    );
  background-size:
    150% 150%,
    120% 120%,
    180% 180%,
    140% 140%,
    200% 200%;
  background-position:
    20% 30%,
    80% 70%,
    50% 50%,
    10% 80%,
    0% 0%;
  animation: gradientMeshFlow 20s ease-in-out infinite alternate;
  opacity: 0.85;
  mix-blend-mode: normal;
}

@keyframes gradientMeshFlow {
  0% {
    background-position:
      20% 30%,
      80% 70%,
      50% 50%,
      10% 80%,
      0% 0%;
  }
  50% {
    background-position:
      30% 40%,
      70% 60%,
      60% 40%,
      20% 70%,
      50% 50%;
  }
  100% {
    background-position:
      25% 35%,
      75% 65%,
      55% 45%,
      15% 75%,
      100% 100%;
  }
}

/* Floating Brush Strokes - SVG-like patterns */
.hero-brush-strokes {
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent 0px,
      transparent 40px,
      rgba(196, 163, 90, 0.1) 40px,
      rgba(196, 163, 90, 0.1) 42px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent 0px,
      transparent 60px,
      rgba(249, 115, 22, 0.08) 60px,
      rgba(249, 115, 22, 0.08) 62px
    );
  animation: brushStrokeDrift 30s linear infinite;
}

@keyframes brushStrokeDrift {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    transform: translate(20px, 20px) rotate(5deg);
  }
}

/* Film Grain Texture Overlay */
.hero-grain-texture {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='2.5' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* Parallax scroll effect */
@media (prefers-reduced-motion: no-preference) {
  .hero-gradient-mesh {
    animation: gradientMeshFlow 20s ease-in-out infinite alternate,
               parallaxScroll 1s linear;
    animation-timeline: scroll();
    animation-range: 0vh 100vh;
  }

  @keyframes parallaxScroll {
    to {
      transform: translateY(30%) scale(1.1);
    }
  }
}

/* ============================================
   HERO CONTENT
   ============================================ */

.hero-content-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: var(--container-lg);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  text-align: center;
}

.hero-content {
  animation: heroFadeUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

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

/* ============================================
   HERO TITLE - CHARACTER REVEAL ANIMATION
   ============================================ */

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-lg);
  color: #ffffff;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.1),
    0 4px 12px rgba(37, 99, 235, 0.2),
    0 8px 24px rgba(139, 92, 246, 0.15);
  position: relative;
}

.hero-title-main {
  display: inline-block;
  position: relative;
}

/* Character-by-character reveal */
.hero-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px) rotateX(-90deg);
  animation: charReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(0.6s + var(--char-index) * 0.05s);
  transform-origin: 50% 100%;
}

@keyframes charReveal {
  0% {
    opacity: 0;
    transform: translateY(30px) rotateX(-90deg);
  }
  50% {
    transform: translateY(-5px) rotateX(5deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
  }
}

/* Dates - Elegant fade in */
.hero-dates {
  display: block;
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 300;
  letter-spacing: 0.05em;
  margin-top: var(--space-md);
  color: rgba(255, 255, 255, 0.85);
  opacity: 0;
  animation: fadeInScale 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.2s both;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============================================
   HERO TAGLINE - LETTER SPACING ANIMATION
   ============================================ */

.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 3.5rem);
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(196, 163, 90, 1);
  margin-bottom: var(--space-xl);
  position: relative;
  display: inline-block;
}

.hero-tagline::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(196, 163, 90, 1) 20%,
    rgba(196, 163, 90, 1) 80%,
    transparent 100%
  );
  animation: underlineExpand 1s cubic-bezier(0.16, 1, 0.3, 1) 1.5s both;
}

@keyframes underlineExpand {
  to {
    width: 120%;
  }
}

.hero-tagline-word {
  display: inline-block;
  opacity: 0;
  letter-spacing: 0.5em;
  animation: wordRevealSpacing 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(1.4s + var(--word-index) * 0.15s);
}

@keyframes wordRevealSpacing {
  from {
    opacity: 0;
    letter-spacing: 0.5em;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    letter-spacing: 0.15em;
    transform: translateX(0);
  }
}

/* ============================================
   HERO INTRO
   ============================================ */

.hero-intro {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-weight: 300;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  max-width: 700px;
  margin: 0 auto;
  opacity: 0;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.8s both;
}

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

/* ============================================
   SCROLL INDICATOR
   ============================================ */

.scroll-indicator-wrapper {
  position: absolute;
  bottom: var(--space-2xl);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  opacity: 0;
  animation: fadeInBounce 1s cubic-bezier(0.16, 1, 0.3, 1) 2.5s both;
}

@keyframes fadeInBounce {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  60% {
    transform: translateX(-50%) translateY(5px);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.scroll-indicator:hover {
  color: rgba(196, 163, 90, 1);
  transform: translateY(-5px);
}

.scroll-indicator:hover .scroll-mouse {
  border-color: rgba(196, 163, 90, 1);
}

.scroll-indicator:hover .scroll-wheel {
  background: rgba(196, 163, 90, 1);
}

/* Mouse Icon */
.scroll-mouse {
  width: 28px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  position: relative;
  transition: border-color 0.3s ease;
}

.scroll-wheel {
  width: 4px;
  height: 8px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollWheel 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes scrollWheel {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  50% {
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
  }
}

/* Arrow Icon */
.scroll-arrow {
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  50% {
    transform: translateY(8px);
    opacity: 1;
  }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .hero-section {
    min-height: 100svh; /* Use small viewport height on mobile */
  }

  .hero-title {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }

  .hero-dates {
    font-size: clamp(1.2rem, 5vw, 1.8rem);
  }

  .hero-tagline {
    font-size: clamp(1.2rem, 5vw, 2rem);
    letter-spacing: 0.1em;
  }

  .hero-tagline-word {
    letter-spacing: 0.3em;
  }

  @keyframes wordRevealSpacing {
    from {
      opacity: 0;
      letter-spacing: 0.3em;
      transform: translateX(-15px);
    }
    to {
      opacity: 1;
      letter-spacing: 0.1em;
      transform: translateX(0);
    }
  }

  .hero-intro {
    font-size: clamp(0.95rem, 4vw, 1.1rem);
  }

  .scroll-indicator-wrapper {
    bottom: var(--space-xl);
  }

  /* Reduce animation complexity on mobile */
  .hero-gradient-mesh {
    animation: gradientMeshFlow 30s ease-in-out infinite alternate;
  }
}

@media (max-width: 480px) {
  .hero-content-wrapper {
    padding: 0 var(--space-lg);
  }

  .hero-char {
    animation-delay: calc(0.4s + var(--char-index) * 0.03s);
  }

  .scroll-mouse {
    width: 24px;
    height: 36px;
  }

  .scroll-wheel {
    width: 3px;
    height: 6px;
  }
}

/* ============================================
   DARK MODE ADJUSTMENTS
   ============================================ */

[data-theme="dark"] .hero-gradient-mesh {
  opacity: 0.6;
}

[data-theme="dark"] .hero-title {
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 4px 12px rgba(37, 99, 235, 0.3),
    0 8px 24px rgba(139, 92, 246, 0.25);
}

[data-theme="dark"] .hero-tagline {
  color: rgba(212, 179, 102, 1);
}

[data-theme="dark"] .hero-grain-texture {
  opacity: 0.08;
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .hero-gradient-mesh,
  .hero-brush-strokes,
  .hero-char,
  .hero-dates,
  .hero-tagline-word,
  .hero-intro,
  .scroll-indicator-wrapper,
  .scroll-wheel,
  .scroll-arrow {
    animation: none !important;
  }

  .hero-char,
  .hero-dates,
  .hero-tagline-word,
  .hero-intro,
  .scroll-indicator-wrapper {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-tagline::after {
    width: 120%;
  }

  .hero-content {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */

@media (prefers-contrast: high) {
  .hero-gradient-mesh {
    opacity: 0.4;
  }

  .hero-title,
  .hero-dates,
  .hero-intro {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  }

  .hero-tagline {
    color: #FFD700;
  }

  .scroll-mouse {
    border-width: 3px;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .hero-parallax-bg,
  .scroll-indicator-wrapper {
    display: none;
  }

  .hero-section {
    min-height: auto;
    padding: 2rem 0;
    background: white;
  }

  .hero-title,
  .hero-dates,
  .hero-tagline,
  .hero-intro {
    color: black;
    text-shadow: none;
  }
}
