/* ==========================================================================
   Ivan Galaviz CV Website - Main Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   Base Styles
   -------------------------------------------------------------------------- */
* {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: #0a0a0a;
}

.font-display {
  font-family: 'Bebas Neue', sans-serif;
}

/* --------------------------------------------------------------------------
   Keyframe Animations
   -------------------------------------------------------------------------- */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gradient-shift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.3);
  }

  50% {
    box-shadow: 0 0 40px rgba(229, 9, 20, 0.6);
  }
}

@keyframes float-slow {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(30px, -40px) scale(1.05);
  }

  50% {
    transform: translate(-20px, -60px) scale(0.98);
  }

  75% {
    transform: translate(-40px, -25px) scale(1.02);
  }
}

@keyframes float-reverse {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(-50px, 30px) scale(1.1);
  }

  66% {
    transform: translate(40px, -20px) scale(0.95);
  }
}

@keyframes float-diagonal {

  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(60px, 40px);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }

  100% {
    background-position: 200% center;
  }
}

/* Rotating tagline - 12s total cycle (4s per item × 3 items) */
@keyframes tagline-cycle {

  0%,
  2% {
    opacity: 0;
    transform: translateY(10px);
  }

  5%,
  28% {
    opacity: 1;
    transform: translateY(0);
  }

  31%,
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@keyframes hero-name-reveal {
  0% {
    clip-path: inset(0 100% 0 0);
    opacity: 0;
  }

  100% {
    clip-path: inset(0 0% 0 0);
    opacity: 1;
  }
}

@keyframes scroll-reveal {
  from {
    opacity: 0;
    transform: translateY(60px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   Animation Utility Classes
   -------------------------------------------------------------------------- */
.animate-fade-in-up {
  animation: fade-in-up 0.8s ease-out forwards;
}

.animate-delay-100 {
  animation-delay: 0.1s;
}

.animate-delay-200 {
  animation-delay: 0.2s;
}

.animate-delay-300 {
  animation-delay: 0.3s;
}

.animate-delay-400 {
  animation-delay: 0.4s;
}

.animate-delay-500 {
  animation-delay: 0.5s;
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.gradient-text {
  background: linear-gradient(135deg, #fff 0%, #E50914 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-gradient {
  background: radial-gradient(ellipse at top, rgba(229, 9, 20, 0.15) 0%, transparent 50%),
    linear-gradient(180deg, #0a0a0a 0%, #141414 100%);
}

/* Floating geometric shapes - MORE VISIBLE */
.floating-shape {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(40px);
}

.floating-shape-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(229, 9, 20, 0.35) 0%, rgba(229, 9, 20, 0.1) 50%, transparent 70%);
  top: 5%;
  left: 5%;
  animation: float-slow 25s ease-in-out infinite;
}

.floating-shape-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(229, 9, 20, 0.25) 0%, rgba(229, 9, 20, 0.08) 50%, transparent 70%);
  bottom: 10%;
  right: 10%;
  animation: float-reverse 30s ease-in-out infinite;
}

.floating-shape-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  top: 50%;
  right: 25%;
  animation: float-diagonal 20s ease-in-out infinite;
}

/* Hero name dramatic styling */
.hero-name {
  animation: hero-name-reveal 1.2s ease-out 0.3s forwards;
  opacity: 0;
}

/* Rotating tagline - FIXED */
.rotating-tagline-container {
  height: 28px;
  overflow: hidden;
  position: relative;
}

.rotating-tagline {
  position: absolute;
  width: 100%;
  left: 0;
  text-align: center;
  opacity: 0;
  animation: tagline-cycle 12s ease-in-out infinite;
}

.rotating-tagline:nth-child(1) {
  animation-delay: 0s;
}

.rotating-tagline:nth-child(2) {
  animation-delay: 4s;
}

.rotating-tagline:nth-child(3) {
  animation-delay: 8s;
}

/* --------------------------------------------------------------------------
   Grain Overlay
   -------------------------------------------------------------------------- */
.grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
  z-index: 1000;
}

/* --------------------------------------------------------------------------
   Cards & Interactive Elements
   -------------------------------------------------------------------------- */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(229, 9, 20, 0.1);
}

.glow-border {
  position: relative;
}

.glow-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, #E50914, transparent, #E50914);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

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

/* Profile picture glow */
.profile-glow {
  box-shadow: 0 0 30px rgba(229, 9, 20, 0.3);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.profile-glow:hover {
  box-shadow: 0 0 50px rgba(229, 9, 20, 0.5);
  transform: scale(1.05);
}

/* Magnetic button effect */
.magnetic-btn {
  position: relative;
  transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.magnetic-btn:hover {
  transform: scale(1.02);
}

.magnetic-btn::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.5), transparent, rgba(229, 9, 20, 0.3));
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.magnetic-btn:hover::after {
  opacity: 1;
}

/* Interactive skill tags */
.skill-tag {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: default;
}

.skill-tag:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 10px 30px rgba(229, 9, 20, 0.2);
  border-color: rgba(229, 9, 20, 0.5) !important;
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a) !important;
}

/* Featured article cards */
.featured-article-card {
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.featured-article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #E50914, #ff6b6b, #E50914);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.featured-article-card:hover::before {
  opacity: 1;
}

.featured-article-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px rgba(229, 9, 20, 0.15);
}

.article-logo {
  transition: transform 0.3s ease;
}

.featured-article-card:hover .article-logo {
  transform: scale(1.1);
}

/* --------------------------------------------------------------------------
   Scroll Reveal Animations - MORE DRAMATIC
   -------------------------------------------------------------------------- */
.scroll-reveal {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered scroll reveal for grids */
.reveal-stagger>* {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.7s ease-out, transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-stagger.revealed>*:nth-child(1) {
  transition-delay: 0s;
}

.reveal-stagger.revealed>*:nth-child(2) {
  transition-delay: 0.12s;
}

.reveal-stagger.revealed>*:nth-child(3) {
  transition-delay: 0.24s;
}

.reveal-stagger.revealed>*:nth-child(4) {
  transition-delay: 0.36s;
}

.reveal-stagger.revealed>*:nth-child(5) {
  transition-delay: 0.48s;
}

.reveal-stagger.revealed>*:nth-child(6) {
  transition-delay: 0.6s;
}

.reveal-stagger.revealed>* {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Mobile Menu
   -------------------------------------------------------------------------- */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  cursor: pointer;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 10, 0.98);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu a {
  font-size: 1.5rem;
  color: #9ca3af;
  transition: color 0.3s ease, transform 0.3s ease;
  transform: translateY(20px);
  opacity: 0;
}

.mobile-menu.active a {
  transform: translateY(0);
  opacity: 1;
}

.mobile-menu.active a:nth-child(1) {
  transition-delay: 0.1s;
}

.mobile-menu.active a:nth-child(2) {
  transition-delay: 0.15s;
}

.mobile-menu.active a:nth-child(3) {
  transition-delay: 0.2s;
}

.mobile-menu.active a:nth-child(4) {
  transition-delay: 0.25s;
}

.mobile-menu.active a:nth-child(5) {
  transition-delay: 0.3s;
}

.mobile-menu.active a:nth-child(6) {
  transition-delay: 0.35s;
}

.mobile-menu.active a:nth-child(7) {
  transition-delay: 0.4s;
}

.mobile-menu a:hover {
  color: white;
}

/* Scroll indicator */
.scroll-indicator {
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.scroll-indicator.hidden {
  opacity: 0 !important;
  visibility: hidden;
}

/* --------------------------------------------------------------------------
   Timeline (Experience)
   -------------------------------------------------------------------------- */
.timeline-line {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, #E50914 0%, #2a2a2a 100%);
}

@media (max-width: 768px) {
  .timeline-line {
    left: 20px;
  }
}

/* --------------------------------------------------------------------------
   Responsive - Hide mobile menu on desktop
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .mobile-menu {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }

  .hamburger {
    display: none !important;
  }
}