/* css/style.css */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;

  /* Dark theme (default) */
  --bg: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --text: #f0f0f0;
  --text-muted: #a0a0a0;
  --accent: #4f9cf9;
  --card-bg: #1e1e1e;
  --border: #2d2d2d;
  --shadow: rgba(0, 0, 0, 0.4);
}

[data-theme='light'] {
  --bg: #ffffff;
  --bg-secondary: #f8f9fa;
  --text: #121212;
  --text-muted: #555;
  --accent: #2563eb;
  --card-bg: #ffffff;
  --border: #e0e0e0;
  --shadow: rgba(0, 0, 0, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

.container {
  width: min(90%, 1200px);
  margin-inline: auto;
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 12px var(--shadow);
  transition: all 0.2s;
}
.theme-toggle:hover {
  transform: rotate(15deg);
}
.sun,
.moon {
  display: none;
}
.theme-dark .moon {
  display: block;
}
.theme-light .sun {
  display: block;
}

[data-theme='dark'] .theme-toggle {
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  border-color: rgba(63, 68, 71, 0.575);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

@media (max-width: 480px) {
  .theme-toggle {
    right: 1.25rem;
    top: 1.25rem;
  }
}

/* Header */
.header {
  padding: 5rem 0 3rem;
  text-align: center;
}
.name {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline {
  font-size: 1.2rem;
  color: var(--text-muted);
}

/* Sections */
.section {
  padding: 4rem 0;
}
.section > .container > h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  margin-bottom: 2rem;
  position: relative;
}
.section > .container > h2::after {
  content: '';
  display: block;
  width: 50px;
  height: 4px;
  background: var(--accent);
  margin-top: 0.5rem;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}
.skill-category h3 {
  margin-bottom: 1rem;
  color: var(--accent);
}
.skill-category ul {
  list-style: none;
}
.skill-category li {
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--border);
}
.skill-category li:last-child {
  border-bottom: none;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
}
.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 6px 20px var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}
.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px var(--shadow);
}
.project-card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}
.project-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 1.25rem 0;
}
.project-images img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.tech-tags span {
  background: rgba(79, 156, 249, 0.15);
  color: var(--accent);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Contact */
.contact-links {
  margin-top: 1.5rem;
}
.contact-links a {
  color: var(--accent);
  text-decoration: none;
  margin-right: 1.5rem;
  font-weight: 600;
}
.contact-links a:hover {
  text-decoration: underline;
}

/* Footer */
.footer {
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.appear {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  .name {
    font-size: 2.2rem;
  }
  .project-images {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
  }
  .project-images img {
    height: 75px;
  }
}

@media (max-width: 480px) {
  .name {
    font-size: 1.8rem;
  }
  .tagline {
    font-size: 1rem;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* WhatsApp Floating Action Button */
.whatsapp-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background: #25D366; /* Color oficial de WhatsApp */
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  z-index: 1000;
  transition: all 0.3s ease, transform 0.2s;
  text-decoration: none;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.whatsapp-fab svg {
  width: 28px;
  height: 28px;
}

.whatsapp-fab:hover {
  transform: scale(1.1) rotate(12deg);
  box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
  background: #128C7E;
}

/* Responsive para móviles pequeños */
@media (max-width: 480px) {
  .whatsapp-fab {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 52px;
    height: 52px;
  }
}

/* === Modal de Imagen - Ventana Emergente Media === */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6); /* menos oscuro */
  backdrop-filter: blur(1px); /* difuminado elegante */
  cursor: pointer;
}

.modal-content {
  position: relative;
  max-width: 85vw;
  max-height: 80vh;
  width: fit-content;
  height: fit-content;
  margin: 4rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
}

.modal-content img {
  max-width: 100%;
  max-height: 75vh;
  width: auto;
  height: auto;
  object-fit: contain; /* ← imagen completa, sin recortar */
  display: block;
  user-select: none; /* evitar selección al arrastrar */
}

/* Responsive: en móviles, un poco más grande */
@media (max-width: 768px) {
  .modal-content {
    max-width: 92vw;
    max-height: 85vh;
    margin: 18rem auto;
  }
  .modal-content img {
    max-height: 80vh;
  }
}
