/* ==========================================================================
   Animation & Reveal Styles
   ========================================================================== */

/* Reveal Classes */
.reveal {
  opacity: 0;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

.reveal-fade-up { transform: translateY(30px); }
.reveal-fade-in { transform: none; }
.reveal-slide-left { transform: translateX(-40px); }
.reveal-slide-right { transform: translateX(40px); }
.reveal-scale { transform: scale(0.95); }

.reveal-blur {
  filter: blur(6px);
  transition: filter 0.7s ease, opacity 0.7s ease;
}
.reveal-blur.visible { filter: blur(0); }

/* Stagger children */
.stagger-children > .reveal:nth-child(1) { transition-delay: 0ms; }
.stagger-children > .reveal:nth-child(2) { transition-delay: 80ms; }
.stagger-children > .reveal:nth-child(3) { transition-delay: 160ms; }
.stagger-children > .reveal:nth-child(4) { transition-delay: 240ms; }
.stagger-children > .reveal:nth-child(5) { transition-delay: 320ms; }
.stagger-children > .reveal:nth-child(6) { transition-delay: 400ms; }
.stagger-children > .reveal:nth-child(7) { transition-delay: 480ms; }
.stagger-children > .reveal:nth-child(8) { transition-delay: 560ms; }
.stagger-children > .reveal:nth-child(9) { transition-delay: 640ms; }
.stagger-children > .reveal:nth-child(10) { transition-delay: 720ms; }
.stagger-children > .reveal:nth-child(11) { transition-delay: 800ms; }
.stagger-children > .reveal:nth-child(12) { transition-delay: 880ms; }

/* ==========================================================================
   Dark Techno — Scanline Overlay
   ========================================================================== */
.techno-scanlines {
  position: fixed;
  inset: 0;
  z-index: 9997;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

/* ==========================================================================
   Dark Techno — Red Grid Accent
   ========================================================================== */
.techno-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(220, 38, 38, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(220, 38, 38, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 70%);
}

/* ==========================================================================
   Parallax Sections
   ========================================================================== */
.parallax-section {
  position: relative;
  overflow: hidden;
}

.parallax-bg {
  position: absolute;
  inset: -40px 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
}

.parallax-content {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Text Reveal (word-by-word)
   ========================================================================== */
.text-reveal-word {
  overflow: hidden;
  display: inline-block;
  vertical-align: top;
}

.text-reveal-word .word-inner {
  display: inline-block;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.6s ease;
}

.text-reveal-word.revealed .word-inner {
  transform: translateY(0);
  opacity: 1;
}

/* Stagger delay for each word */
.text-reveal-word:nth-child(1) .word-inner { transition-delay: 0ms; }
.text-reveal-word:nth-child(2) .word-inner { transition-delay: 60ms; }
.text-reveal-word:nth-child(3) .word-inner { transition-delay: 120ms; }
.text-reveal-word:nth-child(4) .word-inner { transition-delay: 180ms; }
.text-reveal-word:nth-child(5) .word-inner { transition-delay: 240ms; }
.text-reveal-word:nth-child(6) .word-inner { transition-delay: 300ms; }
.text-reveal-word:nth-child(7) .word-inner { transition-delay: 360ms; }
.text-reveal-word:nth-child(8) .word-inner { transition-delay: 420ms; }
.text-reveal-word:nth-child(9) .word-inner { transition-delay: 480ms; }
.text-reveal-word:nth-child(10) .word-inner { transition-delay: 540ms; }
.text-reveal-word:nth-child(11) .word-inner { transition-delay: 600ms; }
.text-reveal-word:nth-child(12) .word-inner { transition-delay: 660ms; }
.text-reveal-word:nth-child(13) .word-inner { transition-delay: 720ms; }
.text-reveal-word:nth-child(14) .word-inner { transition-delay: 780ms; }
.text-reveal-word:nth-child(15) .word-inner { transition-delay: 840ms; }
.text-reveal-word:nth-child(16) .word-inner { transition-delay: 900ms; }

/* ==========================================================================
   Image Scale on Scroll
   ========================================================================== */
.image-reveal {
  overflow: hidden;
  border-radius: var(--radius-md);
}

.image-reveal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.15);
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.image-reveal.revealed img {
  transform: scale(1);
}

/* ==========================================================================
   Sticky Sections
   ========================================================================== */
.sticky-section {
  position: relative;
}

.sticky-pin {
  position: sticky;
  top: var(--nav-height);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sticky-pin-content {
  width: 100%;
  padding: var(--space-8) 0;
}

/* ==========================================================================
   Techno Glow Elements
   ========================================================================== */
.techno-glow {
  position: relative;
}

.techno-glow::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid rgba(220, 38, 38, 0.15);
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.08),
              inset 0 0 20px rgba(220, 38, 38, 0.04);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.techno-glow:hover::after {
  opacity: 1;
}

/* Techno pulse animation for hero background */
@keyframes technoPulse {
  0%, 100% { opacity: 0.08; }
  50% { opacity: 0.15; }
}

.techno-pulse {
  animation: technoPulse 4s ease-in-out infinite;
}

/* ==========================================================================
   Horizontal rule with red accent
   ========================================================================== */
hr.techno-divider {
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(220, 38, 38, 0.3),
    transparent
  );
  margin: var(--space-16) 0;
}

/* ==========================================================================
   Hover Effects
   ========================================================================== */
.glow-hover {
  position: relative;
  overflow: hidden;
}

.glow-hover::before {
  content: '';
  position: absolute;
  top: var(--mouse-y, 50%);
  left: var(--mouse-x, 50%);
  width: 300px;
  height: 300px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(220, 38, 38, 0.06), transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
  border-radius: inherit;
}

.glow-hover:hover::before {
  opacity: 1;
}

/* ==========================================================================
   Loading / Skeleton
   ========================================================================== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--color-bg-card) 25%, var(--color-bg-elevated) 50%, var(--color-bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Page entrance
   ========================================================================== */
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-enter {
  animation: pageEnter 0.5s ease;
}
