* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background: #0f172a;
  color: #e5e7eb;
  line-height: 1.6;
  min-height: 100vh;
}

.hero {
  position: relative;
  text-align: center;
  padding: 6rem 1rem;
  background: linear-gradient(135deg, #1e3a8a, #1e40af);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 4rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.hero h2 {
  font-weight: 400;
  font-size: 1.8rem;
  margin-top: 0.5rem;
  color: #a5f3fc;
}

.hero p {
  margin: 1.5rem auto 0;
  max-width: 700px;
  opacity: 0.95;
  font-size: 1.1rem;
}

.links {
  margin-top: 2rem;
}

.links a {
  margin: 0 1rem;
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.8rem 1.8rem;
  border-radius: 50px;
  border: 1px solid #00ffff;
  transition: all 0.4s ease;
}

.links a:hover {
  background: #00ffff;
  color: #0f172a;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
  transform: translateY(-3px);
}

.btn-portfolio {
  margin-top: 2.5rem;
  padding: 1rem 2.5rem;
  font-size: 1.2rem;
  background: transparent;
  color: #00ffff;
  border: 2px solid #00ffff;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.4s ease;
}

.btn-portfolio:hover {
  background: #00ffff;
  color: #0f172a;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.7);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.95);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background: #0f172a;
  padding: 2.5rem;
  border-radius: 20px;
  width: 95%;
  max-width: 1300px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 0 60px rgba(0, 255, 255, 0.4);
}

.close {
  position: absolute;
  top: 15px;
  right: 30px;
  color: #aaa;
  font-size: 45px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.close:hover {
  color: #00ffff;
}

.modal-content h3 {
  font-size: 2.5rem;
  text-align: center;
  color: #00ffff;
  margin-bottom: 2.5rem;
  position: relative;
}

.modal-content h3::after {
  content: '';
  width: 100px;
  height: 4px;
  background: #00ffff;
  display: block;
  margin: 1rem auto 0;
  border-radius: 2px;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.portfolio-card {
  background: #020617;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: all 0.6s ease;
  opacity: 0;
  transform: translateY(30px);
  display: flex;
  flex-direction: column;
}

.portfolio-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.portfolio-card:hover {
  transform: translateY(-15px) scale(1.02);
  box-shadow: 0 30px 60px rgba(0, 255, 255, 0.4);
}

.image-carousel {
  position: relative;
  overflow: hidden;
  height: 240px;
  border-radius: 16px 16px 0 0;
}

.carousel-images {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.6s ease;
}

.carousel-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  flex-shrink: 0;
  transition: transform 0.6s ease;
}

.portfolio-card:hover .carousel-images img {
  transform: scale(1.15);
}

.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #00ffff;
  border: 1px solid #00ffff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.4s ease;
  z-index: 10;
}

.carousel-prev { left: 15px; }
.carousel-next { right: 15px; }

.image-carousel:hover .carousel-prev,
.image-carousel:hover .carousel-next {
  opacity: 1;
}

.carousel-prev:hover,
.carousel-next:hover {
  background: #00ffff;
  color: #0f172a;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
}

.carousel-dots {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.carousel-dots span {
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transition: all 0.4s ease;
}

.carousel-dots span.active {
  background: #00ffff;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
  transform: scale(1.2);
}

.portfolio-info {
  padding: 1.8rem;
  flex-grow: 1;
}

.portfolio-info h4 {
  font-size: 1.5rem;
  color: #a5f3fc;
  margin-bottom: 0.8rem;
}

.portfolio-info p {
  opacity: 0.9;
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.6;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.tech-tags span {
  background: rgba(0, 255, 255, 0.15);
  padding: 0.5rem 1rem;
  border-radius: 30px;
  font-size: 0.9rem;
  border: 1px solid rgba(0, 255, 255, 0.4);
}

.btn-more {
  color: #00ffff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
}

.btn-more:hover {
  color: white;
  text-shadow: 0 0 12px #00ffff;
}

/* Secciones generales */
.section {
  max-width: 1000px;
  margin: 4rem auto;
  padding: 0 1.5rem;
}

.section h3 {
  font-size: 2.2rem;
  margin-bottom: 2rem;
  color: #00ffff;
  text-align: center;
  position: relative;
}

.section h3::after {
  content: '';
  width: 80px;
  height: 4px;
  background: #00ffff;
  display: block;
  margin: 0.8rem auto 0;
  border-radius: 2px;
}

.card {
  background: #020617;
  padding: 2rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.card.visible {
  opacity: 1;
  transform: translateY(0);
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 255, 255, 0.25);
}

.card h4 {
  font-size: 1.4rem;
  color: #a5f3fc;
}

.card span {
  font-size: 0.95rem;
  opacity: 0.7;
  display: block;
  margin-bottom: 1rem;
}

.card ul {
  margin-top: 1rem;
  padding-left: 1.2rem;
}

.card li {
  margin-bottom: 0.5rem;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.skills span {
  background: rgba(0, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 30px;
  font-size: 0.95rem;
  border: 1px solid rgba(0, 255, 255, 0.3);
  transition: 0.3s;
}

.skills span:hover {
  background: #00ffff;
  color: #0f172a;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.footer {
  background: #020617;
  padding: 4rem 1rem 3rem;
  text-align: center;
  margin-top: 6rem;
  border-top: 1px solid rgba(0, 255, 255, 0.1);
}

.footer-content {
  max-width: 1000px;
  margin: 0 auto;
}

.email {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  opacity: 0.9;
  color: #a5f3fc;
}

.email::before {
  content: "📧 ";
}

.signature {
  font-size: 1.1rem;
  opacity: 0.7;
  color: #94a3b8;
}

.theme-switcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

.theme-button {
  background: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
}

.theme-button:hover {
  transform: scale(1.1) rotate(30deg);
  background: rgba(0, 0, 0, 0.6);
}

.theme-menu {
  position: absolute;
  bottom: 60px;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.theme-menu button {
  background: transparent;
  color: white;
  border: none;
  padding: 10px 14px;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.theme-menu button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.theme-menu button.active {
  background: rgba(255, 255, 255, 0.3);
  font-weight: bold;
}

.theme-switcher.open .theme-menu {
  display: flex;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 3rem; }
  .hero h2 { font-size: 1.5rem; }
  .links a { display: block; margin: 1rem auto; max-width: 220px; }
  .btn-portfolio { font-size: 1.1rem; padding: 0.9rem 2rem; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .image-carousel { height: 200px; }
}