  /* =============================== */
  /* IMPORTACIÓN DE FUENTE      */
  /* =============================== */
  
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');
  /* =============================== */
  /* DEFINICIÓN DE PALETA DE COLORES */
  /* =============================== */
  
   :root {
      /* MODO DÍA (Claro y limpio, con acento Amatista) */
      --color-bg: #f4f7f6;
      --color-bg-container: #ffffff;
      --color-bg-card: #ffffff;
      --color-text-primary: #333333;
      --color-text-heading: #1f1d2b;
      --color-text-secondary: #666666;
      --color-accent-primary: #9f5afd;
      --color-accent-primary-text: #ffffff;
      --color-accent-secondary: #f0eefc;
      --color-border: #e0e0e0;
  }
  
  body.dark-mode {
      /* MODO NOCHE (Amatista Creativo) */
      --color-bg: #1f1d2b;
      --color-bg-container: #26233a;
      --color-bg-card: #3a3554;
      --color-text-primary: #c7c3d9;
      --color-text-heading: #f0eefc;
      --color-text-secondary: #a9a5c0;
      --color-accent-primary: #9f5afd;
      --color-accent-primary-text: #1f1d2b;
      --color-accent-secondary: #3a3554;
      --color-border: #3a3554;
  }
  /* =============================== */
  /* ESTILOS GENERALES (Usando Vars) */
  /* =============================== */
  
  html {
      scroll-behavior: smooth;
  }
  
  body {
      font-family: 'Inter', sans-serif;
      margin: 0;
      background-color: var(--color-bg);
      color: var(--color-text-primary);
      line-height: 1.6;
      transition: background-color 0.3s ease, color 0.3s ease;
  }
  
  h1,
  h2,
  h3 {
      color: var(--color-text-heading);
      font-weight: 900;
  }
  
  h2 {
      text-align: center;
      font-size: 2.5em;
      margin-top: 40px;
      margin-bottom: 40px;
  }
  
  a {
      color: var(--color-accent-primary);
      text-decoration: none;
      transition: color 0.3s ease;
  }
  
  a:hover {
      color: var(--color-text-primary);
  }
  
  img {
      max-width: 100%;
      height: auto;
      display: block;
  }
  
  hr {
      border: none;
      border-top: 1px solid var(--color-border);
      margin: 60px 0;
  }
  
  main {
      padding: 20px;
      max-width: 1200px;
      margin: 0 auto;
  }
  
  section {
      padding: 40px 20px;
      margin-bottom: 20px;
      background-color: var(--color-bg-container);
      border-radius: 8px;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
      transition: background-color 0.3s ease;
  }
  /* =============================== */
  /* ENCABEZADO Y NAVEGACIÓN    */
  /* =============================== */
  
  header {
      background-color: var(--color-bg-container);
      padding: 15px 40px;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
      position: sticky;
      top: 0;
      z-index: 1000;
      transition: background-color 0.3s ease;
  }
  
  nav {
      display: flex;
      justify-content: space-between;
      align-items: center;
      max-width: 1200px;
      margin: 0 auto;
  }
  
  nav .logo {
      font-size: 1.5em;
      font-weight: bold;
      color: var(--color-text-heading);
  }
  
  nav .logo:hover {
      color: var(--color-text-heading);
  }
  
  nav ul {
      list-style: none;
      margin: 0;
      padding: 0;
      display: flex;
      align-items: center;
  }
  
  nav ul li {
      margin-left: 30px;
  }
  
  nav ul li a {
      font-weight: 700;
      font-size: 1em;
      color: var(--color-text-primary);
  }
  
  nav ul li a:hover {
      color: var(--color-accent-primary);
  }
  /* =============================== */
  /* SECCIÓN HERO           */
  /* =============================== */
  
  #hero {
      text-align: center;
      padding: 80px 20px;
      background-color: var(--color-bg-container);
  }
  
  #hero h1 {
      font-size: 3.5em;
      margin-bottom: 10px;
  }
  
  #hero p {
      font-size: 1.2em;
      max-width: 600px;
      margin: 0 auto 30px auto;
      color: var(--color-text-secondary);
  }
  
  .cta-button {
      display: inline-block;
      background-color: var(--color-accent-primary);
      color: var(--color-accent-primary-text);
      padding: 12px 25px;
      font-weight: bold;
      border-radius: 5px;
      transition: background-color 0.3s ease, transform 0.3s ease;
  }
  
  .cta-button:hover {
      background-color: var(--color-accent-primary);
      color: var(--color-accent-primary-text);
      transform: translateY(-2px);
      opacity: 0.9;
  }
  /* =============================== */
  /* SECCIÓN PORTAFOLIO       */
  /* =============================== */
  
  .grid-portafolio {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
      gap: 30px;
  }
  
  .proyecto {
      background-color: var(--color-bg-card);
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
      transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  
  .proyecto:hover {
      transform: translateY(-5px);
      box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  }
  /* === ARREGLO DE FOTOS === */
  
  .proyecto img {
      width: 100%;
      height: 250px;
      /* Damos una altura fija a todas las imágenes */
      object-fit: cover;
      /* Esto las recorta para que quepen sin deformarse */
  }
  
  .proyecto h3 {
      margin: 15px;
      font-size: 1.2em;
  }
  
  .proyecto p {
      margin: 0 15px 15px;
      color: var(--color-text-secondary);
  }
  /* =============================== */
  /* SECCIÓN SOBRE MÍ         */
  /* =============================== */
  
  .contenido-sobre-mi {
      display: flex;
      align-items: center;
      gap: 40px;
  }
  
  .contenido-sobre-mi img {
      width: 200px;
      height: 200px;
      border-radius: 50%;
      object-fit: cover;
      border: 5px solid var(--color-accent-secondary);
  }
  
  .contenido-sobre-mi ul {
      list-style: none;
      padding: 0;
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
  }
  
  .contenido-sobre-mi ul li {
      background-color: var(--color-accent-secondary);
      padding: 5px 15px;
      border-radius: 20px;
      font-size: 0.9em;
  }
  /* =============================== */
  /* SECCIÓN CONTACTO         */
  /* =============================== */
  
  #contacto {
      text-align: center;
  }
  
  form {
      max-width: 600px;
      margin: 30px auto 0 auto;
      text-align: left;
  }
  
  form label {
      display: block;
      margin-bottom: 5px;
      font-weight: bold;
  }
  
  form input,
  form textarea {
      width: 100%;
      padding: 12px;
      margin-bottom: 20px;
      border-radius: 5px;
      border: 1px solid var(--color-border);
      font-family: 'Inter', sans-serif;
      font-size: 1em;
      box-sizing: border-box;
      background-color: var(--color-bg);
      color: var(--color-text-primary);
  }
  
  form button {
      display: block;
      width: 100%;
      padding: 15px;
      background-color: var(--color-accent-primary);
      color: var(--color-accent-primary-text);
      border: none;
      border-radius: 5px;
      font-size: 1.1em;
      font-weight: bold;
      cursor: pointer;
      transition: background-color 0.3s ease;
  }
  
  form button:hover {
      opacity: 0.9;
  }
  /* =============================== */
  /* PIE DE PÁGINA          */
  /* =============================== */
  
  footer {
      text-align: center;
      padding: 40px 20px;
      background-color: var(--color-bg-container);
      color: var(--color-text-secondary);
      transition: background-color 0.3s ease;
  }
  
  footer p {
      margin: 5px 0;
  }
  
  footer a {
      color: var(--color-accent-primary);
      font-weight: bold;
  }
  
  footer a:hover {
      text-decoration: underline;
  }
  /* =============================== */
  /* DISEÑO RESPONSIVO (Media Query) */
  /* =============================== */
  
  @media (max-width: 768px) {
      nav {
          flex-direction: column;
          gap: 15px;
      }
      .contenido-sobre-mi {
          flex-direction: column;
          text-align: center;
      }
  }
  /* =============================== */
  /* ESTILOS MENÚ HAMBURGUESA  */
  /* =============================== */
  
  .menu-hamburguesa {
      display: none;
      border: none;
      background: none;
      cursor: pointer;
      padding: 10px;
      z-index: 1001;
  }
  
  .menu-hamburguesa .linea {
      display: block;
      width: 25px;
      height: 3px;
      margin: 5px 0;
      background-color: var(--color-text-heading);
      transition: transform 0.3s ease, opacity 0.3s ease;
  }
  
  @media (max-width: 768px) {
      nav ul {
          flex-direction: column;
          justify-content: center;
          align-items: center;
          position: fixed;
          top: 0;
          right: 0;
          width: 100%;
          height: 100vh;
          background-color: var(--color-bg-container);
          transform: translateX(100%);
          transition: transform 0.3s ease-in-out;
          padding: 0;
          margin: 0;
      }
      nav ul.active {
          transform: translateX(0);
      }
      nav ul li {
          margin: 20px 0;
      }
      nav ul li a {
          font-size: 1.8em;
      }
      .menu-hamburguesa {
          display: block;
      }
      .menu-hamburguesa.active .linea:nth-child(1) {
          transform: translateY(8px) rotate(45deg);
      }
      .menu-hamburguesa.active .linea:nth-child(2) {
          opacity: 0;
      }
      .menu-hamburguesa.active .linea:nth-child(3) {
          transform: translateY(-8px) rotate(-45deg);
      }
  }
  /* =============================== */
  /* ESTILOS SWITCH MODO NOCHE  */
  /* =============================== */
  
  .switch-modo {
      position: relative;
      display: inline-block;
      width: 60px;
      height: 34px;
      margin-left: 20px;
  }
  
  .switch-modo input {
      opacity: 0;
      width: 0;
      height: 0;
  }
  
  .slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: var(--color-border);
      transition: .4s;
      border-radius: 34px;
  }
  
  .slider::before {
      position: absolute;
      content: "";
      height: 26px;
      width: 26px;
      left: 4px;
      bottom: 4px;
      background-color: white;
      transition: .4s;
      border-radius: 50%;
  }
  
  input:checked+.slider {
      background-color: var(--color-accent-primary);
  }
  
  input:checked+.slider::before {
      transform: translateX(26px);
  }
  
  @media (max-width: 768px) {
      .item-modo-noche {
          margin: 20px 0;
      }
      .switch-modo {
          margin-left: 0;
      }
  }
  /* =============================== */
  /* ESTILOS PRE-LOADER          */
  /* =============================== */
  
  #preloader {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100vh;
      background-color: var(--color-bg);
      z-index: 9999;
      display: flex;
      justify-content: center;
      align-items: center;
      transition: opacity 0.5s ease;
  }
  
  .spinner {
      width: 50px;
      height: 50px;
      border: 5px solid var(--color-border);
      border-top-color: var(--color-accent-primary);
      border-radius: 50%;
      animation: spin 1s ease-in-out infinite;
  }
  
  @keyframes spin {
      to {
          transform: rotate(360deg);
      }
  }
  /* =============================== */
  /* ESTILOS MODAL (LIGHTBOX) - V2   */
  /* =============================== */
  /* 1. El fondo oscuro que cubre toda la pantalla */
  
  .modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      /* Ocupa toda la altura */
      background: rgba(0, 0, 0, 0.85);
      /* Fondo muy oscuro (85%) */
      z-index: 2000;
      /* Por encima de TODO (incluso el header) */
      /* Centramos el contenido */
      display: flex;
      justify-content: center;
      align-items: center;
      /* Estado inicial: Invisible */
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      /* No se puede clicar si está oculto */
      transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  /* 2. Estado Visible (activado por JS) */
  
  .modal-overlay.visible {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
  }
  /* 3. La caja blanca que contiene la info */
  
  .modal-content {
      background-color: var(--color-bg-container);
      padding: 30px;
      border-radius: 10px;
      position: relative;
      /* TAMAÑO: Aquí está el truco para que se expanda */
      max-width: 90%;
      /* Ocupa hasta el 90% del ancho de la pantalla */
      max-height: 90vh;
      /* Ocupa hasta el 90% de la altura */
      width: auto;
      /* Se ajusta al contenido */
      overflow-y: auto;
      /* Si el texto es muy largo, permite scroll dentro de la caja */
      /* Animación de entrada (Zoom in) */
      transform: scale(0.8);
      transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      /* Efecto rebote suave */
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
  /* Animación cuando se hace visible */
  
  .modal-overlay.visible .modal-content {
      transform: scale(1);
  }
  /* 4. La Imagen dentro del modal */
  
  .modal-content img {
      display: block;
      width: 100%;
      height: auto;
      max-height: 60vh;
      /* Limita la altura de la imagen para dejar espacio al texto */
      object-fit: contain;
      /* Asegura que la imagen se vea completa */
      margin: 0 auto 20px auto;
      border-radius: 5px;
  }
  /* 5. Botón de Cerrar (X) */
  
  .modal-close {
      position: absolute;
      top: 15px;
      right: 20px;
      font-size: 2rem;
      line-height: 1;
      color: var(--color-text-secondary);
      cursor: pointer;
      transition: color 0.3s ease, transform 0.3s ease;
  }
  
  .modal-close:hover {
      color: var(--color-accent-primary);
      transform: rotate(90deg);
      /* Pequeño giro al pasar el mouse */
  }
  /* 6. Textos del Modal */
  
  .modal-content h3 {
      margin-top: 0;
      margin-bottom: 10px;
      font-size: 1.8em;
      color: var(--color-text-heading);
      text-align: center;
  }
  
  .modal-content p {
      color: var(--color-text-secondary);
      text-align: center;
      font-size: 1.1em;
      max-width: 600px;
      /* Evita que las líneas de texto sean eternas */
      margin: 0 auto;
  }
  /* IMPORTANTE: Asegúrate de que tus proyectos tengan el cursor de mano */
  
  .proyecto {
      cursor: pointer;
  }