/* =========================================================
   Gabriel Barranco — sitio de 4 páginas
   Réplica de la estructura y el lenguaje visual de Vexoo
   (plantilla Framer): fondo negro, mosaico de tarjetas de
   blanco translúcido con filo interior, radio 32px, nombre
   gigante detrás del mosaico y entrada de texto letra a letra.
   ========================================================= */

:root {
  --bg:        #000000;
  --text:      #f2f0ee;
  --muted:     rgba(242, 240, 238, .55);
  --faint:     rgba(242, 240, 238, .34);

  --tile:      rgba(255, 255, 255, .055);
  --tile-up:   rgba(255, 255, 255, .09);
  --edge:      inset 0 1px 0 1px rgba(255, 255, 255, .06);
  --edge-up:   inset 0 1px 0 1px rgba(255, 255, 255, .13);
  --hairline:  rgba(255, 255, 255, .10);

  --mint:      #ff7a2f;   /* acento */
  --peach:     #ffd9bf;

  --r:         32px;
  --r-in:      18px;
  --gap:       1rem;

  --ease:      cubic-bezier(.22, .61, .36, 1);
  --expo:      cubic-bezier(.16, 1, .3, 1);

  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

/* Requisitos de Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -.012em;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.05; letter-spacing: -.035em; }

/* ---------- Barra superior ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 1.125rem var(--gap);
  background-color: rgba(0, 0, 0, .7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: .9375rem;
  font-weight: 500;
}

.topbar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 88rem;
  margin-inline: auto;
}

.topbar .left { display: flex; align-items: center; gap: 1.5rem; min-width: 0; }
.topbar .role, .topbar .place { color: var(--muted); }
.topbar .right { display: flex; align-items: center; gap: 1rem; color: var(--muted); }

.back { display: inline-flex; align-items: center; gap: .5rem; transition: opacity .3s var(--ease); }
.back:hover { opacity: .6; }
.back svg { width: .9375rem; height: .9375rem; fill: none; stroke: currentColor; stroke-width: 1.8; }

.beacon { width: .5rem; height: .5rem; border-radius: 100%; background-color: var(--mint); animation: ping 2.8s var(--ease) infinite; }

@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(255, 122, 47, .5); }
  70%  { box-shadow: 0 0 0 .5rem rgba(255, 122, 47, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 122, 47, 0); }
}

/* ---------- Contenedores ---------- */

.page { max-width: 88rem; margin-inline: auto; padding: 0 var(--gap) 3rem; }

/* Página de proyecto: margen lateral algo mayor, el mismo para texto e imágenes */
.page.proj { padding-inline: clamp(1rem, 2.3vw, 2rem); }

/* ---------- Home: nombre gigante + mosaico de 4×2 ---------- */

.hero { position: relative; padding-top: clamp(.75rem, 2vw, 1.75rem); }

.bigname {
  --overlap: clamp(.5rem, 1.6vw, 1.5rem);
  margin: 0 0 calc(var(--overlap) * -1);
  font-size: clamp(2.5rem, 10.5vw, 10rem);
  font-weight: 500;
  letter-spacing: -.05em;
  line-height: .9;
  text-align: center;
  white-space: nowrap;
  color: rgba(255, 255, 255, .92);
  will-change: transform;
}


/* --- Variantes del titular: una por tarjeta, apiladas en el mismo hueco --- */
/* La primera queda en flujo y fija la altura; el resto se superpone. */
.bigname { position: relative; }

.bigname .nv { display: block; }
.bigname .nv + .nv { position: absolute; inset: 0; }

.bigname .nvw { display: inline-block; white-space: nowrap; }

.bigname .ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(.3em) skewY(4deg);
  transition: opacity .5s var(--expo), transform .7s var(--expo);
  transition-delay: calc(var(--i, 0) * 24ms);
  will-change: transform;
}

.bigname .nv.on .ch { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .bigname .ch { transition: none; transform: none; }
}

.home-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 19rem);
  gap: var(--gap);
}

.home-grid > * { backdrop-filter: blur(18px) saturate(.9); -webkit-backdrop-filter: blur(18px) saturate(.9); }

.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

/* Columna derecha partida en dos medias alturas */
.stack { display: grid; grid-template-rows: 1fr 1fr; gap: var(--gap); backdrop-filter: none !important; }

/* ---------- Tarjeta ---------- */

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  border-radius: var(--r);
  background-color: var(--tile);
  box-shadow: var(--edge);
  overflow: hidden;
}

a.tile { transition: background-color .4s var(--ease), box-shadow .4s var(--ease), transform .4s var(--ease); }

a.tile:hover,
a.tile:focus-visible {
  background-color: var(--tile-up);
  box-shadow: var(--edge-up), 0 22px 50px -26px rgba(0, 0, 0, .95);
  transform: translateY(-4px);
}

/* Foco que sigue al cursor */
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle 18rem at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .075), transparent 68%);
  opacity: 0;
  transition: opacity .45s var(--ease);
  pointer-events: none;
}

.tile:hover::after { opacity: 1; }

.tile-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
}

/* Etiqueta que rueda al pasar el ratón (dos copias apiladas) */
.roll { position: relative; display: block; overflow: hidden; height: 1.35em; }
.roll span { display: block; transition: transform .5s var(--expo); }
.roll span + span { position: absolute; top: 100%; left: 0; }
a.tile:hover .roll span { transform: translateY(-100%); }

.tile-name { font-size: 1.125rem; font-weight: 500; letter-spacing: -.02em; overflow-wrap: anywhere; }

/* El bloque de texto del pie debe poder encogerse junto a la flecha */
.tile-foot > :first-child { min-width: 0; }

.go {
  display: grid;
  place-items: center;
  width: 2.25rem; min-width: 2.25rem; height: 2.25rem;
  border-radius: 100%;
  background-color: rgba(255, 255, 255, .07);
  transition: background-color .4s var(--ease);
}

.go svg { width: .875rem; height: .875rem; fill: none; stroke: var(--text); stroke-width: 2; transition: stroke .4s var(--ease); }

a.tile:hover .go { background-color: var(--mint); }
a.tile:hover .go svg { stroke: #0b0b0b; }

/* El tile del CV lleva el color de acento para destacarlo del resto:
   naranja con tipografía negra, y al pasar el ratón se invierte. */
.tile[data-descargar-cv] {
  background-color: var(--mint);
  color: #0b0b0b;
  box-shadow: none;
}

.tile[data-descargar-cv] .go      { background-color: rgba(11, 11, 11, .14); }
.tile[data-descargar-cv] .go svg  { stroke: #0b0b0b; }
.tile[data-descargar-cv]::after   { display: none; }

a.tile[data-descargar-cv]:hover,
a.tile[data-descargar-cv]:focus-visible {
  background-color: #0b0b0b;
  color: var(--text);
  box-shadow: var(--edge-up), 0 22px 50px -26px rgba(0, 0, 0, .95);
}

a.tile[data-descargar-cv]:hover .go,
a.tile[data-descargar-cv]:focus-visible .go { background-color: rgba(242, 240, 238, .14); }

a.tile[data-descargar-cv]:hover .go svg,
a.tile[data-descargar-cv]:focus-visible .go svg { stroke: var(--text); }

/* Tarjeta de foto */
.tile.photo { padding: 0; }
.tile.photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; filter: grayscale(1) contrast(1.1) brightness(.9); }

/* ---------- Cinta de herramientas ---------- */

.belt { justify-content: center; padding-inline: 0; }

.belt-track {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: max-content;
  animation: slide 38s linear infinite;
}

.belt:hover .belt-track { animation-play-state: paused; }

@keyframes slide { to { transform: translateX(-50%); } }

.belt-item {
  display: grid;
  place-items: center;
  width: 4.5rem; min-width: 4.5rem; height: 4.5rem;
  border-radius: 20px;
  background-color: rgba(255, 255, 255, .06);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, .07);
  transition: background-color .3s var(--ease);
}

.belt-item svg {
  width: 2.125rem;
  height: 2.125rem;
  fill: rgba(242, 240, 238, .72);
  transition: fill .3s var(--ease);
}

.belt-item:hover { background-color: rgba(255, 255, 255, .12); }
.belt-item:hover svg { fill: #ffffff; }

/* ---------- Páginas interiores ---------- */

.lead {
  max-width: 62rem;
  margin: clamp(2rem, 7vw, 5rem) 0 clamp(2rem, 5vw, 3.5rem);
  font-size: clamp(1.5rem, 3.4vw, 2.75rem);
  font-weight: 500;
  line-height: 1.24;
  letter-spacing: -.035em;
}

.lead .dim { color: var(--faint); }

.section-title {
  margin: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(1rem, 2.5vw, 1.75rem);
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-weight: 500;
}

.eyebrow {
  display: block;
  margin-bottom: .875rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

/* Experiencia y formación: año | puesto | descripción */

.entry {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 1rem 2rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--hairline);
}

.entry:last-child { border-bottom: 1px solid var(--hairline); }

.entry .when { font-size: .9375rem; color: var(--faint); }
.entry .what { font-size: 1.125rem; font-weight: 500; letter-spacing: -.02em; }
.entry .who { display: flex; align-items: center; gap: .5rem; margin-top: .25rem; font-size: .9375rem; color: var(--muted); }
.entry .who .now { width: .4375rem; height: .4375rem; border-radius: 100%; background-color: var(--mint); }

.entry ul { display: flex; flex-direction: column; gap: .375rem; }
.entry li { position: relative; padding-left: .9375rem; font-size: .9375rem; color: var(--muted); }
.entry li::before {
  content: "";
  position: absolute; left: 0; top: .6em;
  width: .3125rem; height: .3125rem;
  border-radius: 100%;
  background-color: rgba(255, 255, 255, .3);
}

.entry p { margin: 0; font-size: .9375rem; color: var(--muted); }

/* Aptitudes en rejilla */
.grid-skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .625rem 2rem; }
.grid-skills li { display: flex; align-items: flex-start; gap: .625rem; font-size: .9375rem; color: var(--muted); }
.grid-skills svg { width: .9375rem; min-width: .9375rem; height: .9375rem; margin-top: .28rem; fill: none; stroke: var(--mint); stroke-width: 2.6; }

/* Grupos de herramientas */
.tool-group + .tool-group { margin-top: 1.5rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .625rem; }
.chip {
  padding: .4375rem .875rem;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, .06);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, .06);
  font-size: .875rem;
  font-weight: 500;
}

/* Marquesina de titulares */
.marquee {
  margin: clamp(3rem, 8vw, 6rem) 0;
  padding: clamp(1.5rem, 3vw, 2.5rem) 0;
  border-block: 1px solid var(--hairline);
  overflow: hidden;
}

.marquee-track {
  display: flex;
  gap: 2.5rem;
  width: max-content;
  animation: slide 26s linear infinite;
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 500;
  letter-spacing: -.04em;
  white-space: nowrap;
}

.marquee-track em { font-style: normal; color: var(--faint); }

/* ---------- Proyectos ---------- */

.works { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }

/* --- Filtro de proyectos por categoría --- */

.filtros {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0 0 2rem;
}

.filtro {
  font: inherit;
  font-size: .875rem;
  padding: .5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background-color: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}

.filtro:hover { color: var(--text); border-color: rgba(255, 255, 255, .22); }

.filtro.activo {
  background-color: var(--mint);
  border-color: var(--mint);
  color: #0b0b0b;
  font-weight: 500;
}

.work[hidden] { display: none; }

.sin-resultados { margin: 2rem 0 0; color: var(--muted); }

/* --- Tarjeta de proyecto: marco con la imagen a todo color y el
       nombre debajo, como en la referencia --- */

.works { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem var(--gap); }

.work {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.work.wide { grid-column: span 2; }

.work-frame {
  position: relative;
  padding: 1rem;
  border-radius: var(--r);
  background-color: var(--tile);
  box-shadow: var(--edge);
  overflow: hidden;
  transition: background-color .4s var(--ease), box-shadow .4s var(--ease);
}

a.work:hover .work-frame,
a.work:focus-visible .work-frame { background-color: var(--tile-up); box-shadow: var(--edge-up); }

.work-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  border-radius: calc(var(--r) - 1rem);
  transition: transform .9s var(--ease);
}

.work.wide .work-frame img { aspect-ratio: 16 / 9; }

a.work:hover .work-frame img { transform: scale(1.03); }

/* Foco del cursor dentro del marco */
.work-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle 20rem at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .09), transparent 68%);
  opacity: 0;
  transition: opacity .45s var(--ease);
  pointer-events: none;
}

.work-frame:hover::after { opacity: 1; }

/* Marco sin imagen todavía */
.work-frame.empty {
  display: grid;
  place-items: center;
  aspect-ratio: 5 / 4;
  padding: 2rem;
}

.work.wide .work-frame.empty { aspect-ratio: 16 / 9; }

.work-frame.empty span {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -.04em;
  color: var(--faint);
  text-align: center;
}

/* Pie de la tarjeta */
.work-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-inline: 1.5rem;
}

.work-name { font-size: 1.25rem; font-weight: 500; letter-spacing: -.025em; }
.work-cat  { font-size: .9375rem; color: var(--muted); text-align: right; white-space: nowrap; }

/* Bloques Reto / Objetivo / Resultado.
   En la referencia van más metidos que las imágenes: 80 px por lado a 1440 px
   (las fotos van a 32), y el texto ocupa la columna derecha con reparto 60/40. */
.story {
  margin: clamp(3rem, 7vw, 5.5rem) 0;
  padding-inline: clamp(0rem, 2.2vw, 2rem);
}

.story-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1rem 2rem;
  padding: clamp(2rem, 4vw, 3rem) 0;
}

.story-row + .story-row { border-top: 1px solid var(--hairline); }

.story-row h2 {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -.01em;
}

.story-row p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--muted);
}

/* --- Página de proyecto: cabecera + galería a sangre, sin marcos --- */

.proj-title {
  margin: clamp(1.5rem, 4vw, 3rem) 0 .5rem;
  font-size: clamp(2.25rem, 6vw, 4rem);
  font-weight: 500;
  letter-spacing: -.045em;
}

.proj-cat { font-size: clamp(1rem, 1.8vw, 1.25rem); color: var(--muted); }

.proj-intro {
  max-width: 48rem;
  margin: clamp(2rem, 4vw, 3rem) 0 0;
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  line-height: 1.6;
  color: var(--muted);
}

.proj-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 4rem;
  margin: clamp(2rem, 4vw, 3rem) 0 clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--hairline);
}

.fact { display: flex; flex-direction: column; gap: .25rem; }
.fact .k { font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.fact .v { font-size: .9375rem; }

/* La galería comparte margen con el texto: todo alineado al mismo eje */
.gallery, .cover {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  width: 100%;
}

.cover img { display: block; width: 100%; height: auto; border-radius: var(--r); }

.gallery figure { margin: 0; }

.gallery img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r);
}

/* Dos verticales seguidas se colocan en pareja, como en la referencia */
.row { display: grid; gap: var(--gap); }
.row figure { margin: 0; }
.row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* En filas de varias columnas se iguala la proporción para que la fila cuadre */
.row img { object-fit: cover; }

/* Una vertical suelta a todo el ancho sería descomunal: se limita y se centra */
.gallery figure.tall img { max-width: 58%; margin-inline: auto; }

.visit {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding: .875rem 1.5rem;
  border-radius: 999px;
  background-color: var(--mint);
  color: #0b0b0b;
  font-size: .9375rem;
  font-weight: 600;
  transition: transform .3s var(--ease), background-color .3s var(--ease);
}

.visit:hover { transform: translateY(-2px); background-color: #ff9557; }
.visit svg { width: .875rem; height: .875rem; fill: none; stroke: currentColor; stroke-width: 2; }

/* ---------- Logofolio ---------- */

.head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin: clamp(3rem, 7vw, 5.5rem) 0 clamp(1.25rem, 3vw, 2rem);
}

.head-note { max-width: 34rem; margin: 0; font-size: .9375rem; color: var(--muted); }

/* Carrusel continuo, igual que la cinta de herramientas del inicio */
.logo-belt {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.logo-track {
  display: flex;
  align-items: stretch;
  gap: var(--gap);
  width: max-content;
  animation: slide 46s linear infinite;
}

.logo-belt:hover .logo-track { animation-play-state: paused; }

.logo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex: 0 0 auto;
  width: 22rem;
  margin: 0;
  min-height: 15rem;
  padding: 2rem;
  border-radius: var(--r);
  background-color: var(--tile);
  box-shadow: var(--edge);
  transition: background-color .4s var(--ease), box-shadow .4s var(--ease);
}

.logo-card:hover { background-color: var(--tile-up); box-shadow: var(--edge-up); }

/* Cada logo se muestra tal cual se diseñó, sin recolorear */
.logo-card img {
  width: auto;
  max-width: 100%;
  max-height: 8rem;
  object-fit: contain;
  opacity: .82;
  transition: opacity .4s var(--ease);
}

.logo-card:hover img { opacity: 1; }

/* Los verticales necesitan más alto para pesar lo mismo a la vista */
.logo-card.tall img { max-height: 9.5rem; }

/* Wash & Lock es de dos tonos: sobre negro se perdía, va en tarjeta clara */
.logo-card.light {
  background-color: #f2f0ee;
  box-shadow: inset 0 1px 0 1px rgba(0, 0, 0, .05);
}

.logo-card.light:hover { background-color: #ffffff; }
.logo-card.light figcaption { color: rgba(31, 29, 27, .5); }

.logo-card figcaption {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: center;
}

/* ---------- Contacto ---------- */

/* Las tarjetas sueltas de contacto no viven en una rejilla con
   filas fijas, así que llevan su propio alto. */
.contact-top .tile { min-height: 11rem; }

.contact-top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }

.form-card { padding: clamp(1.5rem, 3vw, 2.5rem); border-radius: var(--r); background-color: var(--tile); box-shadow: var(--edge); }

.field { margin-bottom: 1.5rem; }
.field > label, .legend { display: block; margin-bottom: .625rem; font-size: .875rem; font-weight: 500; }

.input, .textarea {
  width: 100%;
  padding: .875rem 1rem;
  border: 0;
  border-radius: var(--r-in);
  background-color: rgba(255, 255, 255, .06);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, .06);
  color: var(--text);
  font: inherit;
  font-size: .9375rem;
  transition: background-color .3s var(--ease);
}

.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .textarea:focus { outline: none; background-color: rgba(255, 255, 255, .1); }
.textarea { min-height: 8rem; resize: vertical; }

fieldset { margin: 0 0 1.5rem; padding: 0; border: 0; }

.opts { display: flex; flex-wrap: wrap; gap: .5rem; }

.opt { position: relative; }
.opt input { position: absolute; opacity: 0; width: 0; height: 0; }

.opt span {
  display: inline-block;
  padding: .5rem 1rem;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, .06);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, .06);
  font-size: .875rem;
  cursor: pointer;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

.opt input:checked + span { background-color: var(--mint); color: #0b0b0b; font-weight: 600; }
.opt input:focus-visible + span { outline: 2px solid var(--mint); outline-offset: 3px; }

.submit {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  padding: .875rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background-color: var(--mint);
  color: #0b0b0b;
  font: inherit;
  font-size: .9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .3s var(--ease), background-color .3s var(--ease);
}

.submit:hover { transform: translateY(-2px); background-color: #ff9557; }
.submit svg { width: .875rem; height: .875rem; fill: none; stroke: currentColor; stroke-width: 2; }

.form-aviso {
  margin: 0;
  padding: .875rem 1.125rem;
  border-radius: var(--r-in);
  font-size: .9375rem;
  line-height: 1.45;
  color: #0b0b0b;
  background-color: var(--mint);
}

.form-aviso.malo { background-color: rgba(255, 255, 255, .08); color: var(--text); }
.form-aviso[hidden] { display: none; }

.form-note { margin: 1rem 0 0; font-size: .8125rem; color: var(--faint); }

/* ---------- Pie compartido ---------- */

.foot { margin-top: clamp(3rem, 8vw, 6rem); padding-top: 2rem; border-top: 1px solid var(--hairline); }

.foot-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; }
.foot-item .k { display: block; margin-bottom: .375rem; font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.foot-item .v { font-size: .9375rem; overflow-wrap: anywhere; transition: color .3s var(--ease); }
.foot-item a:hover .v { color: var(--mint); }

.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; margin-top: 2.5rem; font-size: .8125rem; color: var(--faint); }
.foot-base .credito a { color: var(--muted); text-decoration: underline; text-underline-offset: .2em; text-decoration-color: rgba(242, 240, 238, .25); transition: color .3s var(--ease), text-decoration-color .3s var(--ease); }
.foot-base .credito a:hover { color: var(--mint); text-decoration-color: var(--mint); }

/* ---------- Movimiento ---------- */

.reveal {
  opacity: 0;
  transform: translateY(1.75rem) scale(.995);
  transition: opacity .75s var(--expo), transform .9s var(--expo);
  transition-delay: calc(var(--i, 0) * 60ms);
}

.reveal.is-visible { opacity: 1; transform: none; }

.split { display: inline-block; }
.split .w { display: inline-block; white-space: nowrap; }

.split .ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(.3em) skewY(4deg);
  transition: opacity .7s var(--expo), transform .9s var(--expo);
  transition-delay: calc(var(--i, 0) * 26ms);
  will-change: transform;
}

.is-in .split .ch { opacity: 1; transform: none; }

/* Párrafos que entran palabra a palabra */
.split-words .wd {
  display: inline-block;
  opacity: 0;
  transform: translateY(.35em);
  transition: opacity .6s var(--expo), transform .75s var(--expo);
  transition-delay: calc(var(--i, 0) * 18ms);
}

/* `split-words` y `is-in` caen en el mismo elemento, así que hace falta
   el selector compuesto además del descendiente. */
.split-words.is-in .wd,
.is-in .split-words .wd { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .split .ch, .split-words .wd { opacity: 1; transform: none; transition: none; }
  .belt-track, .marquee-track, .logo-track { animation: none; flex-wrap: wrap; }
}

/* Llamada al sitio en producción, al pie de la ficha de proyecto */
.proj-cta {
  margin: clamp(2rem, 5vw, 3.5rem) 0 0;
  padding-inline: clamp(0rem, 2.2vw, 2rem);
  display: flex;
  justify-content: center;
}

.proj-cta .boton-perfil { align-self: center; }

/* Portada sin imagen: misma tarjeta neutra que en la rejilla */
.cover .work-frame.empty { aspect-ratio: 16 / 9; }

/* ---------- Banda de perfil de "Sobre mí" ---------- */

.perfil {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  margin: clamp(2.5rem, 6vw, 4.5rem) 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: var(--r);
  background-color: var(--tile);
  box-shadow: var(--edge);
}

.perfil-foto { margin: 0; border-radius: var(--r-in); overflow: hidden; }

.perfil-foto img {
  display: block;
  width: 100%;
  height: auto;          /* si no, gana el height del atributo HTML */
  aspect-ratio: 1 / 1.12;
  object-fit: cover;
  object-position: 50% 18%;
  filter: grayscale(1) contrast(1.08);
  transition: filter .5s var(--ease), transform .6s var(--ease);
}

.perfil:hover .perfil-foto img { filter: grayscale(0) contrast(1); transform: scale(1.02); }

.perfil-datos { display: flex; flex-direction: column; gap: clamp(1.25rem, 3vw, 2rem); min-width: 0; }

.perfil-intro {
  margin: 0;
  font-size: clamp(1.125rem, 2.1vw, 1.5rem);
  line-height: 1.35;
  letter-spacing: -.02em;
  color: var(--text);
}

.perfil .cifras {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
}

.perfil .cifra b {
  display: block;
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -.04em;
  color: var(--mint);
  line-height: 1;
}

.perfil .cifra span {
  display: block;
  margin-top: .35rem;
  font-size: .875rem;
  color: var(--muted);
}

.boton-perfil {
  display: inline-flex;
  align-items: center;
  gap: .875rem;
  align-self: flex-start;
  padding: .625rem .625rem .625rem 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  font-size: .9375rem;
  color: var(--text);
  transition: background-color .35s var(--ease), border-color .35s var(--ease);
}

.boton-perfil:hover { background-color: var(--tile-up); border-color: rgba(255, 255, 255, .22); }
.boton-perfil:hover .go { background-color: var(--mint); }
.boton-perfil:hover .go svg { stroke: #0b0b0b; }

/* ---------- Transiciones entre páginas ---------- */

/* Chrome la hace nativa; los demás usan las clases de abajo. */
@view-transition { navigation: auto; }

::view-transition-old(root) { animation: pag-sale .28s var(--ease) both; }
::view-transition-new(root) { animation: pag-entra .42s var(--expo) both; }

@keyframes pag-sale  { to   { opacity: 0; transform: translateY(-.75rem); } }
@keyframes pag-entra { from { opacity: 0; transform: translateY(1rem); } }

body { transition: opacity .24s var(--ease), transform .24s var(--ease); }
body.entrando { opacity: 0; transform: translateY(.75rem); }
body.saliendo { opacity: 0; transform: translateY(-.5rem); }

/* ---------- Barra de progreso de lectura ---------- */

.progreso {
  position: fixed;
  top: 0; left: 0;
  z-index: 70;
  width: 100%;
  height: 2px;
  background-color: var(--mint);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* ---------- Flecha magnética ---------- */

.go { transition: background-color .4s var(--ease), transform .35s var(--expo); }

/* ---------- Revelado de imágenes con máscara ---------- */

/* El paralaje va en la misma propiedad que la escala, así que se
   componen en una sola transformada para que no se pisen. */
.cover img, .gallery img {
  transform: translateY(var(--py, 0));
  transition: transform .8s var(--expo);
}

.cover, .gallery figure { clip-path: inset(0 round var(--r-in)); }

/* La galería lleva el .reveal en la fila, no en cada figura:
   se destapan por filas y escalonadas. */
.gallery .row.is-in figure,
.gallery figure.is-in,
.cover.is-in { animation: destapa .9s var(--expo) both; }

.gallery .row.is-in figure:nth-child(2) { animation-delay: .09s; }
.gallery .row.is-in figure:nth-child(3) { animation-delay: .18s; }

@keyframes destapa {
  from { clip-path: inset(0 0 100% 0 round var(--r-in)); }
  to   { clip-path: inset(0 0 0 0 round var(--r-in)); }
}

/* ---------- Enlaces de la barra superior ---------- */

.topbar a, .topbar-in a { position: relative; }

.topbar a::after, .topbar-in a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -.15em;
  height: 1px;
  background-color: currentColor;
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform .45s var(--expo);
}

.topbar a:hover::after, .topbar-in a:hover::after { transform: scaleX(1); transform-origin: 0 50%; }

@media (prefers-reduced-motion: reduce) {
  .progreso { display: none; }
  body, body.entrando, body.saliendo { opacity: 1; transform: none; transition: none; }
  .gallery .row.is-in figure, .gallery figure.is-in, .cover.is-in { animation: none; }
  .cover img, .gallery img { transform: none; transition: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---------- Caja de luz de las fotos de proyecto ---------- */

/* El atributo [hidden] lo anula cualquier display del autor, así que
   hay que apagarlo a mano o la caja aparece abierta al cargar. */
.lightbox[hidden],
.lb-nav[hidden] { display: none !important; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background-color: rgba(0, 0, 0, .92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: lb-entra .25s var(--ease);
}

@keyframes lb-entra { from { opacity: 0 } to { opacity: 1 } }

.lb-marco { margin: 0; display: flex; flex-direction: column; gap: .875rem; max-width: 100%; max-height: 100%; }

.lb-marco img {
  max-width: 100%;
  max-height: calc(100vh - 8rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--r-in);
  display: block;
  margin: 0 auto;
}

.lb-marco figcaption[hidden] { display: none; }
.lb-marco figcaption { text-align: center; font-size: .875rem; color: var(--muted); }

.lb-cerrar, .lb-nav {
  position: absolute;
  display: grid;
  place-items: center;
  width: 2.75rem; height: 2.75rem;
  border-radius: 100%;
  border: 1px solid var(--hairline);
  background-color: rgba(255, 255, 255, .06);
  color: var(--text);
  cursor: pointer;
  transition: background-color .3s var(--ease), border-color .3s var(--ease);
}

.lb-cerrar:hover, .lb-nav:hover { background-color: var(--mint); border-color: var(--mint); }
.lb-cerrar:hover svg, .lb-nav:hover svg { stroke: #0b0b0b; }

.lb-cerrar { top: clamp(.75rem, 2vw, 1.5rem); right: clamp(.75rem, 2vw, 1.5rem); }
.lb-antes  { left:  clamp(.5rem, 2vw, 1.5rem); }
.lb-despues{ right: clamp(.5rem, 2vw, 1.5rem); }

.lb-cerrar svg, .lb-nav svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: stroke .3s var(--ease); }

@media (max-width: 767px) {
  .lb-cerrar, .lb-nav { width: 2.25rem; height: 2.25rem; }
  .lb-marco img { max-height: calc(100vh - 7rem); }
}

@media (prefers-reduced-motion: reduce) { .lightbox { animation: none; } }

/* ---------- Accesibilidad ---------- */

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

.skip { position: absolute; left: -9999px; top: .5rem; z-index: 60; padding: .75rem 1.125rem; border-radius: var(--r-in); background-color: #141414; }
.skip:focus { left: 1rem; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 17rem); }
  .span-2, .span-3 { grid-column: span 2; }
  .entry { grid-template-columns: 8rem minmax(0, 1fr); }
  .entry .desc { grid-column: 2; }
  .grid-skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  :root { --r: 24px; --gap: .75rem; }
  .bigname { --overlap: -1.25rem; font-size: clamp(2.25rem, 13vw, 3.25rem); text-align: left; white-space: normal; }
  /* En móvil manda el retrato: arriba y a todo el ancho, debajo dos
     filas de dos, y lo secundario al final. El .stack agrupa
     herramientas y CV en escritorio; aquí se disuelve con
     display:contents para poder ordenar sus tiles por separado. */
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 7rem); }
  .home-grid > * { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  .span-2, .span-3 { grid-column: span 2; }
  .home-grid .stack { display: contents; }

  .home-grid .tile.photo         { order: 1; grid-column: span 2; grid-row: span 3; }
  .home-grid [href="sobre-mi"]   { order: 2; grid-column: span 1; }
  .home-grid [href="proyectos"]  { order: 3; grid-column: span 1; }
  .home-grid [data-descargar-cv] { order: 4; grid-column: span 1; }
  .home-grid [href="contacto"]   { order: 5; grid-column: span 1; }
  .home-grid .tile.belt          { order: 6; grid-column: span 2; }

  /* Mismo alto de tarjeta en todas las páginas, no sólo en la home */
  .contact-top .tile { min-height: 7rem; }
  .contact-top { gap: .75rem; }

  /* Los tiles de media columna son estrechos: el rótulo se comía
     la flecha, así que aquí se aprieta todo un punto. */
  .home-grid .tile:not(.photo) { padding: 1.125rem; }
  .home-grid .tile-foot { gap: .5rem; }
  .home-grid .tile-name { font-size: .9375rem; letter-spacing: -.025em; }
  .home-grid .go { width: 1.75rem; min-width: 1.75rem; height: 1.75rem; }
  .home-grid .go svg { width: .875rem; height: .875rem; }
  .belt-item { width: 3.25rem; min-width: 3.25rem; height: 3.25rem; border-radius: 16px; }
  .belt-item svg { width: 1.5rem; height: 1.5rem; }
  /* Dos columnas: en una sola la página se hacía larguísima */
  .works { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem .75rem; }
  .work { gap: .625rem; }
  .work.wide { grid-column: span 2; }
  /* En dos columnas no caben nombre y categoría en la misma línea */
  .work-meta { flex-direction: column; align-items: flex-start; gap: .125rem; }
  .work-name { font-size: .9375rem; }
  .work-cat  { font-size: .75rem; text-align: left; white-space: normal; }
  .filtros { gap: .375rem; margin-bottom: 1.5rem; }
  .filtro { font-size: .8125rem; padding: .4rem .75rem; }
  .row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery figure.tall img { max-width: 100%; }
  .story-row { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .story { padding-inline: 0; }
  .perfil { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding: 1rem; }
  .perfil-foto img { aspect-ratio: 4 / 3; object-position: 50% 22%; }
  .perfil .cifras { gap: 1rem; }
  .boton-perfil { align-self: stretch; justify-content: space-between; }
  .proj-facts { gap: 1rem 2rem; }
  /* En móvil el nombre del logo estorba más que ayuda: la marca
     ya se reconoce sola y así entran más de una vez. */
  .logo-card { width: 7rem; min-height: 5rem; padding: .75rem; gap: 0; }
  .logo-card img { max-height: 3rem; }
  .logo-card.tall img { max-height: 3.5rem; }
  .logo-card figcaption { display: none; }
  /* En móvil el nombre del logo estorba más que ayuda: la marca
     ya se reconoce sola y así entran más de una vez. */
  .logo-card { width: 7rem; min-height: 5rem; padding: .75rem; gap: 0; }
  .logo-card img { max-height: 3rem; }
  .logo-card.tall img { max-height: 3.5rem; }
  .logo-card figcaption { display: none; }
  .contact-top { grid-template-columns: minmax(0, 1fr); }
  .entry { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .entry .desc { grid-column: 1; }
  .grid-skills { grid-template-columns: minmax(0, 1fr); }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar .role, .topbar .place { display: none; }
  .topbar { font-size: .875rem; }
  .contact-top .tile-name { font-size: .9375rem; }
}

/* ---------- Impresión ---------- */

@media print {
  :root { --text: #111; --muted: #444; --faint: #666; --hairline: #ddd; }
  body { background: #fff; color: #111; font-size: 10pt; }
  .topbar, .skip, .go, .bigname, .marquee, .belt, .form-card { display: none !important; }
  .tile, .work-frame, .logo-card { background: #fff !important; box-shadow: none !important; border: 1px solid #ddd; backdrop-filter: none !important; break-inside: avoid; }
  .reveal, .split .ch, .split-words .wd { opacity: 1 !important; transform: none !important; }
  .logo-card img { filter: none; opacity: 1; }
  .logo-belt { overflow: visible; mask-image: none; -webkit-mask-image: none; }
  .logo-track { animation: none; flex-wrap: wrap; width: auto; }
  .tile::after, .work::after { display: none; }
}
