/* ---------- Colores y tipografía ---------- */
/* Neue Haas Display en toda la web, textos y titulares (en Windows/Android, si falla, cae en Arial) */
@font-face { font-family: "Neue Haas Display"; src: url("fonts/NeueHaas/NeueHaasDisplayXXThin.ttf") format("truetype"); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: "Neue Haas Display"; src: url("fonts/NeueHaas/NeueHaasDisplayXXThinItalic.ttf") format("truetype"); font-weight: 100; font-style: italic; font-display: swap; }
@font-face { font-family: "Neue Haas Display"; src: url("fonts/NeueHaas/NeueHaasDisplayXThin.ttf") format("truetype"); font-weight: 200; font-style: normal; font-display: swap; }
@font-face { font-family: "Neue Haas Display"; src: url("fonts/NeueHaas/NeueHaasDisplayXThinItalic.ttf") format("truetype"); font-weight: 200; font-style: italic; font-display: swap; }
@font-face { font-family: "Neue Haas Display"; src: url("fonts/NeueHaas/NeueHaasDisplayThin.ttf") format("truetype"); font-weight: 250; font-style: normal; font-display: swap; }
@font-face { font-family: "Neue Haas Display"; src: url("fonts/NeueHaas/NeueHaasDisplayThinItalic.ttf") format("truetype"); font-weight: 250; font-style: italic; font-display: swap; }
@font-face { font-family: "Neue Haas Display"; src: url("fonts/NeueHaas/NeueHaasDisplayLight.ttf") format("truetype"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Neue Haas Display"; src: url("fonts/NeueHaas/NeueHaasDisplayLightItalic.ttf") format("truetype"); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: "Neue Haas Display"; src: url("fonts/NeueHaas/NeueHaasDisplayRoman.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Neue Haas Display"; src: url("fonts/NeueHaas/NeueHaasDisplayRomanItalic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Neue Haas Display"; src: url("fonts/NeueHaas/NeueHaasDisplayMediu.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Neue Haas Display"; src: url("fonts/NeueHaas/NeueHaasDisplayMediumItalic.ttf") format("truetype"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Neue Haas Display"; src: url("fonts/NeueHaas/NeueHaasDisplayBold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Neue Haas Display"; src: url("fonts/NeueHaas/NeueHaasDisplayBoldItalic.ttf") format("truetype"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Neue Haas Display"; src: url("fonts/NeueHaas/NeueHaasDisplayBlack.ttf") format("truetype"); font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Neue Haas Display"; src: url("fonts/NeueHaas/NeueHaasDisplayBlackItalic.ttf") format("truetype"); font-weight: 900; font-style: italic; font-display: swap; }
:root {
  --paper: #000; /* negro profundo en modo oscuro */
  --ink: #ebebeb; /* blanco roto, no 100 % blanco */
  --ink-rgb: 235, 235, 235; /* el mismo color que --ink, para transparencias */
  --line: 1px solid var(--ink);
  --display: "Neue Haas Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --text: "Neue Haas Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --pad: clamp(16px, 2vw, 28px);
  color-scheme: dark;
}
/* Modo claro (theme.js pone data-theme="light" en <html>) */
:root[data-theme="light"] {
  --paper: #ededed;
  --ink: #191919;
  --ink-rgb: 25, 25, 25;
  color-scheme: light;
}
.logo img { filter: brightness(.92); } /* logo blanco → blanco roto, como el texto */
[data-theme="light"] .logo img { filter: brightness(0); }
/* Página Work: titulares con la misma fuente que el texto y líneas de 0,25 pt */
.page-work { --display: var(--text); --line: .25pt solid var(--ink); }
body { transition: background-color .4s ease, color .4s ease; }

/* Botón claro / oscuro: fijo en la esquina, no se mueve con el scroll */
.theme-toggle {
  position: fixed;
  right: calc(var(--pad) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--pad) + env(safe-area-inset-bottom, 0px));
  z-index: 160;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border: .25pt solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: background-color .4s ease, color .4s ease, transform .3s ease;
}
.theme-toggle:hover { transform: rotate(-20deg); }
.theme-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.theme-toggle svg { width: 20px; height: 20px; }
/* En oscuro se ve el sol (pasar a claro); en claro, la luna */
.theme-toggle .i-moon, [data-theme="light"] .theme-toggle .i-sun { display: none; }
[data-theme="light"] .theme-toggle .i-moon { display: block; }

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

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: clamp(14px, 1vw, 16px);
  line-height: 1.5;
  letter-spacing: .02em;
}

a { color: inherit; }
a:focus-visible,
button:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; /* cabecera fija con logo y menú */
  top: 0;
  z-index: 20;
  background: var(--paper);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: clamp(10px, 1.1vw, 16px) var(--pad);
  font-size: .9em;
}

.logo {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(26px, 3.4vw, 48px);
  line-height: .88;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: -.01em;
}
.logo { display: block; line-height: 0; }
.logo img {
  display: block;
  height: clamp(38px, 4vw, 60px);
  width: auto;
  filter: brightness(0) invert(1); /* logo gris → blanco puro sobre fondo oscuro */
}

.site-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px clamp(18px, 4vw, 64px); }
.site-nav a {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .25s ease;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { background-size: 100% 1px; }
/* Work: pastilla negra con trazo fino y resplandor suave que respira, siempre visible */
.site-nav a[href="work.html"] {
  margin-block: -.35em;
  padding: .35em 1.1em;
  border-radius: 999px;
  background: #000; /* pastilla negra (también en modo claro) */
  color: #ebebeb;
  border: .25pt solid #ebebeb;
  box-shadow: 0 0 12px rgba(var(--ink-rgb), .45), 0 0 28px rgba(var(--ink-rgb), .2);
  animation: nav-glow 2.8s ease-in-out infinite;
}
@keyframes nav-glow {
  50% { box-shadow: 0 0 18px rgba(var(--ink-rgb), .7), 0 0 42px rgba(var(--ink-rgb), .3); }
}

/* ---------- Cinta en movimiento ---------- */
.ticker {
  overflow: hidden;
  border-block: .25pt solid var(--ink); /* líneas finas arriba y abajo */
  padding: clamp(6px, .8vw, 10px) 0;
  font-family: var(--text);
  font-stretch: 105%;
  font-weight: 400;
  font-size: clamp(12px, 1.1vw, 16px);
  letter-spacing: .04em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}
.ticker-track {
  display: inline-flex;
  animation: ticker 60s linear infinite;
  will-change: transform;
}
.ticker-track span { padding-right: .6em; }
.ticker-track span::after { content: "·"; padding-left: .6em; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Filtros ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 14px var(--pad);
  border-bottom: var(--line);
}
.filters button {
  font: inherit;
  letter-spacing: inherit;
  color: var(--ink);
  background: transparent;
  border: var(--line);
  border-radius: 999px;
  padding: 4px 16px;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.filters button:hover { background: rgba(var(--ink-rgb), .15); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ---------- Rejilla de proyectos ---------- */
.works {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--ink); /* el hueco de 1px dibuja las líneas */
  border-bottom: var(--line);
}
.work { background: var(--paper); min-width: 0; }
.work[hidden] { display: none; }
.work.span-all { grid-column: 1 / -1; }

.media {
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background: #000;
}
.work.span-all .media { aspect-ratio: 21 / 9; }
.media > video,
.media > img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
/* Vídeo entero, centrado; los laterales quedan en el negro del fondo */
.media > .media-fit { object-fit: contain; transform: scale(1.9); } /* scale = tamaño dentro de la tarjeta */
.media > .media-zoom { transform: scale(1.3); } /* vídeo un 30% más grande dentro de la tarjeta */
/* Logo de la marca encima del vídeo, centrado */
.media > .media-logo {
  position: absolute; inset: 0; margin: auto;
  width: 46%; height: auto;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 16px rgba(0, 0, 0, .35));
}

/* Bloques provisionales: se sustituyen por tu vídeo o imagen */
.ph {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(40px, 7vw, 120px);
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.ph--light { background: #f1f1f1; color: #111; }
.ph--dark  { background: #000; color: #e4e4e4; }
.ph--grey  { background: #bdbdbd; color: #111; }
.ph small {
  position: absolute; left: 14px; bottom: 12px;
  font-family: var(--text);
  font-stretch: 100%;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: .02em;
  text-transform: none;
  opacity: .65;
}

.caption {
  display: grid;
  grid-template-columns: 3.2em 1fr auto;
  align-items: baseline;
  gap: 16px;
  padding: 14px var(--pad);
  border-top: var(--line);
}
.caption .num { font-variant-numeric: tabular-nums; }
.caption h2 {
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 800;
  font-size: clamp(17px, 1.5vw, 22px);
  line-height: 1.1;
}
.caption .meta { text-align: right; }

/* ---------- Contacto y pie ---------- */
.contact p { margin-bottom: .2em; }
.contact a {
  font-weight: 600;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  overflow-wrap: anywhere;
}
.contact a:hover { border-bottom-width: 3px; }

.cta {
  padding: clamp(32px, 7vw, 96px) var(--pad);
  border-bottom: var(--line);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  padding: var(--pad);
  padding-right: calc(var(--pad) + 56px); /* sitio para el botón claro / oscuro */
  /* Las columnas se centran en una franja de 44 px (el alto del botón claro / oscuro), a la
     misma distancia del borde que él: así quedan alineadas con su centro */
  min-height: calc(44px + 2 * var(--pad));
  /* todo el pie en el tono y tamaño del correo, con el mismo interlineado */
  font-size: calc(.85em - 2pt);
  line-height: 1.4;
  color: rgba(var(--ink-rgb), .7);
}
.footer-id { display: flex; flex-direction: column; }
.footer-mail {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  text-decoration: none;
  transition: color .2s ease;
}
.footer-mail:hover { color: var(--ink); }
.footer-label { font-weight: 500; } /* "Contacto:" en Medium */
.footer-services { text-align: right; }

/* ---------- Página About ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(300px, 40%) 1fr;
  min-height: 70vh;
}
.about-text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 56px;
  padding: clamp(28px, 6vh, 72px) var(--pad) var(--pad);
  border-right: var(--line);
}
.about-text h1 { font-weight: 400; font-size: inherit; margin-bottom: 1.4em; }
.about-text p + p { margin-top: 1.4em; }
.about-text strong { font-weight: 600; }
.about-media { background: var(--paper); min-height: 360px; }
.about-media .ph { min-height: 360px; }
/* Manifiesto: titular enorme arriba, frase y texto en dos columnas abajo */
.manifesto {
  display: flex;
  flex-direction: column;
  gap: clamp(80px, 16vh, 220px);
  padding: clamp(28px, 6vh, 72px) var(--pad);
  border-bottom: var(--line);
}
.manifesto-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(56px, 13vw, 260px);
  line-height: .9;
  letter-spacing: -.03em;
}
/* Rejilla de 4 columnas: frase en la 2ª, texto en la 3ª y 4ª (como la referencia) */
.manifesto-body {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: var(--pad);
  align-items: start;
  font-size: clamp(16px, 1.4vw, 24px);
  line-height: 1.3;
}
.manifesto-lead { grid-column: 2; }
.manifesto-body p:last-child {
  grid-column: 3 / span 2;
  max-width: 34em;
  text-wrap: pretty; /* evita palabras sueltas en la última línea */
  hyphens: manual;
}

/* ---------- Home: portada ---------- */
.hero {
  position: relative;
  border-bottom: var(--line);
  background: var(--paper);
  color: var(--ink);
}
/* Cabecera + cinta + portada llenan exactamente la primera pantalla (--top-h lo calcula index.html) */
.hero-media {
  height: calc(100vh - var(--top-h, 0px));
  height: calc(100svh - var(--top-h, 0px));
  min-height: 320px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000; /* negro detrás del titular y del ventilador (también en modo claro) */
  color: #ebebeb;
}
.hero-media > video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Secuencia 3D centrada; se anima con scroll y hover (sequence.js) */
.hero-seq {
  width: auto;
  height: auto;
  max-height: 72%;
  max-width: calc(100% - 2 * var(--pad));
  display: block;
  user-select: none;
  -webkit-user-select: none;
  filter: brightness(1.22) contrast(1.06); /* blancos más limpios */
}
.hero-media > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-ph {
  width: 100%; height: 100%;
  background: radial-gradient(120% 140% at 70% 30%, #2b2b2b 0%, #000 65%);
}
.hero-label {
  position: absolute;
  top: var(--pad);
  left: var(--pad);
}
/* Titular grande centrado detrás de la secuencia */
.hero-media { position: relative; }
.hero-title {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline: var(--pad);
  text-align: center;
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(36px, 8.6vw, 190px);
  line-height: .85;
  letter-spacing: -.02em;
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
}
.hero-seq { position: relative; z-index: 1; }
.fx-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Home: servicios a media pantalla ---------- */
.services {
  display: flex;
  min-height: calc((100vh - var(--head-h, 0px)) / 2); /* media pantalla */
  min-height: calc((100svh - var(--head-h, 0px)) / 2);
  border-bottom: var(--line);
}
.services .index-list { flex: 1; display: flex; flex-direction: column; }
.services .index-list li { flex: 1; align-content: center; }
.services .index-list .name { font-size: clamp(18px, 2.4vw, 38px); }

/* ---------- Home: bloques con etiqueta a la izquierda ---------- */
.block {
  display: grid;
  grid-template-columns: minmax(160px, 22%) 1fr;
  border-bottom: var(--line);
}
.block-label {
  font-weight: 400;
  font-size: inherit;
  padding: clamp(18px, 3vw, 40px) var(--pad);
  border-right: var(--line);
}

/* Listas numeradas (servicios y trabajos) */
.index-list { list-style: none; }
.index-list li,
.index-list--links a {
  display: grid;
  grid-template-columns: 4em 1fr auto;
  align-items: baseline;
  gap: 16px;
  padding: clamp(12px, 1.6vw, 22px) var(--pad);
  border-bottom: var(--line);
}
.index-list li:last-child,
.index-list--links li:last-child a { border-bottom: 0; }
.index-list--links li { display: block; padding: 0; border-bottom: var(--line); }
.index-list--links li:last-child { border-bottom: 0; }
.index-list--links a { text-decoration: none; border-bottom: 0; }

.index-list .idx { font-variant-numeric: tabular-nums; }
.index-list .name {
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 800;
  font-size: clamp(20px, 2.8vw, 42px);
  line-height: 1.05;
}
.index-list--links .name { font-size: clamp(18px, 2.2vw, 32px); }
.index-list .meta { text-align: right; }

.index-list li,
.index-list--links a { transition: background-color .2s ease, color .2s ease; }
.index-list li:hover,
.index-list--links a:hover { background: var(--ink); color: var(--paper); }
.index-list--links li:hover { background: transparent; color: inherit; }

.statement { padding: clamp(18px, 3vw, 40px) var(--pad); }
.statement p {
  max-width: 28em;
  font-family: var(--text);
  font-stretch: 105%;
  font-weight: 500;
  font-size: clamp(19px, 2.1vw, 32px);
  line-height: 1.15;
  letter-spacing: -.01em;
  margin-bottom: 1.2em;
}

.text-link {
  display: inline-block;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
.text-link:hover { border-bottom-width: 3px; }
.all-work { margin: 0 var(--pad) clamp(18px, 3vw, 40px); }
.index-list--links + .all-work { margin-top: clamp(18px, 2vw, 28px); }

/* ---------- Home: carrusel de trabajos ---------- */
/* La sección es más alta que la pantalla (JS fija su altura); el contenido queda fijo
   mientras el scroll vertical recorre las imágenes en horizontal */
.works-carousel { position: relative; }
.carousel-sticky {
  position: sticky;
  top: var(--head-h, 0px); /* bajo la cabecera fija */
  height: calc(100vh - var(--head-h, 0px));
  height: calc(100svh - var(--head-h, 0px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Home a pantalla completa (data-fit): sin scroll de página; el carrusel ocupa lo que queda
   bajo la cabecera y la cinta, y se mueve con la rueda, el trackpad o el dedo */
html:has(body.home-fit), body.home-fit { height: 100%; overflow: hidden; overscroll-behavior: none; }
.home-fit .carousel-sticky {
  position: relative;
  top: 0;
  height: calc(100vh - var(--top-h, 0px));
  height: calc(100svh - var(--top-h, 0px));
}
/* Sin la palabra WORK: aire arriba para que los extremos agrandados no toquen la cinta */
.home-fit .carousel { padding-top: clamp(40px, 6vw, 110px); }
.carousel-head {
  text-align: center;
  padding: clamp(10px, 1.4vw, 24px) var(--pad) clamp(18px, 2.6vw, 44px); /* arriba / abajo: aire hasta el carrusel */
}
.carousel-title {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 900;
  font-size: calc(clamp(36px, 5.5vw, 92px) - 10pt);
  line-height: .9;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.carousel-foot {
  text-align: center;
  padding: 0 var(--pad) clamp(16px, 2.4vw, 32px);
}
/* "Ver más proyectos" en pastilla con trazo de 0,25 pt; al pasar el ratón se rellena */
.carousel-foot .text-link {
  font-size: .8em;
  padding: .55em 1.4em;
  border: .25pt solid currentColor;
  border-radius: 999px;
  transition: background-color .25s ease, color .25s ease;
}
.carousel-foot .text-link:hover { border-bottom-width: .25pt; background: var(--ink); color: var(--paper); }
.carousel-sticky .site-footer { background: var(--paper); padding-top: 0; min-height: calc(44px + var(--pad)); } /* en la home el pie cabe entero en pantalla */
/* Textos por encima del canvas */
.carousel-head, .carousel-foot, .carousel-sticky .site-footer { position: relative; z-index: 1; }

.carousel {
  /* 3 trabajos por pantalla: el ancho sale del contenedor (cqw), limitado por la altura
     para que la imagen 4:5 quepa; el hueco reparte el espacio sobrante */
  container-type: inline-size;
  --slide-w: min(24cqw, 40svh);
  --slide-gap: calc((100cqw - 2 * var(--pad) - 3 * var(--slide-w)) / 2);
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  /* sin overflow: .carousel-sticky ya recorta y la perspectiva agranda los extremos */
}
.carousel-track {
  display: flex;
  gap: var(--slide-gap);
  padding-inline: var(--pad);
  will-change: transform;
}
.slide {
  flex: 0 0 var(--slide-w);
  text-decoration: none;
}
.slide img,
.slide video {
  display: block;
  width: 100%;
  height: auto; /* sin esto, el atributo height="1350" estira la imagen */
  aspect-ratio: 1 / 1;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
}
.slide-cap {
  transform-origin: 0 0; /* carousel.js lo recoloca siguiendo la perspectiva */
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: clamp(14px, 1.4vw, 22px); /* margen entre imagen y texto */
  font-size: .85em;
}
/* Con WebGL activo las imágenes se pintan en el canvas; la del DOM queda invisible pero ocupa su sitio */
.carousel.is-gl .slide img,
.carousel.is-gl .slide video { opacity: 0; }
/* Los textos por encima del canvas, para que la imagen curvada no los tape */
.carousel.is-gl .slide-cap { position: relative; z-index: 2; }
.carousel.is-gl { z-index: 1; }
.carousel-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@media (max-width: 820px) {
  .carousel { --slide-w: min(62cqw, 37svh); --slide-gap: 14cqw; }
  /* Móvil: los trabajos en lista vertical con scroll normal de página (carousel.js no se monta) */
  html:has(body.home-fit), body.home-fit { height: auto; overflow: visible; overscroll-behavior: auto; }
  .home-fit .carousel-sticky { height: auto; overflow: visible; }
  .home-fit .carousel { padding-top: 24px; }
  .carousel-track { flex-direction: column; width: 100%; gap: 40px; will-change: auto; }
  .slide { flex: none; width: 100%; }
  .carousel-foot { padding-top: 40px; padding-bottom: 32px; }
}

/* ---------- Home: cierre ---------- */
.closing {
  padding: clamp(40px, 8vw, 120px) var(--pad);
  border-bottom: var(--line);
}
.closing-title {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(40px, 8.5vw, 140px);
  line-height: .88;
  letter-spacing: -.03em;
  text-transform: uppercase;
  margin-bottom: .35em;
}
.big-mail {
  font-weight: 600;
  font-size: clamp(16px, 1.7vw, 24px);
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 2px solid currentColor;
  overflow-wrap: anywhere;
}
.big-mail:hover { border-bottom-width: 5px; }

@media (max-width: 820px) {
  /* Móvil: titular arriba para que el ventilador no lo tape */
  .hero-title { font-size: 8.6vw; align-items: flex-start; padding-top: calc(var(--pad) * 2); }
  .hero-seq { margin-top: 18%; }
  .closing-title { font-size: 8vw; }
  .block { grid-template-columns: 1fr; }
  .block-label { border-right: 0; border-bottom: var(--line); padding-block: 12px; }
  .index-list li,
  .index-list--links a { grid-template-columns: 3em 1fr; row-gap: 2px; }
  .index-list .meta { grid-column: 2; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .index-list li,
  .index-list--links a { transition: none; }
}

/* ---------- Móvil ---------- */
@media (max-width: 820px) {
  .works { grid-template-columns: 1fr; }
  .work.span-all .media { aspect-ratio: 16 / 11; }
  .caption { grid-template-columns: 2.6em 1fr; row-gap: 2px; }
  .caption .meta { grid-column: 2; text-align: left; }
  .about { grid-template-columns: 1fr; }
  .manifesto-body { grid-template-columns: 1fr; row-gap: 1em; }
  .manifesto-lead,
  .manifesto-body p:last-child { grid-column: 1; }
  .about-text { border-right: 0; border-bottom: var(--line); gap: 40px; }
  /* Contacto en la esquina inferior izquierda; servicios a la derecha, junto al botón claro / oscuro y con la base a su altura */
  .site-footer { flex-wrap: nowrap; align-items: flex-end; gap: 16px; }
  .footer-services { text-align: right; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  .ticker-track, .site-nav a[href="work.html"] { animation: none; }
  .site-nav a,
  .filters button { transition: none; }
}

/* Proyecto con página propia: todo el bloque es clicable */
.work:has(.work-link) { position: relative; cursor: pointer; }
.work-link { position: absolute; inset: 0; z-index: 2; }
.work:has(.work-link:hover) h2 { text-decoration: underline; }

/* ---------- Cursor propio (cursor.js), solo con ratón ---------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  z-index: 150;
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 999px;
  background: #ebebeb;
  mix-blend-mode: difference;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0; /* aparece con el primer movimiento del ratón */
  transition: width .35s cubic-bezier(.16, 1, .3, 1), height .35s cubic-bezier(.16, 1, .3, 1),
              margin .35s cubic-bezier(.16, 1, .3, 1), opacity .3s;
}
.cursor-label { font-size: .75em; color: #000; white-space: nowrap; opacity: 0; transition: opacity .2s; }
.cursor.is-label { width: 110px; height: 110px; margin: -55px 0 0 -55px; mix-blend-mode: normal; }
.cursor.is-label .cursor-label { opacity: 1; }
/* Variante discreta (data-cursor-small): más pequeña y translúcida */
.cursor.is-label.is-small { width: 70px; height: 70px; margin: -35px 0 0 -35px; background: rgba(235, 235, 235, .45); }
.cursor.is-small .cursor-label { font-size: .65em; }
/* Variante mínima (data-cursor-mini, p. ej. sonido): pequeña y al 25 % */
.cursor.is-label.is-mini { width: 54px; height: 54px; margin: -27px 0 0 -27px; background: rgba(235, 235, 235, .25); }
.cursor.is-mini .cursor-label { font-size: .58em; color: #ebebeb; white-space: normal; text-align: center; line-height: 1.1; padding: 0 6px; }


/* ---------- Pantalla de carga de la home (loader.js) ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--paper);
  color: var(--ink);
  transition: transform .9s cubic-bezier(.76, 0, .24, 1);
}
.skip-loader .loader { display: none; }
.loader.is-done { transform: translateY(-100%); }
.loader-name {
  position: absolute;
  top: var(--pad);
  left: var(--pad);
  font-size: .85em;
}
.loader-num {
  position: absolute;
  right: var(--pad);
  bottom: calc(var(--pad) + 1px);
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(64px, 16vw, 300px);
  line-height: .8;
  font-variant-numeric: tabular-nums;
}
.loader-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: 0 50%;
}
@media (prefers-reduced-motion: reduce) {
  .loader { transition: opacity .4s; }
  .loader.is-done { transform: none; opacity: 0; }
}

/* ---------- Menú hamburguesa (menu.js), solo en móvil ---------- */
.menu-toggle { display: none; }
@media (max-width: 820px) {
  .menu-toggle {
    display: grid;
    place-content: center;
    gap: 7px;
    width: 44px; height: 44px;
    margin-right: -10px;
    border: 0;
    background: none;
    color: var(--ink);
    cursor: pointer;
  }
  .menu-toggle span {
    display: block;
    width: 26px; height: 1.5px;
    background: currentColor;
    transition: transform .45s cubic-bezier(.77, 0, .18, 1);
  }
  .menu-open .menu-toggle span:first-child { transform: translateY(4.25px) rotate(45deg); }
  .menu-open .menu-toggle span:last-child { transform: translateY(-4.25px) rotate(-45deg); }

  /* El menú ocupa toda la pantalla bajo la cabecera */
  .site-nav {
    position: fixed;
    inset: 0;
    z-index: -1;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-start;
    gap: 18px;
    padding: var(--pad);
    background: var(--paper);
    font-family: var(--display);
    font-stretch: 125%;
    font-weight: 900;
    font-size: clamp(26px, 7.5vw, 40px);
    line-height: 1;
    text-transform: uppercase;
    clip-path: inset(0 0 100% 0);
    visibility: hidden;
    transition: clip-path .7s cubic-bezier(.77, 0, .18, 1), visibility 0s .7s;
  }
  .menu-open .site-nav {
    clip-path: inset(0 0 0 0);
    visibility: visible;
    transition: clip-path .7s cubic-bezier(.77, 0, .18, 1);
  }
  /* Los enlaces suben uno detrás de otro */
  .site-nav a {
    opacity: 0;
    transform: translateY(40%);
    transition: opacity .5s ease, transform .7s cubic-bezier(.16, 1, .3, 1), background-size .25s ease;
  }
  .menu-open .site-nav a {
    opacity: 1;
    transform: none;
    transition-delay: calc(.25s + var(--i, 0) * 70ms);
  }
  /* En el menú, Work sin pastilla: igual que el resto */
  .site-nav a[href="work.html"] {
    margin-block: 0; padding: 0; border: 0; border-radius: 0;
    background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
    color: inherit; box-shadow: none; animation: none;
  }
  .site-nav a[href="work.html"][aria-current="page"] { background-size: 100% 1px; }
}
@media (max-width: 820px) and (prefers-reduced-motion: reduce) {
  .menu-toggle span, .site-nav, .site-nav a { transition: none; }
}
