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

html,
body {
  background: #fff;
  color: #000;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}

/* El pie de página siempre queda pegado abajo del todo del contenido de
   cada página: si el contenido es corto, al final de la ventana; si es
   largo (como una página de proyecto), después de todo, sin taparlo. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Las medidas están en vw a partir del diseño (1547 px de ancho) */

/* ---------- Vídeo de entrada ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.8s ease;
}

.intro.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.intro__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Cabecera ---------- */
.header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.header__brand {
  position: absolute;
  top: 1.4vw;
  left: 1.9vw;
}

.header__logo {
  display: block;
  width: 13vw;
  height: auto;
}

.header__langs {
  display: flex;
  gap: 1.1vw;
  margin-top: 0.75vw;
  padding-left: 1.1vw;
  font-size: 0.9vw;
}

.header__nav {
  position: absolute;
  top: 2.1vw;
  right: 3.3vw;
  display: flex;
  gap: 3vw;
  font-size: 1.45vw;
}

/* ---------- Cuadrícula ---------- */
.home {
  padding: 18vw 7.4vw 8vw 6.6vw;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 4.9vw;
  row-gap: 4vw;
}

.card {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #dfdfdf;
  display: block;
  color: inherit;
  text-decoration: none;
}

.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card__img[src*="dual"] {
  object-position: 50% 60%;
}

/* Al pasar el cursor: se oscurece y aparece el nombre */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.card__title {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  font-size: 2.9vw;
  line-height: 1.2;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.card__title-small {
  display: inline-block;
  font-size: 0.6em;
  margin-top: -0.5em;
}

.card:hover::after,
.card:hover .card__title {
  opacity: 1;
}

/* ---------- Botones de la cabecera (o enlaces, en las páginas de proyecto) ---------- */
.header__nav button,
.header__nav a {
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

/* ---------- Pantalla ABOUT (medidas a partir del diseño de 1904 px) ---------- */
.about {
  padding: 10.4vw 0 8vw 5.25vw;
  font-size: 0.92vw;
  line-height: 1.32;
  font-weight: 300;
  hyphens: manual;
}

.about[hidden],
.home[hidden],
.work[hidden] {
  display: none;
}

.about__title {
  font-size: 3.1vw;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.about__layout {
  display: grid;
  grid-template-columns: 36.2vw 29.1vw 1fr;
  grid-template-areas:
    'photo bio contact'
    'left experience awards';
  margin-top: 2.7vw;
  align-items: start;
}

.about__photo {
  grid-area: photo;
  width: 27.1vw;
  height: auto;
  display: block;
}

.about__bio {
  grid-area: bio;
  width: 23.1vw;
  margin-top: 0.4vw;
  font-size: 0.83vw;
  line-height: 1.33;
}

.about__bio p + p {
  margin-top: 1.33em;
}

.about__contact {
  grid-area: contact;
}

.about__left {
  grid-area: left;
  margin-top: 1.5vw;
}

.about__experience {
  grid-area: experience;
  margin-top: 1.5vw;
}

.about__awards {
  grid-area: awards;
  margin-top: 1.5vw;
}

.about__heading {
  font-size: inherit;
  font-weight: 500;
  line-height: inherit;
  margin-bottom: 1.32em;
}

.about__heading--bold {
  font-weight: 700;
}

.about section p + p {
  margin-top: 1.32em;
}

.about strong {
  font-weight: 600;
}

.about__name {
  font-weight: 600;
}

.about__small {
  font-size: 0.79vw;
}

.about__strong {
  font-weight: 500;
}

.about__left section + section {
  margin-top: 3.6em;
}

.about__awards p {
  max-width: 22.4vw;
}

/* Al pasar el cursor o pulsar WORK / ABOUT / logo: 60 % transparente */
.header__nav button:hover,
.header__nav a:hover,
.header__home:hover,
.header__home:active,
.header__nav button:active,
.header__nav a:active {
  opacity: 0.4;
}

/* Logo: botón para volver a la pantalla principal */
.header__home {
  display: block;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* Títulos de Formación, Habilidades, Experiencia y Reconocimientos: 2pt más grandes */
.about__heading--lg {
  font-size: calc(0.92vw + 2pt);
}

/* ---------- Pie de página (igual en todas las pantallas) ---------- */
.site-footer {
  margin-top: auto;
  padding: 1.4vw 0;
  text-align: center;
  font-size: 0.75vw;
  color: #8c8c8c;
}

.site-footer a,
.about__contact a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover,
.about__contact a:hover {
  text-decoration: underline;
}

/* ---------- Pantalla WORK (mismas medidas base que ABOUT) ---------- */
.work {
  padding: 10.4vw 0 8vw 5.25vw;
}

.work__title {
  font-size: 3.1vw;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.work__layout {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 3.4vw;
  padding-right: 8vw;
}

.work__list {
  list-style: none;
  white-space: nowrap;
}

.work__item {
  display: block;
  background: none;
  border: 0;
  padding: 0;
  margin: 0 0 2.4vw;
  font-family: inherit;
  font-size: 1.65vw;
  line-height: 1;
  font-weight: 400;
  color: #000;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  opacity: 1;
  transform: scale(1);
  transform-origin: left center;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.work__list li:last-child .work__item {
  margin-bottom: 0;
}

.work__item em {
  font-style: italic;
}

.work__x {
  font-style: normal;
}

.work__small {
  font-size: 0.55em;
}

.work__item:hover,
.work__item:focus-visible {
  opacity: 0.4;
  transform: scale(1.16);
}

.work__photo-wrap {
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.work__photo-wrap.is-visible {
  opacity: 1;
}

.work__photo {
  width: 23.5vw;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.work__caption {
  margin-top: 0.9vw;
  font-size: 0.85vw;
  line-height: 1;
  text-align: center;
  color: #000;
}

/* ==========================================================================
   Páginas de proyecto individual (work/*.html)
   Medidas a partir del diseño de DELÀVIA, de 752px de ancho de referencia.
   ========================================================================== */
.project {
  padding: 11.3vw 5.6vw 8vw;
  font-weight: 300;
}

/* ---------- Intro: título + ficha + dos fotos ---------- */
.project__intro {
  display: flex;
  justify-content: space-between;
  gap: 2vw;
}

.project__intro-text {
  width: 30.6vw;
  flex-shrink: 0;
}

.project__title {
  font-size: 4.5vw;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.project__meta {
  margin-top: 0.8vw;
  font-size: 1.86vw;
  font-weight: 600;
}

.project__p {
  margin-top: 2.6vw;
  font-size: 0.98vw;
  line-height: 1.45;
}

.project__p strong {
  font-weight: 600;
}

.project__p--small {
  font-size: 0.98vw;
  line-height: 1.5;
}

.project__list {
  list-style: none;
  margin-top: 2.6vw;
  font-size: 0.98vw;
  line-height: 1.45;
  word-break: break-word;
}

.project__list a {
  color: inherit;
}

.project__hero {
  display: flex;
  align-items: flex-start;
  gap: 2.9vw;
}

.project__hero img {
  width: 22.6vw;
  aspect-ratio: 170 / 300;
  object-fit: cover;
  display: block;
}

.project__hero img:last-child {
  width: 29.9vw;
  aspect-ratio: 225 / 300;
}

/* ---------- Galería de piezas (8 renders) ---------- */
.project__gallery {
  margin-top: 6.4vw;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.87vw 2.5vw;
  max-width: 46vw;
}

/* Recuadro cuadrado con "padding-top: 100%" en vez de aspect-ratio:
   en Safari, aspect-ratio combinado con una posición de imagen
   personalizada (ver más abajo) podía dejar un hueco gris debajo de
   la foto. Este método es compatible con todos los navegadores. */
.project__gallery-thumb {
  position: relative;
  width: 100%;
  padding-top: 100%;
  background: #b1b1b1;
  overflow: hidden;
}

.project__gallery-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Cada pieza está encuadrada de forma distinta en su foto original;
   esto solo centra la joya dentro del recuadro. Son las fotos
   originales tal cual, sin recortar ni añadir nada. */
.project__gallery-thumb img[src*="anillo-01"] { object-position: 50% 49%; }
.project__gallery-thumb img[src*="anillo-02"] { object-position: 50% 53%; }
.project__gallery-thumb img[src*="anillo-03"] { object-position: 50% 27%; }
.project__gallery-thumb img[src*="anillo-04"] { object-position: 50% 41%; }
.project__gallery-thumb img[src*="anillo-05"] { object-position: 50% 53%; }
.project__gallery-thumb img[src*="pulsera-01"] { object-position: 50% 46%; }
.project__gallery-thumb img[src*="pendiente-01"] { object-position: 50% 46%; }
.project__gallery-thumb img[src*="colgante-03"] { object-position: 50% 27%; }

.project__gallery figcaption {
  margin-top: 0.6vw;
  font-size: 0.84vw;
  color: #000;
}

/* ---------- Pieza destacada + texto ---------- */
.project__feature {
  margin-top: 6vw;
  margin-left: 28.3vw;
  display: flex;
  align-items: flex-start;
  gap: 5.3vw;
}

.project__feature-img {
  width: 33.2vw;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #b1b1b1;
  display: block;
}

/* Visor 3D del anillo (STL), fondo blanco */
.project__ring3d {
  position: relative;
  background: #fff;
  overflow: hidden;
  cursor: grab;
}

.project__ring3d canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.project__ring3d-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9vw;
  color: #999;
  pointer-events: none;
}

.project__feature-side {
  width: 30.6vw;
  margin-top: 12.4vw;
}

.project__slider {
  width: 28.6vw;
  height: 1px;
  background: #000;
  position: relative;
}

.project__slider span {
  position: absolute;
  top: 50%;
  left: 18%;
  width: 1.2vw;
  height: 1.2vw;
  background: #000;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;
}

.project__slider span:active {
  cursor: grabbing;
}

.project__feature-side .project__p {
  margin-top: 4.4vw;
}

/* ---------- Segunda pareja de fotos ---------- */
.project__pair {
  margin-top: 8.5vw;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.project__pair-item {
  width: 36.2vw;
}

.project__pair-item--book {
  width: 44.5vw;
  margin-top: 14.8vw;
}

.project__pair-item--proceso {
  width: 29vw;
  margin-left: 14vw;
}

.project__pair-item--piernas {
  width: 29vw;
}

.project__pair-item--gorra,
.project__pair-item--apilados {
  width: 32.6vw;
}

.project__pair-item--caja {
  width: 29vw;
}

/* Galería de fotos que pasa sola, dentro de la segunda pareja de fotos */
.project__carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 1000 / 679;
  overflow: hidden;
  background: #fff;
}

.project__carousel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.project__carousel img.is-active {
  opacity: 1;
}

.project__carousel-prev,
.project__carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.6vw;
  height: 2.6vw;
  border: 0;
  background: none;
  color: #fff;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.5));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.project__carousel-prev {
  left: 0.9vw;
}

.project__carousel-next {
  right: 0.9vw;
}

.project__carousel-prev:hover,
.project__carousel-next:hover {
  opacity: 0.75;
}

.project__carousel--book {
  aspect-ratio: 1280 / 906;
}

.project__carousel-caption {
  margin-top: 0.6vw;
  font-size: 0.84vw;
  color: #000;
}

/* ---------- Foto de cierre: galería de fotos verticales, centrada ---------- */
.project__closing {
  margin-top: 6.6vw;
  display: flex;
  justify-content: center;
}

.project__closing .project__pair-item {
  width: auto;
}

.project__carousel--studio-v {
  width: 21vw;
  aspect-ratio: 2 / 3;
}

/* ---------- Galerías de Ballet Chicago ---------- */
.project__carousel--gorra { aspect-ratio: 2 / 3; }
.project__carousel--proceso { aspect-ratio: 4 / 3; }
.project__carousel--caja { aspect-ratio: 3 / 4; }
.project__carousel--apilados { aspect-ratio: 3 / 2; }
.project__carousel--piernas { aspect-ratio: 17 / 20; }

.project__logo-block {
  width: fit-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4vw;
}

.project__logo-block img {
  display: block;
}

.project__logo-type {
  width: 26vw;
}

.project__closing-group {
  display: flex;
  align-items: flex-start;
  gap: 2vw;
}

.project__closing-group .project__logo-block {
  margin-right: -4vw;
}

.project__closing-text {
  width: 26vw;
}

/* ---------- Foto principal fija (p.ej. Massís de fulles) ---------- */
.project__title--disfrutar {
  font-size: 4.05vw;
  white-space: nowrap;
}

.project__intro-text--disfrutar {
  width: 37vw;
}

.project__meta--disfrutar {
  font-size: 1.3vw;
  white-space: nowrap;
}

.project__hero-plain {
  width: 30vw;
  aspect-ratio: 7 / 5;
  object-fit: cover;
  flex-shrink: 0;
  align-self: flex-start;
  display: block;
  margin-right: 10vw;
}

.project__pair--dual-trio {
  gap: 2vw;
}

.project__pair-item--dual-trio {
  width: 23vw;
}

.project__carousel--dual-trio {
  aspect-ratio: 5 / 4;
}

.project__carousel--dual-closing {
  aspect-ratio: 4 / 3;
}

.project__hero-plain--dual {
  width: 24vw;
  aspect-ratio: 1004 / 1400;
}

.project__closing .project__pair-item--dual-closing {
  width: 32.94vw;
}

.project__disfrutar-img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.project__pair-item--disfrutar-detail {
  margin-top: 10vw;
}

.project__carousel--disfrutar {
  aspect-ratio: 7 / 5;
}

.project__carousel--disfrutar-02 {
  aspect-ratio: 5 / 7;
}

/* ---------- Foto que cambia al pasar el cursor (p.ej. Ballet Chicago) ---------- */
.project__hero-single {
  position: relative;
  width: 25vw;
  aspect-ratio: 3 / 2;
  flex-shrink: 0;
  overflow: hidden;
  background: #d9d9d9;
  margin-right: 9vw;
}

.project__hero-single img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
  transition: opacity 0.35s ease;
}

.project__hero-single img.is-back {
  opacity: 0;
}

.project__hero-single.is-swapped img.is-front {
  opacity: 0;
}

.project__hero-single.is-swapped img.is-back {
  opacity: 1;
}
