* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background: #121212;
  color: #e0d0f0;
  line-height: 1.7;
  min-height: 100vh;
}

.hero {
  text-align: center;
  padding: 8rem 1rem 6rem;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #2a1a4e 100%);
  border-bottom: 1px solid #4a1a8b;
}

.hero h1 {
  font-size: 3.6rem;
  font-weight: 700;
  color: #c78aff;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 15px rgba(167, 85, 247, 0.4);
}

.hero h2 {
  font-size: 1.9rem;
  font-weight: 500;
  color: #a855f7;
  margin-bottom: 1.5rem;
}

.hero p {
  max-width: 720px;
  margin: 0 auto 2rem;
  font-size: 1.12rem;
  color: #b0b0d0;
}

.links {
  margin: 2.5rem 0;
}

.links a {
  margin: 0 1rem;
  text-decoration: none;
  color: #c78aff;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border: 2px solid #9333ea;
  border-radius: 50px;
  background: rgba(167, 85, 247, 0.15);
  transition: all 0.4s ease;
}

.links a:hover {
  background: #9333ea;
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(147, 51, 234, 0.5);
}

.btn-portfolio {
  margin-top: 2.5rem;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  background: linear-gradient(135deg, #9333ea, #a855f7);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.4s ease;
  box-shadow: 0 6px 20px rgba(147, 51, 234, 0.4);
}

.btn-portfolio:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 35px rgba(147, 51, 234, 0.6);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.7);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background: #1a1a2e;
  padding: 3rem 2rem 2.5rem;
  border-radius: 20px;
  width: 95%;
  max-width: 1300px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  border: 1px solid #4a1a8b;
}

.close {
  position: absolute;
  top: 15px;
  right: 30px;
  color: #c78aff;
  font-size: 40px;
  cursor: pointer;
  transition: all 0.3s;
}

.close:hover {
  color: #e59bff;
  transform: scale(1.1);
}

.modal-content h3 {
  font-size: 2.3rem;
  text-align: center;
  color: #c78aff;
  margin-bottom: 2.5rem;
  position: relative;
}

.modal-content h3::after {
  content: '';
  width: 90px;
  height: 5px;
  background: linear-gradient(90deg, #9333ea, #a855f7);
  display: block;
  margin: 1rem auto 0;
  border-radius: 3px;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.portfolio-card {
  background: #1a1a2e;
  border: 1px solid #4a1a8b;
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s ease;
  display: flex;
  flex-direction: column;
}

.portfolio-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 50px rgba(147, 51, 234, 0.4);
  border-color: #a855f7;
}

.image-carousel {
  position: relative;
  overflow: hidden;
  height: 240px;
  border-radius: 20px 20px 0 0;
}

.carousel-images {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
}

.carousel-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  flex-shrink: 0;
}

.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(147, 51, 234, 0.8);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s 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: #c78aff;
  transform: translateY(-50%) scale(1.1);
}

.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.carousel-dots span {
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.carousel-dots span.active {
  background: #a855f7;
  width: 12px;
  height: 12px;
  box-shadow: 0 0 10px rgba(167, 85, 247, 0.8);
}

.portfolio-info {
  padding: 1.8rem;
  flex-grow: 1;
}

.portfolio-info h4 {
  font-size: 1.45rem;
  color: #c78aff;
  margin-bottom: 0.8rem;
}

.portfolio-info p {
  color: #b0b0d0;
  margin-bottom: 1.2rem;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.tech-tags span {
  background: linear-gradient(135deg, #2a1a4e, #3a1a6e);
  color: #e59bff;
  padding: 0.5rem 1.1rem;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid #4a1a8b;
}

.btn-more {
  color: #a855f7;
  text-decoration: none;
  font-weight: 600;
}

.btn-more:hover {
  color: #e59bff;
  text-decoration: underline;
}

/* Secciones generales */
.section {
  max-width: 1000px;
  margin: 5rem auto;
  padding: 0 1.5rem;
}

.section h3 {
  font-size: 2.1rem;
  margin-bottom: 2.5rem;
  color: #c78aff;
  text-align: center;
  position: relative;
}

.section h3::after {
  content: '';
  width: 90px;
  height: 5px;
  background: linear-gradient(90deg, #9333ea, #a855f7);
  display: block;
  margin: 1rem auto 0;
  border-radius: 3px;
}

.card {
  background: #1a1a2e;
  padding: 2.3rem;
  border: 1px solid #4a1a8b;
  border-radius: 20px;
  margin-bottom: 2rem;
  transition: all 0.4s ease;
}

.card:hover {
  border-color: #a855f7;
  box-shadow: 0 15px 40px rgba(147, 51, 234, 0.3);
}

.card h4 {
  font-size: 1.35rem;
  color: #c78aff;
  margin-bottom: 0.6rem;
}

.card span {
  font-size: 0.95rem;
  color: #9999c0;
  display: block;
  margin-bottom: 1.2rem;
}

.card ul,
.card li {
  color: #b0b0d0;
  padding-left: 1.4rem;
}

.card li {
  margin-bottom: 0.7rem;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.skills span {
  background: linear-gradient(135deg, #2a1a4e, #3a1a6e);
  color: #e59bff;
  padding: 0.6rem 1.3rem;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid #4a1a8b;
  transition: all 0.3s ease;
}

.skills span:hover {
  background: #9333ea;
  color: white;
  transform: scale(1.05);
}

.footer {
  text-align: center;
  padding: 4rem 1rem 3rem;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-top: 1px solid #4a1a8b;
  color: #b0b0d0;
}

.email {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: #c78aff;
}

.email::before {
  content: "📧 ";
}

.signature {
  font-size: 1.05rem;
  color: #9999c0;
}

.theme-switcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

.theme-button {
  background: rgba(255, 255, 255, 0.2);
  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.5);
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
}

.theme-button:hover {
  transform: scale(1.1) rotate(30deg);
  background: rgba(255, 255, 255, 0.4);
}

.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.6);
}

.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.6rem; }
  .hero p { font-size: 1rem; }
  .links a { display: block; margin: 1rem auto; max-width: 280px; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .image-carousel { height: 200px; }
}