/* ───────────────────────── Tokens ───────────────────────── */
:root {
  --bg: #000;
  --fg: #f2f0eb;
  --muted: rgba(242, 240, 235, 0.55);
  --faint: rgba(242, 240, 235, 0.18);
  --line: rgba(242, 240, 235, 0.14);
  --accent: #ff3b1f; /* rojo "REC" */
  --sans: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --serif: "Instrument Serif", Georgia, serif;
  --gutter: clamp(16px, 2.4vw, 36px);
  --logo-w: max(150px, calc(100vw * 238 / 1024));          /* ancho del logo de la cabecera */
  --hud-h: calc(var(--gutter) * 1.6 + var(--logo-w) * 0.0706); /* alto real de la cabecera */
  --ease: cubic-bezier(0.7, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, video, iframe { display: block; max-width: 100%; }
::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; }
main:focus { outline: none; }

/* ───────────────────────── Fondo (stage) ───────────────────────── */
.stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #000; }
.stage__thumbs img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
/* Logo de partículas */
.stage__logo { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .8s var(--ease-out); }
.stage__fallback {
  display: none; position: absolute; left: 50%; top: 46%; width: min(56vh, 70vw); transform: translate(-50%, -50%);
  opacity: calc(0.9 - var(--intro-progress, 0) * 0.6); filter: grayscale(1);
}
body.no-webgl .stage__fallback { display: block; }
body:not([data-view="index"]) .stage__logo,
body:not([data-view="index"]) .stage__trackers,
body:not([data-view="index"]) .stage__fallback { opacity: 0; }
/* Con la portada de un proyecto en hover, el logo desaparece del todo */
body.is-previewing .stage__logo,
body.is-previewing .stage__trackers { opacity: 0; transition-duration: .35s; }

/* Marcadores tipo tracking sobre el logo */
.stage__trackers { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity .6s; }
.stage__thumbs img {
  opacity: 0; transform: scale(1.06);
  transition: opacity 0.5s var(--ease-out), transform 1.6s var(--ease-out);
}
.stage__thumbs img.is-on { opacity: 0.85; transform: scale(1); }
.stage__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,.75) 0%, rgba(0,0,0,.2) 55%, rgba(0,0,0,.1) 100%),
    linear-gradient(0deg, rgba(0,0,0,.6) 0%, transparent 30%);
}
body[data-view="index"] .stage__shade { background: linear-gradient(0deg, rgba(0,0,0,calc(.5 * var(--intro-progress, 0))), rgba(0,0,0,calc(.3 * var(--intro-progress, 0)))); }
body[data-view="project"] .stage__shade { background: rgba(0,0,0,.55); }

/* Grano de película */
.grain {
  position: fixed; inset: -50%; z-index: 50; pointer-events: none; opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.6s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); } 60% { transform: translate(-4%, -1%); }
  80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* Transición tipo corte de cine: barras que se cierran y se abren */
.cut { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.cut__bar { position: absolute; left: 0; right: 0; height: 50.5vh; background: #000; transform: scaleY(0); }
.cut__bar--top { top: 0; transform-origin: top; }
.cut__bar--bottom { bottom: 0; transform-origin: bottom; }
body.is-cutting .cut__bar { transform: scaleY(1); transition: transform 0.38s var(--ease); }
body.is-revealing .cut__bar { transform: scaleY(0); transition: transform 0.6s var(--ease); }

/* ───────────────────────── HUD (cabecera) ───────────────────────── */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  pointer-events: none; /* la franja de la cabecera no bloquea clics; solo sus enlaces */
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: calc(var(--gutter) * 0.8) var(--gutter);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  mix-blend-mode: difference;
}
/* Logo: misma imagen y tamaño que en la web original (238px a 1024px de ancho) */
.hud__logo { justify-self: center; display: block; width: var(--logo-w); }
.hud > * { pointer-events: auto; }
.hud__logo img { width: 100%; height: auto; }
.hud__nav { justify-self: start; display: flex; gap: 24px; padding-left: 11px; }
.hud__nav a { position: relative; color: var(--muted); transition: color .2s; }
.hud__nav a:hover, .hud__nav a[aria-current="page"] { color: var(--fg); }
.hud__nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: -11px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px;
  border-radius: 50%; background: var(--fg);
}
.hud__right { justify-self: end; display: flex; align-items: center; gap: 22px; }
.hud__tc { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.hud__rec { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hud__sound { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.hud__sound:hover, .hud__sound[aria-pressed="true"] { color: var(--fg); }
.hud__eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.hud__eq i { width: 2px; height: 2px; background: currentColor; }
.hud__sound[aria-pressed="true"] .hud__eq i { animation: eq 0.9s ease-in-out infinite; }
.hud__sound[aria-pressed="true"] .hud__eq i:nth-child(2) { animation-delay: -0.3s; }
.hud__sound[aria-pressed="true"] .hud__eq i:nth-child(3) { animation-delay: -0.6s; }
.hud__sound[aria-pressed="true"] .hud__eq i:nth-child(4) { animation-delay: -0.15s; }
/* activado pero esperando al primer clic del visitante: barritas quietas */
.hud__sound.is-waiting .hud__eq i { animation: none; height: 5px; }
@keyframes eq { 0%, 100% { height: 2px; } 50% { height: 10px; } }

/* ───────────────────────── Layout común ───────────────────────── */
#app { position: relative; z-index: 10; min-height: 100vh; min-height: 100svh; }
.page { padding: clamp(96px, 14vh, 140px) var(--gutter) var(--gutter); }
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* ───────────────────────── INTRO ───────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.intro { position: relative; height: 100vh; height: 100svh; }
.intro__scroll {
  position: absolute; left: 0; right: 0; margin: 0 auto; width: max-content; bottom: clamp(28px, 7vh, 64px);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  opacity: 0; animation: fadeUp 1s var(--ease-out) 3s forwards; transition: color .2s;
}
.intro__scroll:hover { color: var(--fg); }
.intro__scroll i { position: relative; width: 1px; height: 44px; background: var(--faint); overflow: hidden; }
.intro__scroll i::after {
  content: ""; position: absolute; left: 0; top: 0; width: 1px; height: 45%; background: var(--fg);
  animation: scrollLine 1.8s var(--ease) infinite;
}
@keyframes scrollLine { 0% { transform: translateY(-100%); } 100% { transform: translateY(230%); } }
.intro { opacity: calc(1 - var(--intro-progress, 0) * 3); }

/* Al entrar por la home: la cabecera aparece con un fundido justo antes del "Scroll to continue" (3s) */
/* por orden: primero el logo, después Work · About y el timecode */
body.hud-intro .hud__logo { opacity: 0; animation: hudIn 1.5s ease-in-out 2.1s forwards; }
body.hud-intro .hud__nav,
body.hud-intro .hud__right { opacity: 0; animation: hudIn 1.5s ease-in-out 2.3s forwards; }
@keyframes hudIn { to { opacity: 1; } }

/* Aparición al hacer scroll: suben desde abajo con fundido y curva suave */
.index .reveal { opacity: 0; transform: translateY(70px); transition: opacity 1s var(--ease-out), transform 1.3s var(--ease-out); }
.index .reveal.is-in { opacity: 1; transform: none; }

/* ───────────────────────── INDEX ───────────────────────── */
.index { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
.index__head { display: flex; justify-content: flex-end; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(20px, 4vh, 40px); }
.index__intro { max-width: 34ch; font-family: var(--serif); font-size: clamp(22px, 2.3vw, 32px); line-height: 1.1; }
.index__intro em { color: var(--muted); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button {
  position: relative;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
  transition: color .2s, border-color .2s, background .2s;
}
/* área de clic más grande que el botón visible */
.filters button::before { content: ""; position: absolute; inset: -8px -4px; }
.filters button:hover { color: var(--fg); border-color: var(--faint); }
.filters button[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.filters sup { font-size: 9px; margin-left: 3px; opacity: .7; }

.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row { border-bottom: 1px solid var(--line); transition: opacity .35s var(--ease-out); }
.row.is-hidden { display: none; }
.row a {
  display: grid; grid-template-columns: 3.2em 1fr auto; align-items: baseline; gap: 16px;
  padding: clamp(10px, 1.6vh, 18px) 0;
}
.row__n { font-family: var(--mono); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row__title {
  font-size: clamp(26px, 4.6vw, 68px); font-weight: 600; letter-spacing: -0.035em; line-height: 0.95;
  display: inline-block; transition: transform .5s var(--ease-out);
}
.row__main { display: inline-flex; align-items: baseline; flex-wrap: wrap; column-gap: clamp(14px, 1.6vw, 28px); transition: transform .5s var(--ease-out); }
.row__by { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(15px, 1.5vw, 22px); letter-spacing: 0; color: var(--muted); }
.row__meta { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); text-align: right; white-space: nowrap; }
.row a { transition: opacity .35s var(--ease-out); }
.list.is-hovering .row a { opacity: 0.22; }
.list.is-hovering .row.is-active a { opacity: 1; }
/* En hover se desplaza el bloque entero (título + director), así nunca se pisan */
.row.is-active .row__main { transform: translateX(clamp(8px, 1vw, 16px)); }

/* Pantalla de proyectos: los 10 caben en una pantalla (en escritorio) */
body.intro-done .intro { display: none; }
@media (min-width: 641px) {
  .index { height: 100vh; height: 100svh; min-height: 520px; padding-top: calc(var(--hud-h) + 6px); padding-bottom: 18px; }
  .index__head { margin-bottom: 12px; }
  .list { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  /* cada fila mide siempre 1/10 de la lista: al filtrar, las que quedan no se estiran */
  .row { flex: 0 0 10%; min-height: 0; display: flex; }
  .row a { flex: 1; align-items: center; padding: 0; }
  .row__main { align-items: baseline; }
  /* el título se ajusta al alto de cada fila: (pantalla − cabecera − pie) / 10 */
  .row__title { font-size: clamp(18px, min(4.2vw, calc((100svh - var(--hud-h) - 100px) / 10 * 0.62)), 60px); }
  .row__by { font-size: clamp(13px, min(1.4vw, calc((100svh - var(--hud-h) - 100px) / 10 * 0.26)), 20px); }
  .index .index__foot { padding-top: 14px; margin-top: 0; }
}

.index__foot {
  margin-top: auto; padding-top: clamp(40px, 8vh, 90px);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap;
}
.links { display: flex; gap: 18px; flex-wrap: wrap; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.links a { color: var(--muted); transition: color .2s; }
.links a:hover { color: var(--fg); }
.links a::after { content: " ↗"; }

/* ───────────────────────── PROYECTO ───────────────────────── */
.project__top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: clamp(24px, 4vh, 48px); }
.back { display: inline-flex; gap: 10px; align-items: center; }
.back:hover { color: var(--fg); }
.project__title { margin: 0 0 18px; font-size: clamp(40px, 8.5vw, 140px); font-weight: 600; letter-spacing: -0.045em; line-height: 0.88; }
.project__title .word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.06em; }
.project__title .word > span { display: inline-block; transform: translateY(105%); animation: rise 0.9s var(--ease-out) forwards; }
@keyframes rise { to { transform: translateY(0); } }
.project__meta { display: flex; flex-wrap: wrap; gap: 8px 40px; margin-bottom: clamp(24px, 5vh, 56px); }
.project__meta div { display: grid; gap: 2px; }
.project__meta dt { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.project__meta dd { margin: 0; font-size: 15px; }

.player {
  position: relative; aspect-ratio: 16 / 9; width: 100%; background: #0a0a0a; overflow: hidden;
  margin-bottom: clamp(40px, 8vh, 96px);
}
.player img, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.player img { transition: transform 1.2s var(--ease-out), opacity .4s; }
.player button { position: absolute; inset: 0; display: grid; place-items: center; }
.player__play {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 14px 22px; border: 1px solid rgba(255,255,255,.5); border-radius: 999px;
  background: rgba(0,0,0,.35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background .3s, color .3s;
}
.player button:hover img { transform: scale(1.03); }
.player button:hover .player__play { background: var(--fg); color: var(--bg); }
.player__play::before { content: ""; border-left: 9px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
/* esquinas de visor de cámara */
.player::before, .player::after {
  content: ""; position: absolute; z-index: 2; width: 22px; height: 22px; pointer-events: none;
  border: 1px solid rgba(255,255,255,.6); transition: opacity .3s;
}
.player::before { top: 14px; left: 14px; border-right: 0; border-bottom: 0; }
.player::after { bottom: 14px; right: 14px; border-left: 0; border-top: 0; }
.player.is-playing::before, .player.is-playing::after { opacity: 0; }

.project__body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: clamp(24px, 5vw, 80px); }
.project__intro { font-family: var(--serif); font-size: clamp(22px, 2vw, 30px); line-height: 1.12; margin: 0 0 16px; }
.project__intro + .eyebrow { margin-top: 0; }
.credits { columns: 2 240px; column-gap: 40px; margin: 0; }
.credits div { break-inside: avoid; padding: 7px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 12px; }
.credits dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.credits dd { margin: 0; font-size: 14px; }
.credits dd a { border-bottom: 1px solid var(--faint); transition: border-color .2s; }
.credits dd a:hover { border-color: var(--fg); }
.credits .is-me dd { color: var(--fg); }
.credits .is-me dt { color: var(--accent); }
/* Hover: barrido blanco de izquierda a derecha que invierte los colores (blend "difference");
   al salir, el barrido sigue hacia la derecha y desaparece */
.credits div { position: relative; isolation: isolate; padding-left: 8px; padding-right: 8px; margin: 0 -8px; }
.about__contact a { position: relative; isolation: isolate; }
.credits div::after, .about__contact a::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: #fff; mix-blend-mode: difference;
  transform: scaleX(0); transform-origin: right center;
  transition: transform .6s cubic-bezier(.65, 0, .35, 1);
}
.credits div:hover::after, .about__contact a:hover::after { transform: scaleX(1); transform-origin: left center; }
.external { display: inline-block; margin-top: 16px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--faint); }

.pager { display: grid; grid-template-columns: 1fr 1fr; margin-top: clamp(60px, 12vh, 140px); border-top: 1px solid var(--line); }
.pager a { position: relative; display: grid; gap: 6px; padding: 24px 0; overflow: hidden; }
.pager a + a { text-align: right; border-left: 1px solid var(--line); padding-left: 20px; }
.pager strong { font-size: clamp(22px, 3vw, 44px); font-weight: 600; letter-spacing: -0.03em; line-height: 1; transition: transform .5s var(--ease-out); }
.pager a:first-child:hover strong { transform: translateX(-0.15em); }
.pager a + a:hover strong { transform: translateX(0.15em); }
.kbd { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 18px; text-align: center; letter-spacing: .06em; text-transform: uppercase; }
.kbd kbd { font: inherit; border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }

/* ───────────────────────── ABOUT / CONTACT ───────────────────────── */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(24px, 6vw, 100px); align-items: start; }
.about__photo { position: sticky; top: 110px; aspect-ratio: 4 / 5; overflow: hidden; background: #111; }
.about__photo img { width: 100%; height: 100%; object-fit: cover; } /* foto estática: sin efectos al pasar el cursor */
/* pie "Guille Fernández — Film Editor": esquina inferior izquierda, con el mismo margen que Work · About */
.about__caption { position: fixed; left: calc(var(--gutter) + 11px); bottom: calc(var(--gutter) * 0.8 + (var(--logo-w) * 0.0706 - 14px) / 2); margin: 0; z-index: 20; font-size: 11px; letter-spacing: .06em; }
/* Contacto sin scroll en escritorio: foto horizontal en su proporción original */
@media (min-width: 901px) {
  body[data-view="contact"] #app > .page { height: 100vh; height: 100svh; min-height: 560px; padding-top: calc(var(--hud-h) + 12px); padding-bottom: 24px; display: flex; align-items: center; }
  .about { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; width: 100%; }
  .about__photo { position: relative; top: 0; aspect-ratio: auto; overflow: visible; background: none; justify-self: center; width: 88%; }
  .about__photo img { display: block; width: auto; max-width: 100%; height: auto; max-height: calc(100svh - var(--hud-h) - 130px); }
}
.about__lead { text-wrap: balance; margin: 0 0 clamp(14px, 2.4vh, 24px); font-size: clamp(28px, min(3.6vw, 6.4vh), 56px); font-weight: 600; letter-spacing: -0.04em; line-height: 0.95; }
.about__lead em { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.about__text p { font-size: clamp(14px, min(1.1vw, 2vh), 17px); line-height: 1.45; max-width: 54ch; color: rgba(242,240,235,.85); margin: 0 0 1em; }
.about__text p.quote { font-family: var(--serif); font-size: clamp(19px, min(1.8vw, 3.2vh), 27px); line-height: 1.1; color: var(--fg); }
.about__contact { margin-top: clamp(18px, 3.5vh, 40px); display: grid; gap: 0; border-top: 1px solid var(--line); }
.about__contact a { display: flex; justify-content: space-between; align-items: baseline; padding: clamp(7px, 1.2vh, 12px) 8px; margin: 0 -8px; border-bottom: 1px solid var(--line); font-size: clamp(15px, min(1.3vw, 2.4vh), 20px); font-weight: 500; letter-spacing: -0.01em; }
.about__contact a span { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.counter { display: flex; gap: clamp(20px, 4vw, 56px); margin-top: clamp(16px, 3vh, 32px); }
.counter b { display: block; font-size: clamp(26px, min(3vw, 5vh), 44px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }

/* ───────────────────────── Entrada de contenido ───────────────────────── */
.fade-in { opacity: 0; transform: translateY(14px); animation: fadeUp 0.9s var(--ease-out) forwards; }
@keyframes fadeUp { to { opacity: 1; transform: none; } }

/* ───────────────────────── Cursor ───────────────────────── */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: none; }
  /* Cursor = el logo del favicon (55×39, centro en 28,20 como en la web original) */
  .cursor { display: block; position: fixed; inset: 0; z-index: 70; pointer-events: none; transition: opacity .3s; }
  .cursor__logo, .cursor__tag { position: absolute; top: 0; left: 0; will-change: transform; }
  .cursor__logo { width: 55px; height: 39px; margin: -20px 0 0 -28px; }
  .cursor__logo img { width: 100%; height: 100%; transition: transform .35s var(--ease-out), filter .25s; }
  /* En hover se invierten los colores del logo (negro ↔ blanco) */
  body.cursor-link .cursor__logo img { transform: scale(1.25) rotate(-8deg); filter: invert(1); }
  body.cursor-label .cursor__logo img { transform: scale(1.35) rotate(-8deg); filter: invert(1); }
  /* Etiqueta "Play" que sigue al logo con un pequeño retardo */
  .cursor__tag { margin: 26px 0 0 30px; }
  .cursor__label {
    display: inline-block; padding: 5px 10px; border-radius: 999px; background: #fff; color: #000;
    font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
    opacity: 0; transform: scale(.6); transform-origin: left top; transition: opacity .2s, transform .35s var(--ease-out);
  }
  body.cursor-label .cursor__label { opacity: 1; transform: none; }
  body.cursor-hidden .cursor { opacity: 0; }
}

/* ───────────────────────── Responsive ───────────────────────── */
@media (max-width: 900px) {
  .project__body, .about { grid-template-columns: 1fr; }
  .about__photo { position: relative; top: 0; max-width: 420px; aspect-ratio: auto; }
  .about__photo img { height: auto; }
  .about__caption { position: static; margin: 0 0 16px; }
}
@media (max-width: 640px) {
  .hud { grid-template-columns: 1fr 1fr; row-gap: 10px; }
  .hud__logo { grid-column: 1 / -1; grid-row: 1; }
  .hud__nav { grid-column: 1; grid-row: 2; }
  .hud__right { grid-column: 2; grid-row: 2; }
  /* cabecera en una línea bajo el logo; el botón de sonido queda solo con las barritas */
  .hud__sound-label { display: none; }
  .hud__right { gap: 14px; }
  /* filtros en una sola línea */
  .filters { gap: 5px; flex-wrap: nowrap; }
  .filters button { padding: 6px 9px; font-size: 10px; letter-spacing: .04em; }
  .filters sup { margin-left: 2px; }
  /* filas compactas: título y director; el tipo ya lo indican los filtros */
  .row a { grid-template-columns: 2em 1fr; gap: 8px; padding: 11px 0; }
  .row__title { font-size: clamp(22px, 7vw, 30px); }
  .row__meta { display: none; }
  .row__main { flex-direction: column; align-items: flex-start; }
  .row__by { display: block; margin: 3px 0 0; font-size: 14px; }
  /* contadores de About sin cortes raros */
  .counter { gap: 18px; }
  .counter .eyebrow { font-size: 9.5px; white-space: nowrap; }
  .stage__shade { background: linear-gradient(0deg, rgba(0,0,0,.85), rgba(0,0,0,.45)); }
  .pager a + a { padding-left: 12px; }
  .credits div { grid-template-columns: 1fr; gap: 0; }
  .kbd { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .grain { display: none; }
}

/* Velo negro bajo la cabecera: el contenido que pasa por debajo al hacer scroll no se mezcla con ella */
body::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; z-index: 39; pointer-events: none;
  height: calc(var(--hud-h) + 28px);
  background: linear-gradient(180deg, #000 0%, rgba(0,0,0,.85) 55%, rgba(0,0,0,0) 100%);
}
@media (max-width: 640px) {
  body::before { height: 104px; }           /* en móvil la cabecera ocupa dos líneas */
  .hud__sound { padding: 6px 4px; }         /* área táctil más cómoda para el botón de sonido */
}
