/* ==========================================================================
   Gurutze Ampudia — La Edición Invisible
   Sistema visual inspirado en el formato "Editions": portada enmarcada,
   índice lateral fijo, capítulos con ilustración a sangre y papel rasgado.
   ========================================================================== */

:root {
  --black: #000;
  --ink: #292919;          /* texto sobre papel */
  --paper: #dedccb;        /* papel */
  --paper-hi: #f7f7ee;     /* papel claro / pills */
  --paper-line: #cfcdb9;
  --muted: #909083;        /* gris índice */
  --light: #f7f7ee;        /* texto sobre imagen */
  --accent: #f0562a;       /* naranja Gurutze */
  --line: rgba(247, 247, 238, 0.32);

  --f-sans: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --f-script: "Imperial Script", "Snell Roundhand", cursive;

  --side: clamp(200px, 18.5vw, 300px);
  --gutter: clamp(16px, 1.4vw, 24px);
  --header-h: 52px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--black);
  color: var(--light);
  font-family: var(--f-sans);
  font-size: 15px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }

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

:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

.skip {
  position: fixed; top: 8px; left: 8px; z-index: 100; padding: 8px 12px; border-radius: 999px;
  background: var(--paper-hi); color: var(--ink); font-weight: 700; transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- WebGL stage ---------- */
.stage {
  position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.stage canvas { width: 100%; height: 100%; }

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  display: grid; grid-template-columns: minmax(var(--side), max-content) 1fr auto; align-items: center;
  padding: 0 var(--gutter); gap: 24px;
  font-size: 14px; font-weight: 500; letter-spacing: -0.01em;
  color: var(--light);
  transition: color 0.35s var(--ease-out);
}
.header::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; pointer-events: none;
  background: rgba(222, 220, 203, 0.82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.35s var(--ease-out);
}
.header[data-tone="dark"] { color: var(--ink); }
.header[data-tone="dark"]::before { opacity: 1; }
.header[data-surface="white"]::before { background: rgba(255, 255, 255, 0.85); }
.menu-open .header { color: var(--light); }
.menu-open .header::before { opacity: 0; }
.menu-open .header .header__logo { filter: invert(1); }
.menu-open .header .pill { background: var(--paper-hi); color: #000; }
/* El logo se apoya en la misma línea base que «Gurutze Ampudia» */
.header__brand { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
/* GA recortado (sin el margen transparente del original) */
/* Margen negativo arriba: el logo sobresale sin empujar el texto, que sigue alineado con el resto de la cabecera */
.header__logo { width: auto; height: 19px; margin-top: -8px; filter: invert(1); transition: filter 0.35s; }
.header[data-tone="dark"] .header__logo { filter: none; }
.header__brand b { font-weight: 600; }
.header__brand span { color: var(--muted); }
.header__nav { display: flex; align-items: center; gap: 28px; }
.header__right { display: flex; align-items: center; gap: 20px; }
.header a:hover, .header button:hover { opacity: 0.7; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px;
  background: var(--paper-hi); color: #000;
  transition: background 0.3s, color 0.3s, transform 0.3s var(--ease-out);
}
.pill:hover { transform: translateY(-1px); opacity: 1 !important; }
.header[data-tone="dark"] .pill { background: #000; color: var(--paper-hi); }

/* Dropdown de capítulos */
.dropdown { position: relative; }
.dropdown__btn { display: inline-flex; align-items: center; gap: 6px; }
.dropdown__btn svg { width: 10px; transition: transform 0.3s var(--ease-out); }
.dropdown[data-open="true"] .dropdown__btn svg { transform: rotate(180deg); }
.dropdown__panel {
  position: absolute; top: calc(100% + 14px); left: -16px; min-width: 260px;
  padding: 10px; border-radius: 8px; background: rgba(12, 12, 10, 0.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(247, 247, 238, 0.12);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), visibility 0.3s;
  color: var(--light);
}
.dropdown[data-open="true"] .dropdown__panel { opacity: 1; visibility: visible; transform: none; }
.dropdown__panel a {
  display: flex; justify-content: space-between; gap: 24px; padding: 7px 8px; border-radius: 4px;
  font-weight: 700; font-size: 16px; letter-spacing: -0.02em;
}
.dropdown__panel a:hover { background: rgba(247, 247, 238, 0.08); opacity: 1; }
.dropdown__panel i { font-family: var(--f-serif); font-style: normal; font-weight: 400; color: var(--muted); font-size: 12px; }

.menu-btn { display: none; width: 28px; height: 28px; position: relative; }
.menu-btn span { position: absolute; left: 4px; right: 4px; height: 2px; background: currentColor; transition: transform 0.35s var(--ease-out), top 0.35s var(--ease-out); }
.menu-btn span:nth-child(1) { top: 10px; }
.menu-btn span:nth-child(2) { top: 16px; }
.menu-open .menu-btn span:nth-child(1) { top: 13px; transform: rotate(45deg); }
.menu-open .menu-btn span:nth-child(2) { top: 13px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 45; background: #000; color: var(--light);
  padding: calc(var(--header-h) + 32px) 16px 32px; display: flex; flex-direction: column; justify-content: space-between;
  opacity: 0; visibility: hidden; transition: opacity 0.4s var(--ease-out), visibility 0.4s;
}
.menu-open .mobile-menu { opacity: 1; visibility: visible; }
.mobile-menu ol a {
  display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0;
  font-weight: 700; font-size: 34px; letter-spacing: -0.035em; line-height: 1;
  border-bottom: 1px solid rgba(247, 247, 238, 0.1);
}
.mobile-menu ol i { font-family: var(--f-serif); font-style: normal; font-weight: 400; font-size: 14px; color: var(--muted); }
.mobile-menu__foot { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }

/* ---------- Cover ---------- */
.cover {
  /* 30vh extra al final: el retrato pasa a negro antes de que asome el Hola */
  position: relative; height: calc(100vh + 30vh); height: calc(100svh + 30vh); min-height: 560px;
  padding-bottom: 30vh;
  display: grid; place-items: center;
}
.cover__lines {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none;
  overflow: visible;
}
.cover__lines * { fill: none; stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.cover__frame, .endmenu__frame {
  position: relative; width: clamp(300px, 24vw, 420px); height: min(64vh, 640px); min-height: 460px;
}
.cover__border {
  position: absolute; inset: 0; pointer-events: none;
}
.cover__border i { position: absolute; background: rgba(247, 247, 238, 0.85); }
.cover__border i:nth-child(1) { top: 0; left: 0; right: 0; height: 1px; transform-origin: left; }
.cover__border i:nth-child(2) { top: 0; right: 0; bottom: 0; width: 1px; transform-origin: top; }
.cover__border i:nth-child(3) { bottom: 0; left: 0; right: 0; height: 1px; transform-origin: right; }
.cover__border i:nth-child(4) { top: 0; left: 0; bottom: 0; width: 1px; transform-origin: bottom; }

/* ---------- Índice (portada + barra lateral) ---------- */
.toc { color: var(--light); }
.toc__title, .endmenu__title {
  display: block; font-weight: 800; font-size: clamp(28px, 2.25vw, 38px);
  line-height: 0.93; letter-spacing: -0.035em; width: max-content;
}
.toc__title .t-line, .endmenu__title .t-line { display: block; }
.toc__title em, .endmenu__title em, .italic-insert {
  font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -0.03em;
  padding: 0 0.02em;
}
.toc__sub, .endmenu__sub {
  margin-top: 18px; max-width: 290px; font-family: var(--f-serif); font-size: 17px; line-height: 1.02;
  letter-spacing: -0.02em; text-wrap: balance;
}
.toc__sub-in { display: inline-block; }
.toc__list, .endmenu__list { margin-top: 14px; width: 100%; }
.toc__list a, .endmenu__list a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font-weight: 700; font-size: 18px; line-height: 1; letter-spacing: -0.025em; padding: 1px 0;
  transition: color 0.3s var(--ease-out);
}
.toc__list i, .endmenu__list i {
  font-family: var(--f-serif); font-style: normal; font-weight: 400; font-size: 11px; letter-spacing: 0;
  opacity: 0.7; position: relative;
}
.toc__legal { display: none; font-size: 11px; font-weight: 700; line-height: 1.1; }
.toc__legal span { display: block; font-family: var(--f-serif); font-weight: 400; }

/* Mobile/tablet: el índice vive dentro del marco, con el título arriba y la lista abajo (como el menú final) */
.cover__frame .toc { position: absolute; inset: 0; padding: 22px; display: flex; flex-direction: column; justify-content: flex-start; }
@media (max-width: 1023px) {
  .cover__frame .toc__list { margin-top: auto; }
}

@media (min-width: 1024px) {
  .cover__frame .toc { position: static; padding: 0; display: block; }
  .toc__title, .toc__sub, .toc__list, .toc__legal {
    position: fixed; z-index: 40; left: var(--gutter);
  }
  .toc__title { top: calc(var(--header-h) + 12px); }
  .toc__sub { top: calc(var(--header-h) + 112px); margin: 0; }
  .toc__list { bottom: 64px; width: calc(var(--side) - var(--gutter) * 2); margin: 0; }
  .toc__legal { display: block; bottom: 14px; }
  .toc [data-tone="dark"] { color: var(--ink); }
  .toc__title, .toc__list, .toc__legal { transition: color 0.35s var(--ease-out); }
  .is-docked .toc__list a { color: var(--muted); }
  .is-docked .toc__list[data-tone="light"] a { color: rgba(247, 247, 238, 0.55); }
  .is-docked .toc__list a.is-active,
  .is-docked .toc__list a:hover { color: var(--ink); }
  .is-docked .toc__list[data-tone="light"] a.is-active,
  .is-docked .toc__list[data-tone="light"] a:hover { color: var(--light); }
  .toc__list a.is-active i::before {
    content: ""; position: absolute; right: calc(100% + 6px); top: 50%; width: 46px; height: 1px;
    background: currentColor; opacity: 0.5;
  }
}

/* ---------- Capítulos ---------- */
main { position: relative; z-index: 2; overflow-x: clip; }
.cover { overflow-x: clip; }
.cover__lines { overflow: hidden !important; }

.chapter { position: relative; }
.chapter__stage {
  position: sticky; top: 0; height: 100vh; margin-bottom: -100vh; overflow: hidden; z-index: 0;
}
.chapter__stage img, .chapter__stage video { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.62); }
.gl .chapter__stage { display: none; }

.chapter__hero {
  position: relative; z-index: 1;
  padding: 26vh var(--gutter) 22vh calc(var(--side) + var(--gutter));
  min-height: 150vh;
  display: flex; flex-direction: column; justify-content: flex-start;
}
.chapter__title, .chapter__lead, .hero-card { position: relative; z-index: 1; }
/* Capítulo sin papel: solo título, texto y el cuadro de fondo */
.chapter--solo .chapter__hero { min-height: 210vh; }
.chapter__title {
  font-weight: 800; font-size: clamp(64px, 10.4vw, 188px); line-height: 0.9; letter-spacing: -0.045em;
  color: var(--light); margin-bottom: clamp(48px, 9vh, 120px); margin-left: -0.04em;
  text-wrap: balance;
}
.chapter__title .char { display: inline-block; will-change: transform; }
/* Máscara de la animación de letras, con holgura para que no se corten
   la última letra (p. ej. la "s") ni los acentos */
.chapter__title .word {
  display: inline-block; overflow: hidden; vertical-align: top;
  padding: 0.16em 0.1em 0.1em; margin: -0.16em -0.1em -0.1em;
}

.chapter__lead {
  max-width: 21em; font-family: var(--f-serif); font-weight: 400;
  font-size: clamp(27px, 2.75vw, 48px); line-height: 0.98; letter-spacing: -0.035em;
  color: var(--light); text-wrap: pretty;
}
.chapter__lead.dropcap::first-letter { color: var(--light); }

/* Párrafos de apoyo bajo la entradilla (textos largos) */
.chapter__text {
  position: relative; z-index: 1;
  max-width: 31em; margin-top: 1.15em;
  font-family: var(--f-serif); font-weight: 400;
  font-size: clamp(19px, 1.75vw, 29px); line-height: 1.12; letter-spacing: -0.025em;
  color: rgba(247, 247, 238, 0.86); text-wrap: pretty;
}
.chapter__lead + .chapter__text { margin-top: 1.6em; }

.dropcap::first-letter {
  font-family: var(--f-script); font-weight: 400; font-size: 2.35em; line-height: 0;
  margin-right: 0.04em; letter-spacing: 0;
}

.hero-card { margin-top: 48px; width: min(360px, 70%); }

/* Tarjetas flotantes (parallax) */
.floaters { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.floater {
  position: absolute; left: var(--x); top: var(--y); width: var(--w, 200px);
  border-radius: 6px; overflow: hidden; background: #111;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(247, 247, 238, 0.12);
  transform: rotate(var(--r, 0deg));
}
.floater img, .floater video { width: 100%; height: auto; aspect-ratio: var(--ar, 4/3); object-fit: cover; }

/* ---------- Papel ---------- */
.paper {
  position: relative; z-index: 2; color: var(--ink); background: var(--paper);
  padding: 40px var(--gutter) 120px calc(var(--side) + var(--gutter));
}
.paper::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.55; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .55  0 0 0 0 .53  0 0 0 0 .45  0 0 0 .35 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.paper > * { position: relative; }

/* Variante oscura de la superficie */
.paper--dark { --paper-dark: #000; background: var(--paper-dark); color: var(--light); }
.paper--dark::before { display: none; }
.paper--dark .meta { color: #8f8f80; }
.paper--dark .btn { background: transparent; color: var(--light); border-color: rgba(247, 247, 238, 0.22); }
.paper--dark .btn svg { background: rgba(247, 247, 238, 0.1); }
.paper--dark .btn:hover { background: var(--light); color: var(--ink); }
.paper--dark .media { box-shadow: 0 0 0 1px rgba(247, 247, 238, 0.06), 0 24px 50px -30px rgba(0, 0, 0, 0.8); }
.paper--dark .specs { border-top-color: rgba(247, 247, 238, 0.14); }
.paper--dark .specs dd { color: #a3a394; }
.paper--dark .specs a { color: var(--light); }
/* Variante blanca (sin grano, blanco puro) */
.paper--white { background: #fff; }
.paper--white::before { display: none; }
/* Corte recto entre la ilustración y la superficie, con una sombra suave */
.paper { box-shadow: 0 -24px 48px -24px rgba(0, 0, 0, 0.55); }
/* Entre dos franjas seguidas, corte limpio sin sombra */
.paper + .paper { box-shadow: none; }

.paper__inner { max-width: 1180px; }

.narrative {
  font-family: var(--f-serif); font-weight: 400; font-size: clamp(32px, 3.05vw, 52px);
  line-height: 0.96; letter-spacing: -0.04em; text-wrap: balance;
  padding: clamp(56px, 9vh, 110px) 0 clamp(40px, 6vh, 72px);
  max-width: 18em;
}
@media (min-width: 1024px) {
  .narrative { margin-left: 0; }
}

.label {
  font-weight: 700; font-size: 18px; line-height: 0.95; letter-spacing: -0.02em; margin-bottom: 14px;
}
.body-serif {
  font-family: var(--f-serif); font-size: clamp(20px, 1.75vw, 27px); line-height: 1; letter-spacing: -0.035em;
  max-width: 17em; text-wrap: pretty;
}
.meta { margin-top: 14px; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px;
  padding: 3px 3px 3px 7px; border-radius: 3px; border: 1px solid var(--paper-line);
  background: var(--paper-hi); color: var(--ink); font-size: 11px; font-weight: 700; line-height: 1.1;
  transition: background 0.25s, color 0.25s;
}
.btn svg { width: 16px; height: 16px; padding: 3px; border-radius: 2px; background: rgba(41, 41, 25, 0.08); transition: transform 0.3s var(--ease-out); }
.btn:hover { background: var(--ink); color: var(--paper-hi); }
.btn:hover svg { transform: translate(1px, -1px); background: rgba(247, 247, 238, 0.15); }

/* Artículos */
.art { display: grid; gap: 28px; padding-bottom: clamp(56px, 10vh, 120px); }
.art--split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: end; }
.art--split.is-flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.art--split.is-flip .art__text { order: 2; }
.art--stack .art__media { margin-top: 12px; }
.art--duo { grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.art--duo .card .label { font-size: 15px; margin: 14px 0 6px; }
.art--duo .card p { font-size: 14px; line-height: 1.3; color: #5b5b4b; max-width: 30em; }

/* Media */
.media {
  position: relative; overflow: hidden; border-radius: 6px; background: #1a1a14;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 24px 50px -30px rgba(41, 41, 25, 0.55);
}
.media img, .media video { width: 100%; height: 100%; object-fit: cover; }
.media[style*="--ar"] { aspect-ratio: var(--ar); }
.media--zoom img { transition: transform 1.2s var(--ease-out); }
.media--zoom:hover img { transform: scale(1.04); }

.play {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(247, 247, 238, 0.92); color: #000;
  transition: transform 0.4s var(--ease-out), background 0.3s;
}
.play svg { width: 20px; margin-left: 3px; }
.media:hover .play, .play:hover { transform: scale(1.08); }
.media__tag {
  position: absolute; left: 10px; bottom: 10px; padding: 4px 8px; border-radius: 3px;
  background: rgba(0, 0, 0, 0.55); color: var(--light); font-size: 11px; font-weight: 700;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

.phone {
  position: relative; width: min(280px, 80%); margin: 0 auto; aspect-ratio: 730 / 1080;
  border-radius: 34px; padding: 10px; background: #0d0d0b;
  box-shadow: 0 0 0 1px #3a3a30 inset, 0 40px 70px -30px rgba(41, 41, 25, 0.7);
}
.phone .media { height: 100%; border-radius: 26px; box-shadow: none; }

/* Fichas (dl) */
.specs {
  display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(24px, 4vw, 64px); row-gap: 26px;
  padding: 40px 0 0; border-top: 1px solid rgba(41, 41, 25, 0.14);
}
.specs > div { display: grid; grid-template-columns: minmax(120px, 0.8fr) 1.2fr; gap: 16px; }
.specs dt { font-weight: 700; font-size: 14px; line-height: 1.15; letter-spacing: -0.01em; }
.specs dd { font-size: 14px; line-height: 1.3; color: #77776a; }
.specs a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* Ficha de cortometraje: póster, foto de rodaje y créditos */
.film { grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: clamp(20px, 3vw, 48px); align-items: end; }
.film__poster { aspect-ratio: 1350 / 2000; }
.film__still { aspect-ratio: 1834 / 1242; }
.film__specs { grid-template-columns: 1fr; row-gap: 12px; margin-top: 28px; padding-top: 24px; }
.film { position: relative; }
.film__cta { margin-top: 24px; }
/* Columnas alineadas arriba (en vez de abajo) */
.film--top { align-items: start; }
/* Foto vertical al lado del cartel: 62,23 % de la columna derecha = misma altura que el cartel (1371×1920) */
.film__still--match { width: 62.23%; }
@media (max-width: 767px) { .film__still--match { width: 100%; } }

/* Dos fotos a la misma altura, cada una con su proporción (--r) */
.film__pair { display: flex; gap: clamp(10px, 1.6vw, 20px); }
.film__pair .media { flex: var(--r) 1 0; min-width: 0; aspect-ratio: var(--r); margin: 0; }

/* Rodajes en formato currículum: año · función · proyecto */
.cv { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid rgba(41, 41, 25, 0.14); }
.cv__item {
  display: grid; grid-template-columns: minmax(64px, 0.5fr) minmax(0, 1.5fr) minmax(0, 2.4fr); gap: 4px clamp(16px, 3vw, 48px);
  align-items: baseline; padding: clamp(16px, 2.4vh, 24px) 0; border-top: 1px solid rgba(41, 41, 25, 0.14);
}
.cv__year { font-family: var(--f-serif); font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cv__role { font-weight: 700; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.15; letter-spacing: -0.02em; }
.cv__what { font-family: var(--f-serif); font-size: clamp(18px, 1.5vw, 22px); line-height: 1.2; letter-spacing: -0.02em; text-wrap: pretty; }
.cv__what em { font-style: italic; }
.paper--dark .cv, .paper--dark .cv__item { border-color: rgba(247, 247, 238, 0.16); }
.paper--dark .cv__year { color: #8f8f80; }
.paper--dark .cv__what { color: rgba(247, 247, 238, 0.82); }
@media (max-width: 767px) {
  .cv__item { grid-template-columns: auto 1fr; }
  .cv__what { grid-column: 1 / -1; }
}

/* Cuaderno de ayudante de dirección: hojas del plan (portada) + collages */
/* La columna izquierda mide lo mismo que el cuadrado de los collages (sin la barra de
   controles, --bar): el título arranca en su borde superior y las hojas llenan el resto,
   centradas, hasta su borde inferior */
.notebook {
  --bar: 48px; padding-top: clamp(56px, 9vh, 110px);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 4vw, 64px); align-items: stretch;
}
.notebook__head { display: flex; flex-direction: column; padding-bottom: var(--bar); min-height: 0; }
.notebook__head .narrative { padding: 0; }
.notebook__slides .slideshow__caption { min-height: 0; }
.notebook__slides .slideshow__bar { height: calc(var(--bar) - 14px); }
.notebook__sheets { position: relative; flex: 1 1 0; min-height: 0; margin-top: clamp(24px, 4vh, 44px); }
.notebook__sheet {
  position: absolute; top: 0; bottom: 0; left: 50%; translate: -50% 0; height: 100%; aspect-ratio: 922 / 1148;
  margin: 0; background: #fff; overflow: hidden;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: transform 0.6s var(--ease-out);
}
.notebook__sheet img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.notebook__sheet--back { transform: rotate(-6deg) translate(-7%, 3%); z-index: 0; }
.notebook__sheet--front { transform: rotate(2.5deg); z-index: 1; }
.notebook__sheets:hover .notebook__sheet--back { transform: rotate(-9deg) translate(-12%, 2%); }
.notebook__sheets:hover .notebook__sheet--front { transform: rotate(4deg) translate(5%, -2%); }
.slideshow[data-manual] .slideshow__frames { cursor: pointer; }
@media (max-width: 767px) {
  .notebook { grid-template-columns: 1fr; }
  .notebook__head { padding-bottom: 0; }
  .notebook__sheets { flex: none; width: 76%; aspect-ratio: 922 / 1148; margin: 8% auto 10%; }
}
/* Foto extra bajo la ficha, alineada con la columna derecha */
.film__more { width: 60%; margin: 0 0 0 auto; aspect-ratio: 1240 / 827; }
.film__main { position: relative; }
/* Dos carteles: --x (0–100) es la posición de la línea; a su izquierda, el segundo cartel */
.film__compare { --x: 0; touch-action: pan-y; }
.film__compare-top { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--x) * 1%) 0 0); pointer-events: none; }
.film__compare-line {
  position: absolute; top: 0; bottom: 0; left: calc(var(--x) * 1%); z-index: 2; width: 2px; margin-left: -1px;
  background: var(--light); box-shadow: 0 0 14px rgba(0, 0, 0, 0.45); pointer-events: none;
  opacity: 0; transition: opacity 0.35s var(--ease-out);
}
.film__compare-line::after {
  content: "‹ ›"; position: absolute; top: 50%; left: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px;
  display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--light);
  background: rgba(0, 0, 0, 0.35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  color: var(--light); font-size: 15px; font-weight: 700; letter-spacing: -1px; line-height: 1;
}
.film__compare.is-comparing .film__compare-line { opacity: 1; }
.film__note { position: absolute; left: 30%; top: calc(100% + 10px); width: 300px; height: 74px; }
.film__note .note__text { left: 58px; top: 34px; }
/* Mis funciones: la fila de créditos propia, destacada y unida a la nota */
.specs__me { will-change: transform; }
.specs__me dt, .specs__me dd { color: var(--ink); }
.film__links { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 1; }
/* Mismo trazo que la flecha de la nota al cartel */
.film__link { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 767px) {
  .film { grid-template-columns: 1fr; }
  .film__note { position: relative; left: 14%; top: auto; width: 76%; margin-top: 10px; }
  /* En móvil, los créditos suben junto a la nota (y mi fila primero) para que la línea no cruce las fotos */
  .film__side { display: contents; }
  .film__specs { order: 1; margin-top: 4px; }
  .film__still { order: 2; }
  .specs__me { order: -1; }
  .film__cta { order: 1; justify-self: start; }
  .film__more { width: 100%; }
  .film__pair { order: 2; }
}

/* Vídeos de la fiesta techno: casilla contenida para que se vean nítidos (960×540) */
.techno { max-width: 600px; }
/* El ritmo y la sombra: el pase a la izquierda y el texto a la derecha (debajo en pantallas estrechas) */
.techno-row { display: grid; grid-template-columns: minmax(0, 600px) minmax(0, 1fr); gap: clamp(28px, 4vw, 72px); align-items: start; }
/* La primera línea empieza a la altura del borde superior del vídeo: se recorta el aire sobre las mayúsculas */
.techno-text .body-serif:first-child { margin-top: -0.08em; }
@supports (text-box: trim-start cap alphabetic) { .techno-text .body-serif:first-child { margin-top: 0; text-box: trim-start cap alphabetic; } }
.techno-text .body-serif { max-width: 21em; line-height: 1.12; }
.techno-text .body-serif + .body-serif { margin-top: 0.9em; }
@media (max-width: 1023px) { .techno-row { grid-template-columns: minmax(0, 1fr); } }
.techno video { pointer-events: none; }

/* ---------- Escritorio interactivo (macOS) ----------
   Todo se mide en --u (1 % del ancho de la pantalla) para que escale como una captura. */
.mac { container: mac / inline-size; }
.mac + .footer { margin-top: clamp(64px, 10vh, 120px); }
.mac__screen {
  --u: 1cqw; --sys: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: calc(var(--u) * 1.2);
  background: #2b2b2b; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12), 0 30px 60px -30px rgba(0, 0, 0, 0.55);
  font-family: var(--sys); -webkit-font-smoothing: antialiased; user-select: none;
}
.mac__wall { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Barra de menús (de la captura), con el borde inferior fundido con el fondo */
.mac__menu {
  position: absolute; left: 0; top: 0; width: 100%; height: auto; pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent);
}
/* Dock (de la captura), en su sitio exacto */
.mac__dock {
  position: absolute; left: 2.75%; bottom: 0.56%; width: 94.5%; z-index: 50; overflow: hidden;
  border-radius: 1.376% / 26.5%; pointer-events: none;
}
.mac__dock img { display: block; width: 100%; height: auto; }
/* Icono de app dibujado encima de la captura del Dock */
.mac__dock-app { position: absolute; height: auto; }
/* Carpetas del escritorio */
.mac__icons { position: absolute; left: calc(var(--u) * 3); top: 9%; margin: 0; padding: 0; list-style: none; z-index: 1; }
.mac__icons li { margin-bottom: calc(var(--u) * 1.6); }
.mac__folder {
  display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 0.4);
  width: calc(var(--u) * 10); padding: calc(var(--u) * 0.4); border-radius: calc(var(--u) * 0.6); color: #fff; text-align: center;
}
.mac__folder-ico { width: calc(var(--u) * 5.6); height: auto; filter: drop-shadow(0 calc(var(--u) * 0.2) calc(var(--u) * 0.35) rgba(0, 0, 0, 0.35)); transition: transform 0.2s; }
.mac__folder:hover .mac__folder-ico { transform: translateY(calc(var(--u) * -0.2)); }
.mac__label {
  max-width: 100%; padding: calc(var(--u) * 0.1) calc(var(--u) * 0.45); border-radius: calc(var(--u) * 0.35);
  font-size: calc(var(--u) * 1.15); font-weight: 600; line-height: 1.2; text-shadow: 0 0 2px rgba(0, 0, 0, 0.9), 0 1px 3px rgba(0, 0, 0, 0.85), 0 0 8px rgba(0, 0, 0, 0.55);
}
.mac__folder.is-selected .mac__folder-ico { filter: brightness(0.82) drop-shadow(0 calc(var(--u) * 0.2) calc(var(--u) * 0.35) rgba(0, 0, 0, 0.35)); }
.mac__folder.is-selected .mac__label { background: #0a62d0; text-shadow: none; }
.mac__folder:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* Ventana del Finder */
.finder {
  position: absolute; left: 22%; top: 12%; width: 58%; height: 60%; z-index: 10;
  display: flex; flex-direction: column; overflow: hidden; color: #1d1d1f; background: #fff;
  border-radius: calc(var(--u) * 1.1);
  box-shadow: 0 calc(var(--u) * 2) calc(var(--u) * 5) rgba(0, 0, 0, 0.45), 0 0 0 0.5px rgba(0, 0, 0, 0.3);
  transform-origin: 50% 60%;
}
.finder[hidden] { display: none; }
.finder.is-opening { animation: finder-open 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.finder.is-closing { animation: finder-close 0.18s ease-in forwards; }
@keyframes finder-open { from { opacity: 0; transform: scale(0.86); } }
@keyframes finder-close { to { opacity: 0; transform: scale(0.9); } }
.finder__bar {
  position: relative; display: flex; align-items: center; height: calc(var(--u) * 3.4); padding: 0 calc(var(--u) * 1.2);
  background: #f3f3f3; border-bottom: 1px solid #dcdcdc; cursor: grab; touch-action: none;
}
.finder.is-dragging .finder__bar { cursor: grabbing; }
.finder__lights { position: relative; z-index: 1; display: flex; gap: calc(var(--u) * 0.65); }
.finder__lights > * { display: block; width: calc(var(--u) * 1.15); height: calc(var(--u) * 1.15); border-radius: 50%; }
.finder__close { position: relative; background: #ff5f57; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18); }
.finder__lights i:nth-child(2) { background: #febc2e; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18); }
.finder__lights i:nth-child(3) { background: #28c840; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18); }
.finder__close::after {
  content: "×"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: calc(var(--u) * 1.05); line-height: 1; font-weight: 700; color: rgba(77, 0, 0, 0.7); opacity: 0;
}
.finder__lights:hover .finder__close::after, .finder__close:focus-visible::after { opacity: 1; }
.finder__title {
  position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: center; gap: calc(var(--u) * 0.5);
  font-size: calc(var(--u) * 1.15); font-weight: 600; pointer-events: none; white-space: nowrap;
}
.finder__title svg { width: calc(var(--u) * 1.5); height: auto; }
.finder__main { flex: 1; display: flex; min-height: 0; }
.finder__side {
  width: 24%; padding: calc(var(--u) * 1) calc(var(--u) * 0.9); background: #f0f0f2; border-right: 1px solid #e3e3e3;
  font-size: calc(var(--u) * 1.02); color: #3a3a3c; display: flex; flex-direction: column; gap: calc(var(--u) * 0.15); overflow: hidden;
}
.finder__side p { margin: calc(var(--u) * 0.6) 0 calc(var(--u) * 0.2); font-size: calc(var(--u) * 0.85); font-weight: 600; color: #8e8e93; }
.finder__side p:first-child { margin-top: 0; }
.finder__side span { padding: calc(var(--u) * 0.2) calc(var(--u) * 0.5); border-radius: calc(var(--u) * 0.4); white-space: nowrap; }
.finder__side span.is-on { background: #dcdce0; }
.finder__body { position: relative; flex: 1; overflow: auto; padding: calc(var(--u) * 1.6); }
.finder__files { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(var(--u) * 8), 1fr)); gap: calc(var(--u) * 1.2); margin: 0; padding: 0; list-style: none; }
.finder__files:empty { display: none; }
.finder__empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font-size: calc(var(--u) * 1.15); color: #a1a1a6; }
.finder__files:not(:empty) + .finder__empty { display: none; }
/* Archivos en vista de iconos: miniatura del póster (abajo, como el Finder) y nombre debajo */
.file { display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 0.4); min-width: 0; cursor: default; }
.file__poster {
  display: flex; align-items: flex-end; justify-content: center; width: 100%; aspect-ratio: 4 / 5;
  padding: calc(var(--u) * 0.45); border-radius: calc(var(--u) * 0.6);
}
.file__poster img {
  display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; background: #e9e9ec;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.2), 0 calc(var(--u) * 0.25) calc(var(--u) * 0.6) rgba(0, 0, 0, 0.18);
  transition: transform 0.2s var(--ease-out);
}
.file:hover .file__poster img { transform: translateY(calc(var(--u) * -0.25)); }
.file__name {
  max-width: 100%; padding: calc(var(--u) * 0.1) calc(var(--u) * 0.4); border-radius: calc(var(--u) * 0.35);
  font-size: calc(var(--u) * 1); line-height: 1.25; text-align: center; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.file.is-selected .file__poster { background: #e3e3e8; }
.file.is-selected .file__name { color: #fff; background: #0a62d0; -webkit-line-clamp: 4; }
/* Autor (libros) o dirección (películas): más pequeño y en gris, justo bajo el título; hasta tres líneas */
.file__meta {
  max-width: 100%; margin-top: calc(var(--u) * -0.3); padding: 0 calc(var(--u) * 0.4);
  font-size: calc(var(--u) * 0.85); line-height: 1.2; color: #8e8e93; text-align: center;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
/* Vista de lista: cabecera de columnas fija y filas a rayas, como el Finder */
.finder__body--list { padding: 0; }
.finder__cols, .row { display: grid; grid-template-columns: 1fr 26%; align-items: center; }
.finder__cols {
  position: sticky; top: 0; z-index: 1; height: calc(var(--u) * 2.2); padding: 0 calc(var(--u) * 1.2);
  font-size: calc(var(--u) * 0.9); font-weight: 600; color: #6e6e73; background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid #e5e5e5; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.finder__cols span + span { padding-left: calc(var(--u) * 0.8); border-left: 1px solid #e5e5e5; }
.finder__rows { margin: calc(var(--u) * 0.3) 0; padding: 0; list-style: none; }
.row {
  height: calc(var(--u) * 2.35); margin: 0 calc(var(--u) * 0.5); padding: 0 calc(var(--u) * 0.7);
  border-radius: calc(var(--u) * 0.45); font-size: calc(var(--u) * 1.15); cursor: default;
}
.row:nth-child(even) { background: #f4f5f5; }
.row__name { display: flex; align-items: center; gap: calc(var(--u) * 0.5); min-width: 0; }
.row__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Triángulo de despliegue de carpeta */
.row__caret { flex: none; width: 0; height: 0; border-left: calc(var(--u) * 0.45) solid #8e8e93; border-block: calc(var(--u) * 0.3) solid transparent; }
.row__ico { flex: none; width: calc(var(--u) * 1.5); height: auto; }
.row__kind { padding-left: calc(var(--u) * 0.8); color: #6e6e73; white-space: nowrap; }
.row.is-selected { color: #fff; background: #0a62d0; }
.row.is-selected .row__kind { color: rgba(255, 255, 255, 0.85); }
.row.is-selected .row__caret { border-left-color: #fff; }
.finder__status {
  display: flex; align-items: center; justify-content: center; height: calc(var(--u) * 2.3);
  font-size: calc(var(--u) * 0.95); color: #6e6e73; background: #f6f6f6; border-top: 1px solid #e5e5e5;
}
/* Móvil: pantalla vertical y todo más grande para poder tocarlo */
@container mac (max-width: 640px) {
  .mac__screen { --u: 2.4cqw; aspect-ratio: 3 / 4; }
  .mac__icons { top: 7%; }
  .finder { left: 4% !important; width: 92%; height: 66%; }
  .finder__side { display: none; }
  .file__name { font-size: calc(var(--u) * 1.15); }
  .file__meta { font-size: calc(var(--u) * 0.95); }
}

/* Galería justificada: cada fila a la misma altura y cada foto con su proporción (--r) */
.gallery-j { display: grid; gap: clamp(10px, 1.6vw, 20px); }
.gallery-j__row { display: flex; gap: clamp(10px, 1.6vw, 20px); }
.gallery-j .media { margin: 0; flex: var(--r) 1 0; min-width: 0; aspect-ratio: var(--r); }
@media (max-width: 767px) {
  .gallery-j__row { flex-direction: column; }
  .gallery-j .media { flex: none; width: 100%; }
}

/* Cuadrícula de fotos 1:1, dos por línea */
.grid-sq { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(10px, 1.6vw, 20px); padding-top: clamp(40px, 8vh, 96px); }
.grid-sq .media { margin: 0; aspect-ratio: 1; }

/* Nota a mano con flecha (la flecha se dibuja y se mece desde main.js) */
.note { margin: 0; color: var(--ink); pointer-events: none; }
.paper--dark .note { color: var(--light); }
.note__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.note__svg path { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
/* Misma tipografía que los títulos de la ficha (.specs dt): es un título de función */
.note__text {
  position: absolute; white-space: nowrap; font-family: var(--f-sans); font-style: normal;
  font-weight: 700; font-size: 14px; line-height: 1.15; letter-spacing: -0.01em; will-change: transform;
}

/* Constelación de palabras */
.cloud { position: relative; height: clamp(520px, 72vh, 760px); margin: 0 0 40px; }
.cloud svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cloud svg line { stroke: rgba(41, 41, 25, 0.16); stroke-width: 1; }
.cloud__word {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  font-family: var(--f-serif); font-size: var(--s, 20px); letter-spacing: -0.03em; line-height: 1;
  white-space: nowrap; opacity: var(--o, 1); transition: color 0.3s;
  pointer-events: auto; cursor: default;
}
.cloud__word:hover { color: var(--accent); }
.cloud__in { display: inline-block; will-change: transform; }
/* Versión clara, sobre la anémona del Hola */
.cloud--light { color: var(--light); margin-top: 8px; }
.cloud--light svg line { stroke: rgba(247, 247, 238, 0.24); }
.cloud--light .cloud__word { text-shadow: 0 1px 12px rgba(0, 0, 10, 0.55); }

/* Poema */
.poem {
  font-family: var(--f-serif); font-size: clamp(29px, 3.25vw, 58px); line-height: 1.02; letter-spacing: -0.04em;
  max-width: 17em; padding: clamp(60px, 10vh, 120px) 0;
}
/* Justo bajo un título, el poema no necesita su aire de arriba */
.narrative + .poem { padding-top: 0; }
.js [data-words] .w { opacity: 0.14; }

/* Galerías */
.grid-6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-bw { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-top: 16px; }
.grid-bw .media:nth-child(1) { grid-column: span 4; aspect-ratio: 16 / 10; }
.grid-bw .media:nth-child(2) { grid-column: span 2; }
.grid-bw .media:nth-child(n + 3) { grid-column: span 2; aspect-ratio: 4 / 3; }

.slideshow { position: relative; }
.slideshow__frames { position: relative; aspect-ratio: 1919 / 1006; }
.slideshow__frames .media { position: absolute; inset: 0; opacity: 0; transition: opacity 1s var(--ease-io), clip-path 1.1s var(--ease-io); clip-path: inset(0 0 0 100%); }
.slideshow__frames .media.is-current { opacity: 1; clip-path: inset(0 0 0 0); z-index: 1; }
.slideshow__frames .media.is-prev { opacity: 1; clip-path: inset(0 0 0 0); }
.slideshow__bar { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 16px; }
.slideshow__caption { font-family: var(--f-serif); font-size: 18px; letter-spacing: -0.02em; line-height: 1.05; min-height: 2.1em; max-width: 34em; }
.slideshow__ctrl { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.slideshow__ctrl button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(41, 41, 25, 0.25); display: grid; place-items: center; transition: background 0.25s, color 0.25s; }
.slideshow__ctrl button:hover { background: var(--ink); color: var(--paper-hi); }
.slideshow__ctrl svg { width: 14px; }
/* Fotograma de vídeo: se recorta la zona útil (546×304 de 886×490) y se centra sobre negro */
.slide-video { background: #000; display: grid; place-items: center; }
.slide-video__crop { position: relative; width: min(100%, 640px); aspect-ratio: 546 / 304; overflow: hidden; }
.slide-video__crop video { position: absolute; left: -31.14%; top: -30.26%; width: 162.27%; height: auto; max-width: none; object-fit: fill; }
/* Botón de sonido en la barra del pase (solo visible en los fotogramas de vídeo) */
.slideshow__sound {
  margin-right: auto; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(41, 41, 25, 0.25);
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em; transition: background 0.25s, color 0.25s;
}
.slideshow__sound[hidden] { display: none; }
.slideshow__sound:hover { background: var(--ink); color: var(--paper-hi); }
.paper--dark .slideshow__sound { border-color: rgba(247, 247, 238, 0.3); color: var(--light); }
.paper--dark .slideshow__sound:hover { background: var(--light); color: #000; }
.paper--dark .slideshow__ctrl button { border-color: rgba(247, 247, 238, 0.3); }
.paper--dark .slideshow__ctrl button:hover { background: var(--light); color: #000; }

.hscroll { position: relative; overflow: hidden; margin: 0 calc(var(--gutter) * -1) 0 0; }
.hscroll__track { display: flex; gap: 16px; width: max-content; padding-right: var(--gutter); will-change: transform; }
.hscroll__track .media { height: min(54vh, 520px); aspect-ratio: 3 / 2; flex: none; }
.hscroll__track .media:nth-child(3n + 2) { aspect-ratio: 4 / 5; }
.hscroll__track .media:nth-child(4n + 4) { aspect-ratio: 1 / 1; }
.hscroll__hint { display: flex; justify-content: space-between; margin-top: 14px; font-size: 12px; font-weight: 700; }
.hscroll__progress { flex: 1; max-width: 260px; height: 1px; background: rgba(41, 41, 25, 0.18); position: relative; align-self: center; margin-left: 16px; }
.hscroll__progress i { position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(0); }

.stagger { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; align-items: start; }
.stagger .media:nth-child(1) { grid-column: 1 / span 7; aspect-ratio: 3 / 2; }
.stagger .media:nth-child(2) { grid-column: 9 / span 4; aspect-ratio: 4 / 5; margin-top: 18vh; }
.stagger .media:nth-child(3) { grid-column: 2 / span 4; aspect-ratio: 4 / 5; margin-top: -6vh; }
.stagger .media:nth-child(4) { grid-column: 7 / span 6; aspect-ratio: 3 / 2; margin-top: 10vh; }
.stagger .media:nth-child(5) { grid-column: 1 / span 5; aspect-ratio: 3 / 2; margin-top: 4vh; }
.stagger .media:nth-child(6) { grid-column: 7 / span 4; aspect-ratio: 4 / 5; margin-top: -10vh; }

/* Contacto: correo e Instagram como subtítulo */
.contact-lead { display: flex; flex-direction: column; align-items: flex-start; gap: 0.12em; word-break: break-word; }
.contact-lead a {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.14em;
  text-decoration-color: rgba(247, 247, 238, 0.45); transition: text-decoration-color 0.3s;
}
.contact-lead a:hover { text-decoration-color: currentColor; }

/* ---------- Juego (estilo arcade) ---------- */
:root { --f-pixel: "Press Start 2P", ui-monospace, monospace; }
.arcade, .psst { --arc-blue: #2323ff; --arc-pink: #ee8bc6; /* el rosa del fondo del cartel de Pearl */ --arc-lime: #d8ff3c; }
@keyframes arcade-blink { 50% { opacity: 0; } }
@keyframes arcade-glow {
  0%, 100% { text-shadow: 0 0 4px var(--arc-lime), 0 0 14px var(--arc-lime); box-shadow: 4px 4px 0 var(--arc-pink), 0 0 18px rgba(216, 255, 60, 0.35); }
  50% { text-shadow: 0 0 1px var(--arc-lime); box-shadow: 4px 4px 0 var(--arc-pink), 0 0 4px rgba(216, 255, 60, 0.1); }
}
/* Invitación en la portada: parpadea como un "PRESS START" */
.psst {
  display: inline-flex; align-items: center; gap: 12px; align-self: flex-start; width: fit-content; margin-top: clamp(32px, 6vh, 56px); padding: 14px 18px;
  font-family: var(--f-pixel); font-size: clamp(10px, 1vw, 13px); line-height: 1.6; color: var(--arc-lime);
  background: rgba(5, 5, 20, 0.72); border: 2px solid var(--arc-lime);
  animation: arcade-glow 1.6s ease-in-out infinite; transition: transform 0.2s;
}
.psst:hover { transform: translate(-2px, -2px); }
.psst__cursor { animation: arcade-blink 0.8s steps(1) infinite; }
/* Pantalla */
.arcade { background: #04040f; }
.arcade__screen {
  position: relative; max-width: 560px; margin: 0 auto; overflow: hidden; text-align: center;
  padding: clamp(18px, 3vw, 32px) clamp(14px, 2.4vw, 28px) clamp(22px, 3vw, 36px);
  border: 4px solid var(--arc-lime); border-radius: 18px; color: #fff; font-family: var(--f-pixel);
  background: radial-gradient(ellipse at 50% 40%, #12124a 0%, #05051a 70%);
  box-shadow: 10px 10px 0 var(--arc-pink), 0 0 36px rgba(216, 255, 60, 0.4), inset 0 0 90px rgba(0, 0, 0, 0.85);
  animation: arcade-screen-glow 1.6s ease-in-out infinite;
}
/* Líneas de tubo (CRT) */
.arcade__screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 3px);
}
.arcade__hud { display: flex; justify-content: space-between; gap: 12px; font-size: clamp(7px, 0.9vw, 10px); letter-spacing: 0.06em; }
.arcade__hud b { font-weight: 400; color: var(--arc-lime); }
.arcade__blink { color: var(--arc-pink); animation: arcade-blink 1s steps(1) infinite; }
.arcade__title {
  max-width: 32em; margin: clamp(22px, 4vh, 36px) auto clamp(20px, 3vh, 30px);
  font-family: var(--f-pixel); font-weight: 400; font-size: clamp(10px, 1.1vw, 13px); line-height: 1.8;
  text-shadow: 2px 2px 0 var(--arc-blue);
}
.arcade__title span { color: var(--arc-pink); }
/* Rasca y gana: mi foto encima (canvas), el personaje debajo, misma escala */
.scratch {
  position: relative; width: min(100%, 290px); aspect-ratio: 736 / 883; margin: 0 auto;
  border: 4px solid #fff; box-shadow: 8px 8px 0 var(--arc-pink); touch-action: none; user-select: none;
}
.scratch__under, .scratch__cover { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.scratch__cover { cursor: none; transition: opacity 0.7s var(--ease-out); }
.scratch.is-done .scratch__cover { opacity: 0; pointer-events: none; }
.scratch:focus-visible { outline: 3px solid var(--arc-lime); outline-offset: 6px; }
/* Moneda que hace de cursor */
.scratch__coin {
  position: absolute; left: 0; top: 0; z-index: 2; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6b0 0 18%, #ffd23f 19% 62%, #c98a00 63%);
  box-shadow: 0 0 0 2px #000, 3px 3px 0 2px rgba(0, 0, 0, 0.45); pointer-events: none; opacity: 0; transition: opacity 0.2s;
}
.scratch.is-hover:not(.is-done) .scratch__coin { opacity: 1; }
.arcade__status { margin-top: 22px; font-size: clamp(8px, 0.9vw, 11px); color: var(--arc-lime); animation: arcade-blink 1.2s steps(1) infinite; }
.arcade__status.is-win { animation: none; color: var(--arc-pink); text-shadow: 0 0 12px var(--arc-pink); }
.arcade__btn {
  margin-top: 18px; padding: 12px 16px; font-family: var(--f-pixel); font-size: 10px; color: #fff;
  background: var(--arc-blue); border: 3px solid #fff; box-shadow: 4px 4px 0 var(--arc-pink); transition: transform 0.15s, box-shadow 0.15s;
}
.arcade__btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--arc-pink); }
.arcade__screen.is-win { animation: arcade-flash 0.5s steps(2) 3, arcade-screen-glow 1.6s ease-in-out 1.5s infinite; }
/* Mismo pulso de brillo que el botÃ³n "Psst" */
@keyframes arcade-screen-glow {
  0%, 100% { box-shadow: 10px 10px 0 var(--arc-pink), 0 0 36px rgba(216, 255, 60, 0.4), inset 0 0 90px rgba(0, 0, 0, 0.85); }
  50% { box-shadow: 10px 10px 0 var(--arc-pink), 0 0 8px rgba(216, 255, 60, 0.12), inset 0 0 90px rgba(0, 0, 0, 0.85); }
}
@keyframes arcade-flash { 50% { border-color: var(--arc-pink); box-shadow: 10px 10px 0 var(--arc-lime), 0 0 90px rgba(238, 139, 198, 0.6), inset 0 0 90px rgba(0, 0, 0, 0.85); } }
.arcade .footer { margin-top: clamp(64px, 10vh, 120px); border-top-color: rgba(247, 247, 238, 0.16); }
.arcade .footer span { color: #8f8f80; }
.arcade .footer img { filter: invert(1); }
@media (max-width: 767px) {
  .scratch { width: 76%; box-shadow: 6px 6px 0 var(--arc-pink); }
  .arcade__hud { font-size: 7px; }
}

.footer {
  display: flex; justify-content: space-between; align-items: end; gap: 24px; padding-top: 28px;
  border-top: 1px solid rgba(41, 41, 25, 0.14); font-size: 12px; font-weight: 700;
}
.footer img { width: 56px; }
.footer span { font-family: var(--f-serif); font-weight: 400; font-size: 13px; color: #6b6b5c; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 90; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: rgba(0, 0, 0, 0.92); color: var(--light);
  display: grid; place-items: center; opacity: 0; transition: opacity 0.35s var(--ease-out);
}
.lightbox:not([open]) { display: none; }
.lightbox.is-visible { opacity: 1; }
.lightbox::backdrop { background: transparent; }
.lightbox__body { width: min(92vw, 1400px); max-height: 86vh; display: grid; place-items: center; }
.lightbox__body video, .lightbox__body img { max-width: 100%; max-height: 86vh; width: auto; height: auto; border-radius: 4px; }
.lightbox__close {
  position: absolute; top: 14px; right: 14px; padding: 8px 14px; border-radius: 999px;
  background: var(--paper-hi); color: #000; font-weight: 600; font-size: 14px;
}
.lightbox__body img { transition: opacity 0.25s var(--ease-out); }
.lightbox__body img.is-swapping { opacity: 0; }
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.35); color: var(--light);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}
.lightbox__nav[hidden] { display: none; }
.lightbox__nav:hover, .lightbox__nav:focus-visible { background: rgba(255, 255, 255, 0.16); border-color: var(--light); }
.lightbox__nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lightbox__nav--prev { left: clamp(10px, 2.5vw, 32px); }
.lightbox__nav--next { right: clamp(10px, 2.5vw, 32px); }
.lightbox__count {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); margin: 0;
  font-size: 12px; font-weight: 600; letter-spacing: 0.12em; color: rgba(255, 255, 255, 0.75);
}
.lightbox__count[hidden] { display: none; }
@media (max-width: 767px) {
  .lightbox__nav { top: auto; bottom: 10px; transform: none; width: 44px; height: 44px; }
  .lightbox__body { width: 100vw; }
}

/* ---------- Índice final (vuelve el menú inicial tras el Hola) ---------- */
.endmenu {
  position: relative; z-index: 2; min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center; padding: 12vh 0; color: var(--light);
}
.endmenu__inner {
  position: absolute; inset: 0; padding: 22px; display: flex; flex-direction: column;
}
.endmenu__list { margin-top: auto; }

/* ---------- El índice brilla para invitar a pulsar ---------- */
/* Luz que recorre el borde del cuadrado */
.frame-glow { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.frame-glow rect {
  fill: none; stroke: #ffe9cf; stroke-width: 2; vector-effect: non-scaling-stroke;
  stroke-dasharray: 0.16 0.84; stroke-linecap: round;
  filter: drop-shadow(0 0 4px rgba(255, 214, 170, 0.95)) drop-shadow(0 0 14px rgba(255, 170, 110, 0.65));
  animation: frame-run 7s linear infinite;
}
@keyframes frame-run { to { stroke-dashoffset: -1; } }

/* Destello en cadena sobre los capítulos */
.toc__list a, .endmenu__list a {
  position: relative;
  animation: toc-shine 6s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.16s + 1.2s);
}
@keyframes toc-shine {
  0%, 14%, 100% { text-shadow: none; transform: none; }
  6% { text-shadow: 0 0 12px rgba(255, 220, 180, 0.95), 0 0 2px rgba(255, 255, 255, 0.9); transform: translateX(5px); }
}
/* Flecha al pasar el ratón */
.toc__list a::before, .endmenu__list a::before {
  content: "→"; position: absolute; left: -20px; top: 50%; font-weight: 400;
  transform: translate(-6px, -52%); opacity: 0; transition: opacity 0.3s, transform 0.3s var(--ease-out);
}
.toc__list a:hover, .endmenu__list a:hover { color: #ffd9b0; }
.toc__list a:hover::before, .endmenu__list a:hover::before { opacity: 1; transform: translate(0, -52%); }
/* En la barra lateral acoplada, sin destellos (solo el hover) */
.is-docked .toc__list a { animation: none; }

/* Pista bajo el subtítulo */
.toc__hint {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  font-family: var(--f-sans); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  opacity: 0.85;
}
.toc__hint b {
  width: 7px; height: 7px; border-radius: 50%; background: #ffd9b0; flex: none;
  box-shadow: 0 0 0 0 rgba(255, 217, 176, 0.7); animation: hint-pulse 2.2s ease-out infinite;
}
@keyframes hint-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 217, 176, 0.7); }
  70%, 100% { box-shadow: 0 0 0 10px rgba(255, 217, 176, 0); }
}

/* ---------- Subíndice dentro de un capítulo (p. ej. Dípticos) ---------- */
.subindex { position: relative; z-index: 1; margin-top: clamp(32px, 6vh, 64px); max-width: 380px; color: var(--light); }
.subindex li + li { margin-top: 6px; }
.subindex a {
  position: relative; display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  font-weight: 800; font-size: clamp(22px, 2vw, 30px); line-height: 1; letter-spacing: -0.03em; padding: 2px 0;
  animation: toc-shine 6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 0.16s + 1.2s);
  transition: color 0.3s var(--ease-out);
}
.subindex i { font-family: var(--f-serif); font-style: normal; font-weight: 400; font-size: 13px; letter-spacing: 0; opacity: 0.7; }
.subindex a::before {
  content: "→"; position: absolute; left: -26px; top: 50%; font-weight: 400;
  transform: translate(-6px, -52%); opacity: 0; transition: opacity 0.3s, transform 0.3s var(--ease-out);
}
.subindex a:hover { color: #ffd9b0; }
.subindex a:hover::before { opacity: 1; transform: translate(0, -52%); }

/* ---------- Carruseles: imágenes pegadas, sin separación ---------- */
.strip-set { scroll-margin-top: calc(var(--header-h) + 16px); }
.strip-set + .strip-set { margin-top: clamp(40px, 8vh, 96px); }
/* Pista bajo el título del carrusel */
.strip-hint {
  display: flex; align-items: center; gap: 8px;
  margin: calc(-1 * clamp(20px, 3vh, 40px)) 0 clamp(20px, 3vh, 32px);
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #6b6b5c;
}
.strip-hint b {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ink); flex: none;
  box-shadow: 0 0 0 0 rgba(41, 41, 25, 0.45); animation: hint-pulse-dark 2.2s ease-out infinite;
}
@keyframes hint-pulse-dark {
  0% { box-shadow: 0 0 0 0 rgba(41, 41, 25, 0.45); }
  70%, 100% { box-shadow: 0 0 0 10px rgba(41, 41, 25, 0); }
}
.paper--dark .strip-hint { color: #a3a394; }
.paper--dark .strip-hint b { background: var(--light); animation-name: hint-pulse; }
.strip { display: flex; gap: 0; width: 100%; }
.strip + .strip { margin-top: clamp(24px, 5vh, 56px); }
.strip__item { flex: 1 1 0; min-width: 0; margin: 0; overflow: hidden; background: #111; cursor: zoom-in; }
.strip__item img { display: block; width: 100%; height: auto; transition: filter 0.4s var(--ease-out); }
/* Sin zoom al pasar el ratón: así la panorámica no se "rompe" entre fotos */
.strip__item:hover img { filter: brightness(1.08); }

/* Vídeo de apoyo dentro de un carrusel: pequeño, sin quitar protagonismo a las fotos */
.aside-video { display: flex; align-items: flex-end; gap: clamp(16px, 3vw, 36px); margin-top: clamp(24px, 5vh, 56px); }
.aside-video__media { flex: none; width: clamp(132px, 15vw, 200px); aspect-ratio: 576 / 1022; margin: 0; cursor: zoom-in; }
.aside-video__media .play { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
.aside-video__media .play svg { width: 14px; margin-left: 2px; }
.aside-video__text { max-width: 26em; padding-bottom: 2px; }
.aside-video__text .meta { margin-top: 0; }
.aside-video__lead {
  margin-top: 8px; font-family: var(--f-serif); font-size: clamp(18px, 1.55vw, 25px);
  line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance;
}

/* ---------- Apartados por capítulo (misma página) ---------- */
.header__back { display: none; }
.view-chapter .header__back { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
html.js:not(.view-chapter) .chapter:not(#hola) { display: none; }
.view-chapter #hola, .view-chapter .chapter:not(.is-current) { display: none; }
.is-intro .frame-glow { opacity: 0; }
.frame-glow { transition: opacity 1.2s var(--ease-out); }
.view-chapter .cover__lines { display: none; }
@media (min-width: 1024px) {
  /* La portada se pliega pero el índice lateral sigue visible */
  .view-chapter .cover { height: 0; min-height: 0; padding: 0; visibility: hidden; }
  .view-chapter .toc__title, .view-chapter .toc__list, .view-chapter .toc__legal { visibility: visible; }
}
@media (max-width: 1023px) {
  .view-chapter .cover { display: none; }
}
/* Fundido a negro entre apartados */
.veil {
  position: fixed; inset: 0; z-index: 55; background: #000; pointer-events: none;
  opacity: 0; transition: opacity 0.45s var(--ease-io);
}
.veil.is-on { opacity: 1; pointer-events: auto; }

/* ---------- Estados iniciales para animaciones (solo con JS) ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  :root { --side: 0px; --header-h: 56px; }
  .header { grid-template-columns: 1fr auto; }
  .header__nav, .header__right .hide-m { display: none; }
  .menu-btn { display: block; }
  .header__brand span { display: none; }
  .cover__frame, .endmenu__frame { width: min(100% - 32px, 420px); height: min(76svh, 640px); }
  .chapter__hero { padding: 22vh 16px 16vh; min-height: 120vh; }
  .chapter__title { font-size: clamp(52px, 16vw, 110px); white-space: normal; }
  .chapter__lead { font-size: clamp(25px, 6.7vw, 36px); }
  .chapter__text { font-size: clamp(17px, 4.5vw, 22px); }
  .floater { --w: 112px !important; left: min(var(--x), calc(100% - 124px)); opacity: 0.7; }
  .paper { padding: 28px 16px 96px; }
  .art--split, .art--split.is-flip, .art--duo { grid-template-columns: 1fr; }
  .art--split.is-flip .art__text { order: 0; }
  .specs { grid-template-columns: 1fr; }
  .specs > div { grid-template-columns: 1fr 1.4fr; }
  .grid-6 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid-bw { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid-bw .media:nth-child(n) { grid-column: span 1; aspect-ratio: 4 / 3; }
  .grid-bw .media:nth-child(1) { grid-column: span 2; }
  .stagger { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .stagger .media:nth-child(n) { grid-column: span 1; margin-top: 0; aspect-ratio: 4 / 5; }
  .stagger .media:nth-child(1), .stagger .media:nth-child(4) { grid-column: span 2; aspect-ratio: 3 / 2; }
  .hscroll { overflow-x: auto; scroll-snap-type: x mandatory; margin-right: -16px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .hscroll::-webkit-scrollbar { display: none; }
  .hscroll__track .media { height: 52vh; scroll-snap-align: start; }
  .hscroll__hint { display: none; }
  .cloud { height: auto; display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; padding: 8px 0 24px; }
  .cloud svg { display: none; }
  .cloud__word { position: static; transform: none; font-size: calc(var(--s) * 0.75); }
  .footer { flex-direction: column; align-items: start; }
  /* Carruseles: en móvil se deslizan con el dedo, una foto casi a pantalla completa */
  .strip { overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-right: -16px; }
  .strip::-webkit-scrollbar { display: none; }
  .strip__item { flex: 0 0 84vw; scroll-snap-align: start; }
  .subindex a::before { display: none; }
  /* En un apartado, la cabecera móvil deja sitio a "← Índice" */
  .view-chapter .header__brand b { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  [data-words] .w { opacity: 1 !important; }
}
