/* ===================================================================
   MAXIM KUSTOV — RESUME & PORTFOLIO
   MD3 Motion & Physics • Rich Animations & Interactive Micro-Interactions
   60/120 FPS GPU-Accelerated Architecture
   =================================================================== */

/* -------------------------------------------------------------------
   0. SPLASH SCREEN PRELOADER (Smooth Cinematic Intro)
   ------------------------------------------------------------------- */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #141216;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
              filter 0.8s ease,
              visibility 0.8s ease;
  will-change: opacity, transform, filter;
}

.splash-screen.fade-out {
  opacity: 0;
  transform: scale(1.03) translateY(-8px);
  filter: blur(8px);
  pointer-events: none;
  visibility: hidden;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.splash-brand-title {
  font-family: var(--md-sys-font-brand);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #FFFFFF;
  text-transform: uppercase;
}

.splash-brand-subtitle {
  font-family: var(--md-sys-font-plain);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
}

.splash-loader-bar {
  width: 140px;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.splash-loader-progress {
  height: 100%;
  width: 0%;
  background: var(--md-sys-color-primary);
  border-radius: 999px;
  transition: width 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

/* -------------------------------------------------------------------
   1. SCROLL-TRIGGERED REVEAL ANIMATIONS (Smooth Transition, 0 Jitter)
   ------------------------------------------------------------------- */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* -------------------------------------------------------------------
   2. HERO INTERACTION & AMBIENT MOTION
   ------------------------------------------------------------------- */
.hero-photo-tilt {
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.25s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.hero-chip-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-emphasized),
              background-color var(--md-sys-motion-duration-short) ease,
              box-shadow var(--md-sys-motion-duration-short) ease;
}

.hero-chip-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(217, 35, 47, 0.15);
}

/* -------------------------------------------------------------------
   3. STATS NUMBER COUNT ANIMATION
   ------------------------------------------------------------------- */
.stat-box__val {
  display: inline-block;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

.stat-box:hover .stat-box__val {
  color: var(--md-sys-color-primary);
}

/* -------------------------------------------------------------------
   4. CITATIONS CAROUSEL & TAPE ANIMATIONS
   ------------------------------------------------------------------- */
.citation-slide-fade {
  animation: citationFade 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes citationFade {
  0% {
    opacity: 0.25;
    transform: scale(0.98);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.citation-nav-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-emphasized);
}

.citation-nav-btn:hover {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border-color: var(--md-sys-color-primary);
  transform: scale(1.1);
}

.citation-nav-btn:active {
  transform: scale(0.95);
}

/* -------------------------------------------------------------------
   5. GAME: «СМОТРЯЩИЙ» ENHANCED RING DELTAS & AURA
   ------------------------------------------------------------------- */
@keyframes cardIdleNudge {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-1.5deg); }
  50% { transform: rotate(1.5deg); }
  75% { transform: rotate(-0.8deg); }
  100% { transform: rotate(0deg); }
}

.card-idle-nudge {
  animation: cardIdleNudge 3.2s ease-in-out infinite alternate;
}

.card-spring-snap {
  transition: transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* Dynamic Gauge Floating Delta Badges */
.gauge-delta-badge {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  font-family: var(--md-sys-font-plain);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  white-space: nowrap;
}

.gauge-delta-badge.active,
.gauge-delta-badge.pos,
.gauge-delta-badge.neg {
  background: #2E2A36;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.18);
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

/* Ring Glow on Active Tilt */
.gauge-circle.active-glow {
  filter: drop-shadow(0 0 8px currentColor);
}

/* Pause Button Animation */
@keyframes pauseBreathing {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
  }
}

.game-pause-btn {
  animation: pauseBreathing 2.2s infinite ease-in-out;
  transition: transform 0.25s var(--md-sys-motion-easing-emphasized),
              background 0.2s ease,
              color 0.2s ease;
  cursor: pointer;
}

.game-pause-btn:hover {
  transform: scale(1.15) rotate(90deg);
  background: #FFFFFF;
  color: #121212;
}

.game-pause-btn:active {
  transform: scale(0.92);
}

/* -------------------------------------------------------------------
   6. CROSSPOSTING 5G PIPELINE ANIMATION & LINK INJECTION
   ------------------------------------------------------------------- */
@keyframes linkSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.channel-card__footer.injected {
  display: block !important;
  animation: linkSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes packetStream {
  0% {
    left: 0%;
    opacity: 0;
    transform: translateY(-50%) scale(0.6);
  }
  20% {
    opacity: 1;
    transform: translateY(-50%) scale(1.2);
  }
  80% {
    opacity: 1;
    transform: translateY(-50%) scale(1.2);
  }
  100% {
    left: 100%;
    opacity: 0;
    transform: translateY(-50%) scale(0.6);
  }
}

.bridge-pulse.traveling {
  animation: packetStream 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  box-shadow: 0 0 12px var(--md-sys-color-primary), 0 0 20px #7B2CBF;
}

/* -------------------------------------------------------------------
   7. AI EDITORIAL LAB: WAVEFORM & TYPEWRITER ANIMATIONS
   ------------------------------------------------------------------- */
.audio-wave-bar {
  width: 3.5px;
  background: var(--md-sys-color-primary);
  border-radius: 2px;
  animation: waveBarJump 0.8s ease-in-out infinite alternate;
}

.audio-wave-bar:nth-child(1) { height: 8px; animation-delay: 0.1s; }
.audio-wave-bar:nth-child(2) { height: 18px; animation-delay: 0.3s; }
.audio-wave-bar:nth-child(3) { height: 26px; animation-delay: 0.5s; }
.audio-wave-bar:nth-child(4) { height: 14px; animation-delay: 0.2s; }
.audio-wave-bar:nth-child(5) { height: 22px; animation-delay: 0.4s; }
.audio-wave-bar:nth-child(6) { height: 10px; animation-delay: 0.6s; }
.audio-wave-bar:nth-child(7) { height: 24px; animation-delay: 0.15s; }
.audio-wave-bar:nth-child(8) { height: 16px; animation-delay: 0.35s; }

.audio-wave-container.paused .audio-wave-bar {
  animation-play-state: paused;
  height: 6px !important;
}

@keyframes waveBarJump {
  0% { transform: scaleY(0.4); opacity: 0.6; }
  100% { transform: scaleY(1.3); opacity: 1; }
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.ai-type-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--md-sys-color-primary);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursorBlink 0.9s infinite;
}

/* -------------------------------------------------------------------
   8. YOUTUBE VIDEO PLAY BUTTON OVERLAY
   ------------------------------------------------------------------- */
.unp-video-box {
  position: relative;
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.28s ease;
}

.unp-video-box:hover {
  transform: translateY(-4px);
  box-shadow: var(--md-sys-elevation-3);
}

.unp-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  backdrop-filter: blur(2px);
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.unp-video-box:hover .unp-play-overlay {
  opacity: 1;
}

.unp-play-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #FF0000;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(255, 0, 0, 0.5);
  transform: scale(0.85);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.unp-video-box:hover .unp-play-btn {
  transform: scale(1.05);
}

.unp-play-btn svg {
  width: 22px;
  height: 22px;
  fill: #FFFFFF;
  margin-left: 3px;
}

/* -------------------------------------------------------------------
   9. THEATER & LIGHTBOX MODAL
   ------------------------------------------------------------------- */
.lightbox-modal {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--md-sys-motion-easing-emphasized);
}

.lightbox-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-modal__content {
  transform: scale(0.94);
  transition: transform 0.3s cubic-bezier(0.05, 0.7, 0.1, 1);
}

.lightbox-modal.active .lightbox-modal__content {
  transform: scale(1);
}

/* -------------------------------------------------------------------
   10. REDUCED MOTION PREFERENCE
   ------------------------------------------------------------------- */
@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;
  }
}
