/* RESET Y ESTILOS BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
  position: relative;
  overflow-x: hidden;
}

/* Fondo con efectos */
.background-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.gradient-orb {
  position: absolute;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  border-radius: 50%;
  top: -400px;
  right: -200px;
  opacity: 0.5;
  filter: blur(60px);
  animation: float 20s ease-in-out infinite;
}

.gradient-orb-2 {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  border-radius: 50%;
  bottom: -300px;
  left: -200px;
  opacity: 0.4;
  filter: blur(60px);
  animation: float 15s ease-in-out infinite reverse;
}

.grid-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.5;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 30px) scale(1.1); }
}

/* Animación de entrada */
@keyframes pageEnter {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.page-content {
  animation: pageEnter 1s ease-out forwards;
  position: relative;
  z-index: 2;
}

/* Welcome Overlay */
#welcome-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.welcome-content {
  text-align: center;
  transform: translateY(0);
}

.welcome-title {
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-subtitle {
  font-size: clamp(1rem, 4vw, 1.5rem);
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.welcome-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  margin: 2rem auto;
  animation: spin 1s infinite cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Menú fijo */
.fixed-menu {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--menu-bg);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  z-index: 100;
  display: flex;
  gap: 2.5rem;
  box-shadow: var(--card-shadow);
}

.fixed-menu a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.3s ease;
  position: relative;
}

.fixed-menu a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  transition: width 0.3s ease;
}

.fixed-menu a:hover::after {
  width: 100%;
}

.fixed-menu a:hover {
  color: var(--accent-primary);
}

/* Botón tema */
.theme-toggle {
  position: fixed;
  top: 30px;
  right: 30px;
  background: var(--menu-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 0.8rem 1.5rem;
  z-index: 100;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--text-primary);
  font-weight: 500;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.05);
}

/* Layout principal */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 120px 2rem 2rem;
  position: relative;
}

section {
  margin-bottom: 8rem;
  position: relative;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.section-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
  opacity: 0.5;
}

.section-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  position: relative;
  color: var(--text-primary);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--accent-primary);
  border-radius: 2px;
}

.section-description {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* Hero section */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4rem;
  align-items: center;
  min-height: 80vh;
}

.hero-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--badge-bg);
  border: 1px solid var(--accent-primary);
  border-radius: 30px;
  color: var(--accent-primary);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2rem;
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.hero-name span {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 500px;
}

.hero-stats {
  display: flex;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.tech-pill {
  padding: 0.6rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.tech-pill:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

/* Foto de perfil */
.profile-image-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.profile-frame {
  position: relative;
  width: 380px;
  height: 380px;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  overflow: hidden;
  animation: morphShape 8s ease-in-out infinite;
  box-shadow: var(--card-shadow);
}

@keyframes morphShape {
  0% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  }
  25% {
    border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
  }
  50% {
    border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
  }
  75% {
    border-radius: 40% 60% 60% 40% / 40% 40% 60% 60%;
  }
  100% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  }
}

.profile-ring {
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border: 3px solid var(--accent-primary);
  border-radius: inherit;
  animation: ringPulse 3s ease-out infinite;
  pointer-events: none;
}

@keyframes ringPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.5;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 2;
  transition: transform 0.5s ease;
}

.profile-image:hover {
  transform: scale(1.05);
}

.profile-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 30%, var(--accent-glow), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 3;
}

.profile-frame:hover .profile-glow {
  opacity: 0.5;
}

/* Iconos flotantes */
.floating-tech-icons {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.floating-icon {
  position: absolute;
  font-size: 2rem;
  color: var(--accent-primary);
  opacity: 0.2;
  animation: floatIcon 6s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(10px, -10px) rotate(5deg);
  }
  66% {
    transform: translate(-5px, 5px) rotate(-5deg);
  }
}

/* Línea de tiempo */
.timeline-container {
  position: relative;
  padding: 2rem 0;
  margin-top: 2rem;
}

.timeline {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 30px;
  top: 0;
  height: 100%;
  width: 3px;
  background: linear-gradient(to bottom, transparent, var(--accent-primary), transparent);
  opacity: 0.3;
  animation: timelinePulse 3s ease-in-out infinite;
}

@keyframes timelinePulse {
  0%, 100% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.5;
  }
}

.timeline-item {
  position: relative;
  padding-left: 80px;
  margin-bottom: 4rem;
  opacity: 0;
  animation: slideInTimeline 0.8s ease forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.3s; }
.timeline-item:nth-child(3) { animation-delay: 0.5s; }
.timeline-item:nth-child(4) { animation-delay: 0.7s; }

@keyframes slideInTimeline {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.timeline-dot {
  position: absolute;
  left: 22px;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 20px var(--accent-glow);
  z-index: 2;
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 20px var(--accent-glow);
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 0 30px var(--accent-glow);
  }
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2rem;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: var(--card-shadow);
}

.timeline-content:hover {
  transform: translateX(10px);
  border-color: var(--accent-primary);
}

.timeline-content::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 20px;
  width: 20px;
  height: 20px;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  transform: rotate(45deg);
  transition: border-color 0.3s ease;
}

.timeline-content:hover::before {
  border-color: var(--accent-primary);
}

.timeline-date {
  display: inline-block;
  padding: 0.3rem 1rem;
  background: var(--accent-primary);
  color: white;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.timeline-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.timeline-title i {
  color: var(--accent-primary);
  margin-right: 0.5rem;
}

.timeline-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-style: italic;
}

.timeline-description {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  padding: 0.3rem 0.8rem;
  background: rgba(255, 138, 92, 0.1);
  border: 1px solid var(--accent-primary);
  border-radius: 15px;
  font-size: 0.8rem;
  color: var(--accent-primary);
  transition: all 0.3s ease;
}

.tag:hover {
  background: var(--accent-primary);
  color: white;
  transform: translateY(-2px);
}

/* Cards grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.feature-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 2rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent, var(--card-overlay));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-primary);
}

.feature-card:hover::before {
  opacity: 1;
}

.card-icon {
  font-size: 2rem;
  color: var(--accent-primary);
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 2;
}

.feature-card h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
  color: var(--text-primary);
}

.feature-card p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 2;
}

.card-meta {
  display: flex;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  position: relative;
  z-index: 2;
}

/* Toolbar */
.toolbar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: 15px;
  border: 1px solid var(--border-color);
}

.input, .select {
  padding: 0.8rem 1.2rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.95rem;
  flex: 1;
  min-width: 200px;
}

.input::placeholder {
  color: var(--text-secondary);
}

.btn {
  padding: 0.8rem 1.5rem;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-secondary);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px var(--accent-glow);
}

.btn-outline {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-outline:hover {
  background: var(--accent-primary);
  color: white;
}

.btn.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* Animaciones */
.fade-in-left {
  opacity: 0;
  animation: fadeInLeft 1s ease forwards;
}

.fade-in-right {
  opacity: 0;
  animation: fadeInRight 1s ease forwards;
}

.fade-in-up {
  opacity: 0;
  animation: fadeInUp 1s ease forwards;
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 968px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .fixed-menu {
    top: 20px;
    padding: 0.8rem 1.2rem;
    gap: 1.2rem;
    font-size: 0.9rem;
    width: 90%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .theme-toggle {
    top: 20px;
    right: 20px;
    padding: 0.6rem 1.2rem;
  }

  main {
    padding: 100px 1rem 1rem;
  }

  .timeline::before {
    left: 20px;
  }

  .timeline-item {
    padding-left: 50px;
  }

  .timeline-dot {
    left: 12px;
    width: 15px;
    height: 15px;
  }

  .timeline-content::before {
    left: -8px;
    width: 15px;
    height: 15px;
  }

  .profile-frame {
    width: 280px;
    height: 280px;
  }

  .floating-icon {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 1.5rem;
  }

  .toolbar {
    flex-direction: column;
  }

  .fixed-menu {
    gap: 0.8rem;
    font-size: 0.8rem;
  }

  .social-links {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .timeline-content {
    padding: 1.5rem;
  }

  .timeline-title {
    font-size: 1.1rem;
  }

  .timeline-description {
    font-size: 0.9rem;
  }

  .profile-frame {
    width: 240px;
    height: 240px;
  }
}