/* ===== Colores y tipografía (cámbialos aquí) ===== */
:root {
  --papel: #fbf8f3;
  --tinta: #161616;
  --tinta-suave: #4a4a4a;   /* contraste 8:1 sobre --papel */
  /* Colores sacados de la ilustración de la portada.
     Se usan SOLO de fondo, con texto --tinta encima (rojo 5,6:1; amarillo 12,7:1). */
  --acento: #F35F36;        /* rojo de las mejillas */
  --resalte: #FDD500;       /* amarillo del pelo */
  --linea: #e4ded3;
  --ancho: 72rem;
  /* Helvetica (Mac/iPhone/iPad); Arial en Windows y Android */
  --fuente: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--fuente);
  font-size: 1.125rem;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--tinta); text-underline-offset: 0.2em;
  text-decoration-color: var(--acento); text-decoration-thickness: 2px;
}
a:hover { text-decoration-thickness: 3px; }

:focus-visible {
  outline: 3px solid var(--tinta);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Enlace para saltar al contenido (visible al tabular) */
.saltar {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--tinta); color: #fff;
  padding: 0.6rem 1rem; z-index: 100; text-decoration: none;
}
.saltar:focus { top: 1rem; }

/* ===== Cabecera ===== */
.cabecera {
  position: relative; z-index: 10;
  display: flex; flex-wrap: wrap; gap: 0.5rem 2rem;
  justify-content: space-between; align-items: center;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--papel) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linea);
}
/* En pantallas anchas la cabecera se queda fija arriba */
@media (min-width: 40rem) { .cabecera { position: sticky; top: 0; } }
.logo {
  font-weight: 800; font-size: 1.25rem; letter-spacing: -0.01em;
  color: var(--tinta); text-decoration: none;
}
.cabecera ul { display: flex; gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.cabecera nav a { color: var(--tinta); text-decoration: none; font-weight: 500; }
.cabecera nav a:hover { text-decoration: underline; }

/* ===== Secciones ===== */
main > section { padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 3rem); }
main > section > * { max-width: var(--ancho); margin-inline: auto; }

.titulo-seccion {
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 800;
  letter-spacing: -0.02em; margin-bottom: 2rem;
}

/* Portada */
.portada { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; }
.portada > * { width: 100%; }
.portada-interior { display: grid; gap: 2rem; align-items: center; }
.avatar { width: min(16rem, 60vw); border-radius: 50%; }
@media (min-width: 52rem) {
  .portada-interior { grid-template-columns: 1fr auto; }
  .avatar { width: 20rem; }
}
.etiqueta {
  text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 0.9rem; font-weight: 700; color: var(--tinta-suave); margin: 0;
}
.portada h1 {
  font-size: clamp(2.75rem, 9vw, 6.5rem); line-height: 1.02;
  font-weight: 800; letter-spacing: -0.03em; margin: 0.5rem 0 1rem;
}
.disciplinas { font-size: clamp(1.1rem, 2.5vw, 1.4rem); color: var(--tinta-suave); margin: 0 0 2rem; }

.boton {
  display: inline-block; padding: 0.85rem 1.5rem;
  background: var(--acento); color: var(--tinta);
  font-weight: 700; text-decoration: none; border-radius: 999px;
}
.boton:hover { background: var(--tinta); color: #fff; }
.boton-claro { background: var(--resalte); color: var(--tinta); }
.boton-claro:hover { background: #fff; color: var(--tinta); }

/* Índice de proyectos */
.indice ol {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  list-style: none; padding: 0; margin: 0 0 3rem;
}
.indice a {
  display: inline-block; padding: 0.4rem 0.9rem;
  border: 1px solid var(--tinta); border-radius: 999px;
  color: var(--tinta); text-decoration: none; font-size: 0.95rem;
}
.indice a:hover { background: var(--resalte); }

/* Proyecto */
.proyecto {
  display: grid; gap: clamp(1.5rem, 4vw, 3.5rem);
  grid-template-columns: 1fr;
  padding: 3rem 0; border-top: 1px solid var(--linea);
}
@media (min-width: 52rem) {
  .proyecto { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .proyecto:nth-of-type(even) .medios { order: 2; }
  .proyecto .texto { position: sticky; top: 6rem; }
}
.proyecto figure { margin: 0; }
.proyecto img { width: 100%; border-radius: 6px; background: var(--linea); }
.principal img { max-height: 85vh; width: auto; max-width: 100%; margin-inline: auto; }

/* Galería de miniaturas */
.galeria {
  list-style: none; padding: 0; margin: 0.75rem 0 0;
  display: grid; gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
}
.galeria img { aspect-ratio: 1; object-fit: cover; height: 100%; }
.ampliar { display: block; border-radius: 6px; cursor: zoom-in; }
.ampliar:hover img { opacity: 0.88; }

/* Visor de imagen ampliada */
.visor {
  border: 0; padding: 0; background: transparent;
  max-width: 95vw; max-height: 95vh; overflow: visible;
}
.visor::backdrop { background: rgb(0 0 0 / 0.85); }
.visor img { max-width: 95vw; max-height: 80vh; width: auto; height: auto; margin: 0 auto; border-radius: 4px; }
.cerrar {
  position: fixed; top: 1rem; right: 1rem;
  width: 3rem; height: 3rem; border-radius: 50%; border: 0;
  background: #fff; color: var(--tinta); font-size: 2rem; line-height: 1; cursor: pointer;
}
.cerrar:focus-visible { outline-color: var(--resalte); }
.proyecto h3 {
  font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.15;
  letter-spacing: -0.01em; margin: 0.25rem 0 1rem;
}
.meta {
  display: inline-block; margin: 0; padding: 0.2rem 0.65rem;
  font-size: 0.8rem; font-weight: 700; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.08em;
  background: var(--acento); color: var(--tinta);
}
.texto p:not(.meta) { max-width: 38rem; }

/* Sobre mí */
.sobre-mi { background: #fff; }
.sobre-mi-interior { display: grid; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
@media (min-width: 52rem) { .sobre-mi-interior { grid-template-columns: 1fr 1.3fr; } }
.foto-sobre-mi { margin: 0; }
.foto-sobre-mi img { width: 100%; max-width: 28rem; border-radius: 6px; margin-inline: auto; }
.sobre-mi-texto { max-width: 40rem; }
.destacado { font-size: clamp(1.4rem, 3vw, 1.8rem); font-weight: 700; line-height: 1.3; }

/* Contacto */
.contacto { background: var(--acento); color: var(--tinta); text-align: center; }
.contacto h2 { font-size: clamp(2.5rem, 7vw, 4.5rem); font-weight: 800; margin: 0 auto 1rem; letter-spacing: -0.02em; }
.contacto a:not(.boton) { color: var(--tinta); text-decoration-color: var(--tinta); }
.redes { list-style: none; padding: 0; margin-top: 1.5rem; }

/* Pie */
.pie {
  padding: 2rem clamp(1rem, 4vw, 3rem);
  font-size: 0.95rem; color: var(--tinta-suave); text-align: center;
}
