/* =========================================
   estilos.css - Página personal de César José Hernández Caro
   ========================================= */

/* =========================================
   1. VARIABLES (colores, fuentes, medidas)
   ========================================= */
:root {
  --negro: #0b0a0f;
  --panel: #1a1723;
  --borde: #2e2a3a;
  --texto: #f2eef8;
  --texto-suave: #a9a2b8;
  --rosa: #ff2e88;
  --rosa-claro: #ffc2dc;
  --rosa-oscuro: #b3005e;
  --morado: #8b5cf6;
  --cian: #22d3ee;

  --fuente-graffiti: "Permanent Marker", "Comic Sans MS", cursive;
  --fuente-pixel: "Press Start 2P", "Courier New", monospace;
  --fuente-texto: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ancho: 1100px;
}

/* =========================================
   2. RESET Y BASE
   ========================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  font-family: var(--fuente-texto);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--texto);
  background-color: var(--negro);
  /* Fondo: brillos de color + cuadros (estilo emo) */
  background-image:
    radial-gradient(circle at 15% 10%, rgba(139, 92, 246, 0.18), transparent 40%),
    radial-gradient(circle at 85% 60%, rgba(255, 46, 136, 0.12), transparent 45%),
    repeating-conic-gradient(#110f17 0% 25%, var(--negro) 0% 50%);
  background-size: auto, auto, 48px 48px;
  background-attachment: fixed;
}

::selection {
  background: var(--rosa);
  color: var(--negro);
}

a:focus-visible {
  outline: 3px dashed var(--cian);
  outline-offset: 3px;
}

/* Enlace para saltar al contenido (accesibilidad) */
.saltar {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--rosa);
  color: var(--negro);
  font-weight: 700;
  text-decoration: none;
}

.saltar:focus {
  top: 1rem;
}

/* =========================================
   3. ENCABEZADO Y NAVEGACIÓN
   ========================================= */
.barra {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 10, 15, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--rosa);
}

.barra__contenido {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 0.8rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  font-family: var(--fuente-pixel);
  font-size: 0.9rem;
  letter-spacing: 2px;
  color: var(--texto);
  text-decoration: none;
}

.logo span {
  color: var(--rosa);
}

.menu ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.menu a {
  display: inline-block;
  padding: 0.7rem 0.8rem;
  font-family: var(--fuente-pixel);
  font-size: 0.6rem;
  text-transform: uppercase;
  color: var(--texto);
  text-decoration: none;
  background: var(--panel);
  border: 2px solid var(--borde);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, color 0.15s;
}

.menu a:hover,
.menu a:focus-visible {
  color: var(--rosa);
  border-color: var(--rosa);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--rosa);
}

/* =========================================
   4. PORTADA (HERO)
   ========================================= */
.portada {
  max-width: var(--ancho);
  min-height: calc(100vh - 70px);
  margin: 0 auto;
  padding: 4rem 1.25rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  gap: 2rem;
}

.etiqueta {
  margin-bottom: 1.25rem;
  font-family: var(--fuente-pixel);
  font-size: 0.75rem;
  color: var(--cian);
}

.cursor {
  animation: parpadeo 1s steps(1) infinite;
}

.portada h1 {
  font-family: var(--fuente-graffiti);
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  line-height: 1.05;
  text-shadow: 4px 4px 0 var(--morado);
  transform: rotate(-2deg);
}

.portada h1 span {
  display: block;
  color: var(--rosa);
  text-shadow: 4px 4px 0 var(--negro), 7px 7px 0 var(--morado);
}

.lema {
  margin: 1.75rem 0 2.25rem;
  font-size: 1.15rem;
  color: var(--texto-suave);
}

.lema strong {
  color: var(--texto);
}

.boton {
  display: inline-block;
  padding: 1rem 1.4rem;
  font-family: var(--fuente-pixel);
  font-size: 0.7rem;
  color: var(--negro);
  text-decoration: none;
  background: var(--rosa);
  border: 3px solid var(--texto);
  box-shadow: 6px 6px 0 var(--morado);
  transition: transform 0.15s, box-shadow 0.15s;
}

.boton:hover,
.boton:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 var(--morado);
}

/* ---- Corazón roto en pixel art (hecho solo con box-shadow) ---- */
.pixel-art {
  justify-self: center;
  text-align: center;
}

.corazon {
  position: relative;
  width: 144px;   /* 9 pixeles x 16px */
  height: 128px;  /* 8 pixeles x 16px */
  margin: 0 auto 1.75rem;
  filter: drop-shadow(10px 10px 0 rgba(139, 92, 246, 0.55));
  animation: latido 1.4s ease-in-out infinite;
}

.corazon::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  box-shadow:
    /* fila 0 */
    16px 0 0 var(--rosa), 32px 0 0 var(--rosa), 96px 0 0 var(--rosa), 112px 0 0 var(--rosa),
    /* fila 1 */
    0 16px 0 var(--rosa), 16px 16px 0 var(--rosa-claro), 32px 16px 0 var(--rosa), 48px 16px 0 var(--rosa),
    80px 16px 0 var(--rosa), 96px 16px 0 var(--rosa-claro), 112px 16px 0 var(--rosa), 128px 16px 0 var(--rosa),
    /* fila 2 (grieta en la columna 4) */
    0 32px 0 var(--rosa), 16px 32px 0 var(--rosa-claro), 32px 32px 0 var(--rosa), 48px 32px 0 var(--rosa),
    80px 32px 0 var(--rosa), 96px 32px 0 var(--rosa), 112px 32px 0 var(--rosa), 128px 32px 0 var(--rosa-oscuro),
    /* fila 3 (grieta en la columna 3) */
    0 48px 0 var(--rosa), 16px 48px 0 var(--rosa), 32px 48px 0 var(--rosa), 64px 48px 0 var(--rosa),
    80px 48px 0 var(--rosa), 96px 48px 0 var(--rosa), 112px 48px 0 var(--rosa), 128px 48px 0 var(--rosa-oscuro),
    /* fila 4 (grieta en la columna 4) */
    16px 64px 0 var(--rosa), 32px 64px 0 var(--rosa), 48px 64px 0 var(--rosa),
    80px 64px 0 var(--rosa), 96px 64px 0 var(--rosa), 112px 64px 0 var(--rosa-oscuro),
    /* fila 5 (grieta en la columna 5) */
    32px 80px 0 var(--rosa), 48px 80px 0 var(--rosa), 64px 80px 0 var(--rosa), 96px 80px 0 var(--rosa-oscuro),
    /* fila 6 (grieta en la columna 4) */
    48px 96px 0 var(--rosa), 80px 96px 0 var(--rosa-oscuro),
    /* fila 7 (punta) */
    64px 112px 0 var(--rosa-oscuro);
}

.pixel-art figcaption {
  font-family: var(--fuente-pixel);
  font-size: 0.55rem;
  line-height: 2;
  color: var(--texto-suave);
}

/* =========================================
   5. SECCIONES GENERALES Y TARJETAS
   ========================================= */
.seccion {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 5rem 1.25rem;
}

.seccion__cabecera {
  margin-bottom: 2.5rem;
}

.seccion__num {
  margin-bottom: 0.75rem;
  font-family: var(--fuente-pixel);
  font-size: 0.7rem;
  color: var(--cian);
}

.seccion h2 {
  display: inline-block;
  font-family: var(--fuente-graffiti);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15;
}

.seccion h2::after {
  content: "";
  display: block;
  width: 60%;
  height: 6px;
  margin-top: 0.4rem;
  background: linear-gradient(90deg, var(--rosa), var(--morado));
}

.tarjeta {
  padding: 1.75rem;
  background-color: var(--panel);
  border: 3px solid var(--borde);
  box-shadow: 6px 6px 0 var(--morado);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.tarjeta:hover {
  transform: translate(-3px, -3px);
  border-color: var(--rosa);
  box-shadow: 9px 9px 0 var(--rosa);
}

.tarjeta h3 {
  margin-bottom: 1rem;
  font-family: var(--fuente-pixel);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--rosa);
}

.tarjeta p + p {
  margin-top: 1rem;
}

/* Separador de cuadros blanco y negro (hr) */
.cuadros {
  height: 32px;
  border: 0;
  border-top: 3px solid var(--rosa);
  border-bottom: 3px solid var(--rosa);
  background: repeating-conic-gradient(var(--texto) 0% 25%, var(--negro) 0% 50%) 0 0 / 32px 32px;
  opacity: 0.9;
}

/* Lista con viñetas de pixel */
.lista-pixel {
  list-style: none;
}

.lista-pixel li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.6rem;
}

.lista-pixel li::before {
  content: "";
  position: absolute;
  top: 0.6em;
  left: 0;
  width: 10px;
  height: 10px;
  background: var(--rosa);
  box-shadow: 3px 3px 0 var(--morado);
}

/* =========================================
   6. SOBRE MÍ
   ========================================= */
.sobre-mi__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: start;
}

.bio strong {
  color: var(--rosa);
}

abbr[title] {
  text-decoration: underline dotted var(--cian);
  cursor: help;
}

.ficha__cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ficha__cabecera h3 {
  margin-bottom: 0;
}

.nivel {
  flex-shrink: 0;
  padding: 0.45rem 0.6rem;
  font-family: var(--fuente-pixel);
  font-size: 0.55rem;
  color: var(--negro);
  background: var(--cian);
}

.ficha dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 2px dashed var(--borde);
}

.ficha dl div:last-child {
  border-bottom: 0;
}

.ficha dt {
  font-size: 0.9rem;
  color: var(--texto-suave);
}

.ficha dd {
  font-weight: 700;
  text-align: right;
}

/* =========================================
   7. COMUNIDAD EMO
   ========================================= */
.comunidad__intro {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 3rem;
}

.frase {
  padding: 1.5rem;
  font-family: var(--fuente-graffiti);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.35;
  border-left: 6px solid var(--rosa);
  background: linear-gradient(90deg, rgba(255, 46, 136, 0.14), transparent);
}

.frase span {
  color: var(--rosa);
}

.historia p + p {
  margin-top: 1rem;
}

.historia strong {
  color: var(--rosa);
}

.comunidad__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.para-mi {
  margin-top: 3rem;
  padding: 1.5rem 1.75rem;
  text-align: center;
  font-size: 1.1rem;
  border: 3px dashed var(--morado);
}

/* =========================================
   8. MIS GUSTOS
   ========================================= */
.gustos__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.gusto--juegos {
  grid-column: span 2;
}

.gusto__icono {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 1.25rem;
  font-size: 1.8rem;
  background: var(--negro);
  border: 3px solid var(--rosa);
  box-shadow: 4px 4px 0 var(--morado);
}

/* Videojuegos */
.juegos {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.juegos li {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem;
  background: var(--negro);
  border: 2px solid var(--borde);
  border-top: 5px solid var(--cian);
  transition: transform 0.15s;
}

.juegos li:nth-child(2) { border-top-color: var(--rosa); }
.juegos li:nth-child(3) { border-top-color: var(--morado); }

.juegos li:hover {
  transform: translateY(-4px);
}

.juegos strong {
  font-family: var(--fuente-pixel);
  font-size: 0.62rem;
  line-height: 1.7;
}

.juegos span {
  font-size: 0.92rem;
  color: var(--texto-suave);
}

/* Pixel art: cuadrícula de fondo + paleta de colores */
.gusto--pixel {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 12px 12px;
}

.paleta {
  height: 22px;
  margin-top: 1.5rem;
  border: 2px solid var(--negro);
  background: linear-gradient(90deg,
    var(--rosa) 0 16.66%,
    var(--morado) 16.66% 33.33%,
    var(--cian) 33.33% 50%,
    #facc15 50% 66.66%,
    #4ade80 66.66% 83.33%,
    var(--texto) 83.33% 100%);
}

/* Dibujar: hoja de cuaderno */
.gusto--dibujar {
  background-image: repeating-linear-gradient(
    transparent 0 27px,
    rgba(34, 211, 238, 0.1) 27px 28px
  );
}

/* Graffiti: manchas de aerosol */
.gusto--graffiti {
  background:
    radial-gradient(circle at 85% 18%, rgba(34, 211, 238, 0.35), transparent 70px),
    radial-gradient(circle at 70% 40%, rgba(255, 46, 136, 0.3), transparent 45px),
    radial-gradient(circle at 92% 55%, rgba(139, 92, 246, 0.4), transparent 30px),
    var(--panel);
}

.gusto--graffiti h3 {
  font-family: var(--fuente-graffiti);
  font-size: 2rem;
  line-height: 1.2;
  color: var(--texto);
  text-shadow: 3px 3px 0 var(--rosa), 6px 6px 0 var(--morado);
  transform: rotate(-3deg);
}

/* Música: lista tipo reproductor */
.playlist {
  list-style: none;
  margin-top: 1rem;
}

.playlist li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
  padding: 0.75rem 0.9rem;
  font-weight: 700;
  background: var(--negro);
  border: 2px solid var(--borde);
  transition: border-color 0.15s;
}

.playlist li:hover {
  border-color: var(--rosa);
}

.playlist__num {
  font-family: var(--fuente-pixel);
  font-size: 0.6rem;
  color: var(--cian);
}

.ecualizador {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
  margin-left: auto;
}

.ecualizador span {
  width: 4px;
  background: var(--rosa);
  animation: ecualizar 0.9s ease-in-out infinite alternate;
}

.ecualizador span:nth-child(2) { animation-delay: 0.3s; }
.ecualizador span:nth-child(3) { animation-delay: 0.6s; }

/* =========================================
   9. PIE DE PÁGINA
   ========================================= */
.pie {
  margin-top: 2rem;
  padding: 2.5rem 1.25rem;
  text-align: center;
  background: rgba(11, 10, 15, 0.92);
  border-top: 3px solid var(--rosa);
}

.pie p + p {
  margin-top: 0.6rem;
}

.pie small {
  font-family: var(--fuente-pixel);
  font-size: 0.55rem;
  line-height: 2;
  color: var(--texto-suave);
}

/* =========================================
   10. ANIMACIONES
   ========================================= */
@keyframes parpadeo {
  50% { opacity: 0; }
}

@keyframes latido {
  0%, 100% { transform: scale(1); }
  15%      { transform: scale(1.08); }
  30%      { transform: scale(1); }
  45%      { transform: scale(1.05); }
}

@keyframes ecualizar {
  from { height: 3px; }
  to   { height: 16px; }
}

/* =========================================
   11. RESPONSIVE (tablet y celular)
   ========================================= */
@media (max-width: 900px) {
  .portada {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 3rem;
    text-align: center;
  }

  .pixel-art {
    order: -1;
  }

  .sobre-mi__grid,
  .comunidad__intro {
    grid-template-columns: 1fr;
  }

  .gustos__grid {
    grid-template-columns: 1fr 1fr;
  }

  .gusto--juegos {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .barra__contenido {
    justify-content: center;
  }

  .seccion {
    padding: 3.5rem 1rem;
  }

  .gustos__grid,
  .juegos {
    grid-template-columns: 1fr;
  }

  .tarjeta {
    padding: 1.4rem;
  }

  .portada h1 {
    text-shadow: 3px 3px 0 var(--morado);
  }

  .portada h1 span {
    text-shadow: 3px 3px 0 var(--morado);
  }
}

/* Respeta a quien prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}