/* =========================================================
   Sofía Carbonell — Portfolio
   Estética del atlas: monoespaciada, blanco y negro, grises para lo secundario.
   BEM · desktop-first (breakpoints 1100px, 900px y 650px)
   ========================================================= */

/* ---------- Tipografía: Switzer (Fontshare, licencia ITF Free Font, alojada en la web) ---------- */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Switzer";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/switzer-400.woff2") format("woff2");
}

@font-face {
  font-family: "Switzer";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("../fonts/switzer-500.woff2") format("woff2");
}

/* ---------- Transición suave entre páginas (View Transitions) ---------- */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: 0.5s cubic-bezier(0.45, 0, 0.55, 1) both vt-fade-out;
}

::view-transition-new(root) {
  animation: 0.6s cubic-bezier(0.45, 0, 0.55, 1) 0.1s both vt-fade-in;
}

@keyframes vt-fade-out {
  to {
    opacity: 0;
  }
}

@keyframes vt-fade-in {
  from {
    opacity: 0;
  }
}

/* Cambio de idioma: el contenido se funde y desenfoca antes de cambiar de página */
.is-switching main > :not(.pnav),
.is-switching .hero,
.is-switching .footer,
.is-switching .marquee,
.is-switching .talk {
  opacity: 0;
  filter: blur(6px);
  transform: translateY(-6px);
  transition: opacity 0.3s var(--ease), filter 0.3s var(--ease), transform 0.3s var(--ease);
}

/* Salida del carrusel al abrir un proyecto */
.ring.is-leaving .ring__card:not(.is-picked) {
  opacity: 0 !important;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.ring.is-leaving .ring__info,
.ring.is-leaving ~ .hero__bottom {
  opacity: 0;
  transition: opacity 0.35s;
}

/* ---------- Variables y reset ---------- */
:root {
  --paper: #ffffff;
  --ink: #0a0a0a;
  --mid: #8c8c8c;
  --soft: #3a3a3a;
  --line: #e8e8e8;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --sans: "Switzer", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --gutter: 28px;
  --gap: 24px;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 0.3s;
  --slow: 0.7s;
}

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

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

body {
  margin: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
p,
ul,
dl,
dd,
figure {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

/* ---------- Animaciones ---------- */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes chair-wiggle {
  0%,
  100% {
    transform: rotate(0deg);
  }
  30% {
    transform: rotate(-8deg);
  }
  65% {
    transform: rotate(5deg);
  }
}

/* ---------- Page ---------- */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 500 13px/1.35 var(--sans);
  letter-spacing: -0.03em;
  -webkit-font-smoothing: antialiased;
}

.main {
  flex: 1;
  width: 100%;
  padding: 0 var(--gutter);
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 var(--gutter);
  color: #fff;
  mix-blend-mode: difference;
  animation: fade-in var(--slow) var(--ease) both;
}

.header__wordmark,
.header__chair {
  filter: invert(1);
}

.header__logo {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.header__wordmark {
  width: 88px;
}

.header__chair {
  width: 14px;
  transform-origin: 100% 100%;          /* pivota sobre las patas derechas */
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* al pasar el ratón se inclina hacia la derecha, como balanceándose */
.header__logo:hover .header__chair {
  transform: rotate(9deg);
}

/* al hacer clic: balanceo con rebote antes de volver a su sitio */
.header__logo.is-tip .header__chair {
  animation: chair-tip 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes chair-tip {
  0% { transform: rotate(9deg); }
  28% { transform: rotate(22deg); }
  52% { transform: rotate(-4deg); }
  70% { transform: rotate(7deg); }
  86% { transform: rotate(-1.5deg); }
  100% { transform: rotate(0deg); }
}

.header__right {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header__nav {
  display: flex;
  gap: 18px;
}

.header__link {
  padding: 2px 0;
  font-weight: 400;
  color: #fff;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.header__link:hover,
.header__link:focus-visible {
  border-color: #fff;
}

.header__link--active {
  color: #fff;
  border-color: #fff;
}

.header__toggle,
.header__burger {
  display: none;
}

/* ---------- Selector de idioma (píldora) ---------- */
.lang {
  position: relative;
  display: inline-flex;
  padding: 2px;
  border: 1px solid #fff;
  border-radius: 99px;
}

.lang::before {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: 30px;
  border-radius: 99px;
  background: #fff;
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}

.lang--en::before {
  transform: translateX(30px);
}

.lang__opt {
  display: block;
  position: relative;
  font-weight: 400;
  width: 30px;
  padding: 1px 0;
  text-align: center;
  border-radius: 99px;
  color: #fff;
  transition: color 0.4s var(--ease);
}

.lang__opt.is-on {
  color: #000;
}

.lang:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- Intro (home) ---------- */
.intro {
  max-width: 900px;
  padding: 0;
  animation: fade-up var(--slow) var(--ease) 0.1s both;
}

.intro__name {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.intro__text {
  margin-top: 6px;
  color: var(--ink);
  font-size: clamp(20px, 2vw, 30px);
  line-height: 1.1;
  letter-spacing: -0.045em;
}

/* ---------- Grid de proyectos ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 48px var(--gap);
  padding-bottom: 96px;
}

.grid__item {
  animation: fade-up var(--slow) var(--ease) both;
}

.grid__item:nth-child(1) { animation-delay: 0.15s; }
.grid__item:nth-child(2) { animation-delay: 0.22s; }
.grid__item:nth-child(3) { animation-delay: 0.29s; }
.grid__item:nth-child(4) { animation-delay: 0.36s; }
.grid__item:nth-child(5) { animation-delay: 0.43s; }
.grid__item:nth-child(6) { animation-delay: 0.5s; }
.grid__item:nth-child(7) { animation-delay: 0.57s; }

/* ---------- Card ---------- */
.card {
  display: block;
}

.card__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #f2f2f2;
}

.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--slow) var(--ease);
}

.card__info {
  display: flex;
  gap: 12px;
  padding-top: 10px;
}

.card__year {
  color: var(--mid);
}

.card__year {
  margin-left: auto;
}

.card__title {
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.card__tags {
  display: block;
  color: var(--mid);
}

.card:hover .card__img,
.card:focus-visible .card__img {
  transform: scale(1.04);
}

/* ---------- Proyecto: texto fijo a la izquierda, imágenes a la derecha ---------- */
.project {
  display: grid;
  grid-template-columns: var(--pnav-w) minmax(280px, 1fr) minmax(0, 2fr);
  column-gap: 56px;
  padding-top: 24px;
}

.project__gallery {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  animation: fade-in var(--slow) var(--ease) 0.2s both;
}

.project__info {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  scrollbar-width: none;
  animation: fade-up var(--slow) var(--ease) 0.1s both;
}

.project__info::-webkit-scrollbar {
  display: none;
}

.project__title {
  margin-bottom: 20px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.project__meta {
  display: grid;
  grid-template-columns: max-content 1fr;   /* la columna de etiquetas se ajusta a la más larga */
  column-gap: 16px;
  row-gap: 2px;
  margin-bottom: 28px;
}

.project__meta-row {
  display: contents;
}

.project__meta-key {
  color: var(--mid);
}

.project__text {
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.project__lead {
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.project__paragraph {
  color: var(--soft);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.project__img,
.project__figure--video {
  position: relative;
  cursor: pointer;
}

.vbtn {
  position: absolute;
  top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #fff;
  border-radius: 50%;
  background: none;
  color: #fff;
  mix-blend-mode: difference;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.3s var(--ease);
}

.vbtn:hover,
.vbtn:focus-visible {
  opacity: 1;
  transform: scale(1.08);
}

.vfull { right: 12px; }
.vsound { right: 50px; }

.vsound .vsound__on,
.is-sound .vsound .vsound__off {
  display: none;
}

.is-sound .vsound .vsound__on {
  display: block;
}

.project__video {
  width: 100%;
  background: #f2f2f2;
}

/* Aparición suave al hacer scroll (navegadores compatibles, sin JS) */
@supports (animation-timeline: view()) {
  .project__figure {
    animation: fade-up linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 35%;
  }
}

/* ---------- Barra lateral: otros proyectos (toda la altura) ---------- */
.project {
  --pnav-w: 84px;
}

.pnav {
  grid-column: 1;
  grid-row: 1;
  position: fixed;
  top: calc(var(--header-h) + 8px);
  left: var(--gutter);
  z-index: 5;
  width: var(--pnav-w);
  height: calc(100vh - var(--header-h) - 32px);
}

.pnav__list {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  height: 100%;
}

.pnav__item {
  flex: 0 1 auto;
  min-height: 0;
  aspect-ratio: 3 / 2;
}

.pnav__link {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.pnav__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  filter: grayscale(0.6);
  transition: opacity 0.3s, filter 0.3s, transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.pnav__link:hover .pnav__img,
.pnav__link:focus-visible .pnav__img,
.pnav__link.is-on .pnav__img {
  opacity: 1;
  filter: none;
}

.pnav__img {
  will-change: transform;
}

/* el proyecto actual queda desplazado a la derecha; al pasar el ratón, los demás se desplazan igual */
.pnav__link:hover .pnav__img,
.pnav__link:focus-visible .pnav__img,
.pnav__link.is-on .pnav__img {
  position: relative;
  z-index: 2;
  transform: translateX(18px);
}

.pnav__label {
  position: absolute;
  left: 24px;                 /* sobre la miniatura (ya desplazada), sin tapar el texto */
  bottom: 6px;
  z-index: 3;
  padding: 2px 5px;
  background: var(--ink);
  color: var(--paper);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s, transform 0.35s var(--ease);
}

.pnav__link:hover .pnav__label,
.pnav__link:focus-visible .pnav__label {
  opacity: 1;
  transform: none;
}

/* ---------- Pager (anterior / siguiente) ---------- */
.pager {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: var(--gap);
  margin-top: 96px;
  padding: 28px 0 56px;
  border-top: 1px solid var(--line);
}

.pager__link {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pager__link--next {
  text-align: right;
}

.pager__label {
  color: var(--mid);
}

.pager__title {
  align-self: flex-start;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.pager__link--next .pager__title {
  align-self: flex-end;
}

.pager__link:hover .pager__title,
.card:hover .card__title {
  border-color: var(--ink);
}

/* ---------- About ---------- */
.about__intro {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: var(--gap);
  padding: 88px 0 64px;
  animation: fade-up var(--slow) var(--ease) 0.1s both;
}

.about__title {
  font-size: 13px;
  font-weight: 500;
}

.about__me {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  filter: grayscale(0.15);
}

/* Escritorio: la foto ocupa exactamente la altura del bloque de texto */
@media (min-width: 1101px) {
  .about__portrait {
    position: relative;
    align-self: stretch;
  }

  .about__me {
    position: absolute;
    top: 0;
    left: 0;
    width: auto;
    max-width: none;
    height: 100%;
  }
}

.about__illustration {
  width: 100%;
  max-width: 200px;
}

.about__text {
  display: flex;
  flex-direction: column;
  gap: 1em;
  max-width: 600px;
}

.about__lead {
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.about__paragraph {
  color: var(--soft);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.about__photo {
  overflow: hidden;
  animation: fade-in var(--slow) var(--ease) 0.25s both;
}

.about__photo-img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
}

.about__columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  padding: 56px 0 96px;
}

.about__heading {
  margin-bottom: 10px;
  color: var(--mid);
  font-size: 12px;
  font-weight: 400;
}

.about__item {
  padding: 2px 0;
}

.about__link {
  border-bottom: 1px solid var(--ink);
}

.about__link:hover {
  color: var(--mid);
  border-color: var(--mid);
}

/* ---------- Footer ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px var(--gutter);
  border-top: 1px solid var(--line);
}

.footer__copy {
  color: var(--mid);
}

.footer__list {
  display: flex;
  gap: 18px;
}

.footer__list {
  gap: 14px;
}

.footer__link {
  display: block;
  color: var(--ink);
  transition: opacity 0.2s, transform 0.3s var(--ease);
}

.footer__link:hover {
  transform: translateY(-2px);
}

.footer__icon {
  display: block;
}

.footer__link:hover {
  opacity: 0.45;
}

/* ---------- Barra de servicios ---------- */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.marquee__track {
  display: inline-flex;
  animation: marquee 50s linear infinite;
}

.marquee__track span {
  padding-right: 0.5em;
}

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

/* ---------- Hero: carrusel + presentación en una pantalla ---------- */
.hero {
  display: flex;
  flex-direction: column;
  height: calc(100svh - var(--header-h));
  min-height: 520px;
  margin-top: calc(var(--header-h) * -1);
  padding-top: var(--header-h);
  box-sizing: content-box;
}

.ring {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.ring__view {
  position: absolute;
  inset: 0;
  perspective: 2200px;
  perspective-origin: 50% 45%;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
}

.ring__view.is-drag {
  cursor: grabbing;
}

.ring__stage {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
}

.ring__card {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  backface-visibility: hidden;
  will-change: transform, opacity;
  -webkit-user-drag: none;
}

.ring__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.ring__card:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 6px;
}

/* Texto sobre las imágenes en modo "diferencia" (se invierte al cruzarlas) */
.ring__caption {
  position: absolute;
  left: 50%;
  top: 80%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transform: translateX(-50%);
}

.ring__info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* botón de sonido del carrusel: mismo círculo con altavoz que los vídeos */
.vbtn.sound {
  position: static;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--ink);
  color: var(--ink);
  mix-blend-mode: normal;
  font: inherit;
  letter-spacing: 0;
  text-transform: none;
}

.sound .vsound__on,
.sound.is-on .vsound__off {
  display: none;
}

.sound.is-on .vsound__on {
  display: block;
}

.ring__title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.ring__info:hover .ring__title {
  border-color: var(--ink);
}

.ring__meta {
  color: var(--mid);
}

.hero__bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 18px var(--gutter) 24px;
}

.hero__aside {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--mid);
}

.sound {
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: none;
  color: var(--ink);
  font: inherit;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}


.hero__scroll {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.page:not(.js-ring) .ring {
  display: none;
}

/* ---------- Etiqueta de sección ---------- */
.main--grid {
  padding-top: 72px;
  padding-bottom: 32px;
}

.section-label {
  margin-bottom: 20px;
  color: var(--mid);
  font-size: 12px;
  font-weight: 400;
}

/* SyncroBeat: portada nueva (3:2) — encuadre que conserva el texto y el reloj */
.card--syncrobeat .card__img,
.card--syncrobeat-img {
  object-position: 50% 50%;
}

/* ---------- Let’s talk ---------- */
.talk {
  padding: 80px var(--gutter) 88px;
}

.talk__link {
  display: inline-flex;
  flex-direction: column;
  gap: 34px;
}

.talk__big {
  white-space: nowrap;
  font-size: clamp(44px, 12.5vw, 190px);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.065em;
}

.talk__arrow {
  display: inline-block;
  margin-left: 0.12em;
  font-weight: 400;
  transition: transform 0.5s var(--ease);
}

.talk__link:hover .talk__arrow {
  transform: translate(0.1em, -0.1em);
}

/* solo la flecha se anima: entra en diagonal al aparecer */
.js .talk__arrow[data-reveal] {
  opacity: 0;
  transform: translate(-0.28em, 0.28em);
  transition: opacity 0.7s var(--ease), transform 0.9s var(--ease);
}

.js .talk__arrow[data-reveal].in {
  opacity: 1;
  transform: none;
}

.js .talk__link:hover .talk__arrow[data-reveal].in {
  transform: translate(0.1em, -0.1em);
}

.talk__mail {
  align-self: flex-start;
  font-size: 15px;
  border-bottom: 1px solid var(--ink);
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.js [data-reveal].in {
  opacity: 1;
  transform: none;
}

/* ---------- About: filas ---------- */
.rows {
  display: grid;
  gap: 56px;
  padding: 64px 0 96px;
}

.rows__block {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: var(--gap);
}

.rows__h {
  padding-top: 10px;
  color: var(--mid);
  font-size: 12px;
  font-weight: 400;
}

.rows__item {
  padding: 8px 0 9px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(14px, 1.2vw, 18px);
  letter-spacing: -0.03em;
  transition: transform 0.5s var(--ease), color 0.3s;
}

.rows__item:first-child {
  border-top: 1px solid var(--line);
}

.rows__item:hover {
  transform: translateX(10px);
}

.rows__link {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.rows__arrow {
  color: var(--mid);
  transition: color 0.3s, transform 0.4s var(--ease);
}

.rows__link:hover .rows__arrow {
  color: var(--ink);
  transform: translate(3px, -3px);
}

/* =========================================================
   Tablet (≤ 1100px)
   ========================================================= */
@media (max-width: 1100px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about__intro {
    grid-template-columns: 1fr 2fr;
  }

  .about__text {
    grid-column: 1 / -1;
  }

  .about__columns {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 40px;
  }

  .project {
    column-gap: 36px;
  }
}

/* ---------- Proyecto apilado (≤ 900px) ---------- */
@media (max-width: 900px) {
  .project {
    display: block;
    padding-top: 0;
  }

  .project__info {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 56px 0 40px;
  }

  .project__text {
    max-width: 600px;
  }

  .pnav {
    position: static;
    width: auto;
    margin: 20px calc(var(--gutter) * -1) 0;
    padding: 0 var(--gutter);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .pnav {
    height: auto;
  }

  .pnav__list {
    flex-direction: row;
    justify-content: flex-start;          /* centrado cortaba la primera miniatura al desbordar */
    height: auto;
    width: max-content;
    padding: 4px 0;
  }

  .pnav__item {
    flex: 0 0 auto;
    aspect-ratio: auto;
  }

  .pnav__link {
    width: 56px;
    height: 42px;
  }

  .pnav__label {
    display: none;
  }

  /* barra arriba: las fotos se deslizan hacia abajo al pasar el ratón */
  .pnav {
    padding-bottom: 14px;
  }

  .pnav__link:hover .pnav__img,
  .pnav__link:focus-visible .pnav__img {
    transform: translateY(8px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  }
}

/* =========================================================
   Móvil (≤ 650px)
   ========================================================= */
@media (max-width: 650px) {
  :root {
    --gutter: 20px;
    --gap: 16px;
    --header-h: 60px;
  }

  .header {
    color: var(--ink);
    mix-blend-mode: normal;
    background: rgba(255, 255, 255, 0.92);
  }

  .header__wordmark,
  .header__chair {
    filter: none;
  }

  .header__link--active {
    border-color: var(--ink);
  }

  .lang {
    border-color: var(--ink);
  }

  .lang__opt {
    color: var(--ink);
  }

  .lang::before {
    background: var(--ink);
  }

  .lang__opt.is-on {
    color: var(--paper);
  }

  .header__link {
    color: var(--ink);
  }

  .hero {
    height: calc(100svh - var(--header-h));
  }

  .hero__bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .header__right {
    gap: 20px;
  }

  .header__burger {
    position: relative;
    z-index: 2;
    order: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 24px;
    height: 24px;
    cursor: pointer;
  }

  .header__burger-line {
    display: block;
    height: 1.5px;
    background: var(--ink);
    transition: transform var(--fast) var(--ease);
  }

  .header__toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  .header__nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0 var(--gutter);
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--fast) var(--ease), padding var(--fast) var(--ease);
  }

  .header__link {
    align-self: flex-start;
    margin: 6px 0;
    color: var(--ink);
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.04em;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
  }

  .header__toggle:checked ~ .header__nav .header__link {
    opacity: 1;
    transform: none;
  }

  .header__toggle:checked ~ .header__nav .header__link + .header__link {
    transition-delay: 0.06s;
  }

  .header__toggle:checked ~ .header__nav {
    max-height: 200px;
    padding: 10px var(--gutter) 20px;
  }

  .header__toggle:checked + .header__burger .header__burger-line:first-child {
    transform: translateY(3.75px) rotate(45deg);
  }

  .header__toggle:checked + .header__burger .header__burger-line:last-child {
    transform: translateY(-3.75px) rotate(-45deg);
  }

  .header__toggle:focus-visible + .header__burger {
    outline: 1px solid var(--ink);
    outline-offset: 4px;
  }

  .intro {
    padding: 48px 0 36px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .about__intro {
    grid-template-columns: 1fr;
    padding: 48px 0 36px;
    gap: 16px;
  }

  .project__info {
    padding: 40px 0 32px;
  }

  .about__photo-img {
    aspect-ratio: 4 / 3;
  }

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

  .pager {
    margin-top: 56px;
  }


  .ring__info {
    min-width: 0;
  }

  .rows__block {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .talk {
    padding: 56px var(--gutter) 64px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* ---------- Accesibilidad: menos movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================
   Combinación tipográfica: mono para etiquetas y títulos pequeños,
   Switzer para textos grandes y cuerpos
   ========================================================= */
.ring__title,
.ring__meta,
.intro__name,
.card__title,
.card__tags,
.card__year,
.rows__h,
.about__title,
.project__title,
.project__meta,
.pager__label,
.pager__title,
.pnav__label,
.marquee,
.sound,
.talk__mail,
.footer__copy {
  font-family: var(--mono);
  font-weight: 400;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.ring__title,
.card__title,
.pager__title {
  font-size: 12px;
}

.ring__meta,
.card__tags,
.card__year,
.project__meta,
.pager__label,
.pnav__label,
.sound,
.vsound,
.footer__copy {
  font-size: 11px;
}

.rows__h,
.about__title,
.intro__name,
.project__title {
  font-size: 12px;
}

.talk__mail {
  text-transform: none;
}

/* ---------- Visor a pantalla completa ---------- */
.project__img {
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.98);
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0s 0.35s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s var(--ease);
}

/* tira deslizable: horizontal en ordenador */
.lightbox__track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.lightbox__track::-webkit-scrollbar {
  display: none;
}

.lightbox__track.is-dragging {
  scroll-snap-type: none;
  cursor: grabbing;
  user-select: none;
}

.lightbox__slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.lightbox__img {
  max-width: calc(100vw - 160px);
  max-height: calc(100vh - 96px);
  object-fit: contain;
  transform: scale(0.97);
  transition: transform 0.45s var(--ease);
  -webkit-user-drag: none;
}

.lightbox.is-open .lightbox__img {
  transform: none;
}

.lightbox__video {
  cursor: pointer;
}

.lightbox__close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  padding: 12px;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  transition: opacity 0.2s;
}

.lightbox__close:hover {
  opacity: 0.45;
}

.is-lb {
  overflow: hidden;
}

/* móvil: la tira se desliza en vertical */
@media (max-width: 650px) {
  .lightbox__track {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
  }

  .lightbox__slide {
    flex: 0 0 100%;
    width: 100%;
  }

  .lightbox__img {
    max-width: 100vw;
    max-height: calc(100% - 120px);
  }
}

.project__figure--mute {
  position: relative;
}

/* Nombres de proyecto en mono medium */
.project__title,
.card__title,
.ring__title,
.pager__title {
  font-weight: 500;
}

/* Presentación: una frase por línea y entrada escalonada tras el carrusel */
.intro__line {
  display: block;
}

.js-ring .intro {
  animation: none;
}

.js-ring .intro__name,
.js-ring .intro__line {
  opacity: 0;
  filter: blur(6px);
  transform: translateY(14px);
  transition: opacity 0.8s var(--ease), transform 0.9s var(--ease), filter 0.8s var(--ease);
}

.js-ring .is-ready .intro__name,
.js-ring .is-ready .intro__line {
  opacity: 1;
  filter: none;
  transform: none;
}

.js-ring .is-ready .intro__line:nth-child(1) { transition-delay: 0.12s; }
.js-ring .is-ready .intro__line:nth-child(2) { transition-delay: 0.24s; }

@media (max-width: 650px) {
  .intro__line {
    display: inline;
  }
}

/* Iconos SVG en flechas y paginación */
.talk__arrow {
  display: inline-flex;
  vertical-align: baseline;
}

.talk__icon {
  width: 0.66em;
  height: 0.66em;
  stroke-width: 3.6;
}

.rows__arrow,
.pager__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lightbox__close svg {
  display: block;
}

/* Botón de descarga del CV */
.btn-cv {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 0.6em;
  padding: 10px 18px 10px 20px;
  border-radius: 99px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 500;
  transition: transform 0.3s var(--ease), background 0.3s;
}

.btn-cv:hover,
.btn-cv:focus-visible {
  background: #2a2a2a;
  transform: translateY(-2px);
}

.btn-cv:hover .btn-cv__icon {
  animation: cv-drop 0.6s var(--ease);
}

@keyframes cv-drop {
  40% { transform: translateY(3px); }
}

/* Navegación entre proyectos: en ordenador solo la barra de la izquierda; en tablet/móvil solo anterior/siguiente */
@media (min-width: 901px) {
  .pager {
    display: none;
  }
}

@media (max-width: 900px) {
  .pnav {
    display: none;
  }
}

/* Vistas previas en movimiento de la galería */
.card__media {
  position: relative;
}

.card__clip,
.card__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--ease);
}

.is-previewing .card__clip {
  opacity: 1;
}

/* pase de fotos: cada imagen entra con fundido y hace un zoom lento */
.card__slide {
  transform: scale(1);
  transition: opacity 0.9s var(--ease), transform 0s 0.9s;
}

.card__slide.is-on {
  opacity: 1;
  transform: scale(1.09);
  transition: opacity 0.9s var(--ease), transform 4.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Premios en Sobre mí: fichas con la miniatura del proyecto */
.awards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  padding-top: 8px;
}

.award__link {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.award__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  margin-bottom: 6px;
  background: #f2f2f2;
}

.award__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

.award__link:hover .award__img,
.award__link:focus-visible .award__img {
  transform: scale(1.04);
}

.award__rank {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.award__name {
  font-size: 14px;
  line-height: 1.3;
}

.award__project {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--mid);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  transition: color 0.2s;
}

.award__link:hover .award__project {
  color: var(--ink);
}

/* premio sin proyecto en la web: ficha de texto, a la altura de las otras */
.award--text {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
  align-self: start;
}



@media (max-width: 900px) {
  .awards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .awards {
    grid-template-columns: 1fr;
  }
}

/* Sobre mí: la foto se alinea solo con el texto; los botones del CV van en una fila aparte */
.about__cv {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.about__cv .btn-cv {
  margin-top: 0;
}

@media (min-width: 1101px) {
  .about__intro {
    column-gap: 56px;
    row-gap: 28px;
  }

  .about__title { grid-column: 1; grid-row: 1; }
  .about__portrait { grid-column: 2; grid-row: 1; }
  .about__text { grid-column: 3; grid-row: 1; }
  .about__cv { grid-column: 3; grid-row: 2; }
}

@media (max-width: 1100px) {
  .about__cv {
    grid-column: 1 / -1;
  }
}

/* Menú móvil: enlaces a la derecha, bajo la hamburguesa, y los iconos de contacto debajo */
.header__social {
  display: none;
}

@media (max-width: 650px) {
  .header__nav {
    align-items: flex-end;
    text-align: right;
  }

  .header__nav .header__link {
    align-self: flex-end;
  }

  .header__social {
    display: flex;
    gap: 18px;
    margin-top: 12px;
    opacity: 0;
    transition: opacity 0.3s var(--ease) 0.1s;
  }

  .header__toggle:checked ~ .header__nav .header__social {
    opacity: 1;
  }

  .header__icon {
    display: block;
    color: var(--ink);
  }

  .header__icon svg {
    display: block;
  }
}

.vbtn.sound svg {
  width: 12px;
  height: 12px;
}
