/* Tokens alineados con Figma: site-Mauro (HOME 2101:3) — fondo claro por defecto */
:root {
  color-scheme: light;
  --color-bg: #ffffff;
  --color-text: #000000;
  --color-muted: #444444;
  --color-hover: #f4ce24;
  --color-overlay: rgba(0, 0, 0, 0.82);
  --icon-hover-filter: brightness(0) saturate(100%) invert(84%) sepia(98%) saturate(1352%) hue-rotate(358deg)
    brightness(104%) contrast(91%);
  --font-title: "Exo 2", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --text-title: calc(1rem + 1px);
  --text-nav: 0.75rem;
  --text-footer: calc(0.9375rem - 2px);
  --frame-max: 90rem;
  /* Marco HOME Figma */
  --home-frame-w: 90rem;
  --home-frame-h: 49.75rem;
  --header-pad-x: 1.5rem;
  --header-pad-y: 1.5rem;
  --shell-pad-x: 40px;
  --shell-pad-y: 30px;
  --chrome-header: 5.5rem;
  --chrome-footer: 5.5rem;
  --radius-thumb: 0;
  --transition: 0.2s ease;
  --theme-transition-duration: 0.35s;
  --theme-transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
  /* Personal hub: escala home + miniaturas un poco más chicas y más aire entre fotos */
  --personal-ui-scale: max(0.5, 100vw / 1440px);
  --personal-thumb-scale: 0.9;
  --series-cell-w: calc(346px * var(--personal-thumb-scale) * var(--personal-ui-scale));
  --series-gap-x: calc(48px * var(--personal-ui-scale));
  --series-gap-y: calc(36px * var(--personal-ui-scale));
  --series-ui-scale: max(0.5, 100vw / 1440px);
  --series-hero-base-w: 720px;
  --series-hero-base-h: 480px;
  --series-aspect: 1.5;
  --series-thumb-gap: 4rem;
  --series-strip-reserve: calc(var(--series-thumb-gap) + max(5.25rem, calc(6rem * var(--series-ui-scale))));
  --gallery-nav-size: 1.75rem;
  --gallery-nav-icon: 1rem;
  --gallery-nav-gap: 50px;
  --series-stage-max-h: calc(
    100dvh - var(--chrome-header) - var(--chrome-footer) - var(--series-strip-reserve) - 1.25rem
  );
  --series-hero-max-w: min(
    calc(var(--series-hero-base-w) * var(--series-ui-scale)),
    calc(100vw - var(--shell-pad-x) * 2)
  );
  --series-hero-max-h: min(
    calc(var(--series-hero-base-h) * var(--series-ui-scale)),
    var(--series-stage-max-h)
  );
  --shaft-panel-bg: #b8b8b8;
  --shaft-loader-text: #141414;
  --shaft-open-duration: 1.2s;
  --shaft-close-duration: 0.65s;
  --shaft-ease: cubic-bezier(0.85, 0, 0.15, 1);
  --content-reveal-duration: 2.15s;
  --content-reveal-opacity-delay: 1.15s;
  --content-reveal-opacity-duration: 1.35s;
  --content-reveal-blur-duration: 2.1s;
  --content-reveal-blur-delay: 1.15s;
  --content-reveal-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #0d0d0d;
  --color-text: #f5f5f5;
  --color-muted: #b3b3b3;
  --color-overlay: rgba(0, 0, 0, 0.92);
  --shaft-panel-bg: #7a7a7a;
  --shaft-loader-text: #f5f5f5;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: var(--theme-transition-duration);
  animation-timing-function: var(--theme-transition-ease);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-mono);
  font-size: var(--text-nav);
  line-height: 1.4;
  color: var(--color-text);
  background: var(--color-bg);
  transition:
    background-color var(--theme-transition-duration) var(--theme-transition-ease),
    color var(--theme-transition-duration) var(--theme-transition-ease);
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
  border-radius: var(--radius-thumb);
}

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

a:hover,
a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  button:hover,
  .gallery-page__series-btn:hover,
  .gallery-page__series-link:hover,
  .menu-overlay__close:hover,
  .gallery-details-overlay__close:hover,
  .site-header__menu-btn:hover,
  .theme-toggle:hover,
  .gallery-page__nav:hover,
  .thumb-strip button:hover {
    color: var(--color-hover);
    opacity: 1;
  }

  .theme-toggle:hover .theme-toggle__icon,
  .gallery-page__nav:hover img,
  .site-header__social a:hover .site-header__icon {
    filter: var(--icon-hover-filter);
    opacity: 1;
  }
}

.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;
}

.page {
  min-height: 100vh;
  display: block;
  max-width: none;
  margin: 0;
  padding: 0;
}

.page:has(> main.gallery-page) {
  height: 100svh;
  max-height: 100svh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ——— Header / Footer fijos a bordes del viewport (todas las páginas) ——— */
.site-header,
.site-footer {
  position: fixed;
  left: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: var(--shell-pad-y) var(--shell-pad-x);
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-mono);
  transition:
    background-color var(--theme-transition-duration) var(--theme-transition-ease),
    color var(--theme-transition-duration) var(--theme-transition-ease);
}

.site-header {
  top: 0;
  font-size: var(--text-nav);
}

.site-footer {
  bottom: 0;
  top: auto;
  font-size: var(--text-footer);
}

.site-header__title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: auto;
  max-width: min(22rem, 50vw);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: var(--text-title);
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--color-text);
}

.site-header__title .swipe-letters {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
}

.site-header__title .swipe-letters__char {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  height: 1.2em;
  line-height: 1.2;
}

.site-header__title .swipe-letters__inner {
  display: block;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transition-delay: var(--swipe-stagger, 0ms);
  will-change: transform;
}

.site-header__title .swipe-letters__line {
  display: block;
  height: 1.2em;
  line-height: 1.2;
}

.site-header__title .swipe-letters__line--hover {
  color: var(--color-hover);
}

.site-header__title .swipe-letters__char--bottom .swipe-letters__inner {
  transform: translateY(0);
}

.site-header__title:hover .swipe-letters__char--bottom .swipe-letters__inner,
.site-header__title:focus-visible .swipe-letters__char--bottom .swipe-letters__inner {
  transform: translateY(-50%);
}

.site-header__title .swipe-letters__char--top .swipe-letters__inner {
  transform: translateY(-50%);
}

.site-header__title:hover .swipe-letters__char--top .swipe-letters__inner,
.site-header__title:focus-visible .swipe-letters__char--top .swipe-letters__inner {
  transform: translateY(0);
}

.site-header__title.swipe-letters--static:hover,
.site-header__title.swipe-letters--static:focus-visible {
  color: var(--color-hover);
}

@media (prefers-reduced-motion: reduce) {
  .site-header__title .swipe-letters__inner {
    transition: none;
  }

  .site-header__title:not(.swipe-letters--static):hover,
  .site-header__title:not(.swipe-letters--static):focus-visible {
    color: var(--color-hover);
  }
}

/* ——— Chrome enter (header/footer load reveal) ——— */
.chrome-reveal {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  line-height: inherit;
}

.chrome-reveal--block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.site-header__social .chrome-reveal--block {
  width: 1.5rem;
  height: 1.5rem;
}

.site-header__menu-btn .chrome-reveal--block {
  width: 1.6875rem;
  height: 1.3125rem;
}

.site-footer .theme-toggle .chrome-reveal--block {
  width: 1.875rem;
  height: 1.875rem;
}

.site-header__title .chrome-reveal--title {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  max-width: 100%;
  line-height: 1.2;
}

.site-header__title .chrome-reveal--title .chrome-reveal__inner {
  display: block;
}

.chrome-reveal__inner {
  display: block;
}

.chrome-reveal--block .chrome-reveal__inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

body.chrome-is-entering .chrome-reveal__inner {
  transform: translateY(110%);
  transition: transform 0.62s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--chrome-enter-delay, 0ms);
}

body.chrome-is-entered .chrome-reveal__inner {
  transform: translateY(0);
}

body.chrome-is-entering:not(.page-index) main {
  opacity: 0;
}

body.chrome-is-entered:not(.page-index) main {
  opacity: 1;
  transition: opacity 0.38s ease 0.1s;
}

body.page-index.chrome-is-entering main,
body.page-index.chrome-is-entered main {
  opacity: 1;
  transition: none;
}

body.chrome-is-entering .page--personal main,
body.chrome-is-entering main.about {
  opacity: 0;
  transform: translate3d(0, -2.5rem, 0);
  filter: blur(8px);
}

body.chrome-is-entered .page--personal main,
body.chrome-is-entered main.about {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  filter: blur(0);
  transition:
    transform var(--content-reveal-duration) var(--content-reveal-ease),
    opacity var(--content-reveal-opacity-duration) var(--content-reveal-ease)
      var(--content-reveal-opacity-delay),
    filter var(--content-reveal-blur-duration) var(--content-reveal-ease) var(--content-reveal-blur-delay);
}

body.chrome-is-entered main.gallery-page[data-series-gallery]:not(.gallery-page--single) {
  transform: none;
  filter: none;
  transition: opacity 0.38s ease 0.1s;
}

body.chrome-is-entering .site-header__social a:not(:has(.chrome-reveal__inner)),
body.chrome-is-entering .site-header__menu-btn:not(:has(.chrome-reveal__inner)),
body.chrome-is-entering .site-footer .theme-toggle:not(:has(.chrome-reveal__inner)),
body.chrome-is-entering .site-header__nav a:not(:has(.chrome-reveal__inner)),
body.chrome-is-entering .site-footer__copy:not(:has(.chrome-reveal__inner)),
body.chrome-is-entering .site-header__title:not(:has(.chrome-reveal__inner)) {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  body .chrome-reveal__inner {
    transform: none !important;
    transition: none !important;
  }

  body.chrome-is-entering main,
  body.chrome-is-entered main {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}

.site-header__nav {
  display: flex;
  gap: 1.5rem;
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.site-header__nav a {
  position: relative;
  display: inline-block;
  font-size: inherit;
  line-height: inherit;
  text-decoration: none;
}

.navbar__nav a::after,
.site-header__nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background-color: var(--color-hover);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.navbar__nav a[aria-current="page"],
.site-header__nav a[aria-current="page"] {
  color: var(--color-hover);
  font-weight: 700;
}

.navbar__nav a[aria-current="page"]::after,
.site-header__nav a[aria-current="page"]::after {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .navbar__nav a:hover,
  .navbar__nav a:focus-visible,
  .site-header__nav a:hover,
  .site-header__nav a:focus-visible {
    color: var(--color-hover);
    text-decoration: none;
  }

  .navbar__nav a:hover::after,
  .navbar__nav a:focus-visible::after,
  .site-header__nav a:hover::after,
  .site-header__nav a:focus-visible::after {
    opacity: 1;
  }
}

.site-header__title:hover {
  text-decoration: none;
}

.site-header__social {
  display: flex;
  gap: 0.875rem;
  align-items: center;
  flex-shrink: 0;
}

.site-header__social a {
  display: flex;
  width: 1.5rem;
  height: 1.5rem;
  opacity: 0.9;
  color: inherit;
}

.site-header__icon {
  width: 1.5rem;
  height: 1.5rem;
  display: block;
  flex-shrink: 0;
  transition: filter var(--theme-transition-duration) var(--theme-transition-ease);
}

.site-header__social a:hover {
  text-decoration: none;
}

.theme-toggle__icon {
  width: 1.875rem;
  height: 1.875rem;
  display: block;
  flex-shrink: 0;
  filter: none;
  transition: filter var(--theme-transition-duration) var(--theme-transition-ease);
}

[data-theme="dark"] .site-header__icon {
  filter: invert(1);
}

.site-header__menu-btn {
  display: none;
  background: none;
  border: 0;
  padding: 0.25rem;
  cursor: pointer;
  color: inherit;
}

.site-header__menu-btn svg {
  display: block;
}

/* ——— Main ——— */
main {
  width: 100%;
  max-width: var(--frame-max);
  margin: 0 auto;
  padding: var(--chrome-header) var(--shell-pad-x) var(--chrome-footer);
  box-sizing: border-box;
}

.theme-toggle {
  width: 1.875rem;
  height: 1.875rem;
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
}


.site-footer__copy {
  margin: 0;
  font-family: var(--font-mono);
  line-height: 1.875rem;
  white-space: nowrap;
}

/* ——— Home: 100vh, galería centrada (header/footer ya fijos globalmente) ——— */
.page-home {
  overflow-x: hidden;
}

.page-home main {
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.page-home .home-hero {
  padding: 0;
  width: 100%;
  max-height: var(--home-frame-h);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.page-home .home-hero__viewport {
  max-height: var(--home-frame-h);
}

/* ——— Home hero (desktop): franja más ancha que el viewport, recorte en bordes ——— */
.home-hero {
  padding: 1rem 0 2rem;
}

.home-hero__viewport {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow: hidden;
}

.home-hero__strip {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(0.35rem, 1.2vw, 1rem);
  min-height: 23.125rem;
  width: max(100% + 4rem, 72rem);
  max-width: none;
  margin: 0 auto;
}

.home-hero figure {
  margin: 0;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: var(--radius-thumb);
}

.home-hero__side {
  width: clamp(12.5rem, 23.5vw, 20.9375rem);
}

.home-hero__center {
  width: clamp(17.5rem, 38.5vw, 34.6875rem);
  z-index: 1;
}

.home-hero__side img {
  width: 100%;
  height: 13.9375rem;
  object-fit: cover;
  display: block;
}

.home-hero__center img {
  width: 100%;
  height: 23.125rem;
  object-fit: cover;
  display: block;
}

/* ——— Home mobile carousel ——— */
.home-mobile-hero {
  display: none;
  position: relative;
  padding: 0.5rem 0 1.5rem;
}

.home-mobile-hero__track {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.home-mobile-hero__track::-webkit-scrollbar {
  display: none;
}

.home-mobile-hero__slide {
  flex: 0 0 88%;
  scroll-snap-align: center;
}

.home-mobile-hero__slide img {
  width: 100%;
  height: 14.6875rem;
  object-fit: cover;
  border-radius: var(--radius-thumb);
}

.home-mobile-hero__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-bg) 70%, transparent);
  color: var(--color-text);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.home-mobile-hero__arrow--prev {
  left: 0;
}

.home-mobile-hero__arrow--next {
  right: 0;
}

/* ——— Personal hub (346×262 @ 1440px, escala como home: max(0.5, vw/1440)) ——— */
.page--personal {
  min-height: 100vh;
}

.page--personal main.personal-main {
  min-height: 100vh;
  box-sizing: border-box;
  margin: 0;
  width: 100%;
  max-width: none;
  /* aire bajo la grilla: footer fijo + texto de las etiquetas (última fila siempre legible) */
  --personal-main-pad-bottom: calc(var(--chrome-footer) + 2.75rem);
  padding: var(--chrome-header) var(--shell-pad-x) var(--personal-main-pad-bottom);
  display: flex;
  align-items: center;
  align-items: safe center;
  justify-content: center;
}

.page--personal .series-grid {
  display: grid;
  grid-template-columns: repeat(3, var(--series-cell-w));
  gap: var(--series-gap-y) var(--series-gap-x);
  justify-content: center;
  align-content: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
}

.page--personal .series-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  color: inherit;
  width: min(100%, var(--series-cell-w));
}

.page--personal .series-card:hover {
  text-decoration: none;
}

.page--personal .series-card:hover .series-card__label {
  text-decoration: underline;
}

.page--personal .series-card__thumb {
  width: min(var(--series-cell-w), 100%);
  aspect-ratio: 346 / 262;
  height: auto;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: var(--radius-thumb);
}

.page--personal .series-card__thumb img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  display: block;
}

.page--personal .series-card__label {
  font-family: var(--font-mono);
  font-size: var(--text-nav);
  text-align: center;
  max-width: var(--series-cell-w);
}

@media (max-width: 72rem) {
  .page--personal .series-grid {
    grid-template-columns: repeat(2, var(--series-cell-w));
  }
}

@media (max-width: 40rem) {
  .page--personal main.personal-main {
    --personal-main-pad-bottom: calc(var(--chrome-footer) + 3.5rem);
  }

  .page--personal .series-grid {
    gap: 2rem;
  }
}

/* ——— Nostalgia gallery page ——— */
.gallery-desktop {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  overflow: visible;
}

main.gallery-page {
  max-width: none;
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: var(--chrome-header) 0 var(--chrome-footer);
  box-sizing: border-box;
  overflow: hidden;
}

.gallery-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.gallery-page__layout {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  margin: 0;
  max-width: none;
  padding-inline: var(--shell-pad-x);
  box-sizing: border-box;
  overflow: visible;
}

.gallery-page__copy {
  position: fixed;
  left: var(--shell-pad-x);
  top: 50%;
  z-index: 1;
  max-width: 11.8125rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.gallery-page__copy a,
.gallery-page__copy button {
  pointer-events: auto;
}

.gallery-page__intro {
  display: none;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0;
  width: 100%;
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-nav);
  line-height: 1.4;
  text-align: center;
}

.gallery-page__intro .gallery-page__title {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  line-height: inherit;
  color: var(--color-text);
}

.gallery-page__intro-sep {
  margin: 0 0.35em;
  font-weight: 400;
  color: var(--color-text);
}

.gallery-page__series-btn {
  font-family: inherit;
  font-size: inherit;
  font-weight: 400;
  line-height: inherit;
  color: var(--color-muted);
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-decoration: none;
}


.gallery-desktop .gallery-page__intro {
  display: flex;
  font-size: 1rem;
}

.gallery-page--single .gallery-page__nav {
  display: none;
}

.gallery-page--single .gallery-page__counter {
  display: none;
}

.gallery-page--single .gallery-page__frame {
  grid-template-columns: minmax(0, 1fr);
  column-gap: 0;
  width: var(--series-hero-slot-w, var(--series-hero-max-w));
  min-width: min(var(--series-hero-slot-w, var(--series-hero-max-w)), 100%);
  max-width: 100%;
}

.gallery-page--single .gallery-page__viewport {
  grid-column: 1;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.gallery-page--single .gallery-page__center {
  gap: 0;
  width: min(var(--series-hero-slot-w, var(--series-hero-max-w)), 100%);
}

.gallery-page--single .gallery-desktop .gallery-page__stage {
  width: 100%;
  margin-inline: 0;
}

.gallery-page--single .gallery-page__hero img[data-gallery-main] {
  width: var(--series-hero-slot-w, var(--series-hero-max-w));
  height: var(--series-hero-slot-h, var(--series-hero-max-h));
  max-width: var(--series-hero-slot-w, var(--series-hero-max-w));
  max-height: var(--series-hero-slot-h, var(--series-hero-max-h));
  object-fit: contain;
}

/* Index — image reveal on load */
.gallery-page--single .img-reveal {
  display: block;
  overflow: hidden;
  width: var(--series-hero-slot-w, var(--series-hero-max-w));
  height: var(--series-hero-slot-h, var(--series-hero-max-h));
  max-width: 100%;
}

.gallery-page--single .img-reveal img[data-gallery-main] {
  will-change: transform, filter, opacity;
  opacity: 0;
  transform: translate3d(0, -108%, 0) scale(1.02);
  filter: blur(8px);
  transition:
    transform var(--content-reveal-duration) var(--content-reveal-ease),
    opacity var(--content-reveal-opacity-duration) var(--content-reveal-ease)
      var(--content-reveal-opacity-delay),
    filter var(--content-reveal-blur-duration) var(--content-reveal-ease)
      var(--content-reveal-blur-delay);
}

.gallery-page--single .img-reveal.is-revealed img[data-gallery-main] {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}

.gallery-page--single .img-reveal.is-reduced img[data-gallery-main] {
  opacity: 1;
  transform: none;
  filter: none;
  transition: none;
}

body.page-index .gallery-page--single .img-reveal.is-carousel-ready img[data-gallery-main] {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity 0.22s ease;
}

body.page-index .gallery-page--single .img-reveal.is-carousel-ready img[data-gallery-main].is-fading {
  opacity: 0;
}

body.page-index .cursor-slideshow-target {
  cursor: none;
}

@media (hover: hover) and (pointer: fine) {
  html.cursor-slideshow-on * {
    cursor: none !important;
  }
}

#mg-slide-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--color-hover);
  color: #000000;
  font-family: var(--font-mono);
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 120ms ease;
  contain: layout style paint;
  will-change: transform, opacity;
}

html.cursor-slideshow-on #mg-slide-cursor {
  opacity: 1;
}

@media (hover: none), (pointer: coarse), (max-width: 900px) {
  #mg-slide-cursor {
    display: none !important;
  }
}

/* Series galleries — image reveal (carousel) */
.gallery-page__hero .img-reveal {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-page--single .gallery-page__hero .img-reveal {
  display: block;
}

.gallery-page[data-series-gallery]:not(.gallery-page--single) .img-reveal {
  overflow: hidden;
  width: var(--series-hero-slot-w, var(--series-hero-max-w));
  height: var(--series-hero-slot-h, var(--series-hero-max-h));
  max-width: 100%;
}

.gallery-page[data-series-gallery]:not(.gallery-page--single) .img-reveal:not(.is-carousel-ready) img[data-gallery-main] {
  will-change: transform, filter, opacity;
  opacity: 0;
  transform: translate3d(0, -108%, 0) scale(1.02);
  filter: blur(8px);
  transition:
    transform var(--content-reveal-duration) var(--content-reveal-ease),
    opacity var(--content-reveal-opacity-duration) var(--content-reveal-ease)
      var(--content-reveal-opacity-delay),
    filter var(--content-reveal-blur-duration) var(--content-reveal-ease)
      var(--content-reveal-blur-delay);
}

.gallery-page[data-series-gallery]:not(.gallery-page--single) .img-reveal:not(.is-carousel-ready).is-revealed img[data-gallery-main] {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}

.gallery-page[data-series-gallery]:not(.gallery-page--single) .img-reveal.is-carousel-ready img[data-gallery-main] {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity 0.22s ease;
}

.gallery-page[data-series-gallery]:not(.gallery-page--single) .img-reveal.is-carousel-ready img[data-gallery-main].is-fading {
  opacity: 0;
}

.gallery-page[data-series-gallery]:not(.gallery-page--single) .img-reveal.is-reduced img[data-gallery-main] {
  opacity: 1;
  transform: none;
  filter: none;
  transition: none;
}

/* ——— Page leave (opacity fade) ——— */
body.page-is-leaving main,
body.page-is-leaving .page--personal main,
body.page-is-leaving main.about,
body.page-is-leaving main.gallery-page[data-series-gallery]:not(.gallery-page--single),
body.page-is-leaving.page-index main {
  opacity: 0;
  transform: none;
  filter: none;
  transition: opacity 0.32s ease;
}

body.page-is-leaving main.gallery-page[data-series-gallery]:not(.gallery-page--single) .img-reveal img[data-gallery-main] {
  opacity: 1;
  transform: none;
  filter: none;
  transition: none;
}

body.page-is-leaving .site-header__title {
  opacity: 0;
  transition: opacity 0.32s ease 0.06s;
}

body.page-is-leaving .site-header__nav,
body.page-is-leaving .site-header__social,
body.page-is-leaving .site-header__menu-btn,
body.page-is-leaving .site-footer {
  opacity: 0;
  transition: opacity 0.32s ease 0.12s;
}

.gallery-page__center {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: var(--series-thumb-gap);
  width: var(--series-frame-w, max-content);
  max-width: 100%;
  min-width: 0;
  margin-inline: auto;
  padding-bottom: 0.5rem;
  overflow: visible;
}

.gallery-page__stage {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-inline: auto;
  overflow: visible;
}

.gallery-desktop .gallery-page__stage {
  width: calc(100vw - 2 * var(--shell-pad-x));
  max-width: none;
  margin-inline: calc((100% - (100vw - 2 * var(--shell-pad-x))) / 2);
}

.gallery-page__stage-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--series-hero-slot-h, var(--series-hero-max-h));
}

.gallery-page__stage-row .gallery-page__frame {
  flex-shrink: 0;
}

.gallery-page__frame {
  display: grid;
  grid-template-columns: var(--gallery-nav-size, 2.75rem) var(--series-hero-slot-w, var(--series-hero-max-w)) var(
      --gallery-nav-size,
      2.75rem
    );
  grid-template-rows: var(--series-hero-slot-h, var(--series-hero-max-h));
  column-gap: var(--gallery-nav-gap, calc(1.25rem * var(--series-ui-scale)));
  align-items: center;
  justify-items: center;
  width: var(--series-frame-w, max-content);
  height: var(--series-hero-slot-h, var(--series-hero-max-h));
  min-width: var(--series-frame-w, max-content);
  min-height: var(--series-hero-slot-h, var(--series-hero-max-h));
  flex-shrink: 0;
  box-sizing: content-box;
}

.gallery-page__viewport {
  grid-column: 2;
  grid-row: 1;
  width: var(--series-hero-slot-w, var(--series-hero-max-w));
  height: var(--series-hero-slot-h, var(--series-hero-max-h));
  min-width: var(--series-hero-slot-w, var(--series-hero-max-w));
  min-height: var(--series-hero-slot-h, var(--series-hero-max-h));
  overflow: hidden;
}

.gallery-page__viewport .gallery-page__hero {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-page__nav {
  grid-row: 1;
  z-index: 2;
  width: var(--gallery-nav-size, 2.75rem);
  height: var(--gallery-nav-size, 2.75rem);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
}

.gallery-page__nav--prev {
  grid-column: 1;
  justify-self: center;
}

.gallery-page__nav--next {
  grid-column: 3;
  justify-self: center;
}


.gallery-page__nav img,
.gallery-page__nav svg {
  display: block;
  width: var(--gallery-nav-icon, 1rem);
  height: var(--gallery-nav-icon, 1rem);
}

[data-theme="dark"] .gallery-desktop .gallery-page__nav img {
  filter: invert(1);
}

.gallery-desktop .gallery-page__center {
  gap: calc(1.25rem * var(--series-ui-scale) + 20px);
}

.gallery-page__photos,
.gallery-desktop .gallery-page__strip-source,
.gallery-desktop > .thumb-strip {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 56.3125rem) {
  .gallery-page__layout .thumb-strip:not(.gallery-mobile__thumbs) {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
}

.gallery-page__title {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 12px;
  margin: 0 0 0.75rem;
}

.gallery-page__body {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  max-width: 11.8125rem;
  margin: 0;
  color: var(--color-muted);
}

.gallery-page[data-series-gallery]:not(.gallery-page--single) .gallery-page__hero .img-reveal img[data-gallery-main] {
  display: block;
  border-radius: var(--radius-thumb);
  width: auto;
  height: auto;
  max-width: var(--series-hero-slot-w, var(--series-hero-max-w));
  max-height: var(--series-hero-slot-h, var(--series-hero-max-h));
  object-fit: contain;
}

.gallery-page__hero img[data-gallery-main] {
  display: block;
  border-radius: var(--radius-thumb);
  width: auto;
  height: auto;
  max-width: var(--series-hero-slot-w, var(--series-hero-max-w));
  max-height: var(--series-hero-slot-h, var(--series-hero-max-h));
  object-fit: contain;
  transition: opacity 0.28s ease;
}

.gallery-page__hero img.is-fading {
  opacity: 0;
}

.gallery-page__series-link {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 400;
  color: var(--color-muted);
  text-decoration: none;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  white-space: nowrap;
}

.gallery-page__series-link-label {
  font-weight: 700;
}

.gallery-page__stage-row .gallery-page__series-link {
  position: absolute;
  top: 50%;
  max-height: var(--series-hero-slot-h, var(--series-hero-max-h));
  transform: translateY(-50%);
  z-index: 3;
  pointer-events: auto;
}

.gallery-page__series-nav {
  display: none;
}

.gallery-page__stage-row .gallery-page__series-link--prev {
  left: 0;
}

.gallery-page__stage-row .gallery-page__series-link--next {
  right: 0;
}


.gallery-desktop .gallery-page__counter {
  position: static;
  transform: none;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.4;
  color: var(--color-text);
  white-space: nowrap;
  text-align: center;
}

.thumb-strip {
  display: inline-flex;
  gap: calc(8px * var(--series-ui-scale));
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  padding: 22px 0 12px;
  min-height: calc(22px + calc(39px * var(--series-ui-scale)) + 12px);
  width: max-content;
  max-width: min(100%, var(--series-hero-max-w));
  margin-inline: auto;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
}

.thumb-strip::-webkit-scrollbar {
  display: none;
}

.thumb-strip button {
  position: relative;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-thumb);
  opacity: 0.55;
  transition:
    opacity var(--transition),
    outline-color var(--transition);
}

.thumb-strip button[aria-current="true"] {
  opacity: 1;
  outline: 1px solid var(--color-text);
  outline-offset: 1px;
}

.thumb-strip button[aria-current="true"]::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border: 1px solid var(--color-text);
  border-radius: 50%;
  background: transparent;
  box-sizing: border-box;
}

.thumb-strip img {
  width: calc(39px * var(--series-ui-scale));
  height: calc(26px * var(--series-ui-scale));
  object-fit: cover;
  display: block;
}

.thumb-strip button[data-orientation="portrait"] img {
  width: calc(26px * var(--series-ui-scale));
  height: calc(39px * var(--series-ui-scale));
}

.gallery-page__counter--mobile {
  display: none;
}

.gallery-page__tap-hint {
  display: none;
}

/* Mobile gallery / detail */
.gallery-mobile {
  display: none;
  flex: 1;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  min-height: 0;
  padding: 0 0 2rem;
  box-sizing: border-box;
}

.gallery-mobile__bar.gallery-page__intro {
  display: flex;
}

.gallery-mobile__bar {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: baseline;
  gap: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 0.375rem var(--shell-pad-x) 0.875rem;
  flex-shrink: 0;
  margin-bottom: 0;
  text-align: left;
}

.gallery-mobile__bar .gallery-page__title {
  flex: 0 1 auto;
  min-width: 0;
  text-align: left;
}

.gallery-mobile .gallery-page__hero {
  display: flex;
  justify-content: center;
  width: 100%;
}

.gallery-mobile .gallery-page__hero img {
  margin: 0 auto;
}

/* ——— Modal “Sobre la serie” (estilo Cargo popup) ——— */
.gallery-details-overlay {
  position: fixed;
  inset: 0;
  z-index: 109;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--shell-pad-x);
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.gallery-details-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.gallery-details-overlay__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.42);
  cursor: pointer;
  transition: background-color var(--theme-transition-duration) var(--theme-transition-ease);
}

[data-theme="dark"] .gallery-details-overlay__backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.gallery-details-overlay__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 22.5rem);
  max-height: min(85vh, 28rem);
  background: var(--color-bg);
  color: var(--color-text);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.16);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    background-color var(--theme-transition-duration) var(--theme-transition-ease),
    color var(--theme-transition-duration) var(--theme-transition-ease);
}

.gallery-details-overlay.is-open .gallery-details-overlay__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.gallery-details-overlay__close {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  opacity: 0.55;
}


.gallery-details-overlay__close svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

.gallery-details-overlay__content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2rem 1.5rem 1.5rem;
  -webkit-overflow-scrolling: touch;
}

.gallery-details-overlay__title {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-text);
}

.gallery-details-overlay__body {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--color-muted);
}

.gallery-details-overlay__body p {
  margin: 0 0 1rem;
}

.gallery-details-overlay__body p:last-child {
  margin-bottom: 0;
}

/* ——— Gallery lightbox (Adobe Portfolio pattern) ——— */
html.gallery-lightbox-enabled,
html.gallery-lightbox-enabled body {
  overflow: hidden;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 111;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}

.gallery-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.4s ease, visibility 0s linear 0s;
}

.gallery-lightbox__blocking {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(255, 255, 255, 0.94);
  cursor: pointer;
}

.gallery-lightbox__wrap {
  position: fixed;
  inset: 0;
  z-index: 2;
  width: 100vw;
  height: 100%;
  pointer-events: none;
}

.gallery-lightbox__content {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100%;
  height: 100dvh;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.gallery-lightbox__figure {
  display: inline-block;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  pointer-events: auto;
}

.gallery-lightbox__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  user-select: none;
  -webkit-user-drag: none;
}

.gallery-lightbox__img.is-portrait {
  max-width: min(82vw, 100vw - 8rem);
  max-height: min(86dvh, 100dvh - 5rem);
}

.gallery-lightbox__close {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.gallery-lightbox__close-bg {
  fill: #696969;
  opacity: 0.2;
  transition: opacity 0.2s ease;
}

.gallery-lightbox__close:hover .gallery-lightbox__close-bg,
.gallery-lightbox__close:focus-visible .gallery-lightbox__close-bg {
  opacity: 0.4;
}

.gallery-lightbox__nav {
  position: fixed;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  transform: translateY(-50%);
}

.gallery-lightbox__nav img {
  display: block;
  width: 1.75rem;
  height: 1.75rem;
}

.gallery-lightbox__nav--prev {
  left: 2rem;
}

.gallery-lightbox__nav--next {
  right: 2rem;
}

[data-theme="dark"] .gallery-lightbox__nav img {
  filter: invert(1);
}

.gallery-lightbox.is-single .gallery-lightbox__nav {
  display: none;
}

.gallery-page[data-series-gallery]:not(.gallery-page--single):not([data-index-hero])
  .gallery-desktop
  .gallery-page__hero
  img[data-gallery-main] {
  cursor: zoom-in;
}

@media (max-width: 900px) {
  .gallery-page[data-series-gallery]:not(.gallery-page--single):not([data-index-hero])
    .gallery-page__hero
    img[data-gallery-main] {
    cursor: default;
  }
}

@media (max-width: 1024px) {
  .gallery-lightbox__close {
    top: 0;
    right: 0;
  }

  .gallery-lightbox__close-bg {
    display: none;
  }
}

/* ——— Menu overlay ——— */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: var(--color-overlay);
  color: #fff;
  padding: 2rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--transition),
    background-color var(--theme-transition-duration) var(--theme-transition-ease);
}

.menu-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.menu-overlay__close {
  align-self: flex-end;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 0.25rem;
  margin-bottom: 1rem;
}

.menu-overlay a {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1.5625rem;
  line-height: 1.35;
  text-decoration: none;
}

.menu-overlay a:hover,
.menu-overlay a:focus-visible,
.menu-overlay a[aria-current="page"] {
  color: var(--color-hover);
  text-decoration: underline;
  text-decoration-color: var(--color-hover);
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.menu-overlay a[aria-current="page"] {
  font-weight: 800;
}

.page:has(> main.about) {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

/* ——— Sobre mí ——— */
main.about {
  flex: 1;
  display: flex;
  align-items: center;
  align-items: safe center;
  justify-content: center;
  justify-content: safe center;
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 0;
  box-sizing: border-box;
}

.about__layout {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  width: max-content;
  max-width: calc(100% - 2 * var(--shell-pad-x));
  margin-inline: auto;
  --about-photo-w: clamp(20rem, 38vw, 44rem);
}

.about__text {
  width: 100%;
  max-width: 22rem;
}

.about__text p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--color-muted);
  text-align: left;
}

.about__text p + p {
  margin-top: 1.125rem;
}

.about__photo {
  display: flex;
  justify-content: center;
  align-items: center;
  width: var(--about-photo-w);
  margin: 0;
  padding: 0;
}

.about__photo img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* ——— Breakpoints ——— */
@media (max-width: 56.25rem) {
  html:has(main.gallery-page),
  body:has(main.gallery-page) {
    height: 100svh;
    max-height: 100svh;
    overflow: hidden;
  }

  html,
  body {
    overflow-x: hidden;
  }

  :root {
    --shell-pad-x: 20px;
    --shell-pad-y: 24px;
    --chrome-header: calc(var(--shell-pad-y) * 2 + 1.35rem);
    --chrome-footer: calc(var(--shell-pad-y) * 2 + 1.875rem);
    --gallery-mobile-reserve: 24px;
    --mobile-photo-w: calc(100vw - 2 * var(--shell-pad-x));
    --mobile-photo-h: min(
      calc(var(--mobile-photo-w) * 235 / 352 * 1.12),
      calc(100svh - var(--chrome-header) - var(--chrome-footer) - var(--gallery-mobile-reserve))
    );
    --mobile-header-content-gap: calc(1rem * 3);
  }

  .site-header,
  .site-footer {
    padding: var(--shell-pad-y) var(--shell-pad-x);
  }

  .site-header__nav {
    display: none;
  }

  .site-header__title {
    position: static;
    left: auto;
    transform: none;
    flex: 1;
    min-width: 0;
    text-align: left;
    max-width: none;
    font-size: clamp(0.75rem, 3.6vw, var(--text-title));
  }

  .site-header__title .swipe-letters {
    max-width: 100%;
  }

  .site-header__social {
    display: none;
  }

  .site-header {
    gap: 0.625rem;
  }

  .site-header__menu-btn {
    display: grid;
    place-items: center;
    flex-shrink: 0;
  }

  .home-hero {
    display: none;
  }

  .home-mobile-hero {
    display: block;
  }

  main.about {
    flex: 1;
    align-items: stretch;
    justify-content: flex-start;
    justify-content: safe flex-start;
    padding-top: calc(var(--chrome-header) + var(--mobile-header-content-gap));
    padding-bottom: calc(var(--chrome-footer) + 2rem);
  }

  .about__layout {
    grid-template-columns: minmax(0, 1fr);
    justify-content: start;
    width: 100%;
    max-width: 100%;
    gap: 2.5rem;
    justify-items: start;
    --about-photo-w: min(var(--mobile-photo-w), calc(100vw - 2 * var(--shell-pad-x)));
  }

  .about__text {
    width: 100%;
    max-width: var(--about-photo-w);
  }

  .about__text p {
    text-align: left;
  }

  .about__photo {
    width: var(--about-photo-w);
  }

  .gallery-page {
    --mobile-gallery-gutter: var(--shell-pad-x);
    --series-hero-max-w: var(--mobile-photo-w);
    --series-hero-max-h: var(--mobile-photo-h);
    --series-strip-reserve: 0;
  }

  .page--personal main.personal-main {
    justify-content: flex-start;
    align-items: center;
    padding-top: calc(var(--chrome-header) + var(--mobile-header-content-gap));
  }

  .page--personal .series-grid {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
    width: 100%;
    gap: 2.5rem;
  }

  .page--personal .series-card {
    align-items: flex-start;
  }

  .page--personal .series-card,
  .page--personal .series-card__label {
    width: 100%;
    max-width: var(--mobile-photo-w);
  }

  .page--personal .series-card__label {
    text-align: left;
  }

  .page--personal .series-card__thumb {
    width: var(--mobile-photo-w);
    max-width: 100%;
    height: var(--mobile-photo-h);
    aspect-ratio: auto;
  }

  .page--personal .series-card__thumb img {
    object-fit: cover;
    object-position: center;
  }

  .gallery-page__counter--desktop {
    display: none;
  }

  .gallery-page__counter--mobile {
    display: block;
    margin: 0;
    padding: 0;
    font-family: var(--font-mono);
    font-size: var(--text-nav);
    line-height: 1.2;
    text-align: center;
    color: var(--color-muted);
    white-space: nowrap;
  }

  .gallery-mobile .gallery-page__series-link {
    font-size: 12px;
  }

  .gallery-page[data-series-gallery]:not(.gallery-page--single) {
    --gallery-mobile-reserve: 24px;
  }

  .gallery-page--single .gallery-mobile {
    justify-content: center;
    padding-bottom: 0;
  }

  .gallery-page--single .gallery-mobile__stage {
    flex: 1;
    min-height: 0;
    margin-top: 0;
    justify-content: center;
    width: 100%;
  }

  .gallery-page--single .gallery-mobile .gallery-page__frame {
    width: var(--mobile-photo-w) !important;
    min-width: 0 !important;
    max-width: 100%;
    height: var(--mobile-photo-h);
    min-height: 0;
    max-height: var(--mobile-photo-h);
    margin-inline: auto;
  }

  .gallery-page--single .gallery-page__counter--mobile {
    display: none !important;
    margin-top: 0;
  }

  body.page-index .gallery-page__tap-hint {
    display: block;
    margin: 12px 0 0;
    width: min(var(--mobile-photo-w), 100%);
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.3;
    text-align: center;
    color: var(--color-muted);
    opacity: 0;
    transition: opacity 0.32s ease;
  }

  body.page-index .gallery-page__tap-hint.is-visible {
    opacity: 1;
  }

  .gallery-mobile__bar {
    flex-shrink: 0;
    padding-left: var(--shell-pad-x);
    padding-right: var(--shell-pad-x);
  }

  .gallery-mobile {
    flex: 1;
    min-height: 0;
    justify-content: center;
    align-items: stretch;
    padding-bottom: 0;
  }

  .gallery-mobile:has(.gallery-mobile__bar) {
    position: relative;
    --mobile-title-photo-gap: 2.75rem;
    --mobile-title-photo-min: 20px;
    --mobile-stage-extra: 6.5rem;
    --mobile-bar-h: 1.75rem;
    --mobile-photo-top: calc(50% - (var(--mobile-photo-h) + var(--mobile-stage-extra)) / 2);
  }

  .gallery-page[data-series-gallery]:not(.gallery-page--single) .gallery-mobile:has(.gallery-mobile__bar) {
    --mobile-stage-extra: 0;
    --mobile-photo-top: calc(50% - var(--mobile-photo-h) / 2);
  }

  .gallery-mobile__bar.gallery-page__intro {
    justify-content: flex-start;
    text-align: left;
    width: 100%;
    align-self: stretch;
    padding-bottom: 0.25rem;
    margin-bottom: 0;
    position: absolute;
    left: 0;
    right: 0;
    top: min(
      calc(var(--mobile-photo-top) - var(--mobile-title-photo-min) - var(--mobile-bar-h)),
      max(
        calc(var(--chrome-header) + 0.25rem),
        calc(var(--mobile-photo-top) - var(--mobile-title-photo-gap) - var(--mobile-bar-h))
      )
    );
    z-index: 2;
  }

  .gallery-mobile__bar .gallery-page__title {
    text-align: left;
  }

  .gallery-mobile__stage {
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    gap: 0;
    margin-top: 0;
    padding-inline: var(--shell-pad-x);
    box-sizing: border-box;
    overflow: hidden;
  }

  .gallery-mobile:has(.gallery-mobile__bar) .gallery-mobile__stage {
    margin-top: 0;
  }

  .gallery-page:not(.gallery-page--single) .gallery-mobile .gallery-page__frame {
    position: relative;
    display: block;
    width: var(--mobile-photo-w) !important;
    min-width: 0 !important;
    max-width: 100%;
    height: var(--mobile-photo-h);
    min-height: 0;
    max-height: var(--mobile-photo-h);
    margin-inline: auto;
    background: var(--color-bg);
    isolation: isolate;
    --gallery-mobile-nav-icon: 0.75rem;
    --gallery-mobile-nav-hit: 1.5rem;
  }

  .gallery-page:not(.gallery-page--single) .gallery-mobile__stage {
    touch-action: none;
  }

  .gallery-page:not(.gallery-page--single) .gallery-mobile .gallery-page__viewport {
    width: 100%;
    height: 100%;
    min-width: 0;
    max-width: 100%;
    position: relative;
    z-index: 1;
  }

  .gallery-page:not(.gallery-page--single) .gallery-mobile .gallery-page__nav {
    position: absolute;
    top: 0;
    bottom: 0;
    margin-block: auto;
    width: var(--gallery-mobile-nav-hit, 1.5rem);
    height: var(--gallery-mobile-nav-hit, 1.5rem);
    display: grid;
    place-items: center;
    transform: none;
    z-index: 2;
    mix-blend-mode: difference;
    -webkit-mix-blend-mode: difference;
    color: #ffffff;
  }

  .gallery-page:not(.gallery-page--single) .gallery-mobile .gallery-page__nav--prev {
    left: 0;
  }

  .gallery-page:not(.gallery-page--single) .gallery-mobile .gallery-page__nav--next {
    right: 0;
  }

  .gallery-page:not(.gallery-page--single) .gallery-mobile .gallery-page__nav img,
  .gallery-page:not(.gallery-page--single) .gallery-mobile .gallery-page__nav svg {
    display: block;
    width: var(--gallery-mobile-nav-icon, 0.75rem);
    height: auto;
  }

  .gallery-page:not(.gallery-page--single) .gallery-mobile .gallery-page__nav img {
    filter: brightness(0) invert(1);
  }

  .gallery-page--single .gallery-mobile .gallery-page__hero img[data-gallery-main] {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }

  .gallery-page--single .gallery-mobile .img-reveal {
    width: 100%;
    height: 100%;
    display: block;
  }

  .gallery-page[data-series-gallery]:not(.gallery-page--single) .gallery-mobile .img-reveal {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .gallery-page--single .gallery-mobile .gallery-page__viewport {
    width: var(--mobile-photo-w);
    height: var(--mobile-photo-h);
    min-width: 0;
    max-width: 100%;
  }

  /* Series mobile — misma foto que index: centrada, sin flechas, tap izq/der */
  .gallery-page[data-series-gallery]:not(.gallery-page--single) .gallery-mobile {
    justify-content: center;
    padding-bottom: 0;
  }

  .gallery-page[data-series-gallery]:not(.gallery-page--single) .gallery-mobile__stage {
    flex: 1;
    min-height: 0;
    margin-top: 0;
    justify-content: center;
    align-items: center;
    position: relative;
    touch-action: pan-y pinch-zoom;
    overflow: visible;
  }

  .gallery-page[data-series-gallery]:not(.gallery-page--single) .gallery-mobile .gallery-page__nav {
    display: none !important;
  }

  .gallery-page[data-series-gallery]:not(.gallery-page--single) .gallery-mobile .gallery-page__frame {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
    position: static;
    width: var(--mobile-photo-w) !important;
    min-width: 0 !important;
    max-width: 100%;
    height: var(--mobile-photo-h);
    min-height: 0;
    max-height: var(--mobile-photo-h);
    margin-inline: auto;
    background: transparent;
    isolation: auto;
    flex-shrink: 0;
  }

  .gallery-page[data-series-gallery]:not(.gallery-page--single) .gallery-mobile .gallery-page__viewport {
    width: var(--mobile-photo-w);
    height: var(--mobile-photo-h);
    min-width: 0;
    max-width: 100%;
    position: static;
    z-index: auto;
  }

  .gallery-page[data-series-gallery]:not(.gallery-page--single) .gallery-mobile .gallery-page__hero {
    width: 100%;
    height: 100%;
  }

  .gallery-page[data-series-gallery]:not(.gallery-page--single) .gallery-mobile .img-reveal {
    width: 100%;
    height: 100%;
    display: block;
  }

  .gallery-page[data-series-gallery]:not(.gallery-page--single) .gallery-mobile .gallery-page__hero img[data-gallery-main] {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }

  .gallery-page[data-series-gallery]:not(.gallery-page--single) .gallery-mobile__stage .gallery-page__counter--mobile {
    position: absolute;
    top: calc(50% + var(--mobile-photo-h) / 2 + 1rem + 20px);
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0;
    width: min(var(--mobile-photo-w), 100%);
    text-align: center;
  }

  .gallery-page[data-series-gallery]:not(.gallery-page--single) .gallery-mobile__stage .gallery-page__series-nav {
    position: absolute;
    top: calc(50% + var(--mobile-photo-h) / 2 + 1rem + 20px + 1.75rem + 2.25rem);
    left: var(--shell-pad-x);
    right: var(--shell-pad-x);
    margin-top: 0;
    width: auto;
    max-width: none;
  }

  .gallery-mobile__stage .gallery-page__counter--mobile {
    margin-top: calc(1rem + 20px);
    width: min(var(--mobile-photo-w), 100%);
    text-align: center;
  }

  .gallery-mobile .gallery-page__series-nav {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    margin-top: 2.25rem;
    align-self: stretch;
  }

  .gallery-mobile .gallery-page__series-nav .gallery-page__series-link {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    transform: none;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    max-height: none;
    white-space: normal;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    flex: 0 1 auto;
    width: auto;
    max-width: 48%;
  }

  .gallery-mobile .gallery-page__series-nav .gallery-page__series-link--prev {
    text-align: left;
    align-items: flex-start;
  }

  .gallery-mobile .gallery-page__series-nav .gallery-page__series-link--next {
    text-align: right;
    align-items: flex-end;
    margin-left: auto;
  }

  .gallery-mobile .gallery-page__series-nav .gallery-page__series-link-label {
    display: block;
    line-height: 1.3;
  }

  .gallery-mobile .gallery-page__series-nav .gallery-page__series-link-title {
    display: block;
    line-height: 1.3;
  }

  .gallery-mobile__stage .gallery-page__hero img[data-gallery-main] {
    display: block;
    width: auto;
    height: auto;
    max-width: min(var(--mobile-photo-w), 100%);
    max-height: var(--mobile-photo-h);
    object-fit: contain;
  }

  .gallery-desktop {
    display: none;
  }

  main.gallery-page {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .gallery-mobile {
    display: flex;
  }

  .page-home main {
    max-width: none;
    width: 100%;
    padding: 0;
  }

  .page-home .home-hero,
  .page-home .home-hero__viewport {
    max-height: none;
  }

  .page-home .home-mobile-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0;
    flex: 0 1 auto;
  }

  /* Pantallas chicas (ej. 375×667): título en flujo normal, mínimo 20px sobre la foto */
  @media (max-height: 43.75rem) {
    .gallery-page:not(.gallery-page--single):not([data-series-gallery]) {
      --gallery-mobile-reserve: calc(24px + 1.75rem + 20px + 3rem);
    }

    .gallery-mobile:has(.gallery-mobile__bar) .gallery-mobile__bar.gallery-page__intro {
      position: static;
      top: auto;
      margin-bottom: 20px;
    }

    .gallery-page[data-series-gallery]:not(.gallery-page--single) .gallery-mobile__bar.gallery-page__intro {
      position: absolute;
      margin-bottom: 0;
    }
  }
}

@media (min-width: 56.3125rem) {
  .gallery-mobile {
    display: none !important;
  }
}

/* ——— ShaftLoader (transiciones entre secciones) ——— */
body.loader-active {
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: none;
}

body.loader-active .site-header,
body.loader-active .page,
body.loader-active .site-footer,
body.loader-active .menu-overlay,
body.loader-active .navbar,
body.loader-active .gallery-shell {
  pointer-events: none;
}

#shaft-loader {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  pointer-events: auto;
  overflow: hidden;
}

#shaft-loader .panel-top,
#shaft-loader .panel-bottom {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  background-color: var(--shaft-panel-bg);
  will-change: transform;
  transform: translateY(0);
  transition: transform var(--shaft-open-duration) var(--shaft-ease);
}

#shaft-loader .panel-top {
  top: 0;
}

#shaft-loader .panel-bottom {
  bottom: 0;
}

#shaft-loader.is-exiting .panel-top {
  transform: translateY(-100%);
}

#shaft-loader.is-exiting .panel-bottom {
  transform: translateY(100%);
}

#shaft-loader.is-closing .panel-top,
#shaft-loader.is-closing .panel-bottom {
  transform: translateY(0);
  transition-duration: var(--shaft-close-duration);
}

#shaft-loader.is-closing .shaft-loader__text {
  opacity: 0;
  transition-duration: 0.35s;
}

#shaft-loader.is-no-transition .panel-top,
#shaft-loader.is-no-transition .panel-bottom {
  transition: none !important;
}

.shaft-loader__text {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0 1.25rem;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--shaft-loader-text);
  pointer-events: none;
  transition: opacity 0.45s var(--shaft-ease);
}

#shaft-loader.is-exiting .shaft-loader__text {
  opacity: 0;
}

.shaft-loader__upper {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: clamp(calc(0.875rem + 1px), 2.5vw, calc(1.125rem + 1px));
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.shaft-loader__lower {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-nav);
  letter-spacing: 0.04em;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  #shaft-loader .panel-top,
  #shaft-loader .panel-bottom {
    transition-duration: 0.01ms;
  }

  #shaft-loader.is-closing .panel-top,
  #shaft-loader.is-closing .panel-bottom {
    transition-duration: 0.01ms;
  }

  #shaft-loader.is-exiting .shaft-loader__text,
  #shaft-loader.is-closing .shaft-loader__text {
    transition-duration: 0.01ms;
  }

  .gallery-page__hero img[data-gallery-main] {
    transition: none;
  }

  .gallery-page--single .img-reveal img[data-gallery-main],
  .gallery-page[data-series-gallery]:not(.gallery-page--single) .img-reveal img[data-gallery-main] {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}
