/* ------------------------------------------------------------
   Portfolio Julen De La Serna
   Escenario negro, tipografía de títulos de crédito, y un solo
   momento memorable: el cursor "play" sobre vídeos en bucle.
------------------------------------------------------------ */

@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #050505;
  --fg: #ebe9e4;
  --muted: #8d8b86;
  --line: #262624;
  --panel: #111110;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pad: clamp(16px, 3.2vw, 48px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img,
video {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3,
p,
ul,
dl,
dd {
  margin: 0;
}
ul {
  padding: 0;
  list-style: none;
}
button {
  font: inherit;
  color: inherit;
}
[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
}

.skip {
  position: absolute;
  left: var(--pad);
  top: -100px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--fg);
  color: var(--bg);
}
.skip:focus {
  top: 12px;
}

/* ---------- cabecera ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px var(--pad);
  background: rgba(5, 5, 5, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.logo img {
  width: 108px;
  height: auto;
}
.nav {
  display: flex;
  gap: clamp(18px, 3vw, 40px);
  font-size: 15px;
}
.nav a {
  white-space: nowrap;
  color: var(--muted);
  transition: color 0.2s;
}
.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--fg);
}
.header-end {
  justify-self: end;
  margin-left: 14px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.lang {
  position: relative;
  font-size: 14px;
}
.lang-current {
  padding: 4px 0;
  background: none;
  border: 0;
  font: inherit;
  letter-spacing: 0.05em;
  color: var(--fg);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  cursor: pointer;
}
.lang-menu {
  position: absolute;
  top: 100%;
  right: -10px;
  min-width: calc(100% + 20px);
  margin: 0;
  padding: 8px 10px;
  list-style: none;
  display: grid;
  gap: 2px;
  text-align: right;
  background: rgba(5, 5, 5, 0.94);
  border: 1px solid var(--line);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}
.lang-menu a {
  display: block;
  padding: 4px 0;
  letter-spacing: 0.05em;
  color: var(--muted);
  transition: color 0.2s;
}
.lang-menu a:hover,
.lang-menu a:focus-visible {
  color: var(--fg);
}
.lang.open .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}
@media (hover: hover) and (pointer: fine) {
  .lang:hover .lang-menu,
  .lang:focus-within .lang-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
}
.clock {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}
.clock time {
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

/* ---------- portada ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 18rem);
  align-items: end;
  gap: 24px var(--pad);
  padding: clamp(48px, 7vw, 104px) var(--pad) clamp(36px, 5vw, 72px);
}
.hero h1 {
  font: 400 clamp(40px, 6.2vw, 96px) / 0.98 var(--serif);
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.hero-note {
  color: var(--muted);
  font-size: 15px;
  max-width: 28ch;
  padding-bottom: 0.6em;
}

/* ---------- barra de trabajo ---------- */
.work {
  padding: 0 var(--pad) clamp(72px, 9vw, 128px);
}
.work-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 14px 32px;
  padding: 18px 0;
  margin-bottom: clamp(28px, 4vw, 52px);
  border-top: 1px solid var(--line);
}
.work-bar h2 {
  margin-right: auto;
  font: 400 28px / 1 var(--serif);
  letter-spacing: -0.01em;
}
.filters,
.views {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}
.filters button,
.views button {
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.filters button:hover,
.views button:hover {
  color: var(--fg);
}
.filters button[aria-pressed="true"],
.views button[aria-pressed="true"] {
  color: var(--fg);
  border-bottom-color: var(--fg);
}

/* ---------- cuadrícula ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(36px, 5vw, 72px) clamp(16px, 2vw, 28px);
}
.tile a {
  display: block;
}
.frame {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--panel);
}
.frame img,
.frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.frame img {
  transition: transform 1.4s var(--ease);
}
.frame video {
  opacity: 0;
  transition: opacity 0.35s ease;
}
.tile.is-playing .frame video {
  opacity: 1;
}
@media (hover: hover) {
  .tile a:hover .frame img {
    transform: scale(1.04);
  }
}
.caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding-top: 14px;
}
.cap-main {
  min-width: 0;
}
.tile h3 {
  font: 400 clamp(26px, 2.5vw, 38px) / 1.04 var(--serif);
  letter-spacing: -0.01em;
}
.artist,
.cat {
  color: var(--muted);
  font-size: 15px;
}
.artist:empty {
  display: none;
}
.cat {
  flex: none;
  text-align: right;
}

/* ---------- vista en lista ---------- */
html[data-view="list"] .grid {
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
}
html[data-view="list"] .tile {
  border-bottom: 1px solid var(--line);
}
html[data-view="list"] .tile a {
  padding: 18px 0;
}
html[data-view="list"] .frame {
  display: none;
}
html[data-view="list"] .caption {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: baseline;
  padding-top: 0;
}
html[data-view="list"] .cap-main {
  display: contents;
}
html[data-view="list"] .tile h3 {
  font-size: clamp(28px, 3.6vw, 52px);
  transition: transform 0.4s var(--ease);
}
html[data-view="list"] .tile a:hover h3 {
  transform: translateX(10px);
}
html[data-view="list"] .cat {
  text-align: right;
}
html[data-view="list"] .artist:empty {
  display: block;
}

/* ---------- cursor play y vista previa ---------- */

.cursor,
.peek {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  pointer-events: none;
  will-change: transform;
}
.cursor-label {
  display: block;
  color: #fff;
  font: 500 16px / 1 var(--sans);
  letter-spacing: 0.04em;
  white-space: nowrap;
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
  transition: opacity 0.2s, transform 0.25s var(--ease);
}
.cursor.is-on .cursor-label {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
html[data-view="list"] .cursor.is-on .cursor-label {
  opacity: 0;
}
.cursor {
  mix-blend-mode: difference;
}
.peek {
  width: 300px;
  aspect-ratio: 16 / 10;
  margin: -90px 0 0 36px;
  background: var(--panel);
  opacity: 0;
  transition: opacity 0.2s;
}
.peek.is-on {
  opacity: 1;
}
.peek img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.has-cursor [data-cursor] {
  cursor: none;
}
@media (hover: none), (pointer: coarse) {
  .cursor,
  .peek {
    display: none;
  }
}

/* ---------- proyecto ---------- */
.project,
.about,
.contact,
.notfound {
  padding: clamp(32px, 5vw, 72px) var(--pad) clamp(72px, 9vw, 128px);
}
.back {
  display: inline-block;
  margin-bottom: clamp(28px, 4vw, 56px);
  color: var(--muted);
  font-size: 15px;
  transition: color 0.2s;
}
.back:hover {
  color: var(--fg);
}
.project h1 {
  font: 400 clamp(44px, 8vw, 128px) / 0.95 var(--serif);
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px clamp(24px, 4vw, 64px);
  margin: clamp(24px, 3vw, 40px) 0 clamp(28px, 4vw, 52px);
}
.facts dt {
  color: var(--muted);
  font-size: 14px;
}
.facts dd {
  font-size: 17px;
}
.player {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--panel);
}
.player img,
.player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}
.player-btn {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.player-label {
  position: absolute;
  left: 20px;
  bottom: 18px;
  padding: 8px 14px;
  background: var(--fg);
  color: var(--bg);
  font-size: 15px;
}
.nb {
  white-space: nowrap;
}
@media (hover: none), (pointer: coarse) {
  .player-btn::after {
    content: "[PLAY]";
    position: absolute;
    left: 50%;
    top: 50%;
    color: #fff;
    font: 500 18px / 1 var(--sans);
    letter-spacing: 0.04em;
    text-shadow: 0 1px 14px rgba(0, 0, 0, 0.7);
    transform: translate(-50%, -50%);
  }
}
.external {
  margin-top: 16px;
  font-size: 15px;
}
.external a,
.text-link {
  border-bottom: 1px solid var(--muted);
  transition: border-color 0.2s;
}
.external a:hover,
.text-link:hover {
  border-bottom-color: var(--fg);
}
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--pad);
  margin-top: clamp(56px, 8vw, 112px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.pager a {
  display: grid;
  gap: 6px;
}
.pager span {
  color: var(--muted);
  font-size: 14px;
}
.pager strong {
  font: 400 clamp(26px, 3.4vw, 48px) / 1.05 var(--serif);
  letter-spacing: -0.01em;
  transition: transform 0.4s var(--ease);
}
.pager .next {
  text-align: right;
}
.pager .prev:hover strong {
  transform: translateX(-8px);
}
.pager .next:hover strong {
  transform: translateX(8px);
}

/* ---------- sobre mí ---------- */
.about .lead {
  max-width: 20ch;
  font: 400 clamp(40px, 7vw, 112px) / 0.98 var(--serif);
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.about-body {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: start;
  gap: var(--pad);
  margin-top: clamp(40px, 6vw, 96px);
}
.portrait {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 30%;
}
@media (min-width: 901px) {
  /* retrato más pequeño y el texto pegado a su derecha */
  .about-body {
    --about-gap: clamp(28px, 3.4vw, 52px);
    grid-template-columns: calc((100% - 2 * var(--about-gap)) * 0.33) calc((100% - 2 * var(--about-gap)) * 0.33) minmax(0, 1fr);
    gap: var(--about-gap);
  }
}
.collage {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5; /* misma proporción que el retrato: mismo alto, y recorta un poco del margen negro */
  object-fit: cover;
  mix-blend-mode: lighten; /* el negro puro del collage se funde con el fondo de la página */
}
.about-text {
  display: grid;
  gap: 20px;
  max-width: 44ch;
  font-size: 17px;
  line-height: 1.6;
}
.services {
  margin-top: clamp(64px, 9vw, 144px);
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.services h2 {
  margin-bottom: clamp(24px, 3vw, 44px);
  font: 400 15px / 1.4 var(--sans);
  color: var(--muted);
}
.about .services,
.about .faq {
  margin-top: clamp(32px, 4.5vw, 72px); /* la mitad del espacio entre bloques de About */
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--pad);
}
.services-grid h3 {
  margin-bottom: 12px;
  font: 400 clamp(32px, 3.4vw, 52px) / 1 var(--serif);
  letter-spacing: -0.02em;
}
.services-grid p {
  max-width: 36ch;
  color: var(--muted);
}
/* ---------- contacto ---------- */
.contact h1,
.notfound h1 {
  font: 400 clamp(48px, 9vw, 144px) / 0.94 var(--serif);
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.contact-sub {
  margin-top: 20px;
  color: var(--muted);
  font-size: 18px;
}
.notfound p {
  margin-top: 28px;
}
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: var(--pad);
  margin-top: clamp(40px, 6vw, 88px);
}
#contact-form {
  display: grid;
  gap: 8px;
  max-width: 640px;
}
#contact-form label {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}
#contact-form input,
#contact-form textarea {
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font: 400 18px / 1.4 var(--sans);
  transition: border-color 0.2s;
}
#contact-form textarea {
  resize: vertical;
}
#contact-form input:focus,
#contact-form textarea:focus {
  outline: none;
  border-bottom-color: var(--fg);
}
#contact-form input[aria-invalid="true"],
#contact-form textarea[aria-invalid="true"] {
  border-bottom-color: #ff8a7a;
}
#contact-form button {
  justify-self: start;
  margin-top: 26px;
  padding: 14px 26px;
  border: 0;
  background: var(--fg);
  color: var(--bg);
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}
#contact-form button:hover {
  opacity: 0.85;
}
.form-status {
  min-height: 1.5em;
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}
.form-status.is-error {
  color: #ff8a7a;
}
.contact-side {
  display: grid;
  align-content: start;
  gap: 8px;
  color: var(--muted);
}
.contact-side .text-link {
  color: var(--fg);
  font: 400 clamp(22px, 2.4vw, 32px) / 1.2 var(--serif);
}
.contact-place {
  margin-top: 28px;
}

/* ---------- pie ---------- */
.site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 18px var(--pad);
  padding: clamp(40px, 6vw, 88px) var(--pad) 28px;
  border-top: 1px solid var(--line);
}
.footer-lead {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 17px;
}
.footer-cta {
  grid-column: 1 / -1;
  font: 400 clamp(44px, 9vw, 150px) / 0.95 var(--serif);
  letter-spacing: -0.03em;
}
.footer-cta:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}
.footer-mail {
  color: var(--muted);
  transition: color 0.2s;
}
.footer-mail:hover {
  color: var(--fg);
}
.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 22px;
  font-size: 15px;
}
.socials a {
  color: var(--muted);
  transition: color 0.2s;
}
.socials a:hover {
  color: var(--fg);
}
.legal,
.to-top {
  margin-top: clamp(24px, 4vw, 56px);
  color: var(--muted);
  font-size: 14px;
}
.to-top {
  justify-self: end;
}
.to-top:hover {
  color: var(--fg);
}

/* ---------- móvil ---------- */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .about-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .about-text {
    grid-column: 1 / -1;
  }
  .services-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}
@media (max-width: 680px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
  }
  .clock {
    display: none;
  }
  .nav {
    justify-self: end;
    gap: 14px;
    font-size: 14px;
  }
  .logo img {
    width: 92px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .work-bar h2 {
    flex: 1 0 100%;
  }
  .views {
    display: none;
  }
  .pager {
    grid-template-columns: 1fr;
  }
  .pager .next {
    text-align: left;
  }
  .site-footer {
    grid-template-columns: 1fr;
  }
  .socials,
  .to-top {
    justify-self: start;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .frame img {
    transform: none !important;
  }
}

@media (max-width: 680px) {
  html[data-view="list"] .caption {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  html[data-view="list"] .artist {
    display: none;
  }
}

/* ---------- móvil: los textos de cada trabajo aparecen según haces scroll ---------- */
.js-reveal .tile h3 {
  opacity: var(--p, 0);
  transform: translateY(calc((1 - var(--p, 0)) * 12px));
  transition: opacity 0.2s linear, transform 0.2s linear;
}
.js-reveal .tile .artist,
.js-reveal .tile .cat {
  opacity: var(--q, 0);
  transform: translateY(calc((1 - var(--q, 0)) * 10px));
  transition: opacity 0.2s linear, transform 0.2s linear;
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal .tile h3,
  .js-reveal .tile .artist,
  .js-reveal .tile .cat {
    transform: none;
  }
}

/* ---------- entrada en cascada de la portada (unos 3 s) ----------
   Solo CSS: sin JavaScript todo se ve de inmediato al terminar. Se repite
   una vez por sesión; con ?intro en la dirección se fuerza.
   Orden: header, titular + subtexto a la vez, y por último Work con las miniaturas. */
@keyframes intro-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes intro-soft {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.page-home .site-header {
  animation: intro-fade 0.9s ease-in-out both;
}
.page-home .hero h1 {
  animation: intro-soft 0.9s ease-out 0.55s both;
}
.page-home .hero-note {
  animation: intro-soft 1.5s ease-in-out 0.55s both;
}
.page-home .work-bar {
  animation: intro-soft 1.3s ease-in-out 2.1s both;
}
.page-home .tile:nth-child(1) {
  animation: intro-soft 1.3s ease-in-out 2.25s both;
}
.page-home .tile:nth-child(2) {
  animation: intro-soft 1.3s ease-in-out 2.37s both;
}
.page-home .tile:nth-child(3) {
  animation: intro-soft 1.3s ease-in-out 2.49s both;
}
.page-home .tile:nth-child(4) {
  animation: intro-soft 1.3s ease-in-out 2.61s both;
}
.no-intro .page-home .site-header,
.no-intro .page-home .hero h1,
.no-intro .page-home .hero-note,
.no-intro .page-home .work-bar,
.no-intro .page-home .tile {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .page-home .site-header,
  .page-home .hero h1,
  .page-home .hero-note,
  .page-home .work-bar,
  .page-home .tile {
    animation: none;
  }
}

/* Titular: se "dibuja" de izquierda a derecha, de borroso a nítido (~2,3 s).
   Dos capas: la nítida aparece barriendo hacia la derecha y detrás queda una copia desenfocada que se va. */
@media (prefers-reduced-motion: no-preference) {
  html:not(.no-intro) .page-home .hero h1 {
    position: relative;
    width: fit-content;
    max-width: 100%;
  }
  html:not(.no-intro) .page-home .h1-sharp {
    display: block;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 33.3%, transparent 66.6%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0%, #000 33.3%, transparent 66.6%, transparent 100%);
    -webkit-mask-size: 300% 100%;
    mask-size: 300% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    animation: h1-sweep 2.3s cubic-bezier(0.45, 0, 0.25, 1) 0.55s both;
  }
  html:not(.no-intro) .page-home .hero h1::after {
    content: attr(data-text) / "";
    position: absolute;
    inset: -0.12em -0.3em;
    padding: 0.12em 0.3em;
    pointer-events: none;
    filter: blur(7px);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 33.3%, #000 66.6%, #000 100%);
    mask-image: linear-gradient(90deg, transparent 0%, transparent 33.3%, #000 66.6%, #000 100%);
    -webkit-mask-size: 300% 100%;
    mask-size: 300% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    animation: h1-sweep 2.3s cubic-bezier(0.45, 0, 0.25, 1) 0.55s both;
  }
}
@keyframes h1-sweep {
  from {
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
  }
  to {
    -webkit-mask-position: 0% 0;
    mask-position: 0% 0;
  }
}

/* ---------- página de colección (Gaupasa) ---------- */
.collection-intro {
  display: grid;
  gap: 16px;
  max-width: 34em;
  margin-bottom: clamp(40px, 6vw, 88px);
  font: 400 clamp(20px, 2vw, 28px) / 1.35 var(--serif);
  letter-spacing: -0.005em;
}

/* Texto local (SEO visible) y preguntas frecuentes */
.local {
  margin-top: clamp(64px, 9vw, 144px);
  margin-inline: var(--pad);
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.local {
  padding-bottom: clamp(40px, 5vw, 72px);
}
.local > * {
  max-width: 44ch;
}
.local p {
  margin-top: 14px;
}
.local h2 {
  font: 400 15px / 1.4 var(--sans);
  color: var(--muted);
}
.local p {
  font-size: 17px;
  line-height: 1.6;
}
.local p[lang='es'] {
  color: var(--muted);
}
.faq {
  margin-top: clamp(64px, 9vw, 144px);
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.faq h2 {
  margin-bottom: clamp(24px, 3vw, 44px);
  font: 400 15px / 1.4 var(--sans);
  color: var(--muted);
}
.faq dl {
  display: grid;
  gap: 28px;
  max-width: 52ch;
}
.faq dt {
  font: 400 clamp(22px, 2.4vw, 30px) / 1.15 var(--serif);
}
.faq dd {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}
@media (min-width: 901px) {
  .faq dl {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 44px var(--pad);
    max-width: none;
  }
  .faq dd {
    max-width: 36ch;
  }
}

@media (max-width: 400px) {
  .site-header {
    gap: 8px;
  }
  .nav {
    gap: 10px;
    font-size: 13px;
  }
  .logo img {
    width: 76px;
  }
  .header-end {
    gap: 0;
    margin-left: 6px;
  }
  .logo img {
    width: 70px;
  }
}

/* ---------- transición entre páginas: se oscurece y aparece lo nuevo ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
  .site-header {
    view-transition-name: site-header;
  }
  ::view-transition {
    background: var(--bg);
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    mix-blend-mode: normal;
  }
  ::view-transition-old(root) {
    animation: vt-out 0.24s ease both;
  }
  ::view-transition-new(root) {
    animation: vt-in 0.5s ease 0.14s both;
  }
  ::view-transition-old(site-header) {
    display: none;
  }
  ::view-transition-new(site-header) {
    animation: none;
  }
  @keyframes vt-out {
    to {
      opacity: 0;
    }
  }
  @keyframes vt-in {
    from {
      opacity: 0;
    }
  }

  /* Respaldo para navegadores sin View Transitions entre páginas (lo activa main.js) */
  html.vt-fallback body {
    animation: vt-in 0.5s ease both;
  }
  html.vt-fallback.is-leaving body {
    opacity: 0;
    transition: opacity 0.24s ease;
  }
}

/* Móvil: los bloques que quedan arriba y abajo del que miras se oscurecen */
.js-reveal .tile > a {
  opacity: var(--d, 1);
  transition: opacity 0.45s cubic-bezier(0.25, 0.1, 0.25, 1);
}
