/* Bloques de la página, en el orden en que aparecen. */
/* ---------- portada ---------- */
.hero {
  height: 100svh;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.hero-img {
  position: relative;
  overflow: hidden;
  min-width: 0;
  height: 100%;
}

/* fondo desenfocado con la misma foto (--hero-bg lo pone js/carpetas.js) */
.hero-img::before {
  content: "";
  position: absolute;
  inset: -60px;
  background: var(--hero-bg) 0 50%/cover;
  filter: blur(40px);
}
.hero-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 36% 48%;
  transform: scale(1.06);
  transition: transform 2.2s cubic-bezier(.2, .7, .1, 1);
}
.loaded .hero-img img {
  transform: scale(1);
}
.hero-title {
  position: relative;
  grid-column: 2;
  align-self: end;
  padding: clamp(20px, 4vw, 64px);
  text-align: right;
  color: var(--ink);
  line-height: 1;
  transform: translateX(-95px);
}
.hero-title h1 {
  font-weight: 300;
  font-size: clamp(56px, 9.5vw, 170px);
  letter-spacing: -.03em;
  line-height: .95;
}
.hero-title .y {
  font-weight: 300;
  font-size: clamp(26px, 4.2vw, 76px);
  margin-top: .1em;
}
.hero-title .who {
  font-style: italic;
  font-weight: 300;
  font-size: clamp(18px, 2.9vw, 52px);
  margin-top: .5em;
}

@media (max-width: 980px) {
  .hero-img::before {
    display: none;
  }
  .hero-title {
    padding: 12px;
  }
  .hero-title h1 {
    font-size: clamp(28px, 7.2vw, 54px);
  }
  .hero-title .y {
    font-size: clamp(18px, 5vw, 32px);
  }
  .hero-title .who {
    font-size: clamp(12px, 3.1vw, 20px);
  }
}

@media (max-width: 620px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: clamp(10px, 2vh, 16px);
  }
  .hero-img {
    grid-column: 1;
    grid-row: 1;
  }
  .hero-title {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
    padding: 0 24px calc(60px + env(safe-area-inset-bottom));
    text-align: left;
    transform: none;
  }
  .hero-title h1 {
    font-size: clamp(38px, 12vw, 62px);
  }
  .hero-title .y {
    font-size: clamp(24px, 7vw, 36px);
  }
  .hero-title .who {
    font-size: clamp(15px, 4.4vw, 22px);
  }
}

/* ---------- secciones ---------- */
.sec + .sec {
  padding-top: clamp(36px, 5vw, 64px);
}
.sec-head {
  display: flex;
  justify-content: space-between;
  padding: 14px var(--pad);
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.sec-head b {
  color: var(--ink);
  font-weight: 500;
}
.headline {
  padding: clamp(32px, 5vw, 72px) var(--pad) var(--title-gap);
  max-width: 1200px;
}
.headline h2 {
  font-weight: 500;
  font-size: clamp(40px, 7vw, 108px);
  line-height: 1.12;
  letter-spacing: -.045em;
}
.headline h2 em {
  font-family: inherit;
  font-style: normal;
  font-weight: inherit;
  letter-spacing: inherit;
  font-size: 1em;
}

@media (max-width: 620px) {
  .sec-head .r {
    display: none;
  }
}

/* ---------- proyectos: título, texto a la izquierda y álbum a la derecha ---------- */
.project {
  border-top: 1px solid var(--line);
}
.sec-head + .project {
  border-top: 0;
}
.p-title {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  padding: clamp(28px, 4vw, 52px) var(--pad) var(--title-gap);
  gap: 20px;
}
.p-title h3 {
  font-weight: 500;
  font-size: clamp(46px, 8vw, 120px);
  line-height: 1.08;
  letter-spacing: -.05em;
}
.p-title .meta {
  text-align: right;
  color: var(--muted);
}
.proj {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
  gap: clamp(24px, 4vw, 64px);
  padding: 0 var(--pad) clamp(50px, 7vw, 100px);
  align-items: start;
}
.proj-text h4 {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--muted);
  margin: 26px 0 10px;
}
.proj-text h4:first-child {
  margin-top: 0;
}
.proj-text p {
  font-size: 15.5px;
  margin-bottom: 12px;
  max-width: 560px;
}
.proj-text p strong {
  font-weight: 500;
}
.dash {
  list-style: none;
  font-size: 15.5px;
  margin-bottom: 12px;
}
.dash li {
  padding-left: 18px;
  position: relative;
  margin-bottom: 6px;
}
.dash li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .proj {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .p-title {
    grid-template-columns: 1fr;
  }
  .p-title .meta {
    text-align: left;
  }
}

/* ---------- sobre mí ---------- */
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  border-top: 1px solid var(--line);
}
#sobre .intro {
  margin-top: clamp(36px, 5vw, 72px);
}
.intro .ph {
  overflow: hidden;
  width: min(82%, 520px);
  aspect-ratio: 4/5;
  min-height: 0;
  justify-self: center;
  align-self: center;
  margin: clamp(24px, 4vw, 52px) auto;
}
.intro .body {
  padding: clamp(28px, 5vw, 70px) var(--pad);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
}
.intro .hello {
  font-family: var(--mono);
  font-size: clamp(30px, 3.9vw, 58px);
  line-height: .95;
}
.intro .lead {
  font-size: clamp(15.2px, 1.44vw, 19.2px);
  max-width: 560px;
  text-align: left;
  text-wrap: pretty;
}

@media (min-width: 981px) {
  #sobre .intro .ph {
    position: relative;
    top: clamp(0px, 2.8vw, 48px);
  }
}

@media (max-width: 980px) {
  .intro {
    grid-template-columns: minmax(0, 1fr);
  }
  .intro .ph {
    width: min(86%, 440px);
    aspect-ratio: 4/5;
    min-height: 0;
    margin: 24px auto 0;
  }
  .intro .body {
    padding-top: 24px;
  }
}
/* móvil: los tres botones (CV, Instagram, idioma) en una sola fila, con letra y relleno según el ancho */
@media (max-width: 620px) {
  .intro .btns {
    flex-wrap: nowrap;
    gap: 6px;
  }
  .intro .btns .btn {
    padding: 12px clamp(10px, 3.6vw, 17px);
    font-size: clamp(10px, 3.15vw, 12.5px);
    letter-spacing: .06em;
    white-space: nowrap;
  }
}

/* ---------- triplet: columna con álbum, croquis y materiales ---------- */
.triplet-column {
  min-width: 0;
}
.triplet-column > .album {
  position: relative;
  top: 0;
}
.triplet-details {
  width: 100%;
  max-width: 660px;
  margin: 24px auto 0;
}
.triplet-dimensions {
  width: 100%;
  padding: 0;
}
.triplet-dimensions picture {
  display: block;
  width: 100%;
}
.triplet-dimensions img {
  display: block;
  width: 65%;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  opacity: .82;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.proj-text p.material-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
}

/* ceñida: secuencia de montaje debajo del álbum (como el croquis de triplet) */
.proj-column {
  min-width: 0;
}
.proj-column > .album {
  position: relative;
  top: 0;
}
.montaje {
  width: 100%;
  max-width: 660px;
  margin: 24px auto 0;
}
.montaje img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
@media (max-width: 980px) {
  /* en una columna: álbum, texto y, al final, el montaje a todo el ancho */
  .proj-column {
    display: contents;
  }
  .montaje {
    order: 1;
    max-width: none;
    margin-top: 0;
  }
}

/* muestras de material: recortes de una misma imagen */
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(8px, 1.15vw, 16px);
  margin-top: 14px;
}
.swatches i {
  flex: 0 0 clamp(48px, 4.5vw, 72px);
  aspect-ratio: 1;
  border-radius: 12px;
  display: block;
  background-repeat: no-repeat;
}
.swatches .felt-sand,
.swatches .felt-charcoal,
.swatches .felt-blue,
.swatches .felt-green {
  background-image: url("../assets/img/fieltro-pet-muestras.png");
  background-size: 470% auto;
}
.swatches .felt-sand {
  background-position: 5% 54%;
}
.swatches .felt-charcoal {
  background-position: 35.1% 54%;
}
.swatches .felt-blue {
  background-position: 65.1% 54%;
}
.swatches .felt-green {
  background-position: 95.4% 54%;
}
.swatches .terrazzo {
  background-image: url("../assets/img/terrazo-pet-muestras.png");
  background-size: 145% auto;
  background-position: 60% 37%;
}

@media (min-width: 981px) {
  .triplet-dimensions img {
    width: 70%;
  }
}

@media (max-width: 980px) {
  .triplet-column {
    order: -1;
    width: 100%;
  }
  .triplet-details {
    max-width: none;
    margin-top: 20px;
  }
}

/* ---------- fotografía: categorías que llevan a su primera foto ---------- */
.proj-text h4.photo-categories button {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
}
.proj-text h4.photo-categories button:hover,
.proj-text h4.photo-categories button:focus-visible {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.proj-text h4.photo-categories button:focus-visible {
  outline: 2px solid var(--sep);
  outline-offset: 3px;
}

/* ---------- gráfico: El archivo de Gustavo ---------- */
#grafico .headline h2 {
  font-family: "Gustavo", var(--hand);
  font-weight: 400;
  font-size: clamp(48px, 8.4vw, 130px);
  line-height: 1.12;
  letter-spacing: 0;
}

/* campo discreto para probar la tipografía Gustavo */
.font-playground {
  width: 100%;
  margin-top: 26px;
}
.font-playground label {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11pt;
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: 0;
}
.font-playground input {
  display: block;
  width: 100%;
  height: 44px;
  padding: 5px 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: 'Gustavo', var(--hand);
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.1;
  outline: none;
}
.font-playground input::placeholder {
  color: var(--muted);
  opacity: .58;
}
.font-playground input:focus {
  border-bottom-color: var(--muted);
}

/* ---------- botones ---------- */
.btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 14px 20px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: .25s;
}
.btn.dark {
  background: var(--ink);
  color: var(--bg);
}
.btn:hover {
  transform: translateY(-2px);
}
/* el botón de idioma es un <button>: quitarle el aspecto por defecto para que sea igual que los enlaces */
button.btn {
  background: none;
  color: inherit;
  font-weight: inherit;
  line-height: inherit;
  cursor: pointer;
}
.btn[hidden] {
  display: none;
}

/* ---------- CV ---------- */
.cv-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  max-width: none;
}
.cv {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cv .cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 26px 22px 30px;
  border: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.cv h4 {
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 12px;
}
.cv .item {
  margin-bottom: 9px;
}
.cv .item b {
  font-weight: 500;
  display: block;
  font-size: 14px;
}
.cv .item small {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
  display: block;
  margin: 1px 0 2px;
}
.cv .item p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.25;
  margin: 2px 0 0;
}
.cv ul {
  list-style: none;
  font-size: 14.5px;
}
.cv ul li {
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.cv ul li span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}

@media (max-width: 980px) {
  .cv {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- contacto: todo centrado en una columna, con la foto arriba ---------- */
.outro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: clamp(40px, 6vw, 88px) var(--pad);
  text-align: center;
  border-top: 1px solid var(--line);
}
.outro .body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.outro h2 {
  font-weight: 500;
  font-size: clamp(30px, 3.6vw, 56px);
  line-height: 1;
  letter-spacing: -.04em;
}
.outro p {
  max-width: 560px;
  font-size: 17px;
  color: var(--muted);
}
.outro .btns {
  justify-content: center;
}
.outro .ph {
  order: -1;
  overflow: hidden;
  width: clamp(150px, 15vw, 210px);
  aspect-ratio: 1;
}
.foot {
  display: flex;
  justify-content: space-between;
  padding: 16px var(--pad);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  .outro .mail-btn {
    font-size: 11px;
    letter-spacing: .05em;
    padding: 14px 16px;
    gap: 0;
    white-space: nowrap;
  }
  .outro .mail-btn .mail-icon {
    display: none;
  }
}
