/* =========================================================================
   Rod Sotomayor — Portafolio
   Lienzo claro · tinta · un acento · secciones a pantalla completa
   ========================================================================= */

:root {
  --canvas:  #EFEEEB;   /* fondo claro */
  --night:   #0D0D0B;   /* secciones oscuras */
  --ink:     #0A0A0A;   /* texto */
  --muted:   #6B6862;   /* texto secundario */
  --rule:    #C9C7C1;   /* líneas */
  --accent:  #DE2E33;   /* rojo de marca: el punto del logo (hover, activo, destello) */

  --display: 'Funnel Display', 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --body:    'Archivo', 'Helvetica Neue', Arial, sans-serif;

  --gx:      clamp(1rem, 4.4vw, 4.5rem);          /* margen lateral */
  --ease:    cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.55, 0, .25, 1);

  --wave-dim:   rgba(10, 10, 10, .2);
  --wave-lit:   var(--ink);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--canvas); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-stopped { overflow: hidden; }
body { font-family: var(--body); color: var(--ink); background: var(--canvas); font-size: 1rem; line-height: 1.5; overflow-x: clip; }
body.is-loading { overflow: hidden; height: 100svh; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
svg { width: 1em; height: 1em; flex: none; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

.label { font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.h-xl { font-family: var(--display); font-weight: 500; font-size: clamp(2.7rem, 6.7vw, 6.4rem); letter-spacing: -.025em; line-height: 1; }

/* ---- Máscara: el texto sube desde abajo ---- */
.mask { display: block; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; }
.mask > span { display: block; transform: translateY(112%); transition: transform 1.1s var(--ease); transition-delay: var(--d, 0s); }
.in .mask > span, .mask.in > span { transform: none; }
.reveal > :not(.h-xl) { transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal:not(.in) > :not(.h-xl) { opacity: 0; transform: translateY(18px); }
.rule { height: 1px; background: var(--rule); transform: scaleX(0); transform-origin: left; transition: transform 1.4s var(--ease); }
.rule.in { transform: none; }

/* ---- Barrido de color letra a letra en hover ---- */
[data-hw] .hww { display: inline-block; white-space: nowrap; }
[data-hw] .hwc { display: inline-block; }
[data-hw]:hover .hwc, a:hover > [data-hw] .hwc, .prow.active h3 .hwc { animation: hw-px .5s both; animation-delay: calc(var(--hwi) * 16ms); }

/* ---- Botones y chips ---- */
.btn { display: inline-flex; align-items: center; gap: .9rem; border: 1px solid var(--ink); padding: .55rem .9rem; font-size: .78rem; font-weight: 500; letter-spacing: .01em; white-space: nowrap;
  transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s; }
.btn svg { transition: transform .45s var(--ease); }
.btn:hover svg { transform: translateX(.3rem); }
.btn-fill { background: var(--ink); color: var(--canvas); }
.btn-light { background: var(--canvas); color: var(--ink); border-color: var(--canvas); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; max-width: 24rem; }
.chips li, .chip { border: 1px solid var(--rule); padding: .5rem .95rem; font-size: .68rem; font-weight: 500; background: rgba(255, 255, 255, .25); transition: border-color .3s, background-color .3s, color .3s; }
.chip:hover { border-color: var(--ink); }
.chip.active { background: var(--ink); color: var(--canvas); border-color: var(--ink); }

/* =========================================================================
   PANTALLA DE CARGA
   ========================================================================= */
.loader { position: fixed; inset: 0; z-index: 200; background: var(--canvas); display: grid; place-items: center; transition: transform .85s var(--ease-io), visibility 0s .85s; }
.loader.done { transform: translateY(-100%); visibility: hidden; }
.loader-word { display: flex; align-items: center; font-family: var(--body); font-weight: 600; font-size: clamp(1.6rem, 6vw, 5.4rem); letter-spacing: .01em; line-height: 1; }
.loader-half { display: flex; overflow: hidden; padding-block: .08em; }
.loader-half i { font-style: normal; display: block; transform: translateY(110%); animation: loader-letter-in .7s var(--ease) both; animation-delay: calc(var(--i) * 45ms + .1s); }
.loader.out .loader-half i { animation: loader-letter-out .5s var(--ease-io) both; animation-delay: calc(var(--i) * 28ms); }
/* con el polvo de píxeles activo, las letras reales se ocultan: las dibuja el canvas */
.loader.px-out .loader-half i { animation: none; visibility: hidden; }
.px-dust { position: fixed; inset: 0; z-index: 201; width: 100vw; height: 100vh; pointer-events: none; }
/* el video del logo (fondo blanco) se funde con el lienzo gracias a multiply.
   Ojo: no animar la opacidad del chip, solo la del video, o el blanco reaparece */
.loader-chip { position: relative; width: 0; height: 1.8em; margin-inline: 0; overflow: hidden; transition: width .7s var(--ease-io), margin .7s var(--ease-io); }
.loader.split .loader-chip { width: 1.8em; margin-inline: .14em; }
.loader.closing .loader-chip { width: 0; margin-inline: 0; transition-duration: .42s; }
.loader-chip video { position: absolute; top: 0; left: 50%; width: 1.8em; height: 1.8em; transform: translateX(-50%); mix-blend-mode: multiply; transition: opacity .4s; }
.loader.closing .loader-chip video, .loader.no-video .loader-chip video { opacity: 0; }
/* respaldo si el video no se puede reproducir */
.loader-mark { position: absolute; inset: 0; margin: auto; width: 70%; height: 70%; color: var(--ink); opacity: 0; transform: scale(.8); transition: opacity .35s, transform .6s var(--ease); }
.loader.no-video.split .loader-mark { opacity: 1; transform: none; }
.loader.closing .loader-mark { opacity: 0; }

/* Entrada de la página tras la carga */
.enter { opacity: 0; transform: translateY(14px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
body.is-ready .enter { opacity: 1; transform: none; }

/* =========================================================================
   NAV + MENÚ
   ========================================================================= */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 100; display: flex; justify-content: space-between; align-items: center; padding: 1.5rem var(--gx); color: #fff; mix-blend-mode: difference;
  opacity: 0; transition: opacity .8s var(--ease) .3s, transform .5s var(--ease); pointer-events: none; }
body.is-ready .nav { opacity: 1; }
.nav-hidden .nav { transform: translateY(-110%); }
/* la nav usa "difference": sobre la franja crema se ve negra, sobre la franja oscura se ve blanca */
.nav-bar { position: fixed; inset: 0 0 auto 0; z-index: 99; height: var(--nav-h, 4.6rem); pointer-events: none;
  --tone: var(--canvas); background: color-mix(in srgb, var(--tone) 84%, transparent); border-bottom: 1px solid rgba(10, 10, 10, .08);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  opacity: 0; transform: translateY(-100%); transition: transform .5s var(--ease), opacity .4s, background-color .45s var(--ease), border-color .45s; }
.nav-dark .nav-bar { --tone: var(--night); border-bottom-color: rgba(255, 255, 255, .08); }
.nav-solid .nav-bar { opacity: 1; transform: none; }
.nav-hidden .nav-bar, .menu-open .nav-bar { transform: translateY(-110%); }
.nav > * { pointer-events: auto; }
.nav-logo { display: flex; align-items: center; gap: .65rem; font-size: .8rem; font-weight: 600; letter-spacing: .01em; }
.logo-mark { width: auto; aspect-ratio: 461 / 475; }
.nav-logo .logo-mark { height: 1.55rem; --dot: currentColor; transition: transform .6s var(--ease); }
.nav-logo:hover .logo-mark { transform: rotate(-8deg); }
/* capa sin "difference" para que el punto se vea rojo sobre cualquier fondo */
.nav-accent { z-index: 101; mix-blend-mode: normal; color: transparent; }
.nav.nav-accent > * { pointer-events: none; }
.nav-accent .nav-logo > span { visibility: hidden; }
.nav-accent .logo-mark { --dot: var(--accent); }
.nav:has(.nav-logo:hover) + .nav-accent .logo-mark { transform: rotate(-8deg); }
.nav-burger { width: 9.1rem; height: 1.6rem; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: 7px; }
.nav-burger i { display: block; height: 2.5px; width: 100%; background: var(--accent); transition: transform .5s var(--ease), width .5s var(--ease); }
/* las líneas rojas se pintan en la capa .nav-accent (sin "difference"); el botón real solo recibe el clic */
#burger i { visibility: hidden; }
body:not(.menu-open) .nav:has(#burger:hover) + .nav-accent .nav-burger i:last-child { width: 60%; }
.menu-open .nav-burger i:first-child { transform: translateY(4.75px) rotate(3.75deg); }
.menu-open .nav-burger i:last-child { transform: translateY(-4.75px) rotate(-3.75deg); width: 100%; }

.menu { position: fixed; inset: 0; z-index: 90; background: var(--night); color: var(--canvas); display: flex; flex-direction: column; justify-content: space-between; padding: 6.5rem var(--gx) 2rem;
  clip-path: inset(0 0 100% 0); visibility: hidden; transition: clip-path .9s var(--ease-io), visibility 0s .9s; }
.menu-open .menu { clip-path: inset(0); visibility: visible; transition: clip-path .9s var(--ease-io); }
.menu-links { display: flex; flex-direction: column; }
.menu-links a { display: flex; align-items: baseline; gap: 1.5rem; border-top: 1px solid rgba(255, 255, 255, .16); padding: .5rem 0; overflow: hidden; }
.menu-links small { font-size: .65rem; color: #8b8882; width: 2rem; }
.menu-links span { font-family: var(--display); font-weight: 500; font-size: clamp(2.2rem, 6.4vw, 5.4rem); letter-spacing: -.025em; line-height: 1.1; transform: translateY(110%); transition: transform .9s var(--ease); transition-delay: calc(var(--i) * 60ms + .15s); }
.menu-open .menu-links span { transform: none; }
.menu-foot { display: flex; flex-wrap: wrap; gap: .6rem 2.5rem; font-size: .75rem; font-weight: 500; letter-spacing: .02em; color: #b9b6af; }
.menu-foot span { margin-left: auto; }

/* =========================================================================
   HERO
   ========================================================================= */
.hero { position: relative; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 37fr) minmax(0, 55fr); gap: 0 4%; padding: 5.2rem var(--gx) 0; overflow: hidden; }
.hero::after { content: ""; position: absolute; left: var(--gx); right: var(--gx); bottom: 0; height: 1px; background: var(--rule); }
.hero-copy { position: relative; z-index: 3; align-self: center; padding-bottom: 2rem; display: flex; flex-direction: column; gap: 1.4rem; pointer-events: none; }
.hero-status { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1.6rem; pointer-events: auto; font-size: .72rem; font-weight: 500; color: var(--muted); }
.hero-social { display: flex; gap: 1.4rem; }
/* Links discretos: subrayado fino que crece al hover, flecha que se endereza */
.hero-social a { position: relative; display: inline-flex; align-items: center; gap: .35rem; color: var(--ink); transition: color .3s; }
.hero-social a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor; transform: scaleX(.25); transform-origin: left; transition: transform .5s var(--ease); }
.hero-social a:hover { color: var(--accent); }
.hero-social a:hover::after { transform: scaleX(1); }
.hero-social svg { width: .8em; height: .8em; transform: rotate(-45deg); transition: transform .4s var(--ease); }
.hero-social a:hover svg { transform: rotate(0deg); }
.hero-time { font-variant-numeric: tabular-nums; }
.hero-name { font-family: var(--display); font-weight: 500; font-size: clamp(3.2rem, 6.6vw, 6.6rem); letter-spacing: -.035em; line-height: .92; margin-left: -.04em; }
.hero-name .mask:nth-child(2) > span { transition-delay: .09s; }
body.is-ready .hero-name .mask > span { transform: none; }
.hero-name i { font-style: normal; transition: color 1.1s var(--ease); }
.hero-name i.hot { color: var(--accent); transition-duration: .5s; }
.hero-tag { font-size: clamp(.95rem, 1.2vw, 1.1rem); font-weight: 500; line-height: 1.45; }
.hero-portrait { position: relative; z-index: 1; overflow: hidden; margin-bottom: .9rem; background: #d9d8d4; clip-path: inset(100% 0 0 0); transition: clip-path 1.5s var(--ease-io) .1s; }
body.is-ready .hero-portrait { clip-path: inset(0); }
.hero-photo { position: absolute; inset: -8% 0; width: 100%; height: 116%; object-fit: cover; object-position: 50% 18%; filter: grayscale(1) contrast(1.08); transform: scale(1.18); transition: transform 2.2s var(--ease) .1s; will-change: transform; }
body.is-ready .hero-photo { transform: translateY(var(--py, 0)); }
body.is-settled .hero-photo { transition: none; }
.hero-trail { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.hero-trail img { position: absolute; left: 0; top: 0; width: calc(clamp(3.6rem, 6.4vw, 6.4rem) * var(--k, 1.265)); aspect-ratio: 1; object-fit: contain; opacity: 0; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .05)); will-change: transform, opacity; }
.hero-trail img[src$="logo-1.webp"] { --k: 1; }   /* el retrato de frente mantiene su tamaño */

/* =========================================================================
   SOBRE MÍ — sección anclada, el texto se ilumina con el scroll
   ========================================================================= */
.studio { position: relative; height: 235vh; }
.studio-pin { position: sticky; top: var(--pin-top, 0); display: flex; flex-direction: column; justify-content: center; gap: clamp(1.6rem, 5vh, 3.4rem); padding: 4rem var(--gx) 2rem; }
.studio-top { display: grid; grid-template-columns: minmax(0, 66fr) minmax(0, 34fr); align-items: start; gap: 2rem; }
.studio-text { font-family: var(--display); font-weight: 500; font-size: clamp(1.45rem, 2.72vw, 2.6rem); letter-spacing: -.012em; line-height: 1.24; }
.studio-text .w { display: inline-block; white-space: nowrap; }
[data-wave] [data-char] { color: var(--wave-dim); transition: color .12s steps(1, end); }
/* pintado "pixel": la letra se imprime con una trama recortada al glifo — rala → media → densa → sólida, a cortes duros */
[data-wave] [data-char][data-lit] { animation: char-px .7s both; }
/* partículas: píxeles sueltos que saltan desde las letras recién pintadas */
.px-bit { position: fixed; z-index: 160; left: 0; top: 0; width: 4px; height: 4px; background: var(--accent); pointer-events: none; }
.px-bit.ink { background: var(--ink); }
.studio-float { justify-self: center; width: min(16rem, 62%); aspect-ratio: 4 / 5; overflow: hidden; box-shadow: 0 26px 50px -24px rgba(0, 0, 0, .5); transform: translateY(var(--y, 0)) rotate(var(--r, 7deg)); will-change: transform; }
.studio-float img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.studio-strip { display: grid; grid-template-columns: clamp(12.5rem, 27vw, 25rem) minmax(0, 1fr); gap: clamp(1rem, 1.8vw, 1.6rem); align-items: center; border-top: 1px solid var(--rule); padding-top: 1rem; }
.reel-thumb { position: relative; aspect-ratio: 16 / 9.4; overflow: hidden; background: var(--night); }
.reel-thumb video { width: 100%; height: 100%; object-fit: cover; }
.clients { min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 90%, transparent); }
/* junto al video el desvanecido izquierdo es corto, para que las tiras no se alejen de él */
.clients .marquee { -webkit-mask-image: linear-gradient(90deg, transparent, #000 2.5%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 2.5%, #000 90%, transparent); }
.marquee-track { display: flex; width: max-content; align-items: center; animation: marquee 46s linear infinite; }
.marquee-track.reverse { animation-direction: reverse; animation-duration: 58s; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { flex: none; display: inline-flex; align-items: center; gap: .55rem; margin-right: clamp(1.8rem, 3.6vw, 3.4rem); color: var(--muted); white-space: nowrap; transition: color .3s; }
.marquee-track span:hover { color: var(--ink); }
/* tira de apps: banda entre márgenes que cierra el Sobre mí y da paso a Proyectos */
.tool-band { border-block: 1px solid var(--rule); padding-block: clamp(.9rem, 2vh, 1.3rem); }
.marquee-track .tool { gap: .7rem; margin-right: clamp(2.4rem, 4.4vw, 4.2rem); color: var(--ink); }
.tool-band .marquee-track { animation-duration: 64s; }
.tool .ico, .tool .ico-mono { width: clamp(1.6rem, 2.1vw, 2rem); height: clamp(1.6rem, 2.1vw, 2rem); }
.tool small { font-size: .62rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); transition: color .3s; }
.tool:hover small { color: var(--ink); }
.ico-mono { display: inline-grid; place-items: center; border-radius: 3px; background: var(--ink); color: var(--canvas); font-size: .68rem; font-weight: 700; line-height: 1; }
.principle { font-family: var(--display); font-weight: 500; font-size: clamp(1.05rem, 1.6vw, 1.5rem); letter-spacing: -.02em; }
.marquee-track .principle { gap: clamp(.9rem, 1.6vw, 1.4rem); }
.principle i { flex: none; width: .32em; height: .32em; background: var(--accent); }
.step { font-size: .78rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.marquee-track .step { margin-right: clamp(.9rem, 1.6vw, 1.4rem); }
.step small { font-size: .62rem; color: var(--accent); letter-spacing: .08em; }
.step svg { width: .95rem; height: .95rem; margin-left: clamp(.9rem, 1.6vw, 1.4rem); }
.ico { display: inline-block; width: 1.15rem; height: 1.15rem; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }

/* =========================================================================
   PROYECTOS — acordeón
   ========================================================================= */
.projects { position: relative; padding: clamp(4rem, 10vh, 7rem) var(--gx) calc(clamp(4rem, 10vh, 7rem) + var(--edge) * .6); }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem 2rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.filters { display: flex; flex-wrap: wrap; gap: .4rem; padding-bottom: .7rem; }
.prows { border-bottom: 1px solid var(--rule); }
.prow { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto 25.4%; column-gap: clamp(1rem, 3vw, 2.6rem); align-items: start; border-top: 1px solid var(--rule); padding: 1.35rem 0; cursor: pointer; animation: rise .7s var(--ease) both; animation-delay: calc(var(--i) * 50ms); }
.prow h3 { font-family: var(--display); font-weight: 500; font-size: clamp(1.7rem, 3.5vw, 3.3rem); letter-spacing: -.02em; line-height: 1.08; color: #8a8782; transition: color .45s var(--ease); }
.prow.active h3 { color: var(--accent); --hw-base: var(--accent); }
.prow.is-featured h3::after { content: "Destacado"; display: inline-block; vertical-align: .95em; margin-left: .7rem; padding: .38rem .55rem; font-family: var(--body); font-size: .58rem; font-weight: 600; letter-spacing: .08em; line-height: 1; text-transform: uppercase; color: #fff; background: var(--accent); }
.prow .btn { margin-top: .5rem; color: #8a8782; border-color: var(--rule); }
.prow.active .btn { color: var(--ink); border-color: var(--ink); }
.prow .btn:hover { background: var(--ink); color: var(--canvas); }
.prow-img { grid-column: 3; grid-row: 1 / span 2; height: 0; overflow: hidden; transition: height .7s var(--ease-io); }
.prow.active .prow-img { height: clamp(8rem, 15.5vw, 14rem); }
.prow-img img { width: 100%; height: clamp(8rem, 15.5vw, 14rem); object-fit: cover; transform: scale(1.15); transition: transform 1.2s var(--ease); }
.prow.active .prow-img img { transform: none; }
.prow-meta { grid-column: 1 / span 2; grid-row: 2; align-self: end; display: flex; flex-wrap: wrap; gap: .4rem 2.6rem; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .7s var(--ease-io), opacity .5s, padding .7s var(--ease-io); }
.prow.active .prow-meta { max-height: 8rem; opacity: 1; padding-top: 1.2rem; }
/* Táctil / móvil: todas las filas desplegadas (no hay hover) */
.prows.all-open .prow h3 { color: var(--ink); }
.prows.all-open .prow .btn { color: var(--ink); border-color: var(--ink); }
.prows.all-open .prow-img { height: clamp(8rem, 15.5vw, 14rem); }
.prows.all-open .prow-img img { transform: none; }
.prows.all-open .prow-meta { max-height: 8rem; opacity: 1; padding-top: 1.2rem; }
.prow-meta dt { font-size: .58rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .2rem; }
.prow-meta dd { font-size: .8rem; font-weight: 500; }

/* =========================================================================
   PÍXELES TRAMADOS — capas de canvas que dibuja Px (main.js)
   ========================================================================= */
:root { --edge: clamp(4.5rem, 13vh, 8rem); }   /* alto de los bordes que se deshacen */
.px-layer { position: absolute; pointer-events: none; image-rendering: pixelated; }
.hero-px, .path-px, .footer-px { inset: 0; width: 100%; height: 100%; }
.hero-px { z-index: 0; }
.menu-px { inset: 0; width: 100%; height: 100%; }
.menu > :not(.px-layer) { position: relative; }
.studio-top { position: relative; }
.studio-top > :not(.px-layer) { position: relative; z-index: 1; }
.studio-px { top: -14%; right: calc(var(--gx) * -1); width: calc(34% + var(--gx)); height: 128%; }
.path > :not(.px-layer), .footer > :not(.px-layer), .certs > :not(.px-layer), .projects > :not(.px-layer) { position: relative; }
/* bordes: la sección oscura vecina se deshace en píxeles */
.edge-px { left: 0; width: 100%; height: var(--edge); opacity: .15; }
.edge-top { top: 0; }
.edge-bottom { bottom: 0; }

/* =========================================================================
   ESTUDIOS — paneles tonales con el logo al centro
   ========================================================================= */
.certs { position: relative; padding: calc(clamp(5rem, 13vh, 9rem) + var(--edge) * .6) var(--gx) calc(clamp(4.5rem, 11vh, 7.5rem) + var(--edge) * .6); }
.cert-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.4rem 1.2rem; }
.cert { display: flex; flex-direction: column; align-items: flex-start; gap: .55rem; }
.cert-panel { position: relative; width: 100%; aspect-ratio: 4 / 3; margin-bottom: .9rem; display: grid; place-items: center; background: var(--night); overflow: hidden;
  clip-path: inset(0 0 100% 0); transition: clip-path 1.3s var(--ease-io) calc(var(--i) * 140ms); }
/* fondo de píxeles tramados siempre encendido, una forma por panel (ver main.js, Px) */
.cert-px { inset: 0; width: 100%; height: 100%; opacity: .25; }   /* muy tenue: el logo manda */
.cert-panel > :not(.cert-px) { position: relative; }
.cert-grid.in .cert-panel { clip-path: inset(0); }
/* el contenido llega un poco después que el panel, subiendo y apareciendo */
.cert-panel > :not(.cert-px) { opacity: 0; transform: translateY(1.2rem); transition: opacity .9s var(--ease), transform 1.2s var(--ease); transition-delay: calc(var(--i) * 140ms + .45s); }
.cert-grid.in .cert-panel > :not(.cert-px) { opacity: 1; transform: none; }
.cert-panel > .label { position: absolute; left: 1rem; top: 1rem; color: #9b9892; }
.cert-panel > .cert-year { position: absolute; right: 1rem; bottom: .55rem; font-family: var(--display); font-weight: 500; font-size: clamp(2.6rem, 5.4vw, 5rem); letter-spacing: -.035em; line-height: 1; color: var(--canvas); }
.cert-panel img { width: clamp(4.2rem, 7vw, 6.4rem); aspect-ratio: 1; object-fit: cover; box-shadow: 0 18px 36px -20px rgba(0, 0, 0, .8); }
.cert-panel img.is-badge { width: clamp(6rem, 10vw, 9rem); object-fit: contain; box-shadow: none; }
.cert h3 { font-family: var(--display); font-weight: 500; font-size: clamp(1.3rem, 2vw, 1.85rem); letter-spacing: -.015em; line-height: 1.1; }
.cert p { font-size: .88rem; color: #55524d; max-width: 30rem; margin-top: .3rem; }
.cert .btn { margin-top: .7rem; }
.cert .btn:hover { background: var(--ink); color: var(--canvas); }

/* =========================================================================
   TRAYECTORIA (oscuro)
   ========================================================================= */
.path { position: relative; background: var(--night); color: var(--canvas); padding: clamp(5rem, 13vh, 9rem) var(--gx) clamp(4rem, 10vh, 6rem); overflow: hidden; }
.jrows { border-bottom: 1px solid rgba(255, 255, 255, .3); }
.jrow { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) minmax(0, 1fr); gap: 1rem 2rem; align-items: start; border-top: 1px solid rgba(255, 255, 255, .3); padding: 2rem 0 2.2rem; color: #9b9892;
  opacity: 0; transform: translateX(22%); transition: opacity 1s var(--ease), transform 1.2s var(--ease), color .4s; transition-delay: calc(var(--i) * 90ms), calc(var(--i) * 90ms), 0s; }
.jrow.in { opacity: 1; transform: none; }
.jrow:hover { color: var(--canvas); }
.jrow small { font-size: .65rem; letter-spacing: .06em; padding-top: .7rem; }
.jrow h3 { font-family: var(--display); font-weight: 500; font-size: clamp(1.5rem, 2.6vw, 2.4rem); letter-spacing: -.015em; line-height: 1.1; }
.jrow h3 em { display: block; font-family: var(--body); font-style: normal; font-size: .62rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; margin-top: .6rem; opacity: .75; }
.jrow p { font-size: .82rem; max-width: 30rem; padding-top: .5rem; }

/* =========================================================================
   CONTACTO
   ========================================================================= */
.contact { position: relative; min-height: 100svh; display: grid; place-items: center; padding: 4.5rem var(--gx); overflow: hidden; background: var(--night); }
.contact-bg { position: absolute; inset: -12% 0; width: 100%; height: 124%; image-rendering: pixelated; transform: translateY(var(--py, 0)) scale(1.05); will-change: transform; }
.contact-card { position: relative; width: min(49rem, 100%); background: var(--night); color: var(--canvas); padding: clamp(1.4rem, 3.6vw, 3.2rem); }
.contact-card .label { color: #9b9892; }
.contact-title { font-family: var(--display); font-weight: 500; font-size: clamp(2.2rem, 5vw, 4.2rem); letter-spacing: -.015em; line-height: 1; margin: .7rem 0 .8rem; }
.door { display: inline-block; animation: door-spin 5s infinite; }
.door ~ .door { animation-delay: .45s; }
.contact-direct { font-size: .8rem; color: #9b9892; margin-bottom: 1.6rem; }
.contact-direct a { color: var(--canvas); border-bottom: 1px solid #55524d; margin-left: .4rem; transition: border-color .3s; }
.contact-direct a:hover { border-color: var(--accent); }
form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem 1.8rem; }
.field { display: flex; flex-direction: column; gap: .5rem; border-bottom: 1px solid #55524d; padding-bottom: .6rem; transition: border-color .3s; }
.field:focus-within { border-color: var(--canvas); }
.field-wide { grid-column: 1 / -1; }
.field input, .field textarea, .field select { font: inherit; font-size: .92rem; color: var(--canvas); background: none; border: 0; outline: 0; width: 100%; resize: none; appearance: none; -webkit-appearance: none; }
.field ::placeholder { color: #77746e; }
.select { position: relative; display: flex; align-items: center; }
.select select option { color: #000; }
.select svg { position: absolute; right: 0; pointer-events: none; }
.form-foot { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.note { font-size: .68rem; letter-spacing: .03em; color: #9b9892; }
.form-done { display: flex; flex-direction: column; align-items: flex-start; gap: .8rem; padding: 2rem 0; }
.form-done h3 { font-family: var(--display); font-weight: 500; font-size: 2rem; }

/* =========================================================================
   FOOTER
   ========================================================================= */
.footer { position: relative; background: var(--night); color: var(--canvas); padding: clamp(3rem, 9vh, 5.5rem) var(--gx) 1.6rem; overflow: hidden; }
.footer-word { overflow: hidden; line-height: .86; font-family: var(--body); font-weight: 600; letter-spacing: -.01em; white-space: nowrap; font-size: 10vw; padding-bottom: .04em; }
.footer-word { padding-right: .02em; }
.footer-word span { display: inline-block; transform: translateY(105%); transition: transform 1.4s var(--ease); }
.footer-word.in span { transform: none; }
.footer-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; flex-wrap: wrap; margin-top: clamp(2.4rem, 7vh, 4.5rem); }
/* logo junto a la frase: alto = las dos líneas del texto */
.footer-brand { display: flex; align-items: center; gap: clamp(.9rem, 1.6vw, 1.5rem); font-size: clamp(1.3rem, 2.3vw, 2.1rem); }
.footer-mark { height: 2.05em; }
.footer-tag { font-family: var(--display); font-weight: 500; font-size: clamp(1.3rem, 2.3vw, 2.1rem); line-height: 1.15; text-transform: uppercase; letter-spacing: -.01em; }
.footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: .9rem 1.6rem; font-size: .8rem; font-weight: 500; letter-spacing: .02em; padding-top: .4rem; }
.footer-links .ico { width: 1.05rem; height: 1.05rem; transition: color .3s; }
.footer-links .ico:hover { color: var(--accent); }
.footer-copy { font-size: .72rem; color: #9b9892; margin-top: clamp(2.5rem, 7vh, 4.5rem); }

/* =========================================================================
   DETALLE DE PROYECTO
   ========================================================================= */
.sheet { position: fixed; inset: 0; z-index: 150; background: var(--canvas); display: flex; flex-direction: column; clip-path: inset(100% 0 0 0); visibility: hidden; transition: clip-path .9s var(--ease-io), visibility 0s .9s; }
.sheet.open { clip-path: inset(0); visibility: visible; transition: clip-path .9s var(--ease-io); }
.sheet-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem var(--gx); border-bottom: 1px solid var(--rule); }
.sheet-bar .btn:hover { background: var(--ink); color: var(--canvas); }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--gx) 5rem; }
.sheet-title { font-family: var(--display); font-weight: 500; font-size: clamp(2.4rem, 6.4vw, 6rem); letter-spacing: -.025em; line-height: 1; padding: clamp(2.5rem, 8vh, 5rem) 0 1.6rem; }
.sheet-title .mask > span { transition-delay: .35s; }
.sheet-hero { position: relative; aspect-ratio: 16 / 9; background: var(--night); overflow: hidden; }
.sheet-hero img, .sheet-hero iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.sheet-cols { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: 2rem 4rem; padding: 2.4rem 0 3rem; }
.sheet-meta div { display: grid; grid-template-columns: 6rem 1fr; gap: 1rem; padding: .75rem 0; border-top: 1px solid var(--rule); align-items: baseline; }
.sheet-meta div:last-child { border-bottom: 1px solid var(--rule); }
.sheet-meta dt { font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sheet-meta dd { font-size: .88rem; font-weight: 500; }
.sheet-meta .credit { display: block; }
.sheet-meta .credit + .credit { margin-top: .55rem; }
.sheet-meta .credit small { display: block; font-size: .78rem; font-weight: 400; color: var(--muted); }
.sheet-desc { display: flex; flex-direction: column; gap: 1.5rem; align-items: flex-start; font-size: 1.05rem; line-height: 1.55; }
.sheet-desc .chips { max-width: none; }
.sheet-links { display: flex; flex-wrap: wrap; gap: .6rem; }
.sheet-links .btn:not(.btn-fill):hover { background: var(--ink); color: var(--canvas); }
.story { display: flex; flex-direction: column; gap: clamp(3.5rem, 8vw, 6.5rem); padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(3.5rem, 8vw, 6.5rem); border-top: 1px solid var(--rule); }
.story-step { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: 1.2rem 4rem; align-items: start; }
.story-step .label { display: block; margin-bottom: .7rem; }
.story-step h3 { font-family: var(--display); font-weight: 500; font-size: clamp(1.7rem, 3vw, 2.8rem); letter-spacing: -.02em; line-height: 1.05; }
.story-step p { font-size: 1.05rem; line-height: 1.55; padding-top: 1.3rem; max-width: 40rem; }
.story-step img { grid-column: 1 / -1; width: 100%; height: auto; margin-top: 1.4rem; background: #e4e3df; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.gallery img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3 / 2; }
.gallery.portrait { grid-template-columns: repeat(3, 1fr); }
.gallery.portrait img, .gallery img.tall { aspect-ratio: 2 / 3; }
.gallery.mixed { grid-template-columns: repeat(6, 1fr); }
.gallery.mixed img { grid-column: span 2; }
.gallery.contain img { object-fit: contain; background: #e4e3df; }
.gallery.cine img { aspect-ratio: 2.38 / 1; }
.gallery.odd img:last-child { grid-column: 1 / -1; aspect-ratio: 21 / 9; }

/* =========================================================================
   Animaciones
   ========================================================================= */
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes loader-letter-in { from { transform: translate3d(0, 110%, 0); } to { transform: none; } }
@keyframes loader-letter-out { from { transform: none; opacity: 1; } to { transform: translate3d(0, -60%, 0); opacity: 0; } }
/* rojo en trama → rojo sólido → negro en trama → negro sólido, a cortes duros */
@keyframes char-px {
  0%   { -webkit-text-fill-color: transparent; -webkit-background-clip: text; background-clip: text;
         background-image: repeating-conic-gradient(var(--accent) 0 25%, transparent 0 50%); background-size: 6px 6px; animation-timing-function: steps(1, end); }
  22%  { -webkit-text-fill-color: transparent; -webkit-background-clip: text; background-clip: text;
         background-image: repeating-conic-gradient(var(--accent) 0 75%, transparent 0 100%); background-size: 4px 4px; animation-timing-function: steps(1, end); }
  44%  { -webkit-text-fill-color: currentColor; color: var(--accent); background: none; animation-timing-function: steps(1, end); }
  66%  { -webkit-text-fill-color: transparent; -webkit-background-clip: text; background-clip: text;
         background-image: repeating-conic-gradient(var(--ink) 0 75%, transparent 0 100%); background-size: 4px 4px; animation-timing-function: steps(1, end); }
  to   { -webkit-text-fill-color: currentColor; color: var(--wave-lit); background: none; }
}
/* versión hover del pintado pixel: no toca `color`, así cada elemento vuelve a su color base (currentColor) */
@keyframes hw-px {
  0%   { -webkit-text-fill-color: transparent; -webkit-background-clip: text; background-clip: text;
         background-image: repeating-conic-gradient(var(--accent) 0 25%, transparent 0 50%); background-size: 4px 4px; animation-timing-function: steps(1, end); }
  25%  { -webkit-text-fill-color: transparent; -webkit-background-clip: text; background-clip: text;
         background-image: repeating-conic-gradient(var(--accent) 0 75%, transparent 0 100%); background-size: 3px 3px; animation-timing-function: steps(1, end); }
  50%  { -webkit-text-fill-color: var(--accent); background: none; animation-timing-function: steps(1, end); }
  75%  { -webkit-text-fill-color: transparent; -webkit-background-clip: text; background-clip: text;
         background-image: repeating-conic-gradient(var(--hw-base, currentColor) 0 75%, transparent 0 100%); background-size: 3px 3px; animation-timing-function: steps(1, end); }
  to   { -webkit-text-fill-color: var(--hw-base, currentColor); background: none; }
}
@keyframes door-spin { 0%, 78% { transform: rotateY(0); color: inherit; } 86% { color: var(--accent); } 94%, to { transform: rotateY(360deg); color: inherit; } }

/* =========================================================================
   Pantallas táctiles (sin hover): lo que dependía del mouse se muestra siempre
   ========================================================================= */
html { -webkit-tap-highlight-color: transparent; }
@media (hover: none) {
  .jrow { color: var(--canvas); }
  .jrow p, .jrow h3 em { opacity: .78; }
  .cert img { filter: none; }
  .marquee-track span { color: #55524d; }
  .chip, .chips li { padding: .7rem 1.05rem; font-size: .74rem; }
  .btn { padding: .8rem 1.05rem; font-size: .82rem; }
  .prow .btn { padding: .7rem .75rem; }
  .nav-burger { height: 2.75rem; width: 9.1rem; margin: -.6rem 0; }
  .field input, .field textarea, .field select { font-size: 1rem; }   /* 16px: evita el zoom automático de iOS al enfocar */
  .field { padding-bottom: .8rem; }
  .footer-links { gap: 1.1rem 1.6rem; font-size: .86rem; }
  .footer-links .ico { width: 1.4rem; height: 1.4rem; }
  .menu-foot { gap: 1rem 2.5rem; font-size: .82rem; }
  .contact-direct a { padding-block: .3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .studio { height: auto; } .studio-pin { position: static; height: auto; }
  [data-wave] [data-char] { color: var(--ink); }
}

/* =========================================================================
   Responsive
   ========================================================================= */
/* pantallas de escritorio bajas: el bloque fijo del "Sobre mí" se compacta para caber entero */
@media (min-width: 861px) and (max-height: 820px) {
  .studio-pin { gap: clamp(1rem, 3vh, 1.6rem); padding-top: 4.4rem; padding-bottom: 1.2rem; }
  .studio-float { width: min(12.5rem, 52%); }
  .studio-text { font-size: clamp(1.3rem, min(2.72vw, 4.6vh), 2.6rem); }
  .studio-strip { grid-template-columns: clamp(12.5rem, min(27vw, 44vh), 25rem) minmax(0, 1fr); }   /* la columna entera, no solo el video: si no, queda un hueco al lado */
}

@media (max-width: 860px) {
  .nav { padding-block: 1.1rem; }
  .hero { grid-template-columns: 1fr; padding-top: 4.4rem; gap: 1.6rem; min-height: 0; }
  .hero-copy { order: 2; padding-bottom: 2.2rem; }
  .hero-portrait { order: 1; aspect-ratio: 4 / 4.4; margin-bottom: 0; }
  .hero-px { display: none; }   /* en móvil el texto queda abajo, justo donde vive la esfera */

  .studio { height: auto; }
  .studio-pin { position: static; height: auto; padding-block: 4.5rem 3rem; }
  .studio-top { grid-template-columns: 1fr; }
  .studio-float { justify-self: start; width: 9.5rem; order: -1; margin-bottom: .6rem; }
  .studio-px { top: -2.5rem; right: auto; left: calc(var(--gx) * -1); width: 15rem; height: 17rem; }
  .studio-strip { grid-template-columns: 1fr; }
  .reel-thumb { width: min(100%, 30rem); }

  .prow { grid-template-columns: minmax(0, 1fr) auto; }
  .prow-img { grid-column: 1 / -1; grid-row: 3; }
  .prow.active .prow-img, .prows.all-open .prow-img { height: 12.5rem; margin-top: 1rem; }
  .prow-img img { height: 12.5rem; }
  .prow { padding: 1.5rem 0 1.7rem; }
  .prows.all-open .prow-meta { max-height: none; gap: .8rem 1.6rem; }
  .prow .btn { padding: .5rem .6rem; }
  .prow .btn b { display: none; }

  .cert-grid { grid-template-columns: 1fr; }
  .cert-panel { aspect-ratio: 16 / 9; }

  .jrow { grid-template-columns: 2.4rem minmax(0, 1fr); transform: translateX(10%); }
  .jrow p { grid-column: 2; padding-top: 0; }

  form { grid-template-columns: 1fr; }
  .footer-links { gap: .8rem 1.2rem; }
  .menu-foot span { margin-left: 0; }

  .sheet-cols { grid-template-columns: 1fr; }
  .story-step { grid-template-columns: 1fr; }
  .story-step p { padding-top: 0; }
  .story-step img { margin-top: .6rem; }
  .gallery, .gallery.portrait, .gallery.mixed { grid-template-columns: 1fr; }
  .gallery.mixed img { grid-column: auto; }
  .gallery.odd img:last-child { aspect-ratio: 3 / 2; }
}

/* =========================================================================
   Puntero — triángulo de píxeles + aureola tramada (canvas) que se desprende al moverse
   La aureola y sus partículas las dibuja initCursor (main.js); aquí va la punta y la etiqueta
   ========================================================================= */
html.has-cursor, html.has-cursor * { cursor: none !important; }
.cursor { --c: var(--accent); --txt: var(--canvas); --core: var(--canvas);
  position: fixed; inset: 0 auto auto 0; z-index: 300; pointer-events: none; opacity: 0; transition: opacity .25s var(--ease); }
.cursor.on { opacity: 1; }
.cursor-halo { position: fixed; inset: 0; width: 100vw; height: 100vh; }
.cursor-tip, .cursor-tag { position: fixed; top: 0; left: 0; will-change: transform; }
.cursor svg { display: block; overflow: visible; }

/* punta: la celda superior izquierda es el punto exacto del click; crece y se contrae a saltos, como un píxel */
.cursor-tip svg { width: 24px; height: 24px; transform-origin: 1px 1px; transition: transform .3s steps(3, end); }
.cursor-tip .px { fill: var(--c); transition: fill .3s; }
.cursor-tip .core { fill: var(--core); opacity: 0; transition: fill .3s; }
.cursor-tip .beam { fill: var(--c); opacity: 0; }

/* ---- contraste según el fondo ---- */
.cursor.on-red { --c: var(--canvas); --txt: var(--ink); --core: var(--accent); }

/* ---- hover: la punta crece y un núcleo de 4 píxeles parpadea adentro (la aureola se abre en el canvas) ---- */
.cursor.is-hover .cursor-tip svg { transform: scale(1.25); }
.cursor.is-hover .cursor-tip .core { opacity: 1; animation: px-blink 1.2s steps(1, end) infinite; }
@keyframes px-blink { 50% { opacity: .3; } }

/* ---- campos de texto: barra en I de píxeles ---- */
.cursor.is-text .cursor-tip .px, .cursor.is-text .cursor-tip .core { opacity: 0; animation: none; }
.cursor.is-text .cursor-tip .beam { opacity: 1; }
.cursor.is-text .cursor-tip svg { transform: none; }

/* ---- click: se contrae (la aureola estalla en el canvas) ---- */
.cursor.is-down .cursor-tip svg { transform: scale(.8); }
.cursor.is-hover.is-down .cursor-tip svg { transform: scale(1.05); }

/* ---- etiqueta (data-cursor): bloque sólido que se arma de izquierda a derecha, en pasos ---- */
.cursor-tag { margin: 28px 0 0 22px; }
.cursor-tag > span { display: flex; align-items: center; gap: .45em; padding: .8em 1.05em .75em; background: var(--c); color: var(--txt);
  font: 600 .74rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
  clip-path: inset(0 100% 0 0); transition: clip-path .32s steps(6, end), transform .2s, background-color .3s, color .3s; }
.cursor-tag svg { width: .9em; height: .9em; }
.cursor.has-label .cursor-tag > span { clip-path: inset(0); }
.cursor.is-down .cursor-tag > span { transform: scale(.94); }

/* sobre iframes (videos embebidos) el documento no recibe el ratón: se oculta */
.cursor.off { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .cursor.is-hover .cursor-tip .core { animation: none; }
}
