/* PALETA */
:root {
  --fondo-principal: #10152b;
  --acento-rojo: #bf092f;
  --acento-celeste: #74e0ff;
  --texto-claro: #f5f5f5;
  --texto-suave: #cdd7e0;
  --marino: #162040;
  --borde-retro: #aa1636;
  --verde-retro: #2d5016;
  --verde-claro: #4a7c2c;
}

html {
  scroll-behavior: smooth;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-color: cadetblue gainsboro;
  overscroll-behavior: none;
}

body {
  background-image: url("../imagenes/toborochi.webp");
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  color: var(--texto-claro);
  font-family: "Montserrat", "Courier New", Courier, monospace;
  line-height: 1.7;
  overflow-x: hidden;
  /* Color de respaldo mientras carga */
  background-color: #10152b;
}

/* gradiente si el fondo tarda mucho */
body.fast-mode {
  background-image: none;
  background: linear-gradient(
    135deg,
    #0a0f23 0%,
    #162040 25%,
    #10152b 50%,
    #162040 75%,
    #0a0f23 100%
  );
}

/* CONTENEDOR PRINCIPAL */
.sitecanvas {
  max-width: 1720px;
  margin: 0 auto;
  box-shadow: 0 3px 3px 0 #32311933, 0 3px 6px 0 #32311933;
  background-color: rgba(255, 255, 255, 75%);
}

/* HEADER LOGO */
.site-header {
  padding: 40px 20px;
  margin: 0;
  text-align: center;
}

.logo {
  font-family: "VT323", "Courier New", monospace;
  font-size: 110px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 10px;
  color: #e8e8e8;
  margin: 0;
  text-align: center;
  line-height: 0.85;
  text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.9),
    -1px -1px 0px rgba(255, 255, 255, 0.1), 0 0 20px rgba(116, 224, 255, 0.3);
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

.logo-line {
  display: block;
}

/* LAYOUT PRINCIPAL CON SIDEBAR */
.main-layout {
  display: flex;
  gap: 0;
  min-height: 500px;
}

/* SIDEBAR / MENÚ LATERAL */
.sidebar {
  width: 200px;
  background: linear-gradient(
    180deg,
    var(--borde-retro) 0%,
    var(--acento-rojo) 100%
  );
  border-right: 3px solid var(--marino);
  padding: 20px 0;
  position: relative;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin: 0;
  border-bottom: 2px dotted rgba(88, 44, 124, 0.3);
}

.sidebar-link {
  display: block;
  padding: 20px 22px;
  color: #eed9d9;
  text-decoration: none;
  font-family: "Courier New", monospace;
  font-size: 20px;
  font-weight: 600;
  text-transform: lowercase;
  line-height: 1.3;
  transition: all 0.3s ease;
  background: rgba(0, 0, 0, 0.2);
  border-left: 4px solid transparent;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.sidebar-link:hover {
  background: rgba(56, 44, 124, 0.3);
  color: #a7caff;
  border-left: 4px solid #ff4e83;
  padding-left: 25px;
  text-shadow: 0 0 8px rgba(255, 137, 230, 0.6);
}

.sidebar-link.active {
  background: rgba(189, 48, 107, 0.5);
  color: #fff;
  border-left: 4px solid #d08495;
  font-weight: 700;
}

.sidebar-decoration {
  margin-top: 30px;
  padding: 0 20px;
}

.pixel-border {
  height: 60px;
  background: repeating-linear-gradient(
    0deg,
    #2d5016,
    #2d5016 2px,
    transparent 2px,
    transparent 4px
  );
  opacity: 0.3;
}

/* CONTENIDO PRINCIPAL */
.caja-contenido {
  flex: 1;
  padding: 2rem;
  background: rgba(255, 255, 255, 0);
  backdrop-filter: blur(5px);
}

/* INTRO */
.intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 4rem;
}

.intro-texto h1 {
  letter-spacing: 20px;
  font-family: "VT323", "Courier New", monospace;
  font-size: 120px;
  color: var(--acento-rojo);
  text-shadow: 0 0 10px pink;
  margin-bottom: 20;
}

.intro-texto p {
  font-family: monospace;
  color: var(--marino);
  font-size: 25px;
  margin-bottom: 1.5rem;
  text-align: justify;
}

.intro-texto h1,
p {
  padding: 10px;
  margin: 40px;
}

/* animaciones */
@keyframes autoRun3d {
  from {
    transform: perspective(900px) rotateY(-360deg);
  }
  to {
    transform: perspective(900px) rotateY(0deg);
  }
}

@keyframes animateBrightness {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(0.4);
  }
}

/* FOTO PRINCIPAL */
.caja-imagen {
  text-align: center;
}

.foto-principal {
  width: 80%;
  border-radius: 50%;
  object-fit: cover;
}

/* SECCIÓN DESTACADOS */
.titulo-seccion {
  font-family: "VT323", "Courier New", monospace;
  text-align: center;
  font-size: 70px;
  letter-spacing: 50px;
  color: var(--acento-rojo);
  text-shadow: 0 0 10px rgba(191, 9, 47, 0.5);
  margin-bottom: 2rem;
}

/* TARJETAS */
.tarjetas-contenedor {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  padding: 2rem 0;
}

.card {
  position: relative;
  width: 300px;
  height: 200px;
  background: linear-gradient(
    -45deg,
    var(--acento-celeste),
    var(--acento-rojo)
  );
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  cursor: pointer;
}

.card svg {
  width: 48px;
  fill: #333;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.card__content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  width: 100%;
  height: 100%;
  padding: 20px;
  box-sizing: border-box;
  background-color: #fff;
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.card:hover {
  transform: rotate(-5deg) scale(1.1);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.card:hover .card__content {
  transform: translate(-50%, -50%) rotate(0deg);
  opacity: 1;
}

.card__title {
  margin: 0;
  font-size: 1.3rem;
  color: #333;
  font-weight: 700;
}

.card__description {
  margin: 10px 0 0;
  font-size: 0.95rem;
  color: #555;
  line-height: 1.4;
}

.card:hover svg {
  transform: rotate(-45deg) scale(0);
}

/* FOOTER */
.site-footer {
  text-align: center;
  background: linear-gradient(90deg, #0a0f23, #111a3b);
  padding: 1.5rem;
  font-size: 0.9rem;
  color: var(--texto-suave);
  border-top: 1px solid var(--acento-celeste);
}

.creditos {
  font-size: 0.8rem;
  color: var(--acento-rojo);
  margin-top: 0.5rem;
}

/* ============================
   SECCIÓN SOBRE MÍ
============================ */
.sobre-mi {
  color: #000;
  padding: 3rem 2rem;
  border-top: 3px solid var(--acento-rojo);
  border-bottom: 3px solid var(--acento-rojo);
  scroll-margin-top: 100px;
}

.sobre-mi-contenido {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
}

.perfil-texto p,
.lista-curiosidades {
  font-family: monospace;
  line-height: 1.8;
  margin-bottom: 1rem;
  font-size: 25px;
  color: #111;
}

.foto-sobre-mi {
  width: 100%;
  max-width: 300px;
  border-radius: 50%;
  display: block;
  margin: 0 auto;
  border: 3px solid var(--acento-rojo);
  box-shadow: 0 0 20px rgba(255, 0, 85, 0.4);
}

/* ============================
   GALERÍA DE DIBUJOS
============================ */
body.pagina-dibujos {
  background-image: url("../imagenes/fondo-dibujos.png");
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
}

.galeria-dibujos {
  padding: 3rem 2rem;
  color: #111;
}

.grid-dibujos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  max-width: 1100px;
  margin: 0 auto;
  justify-items: center;
  align-items: center;
}

/* Variaciones de tamaño para romper la simetría */
.item.grande {
  grid-row: span 2;
  grid-column: span 2;
}

.item.ancho {
  grid-column: span 2;
}

.item.alto {
  grid-row: span 2;
}

/* Estilo visual */
.grid-dibujos img {
  display: block;
  width: 100%;
  height: auto; /* Evita el estiramiento */
  object-fit: contain; /* Mantiene la proporción original */
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: high-quality;
  -ms-interpolation-mode: bicubic;
  backface-visibility: hidden; /* Evita pixelado al animar */
  transform: translateZ(0); /* Activa renderizado por GPU */
}

.grid-dibujos img:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px var(--acento-celeste);
  cursor: pointer;
}

.boton-volver {
  display: inline-block;
  margin-top: 2rem;
  padding: 10px 20px;
  background: var(--acento-rojo);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-family: "VT323", monospace;
  font-size: 22px;
}

.boton-volver:hover {
  background: var(--acento-celeste);
  color: #000;
}

/* ============================
   GALERÍA DE FOTOGRAFÍAS
============================ */
.galeria-fotos {
  text-align: center;
}

.grid-fotos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding: 2rem;
}

.foto-frame {
  position: relative;
  background: rgba(255, 255, 255, 0.8);
  border: 3px dashed var(--verde-retro);
  padding: 10px;
  transform: rotate(calc(var(--r, 0) * 1deg));
  transition: transform 0.3s ease;
  box-shadow: 0 0 15px rgba(45, 80, 22, 0.3);
}

.foto-frame:nth-child(odd) {
  --r: -2;
}
.foto-frame:nth-child(even) {
  --r: 2;
}

.foto-frame:hover {
  transform: scale(1.05) rotate(0deg);
}

.foto-frame img {
  width: 100%;
  display: block;
  border: 2px solid var(--marino);
  border-radius: 4px;
}

/* Quitar efecto pixelado en imágenes de las galerías */
.foto-principal,
.foto-sobre-mi,
.grid-dibujos img,
.item.alto,
.item.ancho,
.item.grande,
.item .grid-dibujos,
.grid-fotos img,
.foto-frame img,
img {
  image-rendering: auto !important;
  image-rendering: -webkit-optimize-contrast !important;
  -ms-interpolation-mode: bicubic !important;
}

/* ============================
   PÁGINA DE CONTACTO
============================ */
.contacto-seccion {
  color: #111;
  padding: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.contacto-intro {
  text-align: center;
  font-family: monospace;
  font-size: 20px;
  color: var(--marino);
  margin-bottom: 3rem;
  line-height: 1.8;
}

.formulario-contenedor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

/* FORMULARIO */
.formulario-contacto {
  background: rgba(255, 255, 255, 0.9);
  padding: 2.5rem;
  border-radius: 10px;
  border: 3px solid var(--acento-rojo);
  box-shadow: 0 0 30px rgba(191, 9, 47, 0.2);
}

.form-grupo {
  margin-bottom: 1.8rem;
}

.form-grupo label {
  display: block;
  font-family: "VT323", monospace;
  font-size: 28px;
  color: var(--acento-rojo);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.form-grupo input,
.form-grupo select,
.form-grupo textarea {
  width: 100%;
  padding: 12px 15px;
  font-family: "Courier New", monospace;
  font-size: 16px;
  border: 2px solid var(--marino);
  border-radius: 5px;
  background: #fff;
  color: #111;
  transition: all 0.3s ease;
}

.form-grupo input:focus,
.form-grupo select:focus,
.form-grupo textarea:focus {
  outline: none;
  border-color: var(--acento-celeste);
  box-shadow: 0 0 10px rgba(116, 224, 255, 0.4);
}

.form-grupo textarea {
  resize: vertical;
  min-height: 120px;
}

/* BOTÓN ENVIAR */
.boton-enviar {
  width: 100%;
  padding: 15px;
  font-family: "VT323", monospace;
  font-size: 30px;
  font-weight: bold;
  text-transform: uppercase;
  color: white;
  background: linear-gradient(135deg, var(--acento-rojo), var(--borde-retro));
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 3px;
  box-shadow: 0 4px 15px rgba(191, 9, 47, 0.3);
}

.boton-enviar:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(191, 9, 47, 0.5);
  background: linear-gradient(135deg, var(--borde-retro), var(--acento-rojo));
}

.boton-enviar:active {
  transform: translateY(0);
}

/* MENSAJE DE ÉXITO */
.mensaje-exito {
  display: none;
  margin-top: 1.5rem;
  padding: 15px;
  background: var(--verde-claro);
  color: white;
  border-radius: 5px;
  text-align: center;
  font-family: "Courier New", monospace;
  font-size: 16px;
  border: 2px solid var(--verde-retro);
  animation: slideIn 0.5s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* INFO ADICIONAL */
.info-adicional {
  background: rgba(255, 255, 255, 0.85);
  padding: 2rem;
  border-radius: 10px;
  border: 3px solid var(--acento-celeste);
  box-shadow: 0 0 20px rgba(116, 224, 255, 0.2);
}

.info-adicional h3 {
  font-family: "VT323", monospace;
  font-size: 35px;
  color: var(--acento-rojo);
  text-align: center;
  margin-bottom: 1.5rem;
  letter-spacing: 3px;
}

.redes-contacto {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.enlace-contacto {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 20px;
  background: rgba(22, 32, 64, 0.05);
  border: 2px solid var(--marino);
  border-radius: 8px;
  text-decoration: none;
  color: var(--marino);
  font-family: "Courier New", monospace;
  font-size: 16px;
  transition: all 0.3s ease;
}

.enlace-contacto:hover {
  background: var(--acento-celeste);
  color: white;
  border-color: var(--acento-celeste);
  transform: translateX(5px);
}

.enlace-contacto .icono {
  font-size: 24px;
  min-width: 30px;
  text-align: center;
}

/* ============================
   PÁGINA DE PROYECTOS - DISEÑO HORIZONTAL
============================ */

.proyectos-seccion {
  padding: 2rem;
  color: #111;
}

.intro-proyectos {
  text-align: center;
  font-family: monospace;
  font-size: 29px;
  color: var(--marino);
  margin-bottom: 3rem;
  line-height: 1.8;
}

/* GRID DE PROYECTOS */
.proyectos-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 0;
}

/* TARJETA DE PROYECTO - HORIZONTAL */
.proyecto-card {
  display: grid;
  grid-template-columns: 350px 1fr;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.12);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  border: 3px solid transparent;
  min-height: 250px;
}

.proyecto-card:hover {
  transform: translateX(8px);
  box-shadow: 0 8px 35px rgba(191, 9, 47, 0.25);
  border-color: var(--acento-celeste);
}

/* Alternar lado de imagen */
.proyecto-card:nth-child(even) {
  grid-template-columns: 1fr 350px;
  direction: rtl;
}

.proyecto-card:nth-child(even) > * {
  direction: ltr;
}

/* IMAGEN DEL PROYECTO */
.proyecto-imagen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--marino), var(--acento-rojo));
}

.proyecto-imagen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.proyecto-card:hover .proyecto-imagen img {
  transform: scale(1.15);
}

/* OVERLAY CON CATEGORÍA */
.proyecto-overlay {
  position: absolute;
  top: 20px;
  left: 20px;
}

.proyecto-categoria {
  background: rgba(191, 9, 47, 0.95);
  color: white;
  padding: 8px 16px;
  border-radius: 25px;
  font-family: "Courier New", monospace;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
}

/* INFORMACIÓN DEL PROYECTO */
.proyecto-info {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
}

.proyecto-titulo {
  font-family: "VT323", monospace;
  font-size: 32px;
  color: var(--acento-rojo);
  margin: 0;
  line-height: 1.2;
  letter-spacing: 1px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
}

.proyecto-descripcion {
  font-family: "Courier New", monospace;
  font-size: 25px;
  color: #555;
  line-height: 1.7;
  margin: 0;
}

/* TAGS/ETIQUETAS */
.proyecto-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0.5rem 0;
}

.tag {
  background: linear-gradient(
    135deg,
    rgba(22, 32, 64, 0.08),
    rgba(22, 32, 64, 0.12)
  );
  color: var(--marino);
  padding: 6px 14px;
  border-radius: 18px;
  font-family: "Courier New", monospace;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid rgba(22, 32, 64, 0.2);
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag:hover {
  background: var(--acento-celeste);
  color: white;
  border-color: var(--acento-celeste);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 4px 12px rgba(116, 224, 255, 0.4);
}

/* ENLACES/BOTONES */
.proyecto-links {
  display: flex;
  gap: 12px;
  margin-top: 0.8rem;
}

.btn-proyecto {
  position: relative;
  padding: 12px 24px;
  text-align: center;
  text-decoration: none;
  font-family: "VT323", monospace;
  font-size: 22px;
  font-weight: 700;
  border-radius: 8px;
  transition: all 0.3s ease;
  border: 3px solid;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  overflow: hidden;
  cursor: pointer;
}

.btn-proyecto::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.btn-proyecto:hover::before {
  left: 100%;
}

/* Botón Ver Demo/Página */
.btn-demo {
  background: linear-gradient(135deg, var(--acento-rojo), var(--borde-retro));
  color: white;
  border-color: var(--acento-rojo);
  box-shadow: 0 4px 15px rgba(191, 9, 47, 0.3);
  flex: 1;
}

.btn-demo:hover {
  background: linear-gradient(135deg, var(--borde-retro), #d01040);
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(191, 9, 47, 0.5);
}

.btn-demo:active {
  transform: translateY(-1px);
}

/* Botón Ver Código */
.btn-codigo {
  background: transparent;
  color: var(--marino);
  border-color: var(--marino);
  flex: 0.8;
}

.btn-codigo:hover {
  background: var(--acento-celeste);
  color: white;
  border-color: var(--acento-celeste);
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(116, 224, 255, 0.4);
}

.btn-codigo:active {
  transform: translateY(-1px);
}

/* Efecto de onda al hacer clic */
.btn-proyecto:active {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    box-shadow: 0 0 0 0 rgba(191, 9, 47, 0.7);
  }
  100% {
    box-shadow: 0 0 0 15px rgba(191, 9, 47, 0);
  }
}

/* Variaciones de colores para categorías */
.proyecto-card:nth-child(1) .proyecto-categoria {
  background: linear-gradient(135deg, #bf092f, #d01040);
}

.proyecto-card:nth-child(2) .proyecto-categoria {
  background: linear-gradient(135deg, #74e0ff, #5ac8e8);
}

.proyecto-card:nth-child(3) .proyecto-categoria {
  background: linear-gradient(135deg, #4a7c2c, #5a9c3c);
}

.proyecto-card:nth-child(4) .proyecto-categoria {
  background: linear-gradient(135deg, #162040, #1e2d5a);
}

.proyecto-card:nth-child(5) .proyecto-categoria {
  background: linear-gradient(135deg, #aa1636, #c01846);
}

.proyecto-card:nth-child(6) .proyecto-categoria {
  background: linear-gradient(
    135deg,
    var(--acento-rojo),
    var(--acento-celeste)
  );
}

/* hover tarjetas */
.proyecto-card::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    transparent 40%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 60%,
    transparent
  );
  transform: rotate(45deg);
  transition: all 0.6s;
  opacity: 0;
}

.proyecto-card:hover::after {
  opacity: 1;
  left: 100%;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .proyecto-card {
    grid-template-columns: 1fr !important;
    direction: ltr !important;
  }

  .proyecto-card:nth-child(even) {
    grid-template-columns: 1fr !important;
    direction: ltr !important;
  }

  .proyecto-imagen {
    height: 250px;
  }

  .proyecto-info {
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .proyectos-grid {
    gap: 1.5rem;
    padding: 0.5rem;
  }

  .proyecto-card:hover {
    transform: translateY(-5px);
  }

  .proyecto-imagen {
    height: 220px;
  }

  .proyecto-titulo {
    font-size: 26px;
  }

  .intro-proyectos {
    font-size: 18px;
    padding: 0 1rem;
  }

  .proyecto-links {
    flex-direction: column;
  }

  .btn-proyecto {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .proyectos-seccion {
    padding: 1rem;
  }

  .proyecto-info {
    padding: 1rem;
  }

  .proyecto-titulo {
    font-size: 24px;
  }

  .proyecto-descripcion {
    font-size: 14px;
  }

  .btn-proyecto {
    font-size: 20px;
    padding: 10px 18px;
  }

  .proyecto-categoria {
    font-size: 11px;
    padding: 6px 12px;
  }

  .proyecto-imagen {
    height: 200px;
  }
}

/* Animación de entrada para las tarjetas */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.proyecto-card {
  animation: fadeInUp 0.6s ease-out;
  animation-fill-mode: both;
}

.proyecto-card:nth-child(1) {
  animation-delay: 0.1s;
}
.proyecto-card:nth-child(2) {
  animation-delay: 0.2s;
}
.proyecto-card:nth-child(3) {
  animation-delay: 0.3s;
}
.proyecto-card:nth-child(4) {
  animation-delay: 0.4s;
}
.proyecto-card:nth-child(5) {
  animation-delay: 0.5s;
}
.proyecto-card:nth-child(6) {
  animation-delay: 0.6s;
}
/* RESPONSIVE DESING*/

/* Scroll horizontal suave para el menú */
.sidebar-nav ul {
  scroll-behavior: smooth;
}

.sidebar-nav ul::-webkit-scrollbar {
  height: 4px;
}

.sidebar-nav ul::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

.sidebar-nav ul::-webkit-scrollbar-thumb {
  background: var(--acento-celeste);
  border-radius: 10px;
}

.sidebar-nav ul::-webkit-scrollbar-thumb:hover {
  background: var(--acento-rojo);
}

/* TABLETS Y MÓVILES */
@media screen and (max-width: 768px) {
  /* Header más pequeño */
  .site-header {
    padding: 20px 10px;
  }

  .logo {
    font-size: 50px;
    letter-spacing: 5px;
  }

  /* Layout en columna */
  .main-layout {
    flex-direction: column;
  }

  /* Sidebar horizontal */
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 3px solid var(--marino);
    padding: 0;
  }

  .sidebar-nav ul {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .sidebar-nav li {
    flex-shrink: 0;
    border-bottom: none;
    border-right: 2px dotted rgba(88, 44, 124, 0.3);
  }

  .sidebar-nav li:last-child {
    border-right: none;
  }

  .sidebar-link {
    font-size: 16px;
    padding: 15px 20px;
    text-align: center;
    min-width: 100px;
  }

  .sidebar-link:hover {
    padding-left: 20px;
  }

  .sidebar-decoration {
    display: none;
  }

  /* Contenido */
  .caja-contenido {
    padding: 1.5rem;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .intro-texto h1 {
    font-size: 60px;
    letter-spacing: 10px;
    text-align: center;
  }

  .intro-texto p {
    font-size: 18px;
    text-align: left;
    margin: 20px;
    padding: 5px;
  }

  .foto-principal {
    width: 60%;
  }

  /* Sección Sobre Mí */
  .sobre-mi {
    padding: 2rem 1rem;
  }

  .sobre-mi-contenido {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .perfil-texto p,
  .lista-curiosidades {
    font-size: 18px;
  }

  .foto-sobre-mi {
    margin-top: 1rem;
    max-width: 250px;
  }

  /* Título sección */
  .titulo-seccion {
    font-size: 45px;
    letter-spacing: 20px;
  }

  /* Tarjetas */
  .tarjetas-contenedor {
    gap: 1.5rem;
    padding: 1rem 0;
  }

  .card {
    width: 100%;
    max-width: 320px;
  }

  /* Galerías */

  .grid-dibujos img {
    width: 100%;
    height: auto; /* 🔹 antes tenía height: 100% */
    object-fit: contain; /* 🔹 mostrará toda la imagen sin deformarla */
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    image-rendering: auto;
    image-rendering: -webkit-optimize-contrast;
    -ms-interpolation-mode: bicubic;
  }

  .item.grande,
  .item.ancho,
  .item.alto {
    grid-column: span 1;
    grid-row: span 1;
  }

  .grid-fotos {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }

  /* Contacto */
  .contacto-intro {
    font-size: 18px;
  }

  .formulario-contacto {
    padding: 1.5rem;
  }

  .form-grupo label {
    font-size: 24px;
  }

  .boton-enviar {
    font-size: 24px;
  }

  .info-adicional {
    padding: 1.5rem;
  }

  .info-adicional h3 {
    font-size: 28px;
  }
}

/* MÓVILES PEQUEÑOS */
@media screen and (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .site-header {
    padding: 15px 10px;
  }

  .logo {
    font-size: 35px;
    letter-spacing: 3px;
  }

  .sidebar-link {
    font-size: 14px;
    padding: 12px 15px;
    min-width: 90px;
  }

  .caja-contenido {
    padding: 1rem;
  }

  .intro-texto h1 {
    font-size: 45px;
    letter-spacing: 5px;
  }

  .intro-texto p {
    font-size: 16px;
    margin: 15px;
  }

  .titulo-seccion {
    font-size: 35px;
    letter-spacing: 10px;
  }

  .card {
    width: 100%;
    max-width: 280px;
    height: 180px;
  }

  .perfil-texto p,
  .lista-curiosidades {
    font-size: 16px;
  }

  .foto-sobre-mi {
    max-width: 200px;
  }

  /* Galerías más pequeñas */
  .grid-dibujos {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 150px;
    gap: 10px;
  }

  .grid-fotos {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* Contacto */
  .contacto-intro {
    font-size: 16px;
  }

  .formulario-contacto {
    padding: 1rem;
  }

  .form-grupo label {
    font-size: 22px;
  }

  .form-grupo input,
  .form-grupo select,
  .form-grupo textarea {
    font-size: 14px;
    padding: 10px;
  }

  .boton-enviar {
    font-size: 24px;
    padding: 12px;
  }

  .enlace-contacto {
    font-size: 13px;
    padding: 10px 12px;
  }

  .info-adicional h3 {
    font-size: 24px;
  }

  /* Botón volver */
  .boton-volver {
    font-size: 18px;
    padding: 8px 15px;
  }

  /* Footer */
  .site-footer {
    padding: 1rem;
    font-size: 0.8rem;
  }
}

/* TABLETS MEDIANAS */
@media screen and (min-width: 481px) and (max-width: 768px) {
  .intro-texto h1 {
    font-size: 70px;
  }

  .titulo-seccion {
    font-size: 50px;
    letter-spacing: 30px;
  }

  .card {
    max-width: 250px;
  }

  .grid-dibujos {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    grid-auto-rows: 200px;
  }
}

img {
  image-rendering: -webkit-optimize-contrast !important;
  -ms-interpolation-mode: bicubic !important;
  transform: translateZ(0);
}
