* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background: #ffffff;
  color: #1f2937;
  line-height: 1.7;
  min-height: 100vh;
}

.hero {
  text-align: center;
  padding: 9rem 1rem 7rem;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3.8rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.8rem;
  letter-spacing: -0.5px;
}

.hero h2 {
  font-size: 1.9rem;
  font-weight: 500;
  color: #2563eb;
  margin-bottom: 1.5rem;
}

.hero p {
  max-width: 740px;
  margin: 0 auto 2.5rem;
  font-size: 1.15rem;
  color: #4b5563;
}

.links {
  margin: 2.5rem 0;
}

.links a {
  margin: 0 1rem;
  text-decoration: none;
  color: #2563eb;
  font-weight: 600;
  padding: 0.7rem 1.8rem;
  border: 2px solid #2563eb;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.links a:hover {
  background: #2563eb;
  color: white;
}

.btn-portfolio {
  margin-top: 2.5rem;
  padding: 1rem 2.8rem;
  font-size: 1.1rem;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-portfolio:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.15);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background: white;
  padding: 3.5rem 2.5rem 2.5rem;
  border-radius: 12px;
  width: 95%;
  max-width: 1300px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0,0,0,0.08);
}

.close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #6b7280;
  font-size: 42px;
  cursor: pointer;
  transition: color 0.3s;
}

.close:hover {
  color: #2563eb;
}

.modal-content h3 {
  font-size: 2.4rem;
  text-align: center;
  color: #111827;
  margin-bottom: 3rem;
  font-weight: 600;
}

.modal-content h3::after {
  content: '';
  width: 80px;
  height: 4px;
  background: #2563eb;
  display: block;
  margin: 1.2rem auto 0;
  border-radius: 2px;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2.5rem;
}

.portfolio-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.4s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.portfolio-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
  border-color: #2563eb;
}

/* Carrusel */
.image-carousel {
  position: relative;
  overflow: hidden;
  height: 240px;
}

.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(255, 255, 255, 0.9);
  color: #1f2937;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 10;
}

.carousel-prev { left: 16px; }
.carousel-next { right: 16px; }

.image-carousel:hover .carousel-prev,
.image-carousel:hover .carousel-next {
  opacity: 1;
}

.carousel-prev:hover,
.carousel-next:hover {
  background: #2563eb;
  color: white;
}

.carousel-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.carousel-dots span {
  width: 9px;
  height: 9px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.carousel-dots span.active {
  background: #2563eb;
  width: 11px;
  height: 11px;
}

.portfolio-info {
  padding: 2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.portfolio-info h4 {
  font-size: 1.5rem;
  color: #111827;
  margin-bottom: 0.8rem;
  font-weight: 600;
}

.portfolio-info p {
  color: #4b5563;
  margin-bottom: 1.2rem;
  flex-grow: 1;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1.4rem;
}

.tech-tags span {
  background: #f3f4f6;
  color: #374151;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid #e5e7eb;
}

.btn-more {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
  margin-top: auto;
}

.btn-more:hover {
  text-decoration: underline;
}

/* Secciones */
.section {
  max-width: 1000px;
  margin: 6rem auto;
  padding: 0 1.5rem;
}

.section h3 {
  font-size: 2.2rem;
  margin-bottom: 3rem;
  color: #111827;
  text-align: center;
  font-weight: 600;
  position: relative;
}

.section h3::after {
  content: '';
  width: 70px;
  height: 4px;
  background: #2563eb;
  display: block;
  margin: 1rem auto 0;
  border-radius: 2px;
}

.card {
  background: white;
  padding: 2.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 2.5rem;
  transition: all 0.4s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card:hover {
  box-shadow: 0 15px 35px rgba(0,0,0,0.06);
  border-color: #2563eb;
}

.card h4 {
  font-size: 1.4rem;
  color: #111827;
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.card span {
  font-size: 1rem;
  color: #6b7280;
  display: block;
  margin-bottom: 1.2rem;
  font-weight: 500;
}

.card ul {
  padding-left: 1.4rem;
  color: #4b5563;
}

.card li {
  margin-bottom: 0.8rem;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.2rem;
}

.skills span {
  background: #f3f4f6;
  color: #374151;
  padding: 0.7rem 1.3rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
}

.skills span:hover {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.footer {
  text-align: center;
  padding: 5rem 1rem 4rem;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  color: #4b5563;
}

.email {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: #111827;
  font-weight: 500;
}

.email::before {
  content: "📧 ";
}

.signature {
  font-size: 1.1rem;
  color: #6b7280;
}

.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;
}

/* Mostrar menú al abrir */
.theme-switcher.open .theme-menu {
  display: flex;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 3rem; }
  .hero h2 { font-size: 1.6rem; }
  .links a { display: block; margin: 1rem auto; max-width: 300px; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .image-carousel { height: 220px; }
}