:root {
  --primary: #00a8ff;
  --secondary: #192a56;
  --dark: #2f3640;
  --accent: #00fff7;
  --light: #f5f6fa;
  --text: #dcdde1;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--dark) 100%);
  color: var(--text);
  overflow-x: hidden;
}

/* Animaciones globales */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes glow {
  0%,
  100% {
    text-shadow: 0 0 10px var(--primary);
  }
  50% {
    text-shadow: 0 0 20px var(--accent), 0 0 30px var(--primary);
  }
}

@keyframes flipIn {
  from {
    opacity: 0;
    transform: rotateY(90deg);
  }
  to {
    opacity: 1;
    transform: rotateY(0);
  }
}

/* Header y Navegación */
header {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(25, 42, 86, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 1rem 0;
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent);
  animation: glow 3s ease-in-out infinite;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s ease;
  position: relative;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

/* Hero Section Mejorada */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 2rem;
  background: linear-gradient(
    135deg,
    rgba(0, 168, 255, 0.1) 0%,
    rgba(25, 42, 86, 0.3) 100%
  );
  position: relative;
}

.hero-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-content {
  text-align: left;
}

.hero-content h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  animation: fadeInUp 1s ease-out;
}

.hero-content h2 {
  font-size: 1.8rem;
  color: var(--accent);
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease-out 0.3s both;
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease-out 0.6s both;
}

.hero-image {
  position: relative;
  animation: fadeInUp 1s ease-out 0.9s both;
}

.profile-image {
  width: 100%;
  max-width: 400px;
  height: 500px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  border: 3px solid var(--accent);
}

.cta-button {
  display: inline-block;
  padding: 1rem 2rem;
  background: linear-gradient(45deg, var(--primary), var(--accent));
  color: var(--secondary);
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-right: 1rem;
  margin-bottom: 1rem;
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 168, 255, 0.3);
}

.cta-button.secondary {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

/* Secciones generales */
section {
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
  color: var(--accent);
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background: linear-gradient(45deg, var(--primary), var(--accent));
}

/* Galería Estilo Revista Digital */
.gallery-section {
  background: rgba(47, 54, 64, 0.5);
}

.magazine-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  perspective: 1000px;
}

.magazine-item {
  background: rgba(47, 54, 64, 0.8);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  cursor: pointer;
  animation: flipIn 0.6s ease-out;
}

.magazine-item:hover {
  transform: translateY(-10px) rotate(2deg);
  box-shadow: 0 25px 50px rgba(0, 168, 255, 0.2);
}

.magazine-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-bottom: 3px solid var(--accent);
}

.magazine-caption {
  padding: 1.5rem;
  text-align: center;
}

.magazine-caption h3 {
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* Stack Carousel Styles */
.stack-carousel-container {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 0;
}

.stack-carousel {
  position: relative;
  height: 500px;
  perspective: 1000px;
}

.stack-item {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 400px;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  opacity: 0;
  z-index: 1;
}

.stack-item.active {
  opacity: 1;
  transform: translateX(-50%) scale(1) rotate(0deg);
  z-index: 5;
}

.stack-item.prev-1 {
  opacity: 0.8;
  transform: translateX(-80%) scale(0.9) rotate(-5deg);
  z-index: 4;
}

.stack-item.prev-2 {
  opacity: 0.6;
  transform: translateX(-90%) scale(0.8) rotate(-8deg);
  z-index: 3;
}

.stack-item.next-1 {
  opacity: 0.8;
  transform: translateX(-20%) scale(0.9) rotate(5deg);
  z-index: 4;
}

.stack-item.next-2 {
  opacity: 0.6;
  transform: translateX(-10%) scale(0.8) rotate(8deg);
  z-index: 3;
}

.stack-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.stack-item:hover img {
  transform: scale(1.05);
}

.stack-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 2rem 1rem 1rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.stack-item.active .stack-caption {
  transform: translateY(0);
}

.stack-caption h3 {
  color: var(--accent);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.stack-caption p {
  color: var(--light);
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Controles del Carousel */
.carousel-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-top: 3rem;
}

.carousel-btn {
  background: rgba(47, 54, 64, 0.8);
  border: 2px solid var(--accent);
  color: var(--accent);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-btn:hover {
  background: var(--accent);
  color: var(--secondary);
  transform: scale(1.1);
}

.carousel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.carousel-btn:disabled:hover {
  background: rgba(47, 54, 64, 0.8);
  color: var(--accent);
}

.carousel-indicators {
  display: flex;
  gap: 0.5rem;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator.active {
  background: var(--accent);
  transform: scale(1.2);
}

.indicator:hover {
  background: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
  .stack-carousel {
    height: 400px;
  }

  .stack-item {
    width: 250px;
    height: 350px;
  }

  .carousel-controls {
    gap: 1rem;
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .stack-carousel {
    height: 350px;
  }

  .stack-item {
    width: 200px;
    height: 300px;
  }

  .stack-caption h3 {
    font-size: 1rem;
  }

  .stack-caption p {
    font-size: 0.8rem;
  }
}

/* Sección de Documentos */
.documents-section {
  background: rgba(25, 42, 86, 0.3);
}

.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.document-card {
  background: rgba(47, 54, 64, 0.8);
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  border-left: 4px solid var(--accent);
  transition: transform 0.3s ease;
}

.document-card:hover {
  transform: translateY(-5px);
}

.document-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.document-card h3 {
  color: var(--accent);
  margin-bottom: 1rem;
}

.download-btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.3s ease;
  margin-top: 1rem;
}

.download-btn:hover {
  background: var(--accent);
}

/* Timeline Experiencia */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: var(--primary);
}

.timeline-item {
  margin-bottom: 3rem;
  position: relative;
  width: 45%;
  animation: fadeInUp 0.6s ease-out;
}

.timeline-item:nth-child(odd) {
  left: 0;
}

.timeline-item:nth-child(even) {
  left: 55%;
}

.timeline-content {
  background: rgba(47, 54, 64, 0.8);
  padding: 1.5rem;
  border-radius: 10px;
  border-left: 4px solid var(--accent);
  transition: transform 0.3s ease;
}

.timeline-content:hover {
  transform: translateX(10px);
}

.timeline-date {
  color: var(--accent);
  font-weight: bold;
  margin-bottom: 0.5rem;
}

/* Habilidades Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.skill-category {
  background: rgba(47, 54, 64, 0.8);
  padding: 2rem;
  border-radius: 10px;
  border-top: 4px solid var(--primary);
  transition: transform 0.3s ease;
}

.skill-category:hover {
  transform: translateY(-10px);
}

.skill-category h3 {
  color: var(--accent);
  margin-bottom: 1rem;
}

.skill-list {
  list-style: none;
}

.skill-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Contacto */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(47, 54, 64, 0.8);
  border-radius: 10px;
  transition: transform 0.3s ease;
}

.contact-item:hover {
  transform: translateX(10px);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.social-link {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 5px;
  transition: transform 0.3s ease;
}

.social-link:hover {
  transform: translateY(-3px);
  background: var(--accent);
}

/* Footer */
footer {
  background: var(--dark);
  text-align: center;
  padding: 2rem;
  margin-top: 5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content {
    text-align: center;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .timeline::before {
    left: 30px;
  }

  .timeline-item {
    width: calc(100% - 80px);
    left: 80px !important;
  }

  .magazine-gallery {
    grid-template-columns: 1fr;
  }
}

.img-title {
  width: 250px;
  height: 200px;
  display: block;
  margin: 10px auto;
  margin-top: 40px;
  object-fit: cover;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Hero Stack Carousel Styles - CORREGIDOS */
.hero-stack-carousel {
  position: relative;
  width: 100%;
  max-width: 400px; /* Reducido para mejor proporción */
  height: 500px; /* Altura ajustada */
  perspective: 1200px;
  margin: 0 auto; /* Centrado automático */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-stack-container {
  position: relative;
  width: 100%;
  height: 100%;
  margin-top: 20px; /* Espacio desde el nav */
}

.hero-stack-item {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 85%; /* Reducido para que no sea tan grande */
  transform: translate(-50%, -50%);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border: 2px solid var(--accent);
  cursor: pointer;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  opacity: 0;
  z-index: 1;
}

.hero-stack-item.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
  z-index: 5;
}

.hero-stack-item.prev-1 {
  opacity: 0.7;
  transform: translate(-65%, -50%) scale(0.85) rotate(-8deg);
  z-index: 4;
  filter: brightness(0.8);
}

.hero-stack-item.prev-2 {
  opacity: 0.4;
  transform: translate(-75%, -50%) scale(0.7) rotate(-15deg);
  z-index: 3;
  filter: brightness(0.6);
}

.hero-stack-item.next-1 {
  opacity: 0.7;
  transform: translate(-35%, -50%) scale(0.85) rotate(8deg);
  z-index: 4;
  filter: brightness(0.8);
}

.hero-stack-item.next-2 {
  opacity: 0.4;
  transform: translate(-25%, -50%) scale(0.7) rotate(15deg);
  z-index: 3;
  filter: brightness(0.6);
}

.hero-stack-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.hero-stack-item:hover img {
  transform: scale(1.05);
}

.hero-stack-item.active:hover {
  transform: translate(-50%, -50%) scale(1.02) rotate(0deg);
}

/* Indicadores del Hero */
.hero-indicators {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 2rem;
  position: relative;
  z-index: 10;
}

.hero-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.hero-indicator.active {
  background: var(--accent);
  transform: scale(1.3);
}

.hero-indicator::after {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
}

.hero-indicator:hover {
  background: var(--primary);
}

/* Ajustes específicos para el hero container */
.hero-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 80px; /* Espacio para el nav fixed */
  min-height: 100vh;
}

.hero-content {
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* RESPONSIVE - Móviles */
@media (max-width: 768px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
    padding-top: 100px; /* Más espacio en móviles */
    min-height: auto;
    padding-bottom: 2rem;
  }
  
  .hero-stack-carousel {
    max-width: 300px;
    height: 380px;
    order: 2; /* Poner el carousel después del contenido */
  }
  
  .hero-content {
    text-align: center;
    order: 1; /* Poner el contenido primero */
  }
  
  .hero-stack-container {
    margin-top: 0;
  }
  
  .hero-stack-item {
    height: 80%; /* Un poco más pequeño en móviles */
  }
}

/* Tablets */
@media (max-width: 1024px) and (min-width: 769px) {
  .hero-stack-carousel {
    max-width: 350px;
    height: 450px;
  }
  
  .hero-container {
    gap: 2rem;
  }
}

/* Móviles pequeños */
@media (max-width: 480px) {
  .hero-stack-carousel {
    max-width: 280px;
    height: 350px;
  }
  
  .hero-indicators {
    margin-top: 1.5rem;
  }
  
  .hero-stack-item {
    border-radius: 12px;
  }
}

/* Asegurar que el hero section tenga suficiente espacio */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(
    135deg,
    rgba(0, 168, 255, 0.1) 0%,
    rgba(25, 42, 86, 0.3) 100%
  );
  position: relative;
  overflow: hidden;
}


/* Estilos para la sección Portafolio */
.portfolio-section {
  background: rgba(25, 42, 86, 0.3);
  padding: 5rem 2rem;
}

.portfolio-description {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3rem;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.portfolio-card {
  background: rgba(47, 54, 64, 0.8);
  padding: 2rem;
  border-radius: 15px;
  border-top: 4px solid var(--accent);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.portfolio-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.portfolio-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 168, 255, 0.2);
}

.portfolio-card:hover::before {
  transform: scaleX(1);
}

.portfolio-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.portfolio-card h3 {
  color: var(--accent);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.portfolio-card p {
  color: var(--text);
  margin-bottom: 1.5rem;
  flex-grow: 1;
  line-height: 1.5;
}

.portfolio-link {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background: linear-gradient(45deg, var(--primary), var(--accent));
  color: var(--secondary);
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: all 0.3s ease;
  text-align: center;
  border: none;
  cursor: pointer;
}

.portfolio-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 168, 255, 0.3);
}

.portfolio-note {
  max-width: 800px;
  margin: 3rem auto 0;
  padding: 1.5rem;
  background: rgba(47, 54, 64, 0.5);
  border-radius: 10px;
  text-align: center;
  border-left: 4px solid var(--primary);
}

.portfolio-note a {
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
}

.portfolio-note a:hover {
  text-decoration: underline;
}

/* Animación para las tarjetas del portafolio */
@keyframes cardAppear {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.portfolio-card {
  animation: cardAppear 0.6s ease-out;
  animation-fill-mode: both;
}

.portfolio-card:nth-child(1) { animation-delay: 0.1s; }
.portfolio-card:nth-child(2) { animation-delay: 0.2s; }
.portfolio-card:nth-child(3) { animation-delay: 0.3s; }
.portfolio-card:nth-child(4) { animation-delay: 0.4s; }
.portfolio-card:nth-child(5) { animation-delay: 0.5s; }
.portfolio-card:nth-child(6) { animation-delay: 0.6s; }

/* Responsive */
@media (max-width: 768px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
  
  .portfolio-card {
    padding: 1.5rem;
  }
  
  .portfolio-description {
    font-size: 1rem;
    margin-bottom: 2rem;
  }
}
