/* ===== FONTS (local) ===== */
@font-face {
  font-family: 'Goldman';
  src: url('fuentes/Goldman-Regular.woff2') format('woff2'), url('fuentes/Goldman-Regular.ttf') format('truetype');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Goldman';
  src: url('fuentes/Goldman-Bold.woff2') format('woff2'), url('fuentes/Goldman-Bold.ttf') format('truetype');
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: 'PressStart';
  src: url('fuentes/PressStart2P-Regular.woff2') format('woff2'), url('fuentes/PressStart2P-Regular.ttf') format('truetype');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Rajdhani';
  src: url('fuentes/Rajdhani-Light.woff2') format('woff2'), url('fuentes/Rajdhani-Light.ttf') format('truetype');
  font-weight: 300; font-display: swap;
}
@font-face {
  font-family: 'Rajdhani';
  src: url('fuentes/Rajdhani-SemiBold.woff2') format('woff2'), url('fuentes/Rajdhani-SemiBold.ttf') format('truetype');
  font-weight: 600; font-display: swap;
}
@font-face {
  font-family: 'Rajdhani';
  src: url('fuentes/Rajdhani-Bold.woff2') format('woff2'), url('fuentes/Rajdhani-Bold.ttf') format('truetype');
  font-weight: 700; font-display: swap;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Paleta INVERTIDA: el body es oscuro y el hero/about son claros (antes era al
   revés). --cream se mantiene claro porque el topbar y el bottombar (chrome)
   siguen siendo oscuros y lo usan para su texto. --on-band es el color de texto
   de las dos bandas claras (hero / about). */
:root {
  --bg:     #222222;
  --bg2:    #222222;
  --ink:    #f6f4ef;
  --muted:  #cccccc;
  --line:   #f6f4ef;
  --red:    #e63946;
  --red-rgb: 230, 57, 70;
  --cream:  #f6f4ef;
  --hero-bg:#ffffff;   /* antes crema #f6f4ef */
  --on-band:#222222;
  --radius: 14px;
  --transition: 0.3s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Rajdhani', system-ui, sans-serif;
  font-weight: 600;
  color: var(--ink);
  overflow-x: hidden;
  cursor: none;
  /* Fondo con más diseño: papel cuadriculado editorial */
  background-color: #000000;
}
/* La cuadrícula vive en un pseudo FIJO y se desplaza con transform (compositado
   por la GPU) en vez de animar background-position en el body: eso forzaba un
   repintado de toda la página en cada frame, de forma permanente y aunque nada
   más se moviera. El overscan (inset negativo) evita que el drift muestre borde. */
body::before {
  content: '';
  position: fixed;
  inset: -44px;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(246,244,239,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246,244,239,0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  animation: gridDrift 60s linear infinite;
  will-change: transform;
}
@keyframes gridDrift {
  from { transform: translate(0, 0); }
  to   { transform: translate(44px, 44px); }
}


/* ===== STREAK POR SECCIÓN =====
   Mismo lenguaje visual que el streak del hero (r5): una franja de luz
   iridiscente difuminada cruzando en diagonal. Va una por sección, dentro de
   ella (position: absolute sobre el section, que ya es relative + overflow
   hidden), así que hace scroll con el contenido y queda recortada por los
   límites de su sección. Blend SCREEN porque el body es oscuro; el about, que
   es banda clara, lo sobreescribe a multiply más abajo.
   Tres paletas (ss-a / ss-b / ss-c) que se alternan sección a sección. */
/* alto en vh (no en % de la sección): con % una sección alta como FAMA daba una
   banda de ~950px; en vh se mantiene una franja angosta sea cual sea el alto de
   la sección. */
.sec-streak {
  position: absolute;
  left: -25%;
  width: 150%;
  height: 18vh;
  top: 38%;
  border-radius: 50%;
  filter: blur(70px);
  mix-blend-mode: screen;
  z-index: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.ss-a {
  height: 17vh;
  background: linear-gradient(var(--gdir, 90deg),
    transparent 0%,
    rgba(56, 225, 255, 0.85) 26%,
    rgba(139, 92, 246, 0.9) 50%,
    rgba(var(--red-rgb), 0.75) 74%,
    transparent 100%);
  animation: ssDriftA 30s ease-in-out infinite alternate,
             ssFadeA  16s ease-in-out infinite alternate;
}
.ss-b {
  height: 20vh;
  background: linear-gradient(var(--gdir, 90deg),
    transparent 0%,
    rgba(var(--red-rgb), 0.8) 24%,
    rgba(255, 154, 61, 0.9) 48%,
    rgba(255, 225, 77, 0.7) 70%,
    transparent 100%);
  animation: ssDriftB 38s ease-in-out infinite alternate,
             ssFadeB  21s ease-in-out infinite alternate;
}
.ss-c {
  height: 16vh;
  background: linear-gradient(var(--gdir, 90deg),
    transparent 0%,
    rgba(139, 92, 246, 0.85) 28%,
    rgba(56, 225, 255, 0.9) 54%,
    rgba(74, 222, 128, 0.7) 76%,
    transparent 100%);
  animation: ssDriftC 34s ease-in-out infinite alternate,
             ssFadeC  18s ease-in-out infinite alternate;
}
/* cuarta paleta: rosa magenta → violeta → índigo. Más fría y rosada que las
   otras tres, para que la primera sección no repita ninguna. */
.ss-d {
  height: 18vh;
  background: linear-gradient(var(--gdir, 90deg),
    transparent 0%,
    rgba(255, 89, 200, 0.85) 25%,
    rgba(186, 104, 246, 0.9) 48%,
    rgba(99, 132, 246, 0.78) 72%,
    transparent 100%);
  animation: ssDriftB 27s ease-in-out infinite alternate,
             ssFadeA  19s ease-in-out infinite alternate;
}
/* Deriva lenta. El ángulo base sale de --ang, que cada sección define abajo, así
   que la misma variante de color puede cruzar en direcciones distintas según
   dónde esté. Los keyframes sólo añaden el delta de giro. */
@keyframes ssDriftA {
  from { transform: translate3d(-4%, -2%, 0) rotate(var(--ang, -9deg))              scaleX(1);    }
  to   { transform: translate3d( 5%,  3%, 0) rotate(calc(var(--ang, -9deg) - 3deg)) scaleX(1.08); }
}
@keyframes ssDriftB {
  from { transform: translate3d( 4%,  2%, 0) rotate(var(--ang, 7deg))              scaleX(1.05); }
  to   { transform: translate3d(-5%, -3%, 0) rotate(calc(var(--ang, 7deg) + 3deg)) scaleX(1);    }
}
@keyframes ssDriftC {
  from { transform: translate3d(-5%,  3%, 0) rotate(var(--ang, -6deg))              scaleX(1);   }
  to   { transform: translate3d( 6%, -2%, 0) rotate(calc(var(--ang, -6deg) - 3deg)) scaleX(1.1); }
}

/* ===== ORIENTACIÓN Y POSICIÓN POR SECCIÓN =====
   Tres familias de orientación para que el scroll no repita el mismo gesto:

     · HORIZONTAL  franja ancha y plana que cruza de lado a lado (ángulo ~0-5°)
     · DIAGONAL    ancha pero muy inclinada (25-35°)
     · VERTICAL    proporciones invertidas: alta y angosta, como un haz de luz
                   que baja. Necesita --gdir:180deg para que el degradado corra
                   por su eje largo (si no, degradaría a lo ancho, que aquí son
                   sólo unos px).

   Se alternan familia a familia y además cambia el lado por el que entra. */

/* FAMA — diagonal ascendente gruesa, cruzando por la mitad baja */
#fama .sec-streak {
  top: 46%; left: -20%; width: 146%; height: 25vh;
  --ang: 28deg;
  filter: blur(88px);
}
/* FREELANCE — horizontal ancha, sube al tercio superior y entra por la izquierda */
#freelance .sec-streak {
  top: 17%; left: -34%; width: 166%; height: 18vh;
  --ang: -7deg;
  filter: blur(72px);   /* blur acompañando al grosor */
}
/* BAMBUCO — ya no es vertical: pasa a diagonal ascendente marcada, con las
   proporciones normales (ancha y de poco grosor) y el degradado por su eje
   largo, así que se quita el --gdir de 180deg */
#bambuco .sec-streak {
  top: 28%; left: -28%; width: 158%; height: 16vh;
  --ang: 34deg;
  filter: blur(62px);
}
/* CONFIAR — diagonal descendente media, en el tercio superior */
#confiar .sec-streak {
  top: 24%; left: -32%; width: 164%; height: 13vh;
  --ang: -19deg;
  filter: blur(58px);
}
/* VOLUNTEERING — vertical MUY gruesa (la columna más masiva del recorrido),
   ahora sobre el tercio derecho en vez del izquierdo */
#volunteering .sec-streak {
  top: -26%; left: 64%; width: 31vh; height: 154%;
  --ang: -5deg; --gdir: 180deg;
  filter: blur(108px);
}
/* ABOUT — diagonal media, sentido contrario al de bambuco. Además es la única
   banda CLARA: screen la borraría, así que oscurece (multiply) y con menos
   fuerza. La opacidad va por keyframes propios (ssFadeAbout) porque una regla
   estática `opacity` la pisaría la animación de fade de la variante. */
#about .sec-streak {
  top: 58%; left: -14%; width: 130%; height: 20vh;
  --ang: 3deg;
  filter: blur(76px);
  mix-blend-mode: multiply;
  animation-name: ssDriftA, ssFadeAbout;
}

@keyframes ssFadeA { from { opacity: 1;    } to { opacity: 0.7;  } }
@keyframes ssFadeB { from { opacity: 0.75; } to { opacity: 1;    } }
@keyframes ssFadeC { from { opacity: 0.95; } to { opacity: 0.68; } }
@keyframes ssFadeAbout { from { opacity: 0.42; } to { opacity: 0.26; } }

@media (max-width: 900px) { .sec-streak { display: none; } }

/* ===== CÓDIGO DECORATIVO DE FONDO =====
   Columnas de binario y fragmentos reales de los lenguajes del CV (PHP, JS,
   CSS, SQL, Mustache…) cayendo muy despacio por detrás de todo. Va en el mismo
   plano fijo que el mesh, con alpha bajísimo: se percibe como textura, no como
   texto legible que compita con el contenido. Poblado por script.js. */
#code-rain {
  position: fixed; inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  /* monoespaciada de sistema (no la pixel font): a este tamaño se lee como
     código real y ocupa menos peso visual que 'PressStart' */
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  white-space: pre;
  /* SIN mix-blend-mode a propósito: era una tercera capa fija a pantalla
     completa con blending, y el compositor tenía que re-mezclarla en cada
     repintado (se notaba como lentitud al usar los sliders). Con texto claro a
     alpha bajo sobre fondo oscuro el resultado es visualmente idéntico a
     screen, pero sin coste de composición. */
}
.code-col {
  position: absolute;
  top: 0;
  color: rgba(246, 244, 239, 0.0833);
  will-change: transform;
  animation: codeFall linear infinite;
}
/* una de cada tres columnas en rojo tenue, sólo como acento de color */
.code-col.accent { color: rgba(var(--red-rgb), 0.098); }
@keyframes codeFall {
  from { transform: translateY(-55%); }
  to   { transform: translateY(0%); }
}
/* sobre el hero y el about (ahora bandas CLARAS) screen borraría el texto:
   ahí se invierte a texto oscuro con multiply. La clase la pone script.js
   cuando una de esas dos bandas domina el viewport. */
body.on-dark-band .code-col { color: rgba(17, 17, 17, 0.1083); }
body.on-dark-band .code-col.accent { color: rgba(201, 55, 66, 0.1401); }

@media (max-width: 900px) { #code-rain { display: none; } }

/* ===== FONDO DEL HERO — STREAK IRIDISCENTE (referencia r5) =====
   Un solo elemento gráfico dramático sobre negro: una franja de gas caliente
   que cruza el hero en diagonal, con dispersión cromática hacia los bordes
   (magenta / rojo / naranja / amarillo). Un segundo streak menor cruza por
   detrás en dirección contraria y respira más despacio → hay siempre algo
   moviéndose sin invadir la composición. */
.hero-streak {
  position: absolute; inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
/* RENDIMIENTO: antes cada franja era un elemento enorme con filter: blur(60px)
   y además se animaban sus colores (@property) → el navegador re-pintaba y
   re-difuminaba capas gigantes en CADA frame, de forma permanente; con la
   pestaña abierta un rato el equipo se calentaba y todo iba lento.
   Ahora:
   · el difuminado lo hace una máscara radial (se rasteriza una vez, sin filter)
   · el color cambia con un fundido cruzado entre dos capas ya pintadas
     (::before / ::after, sólo opacity)
   · el movimiento es sólo transform
   → todo lo animado corre en el compositor, sin repintar. */
.hero-streak span {
  position: absolute;
  will-change: transform;
}
.hero-streak span::before,
.hero-streak span::after {
  content: '';
  position: absolute; inset: 0;
  -webkit-mask-image: radial-gradient(closest-side, #000 0%, rgba(0,0,0,0.9) 35%, rgba(0,0,0,0.45) 65%, rgba(0,0,0,0.12) 85%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 0%, rgba(0,0,0,0.9) 35%, rgba(0,0,0,0.45) 65%, rgba(0,0,0,0.12) 85%, transparent 100%);
  will-change: opacity;
  animation: var(--tint-dur, 14s) ease-in-out var(--tint-delay, 0s) infinite alternate;
}
/* fundido cruzado: una paleta se va mientras la otra entra (la intensidad
   total se mantiene prácticamente constante; sólo cambia el color) */
.hero-streak span::before { background: var(--grad-a); animation-name: streakTintOut; }
.hero-streak span::after  { background: var(--grad-b); animation-name: streakTintIn; opacity: 0; }
@keyframes streakTintOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes streakTintIn  { from { opacity: 0; } to { opacity: 1; } }

/* ---- franja principal: diagonal, paleta original ↔ fría ---- */
.hero-streak span:nth-child(1) {
  width: 160%; height: 48vh;
  left: -30%; top: 34%;
  transform: rotate(-16deg);
  --grad-a: linear-gradient(90deg, transparent 0%,
    rgba(139, 92, 246, 0.16) 18%, rgba(230, 57, 70, 0.46) 38%,
    rgba(255, 154, 61, 0.5) 52%, rgba(255, 225, 77, 0.3) 66%,
    rgba(230, 57, 70, 0.16) 82%, transparent 100%);
  --grad-b: linear-gradient(90deg, transparent 0%,
    rgba(56, 225, 255, 0.16) 18%, rgba(139, 92, 246, 0.46) 38%,
    rgba(255, 94, 142, 0.5) 52%, rgba(255, 154, 61, 0.3) 66%,
    rgba(139, 92, 246, 0.16) 82%, transparent 100%);
  --tint-dur: 14s;
  animation: streakPulse 14s ease-in-out infinite alternate,
             streakSway 22s ease-in-out infinite alternate;
}
/* ---- franja secundaria: diagonal contraria ---- */
.hero-streak span:nth-child(2) {
  width: 140%; height: 40vh;
  left: -20%; top: 12%;
  transform: rotate(12deg);
  opacity: 0.72;
  --grad-a: linear-gradient(90deg, transparent 0%,
    rgba(56, 225, 255, 0.34) 28%, rgba(139, 92, 246, 0.36) 52%,
    rgba(230, 57, 70, 0.3) 76%, transparent 100%);
  --grad-b: linear-gradient(90deg, transparent 0%,
    rgba(74, 222, 128, 0.3) 28%, rgba(56, 225, 255, 0.36) 52%,
    rgba(255, 94, 142, 0.32) 76%, transparent 100%);
  --tint-dur: 17s;
  animation: streakPulse2 17s ease-in-out infinite alternate,
             streakSway 28s ease-in-out infinite alternate-reverse;
}

/* ---- franjas que ORBITAN por los bordes (3, 4, 5) ----
   Centradas en el contenedor y desplazadas con translate en vw/vh hasta los
   bordes: recorren el perímetro (arriba → derecha → abajo → izquierda) sin
   pasar por el centro, y en el camino cambian de proporción (scaleX/scaleY). */
.hero-streak span:nth-child(n+3) {
  width: 64vw; height: 34vh;
  left: calc(50% - 32vw); top: calc(50% - 17vh);
  animation: streakOrbit 56s ease-in-out infinite;
}
.hero-streak span:nth-child(3) {
  --grad-a: linear-gradient(90deg, transparent, rgba(255, 94, 142, 0.34) 35%, rgba(139, 92, 246, 0.3) 65%, transparent);
  --grad-b: linear-gradient(90deg, transparent, rgba(255, 154, 61, 0.34) 35%, rgba(230, 57, 70, 0.3) 65%, transparent);
  --tint-dur: 14s;
  animation-delay: -6s;
}
.hero-streak span:nth-child(4) {
  --grad-a: linear-gradient(90deg, transparent, rgba(56, 225, 255, 0.32) 35%, rgba(74, 222, 128, 0.26) 65%, transparent);
  --grad-b: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.32) 35%, rgba(255, 94, 142, 0.28) 65%, transparent);
  --tint-dur: 17s; --tint-delay: -5s;
  animation-duration: 68s;
  animation-delay: -30s;
  animation-direction: reverse;
}
.hero-streak span:nth-child(5) {
  --grad-a: linear-gradient(90deg, transparent, rgba(255, 225, 77, 0.3) 35%, rgba(255, 154, 61, 0.32) 65%, transparent);
  --grad-b: linear-gradient(90deg, transparent, rgba(230, 57, 70, 0.3) 35%, rgba(255, 94, 142, 0.3) 65%, transparent);
  --tint-dur: 20s; --tint-delay: -9s;
  animation-duration: 80s;
  animation-delay: -52s;
}

/* deriva SUTIL (menos recorrido que antes) */
@keyframes streakPulse {
  0%   { transform: translate3d(-5%, -3%, 0) rotate(-18deg) scale(0.96, 0.94); }
  33%  { transform: translate3d( 3%,  2%, 0) rotate(-14deg) scale(1.06, 1.08); }
  66%  { transform: translate3d(-2%,  4%, 0) rotate(-19deg) scale(1.02, 0.92); }
  100% { transform: translate3d( 4%,  0%, 0) rotate(-15deg) scale(1.08, 1.04); }
}
@keyframes streakPulse2 {
  0%   { transform: translate3d( 4%,  2%, 0) rotate(13deg) scale(1, 1); }
  40%  { transform: translate3d(-3%,  5%, 0) rotate(9deg)  scale(1.1, 1.08); }
  100% { transform: translate3d(-4%, -3%, 0) rotate(15deg) scale(1.05, 0.92); }
}
/* giro lento de vaivén (antes vuelta completa), compuesto con la deriva */
@keyframes streakSway {
  from { rotate: -14deg; }
  to   { rotate: 14deg; }
}
@keyframes streakOrbit {
  0%   { transform: translate3d(-34vw, -38vh, 0) rotate(-6deg) scale(1.1, 0.75); }
  25%  { transform: translate3d( 34vw, -38vh, 0) rotate(7deg)  scale(1.35, 0.6); }
  50%  { transform: translate3d( 40vw,  36vh, 0) rotate(-8deg) scale(0.75, 1.15); }
  75%  { transform: translate3d(-38vw,  38vh, 0) rotate(9deg)  scale(1.25, 0.85); }
  100% { transform: translate3d(-34vw, -38vh, 0) rotate(-6deg) scale(1.1, 0.75); }
}

/* opacidad FIJA del conjunto (no se anima) */
#hero  .hero-streak { opacity: 0.7; }
#about .hero-streak { opacity: 0.6; }
.anim-off .hero-streak span,
.anim-off .hero-streak span::before,
.anim-off .hero-streak span::after { animation-play-state: paused; }

/* ===== EFECTO AGUA (ripple) =====
   Canvas fijo de baja resolución (240×135) escalado a viewport. La simulación 2D
   de olas vive en script.js; aquí sólo posiciona el canvas y elige el blend con el
   fondo. mix-blend-mode: overlay hace que las crestas iluminen y los valles
   oscurezcan sobre lo que hay debajo, así el efecto es visible tanto sobre el
   hero oscuro como sobre el crema del body. */
#ripple {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  mix-blend-mode: overlay;
  /* z-index alto para pintarse ENCIMA del hero opaco (antes no se veía dentro
     del hero porque el negro sólido lo tapaba). Va por debajo del cursor
     (z:9999), topbar y modales, así que no interfiere con la UI. */
  z-index: 50;
}
/* con modales abiertos el ripple no aporta */
/* con un modal abierto, las capas animadas de fondo se APAGAN por completo
   (display:none, no opacity:0 que las dejaba en el compositor) → el zoom abre y
   cierra sin arrastrar el repintado de todo el fondo. */
body.zoom-open #ripple,
body.lb-open  #ripple,
body.zoom-open #code-rain,
body.lb-open  #code-rain { display: none; }
/* En pantallas pequeñas se omite el canvas para reducir el coste gráfico.
   No se consulta `hover`: algunos equipos híbridos reportan que no existe
   incluso cuando hay un mouse conectado. */
@media (max-width: 900px) { #ripple { display: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  #ripple, #code-rain { display: none; }
}

h1, h2, h3, h4 { font-family: 'Goldman', system-ui, sans-serif; font-weight: 700; }

a { text-decoration: none; color: inherit; cursor: none; }
button { font-family: inherit; cursor: none; }
img, video { max-width: 100%; display: block; }

.red { color: var(--red); }

/* Microtype label — ahora en pixel font */
.micro {
  font-family: 'PressStart', monospace;
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.7;
  text-transform: uppercase;
  color: var(--ink);
}

/* Pixel font */
.px {
  font-family: 'PressStart', monospace;
  text-transform: uppercase;
  line-height: 1.5;
}

.rule { border-top: 2px dashed rgba(246,244,239,0.46); }

/* selección de texto */
::selection { background: var(--red); color: #fff; }
::-moz-selection { background: var(--red); color: #fff; }

/* ===== CUSTOM CURSOR ===== */
#cursor {
  width: 42px; height: 42px;
  background: url('img/cursor2.png') center/contain no-repeat;
  position: fixed; top: 0; left: 0; z-index: 9999;
  pointer-events: none;
  /* corrección de hotspot: 10px abajo y 10px a la derecha */
  transform: translate(calc(-50% + 10px), calc(-50% + 10px));
  transition: transform 0.1s ease;
  filter: drop-shadow(0 2px 5px rgba(17,17,17,0.35));
}
/* glitch del cursor: copias clipeadas de la misma imagen */
#cursor::before,
#cursor::after {
  content: '';
  position: absolute; inset: 0;
  background: inherit;
  opacity: 0;
  pointer-events: none;
}
#cursor::before { filter: hue-rotate(180deg); animation: glitchA 3.2s infinite; }
#cursor::after  { filter: hue-rotate(-60deg) saturate(3); animation: glitchB 3.2s infinite; }

/* en enlaces y botones cambia a cursor1 (clase puesta por JS, sin :has) */
body.cur-link #cursor {
  background-image: url('img/cursor1.png');
  transform: translate(calc(-50% + 10px), calc(-50% + 10px)) scale(1.3);
}
/* lupa sobre media ampliable (zoomin); zoomout en el modal; más pequeña que el cursor */
body.mag-in #cursor,
body.zoom-open #cursor,
body.lb-open #cursor {
  width: 26px; height: 26px;
}
body.mag-in #cursor { background-image: url('img/zoomin.png'); }
body.zoom-open #cursor,
body.lb-open #cursor { background-image: url('img/zoomout.png'); }
/* la LUPA se auto-invierte según el fondo real (mix-blend difference + icono blanco);
   sensible al pixel y sin canvas → funciona también abriendo el archivo (file://) */
body.mag-in #cursor,
body.zoom-open:not(.zoom-ctrl) #cursor,
body.lb-open:not(.zoom-ctrl) #cursor {
  mix-blend-mode: difference;
  filter: invert(1);
}
/* sobre las flechas/cerrar del zoom → cursor normal (cursor2), tamaño normal, sin blend */
body.zoom-open.zoom-ctrl #cursor,
body.lb-open.zoom-ctrl #cursor {
  background-image: url('img/cursor2.png');
  width: 42px; height: 42px;
  mix-blend-mode: normal;
  filter: drop-shadow(0 2px 5px rgba(17,17,17,0.35));
}
/* cursor invertido cuando detecta un fondo oscuro bajo el puntero */
#cursor.on-dark {
  /* glow blanco suave alrededor del puntero sobre fondos oscuros */
  filter: invert(1) drop-shadow(0 0 3px rgba(255,255,255,0.75)) drop-shadow(0 0 9px rgba(255,255,255,0.35));
}
/* durante el scroll desactivamos el mix-blend del cursor/estelas: un elemento con
   mix-blend desactiva el scroll por GPU del contenedor de abajo (slider lento).
   El cursor está quieto al hacer scroll, así que no se nota. */
body.scrolling #cursor {
  mix-blend-mode: normal;
  filter: drop-shadow(0 2px 5px rgba(17,17,17,0.35));
}
body.scrolling .cursor-ghost { mix-blend-mode: normal; }

/* Ghosting más visible con cursor1 */
.cursor-ghost {
  width: 40px; height: 40px;
  background: url('img/cursor1.png') center/contain no-repeat;
  position: fixed; z-index: 9997;
  pointer-events: none;
  transform: translate(calc(-50% + 10px), calc(-50% + 10px));
  animation: ghostFade 0.6s ease-out forwards;
  filter: drop-shadow(0 0 4px rgba(var(--red-rgb), 0.4));
}
.cursor-ghost.on-dark { filter: invert(1) drop-shadow(0 0 4px rgba(255,255,255,0.4)); }
/* estelas de lupa: misma imagen y más pequeñas; estela más corta (menos intensa)
   pero cada copia un poco más opaca */
.cursor-ghost.gz-in,
.cursor-ghost.gz-out { width: 24px; height: 24px; mix-blend-mode: difference; filter: invert(1); animation: ghostFadeZoom 0.4s ease-out forwards; }
.cursor-ghost.gz-in  { background-image: url('img/zoomin.png'); }
.cursor-ghost.gz-out { background-image: url('img/zoomout.png'); }
@keyframes ghostFadeZoom {
  from { opacity: 0.55; }
  to   { opacity: 0; transform: translate(calc(-50% + 10px), calc(-50% + 10px)) scale(0.7); }
}
@keyframes ghostFade {
  from { opacity: 0.38; }
  to   { opacity: 0; transform: translate(calc(-50% + 10px), calc(-50% + 10px)) scale(0.7); }
}

/* ===== GRADIENT ORBS ===== */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
}
.orb-a {
  width: 520px; height: 520px;
  top: 6%; right: -120px;
  background: conic-gradient(from 120deg, #ff9a3d, #ff5e8e, #8b5cf6, #38e1ff, #4ade80, #ff9a3d);
  opacity: 0.85;
}
.orb-b {
  width: 260px; height: 260px;
  bottom: 18%; left: -60px;
  background: radial-gradient(circle at 35% 35%, #38e1ff, #8b5cf6 70%);
  opacity: 0.5;
}
.orb-c {
  width: 320px; height: 320px;
  top: -60px; left: -60px;
  background: conic-gradient(from 40deg, #4ade80, #38e1ff, #8b5cf6, #4ade80);
  opacity: 0.55;
}
.orb-d {
  width: 420px; height: 420px;
  top: 4%; right: -160px;
  background: radial-gradient(circle at 40% 40%, #ff9a3d, #ff5e8e 60%, transparent 75%);
  opacity: 0.5;
}
.orb-d2 {
  width: 380px; height: 380px;
  top: 12%; left: -160px;
  background: radial-gradient(circle at 60% 40%, #38e1ff, #8b5cf6 65%, transparent 80%);
  opacity: 0.45;
}
.orb-e {
  width: 460px; height: 460px;
  top: 60%; left: -2%;
  background: conic-gradient(from 200deg, #8b5cf6, #ff5e8e, #ff9a3d, #38e1ff, #8b5cf6);
  opacity: 0.6;
}

/* ===== DECORACIONES ===== */
.deco-ring {
  position: absolute;
  width: 340px; height: 340px;
  border: 2px dashed rgba(246,244,239,0.42);
  border-radius: 50%;
  right: 8%; top: 12%;
  z-index: 0; pointer-events: none;
  animation: spin 50s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.deco-plus {
  position: absolute;
  font-family: 'PressStart', monospace;
  font-size: 15px;
  color: var(--red);
  opacity: 0.85;
  -webkit-text-stroke: 0.7px currentColor; /* + más gruesos */
  z-index: 0; pointer-events: none;
  animation: floatRot 9s ease-in-out infinite;
}
.dp1 { top: 18%; left: 6%; }
.dp2 { bottom: 28%; right: 22%; font-size: 10px; color: var(--ink); opacity: 0.55; animation-duration: 11s; animation-direction: reverse; }
.dp3 { top: 38%; right: 6%; font-size: 18px; animation-duration: 7s; }
.dp4 { bottom: 10%; left: 4%; }
.dp5 { top: 16%; right: 10%; animation-duration: 8s; animation-direction: reverse; }
.dp6 { top: 42%; right: 4%; font-size: 11px; color: var(--ink); opacity: 0.55; animation-duration: 12s; }
.dp7 { top: 12%; left: 4%; font-size: 16px; animation-duration: 7.5s; }
.dp8 { bottom: 18%; right: 5%; font-size: 11px; color: var(--ink); opacity: 0.55; animation-duration: 10.5s; animation-direction: reverse; }
.dp9 { bottom: 12%; right: 8%; animation-duration: 8.5s; }
.dp10 { bottom: 30%; left: 5%; font-size: 11px; color: var(--ink); opacity: 0.55; animation-duration: 11.5s; }
.dp11 { top: 14%; right: 7%; font-size: 16px; animation-duration: 8s; }
.dp12 { bottom: 16%; left: 5%; font-size: 11px; color: var(--ink); opacity: 0.55; animation-duration: 10s; animation-direction: reverse; }

/* parches de puntos — claros: el body es oscuro (el hero y el about, que son
   bandas claras, los sobreescriben a oscuro más abajo) */
.deco-dots {
  position: absolute;
  width: 230px; height: 150px;
  background-image: radial-gradient(rgba(246,244,239,0.42) 1.7px, transparent 1.7px);
  background-size: 15px 15px;
  z-index: 0; pointer-events: none;
  animation: dotsDrift 7s ease-in-out infinite alternate;
}
.dd0 { bottom: 12%; right: 4%; width: 200px; height: 130px; }
.dd1 { top: 8%; left: 3%; }
.dd2 { top: 5%; right: 4%; animation-duration: 9s; }
.dd3 { bottom: 8%; left: 4%; width: 170px; height: 110px; animation-duration: 8s; }
.dd4 { top: 10%; left: 8%; width: 170px; height: 110px; }
.dd5 { bottom: 10%; right: 3%; width: 190px; height: 120px; animation-duration: 9.5s; }

/* anillos pequeños */
.deco-ring-sm {
  position: absolute;
  width: 150px; height: 150px;
  border: 2px dashed rgba(var(--red-rgb), 0.55);
  border-radius: 50%;
  z-index: 0; pointer-events: none;
  animation: spin 32s linear infinite reverse;
}
.dr1 { bottom: 6%; right: 6%; }
.dr2 { bottom: 40%; left: -50px; }
.dr3 { bottom: 12%; left: 12%; width: 110px; height: 110px; }
.dr4 { top: 20%; left: -40px; width: 120px; height: 120px; animation-duration: 28s; }

/* palabras gigantes delineadas de fondo — +50% visibles */
.deco-word {
  position: absolute;
  font-family: 'Goldman', sans-serif;
  font-weight: 700;
  font-size: clamp(6rem, 15vw, 12rem);
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  color: transparent;
  /* claro: es el texto gigante de fondo sobre el body oscuro */
  -webkit-text-stroke: 1.8px rgba(246,244,239,0.17);
  z-index: 0; pointer-events: none;
}
.dw1 { top: 34%; right: -2rem; transform: rotate(90deg); transform-origin: top right; }
.dw2 { top: 2rem; right: -1.5rem; animation: wordDrift 16s ease-in-out infinite alternate; }
.dw3 { bottom: 1.5rem; right: -2rem; animation: wordDrift 19s ease-in-out infinite alternate; }
.dw4 { bottom: 2rem; left: -2rem; animation: wordDrift 22s ease-in-out infinite alternate; }

/* formas geométricas flotantes */
.deco-shape {
  position: absolute;
  z-index: 0; pointer-events: none;
  opacity: 0.62;
  animation: floatY 10s ease-in-out infinite;
}
.ds-sq {
  width: 46px; height: 46px;
  border: 2px solid rgba(246,244,239,0.35);
}
.ds-ci {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid rgba(var(--red-rgb), 0.55);
}
.ds-tri {
  width: 0; height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-bottom: 28px solid rgba(56,225,255,0.35);
}
.s1 { top: 30%; left: 12%; animation-duration: 11s; }
.s2 { bottom: 24%; left: 8%; animation-duration: 9s; animation-direction: reverse; }
.s3 { top: 24%; right: 16%; animation-duration: 13s; }
.s4 { top: 32%; right: 10%; animation-duration: 12s; animation-direction: reverse; }

/* ===== KEYFRAMES DECO ===== */
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-18px); }
}
@keyframes floatRot {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-12px) rotate(45deg); }
}
@keyframes dotsDrift {
  from { transform: translateY(0); }
  to   { transform: translateY(14px); }
}
@keyframes wordDrift {
  from { transform: translateX(0); }
  to   { transform: translateX(-28px); }
}

/* ===== TOP BAR (dark) ===== */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; gap: 1.8rem;
  padding: 0.55rem 1.6rem;
  background: #111;
  /* borde sutil, no var(--line): al invertir la paleta --line pasó a claro y
     dejaba una línea blanca sobre la barra oscura */
  border-bottom: 1px solid rgba(246,244,239,0.1);
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}
/* Download CV: icono + texto en desktop, solo icono en móvil */
.btn-light { display: flex; align-items: center; gap: 8px; }
.btn-light .cv-icon { display: inline-block; width: 18px; height: 18px; object-fit: contain; transition: filter var(--transition); }
.btn-light:hover .cv-icon { filter: none; } /* la flecha roja se mantiene al hover */
.nav-logo { display: flex; align-items: center; gap: 0.8rem; }
.nav-logo img {
  width: 44px; height: 44px; object-fit: contain;
  transition: transform var(--transition);
}
.nav-logo:hover img { transform: rotate(-8deg) scale(1.08); }

.brand { display: flex; flex-direction: column; gap: 3px; min-width: 120px; margin-right: 10px; }
.brand strong {
  font-family: 'Goldman', sans-serif;
  font-size: 1.1rem;
  color: var(--cream);
  letter-spacing: 0.04em;
  line-height: 1;
}
.side-roles {
  font-family: 'Goldman', system-ui, sans-serif;
  font-size: 10px;
  font-weight: lighter;
  color: #ffffffa8;
  text-transform: uppercase;
}

#topbar ul {
  list-style: none;
  display: flex; gap: 1.6rem;
  margin: 0 auto;
}
#topbar ul a {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.95rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(246,244,239,0.6);
  display: flex; align-items: baseline; gap: 0.5rem;
  transition: color var(--transition), transform var(--transition);
}
#topbar ul a .micro { color: var(--red); font-size: 7px; }
#topbar ul a:hover { color: var(--cream); transform: translateY(-2px); }
#topbar ul a.active { color: var(--cream); }
#topbar ul a.active::after { content: '●'; color: var(--red); font-size: 0.5rem; margin-left: 0.4rem; }

/* ===== BOTTOM CONTACT BAR (dark) ===== */
#bottombar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-around;
  gap: 24px; flex-wrap: wrap;
  padding: 0.7rem 1rem;
  /* background-color SÓLIDO: el detector del cursor (effectiveBg lee backgroundColor)
     necesita ver oscuro el bottombar para invertir el cursor. El gradiente plano
     (idéntico a #111) va como background-image para interpolar suave hacia/desde
     el hover (color sólido ↔ gradiente no son interpolables → parpadeaba). */
  background-color: #111;
  background-image: linear-gradient(178deg, #111 0%, #111 82%);
  border-top: 1px solid rgba(246,244,239,0.1);
  box-shadow: 0 -12px 40px rgba(0,0,0,0.45);
  height: 56px;
  overflow: hidden;
  transition: height 0.55s cubic-bezier(.4,0,.2,1), gap 0.5s ease, padding 0.5s ease,
              background-image 0.4s ease, box-shadow 0.4s ease;
}
/* hover sobre la barra (SOLO cerrada): degradado violáceo + halo blanco.
   Con la barra abierta no se aplica el hover. */
#bottombar:not(.open):hover {
  background-image: linear-gradient(178deg, rgba(17,17,17,1) 0%, rgb(43 39 50) 82%);
  box-shadow: 0 -22px 60px rgba(0,0,0,0.45), 0 0 82px rgba(255,255,255,0.55);
}
/* abierta: la clase .open la dispara el JS (mouse a 100px, final de pág. o inactividad) */
#bottombar.open {
  height: 16vh;
  gap: 0px !important;
  padding: 0rem 2rem 0rem;
  align-items: flex-end;
  justify-content: space-around;
}
/* al estar al final del sitio no se muestra el botón de cerrar */
#bottombar.at-bottom .bb-toggle { display: none; }

#bottombar a {
  position: relative;
  font-family: 'Goldman', system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  color: #ffffffb5;
  line-height: initial;
  font-weight: 500;
  z-index: 2;
  text-decoration: none;
  transition: color var(--transition), font-size 0.5s ease, transform var(--transition);
  display: flex; align-items: center; gap: 0px;
}
#bottombar a img {
  width: 30px; height: 30px; object-fit: contain;
  transition: width 0.5s ease, height 0.5s ease;
}
/* hover: subrayado blanco animado */
#bottombar a::after {
  content: ''; position: absolute; left: 0; bottom: -3px;
  width: 100%; height: 2px; background: #fff;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s ease;
}
#bottombar a:hover { color: #fff; transform: translateY(-4px); }
#bottombar a:hover::after { transform: scaleX(1); }

/* contenido cuando está abierta — solo pantallas > 1103px */
@media (min-width: 1104px) {
  #bottombar.open a { font-size: 15px; padding: 33px 0%; margin-top: -29px; }
  #bottombar.open a:last-child { padding-left: 30px; }
}

/* orb que aparece detrás de cada opción al hover */
#bottombar a::before {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 180px; height: 180px; border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.2);
  background: radial-gradient(circle, rgb(255 255 255 / 55%), transparent 70%);
  filter: blur(22px);
  opacity: 0; z-index: -1; pointer-events: none;
  transition: transform 0.45s ease, opacity 0.45s ease;
}
#bottombar a:hover::before { transform: translate(-50%, -50%) scale(1); opacity: 1; }

/* botón de cerrar (antes el "+"): 45°, círculo blanco tipo botón */
.bb-toggle {
  position: absolute; top: 14px; right: 18px; z-index: 5;
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid #fff;
  background: #ffffff00; color: #fff;
  font-family: 'PressStart', monospace; font-size: 12px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(45deg);
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease, background 0.2s ease, color 0.2s ease;
}
#bottombar.open .bb-toggle { opacity: 1; pointer-events: auto; }
.bb-toggle:hover { background: var(--red); color: #fff; border-color: transparent; transform: rotate(135deg); }

/* decoración de fondo de la barra (visible al abrirse) */
.bb-deco {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0; transition: opacity 0.6s ease;
}
#bottombar.open .bb-deco { opacity: 1; }
.bb-deco .orb { filter: blur(60px); }
.bb-orb1 {
  width: 360px; height: 360px; left: -80px; top: -120px;
  background: conic-gradient(from 120deg, #ff9a3d, #ff5e8e, #8b5cf6, #38e1ff, #ff9a3d);
  opacity: 0.5;
}
.bb-orb2 {
  width: 300px; height: 300px; right: 0px; bottom: -100px;
  background: radial-gradient(circle at 40% 40%, #fff, #8b5cf6 70%);
  opacity: 0.3;
}
.bb-ring { top: calc(50% - 60px); left: 8%; width: 120px; height: 120px; }
.bb-title {
  position: absolute; left: 50%; top: 6%;
  transform: translateX(-50%);
  font-family: 'Goldman', sans-serif; font-weight: 700;
  font-size: clamp(2rem, 6vw, 4rem); text-transform: uppercase;
  color: transparent; -webkit-text-stroke: 1.5px rgba(246,244,239,0.16);
  white-space: nowrap;
}

/* ===== BUTTONS ===== */
.btn-dark {
  display: inline-block; padding: 0.75rem 1.8rem;
  background: var(--ink); color: var(--bg);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700; font-size: 0.95rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  border-radius: 50px; border: 1.5px solid var(--ink);
  text-align: center;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.btn-dark:hover { background: transparent; color: var(--ink); transform: translateY(-2px); }

.btn-ghost {
  display: inline-block; padding: 0.75rem 1.8rem;
  border: 1.5px solid var(--ink); border-radius: 50px;
  color: var(--ink);
  text-align: center;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700; font-size: 0.95rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.btn-ghost:hover { background: var(--ink); color: var(--bg); transform: translateY(-2px); }

/* botón claro para el sidebar oscuro */
/* botón claro para el sidebar oscuro */
.btn-light {
  display: flex;
  padding: 0.55rem 1.3rem;
  background: var(--cream);
  color: var(--bg);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 50px;
  border: 1.5px solid var(--cream);
  text-align: center;
  min-width: 159px;
  align-items: center;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.btn-light:hover { background: transparent; color: var(--cream); transform: translateY(-2px); }

/* ===== PAGE LAYOUT ===== */
#page {
  padding-top: 42px;
  padding-bottom: 56px; /* alto del bottombar cerrado */
  transition: padding-bottom 0.55s cubic-bezier(.4,0,.2,1);
  position: relative;
}
/* cuando el bottombar está abierto desplaza el contenido para no ocultar nada */
body.bb-open #page { padding-bottom: 15vh; }
/* al dar back-to-top se oculta el texto hasta el próximo scroll */
#bottombar.backtop-hidden .backtop span { display: none; }
section[id], header[id] { scroll-margin-top: 70px; }

/* ===== HERO ===== */
#hero,
#about {
  --red: #c93742;
  --red-rgb: 201, 55, 66;
}

#hero {
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 0 201px 0;
}

.side-label {
  position: absolute; z-index: 2;
  writing-mode: vertical-rl;
  color: var(--muted);
}
.side-right { right: 1.2rem; top: 50%; transform: translateY(-50%); }

.hero-inner { position: relative; z-index: 1; }

.hero-name {
  font-size: 147px;
  line-height: 0.9;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  min-height: 1em;
  white-space: nowrap;
}

.hero-rolebig {
  margin: 0;
  font-size: 19px;
  display: flex; align-items: baseline; gap: 0.9rem; flex-wrap: nowrap;
  min-height: 1.8rem;
}
.hero-rolebig .px {
  font-size: inherit;
  color: var(--ink);
  min-width: 13ch;
}
.role-amp {
  font-family: 'PressStart', monospace;
  font-size: inherit;
  text-transform: uppercase;
  line-height: 1.5;
  color: #fff;
  display: inline-block;
  /* min-width: 13ch; */
  white-space: nowrap;
  background-color: var(--red);
  padding: 10px;
  margin-bottom: -10px;
}

/* caret de máquina de escribir */
.typing::after {
  content: '';
  display: inline-block;
  width: 0.55em; height: 0.14em;
  background: var(--red);
  margin-left: 0.12em;
  vertical-align: baseline;
  animation: blink 0.7s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Glitch loop para UX/UI DESIGNER (tras decodificarse) */
.px-glitch { position: relative; display: inline-block; }
.px-glitch::before,
.px-glitch::after {
  content: attr(data-text);
  position: absolute; top: 0; left: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
}
.px-glitch.glitch-on::before {
  color: #38e1ff;
  animation: glitchA 3.2s infinite;
}
.px-glitch.glitch-on::after {
  color: var(--red);
  animation: glitchB 3.2s infinite;
}
@keyframes glitchA {
  0%, 88%, 100% { opacity: 0; transform: none; clip-path: inset(0 0 0 0); }
  89% { opacity: 0.9; transform: translate(-4px, 2px);  clip-path: inset(10% 0 60% 0); }
  91% { opacity: 0.9; transform: translate(3px, -1px);  clip-path: inset(55% 0 15% 0); }
  93% { opacity: 0.9; transform: translate(-2px, 1px);  clip-path: inset(30% 0 40% 0); }
  95% { opacity: 0; }
}
@keyframes glitchB {
  0%, 88%, 100% { opacity: 0; transform: none; clip-path: inset(0 0 0 0); }
  90% { opacity: 0.9; transform: translate(4px, -2px);  clip-path: inset(65% 0 5% 0); }
  92% { opacity: 0.9; transform: translate(-3px, 2px);  clip-path: inset(5% 0 70% 0); }
  94% { opacity: 0.9; transform: translate(2px, -1px);  clip-path: inset(40% 0 30% 0); }
  96% { opacity: 0; }
}

/* Glitch genérico (mismo efecto que UX/UI DESIGNER, con soporte para variables CSS aleatorias) */
.glitch { 
  position: relative; 
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute; 
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100%;
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}
.glitch::before {
  color: #38e1ff;
  animation: glitchA var(--glitch-dur, 3.8s) infinite;
  animation-delay: var(--glitch-delay, 0s);
}
.glitch::after {
  color: var(--red);
  animation: glitchB var(--glitch-dur, 3.8s) infinite;
  animation-delay: var(--glitch-delay, 0s);
}

/* Ajustes específicos de alineación para elementos complejos con glitch */
.btn-light.glitch::before,
.btn-light.glitch::after {
  justify-content: center;
  padding-left: 22px; /* Desfase para saltarse el icono de descarga */
}
.nav-logo.glitch::before,
.nav-logo.glitch::after {
  justify-content: flex-start;
  padding-left: 54px; /* Desfase para saltarse el icono del isotipo */
  font-family: 'Goldman', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--cream);
}
@media (max-width: 900px) {
  .nav-logo.glitch::before,
  .nav-logo.glitch::after {
    padding-left: 44px; /* Ajuste del desfase en móviles por reducción del isotipo */
  }
}

/* hero-top: DARGO grande a la izquierda + rol a la derecha con línea roja debajo,
   alineados al baseline del nombre. Colapsa en móvil por flex-wrap. */
.hero-top {
  display: flex;
  align-items: flex-end;
  gap: 1.8rem;
  flex-wrap: nowrap;   /* en desktop nunca envuelve — el nombre se dimensiona
                          para que quepan juntos */
}
.hero-top .hero-name  {
  flex: 0 0 auto;
  margin-bottom: -20px;
  margin-left: -10px;
}
.hero-top .hero-rolebig {
  /* El borde debe seguir el contenido, sin extenderse hasta el borde del hero. */
  flex: 0 0 auto;
  margin: 0 0 0.75rem;
  border-bottom: 10px solid var(--red);
  padding: 0 0 0.35rem;
  min-height: 0;
  justify-content: flex-start;
}
/* en móvil sí se apilan */
@media (max-width: 720px) {
  .hero-top { flex-wrap: wrap; align-items: flex-start; }
  .hero-top .hero-name  { white-space: normal; }
  .hero-top .hero-rolebig { flex: 0 0 auto; }
}

.hero-row { margin: 0 0 2.2rem; }
.hero-desc {
  color: var(--muted); line-height: 1.6; max-width: none;
  font-size: 1.15rem;
}
.hero-desc strong { color: var(--ink); }

/* nombre completo inline dentro del párrafo de la descripción */
.hero-fullname {
  display: inline;
  font-family: 'Goldman', sans-serif;
  font-size: inherit; text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--red);
  font-weight: 700;
  margin: 0;
}
.hero-sep {
  color: var(--red);
  margin: 0 0.35rem;
  font-weight: 700;
  opacity: 0.85;
}

.hero-ctas {
  display: flex; gap: 1rem; align-items: center;
  flex-wrap: nowrap;
  width: 100%;
}
.hero-ctas > a {
  flex: 0 0 48%;
  width: 48%;
}
@media (max-width: 720px) {
  .hero-ctas { flex-wrap: wrap; }
  .hero-ctas > a { flex: 1 1 100%; width: 100%; }
}

/* ===== HERO EN MÓVIL =====
   En móvil el nombre de 147px y el rol con min-width 13ch desbordaban a lo
   ancho, y min-height:100vh + padding-bottom 201px lo hacían más alto que la
   pantalla y lo recortaba (justify-content:center corta arriba y abajo). Acá se
   reduce todo y el hero pasa a crecer con su contenido. */
@media (max-width: 600px) {
  #hero {
    min-height: auto;
    justify-content: flex-start;
    padding: 6.5rem 0 3rem;
  }
  .hero-name { font-size: clamp(2.6rem, 15vw, 4.4rem); white-space: normal; line-height: 0.95; }
  .hero-top { gap: 0.6rem; margin-bottom: 1.1rem; }
  .hero-rolebig { font-size: 12px; flex-wrap: wrap; gap: 0.5rem; }
  /* sin reserva de ancho fija: en móvil el typewriter puede envolver */
  .hero-rolebig .px, .role-amp { min-width: 0; }
  .hero-top .hero-rolebig { border-bottom-width: 5px; margin-bottom: 0.2rem; }
  .hero-desc { font-size: 1rem; }
}

/* ===== HERO LIGHT (banda clara sobre el body oscuro) =====
   Invertido respecto a la versión anterior: el hero es la zona CLARA de la
   página y el body el fondo oscuro. Todo lo que antes era crema sobre #111
   ahora es #111 sobre crema. */
#hero {
  background-color: var(--hero-bg);
  background-image:
    linear-gradient(rgba(17,17,17,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17,17,17,0.05) 1px, transparent 1px);
  background-size: 44px 44px;
}
#hero .hero-name { color: var(--on-band); }
#hero .hero-rolebig .px { color: var(--on-band); }
#hero .hero-desc { color: rgba(17,17,17,0.8); }
#hero .hero-desc strong { color: #000; }
/* dentro del hero el nombre queda rojo (según diagramación de referencia) */
#hero .hero-fullname { color: var(--red); }
#hero .side-label { color: rgba(17,17,17,0.55); }
/* botones para fondo claro */
#hero .btn-dark { background: var(--on-band); color: var(--cream); border-color: var(--on-band); }
#hero .btn-dark:hover { background: transparent; color: var(--on-band); }
#hero .btn-ghost { border-color: var(--on-band); color: var(--on-band); }
#hero .btn-ghost:hover { background: var(--on-band); color: var(--cream); }
/* decoraciones del hero a tonos oscuros para que se noten sobre el crema */
#hero .deco-plus { color: var(--red); }
#hero .deco-ring,
#hero .deco-ring-sm { border-color: rgba(17,17,17,0.32); }
#hero .deco-dots { background-image: radial-gradient(rgba(17,17,17,0.38) 1.7px, transparent 1.7px); }
#hero .deco-shape.ds-sq { border-color: rgba(17,17,17,0.32); }
#hero .deco-word { -webkit-text-stroke-color: rgba(17,17,17,0.2); }
/* los iconos flotantes del hero venían invertidos para fondo oscuro: sobre el
   crema van sin invertir, con multiply para integrarse */
#hero .tool-float { filter: none; mix-blend-mode: multiply; }
/* el streak iridiscente se diseñó para iluminar sobre negro (screen); sobre
   claro hay que oscurecer, así que pasa a multiply */
.hero-streak { mix-blend-mode: multiply; }
/* ===== SECTIONS ===== */
section { padding: 2rem 0; position: relative; overflow: hidden; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 2.5rem; position: relative; z-index: 1; }

.section-head {
  display: flex; align-items: baseline; gap: 1.5rem;
  margin-bottom: 3.5rem; flex-wrap: wrap;
}
.big-num {
  font-family: 'Goldman', sans-serif;
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  font-weight: 700; line-height: 1;
  color: var(--red);
}
.section-title {
  font-size: clamp(1.5rem, 3.2vw, 2.3rem);
  text-transform: uppercase;
  padding-bottom: 0.35rem;
  border-bottom: 3px solid var(--ink);
}
.head-note { color: var(--muted); margin-left: auto; }
.section-sub { color: var(--muted); margin: -2rem 0 3rem; font-size: 1.05rem; }

/* ===== ABOUT (mismo tratamiento claro que el hero) ===== */
#about {
  isolation: isolate;
  background-color: var(--hero-bg);
  background-image:
    linear-gradient(rgba(17,17,17,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17,17,17,0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  border-top: 2px dashed rgba(17, 17, 17, 0.45);
  border-bottom: 3px solid var(--on-band);
}
#about .section-title,
#about .head-loc { color: var(--on-band); }
/* el número de sección (06.) queda rojo, como pediste (hereda .big-num global) */
#about .big-num { color: var(--red); }
#about .section-title { border-bottom-color: var(--on-band); }
#about .about-text p { color: rgba(17, 17, 17, 0.8); }
#about .about-text p strong { color: #000000; }
#about strong { color: #000000; }
#about .skill-tag { border-color: rgba(17, 17, 17, 0.5); color: var(--on-band); }
#about .about-img img { border-color: rgba(17, 17, 17, 0.2); }
#about .deco-word { color: transparent; -webkit-text-stroke: 1.5px rgba(17, 17, 17, 0.16); }
#about .deco-plus { color: var(--red); }
#about .deco-ring-sm { border-color: rgba(17,17,17,0.32); }
#about .deco-dots { background-image: radial-gradient(rgba(17,17,17,0.38) 1.7px, transparent 1.7px); }
/* iconos flotantes sin invertir sobre el crema */
#about .tool-float { filter: none; mix-blend-mode: multiply; }
/* streaks del about más apagados que los del hero: aquí el protagonista es el
   texto, no la banda de color */
#about .hero-streak span:nth-child(2) { opacity: 0.45; }

.about-grid {
  display: grid; grid-template-columns: 1fr 1.5fr; gap: 4rem;
  align-items: center;
}
.about-img { position: relative; }
.about-img img {
  position: relative; z-index: 1;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  width: 100%; object-fit: cover;
}
.about-text p {
  color: var(--muted); line-height: 1.7; margin-bottom: 1rem;
  font-size: 1.15rem;
}
.about-text p strong { color: var(--ink); }
.skills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.6rem 0; }
.skill-tag {
  padding: 0.3rem 0.9rem; border-radius: 50px;
  font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  border: 1px solid var(--ink);
  transition: background var(--transition), color var(--transition);
}
/* (sin efecto hover en los skills) */
.cv-links { display: flex; gap: 1rem; margin-top: 1.6rem; flex-wrap: wrap; }

/* ===== EXPERIENCE (FAMA) ===== */
/* tarjeta de rol CLARA sobre el body oscuro (invertida respecto a antes).
   Ojo: .proj-desc se queda oscura a propósito — el contraste entre la tarjeta
   clara del rol y las tarjetas oscuras de proyecto es intencional. */
.exp-intro {
  width: 100%; max-width: 100%;
  margin-bottom: 3rem;
  background: var(--cream);
  color: var(--on-band);
  border-radius: var(--radius);
  padding: 2.2rem 2.4rem;
  box-shadow: 0 18px 50px rgba(0,0,0,0.28);
}
.exp-intro .proj-num { display: block; margin-bottom: 0.7rem; color: var(--red); }
.exp-role {
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  color: var(--on-band);
}
.exp-desc { color: rgba(17,17,17,0.78); line-height: 1.7; font-size: 1.15rem; }
.exp-desc strong { color: #000; }
.exp-intro .site-pill { border-color: var(--on-band); color: var(--on-band); background: transparent; }
.exp-intro .site-pill:hover { background: var(--on-band); color: var(--cream); }
/* el .head-loc y el número de sección viven fuera de la tarjeta, sobre el body
   oscuro, así que mantienen el color claro heredado de --ink */

/* subtítulo "Projects" (tamaño del rol) + nombre de proyecto (más pequeño) */
.projects-title {
  font-family: 'Goldman', sans-serif;
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 1.8rem;
}
.projects-title::before { content: '// '; color: var(--red); }
.proj-name {
  font-family: 'Goldman', sans-serif;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.exp-sites { display: flex; gap: 0.8rem; margin-top: 1.4rem; flex-wrap: wrap; }
.site-pill {
  padding: 0.45rem 1.2rem; border-radius: 50px;
  border: 1.5px solid var(--ink);
  font-weight: 700; font-size: 0.95rem;
  letter-spacing: 0.05em;
  background: var(--bg2);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.site-pill:hover { background: var(--ink); color: #222222; transform: translateY(-2px); }

/* ===== PROJECTS ===== */
.project { margin-bottom: 6rem; position: relative; }
.project:last-child { margin-bottom: 0; }

/* Proyectos en dos columnas (dos por fila) en pantallas anchas.
   Los encabezados (título de sección, intro, "Projects") ocupan la fila
   completa; solo los .project se reparten en 2 columnas. */
@media (min-width: 1000px) {
  .company-sec .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 2.5rem;
    row-gap: 0rem;
    align-items: start;
  }
  .company-sec .container > :not(.project) { grid-column: 1 / -1; }
  /* si la sección tiene un solo proyecto, que ocupe todo el ancho */
  .company-sec .container > .project:only-of-type { grid-column: 1 / -1; }
  /* row-gap:0 mantiene junto el bloque de encabezados, así que la separación
     entre FILAS de proyectos la da el margen (si no, la fila 2 queda pegada
     a la fila 1). La última fila no lo necesita: son los últimos hijos. */
  .company-sec .container > .project { margin-bottom: 1rem; }
  .company-sec .container > .project:nth-last-child(-n+2) { margin-bottom: 0; }
}

/* watermark de fondo por experiencia (VISUAL / BAMBUCO / CONFIAR) */
.deco-word.wmk {
  position: absolute;
  z-index: -1;
  top: 0.2rem; right: -1.5rem;
  font-size: clamp(3.5rem, 9vw, 7.5rem);
  animation: wordDrift 18s ease-in-out infinite alternate;
}

.proj-head {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  border-top: 1.5px dashed var(--line);
  padding-top: 1.2rem; margin-bottom: 1.8rem;
}
.proj-head > * { width: 100%; }
.proj-num {
  font-family: 'Goldman', sans-serif;
  font-size: 0.9rem; font-weight: 700; letter-spacing: 0.1em;
  color: var(--red);
}
.proj-head h3 {
  font-size: clamp(1.4rem, 3.5vw, 2.3rem);
  text-transform: uppercase;
}
.proj-meta { display: flex; gap: 2rem; flex-wrap: wrap; }
.proj-meta div { display: flex; flex-direction: column; gap: 0.2rem; }
.proj-meta dt { color: var(--muted); }
.proj-meta dd {
  font-size: 8px;
  line-height: 17px;
  letter-spacing: 0.06em;
  max-width: 100%;
}

/* --- Slider --- */
/* El slider conserva su paleta original (visor claro con controles oscuros): la
   inversión de la página NO lo afecta, así que sus colores van literales en vez
   de por variable. Es el "marco" que muestra las capturas y debe leerse igual
   que en el diseño previo. */
.slider-main {
  position: relative;
  border: 1px solid #222222;
  border-radius: var(--radius);
  overflow: hidden;
  background: #ffffff;
  aspect-ratio: 16 / 9;
  /* limita el área de repintado al propio visor: sin esto, el crossfade de un
     slide invalidaba el compositing de las capas fijas de fondo */
  contain: paint;
  isolation: isolate;
}
/* variante para capturas de página completa: scroll vertical interno */
.slider-main.tall { aspect-ratio: 16 / 10; }
.slider-main.tall .slide { overflow-y: auto; overflow-x: hidden; overscroll-behavior: auto; will-change: scroll-position; }
.slider-main.tall .slide img { width: 100%; height: auto; object-fit: unset; }
.slider-main.tall .slide::-webkit-scrollbar { width: 8px; }
.slider-main.tall .slide::-webkit-scrollbar-track { background: #eceae3; }
.slider-main.tall .slide::-webkit-scrollbar-thumb { background: rgba(17,17,17,0.45); border-radius: 4px; }
.slide {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none;
  /* 0.45s se sentía lento al pasar de slide; 0.18s responde al clic sin perder
     el crossfade */
  transition: opacity 0.18s ease;
}
.slide.active { opacity: 1; pointer-events: auto; }
.slide[role="button"]:focus-visible,
.design-item:focus-visible,
.thumb:focus-visible,
.nav-btn:focus-visible,
#zoom button:focus-visible,
#lightbox button:focus-visible {
  outline: 3px solid #38e1ff;
  outline-offset: 4px;
}
.slide img, .slide video {
  width: 100%; height: 100%; object-fit: contain;
}
.slide-tag {
  position: absolute; top: 1rem; left: 1rem;
  /* decorativa: si captura el hover, detect() pierde el IMG y quita la lupa */
  pointer-events: none;
  background: #222222; color: #f6f4ef;
  font-family: 'PressStart', monospace;
  font-size: 8px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.45rem 0.9rem; border-radius: 50px;
}

/* flechas de paso de slide: igual que la lupa del cursor, se auto-invierten
   según el fondo REAL que tienen detrás con mix-blend-mode: difference (sin
   canvas → también funciona con file://). El círculo es blanco: al restarse
   del fondo queda claro sobre zonas oscuras y oscuro sobre zonas claras; la
   flecha es negra, así deja ver el fondo original y contrasta con el círculo.
   El visor (.slider-main) ya es un grupo aislado (isolation), así que la
   mezcla sólo actúa sobre la imagen del slide. */
.nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 5;
  width: 46px; height: 46px; border-radius: 50%;
  background: #fff; color: #000;
  border: 0;
  mix-blend-mode: difference;
  font-size: 1.1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--transition);
}
.nav-btn:hover {
  transform: translateY(-50%) scale(1.1);
}
/* al pasar el mouse se quita la inversión: botón sólido blanco con flecha
   negra, legible sobre cualquier fondo mientras se interactúa */
.nav-btn:hover,
.nav-btn:focus-visible {
  mix-blend-mode: normal;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}
.prev-btn { left: 1rem; }
.next-btn { right: 1rem; }

.slide-counter {
  position: absolute; top: 1rem; right: 1rem; z-index: 5;
  background: #f6f4ef; border: 1px solid #222222; color: #222222;
  padding: 0.35rem 0.8rem; border-radius: 50px;
}

/* Barra de progreso bajo el slider */
.progress-bar {
  position: relative;
  height: 6px;
  /* el track va sobre el body oscuro (no dentro del visor), así que es claro */
  background: rgba(246,244,239,0.16);
  border-radius: 3px;
  margin-top: 0.9rem;
  overflow: visible;
}
.progress-fill {
  height: 100%; width: 0;
  /* el degradado se dimensiona sobre el ANCHO TOTAL de la barra (no del fill),
     así los colores no se comprimen cuando el fill es corto */
  background: linear-gradient(90deg,
    rgba(239,35,60,0) 0%,
    rgba(239,35,60,1) 63%,
    rgba(255,190,11,1) 81%,
    rgba(127,150,255,1) 96%);
  background-size: var(--track-w, 100%) 100%;
  background-repeat: no-repeat;
  border-radius: 3px;
  position: relative;
  transition: width 0.22s ease;
}
/* cohete horizontal: apunta en el sentido de avance de la barra */
.progress-fill span {
  position: absolute; right: -10px; top: 50%;
  transform: translateY(-52%) rotate(45deg);
  font-size: 1.05rem;
  line-height: 1;
}

/* --- Thumbnails --- */
.thumbs {
  display: flex; gap: 0.6rem; margin-top: 0.8rem;
  overflow-x: auto; padding-bottom: 0.3rem;
  scrollbar-width: none;
}
.thumbs::-webkit-scrollbar { display: none; }
.thumb {
  flex-shrink: 0;
  width: 96px; height: 64px;
  border: 1.5px solid rgba(246,244,239,0.3);
  border-radius: 8px; overflow: hidden;
  background: #ffffff; padding: 0;
  opacity: 0.6;
  transition: opacity var(--transition), border-color var(--transition), transform var(--transition);
}
.thumb img, .thumb video {
  width: 100%; height: 100%; object-fit: cover; pointer-events: none;
}
.thumb:hover { opacity: 1; transform: translateY(-3px); }
.thumb.active { opacity: 1; border-color: var(--ink); border-width: 2px; }

/* tarjeta CLARA con borde oscuro: se queda igual que antes de invertir la
   paleta, así que sus colores van literales (no por variable) para que la
   inversión del body no la arrastre. */
.proj-desc,
.proj-desc-shared {
  color: #222222; line-height: 1.7;
  width: 100%; max-width: 100%;
  font-size: 14px;
  text-align: justify;
  background: #ffffff;
  border: 1.5px dashed #222222;
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
}
.proj-desc { margin-top: 1.4rem; }
.proj-desc-shared { margin: 0; text-align: center; }

/* ===== DESIGN GALLERY ===== */
.gallery-cap { color: var(--muted); margin: 1.6rem 0 1rem; }
.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
/* fondo transparente: las piezas gráficas ya traen el suyo, así que el
   contenedor sólo aporta el recorte redondeado y el borde. El borde sí es claro
   para que la tarjeta se delimite sobre el body oscuro. */
.design-item {
  border: 1px solid rgba(246,244,239,0.3);
  border-radius: var(--radius); overflow: hidden;
  background: transparent; padding: 0;
  position: relative;
}
.design-item::after {
  content: '+';
  position: absolute; right: 0.6rem; bottom: 0.6rem;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--ink); color: #222222;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 700;
  opacity: 0; transform: scale(0.6);
  transition: opacity var(--transition), transform var(--transition);
}
.design-item:hover::after { opacity: 1; transform: scale(1); }
.design-item img {
  width: 100%; height: 190px; object-fit: cover;
  transition: transform 0.5s ease;
}
.design-item:hover img { transform: scale(1.06); }

/* ===== LIGHTBOX ===== */
#lightbox {
  display: none; position: fixed; inset: 0; z-index: 9500;
  background: #222222;   /* opaco por el mismo motivo que #zoom (rendimiento) */
  align-items: center; justify-content: center;
}
#lightbox.active { display: flex; }
#lb-img { max-width: 88vw; max-height: 88vh; border-radius: 10px; }
#lb-close, #lb-prev, #lb-next {
  position: absolute; z-index: 9501;
  background: var(--bg); color: var(--ink);
  border: none; font-size: 1.1rem; font-weight: 700;
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
#lb-close:hover, #lb-prev:hover, #lb-next:hover { background: var(--red); color: #fff; }
#lb-close { top: 1.5rem; right: 1.5rem; }
#lb-prev  { left: 1.5rem;  top: 50%; transform: translateY(-50%); }
#lb-next  { right: 1.5rem; top: 50%; transform: translateY(-50%); }

/* ===== ZOOM MODAL (imágenes de los sliders) ===== */
#zoom {
  display: none; position: fixed; inset: 0; z-index: 9500;
  /* OPACO (antes 0.94): con un fondo translúcido el navegador tenía que seguir
     componiendo todo lo animado de atrás (agua, código, grain) mientras el zoom
     estaba abierto → apertura/cierre lentos. Opaco descarta el fondo. */
  background: #222222;
  padding: 3vh 0;
  cursor: none;
}
#zoom.active { display: block; }
.zoom-view {
  height: 94vh; max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; overscroll-behavior: contain;
  border-radius: 10px;
}
/* por defecto la imagen/video cabe en pantalla */
#zoom-img, #zoom-video {
  max-width: 100%; max-height: 94vh; width: auto; height: auto;
  display: block; border-radius: 10px;
}
#zoom-video { background: #000; }
/* solo los pantallazos de landings hacen scroll (imagen a todo el ancho) */
#zoom.zoom-scroll .zoom-view { display: block; overflow-y: auto; }
#zoom.zoom-scroll #zoom-img { width: 100%; max-height: none; height: auto; }
.zoom-view::-webkit-scrollbar { width: 10px; }
.zoom-view::-webkit-scrollbar-track { background: rgba(255,255,255,0.1); }
.zoom-view::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.5); border-radius: 5px; }
#zoom-close {
  position: absolute; top: 1.5rem; right: 1.5rem; z-index: 9501;
  background: var(--bg); color: var(--ink);
  border: none; font-size: 1.1rem; font-weight: 700;
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
#zoom-close:hover { background: var(--red); color: #fff; }
#zoom-prev, #zoom-next {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 9501;
  background: var(--bg); color: var(--ink); border: none;
  font-size: 1.3rem; font-weight: 700;
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
#zoom-prev { left: 1.5rem; }
#zoom-next { right: 1.5rem; }
#zoom-prev:hover, #zoom-next:hover { background: var(--red); color: #fff; }

/* etiqueta Before/After heredada del slide: va anclada a #zoom (no a .zoom-view)
   para que no se desplace cuando el modo .zoom-scroll hace scroll del contenido.
   pointer-events:none → el clic la atraviesa y sigue cerrando el modal. */
#zoom-tag {
  display: none;
  position: absolute; top: 1.5rem; z-index: 9501;
  /* pegada al borde izquierdo de .zoom-view (centrada, max-width 1100px), no al
     de la ventana: si no, en pantallas anchas flota sola en el fondo negro */
  left: max(1.5rem, calc(50% - 550px + 1.5rem));
  /* --ink pasó a claro al invertir la paleta y el texto quedaba crema sobre
     crema; va literal oscuro para que siempre se lea */
  background: var(--cream); color: #222222;
  font-family: 'PressStart', monospace;
  font-size: 8px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.55rem 1rem; border-radius: 50px;
  pointer-events: none;
}
#zoom-tag.on { display: block; }

/* ===== FOOTER ===== */
footer { background: var(--ink); }
footer .micro { color: rgba(246,244,239,0.7); }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 1.4rem; padding-bottom: 1.4rem; flex-wrap: wrap; gap: 1rem;
}
.footer-inner a { transition: color var(--transition); }
.footer-inner a:hover { color: #fff; }

/* ===== REVEAL ===== */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* caret mientras el bloque se está tecleando (ver typeIn() en script.js) */
.typing-in::after {
  content: '';
  display: inline-block;
  width: 0.5em; height: 0.9em;
  margin-left: 0.1em;
  background: var(--red);
  vertical-align: text-bottom;
  animation: blink 0.7s steps(1) infinite;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--ink); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  #topbar { gap: 1rem; padding: 0.55rem 1rem; }
  .nav-logo img { width: 36px; height: 36px; }
  .side-roles { display: none; }
  #topbar ul {
    gap: 1.1rem;
    overflow-x: auto; scrollbar-width: none;
    flex: 1;
  }
  #topbar ul::-webkit-scrollbar { display: none; }
  #topbar ul a { font-size: 0.8rem; white-space: nowrap; }
  #topbar ul a .micro { display: none; }
  /* CV.pdf: texto + flecha también en móvil, más compacto */
  #topbar .btn-light { display: flex; align-items: center; justify-content: center; padding: 0.45rem 0.6rem; min-width: 37px; gap: 6px; }
  #topbar .btn-light .cv-icon { display: block; }

  #bottombar { gap: 1.2rem; }
  #bottombar a { font-size: 11px; }

  #hero { padding-top: 7rem; }

  .side-label { display: none; }
  .deco-ring { width: 220px; height: 220px; right: -60px; }
  .about-grid { grid-template-columns: 1fr; }
  .about-img { max-width: 340px; justify-self: center; }
  .proj-head { grid-template-columns: auto 1fr; }
  .proj-meta { grid-column: 1 / -1; }
  .contact-item { grid-template-columns: 100px 1fr auto; gap: 1rem; }
}
@media (max-width: 1103px) {
  /* barra inferior: solo iconos (más grandes) */
  #bottombar a img { width: 35px; height: 35px; }
  #bottombar { gap: 2rem; }
  /* el overflow pasa a visible para que el tooltip pueda salir de la barra;
     el recorte de los orbes decorativos se mueve a .bb-deco para que no se
     desborden por encima */
  #bottombar { overflow: visible; }
  #bottombar .bb-deco { overflow: hidden; }

  /* el texto de cada icono es SIEMPRE tooltip (barra cerrada o abierta): aparece
     al hover. Se ancla al centro del icono (bottom: 50% + media altura del icono +
     hueco), no al alto del <a>, así queda bien en ambos estados porque el icono va
     centrado dentro del <a> sin importar lo alto que sea (padding de la barra abierta). */
  #bottombar a:not(.backtop) span {
    position: absolute;
    left: 50%;
    bottom: calc(50% + 32px);
    transform: translateX(-50%) translateY(6px);
    margin: 0 !important;
    background: #222222;
    color: #fff;
    padding: 6px 11px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    font-size: 12px; font-weight: 500; letter-spacing: 0.02em;
    white-space: nowrap;
    opacity: 0; pointer-events: none;
    z-index: 30;
    transition: opacity 0.22s ease, transform 0.22s ease;
  }
  /* flechita inferior del tooltip */
  #bottombar a:not(.backtop) span::after {
    content: '';
    position: absolute; top: 100%; left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #222222;
  }
  #bottombar a:not(.backtop):hover span {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  /* cualquier interacción (scroll/clic/touch) oculta el tooltip; se reactiva
     al volver a mover el ratón sobre un icono (clase .tip-off puesta por JS) */
  #bottombar.tip-off a:not(.backtop) span { opacity: 0; }

  /* el back-to-top no tiene icono: mantener su texto/flecha */
  #bottombar .backtop span { display: inline-block; }
}
@media (max-width: 600px) {
  .design-grid { grid-template-columns: repeat(2, 1fr); }
  .design-item img { height: 140px; }
  .slider-main { aspect-ratio: 4 / 3; }
  .thumb { width: 72px; height: 50px; }
  .hero-row { gap: 1.5rem; }
}

/* ===== BACK TO TOP (bottombar) ===== */
.backtop {
  margin-left: 1.4rem;
  padding-left: 1.4rem;
  border-left: 1px solid rgba(255,255,255,0.18);
  display: none; /* solo visible tras la 2ª sección */
}
#bottombar.show-backtop .backtop { display: flex; }
/* sin texto → sin separador colgando */
#bottombar.backtop-hidden .backtop { border-left: none; padding-left: 0; margin-left: 0; }

/* ===== ORBES RESPONSIVE ===== */
@media (max-width: 1367px) {
  .orb-a { width: 520px; height: 520px; top: 56%; right: -120px; }
  .orb-b { width: 260px; height: 260px; bottom: 68%; }
}
@media (max-width: 1024px) {
  .orb-a { top: -24%; }
  .orb-b { bottom: -12%; }
}
@media (max-width: 600px) {
  .orb-a { width: 520px; height: 520px; top: 66%; }
  .orb-b { width: 260px; height: 260px; bottom: 78%; }
}

/* ===== GRANULADO RETRO (sólo en el fondo) ===== */
/* Los modales son opacos y no necesitan componer las capas de fondo. */
body.zoom-open #grain,
body.lb-open #grain { display: none; }
#grain {
  /* z:0 lo mantiene por debajo de los contenedores de contenido (z:1+),
     de modo que imágenes, textos y controles nunca reciben el granulado. */
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  /* hard-light refuerza la textura sobre el fondo negro sin superponerla al contenido. */
  opacity: .3;
  /* filter: contrast(10); */
  mix-blend-mode: hard-light;
  transition: opacity 0.3s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  /* sin animación: el parpadeo venía del repintado por steps() */
}
/* Granulado local para las dos bandas claras. Queda detrás de sus contenedores
   (z:1+) y sólo textura el fondo sólido de cada sección. */
#hero::after,
#about::after {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.58;
  filter: contrast(1.4);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  /* sin animación para evitar el parpadeo */
}
/* ===== TOOLS FLOTANTES (hero + contenido) ===== */
.tools-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.tool-float {
  position: absolute; top: 0; left: 0;
  filter: invert(1) drop-shadow(0 0 6px rgba(56,225,255,0.28));
  opacity: 0;
  will-change: transform, opacity;
}

/* capa de los iconos que suelta el clic: una por sección (la crea el JS al
   primer clic). Va DENTRO de la sección y DETRÁS del contenido (z-index 0, como
   los iconos ambientales del hero; .container/.hero-inner van en z-index 1).
   Hereda el overflow:hidden de la sección → recortados en sus bordes. */
.click-tools {
  position: absolute; inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.click-tool { position: absolute; top: 0; left: 0; opacity: 0; will-change: transform, opacity; }
/* sobre banda clara (hero/about): icono normal (es oscuro de origen) con multiply */
.ct-light { filter: none; mix-blend-mode: multiply; }
/* sobre el body oscuro: invertido a claro + screen para que se lea */
.ct-dark  { filter: invert(1); mix-blend-mode: screen; }

/* ===== WATERMARK DE SECCIÓN (nombre empresa, vertical a la derecha, al medio) ===== */
.section-wm {
  top: 50%; right: 0.6rem; left: auto; bottom: auto;
  writing-mode: vertical-rl;
  transform: translateY(-50%);
  font-size: clamp(2.6rem, 7vw, 6rem);
  line-height: 1;
  animation: wmDrift 20s ease-in-out infinite alternate;
}
@keyframes wmDrift {
  0%   { transform: translateY(-52%); }
  100% { transform: translateY(-48%); }
}

/* head-loc: ubicación bajo el título de sección, más grande */
.head-loc {
  margin-left: auto;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700; font-size: 1.1rem;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted);
}
.head-loc::before {
  content: '◉ '; color: var(--red); margin-right: 0.3rem;
}

/* subtítulo descriptivo (sub-bloques dentro del showcase) */
.sub-desc {
  color: var(--muted); line-height: 1.65; font-size: 1.05rem;
  max-width: 760px; margin: 0 0 1.4rem;
}

/* nombre de empresa pequeño bajo el título del proyecto */
.proj-company {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700; font-size: 0.95rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--red);
  margin-top: -0.1rem;
}

/* ===== MÁS ORBES + ANIMACIÓN SUTIL ===== */
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(18px, -22px); }
}
.orb-f, .orb-g, .orb-h, .orb-i, .orb-j, .orb-b2, .orb-c2 {
  animation: orbFloat 16s ease-in-out infinite;
}
.orb-f {
  width: 300px; height: 300px; bottom: 8%; left: 12%;
  background: radial-gradient(circle at 40% 40%, #4ade80, #38e1ff 70%);
  opacity: 0.4;
}
.orb-g {
  width: 360px; height: 360px; top: 40%; left: -120px;
  background: conic-gradient(from 80deg, #8b5cf6, #ff9a3d, #38e1ff, #8b5cf6);
  opacity: 0.4; animation-duration: 19s;
}
.orb-h {
  width: 400px; height: 400px; top: 6%; right: -140px;
  background: radial-gradient(circle at 50% 50%, #ff9a3d, #ff5e8e 60%, transparent 75%);
  opacity: 0.45; animation-duration: 21s;
}
.orb-i {
  width: 320px; height: 320px; top: 8%; left: -110px;
  background: radial-gradient(circle at 40% 40%, #38e1ff, #8b5cf6 70%);
  opacity: 0.42; animation-duration: 18s;
}
.orb-j {
  width: 380px; height: 380px; bottom: -120px; right: 4%;
  background: conic-gradient(from 200deg, #8b5cf6, #ff5e8e, #38e1ff, #8b5cf6);
  opacity: 0.4; animation-duration: 23s;
}
.orb-b2 {
  width: 340px; height: 340px; top: 20%; right: -130px;
  background: radial-gradient(circle at 45% 45%, #4ade80, #38e1ff 65%, transparent 80%);
  opacity: 0.42; animation-duration: 17s;
}
.orb-c2 {
  width: 300px; height: 300px; bottom: 6%; right: 8%;
  background: radial-gradient(circle at 50% 50%, #ff9a3d, #ff5e8e 60%, transparent 78%);
  opacity: 0.4; animation-duration: 20s;
}

/* ===== POSICIONES DECO EXTRA ===== */
.dd6 { top: 10%; right: 5%; width: 200px; height: 130px; animation-duration: 8.5s; }
.dd7 { bottom: 10%; left: 4%; width: 210px; height: 140px; animation-duration: 9.2s; }
.dr5 { top: 24%; right: -40px; width: 130px; height: 130px; animation-duration: 30s; }
.dr6 { bottom: 32%; left: 88%; width: 120px; height: 120px; animation-duration: 26s; }
.dp13 { bottom: 16%; right: 6%; font-size: 16px; animation-duration: 9s; }
.dp14 { top: 30%; left: 5%; font-size: 13px; color: var(--ink); opacity: 0.55; animation-duration: 11s; }
.dp15 { top: 16%; right: 8%; font-size: 17px; animation-duration: 8s; }
.dp16 { bottom: 22%; left: 6%; font-size: 12px; color: var(--ink); opacity: 0.55; animation-duration: 12s; }
.s5 { bottom: 14%; right: 10%; animation-duration: 12s; }
.s6 { top: 26%; right: 8%; animation-duration: 10s; animation-direction: reverse; }
.s7 { bottom: 18%; left: 9%; animation-duration: 13s; }
.s8 { top: 22%; left: 7%; animation-duration: 11s; animation-direction: reverse; }
.s9  { top: 64%; left: 18%; animation-duration: 12.5s; }
.s10 { bottom: 16%; right: 12%; animation-duration: 10.5s; animation-direction: reverse; }
.s11 { bottom: 22%; left: 14%; animation-duration: 13.5s; }
.s12 { top: 30%; right: 14%; animation-duration: 11.5s; }
.s13 { bottom: 30%; right: 18%; animation-duration: 9.5s; animation-direction: reverse; }
.s14 { top: 28%; left: 12%; animation-duration: 12s; }
.s15 { bottom: 24%; right: 8%; animation-duration: 14s; animation-direction: reverse; }

/* ===== TOPBAR: bajo 1170px el menú se desplaza (scroll horiz.) y deja sitio al CV ===== */
@media (max-width: 1170px) {
  #topbar ul {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  #topbar ul::-webkit-scrollbar { display: none; }
  #topbar ul a { white-space: nowrap; }
}

/* ===== BOTTOMBAR abierto en pantallas medianas ===== */
@media (max-width: 995px) {
  #bottombar.open {
    height: 12vh;
    gap: 6px !important;
    padding: 5.8rem 2rem 5rem;
    align-items: flex-end;
  }
}

/* ===== OCULTAR DECO PESADA EN MÓVIL ===== */
@media (max-width: 600px) {
  .bb-orb1 { display: none; }
  #confiar .orb-i { display: none; }
  #about .dd5 { bottom: 1%; right: 3%; }
  /* flechas del zoom abajo en móvil */
  #zoom-prev, #zoom-next { top: 84%; }
}

/* ===== RENDIMIENTO: pausar animaciones fuera de pantalla =====
   El JS marca con .anim-off las secciones (y el hero) que están lejos del
   viewport. Sus animaciones decorativas infinitas (glitch, orbes con blur,
   anillos que giran, puntos, formas, watermark) se congelan: no gastan CPU/GPU
   cuando no se ven y se reanudan justo antes de entrar en pantalla. */
.anim-off [class*="orb-"],
.anim-off .deco-ring,
.anim-off .deco-ring-sm,
.anim-off .deco-plus,
.anim-off .deco-dots,
.anim-off .deco-shape,
.anim-off .deco-word,
.anim-off .section-wm,
.anim-off .glitch::before,
.anim-off .glitch::after,
.anim-off .px-glitch::before,
.anim-off .px-glitch::after,
.anim-off .sec-streak,
.anim-off .tool-float {
  animation-play-state: paused;
}

/* =====================================================================
   DECK — el sitio como slider 3D controlado por scroll
   =====================================================================
   body.deck lo pone script.js. Cada sección (.stage) es una diapositiva fija
   a pantalla completa; sólo la .is-active (y la .is-leaving mientras sale) es
   visible. Las diapositivas en reposo NO tienen transform → no crean stacking
   context y el #grain / fondos se componen igual que antes. */
:root {
  --deck-top: 58px;      /* alto real del topbar (lo mide el JS) */
  --deck-bottom: 56px;   /* bottombar cerrado */
  --stage-h: calc(100vh - var(--deck-top) - var(--deck-bottom));
}
body.deck.bb-open { --deck-bottom: 16vh; }
/* (abierto mide 12vh, pero su padding de 5.8rem + 5rem lo estira a ~10.8rem:
   se reserva lo que de verdad ocupa para que no tape lo último del contenido) */
@media (max-width: 995px) { body.deck.bb-open { --deck-bottom: max(12vh, 10.8rem); } }

body.deck {
  overflow: hidden;
  height: 100vh;
  /* el fondo oscuro cambia de matiz con cada sección */
  background-color: var(--deck-bg, #000);
  transition: background-color 0.7s ease;
}
/* glow de color de la sección, detrás de todo (sólo cambia background-color) */
#deck-glow { display: none; }
.deck #deck-glow {
  display: block;
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-color: var(--deck-glow, #e63946);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 72% 42%, #000 0%, transparent 70%);
          mask-image: radial-gradient(ellipse 70% 60% at 72% 42%, #000 0%, transparent 70%);
  opacity: 0.16;
  transition: background-color 0.7s ease;
}

.deck #page { padding: 0; }

.deck #page > .stage {
  position: fixed; inset: 0;
  visibility: hidden;
  pointer-events: none;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
}
.deck #page > .stage.is-active,
.deck #page > .stage.is-leaving { visibility: visible; }
.deck #page > .stage.is-active { pointer-events: auto; }
.deck #page > .stage.is-leaving,
.deck .ghost-echo { pointer-events: none !important; }
.deck .ghost-echo { will-change: transform, opacity; }

/* HERO: llena la diapositiva y deja libres topbar y bottombar */
.deck #hero {
  min-height: 0;
  height: 100%;
  padding: calc(var(--deck-top) + 1rem) 0 calc(var(--deck-bottom) + 1rem);
  transition: padding-bottom 0.55s cubic-bezier(.4,0,.2,1);
}

/* SECCIONES: la .container es el área de contenido (con scroll interno sólo
   si no cabe — pantallas bajas / móvil) */
.deck #page > section.stage {
  padding: 0;
  border-top: none;
}
.deck #page > section.stage > .container {
  height: 100%;
  max-width: 1320px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding-top: calc(var(--deck-top) + 1.6rem);
  padding-bottom: calc(var(--deck-bottom) + 1.6rem);
  display: flex;
  flex-direction: column;
  transition: padding-bottom 0.55s cubic-bezier(.4,0,.2,1);
}
.deck #page > section.stage > .container::-webkit-scrollbar { display: none; }
.deck #page > section.stage > .container > * { flex-shrink: 0; }
/* centrado vertical "seguro": con margin auto el contenido no se recorta por
   arriba cuando desborda */
.deck #page > section.stage > .container > :first-child { margin-top: auto; }
.deck #page > section.stage > .container > :last-child  { margin-bottom: auto; }
#about.stage { border-bottom: none; }

/* ---------- dos columnas: intro de la experiencia | proyecto ---------- */
.deck .stage-cols {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 3.5rem;
  align-items: center;
}
.deck .col-intro .section-head { margin-bottom: 1.3rem; }
.deck .col-intro .big-num { font-size: clamp(2.8rem, 5.4vw, 4.8rem); }
.deck .col-intro .exp-intro { margin-bottom: 1.4rem; padding: 1.5rem 1.8rem; }
.deck .col-intro .exp-role { font-size: clamp(1.3rem, 2.3vw, 1.9rem); margin-bottom: 0.9rem; }
.deck .col-intro .exp-desc { font-size: 1.05rem; line-height: 1.6; }
.deck .col-intro .exp-sites { margin-top: 1.1rem; }
.deck .col-intro .projects-title { margin: 0 0 1rem; }

/* la columna de proyectos apila todos en la misma celda: su alto es el del
   proyecto más alto y el cambio de proyecto no mueve la intro */
.deck .col-projects {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  position: relative;
}
.deck .col-projects > .project {
  grid-area: 1 / 1;
  margin: 0;
  visibility: hidden;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
}
/* inherit (no visible): si no, el proyecto actual de una sección OCULTA se
   seguiría viendo a través de su diapositiva */
.deck .col-projects > .project.is-current,
.deck .col-projects > .project.is-leaving { visibility: inherit; }
/* la entrada la anima el deck (3D); el reveal clásico sobra aquí */
.deck .project.reveal,
.deck .exp-intro.reveal { opacity: 1; transform: none; transition: none; }
/* reels (móvil): la pantalla ya entra deslizándose; si las piezas de
   Freelance además suben 36px, siguen moviéndose cuando la pantalla ya
   paró y se siente un rebote → sólo aparecen con fundido */
.deck-reels .design-item.reveal { transform: none; transition: opacity 0.5s ease; }

.deck .col-projects .proj-head { margin-bottom: 1rem; padding-top: 1rem; }
/* el visor se dimensiona por el ALTO disponible para que todo el proyecto
   (cabecera, visor, miniaturas, descripción) quepa sin scroll */
.deck .col-projects .slider {
  width: min(100%, max(320px, calc((var(--stage-h) - 19rem) * 1.6)));
}
.deck .col-projects .thumb { width: 82px; height: 52px; }
.deck .col-projects .proj-desc { margin-top: 1rem; padding: 1rem 1.3rem; font-size: 13.5px; }
/* las landings ya no hacen scroll interno: la rueda avanza el deck y el clic
   abre la página completa en el zoom */
.deck .slider-main.tall .slide { overflow: hidden; }

/* pager de proyectos bajo "// Projects" */
.proj-pager {
  display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap;
}
.proj-pager-count { margin-right: 0.6rem; color: var(--muted); }
.proj-pager button {
  width: 30px; height: 6px; padding: 0;
  border: 0; border-radius: 3px;
  background: rgba(246,244,239,0.22);
  transition: width 0.45s cubic-bezier(.77,0,.18,1), background 0.3s ease;
}
.proj-pager button:hover { background: rgba(246,244,239,0.5); }
.proj-pager button[aria-current="true"] { width: 56px; background: var(--red); }
.proj-pager button:focus-visible { outline: 3px solid #38e1ff; outline-offset: 4px; }

/* FREELANCE: galería en 4 columnas que entra en el alto de la diapositiva */
.deck #freelance .design-grid { grid-template-columns: repeat(4, 1fr); gap: 0.7rem; }
.deck #freelance .design-item img {
  height: clamp(80px, calc((var(--stage-h) - 5rem) / 3 - 0.7rem), 180px);
}

/* ABOUT: la foto se limita al alto disponible */
.deck #about .about-img img {
  max-height: calc(var(--stage-h) - 10rem);
  width: auto; max-width: 100%;
  margin: 0 auto;
}
.deck #about .section-head { margin-bottom: 2rem; }

/* ---------- chrome del deck ---------- */
#deck-progress, #deck-nav { display: none; }
.deck #deck-progress {
  display: block;
  position: fixed; left: 0; right: 0; top: var(--deck-top);
  height: 6px; z-index: 95; pointer-events: none;
  background: rgba(246,244,239,0.14);
}
.deck #deck-progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #38e1ff 0%, #8b5cf6 35%, #ff5e8e 68%, #ff9a3d 100%);
  background-size: 100vw 100%;
  box-shadow: 0 0 14px rgba(139,92,246,0.7), 0 0 4px rgba(56,225,255,0.6);
  border-radius: 0 3px 3px 0;
  transition: width 0.65s cubic-bezier(.77,0,.18,1);
}
/* flechas grandes: anterior en el lateral izquierdo, siguiente en el derecho,
   centradas en el área útil. El contenedor no ocupa caja (display:contents)
   y cada pieza se posiciona sola. */
.deck #deck-nav { display: contents; }
.deck #deck-prev,
.deck #deck-next,
.deck #deck-count {
  position: fixed; z-index: 90;
  top: calc(var(--deck-top) + (100vh - var(--deck-top) - var(--deck-bottom)) / 2);
  transform: translateY(-50%);
  transition: top 0.55s cubic-bezier(.4,0,.2,1), background var(--transition),
              border-color var(--transition), color var(--transition), opacity var(--transition);
}
.deck #deck-prev { left: 1.1rem; }
.deck #deck-next { right: 1.1rem; }
.deck #deck-count {
  right: 1.1rem; width: 58px;
  margin-top: 5.6rem;
  writing-mode: vertical-rl;
  display: flex; align-items: center; justify-content: center;
}
/* el label vertical del hero se corre para dejar sitio a la flecha */
.deck-arrow {
  width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(17,17,17,0.6);
  color: var(--cream);
  border: 1.5px solid rgba(246,244,239,0.45);
  transition: background var(--transition), border-color var(--transition),
              color var(--transition), transform var(--transition), opacity var(--transition);
}
.deck-arrow svg { width: 22px; height: 22px; fill: currentColor; }
.deck-arrow.prev svg { transform: rotate(180deg); }
.deck-arrow:hover:not(:disabled) { background: var(--red); border-color: var(--red); color: #fff; }
.deck-arrow.next:hover:not(:disabled) svg { animation: arrowNudge 0.6s ease-in-out infinite alternate; }
.deck-arrow:disabled { opacity: 0.28; }
.deck-arrow:focus-visible { outline: 3px solid #38e1ff; outline-offset: 4px; }
#deck-count { color: var(--cream); text-align: center; }
/* sobre las bandas claras (hero / about) el chrome pasa a oscuro */
body.deck-light .deck-arrow { background: rgba(246,244,239,0.7); color: #222; border-color: rgba(17,17,17,0.5); }
body.deck-light #deck-count { color: #222; }
body.deck-light #deck-progress { background: rgba(17,17,17,0.12); }
@keyframes arrowNudge { from { transform: translateX(-1px); } to { transform: translateX(3px); } }

/* flechas SVG dentro de los visores de proyecto */
.nav-btn svg { width: 16px; height: 16px; fill: currentColor; }
.prev-btn svg { transform: rotate(180deg); }

/* "See my work" → señala a la derecha */
.btn-arrow {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.7rem;
}
.btn-arrow svg {
  width: 14px; height: 14px; fill: currentColor; flex-shrink: 0;
  transition: transform var(--transition);
}
.btn-arrow:hover svg { transform: translateX(5px); }

/* ---------- responsive ---------- */
@media (max-width: 999px) {
  .deck .stage-cols { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .deck .col-projects .slider { width: 100%; }
  .deck #freelance .design-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .deck #freelance .design-item img { height: 140px; }
}
@media (max-width: 900px) {
  /* en móvil el contenido ocupa todo el ancho: las flechas van abajo, una en
     cada esquina */
  .deck #deck-prev,
  .deck #deck-next {
    top: auto; bottom: calc(var(--deck-bottom) + 0.8rem); transform: none;
  }
  .deck #deck-prev { left: 0.8rem; }
  .deck #deck-next { right: 0.8rem; }
  .deck-arrow { width: 44px; height: 44px; }
  .deck-arrow svg { width: 18px; height: 18px; }
  .deck #deck-count { display: none; }
}
@media (max-width: 600px) {
  .deck #hero { justify-content: center; }
  .deck #page > section.stage > .container { padding-top: calc(var(--deck-top) + 1rem); }
}
/* margen derecho reservado para la columna de flechas del deck */
@media (min-width: 901px) {
  /* a ancho completo y centrado por padding (no max-width): el overflow del
     contenedor recortaba los blur que sobresalen del contenido (p. ej. el orbe
     tras la foto del About) y dejaba un corte vertical en el fondo. El ancho
     útil es el mismo que antes (1320px - 2 × 5.75rem). */
  .deck #page > section.stage > .container {
    max-width: none;
    padding-left:  max(5.75rem, calc((100vw - 1320px) / 2 + 5.75rem));
    padding-right: max(5.75rem, calc((100vw - 1320px) / 2 + 5.75rem));
  }
  .deck #hero .hero-inner { padding-left: 5.75rem; padding-right: 6.5rem; }
}

/* ===== DECK · TARJETA DE EXPERIENCIA =====
   Ubicación + fecha en una línea, descripción de la experiencia (16px,
   justificada) y debajo la descripción del proyecto que se está mostrando. */
.deck .exp-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.8rem; flex-wrap: nowrap;
  margin-bottom: 0.7rem;
}
.deck .exp-meta .head-loc {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; min-width: 0;
  color: rgba(17,17,17,0.62);
}
.deck .exp-meta .head-loc::before { margin-right: 0.15rem; }
.deck .exp-intro .exp-meta .proj-num { display: inline; margin: 0; font-size: 0.8rem; white-space: nowrap; flex-shrink: 0; }
.deck .col-intro .exp-desc {
  font-size: 16px;
  line-height: 1.6;
  text-align: justify;
  hyphens: auto;
}

.exp-projdesc {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1.5px dashed rgba(17,17,17,0.3);
}
.exp-projdesc-title {
  font-family: 'Goldman', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.5rem;
}
/* las descripciones se superponen (absolutas) y el alto del contenedor lo
   fija el JS con el de la descripción ACTUAL, animado: la tarjeta crece o se
   encoge con el contenido, sin espacio vacío y sin saltos bruscos */
.exp-projdesc-stack {
  position: relative;
  transition: height 0.4s cubic-bezier(.4,0,.2,1);
}
.exp-projdesc-stack > .proj-desc {
  position: absolute; top: 0; left: 0; right: 0;
  margin: 0; padding: 0;
  background: none; border: 0; border-radius: 0;
  font-size: 14px; line-height: 1.6;
  text-align: justify;
  color: rgba(17,17,17,0.78);
  opacity: 0; visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0.35s;
}
.exp-projdesc-stack > .proj-desc.is-current {
  opacity: 1; visibility: inherit; transform: none;
  transition: opacity 0.35s ease 0.12s, transform 0.35s ease 0.12s, visibility 0s;
}

/* columna derecha: "// Projects" + pager encima del proyecto */
.deck .col-right { min-width: 0; }
.deck .col-projects-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: 0.9rem;
}
.deck .col-projects-head .projects-title { margin: 0; }

/* ===== BARRA DE PROGRESO DE LOS VISORES: más ancha y viva ===== */
.progress-bar {
  height: 9px;
  border-radius: 5px;
  background: rgba(246,244,239,0.22);
}
.progress-fill {
  border-radius: 5px;
  background: linear-gradient(90deg, #38e1ff 0%, #8b5cf6 38%, #ff5e8e 70%, #ff9a3d 100%);
  background-size: var(--track-w, 100%) 100%;
  background-repeat: no-repeat;
  box-shadow: 0 0 10px rgba(139,92,246,0.55);
}
.progress-fill span { font-size: 1.15rem; }

/* ===== DECK · PANTALLAS BAJAS (portátiles ~768px de alto) =====
   La tarjeta de experiencia (con la descripción del proyecto) es lo más alto
   de la diapositiva: se compacta para que todo quepa sin scroll interno. */
@media (min-width: 1000px) and (max-height: 860px) {
  .deck #page > section.stage > .container {
    padding-top: calc(var(--deck-top) + 1rem);
    padding-bottom: calc(var(--deck-bottom) + 1rem);
  }
  .deck .col-intro .section-head { margin-bottom: 0.7rem; }
  .deck .col-intro .big-num { font-size: clamp(2.4rem, 4.2vw, 3.4rem); }
  .deck .col-intro .section-title { font-size: 1.5rem; }
  .deck .col-intro .exp-intro { padding: 1.1rem 1.4rem; margin-bottom: 0; }
  .deck .col-intro .exp-role { font-size: clamp(1.15rem, 1.8vw, 1.5rem); margin-bottom: 0.6rem; }
  .deck .col-intro .exp-sites { margin-top: 0.8rem; gap: 0.5rem; }
  .deck .exp-intro .site-pill { padding: 0.3rem 0.9rem; font-size: 0.85rem; }
  .exp-projdesc { margin-top: 0.8rem; padding-top: 0.7rem; }
  .exp-projdesc-stack > .proj-desc { font-size: 13px; line-height: 1.5; }
  .deck .col-projects-head { margin-bottom: 0.5rem; }
  .deck .col-projects .proj-head { margin-bottom: 0.6rem; padding-top: 0.6rem; gap: 0.4rem; }
  .deck .col-projects .thumb { width: 70px; height: 44px; }
  .deck .col-projects .slider { width: min(100%, max(300px, calc((var(--stage-h) - 15rem) * 1.6))); }
  .deck #freelance .design-item img { height: clamp(70px, calc((var(--stage-h) - 4rem) / 3 - 0.7rem), 160px); }
}
@media (max-width: 600px) {
  .deck .exp-meta { flex-wrap: wrap; gap: 0.3rem 0.8rem; }
  .deck .exp-meta .head-loc { white-space: normal; overflow: visible; }
}

/* ===== DECORACIÓN DE FONDO MÁS TENUE =====
   Puntos, cruces, anillos, formas, palabras gigantes, franjas de color, código
   y glow quedan como textura: bajan opacidad e intensidad para no competir con
   el contenido. (Ninguno anima su opacidad salvo las franjas, cuyos keyframes
   de fade se redefinen aquí con valores menores.) */
.deck .stage .deco-dots    { opacity: 0.3; }
.deck .stage .deco-plus    { opacity: 0.35; }
.deck .stage .deco-ring,
.deck .stage .deco-ring-sm { opacity: 0.35; }
.deck .stage .deco-shape   { opacity: 0.28; }
.deck .stage .deco-word    { opacity: 0.5; }

@keyframes ssFadeA { from { opacity: 0.5;  } to { opacity: 0.36; } }
@keyframes ssFadeB { from { opacity: 0.38; } to { opacity: 0.5;  } }
@keyframes ssFadeC { from { opacity: 0.48; } to { opacity: 0.34; } }
@keyframes ssFadeAbout { from { opacity: 0.3; } to { opacity: 0.18; } }

.deck .code-col        { color: rgba(246, 244, 239, 0.05); }
.deck .code-col.accent { color: rgba(var(--red-rgb), 0.06); }
.deck #deck-glow { opacity: 0.1; }

/* ===== HERO: nombre completo + rol debajo + descripción en vidrio ===== */
.deck #hero .hero-top {
  flex-direction: column;
  align-items: flex-start;
  gap: 1.1rem;
  margin-bottom: 1.6rem;
}
.deck #hero .hero-top .hero-name {
  font-size: clamp(2.4rem, 6vw, 5.6rem);
  line-height: 0.98;
  margin: 0;
  white-space: nowrap;
  min-height: 0;
}
/* dos líneas justificadas (el JS iguala anchos con letter-spacing) */
.deck #hero .hero-name .hn-line {
  display: block;
  width: max-content;
  min-height: 0.98em;
}
.deck #hero .hero-top { gap: 1rem; }
.deck #hero .hero-rolebig .px { min-width: 0; }
.deck #hero .hero-rolebig { gap: 0.9rem; }
.deck #hero .hero-top .hero-rolebig { margin: 0; }
/* descripción sobre panel claro con efecto vidrio: el fondo animado queda
   detrás difuminado y no estorba la lectura */
.deck #hero .hero-desc {
  background: rgba(255, 255, 255, 0.58);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
          backdrop-filter: blur(16px) saturate(1.15);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(17, 17, 17, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  padding: 1.1rem 1.5rem;
  color: rgba(17, 17, 17, 0.86);
}
/* etiqueta "Portfolio · 2026 …": horizontal, esquina inferior izquierda */
.deck #hero .side-label.side-bl {
  writing-mode: horizontal-tb;
  top: auto; right: auto; transform: none;
  left: 1.6rem;
  bottom: calc(var(--deck-bottom) + 1.1rem);
  transition: bottom 0.55s cubic-bezier(.4,0,.2,1);
}
@media (max-width: 720px) {
  .deck #hero .hero-top .hero-name { white-space: normal; font-size: clamp(1.9rem, 9vw, 2.8rem); }
}

/* ===== HERO: bloque de ancho único =====
   --hero-w lo fija el JS con el ancho del nombre: rol, descripción y botones
   se alinean a él. "& DESIGNER" sin caja roja, mismo estilo que el rol. */
.deck #hero .hero-row,
.deck #hero .hero-ctas { width: var(--hero-w, 100%); max-width: 100%; }
.deck #hero .hero-row { margin-bottom: 1.4rem; }
.deck #hero .role-amp {
  background: none;
  color: var(--on-band);
  padding: 0;
  margin: 0;
}
.deck #hero .hero-rolebig { align-items: baseline; }

/* etiqueta "Portfolio · 2026 …" más visible y repetida arriba a la derecha */
.deck #hero .side-label {
  font-size: 10px;
  color: rgba(17, 17, 17, 0.78);
  letter-spacing: 0.12em;
}
.deck #hero .side-label.side-tr {
  writing-mode: horizontal-tb;
  bottom: auto; left: auto; transform: none;
  top: calc(var(--deck-top) + 1.4rem);
  right: 1.6rem;
}

/* ===== HERO EN DOS COLUMNAS =====
   Izquierda: nombre + rol (barra roja). Derecha: recuadro de vidrio con la
   cifra grande ("7+ years") en una columna y el texto en otra, y debajo los
   botones. Todo centrado vertical y horizontalmente. */
.deck #hero .hero-inner {
  display: grid;
  grid-template-columns: max-content minmax(300px, 440px);
  max-width: none;
  grid-template-areas:
    "top desc"
    "top ctas";
  column-gap: clamp(2.5rem, 5vw, 5rem);
  row-gap: 1.2rem;
  align-items: center;
  align-content: center;
  justify-content: center;
}
.deck #hero .hero-top  { grid-area: top; margin: 0; }
.deck #hero .hero-row  { grid-area: desc; margin: 0; align-self: end; }
.deck #hero .hero-ctas { grid-area: ctas; align-self: start; }
.deck #hero .hero-row,
.deck #hero .hero-ctas { width: 100%; }

/* rol: una sola barra roja con texto claro, sin subrayado */
.deck #hero .hero-top .hero-rolebig {
  border-bottom: none;
  background: var(--red);
  padding: 0.6rem 0.9rem;
  margin: 0;
}
.deck #hero .hero-rolebig .px,
.deck #hero .role-amp { color: #fff; }

/* recuadro: cifra | texto */
.deck #hero .hero-desc {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  padding: 1.3rem 1.6rem;
}
.hd-stat {
  display: flex; flex-direction: column; align-items: center;
  flex-shrink: 0;
  padding-right: 1.3rem;
  border-right: 1.5px solid rgba(17, 17, 17, 0.18);
  font-family: 'Goldman', sans-serif;
  color: var(--red);
  line-height: 0.9;
}
.hd-num  { font-size: clamp(3.2rem, 5vw, 4.6rem); font-weight: 700; }
.hd-unit {
  font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--on-band); margin-top: 0.35rem;
}
.hd-text {
  margin: 0;
  font-size: 1.15rem; line-height: 1.5;
  color: rgba(17, 17, 17, 0.85);
}

/* pantallas medianas/pequeñas: una sola columna */
@media (max-width: 1099px) {
  .deck #hero .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "top" "desc" "ctas";
    justify-content: start;
    max-width: 640px;
  }
  .deck #hero .hero-row { align-self: auto; }
}
.deck #hero .hero-desc .hd-stat { color: var(--red); }

/* nombre: más grande, casi sin interlineado y con las letras más juntas
   (el JS suma el espaciado de ajuste a este valor base) */
.deck #hero .hero-top .hero-name {
  font-size: clamp(2.4rem, 6vw, 5.6rem);
  line-height: 0.8;
  letter-spacing: -0.035em;
}
.deck #hero .hero-name .hn-line { min-height: 0.8em; }
.deck #hero .hero-top { gap: 1.3rem; }
.deck #hero .hd-text { font-size: 1.32rem; line-height: 1.45; }
.deck #hero .hero-name .hn-line { letter-spacing: -0.035em; }

/* ===== HERO: orden de aparición =====
   El rol (barra roja), el recuadro y los botones esperan su turno; el JS
   añade .hero-in-role / .hero-in-desc / .hero-in-ctas en orden de lectura. */
.deck #hero .hero-rolebig,
.deck #hero .hero-row,
.deck #hero .hero-ctas {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(.22,.8,.2,1);
}
.deck #hero.hero-in-role  .hero-rolebig,
.deck #hero.hero-in-desc  .hero-row,
.deck #hero.hero-in-ctas  .hero-ctas { opacity: 1; transform: none; }

/* ===== HERO: columnas de la MISMA altura =====
   Izquierda (nombre + rol) y derecha (recuadro + botones) comparten borde
   superior e inferior: el recuadro absorbe la diferencia (fila 1fr) y el
   nombre/rol se reparten arriba/abajo si la derecha fuese más alta. */
@media (min-width: 1100px) {
  .deck #hero .hero-inner {
    grid-template-rows: 1fr auto;
    align-items: stretch;
  }
  .deck #hero .hero-top {
    align-self: stretch;
    justify-content: space-between;
  }
  .deck #hero .hero-row  { align-self: stretch; display: flex; }
  .deck #hero .hero-row .hero-desc { flex: 1; }
  .deck #hero .hero-ctas { align-self: end; }
}

/* ===== CABECERA DE PROYECTOS: sin título, pager grande ===== */
.deck .col-projects-head .projects-title { display: none; }
.deck .col-projects-head.no-pager { display: none; }
.deck .col-projects-head { margin-bottom: 1.1rem; }
.deck .col-projects-head .proj-pager {
  flex: 1;
  flex-wrap: nowrap;
  gap: 0.6rem;
}
.deck .col-projects-head .proj-pager-count {
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
  margin-right: 1rem;
}
.deck .col-projects-head .proj-pager button {
  flex: 1 1 0;
  width: auto;
  max-width: 90px;
  height: 10px;
  border-radius: 5px;
}
.deck .col-projects-head .proj-pager button[aria-current="true"] {
  flex-grow: 2;
  max-width: 160px;
  width: auto;
}

/* ===== "Project description": nombre del proyecto + description ===== */
.exp-projdesc-stack > .proj-desc .pd-name {
  display: block;
  margin-bottom: 0.45rem;
  font-family: 'Goldman', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  color: var(--red);
}
.exp-projdesc-stack > .proj-desc .pd-label { color: rgba(17, 17, 17, 0.45); }

/* código que cae de fondo: más presente sobre las diapositivas oscuras */
.deck .code-col        { color: rgba(246, 244, 239, 0.13); }
.deck .code-col.accent { color: rgba(var(--red-rgb), 0.16); }

/* mientras script.js aún no marcó ninguna diapositiva activa (primer pintado),
   el hero ya se ve: evita un destello del fondo oscuro al cargar */
.deck-boot #page > #hero { visibility: visible; }

/* ===== IRIS ARCOÍRIS (transición hero/about) =====
   Contenedor circular que el deck escala de 0 a 1 siguiendo el borde del
   clip. Dos aros de conic-gradient con la paleta del proyecto, recortados en
   forma de anillo con máscaras radiales (no usan filter: blur). */
.iris-fx {
  position: fixed; z-index: 60; pointer-events: none;
  border-radius: 50%;
  will-change: transform, opacity;
}
.iris-fx span {
  position: absolute; inset: 0;
  border-radius: 50%;
  will-change: rotate;
}
/* halo arcoíris fino y suave que envuelve el borde del círculo */
.iris-halo {
  background: conic-gradient(from 0deg,
    #ff5e8e, #ff9a3d, #ffe14d, #4ade80, #38e1ff, #8b5cf6, #ff5e8e);
  -webkit-mask-image: radial-gradient(closest-side, transparent 84%, rgba(0,0,0,0.25) 87.5%, rgba(0,0,0,0.8) 89.3%, rgba(0,0,0,0.25) 91.3%, transparent 94%);
          mask-image: radial-gradient(closest-side, transparent 84%, rgba(0,0,0,0.25) 87.5%, rgba(0,0,0,0.8) 89.3%, rgba(0,0,0,0.25) 91.3%, transparent 94%);
  opacity: 0.65;
}
/* segundo halo: otra fase del arcoíris, un poco más ancho y suave, gira más
   rápido y en sentido contrario */
.iris-halo-b {
  background: conic-gradient(from 120deg,
    #38e1ff, #8b5cf6, #ff5e8e, #ff9a3d, #ffe14d, #4ade80, #38e1ff);
  -webkit-mask-image: radial-gradient(closest-side, transparent 82%, rgba(0,0,0,0.2) 86.5%, rgba(0,0,0,0.6) 89.3%, rgba(0,0,0,0.2) 92.3%, transparent 96%);
          mask-image: radial-gradient(closest-side, transparent 82%, rgba(0,0,0,0.2) 86.5%, rgba(0,0,0,0.6) 89.3%, rgba(0,0,0,0.2) 92.3%, transparent 96%);
  opacity: 0.5;
}

/* ===== IRIS CON BORDE DIFUMINADO =====
   La diapositiva que entra se revela con una máscara radial animada (el JS
   anima --iris-r): sólida por dentro y un degradado en el borde (hasta 140px
   a cada lado del radio), así las dos capas se funden en vez de cortarse. */
@property --iris-r { syntax: '<length>'; inherits: false; initial-value: 0px; }
.deck #page > .stage.iris-reveal {
  -webkit-mask-image: radial-gradient(circle at var(--ix, 50%) var(--iy, 50%),
    #000 calc(var(--iris-r) - min(140px, var(--iris-r) * 0.35)),
    transparent calc(var(--iris-r) + min(140px, var(--iris-r) * 0.35)));
          mask-image: radial-gradient(circle at var(--ix, 50%) var(--iy, 50%),
    #000 calc(var(--iris-r) - min(140px, var(--iris-r) * 0.35)),
    transparent calc(var(--iris-r) + min(140px, var(--iris-r) * 0.35)));
}

/* ONDA del iris: lente de agua en forma de aro. Refracta lo que hay detrás
   (desenfoque leve + saturación) en vez de pintar una banda clara, con un
   sombreado muy transparente (luz → sombra) que sugiere el volumen de la ola.
   La máscara radial suaviza los dos bordes del aro para que se funda. */
.iris-wave {
  position: fixed; z-index: 59; pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(closest-side,
    transparent 44%,
    rgba(255, 255, 255, 0.05) 60%,
    rgba(255, 255, 255, 0.12) 74%,
    rgba(17, 17, 17, 0.07) 87%,
    transparent 100%);
  -webkit-backdrop-filter: blur(2.5px) saturate(1.3) brightness(1.04);
          backdrop-filter: blur(2.5px) saturate(1.3) brightness(1.04);
  -webkit-mask-image: radial-gradient(closest-side, transparent 44%, rgba(0,0,0,0.6) 62%, #000 75%, rgba(0,0,0,0.6) 88%, transparent 100%);
          mask-image: radial-gradient(closest-side, transparent 44%, rgba(0,0,0,0.6) 62%, #000 75%, rgba(0,0,0,0.6) 88%, transparent 100%);
  will-change: transform, opacity;
}

/* onda sobre las secciones OSCURAS: más "agua" — refracción y brillo más
   marcados (lo de atrás se ilumina y satura dentro del aro), una cresta de
   luz fría y un valle de sombra que dan volumen de ola */
.iris-wave.on-dark {
  background: radial-gradient(closest-side,
    transparent 44%,
    rgba(150, 200, 255, 0.05) 58%,
    rgba(220, 240, 255, 0.16) 70%,
    rgba(255, 255, 255, 0.22) 75%,
    rgba(0, 0, 0, 0.28) 85%,
    rgba(0, 0, 0, 0.1) 92%,
    transparent 100%);
  -webkit-backdrop-filter: blur(3.5px) saturate(1.7) brightness(1.3) contrast(1.06);
          backdrop-filter: blur(3.5px) saturate(1.7) brightness(1.3) contrast(1.06);
}

/* ===== PISTA DE TECLADO (pixel art, esquina inferior derecha del hero) ===== */
.kbd-hint { display: none; }
/* fija en la esquina inferior derecha durante TODO el sitio (no sólo en el
   hero); el texto cambia de color según la diapositiva sea clara u oscura */
@media (min-width: 901px) {
  .deck .kbd-hint {
    display: flex; flex-direction: column; align-items: flex-end; gap: 0.55rem;
    position: fixed; z-index: 85;
    right: 1.6rem;
    bottom: calc(var(--deck-bottom) + 1.1rem);
    transition: bottom 0.55s cubic-bezier(.4,0,.2,1), opacity 0.4s ease;
    pointer-events: none;
  }
  /* con el zoom / la galería abiertos el instructivo SIGUE visible (las
     flechas y la rueda también funcionan ahí): ver regla más abajo */
}
.kbd-text {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  font-family: 'PressStart', monospace;
  font-size: 8px; line-height: 1;
  letter-spacing: 0.08em;
  color: rgba(246, 244, 239, 0.8);
  padding-bottom: 6px;
  transition: color 0.4s ease;
}
body.deck-light .kbd-text { color: rgba(17, 17, 17, 0.78); }
/* "PRESS" parpadea como un menú arcade */
.kbd-press {
  color: var(--red);
  font-size: 10px;
  animation: kbdBlink 1.1s steps(1) infinite;
}
@keyframes kbdBlink { 50% { opacity: 0; } }

/* pad: ▲ arriba al centro, ◄ ▼ ► abajo */
.kbd-keys {
  display: grid;
  grid-template-columns: repeat(3, 30px);
  grid-template-rows: repeat(2, 33px);
  gap: 3px;
}
.kbd-keys .kc[data-key="ArrowUp"]    { grid-column: 2; grid-row: 1; }
.kbd-keys .kc[data-key="ArrowLeft"]  { grid-column: 1; grid-row: 2; }
.kbd-keys .kc[data-key="ArrowDown"]  { grid-column: 2; grid-row: 2; }
.kbd-keys .kc[data-key="ArrowRight"] { grid-column: 3; grid-row: 2; }
.kc { display: block; width: 30px; height: 33px; }
.kc svg { display: block; width: 100%; height: 100%; overflow: visible;
  image-rendering: pixelated; transition: transform 0.06s steps(1); }
.kc .po { fill: #222; }
.kc .pf { fill: #f6f4ef; }
.kc .ps { fill: #b9b5ad; }
.kc .pa { fill: #222; }
/* tecla presionada: se hunde 1 "píxel" y se ilumina en rojo */
.kc.is-down svg { transform: translateY(2.5px); }
.kc.is-down .pf { fill: var(--red); }
.kc.is-down .pa { fill: #fff; }
.kc.is-down .ps { fill: #222; }

/* demo automática (hasta que el usuario usa el teclado): ► se presiona sola */
.kbd-hint:not(.used) .kc-demo svg { animation: kcDemoMove 2.4s steps(1) infinite; }
.kbd-hint:not(.used) .kc-demo .pf { animation: kcDemoFace 2.4s steps(1) infinite; }
.kbd-hint:not(.used) .kc-demo .pa { animation: kcDemoArrow 2.4s steps(1) infinite; }
@keyframes kcDemoMove  { 0%, 62%, 82%, 100% { transform: none; } 66%, 78% { transform: translateY(2.5px); } }
@keyframes kcDemoFace  { 0%, 62%, 82%, 100% { fill: #f6f4ef; } 66%, 78% { fill: #c93742; } }
@keyframes kcDemoArrow { 0%, 62%, 82%, 100% { fill: #222; } 66%, 78% { fill: #fff; } }
.anim-off .kbd-press,
.anim-off .kc svg,
.anim-off .kc rect { animation-play-state: paused; }

/* en la última diapositiva la barra de contacto se abre y sube la pista; en
   pantallas bajas chocaría con los skills del About → ahí se desvanece */
@media (max-height: 860px) {
  body.deck-at-end .kbd-hint { opacity: 0; }
}

/* filas de la pista: [texto + icono]; "— OR —" entre la rueda y las flechas */
.kbd-row { display: flex; align-items: flex-end; gap: 0.9rem; }
.kbd-scroll { align-items: center; }
.kbd-scroll .kbd-text { padding-bottom: 0; }
.kbd-or {
  font-family: 'PressStart', monospace;
  font-size: 7px; letter-spacing: 0.12em;
  color: rgba(246, 244, 239, 0.55);
  align-self: flex-end;
  margin-right: 24.5px;        /* centrado sobre el pad de flechas */
}
body.deck-light .kbd-or { color: rgba(17, 17, 17, 0.5); }

/* mouse pixel art con la rueda animada (gira hacia abajo en 3 pasos) */
.kbd-mouse { display: block; width: 27px; height: 39px; margin-right: 34.5px; }
.kbd-mouse svg { display: block; width: 100%; height: 100%; overflow: visible; }
.kbd-mouse .po { fill: #222; }
.kbd-mouse .pf { fill: #f6f4ef; }
.kbd-mouse .pw { fill: var(--red); animation: wheelRoll 1.2s steps(1) infinite; }
@keyframes wheelRoll {
  0%   { transform: translateY(0); }
  33%  { transform: translateY(1px); }
  66%  { transform: translateY(2px); opacity: 0.4; }
}
/* al usar la rueda real: el mouse se pone más rojo y la rueda gira rápido */
.kbd-mouse.is-scrolling .pf { fill: var(--red); }
.kbd-mouse.is-scrolling .pw { fill: #fff; animation-duration: 0.36s; }
/* clic izquierdo / derecho: el botón correspondiente se pinta de rojo */
.kbd-mouse.btn-l .pl,
.kbd-mouse.btn-r .pr { fill: var(--red); }
.anim-off .kbd-mouse .pw { animation-play-state: paused; }

/* pantallas bajas o angostas: la pista completa (con textos) invadía las
   miniaturas de los visores → versión compacta sólo con iconos (mouse, OR y
   flechas), más pequeña y metida en el margen derecho libre */
@media (min-width: 901px) and (max-height: 860px),
       (min-width: 901px) and (max-width: 1400px) {
  .deck .kbd-hint {
    right: 1rem;
    transform: scale(0.7);
    transform-origin: 100% 100%;
  }
  .deck .kbd-hint .kbd-text { display: none; }
}

/* ubicación de la experiencia: misma tipografía que la fecha (Goldman) y un
   poco más grande */
.deck .exp-meta .head-loc {
  font-family: 'Goldman', sans-serif;
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
}
.deck .exp-intro .exp-meta .proj-num { font-size: 0.86rem; }
/* con Goldman las ubicaciones largas no caben junto a la fecha: en vez de
   recortarlas con "…", la fecha pasa a una segunda línea (a la derecha) */
.deck .exp-meta { flex-wrap: wrap; row-gap: 0.35rem; }
.deck .exp-meta .head-loc { white-space: normal; overflow: visible; text-overflow: clip; }
.deck .exp-intro .exp-meta .proj-num { margin-left: auto; }

/* instructivo: sólo "SCROLL" y "PRESS", fijos (sin parpadeo), centrados con
   su icono */
.kbd-press { animation: none; }
.kbd-row { align-items: center; }
.kbd-row .kbd-text { padding-bottom: 0; }

/* ubicación + fecha: la ubicación se parte en dos líneas si no cabe y queda
   a la izquierda de la fecha, ambas centradas verticalmente (la fecha ya no
   baja a otra línea) */
.deck .exp-meta { flex-wrap: nowrap; align-items: center; }
.deck .exp-meta .head-loc { flex: 1 1 auto; min-width: 0; line-height: 1.35; }
.deck .exp-intro .exp-meta .proj-num { flex-shrink: 0; margin-left: 0; }
/* rejilla de dos columnas: palabras alineadas a la derecha en la primera,
   iconos (mouse / pad) centrados en la segunda */
@media (min-width: 901px) {
  .deck .kbd-hint {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    column-gap: 0.9rem;
    row-gap: 0.7rem;
  }
}
.kbd-row { display: contents; }
.kbd-row .kbd-text { justify-self: end; }
.kbd-mouse { justify-self: center; margin-right: 0; }
.kbd-keys { justify-self: center; }

/* ===== HERO PIXEL ART: barra del rol + recuadro de la descripción =====
   Esquinas "partidas" (escalón de 6px recortado en cada esquina, como en los
   marcos 8-bit) con clip-path + relieve de botón retro (inset claro arriba/
   izq., oscuro abajo/der.). La sombra es NORMAL (suave) y va en una capa que
   no se recorta, para que el clip-path no se la coma:
   · barra del rol: el fondo rojo pasa a ::before (recortado) y el box-shadow
     queda en el propio elemento
   · recuadro: la sombra va en su envoltorio (.hero-row::before), así el
     recuadro conserva su backdrop-filter (vidrio) recortado */
.deck #hero {
  --notch: 6px;
  --notch-clip: polygon(
    var(--notch) 0, calc(100% - var(--notch)) 0,
    calc(100% - var(--notch)) var(--notch), 100% var(--notch),
    100% calc(100% - var(--notch)), calc(100% - var(--notch)) calc(100% - var(--notch)),
    calc(100% - var(--notch)) 100%, var(--notch) 100%,
    var(--notch) calc(100% - var(--notch)), 0 calc(100% - var(--notch)),
    0 var(--notch), var(--notch) var(--notch));
}
.deck #hero .hero-top .hero-rolebig {
  position: relative;
  isolation: isolate;
  background: transparent;
  border-radius: 0;
  box-shadow: 0 12px 28px rgba(17, 17, 17, 0.2);
}
.deck #hero .hero-top .hero-rolebig::before {
  content: '';
  position: absolute; inset: 0;
  z-index: -1;
  background: var(--red);
  clip-path: var(--notch-clip);
  box-shadow:
    inset 6px 6px 0 0 rgba(255, 255, 255, 0.2),
    inset -6px -6px 0 0 rgba(0, 0, 0, 0.2);
}
.deck #hero .hero-desc {
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.64);
  clip-path: var(--notch-clip);
  box-shadow:
    inset 6px 6px 0 0 rgba(255, 255, 255, 0.85),
    inset -6px -6px 0 0 rgba(17, 17, 17, 0.07);
}
.deck #hero .hero-row { position: relative; isolation: isolate; }
.deck #hero .hero-row::before {
  content: '';
  position: absolute; inset: 0;
  z-index: -1;
  pointer-events: none;
  box-shadow: 0 14px 34px rgba(17, 17, 17, 0.14);
}

/* instructivo sólo con ilustraciones (mouse con rueda + pad de flechas),
   apiladas y centradas en una columna */
@media (min-width: 901px) {
  .deck .kbd-hint { grid-template-columns: auto; justify-items: center; }
}

/* ubicación y fecha del mismo tamaño */
.deck .exp-meta .head-loc,
.deck .exp-intro .exp-meta .proj-num { font-size: 12px; }

/* divisoria entre "7+ years" y el texto: punteada */
.deck #hero .hero-desc .hd-stat { border-right: 2px dashed rgba(17, 17, 17, 0.28); }

/* ===== MENÚ: más padding + reacción por cercanía (ver script.js) ===== */
#topbar ul { gap: 0.35rem; }
#topbar ul a {
  --prox: 0; --mx: 0px; --my: 0px;
  position: relative;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  transform: translate(var(--mx), var(--my));
  color: rgba(246, 244, 239, calc(0.6 + var(--prox) * 0.4));
  background: rgba(255, 255, 255, calc(var(--prox) * 0.07));
  transition: transform 0.18s cubic-bezier(.22,.8,.2,1), background 0.2s ease, color 0.2s ease;
}
#topbar ul a:hover {
  transform: translate(var(--mx), calc(var(--my) - 2px));
  background: rgba(255, 255, 255, 0.1);
}
#topbar ul a.active { color: var(--cream); }

/* imán mucho más lento y sin fondo (ni por cercanía ni al hover) */
#topbar ul a {
  background: none;
  transition: transform 0.9s cubic-bezier(.22,.8,.2,1), color 0.4s ease;
}
#topbar ul a:hover { background: none; }

/* ===== MENÚ: imán POR LETRA (ver script.js) =====
   El enlace ya no se mueve entero; cada letra se desplaza despacio hacia el
   cursor y se aclara según su cercanía. Los números (.micro) sólo se mueven. */
#topbar ul a { transform: none; }
#topbar ul a:hover { transform: translateY(-2px); }
#topbar ul a .mg-ch {
  display: inline-block;
  transform: translateY(var(--cy, 0px));
  color: color-mix(in srgb, #f6f4ef calc(var(--p, 0) * 100%), currentColor);
  transition: transform 0.9s cubic-bezier(.22,.8,.2,1), color 0.4s ease;
  will-change: transform;
}
#topbar ul a .micro .mg-ch { color: inherit; }
#topbar ul a .mg-word { display: inline-block; white-space: nowrap; }
/* imán por letra: en ambos ejes y más lento */
#topbar ul a .mg-ch {
  transform: translate(var(--cx, 0px), var(--cy, 0px));
  transition: transform 1.4s cubic-bezier(.22,.8,.2,1), color 0.5s ease;
}

/* ===== HERO: botones en pixel art (mismo lenguaje que la barra y el recuadro) =====
   Esquinas partidas con el mismo clip-path; el borde del botón "ghost" es un
   inset de 2px que el recorte corta en las esquinas (escalón). La sombra
   suave va en el contenedor (.hero-ctas) porque el clip-path se la comería. */
.deck #hero .hero-ctas { filter: drop-shadow(0 8px 14px rgba(17, 17, 17, 0.14)); }
.deck #hero .hero-ctas > a {
  border: 0;
  border-radius: 0;
  clip-path: var(--notch-clip);
  padding: calc(0.75rem + 1.5px) 1.8rem;
  transition: background 0.2s steps(2), color 0.2s steps(2), transform var(--transition);
}
/* SEE MY WORK: oscuro con relieve de botón retro */
.deck #hero .btn-dark {
  background: var(--on-band);
  color: var(--cream);
  box-shadow:
    inset 5px 5px 0 0 rgba(255, 255, 255, 0.14),
    inset -5px -5px 0 0 rgba(0, 0, 0, 0.35);
}
.deck #hero .btn-dark:hover { background: var(--red); color: #fff; }
/* DOWNLOAD CV: contorno de píxel con las esquinas partidas */
.deck #hero .btn-ghost {
  background: rgba(255, 255, 255, 0.45);
  color: var(--on-band);
  box-shadow: inset 0 0 0 2px var(--on-band);
}
.deck #hero .btn-ghost:hover { background: var(--on-band); color: var(--cream); }

/* ===== IMÁN POR LETRA en títulos y botones (ver script.js) ===== */
.mag .mg-word { display: inline-block; position: relative; white-space: nowrap; }
.mag .mg-ch {
  display: inline-block;
  transform: translate(var(--cx, 0px), var(--cy, 0px));
  transition: transform 1.4s cubic-bezier(.22,.8,.2,1);
}

/* ===== FLECHAS PRINCIPALES DEL DECK EN PIXEL ART =====
   Cuadradas con esquinas partidas (mismo escalón que el hero), relieve de
   botón retro y chevron de píxeles. Oscuras sobre las secciones oscuras,
   claras sobre hero/about; rojas al hover. */
.deck-arrow {
  --n: 6px;
  border: 0;
  border-radius: 0;
  clip-path: polygon(
    var(--n) 0, calc(100% - var(--n)) 0, calc(100% - var(--n)) var(--n), 100% var(--n),
    100% calc(100% - var(--n)), calc(100% - var(--n)) calc(100% - var(--n)),
    calc(100% - var(--n)) 100%, var(--n) 100%, var(--n) calc(100% - var(--n)),
    0 calc(100% - var(--n)), 0 var(--n), var(--n) var(--n));
  background: #222;
  color: var(--cream);
  box-shadow:
    inset 5px 5px 0 0 rgba(255, 255, 255, 0.14),
    inset -5px -5px 0 0 rgba(0, 0, 0, 0.4);
  transition: background 0.2s steps(2), color 0.2s steps(2), opacity var(--transition);
}
.deck-arrow svg { width: 14px; height: 21px; fill: currentColor; }
.deck-arrow.next svg { transform: translateX(1px); }
.deck-arrow.prev svg { transform: rotate(180deg) translateX(1px); }
.deck-arrow:hover:not(:disabled) { background: var(--red); color: #fff; border-color: transparent; }
.deck-arrow.next:hover:not(:disabled) svg { animation: none; }
body.deck-light .deck-arrow {
  background: #f6f4ef;
  color: #222;
  border: 0;
  box-shadow:
    inset 5px 5px 0 0 rgba(255, 255, 255, 0.9),
    inset -5px -5px 0 0 rgba(17, 17, 17, 0.14),
    inset 0 0 0 2px rgba(17, 17, 17, 0.55);
}
body.deck-light .deck-arrow:hover:not(:disabled) { background: var(--red); color: #fff; }

/* flechas principales: "círculo pixelado" (16×16 en escalones) en lugar del
   cuadrado con esquinas partidas — se lee redondo y conserva el borde 8-bit */
.deck-arrow {
  clip-path: polygon(31.25% 0%, 68.75% 0%, 68.75% 6.25%, 81.25% 6.25%, 81.25% 12.5%, 87.5% 12.5%, 87.5% 18.75%, 93.75% 18.75%, 93.75% 31.25%, 100% 31.25%, 100% 68.75%, 93.75% 68.75%, 93.75% 81.25%, 87.5% 81.25%, 87.5% 87.5%, 81.25% 87.5%, 81.25% 93.75%, 68.75% 93.75%, 68.75% 100%, 31.25% 100%, 31.25% 93.75%, 18.75% 93.75%, 18.75% 87.5%, 12.5% 87.5%, 12.5% 81.25%, 6.25% 81.25%, 6.25% 68.75%, 0% 68.75%, 0% 31.25%, 6.25% 31.25%, 6.25% 18.75%, 12.5% 18.75%, 12.5% 12.5%, 18.75% 12.5%, 18.75% 6.25%, 31.25% 6.25%);
  box-shadow:
    inset 4px 4px 0 0 rgba(255, 255, 255, 0.14),
    inset -4px -4px 0 0 rgba(0, 0, 0, 0.4);
}
body.deck-light .deck-arrow {
  background: #efebe3;
  box-shadow:
    inset 4px 4px 0 0 rgba(255, 255, 255, 0.95),
    inset -4px -4px 0 0 rgba(17, 17, 17, 0.18);
}

/* flechas principales con el contraste INVERTIDO: claras sobre las
   secciones oscuras, oscuras sobre las bandas claras (hero / about) */
.deck-arrow {
  background: #efebe3;
  color: #222;
  box-shadow:
    inset 4px 4px 0 0 rgba(255, 255, 255, 0.9),
    inset -4px -4px 0 0 rgba(17, 17, 17, 0.2);
}
body.deck-light .deck-arrow {
  background: #222;
  color: var(--cream);
  box-shadow:
    inset 4px 4px 0 0 rgba(255, 255, 255, 0.14),
    inset -4px -4px 0 0 rgba(0, 0, 0, 0.4);
}

/* flechas principales más pequeñas */
.deck-arrow { width: 46px; height: 46px; }
.deck-arrow svg { width: 11px; height: 17px; }
.deck #deck-count { width: 46px; margin-top: 4.4rem; }

/* flechas de los visores de proyecto en pixel art: mismo círculo pixelado y
   chevron de píxeles; mantienen la auto-inversión (mix-blend difference) y
   al hover pasan a sólidas */
.nav-btn {
  clip-path: polygon(31.25% 0%, 68.75% 0%, 68.75% 6.25%, 81.25% 6.25%, 81.25% 12.5%, 87.5% 12.5%, 87.5% 18.75%, 93.75% 18.75%, 93.75% 31.25%, 100% 31.25%, 100% 68.75%, 93.75% 68.75%, 93.75% 81.25%, 87.5% 81.25%, 87.5% 87.5%, 81.25% 87.5%, 81.25% 93.75%, 68.75% 93.75%, 68.75% 100%, 31.25% 100%, 31.25% 93.75%, 18.75% 93.75%, 18.75% 87.5%, 12.5% 87.5%, 12.5% 81.25%, 6.25% 81.25%, 6.25% 68.75%, 0% 68.75%, 0% 31.25%, 6.25% 31.25%, 6.25% 18.75%, 12.5% 18.75%, 12.5% 12.5%, 18.75% 12.5%, 18.75% 6.25%, 31.25% 6.25%);
  border-radius: 0;
  width: 42px; height: 42px;
}
.nav-btn svg { width: 10px; height: 15px; fill: currentColor; }
.next-btn svg { transform: translateX(1px); }
.prev-btn svg { transform: rotate(180deg) translateX(1px); }
.nav-btn:hover, .nav-btn:focus-visible { box-shadow: none; }

/* el instructivo ya no depende de (hover: hover): Brave lo reporta falso aun
   con mouse. En pantallas táctiles se oculta al primer toque (script.js) */
body.touch-ui .kbd-hint { display: none !important; }

/* ===== RENDIMIENTO =====
   Desenfoques ~30% menores: casi no cambia el aspecto (son degradados suaves)
   y el costo del blur crece con el radio en cada cuadro */
.sec-streak { filter: blur(48px); }
#fama .sec-streak         { filter: blur(60px); }
#freelance .sec-streak    { filter: blur(50px); }
#bambuco .sec-streak      { filter: blur(44px); }
#confiar .sec-streak      { filter: blur(40px); }
#volunteering .sec-streak { filter: blur(74px); }
#about .sec-streak        { filter: blur(52px); }
.orb { filter: blur(48px); }
.bb-deco .orb { filter: blur(42px); }

/* pestaña oculta: todo en pausa (el JS también detiene sus bucles) */
body.tab-hidden *, body.tab-hidden *::before, body.tab-hidden *::after {
  animation-play-state: paused !important;
}

/* flecha ► de la demo del instructivo: UNA animación (en el <svg>) en vez de
   una por píxel; los rects heredan color (cara) y fill (flecha) del svg */
.kbd-hint:not(.used) .kc-demo svg {
  color: #f6f4ef; fill: #222;
  animation: kcDemoAll 2.4s steps(1) infinite;
}
.kbd-hint:not(.used) .kc-demo .pf { fill: currentColor; animation: none; }
.kbd-hint:not(.used) .kc-demo .pa { fill: inherit; animation: none; }
@keyframes kcDemoAll {
  0%, 62%, 82%, 100% { transform: none; color: #f6f4ef; fill: #222; }
  66%, 78% { transform: translateY(2.5px); color: #c93742; fill: #fff; }
}

/* ===== MODO LIGERO (body.lite) =====
   Lo activa script.js si el equipo va lento, si el sistema pide reducir el
   movimiento, o a mano con ?lite=1. Quita las animaciones
   decorativas continuas y el vidrio esmerilado; el contenido no cambia. */
body.lite::before,
body.lite .sec-streak,
body.lite .hero-streak span,
body.lite .hero-streak span::before,
body.lite .hero-streak span::after,
body.lite .code-col,
body.lite .glitch::before, body.lite .glitch::after,
body.lite .px-glitch::before, body.lite .px-glitch::after,
body.lite #cursor::before, body.lite #cursor::after,
body.lite .deco-ring, body.lite .deco-ring-sm, body.lite .deco-plus,
body.lite .deco-dots, body.lite .deco-shape, body.lite .deco-word,
body.lite .section-wm, body.lite .orb {
  animation: none !important;
  will-change: auto !important;
}
body.lite .sec-streak { mix-blend-mode: normal; opacity: 0.55; }
body.lite.deck #hero .hero-desc {
  -webkit-backdrop-filter: none; backdrop-filter: none;
  background: rgba(255, 255, 255, 0.88);
}

/* menú entre ~1170 y 1400px: no cabía y los números (00, 01…) se partían en
   dos líneas → nunca se parte y el padding se reduce para que quepa */
#topbar ul a, #topbar ul a .micro { white-space: nowrap; }
#topbar ul a > * { flex-shrink: 0; }
@media (max-width: 1400px) {
  #topbar ul a { padding-left: 0.5rem; padding-right: 0.5rem; }
}

/* ===== TARJETA DE EXPERIENCIA EN PIXEL ART (mismo lenguaje que el hero) =====
   Esquinas partidas con clip-path. El fondo crema y el relieve retro van en
   ::before (recortado); la sombra suave queda en la propia tarjeta, que no se
   recorta, así el clip-path no se la come. */
.deck .exp-intro {
  --n: 8px;
  --notch-card: polygon(
    var(--n) 0, calc(100% - var(--n)) 0,
    calc(100% - var(--n)) var(--n), 100% var(--n),
    100% calc(100% - var(--n)), calc(100% - var(--n)) calc(100% - var(--n)),
    calc(100% - var(--n)) 100%, var(--n) 100%,
    var(--n) calc(100% - var(--n)), 0 calc(100% - var(--n)),
    0 var(--n), var(--n) var(--n));
  position: relative;
  isolation: isolate;
  background: transparent;
  border-radius: 0;
}
.deck .exp-intro::before {
  content: '';
  position: absolute; inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--cream);
  clip-path: var(--notch-card);
  box-shadow:
    inset 8px 8px 0 0 rgba(255, 255, 255, 0.9),
    inset -8px -8px 0 0 rgba(17, 17, 17, 0.08);
}
/* divisoria de "project description": puntos gruesos tipo píxel */
.deck .exp-projdesc { border-top: 2px dashed rgba(17, 17, 17, 0.3); }

/* enlaces a los sitios: contorno de píxel CERRADO con esquinas partidas.
   El contorno es el fondo oscuro del botón (recortado con escalón) y el
   relleno crema es un ::before 2px más adentro con el mismo escalón: así la
   línea sigue también el escalón de las esquinas */
.deck .exp-intro .site-pill {
  --n: 4px;
  --pill-clip: polygon(
    var(--n) 0, calc(100% - var(--n)) 0,
    calc(100% - var(--n)) var(--n), 100% var(--n),
    100% calc(100% - var(--n)), calc(100% - var(--n)) calc(100% - var(--n)),
    calc(100% - var(--n)) 100%, var(--n) 100%,
    var(--n) calc(100% - var(--n)), 0 calc(100% - var(--n)),
    0 var(--n), var(--n) var(--n));
  position: relative;
  isolation: isolate;
  border: 0;
  border-radius: 0;
  background: var(--on-band);
  clip-path: var(--pill-clip);
  padding: calc(0.45rem + 1.5px) 1.2rem;
  transition: color 0.2s steps(2), transform var(--transition);
}
.deck .exp-intro .site-pill::before {
  content: '';
  position: absolute; inset: 2px;
  z-index: -1;
  background: var(--cream);
  clip-path: var(--pill-clip);
  transition: opacity 0.2s steps(2);
}
.deck .exp-intro .site-pill:hover { background: var(--on-band); color: var(--cream); }
.deck .exp-intro .site-pill:hover::before { opacity: 0; }
@media (min-width: 1000px) and (max-height: 860px) {
  .deck .exp-intro .site-pill { padding: calc(0.3rem + 1.5px) 0.9rem; }
}

/* flecha principal "presionada" mientras pasa una diapositiva (la pone
   script.js con cualquier forma de navegar): igual que su hover */
.deck-arrow.is-pulse:not(:disabled),
body.deck-light .deck-arrow.is-pulse:not(:disabled) { background: var(--red); color: #fff; }

/* ===== ABOUT: retrato en pixel art =====
   Marco oscuro de 4px con esquinas partidas en escalón (clip-path) y una
   sombra "dura" de píxeles desplazada abajo-derecha (::before del marco,
   también escalonado). */
.about-frame {
  --n: 8px;
  --frame-clip: polygon(
    var(--n) 0, calc(100% - var(--n)) 0,
    calc(100% - var(--n)) var(--n), 100% var(--n),
    100% calc(100% - var(--n)), calc(100% - var(--n)) calc(100% - var(--n)),
    calc(100% - var(--n)) 100%, var(--n) 100%,
    var(--n) calc(100% - var(--n)), 0 calc(100% - var(--n)),
    0 var(--n), var(--n) var(--n));
  position: relative; z-index: 1;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  isolation: isolate;
}
.about-frame::before {
  content: '';
  position: absolute; inset: 0;
  transform: translate(10px, 10px);
  z-index: -1;
  background: rgba(17, 17, 17, 0.18);
  clip-path: var(--frame-clip);
  pointer-events: none;
}
.about-img .about-frame img,
.deck #about .about-img .about-frame img {
  display: block;
  border: 0;
  border-radius: 0;
  padding: 4px;
  background: #222;
  clip-path: var(--frame-clip);
  margin: 0;
}

/* ===== ABOUT: skills en pixel art =====
   Contorno de píxel que sigue el escalón de las esquinas, SIN relleno (el
   fondo del about se ve a través): el borde se dibuja con 12 franjas de
   degradado (4 lados + 2 tramos por esquina) y las esquinas se recortan */
#about .skill-tag {
  --n: 4px; --w: 2px; --c: rgba(17, 17, 17, 0.55);
  --g: linear-gradient(var(--c), var(--c));
  border: 0;
  border-radius: 0;
  padding: calc(0.3rem + 1px) 0.9rem;
  clip-path: polygon(
    var(--n) 0, calc(100% - var(--n)) 0,
    calc(100% - var(--n)) var(--n), 100% var(--n),
    100% calc(100% - var(--n)), calc(100% - var(--n)) calc(100% - var(--n)),
    calc(100% - var(--n)) 100%, var(--n) 100%,
    var(--n) calc(100% - var(--n)), 0 calc(100% - var(--n)),
    0 var(--n), var(--n) var(--n));
  background:
    /* lados */
    var(--g) var(--n) 0 / calc(100% - 2 * var(--n)) var(--w),
    var(--g) var(--n) 100% / calc(100% - 2 * var(--n)) var(--w),
    var(--g) 0 var(--n) / var(--w) calc(100% - 2 * var(--n)),
    var(--g) 100% var(--n) / var(--w) calc(100% - 2 * var(--n)),
    /* escalones: arriba-izq, arriba-der, abajo-izq, abajo-der */
    var(--g) var(--n) 0 / var(--w) calc(var(--n) + var(--w)),
    var(--g) 0 var(--n) / calc(var(--n) + var(--w)) var(--w),
    var(--g) calc(100% - var(--n)) 0 / var(--w) calc(var(--n) + var(--w)),
    var(--g) 100% var(--n) / calc(var(--n) + var(--w)) var(--w),
    var(--g) var(--n) 100% / var(--w) calc(var(--n) + var(--w)),
    var(--g) 0 calc(100% - var(--n)) / calc(var(--n) + var(--w)) var(--w),
    var(--g) calc(100% - var(--n)) 100% / var(--w) calc(var(--n) + var(--w)),
    var(--g) 100% calc(100% - var(--n)) / calc(var(--n) + var(--w)) var(--w);
  background-repeat: no-repeat;
}

/* ===== DESCRIPCIÓN DEL PROYECTO COMO TERMINAL =====
   Bloque oscuro con barra de ventana (tres luces + ruta) y texto monoespaciado
   claro; el nombre del proyecto es la "línea de comando" en verde. Mismas
   esquinas partidas del resto del pixel art. El padding va en el contenedor:
   el alto del stack lo fija el JS con el de la descripción actual. */
.deck .exp-projdesc {
  --n: 6px;
  position: relative;
  margin-top: 1.3rem;
  padding: calc(1.55rem + 0.75rem) 1.1rem 0.95rem;
  border-top: 0;
  background: #121417;
  clip-path: polygon(
    var(--n) 0, calc(100% - var(--n)) 0,
    calc(100% - var(--n)) var(--n), 100% var(--n),
    100% calc(100% - var(--n)), calc(100% - var(--n)) calc(100% - var(--n)),
    calc(100% - var(--n)) 100%, var(--n) 100%,
    var(--n) calc(100% - var(--n)), 0 calc(100% - var(--n)),
    0 var(--n), var(--n) var(--n));
  box-shadow:
    inset 4px 4px 0 0 rgba(255, 255, 255, 0.05),
    inset -4px -4px 0 0 rgba(0, 0, 0, 0.45);
}
/* barra de la ventana: luces roja / ámbar / verde (cuadradas, pixel) */
.deck .exp-projdesc::before {
  content: '';
  position: absolute; left: 0; right: 0; top: 0;
  height: 1.55rem;
  background:
    linear-gradient(#ff5f56, #ff5f56) 0.8rem 50% / 8px 8px no-repeat,
    linear-gradient(#ffbd2e, #ffbd2e) calc(0.8rem + 14px) 50% / 8px 8px no-repeat,
    linear-gradient(#27c93f, #27c93f) calc(0.8rem + 28px) 50% / 8px 8px no-repeat,
    #23262b;
  border-bottom: 2px solid #0b0c0e;
}
.deck .exp-projdesc::after {
  content: '~/dargo/projects';
  position: absolute; top: 0; left: 0; right: 0;
  height: 1.55rem;
  display: flex; align-items: center; justify-content: center;
  font-family: 'PressStart', monospace;
  font-size: 7px; letter-spacing: 0.08em;
  color: rgba(230, 237, 243, 0.45);
  pointer-events: none;
}
.deck .exp-projdesc-stack > .proj-desc {
  font-family: Consolas, 'Cascadia Mono', 'Courier New', monospace;
  font-size: 12.5px;
  line-height: 1.6;
  text-align: left;
  hyphens: none;
  color: rgba(222, 230, 238, 0.86);
}
.deck .exp-projdesc-stack > .proj-desc .pd-name {
  color: #5af78e;
  font-size: 0.8rem;
}
/* prompt antes del nombre */
.deck .exp-projdesc-stack > .proj-desc .pd-name::before {
  content: '$ ';
  color: rgba(222, 230, 238, 0.5);
}
.deck .exp-projdesc-stack > .proj-desc .pd-label { color: rgba(222, 230, 238, 0.5); }
.deck .exp-projdesc-stack > .proj-desc strong { color: #fff; }
.deck .exp-projdesc-stack > .proj-desc a { color: #8be9fd; }
@media (min-width: 1000px) and (max-height: 860px) {
  .deck .exp-projdesc { margin-top: 0.8rem; padding: calc(1.55rem + 0.55rem) 0.9rem 0.7rem; }
  .deck .exp-projdesc-stack > .proj-desc { font-size: 12px; line-height: 1.5; }
}

/* ===== VISOR DE PROYECTOS EN PIXEL ART (sutil) =====
   Esquinas partidas con clip-path y marco de píxel que sigue el escalón
   (12 franjas de degradado en un ::after encima del contenido, como los
   skills del about). */
.deck .col-projects .slider-main,
.deck .col-projects .thumb,
.deck .col-projects .slide-counter {
  --pclip: polygon(
    var(--n) 0, calc(100% - var(--n)) 0,
    calc(100% - var(--n)) var(--n), 100% var(--n),
    100% calc(100% - var(--n)), calc(100% - var(--n)) calc(100% - var(--n)),
    calc(100% - var(--n)) 100%, var(--n) 100%,
    var(--n) calc(100% - var(--n)), 0 calc(100% - var(--n)),
    0 var(--n), var(--n) var(--n));
  --g: linear-gradient(var(--fc), var(--fc));
  --pframe:
    var(--g) var(--n) 0 / calc(100% - 2 * var(--n)) var(--w),
    var(--g) var(--n) 100% / calc(100% - 2 * var(--n)) var(--w),
    var(--g) 0 var(--n) / var(--w) calc(100% - 2 * var(--n)),
    var(--g) 100% var(--n) / var(--w) calc(100% - 2 * var(--n)),
    var(--g) var(--n) 0 / var(--w) calc(var(--n) + var(--w)),
    var(--g) 0 var(--n) / calc(var(--n) + var(--w)) var(--w),
    var(--g) calc(100% - var(--n)) 0 / var(--w) calc(var(--n) + var(--w)),
    var(--g) 100% var(--n) / calc(var(--n) + var(--w)) var(--w),
    var(--g) var(--n) 100% / var(--w) calc(var(--n) + var(--w)),
    var(--g) 0 calc(100% - var(--n)) / calc(var(--n) + var(--w)) var(--w),
    var(--g) calc(100% - var(--n)) 100% / var(--w) calc(var(--n) + var(--w)),
    var(--g) 100% calc(100% - var(--n)) / calc(var(--n) + var(--w)) var(--w);
  border: 0;
  border-radius: 0;
  clip-path: var(--pclip);
}
/* visor principal: escalón de 8px, marco oscuro de 2px */
.deck .col-projects .slider-main { --n: 8px; --w: 2px; --fc: #222; }
.deck .col-projects .slider-main::after {
  content: '';
  position: absolute; inset: 0;
  z-index: 6;
  pointer-events: none;
  background: var(--pframe);
  background-repeat: no-repeat;
}
/* miniaturas: escalón de 4px; marco claro tenue, el activo más marcado */
.deck .col-projects .thumb {
  --n: 4px; --w: 2px; --fc: rgba(246, 244, 239, 0.35);
  position: relative;
}
.deck .col-projects .thumb.active { --fc: var(--cream); }
.deck .col-projects .thumb::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background: var(--pframe);
  background-repeat: no-repeat;
}
/* contador "01 / 05": contorno de píxel cerrado, relleno crema */
.deck .col-projects .slide-counter {
  --n: 3px; --w: 2px; --fc: #222;
  background: var(--pframe), #f6f4ef;
  background-repeat: no-repeat;
}
/* barra de progreso: puntas rectas y segmentada como una barra de carga
   retro (los cortes son franjas oscuras de 2px cada 9px) */
.deck .col-projects .progress-bar,
.deck .col-projects .progress-fill { border-radius: 0; }
.deck .col-projects .progress-bar {
  background:
    repeating-linear-gradient(90deg, transparent 0 7px, rgba(14, 14, 20, 0.55) 7px 9px),
    rgba(246, 244, 239, 0.22);
}
.deck .col-projects .progress-fill {
  background:
    repeating-linear-gradient(90deg, transparent 0 7px, rgba(14, 14, 20, 0.55) 7px 9px),
    linear-gradient(90deg, #38e1ff 0%, #8b5cf6 38%, #ff5e8e 70%, #ff9a3d 100%);
  background-size: auto, var(--track-w, 100%) 100%;
  background-repeat: repeat, no-repeat;
}

/* ===== BARRA DE PROGRESO: ESTELA DE COHETE EN PIXEL ART =====
   Sin divisiones. El relleno es la estela: el degradado de color con un
   núcleo caliente de 2px y una cola que se desvanece en ESCALONES (bandas
   de opacidad, como el sombreado 8-bit). La máscara va en ::before para no
   recortar el cohete, que vive en el span del relleno. */
.deck .col-projects .progress-bar {
  height: 8px;
  background: rgba(246, 244, 239, 0.16);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}
.deck .col-projects .progress-fill {
  background: none;
  box-shadow: none;
  position: relative;
}
.deck .col-projects .progress-fill::before {
  content: '';
  position: absolute; inset: 0;
  background:
    /* núcleo caliente (2px, blanco) en el último tramo, junto al cohete */
    linear-gradient(90deg, transparent 0 55%, rgba(255, 255, 255, 0.85) 55%) 0 50% / 100% 2px no-repeat,
    linear-gradient(90deg, #38e1ff 0%, #8b5cf6 38%, #ff5e8e 70%, #ff9a3d 100%) 0 0 / var(--track-w, 100%) 100% no-repeat;
  -webkit-mask-image: linear-gradient(90deg,
    rgba(0,0,0,0.18) 0 14%, rgba(0,0,0,0.36) 14% 28%,
    rgba(0,0,0,0.58) 28% 44%, rgba(0,0,0,0.8) 44% 62%, #000 62%);
          mask-image: linear-gradient(90deg,
    rgba(0,0,0,0.18) 0 14%, rgba(0,0,0,0.36) 14% 28%,
    rgba(0,0,0,0.58) 28% 44%, rgba(0,0,0,0.8) 44% 62%, #000 62%);
}
/* el cohete: sprite de 16×9 a 2px por píxel, la nariz sale del relleno */
.deck .col-projects .progress-fill .px-rocket {
  position: absolute;
  right: -26px; top: 50%;
  width: 32px; height: 18px;
  transform: translateY(-50%);
  font-size: 0; line-height: 0;
}
.px-rocket svg { display: block; width: 100%; height: 100%; overflow: visible; }
.px-rocket .ro { fill: #222; }
.px-rocket .rw { fill: #f6f4ef; }
.px-rocket .rb { fill: #38e1ff; }
.px-rocket .rr { fill: #e63946; }
.px-rocket .fy { fill: #ffbe0b; }
.px-rocket .fo { fill: #ff6b1a; }
.px-rocket .fw { fill: #fff6c2; }
/* llama de dos cuadros */
.px-rocket .fa { animation: pxFlameA 0.24s steps(1) infinite; }
.px-rocket .fb { animation: pxFlameB 0.24s steps(1) infinite; }
@keyframes pxFlameA { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes pxFlameB { 0% { opacity: 0; } 50% { opacity: 1; } }
/* chispas: cuadritos de 2px que quedan atrás y se apagan por pasos */
.px-sparks {
  position: absolute;
  left: 0; top: 50%;
  width: 2px; height: 2px;
  background: transparent;
  box-shadow:
    -4px -3px 0 #ffbe0b,
    -10px 2px 0 #ff6b1a,
    -16px -1px 0 #ff9a3d,
    -22px 3px 0 rgba(255, 190, 11, 0.6);
  animation: pxSparks 0.72s steps(4) infinite;
}
@keyframes pxSparks {
  from { transform: translate(0, -1px); opacity: 1; }
  to   { transform: translate(-12px, -1px); opacity: 0; }
}
body.lite .px-rocket .fa, body.lite .px-rocket .fb, body.lite .px-sparks { animation: none; }
body.lite .px-rocket .fb { opacity: 0; }

/* ESTELA ANIMADA: tres filas de partículas de 2px (claras) que corren hacia
   atrás a saltos de píxel, sobre el degradado. Mosaicos de 16/24/48px que se
   desplazan 48px por ciclo (múltiplo de los tres → bucle continuo). Sólo se
   anima background-position en una franja de 8px: barato. */
.deck .col-projects .progress-fill::before {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.9) 0 2px, transparent 2px) 0 0 / 24px 2px repeat-x,
    linear-gradient(90deg, rgba(255,255,255,0.65) 0 2px, transparent 2px) 6px 3px / 16px 2px repeat-x,
    linear-gradient(90deg, rgba(255,255,255,0.8) 0 2px, transparent 2px) 20px 6px / 48px 2px repeat-x,
    linear-gradient(90deg, #38e1ff 0%, #8b5cf6 38%, #ff5e8e 70%, #ff9a3d 100%) 0 0 / var(--track-w, 100%) 100% no-repeat;
  animation: pxTrail 0.9s steps(24) infinite;
}
@keyframes pxTrail {
  from { background-position: 0 0, 6px 3px, 20px 6px, 0 0; }
  to   { background-position: -48px 0, -42px 3px, -28px 6px, 0 0; }
}
/* el cohete vibra 1px arriba/abajo, como al acelerar */
.deck .col-projects .progress-fill .px-rocket svg { animation: pxBob 0.36s steps(1) infinite; }
@keyframes pxBob { 0% { transform: translateY(0); } 50% { transform: translateY(1px); } }
body.lite .deck .col-projects .progress-fill::before,
body.lite .deck .col-projects .progress-fill .px-rocket svg { animation: none; }

/* ===== FUEGO DEL COHETE (pixel art) =====
   Llama de cuadritos de 2px (box-shadow) detrás de la tobera, en dos
   cuadros que se alternan: amarillo/blanco junto al cohete, naranja y rojo
   hacia las puntas. Más brasas que saltan hacia arriba y hacia abajo. */
.px-rocket::before {
  content: '';
  position: absolute;
  left: 2px; top: 50%;
  width: 2px; height: 2px;
  margin-top: -1px;
  background: transparent;
  pointer-events: none;
  animation: pxFire 0.2s steps(1) infinite;
}
@keyframes pxFire {
  0% { box-shadow:
    -2px -2px 0 #ffbe0b,
    -2px 0px 0 #fff6c2,
    -2px 2px 0 #ffbe0b,
    -4px -2px 0 #ffbe0b,
    -4px 0px 0 #fff6c2,
    -4px 2px 0 #ffbe0b,
    -6px -4px 0 #ff6b1a,
    -6px -2px 0 #ffbe0b,
    -6px 0px 0 #ffbe0b,
    -6px 2px 0 #ffbe0b,
    -6px 4px 0 #ff6b1a,
    -8px -2px 0 #ff6b1a,
    -8px 0px 0 #ffbe0b,
    -8px 2px 0 #ff6b1a,
    -8px 4px 0 #e63946,
    -10px -4px 0 #e63946,
    -10px -2px 0 #ff6b1a,
    -10px 0px 0 #ff6b1a,
    -10px 2px 0 #ff6b1a,
    -12px -2px 0 #e63946,
    -12px 0px 0 #ff6b1a,
    -12px 2px 0 #e63946,
    -14px 0px 0 #e63946,
    -14px -4px 0 #ff6b1a,
    -16px -4px 0 #e63946,
    -16px 2px 0 #e63946,
    -18px 2px 0 rgba(230,57,70,0.6),
    -20px -2px 0 rgba(230,57,70,0.6),
    -24px 0px 0 rgba(230,57,70,0.4); }
  50% { box-shadow:
    -2px -2px 0 #ffbe0b,
    -2px 0px 0 #fff6c2,
    -2px 2px 0 #ffbe0b,
    -4px -4px 0 #ff6b1a,
    -4px -2px 0 #ffbe0b,
    -4px 0px 0 #ffbe0b,
    -4px 2px 0 #ff6b1a,
    -6px -2px 0 #ffbe0b,
    -6px 0px 0 #fff6c2,
    -6px 2px 0 #ffbe0b,
    -8px -4px 0 #e63946,
    -8px -2px 0 #ff6b1a,
    -8px 0px 0 #ff6b1a,
    -8px 2px 0 #ffbe0b,
    -8px 4px 0 #ff6b1a,
    -10px -2px 0 #ff6b1a,
    -10px 0px 0 #ffbe0b,
    -10px 2px 0 #e63946,
    -12px 0px 0 #ff6b1a,
    -12px 4px 0 #e63946,
    -14px -2px 0 #e63946,
    -14px 2px 0 #ff6b1a,
    -16px 0px 0 #e63946,
    -16px 4px 0 rgba(230,57,70,0.6),
    -18px -2px 0 rgba(230,57,70,0.6),
    -22px 2px 0 rgba(230,57,70,0.6),
    -26px -2px 0 rgba(230,57,70,0.4); }
}
/* brasas: más partículas que se quedan atrás */
.px-sparks {
  box-shadow:
    -4px -3px 0 #ffbe0b,
    -8px 3px 0 #ff6b1a,
    -12px -1px 0 #ff9a3d,
    -16px 4px 0 #ffbe0b,
    -20px -4px 0 #ff6b1a,
    -26px 1px 0 rgba(255, 190, 11, 0.7),
    -32px -2px 0 rgba(255, 107, 26, 0.55),
    -40px 3px 0 rgba(230, 57, 70, 0.45);
  animation: pxSparks 0.6s steps(5) infinite;
}
@keyframes pxSparks {
  from { transform: translate(0, -1px); opacity: 1; }
  to   { transform: translate(-16px, -1px); opacity: 0.1; }
}
.px-sparks::before, .px-sparks::after {
  content: '';
  position: absolute; left: 0; top: 0;
  width: 2px; height: 2px;
}
/* brasas que suben */
.px-sparks::before {
  box-shadow:
    -6px -6px 0 #ffbe0b,
    -14px -8px 0 #ff6b1a,
    -22px -6px 0 rgba(255, 190, 11, 0.8),
    -30px -10px 0 rgba(230, 57, 70, 0.6);
  animation: pxEmberUp 0.9s steps(6) infinite;
}
/* brasas que bajan */
.px-sparks::after {
  box-shadow:
    -10px 6px 0 #ff6b1a,
    -18px 8px 0 #ffbe0b,
    -26px 6px 0 rgba(255, 107, 26, 0.7),
    -36px 9px 0 rgba(230, 57, 70, 0.5);
  animation: pxEmberDown 1.1s steps(7) infinite;
}
@keyframes pxEmberUp   { from { transform: translate(0, 0); opacity: 1; } to { transform: translate(-14px, -6px); opacity: 0; } }
@keyframes pxEmberDown { from { transform: translate(0, 0); opacity: 1; } to { transform: translate(-16px, 6px); opacity: 0; } }

/* estela con MÁS partículas: cinco filas (mosaicos de 12/16/24/48px que
   dividen el ciclo de 48px), blancas y doradas */
.deck .col-projects .progress-fill::before {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.9) 0 2px, transparent 2px) 0 0 / 24px 2px repeat-x,
    linear-gradient(90deg, rgba(255,214,102,0.85) 0 2px, transparent 2px) 4px 2px / 12px 2px repeat-x,
    linear-gradient(90deg, rgba(255,255,255,0.65) 0 2px, transparent 2px) 6px 3px / 16px 2px repeat-x,
    linear-gradient(90deg, rgba(255,190,11,0.8) 0 2px, transparent 2px) 10px 4px / 24px 2px repeat-x,
    linear-gradient(90deg, rgba(255,255,255,0.8) 0 2px, transparent 2px) 20px 6px / 48px 2px repeat-x,
    linear-gradient(90deg, #38e1ff 0%, #8b5cf6 38%, #ff5e8e 70%, #ff9a3d 100%) 0 0 / var(--track-w, 100%) 100% no-repeat;
  animation: pxTrail 0.9s steps(24) infinite;
}
@keyframes pxTrail {
  from { background-position: 0 0, 4px 2px, 6px 3px, 10px 4px, 20px 6px, 0 0; }
  to   { background-position: -48px 0, -44px 2px, -42px 3px, -38px 4px, -28px 6px, 0 0; }
}
body.lite .px-rocket::before { animation: none; box-shadow: -2px 0 0 #ffbe0b, -4px 0 0 #ff6b1a; }
body.lite .px-sparks::before, body.lite .px-sparks::after { animation: none; opacity: 0; }

/* ===== BARRA DEL COHETE EN VERTICAL, A LA IZQUIERDA DEL VISOR =====
   El visor pasa a una rejilla: columna estrecha para la barra + visor y
   miniaturas. El relleno crece de abajo hacia arriba (--p, lo pone el JS) y
   el cohete apunta hacia arriba; fuego, brasas y partículas caen hacia abajo.
   La barra empieza un poco más abajo para que el cohete al 100% no tape la
   cabecera del proyecto. */
.deck .col-projects .slider {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  column-gap: 20px;
}
.deck .col-projects .slider > * { grid-column: 2; }
.deck .col-projects .slider > .slider-main { grid-row: 1; }
.deck .col-projects .slider > .progress-bar {
  grid-column: 1; grid-row: 1;
  align-self: stretch;
  width: 10px; height: auto;
  margin: 34px 0 0;
}
.deck .col-projects .progress-fill {
  position: absolute; left: 0; right: 0; bottom: 0;
  width: 100% !important;          /* el JS pone width (modo horizontal) */
  height: var(--p, 0%);
  transition: height 0.32s cubic-bezier(.3, .7, .2, 1);
}
/* estela vertical: degradado de abajo (frío) hacia arriba (caliente),
   partículas en COLUMNAS que caen y cola escalonada hacia abajo */
.deck .col-projects .progress-fill::before {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.9) 0 2px, transparent 2px) 0 0 / 2px 24px repeat-y,
    linear-gradient(180deg, rgba(255,214,102,0.85) 0 2px, transparent 2px) 2px 4px / 2px 12px repeat-y,
    linear-gradient(180deg, rgba(255,255,255,0.65) 0 2px, transparent 2px) 4px 6px / 2px 16px repeat-y,
    linear-gradient(180deg, rgba(255,190,11,0.8) 0 2px, transparent 2px) 6px 10px / 2px 24px repeat-y,
    linear-gradient(180deg, rgba(255,255,255,0.8) 0 2px, transparent 2px) 8px 20px / 2px 48px repeat-y,
    linear-gradient(0deg, #38e1ff 0%, #8b5cf6 38%, #ff5e8e 70%, #ff9a3d 100%) 0 100% / 100% var(--track-h, 100%) no-repeat;
  -webkit-mask-image: linear-gradient(0deg,
    rgba(0,0,0,0.18) 0 14%, rgba(0,0,0,0.36) 14% 28%,
    rgba(0,0,0,0.58) 28% 44%, rgba(0,0,0,0.8) 44% 62%, #000 62%);
          mask-image: linear-gradient(0deg,
    rgba(0,0,0,0.18) 0 14%, rgba(0,0,0,0.36) 14% 28%,
    rgba(0,0,0,0.58) 28% 44%, rgba(0,0,0,0.8) 44% 62%, #000 62%);
  animation: pxTrailV 0.9s steps(24) infinite;
}
@keyframes pxTrailV {
  from { background-position: 0 0, 2px 4px, 4px 6px, 6px 10px, 8px 20px, 0 100%; }
  to   { background-position: 0 48px, 2px 52px, 4px 54px, 6px 58px, 8px 68px, 0 100%; }
}
.deck .col-projects .progress-bar {
  box-shadow: inset -2px 0 0 rgba(0, 0, 0, 0.25);
}
/* cohete girado hacia ARRIBA, la nariz sale por encima del relleno */
.deck .col-projects .progress-fill .px-rocket {
  right: auto;
  left: 50%; top: 0;
  transform: translate(-50%, -100%) translateY(8px) rotate(-90deg);
}
body.lite .deck .col-projects .progress-fill::before { animation: none; }

/* ===== BARRA DE PROGRESO GENERAL: OVNI PIXEL ART =====
   La barra es la estela del ovni: degradado de color con la cola
   desvaneciéndose en escalones hacia la izquierda y estrellitas de píxel que
   titilan dentro. El ovni flota al final (vaivén de 1px), sus luces se
   encienden en cadena y proyecta un rayo tractor tenue hacia abajo. */
.deck #deck-progress { height: 6px; }
.deck #deck-progress span {
  position: relative;
  background: none;
  box-shadow: none;
  border-radius: 0;
}
.deck #deck-progress span::before {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.95) 0 2px, transparent 2px) 0 2px / 30px 2px repeat-x,
    linear-gradient(90deg, rgba(255,255,255,0.6) 0 2px, transparent 2px) 14px 0 / 20px 2px repeat-x,
    linear-gradient(90deg, rgba(255,255,255,0.75) 0 2px, transparent 2px) 7px 4px / 40px 2px repeat-x,
    linear-gradient(90deg, #38e1ff 0%, #8b5cf6 35%, #ff5e8e 68%, #ff9a3d 100%) 0 0 / 100vw 100% no-repeat;
  -webkit-mask-image: linear-gradient(90deg,
    rgba(0,0,0,0.2) 0 10%, rgba(0,0,0,0.4) 10% 22%,
    rgba(0,0,0,0.62) 22% 38%, rgba(0,0,0,0.82) 38% 56%, #000 56%);
          mask-image: linear-gradient(90deg,
    rgba(0,0,0,0.2) 0 10%, rgba(0,0,0,0.4) 10% 22%,
    rgba(0,0,0,0.62) 22% 38%, rgba(0,0,0,0.82) 38% 56%, #000 56%);
  animation: ufoStars 1.6s steps(1) infinite;
}
/* las estrellitas titilan cambiando de sitio a saltos */
@keyframes ufoStars {
  0%   { background-position: 0 2px, 14px 0, 7px 4px, 0 0; }
  33%  { background-position: 10px 2px, 4px 0, 27px 4px, 0 0; }
  66%  { background-position: 20px 2px, 9px 0, 17px 4px, 0 0; }
}
.px-ufo {
  position: absolute;
  right: -20px; top: 50%;
  width: 36px; height: 26px;
  margin-top: -8px;               /* el casco queda centrado en la barra */
  pointer-events: none;
}
.px-ufo svg { display: block; width: 100%; height: 100%; overflow: visible; }
.px-ufo .ufo-body { animation: ufoBob 0.8s steps(1) infinite; }
@keyframes ufoBob { 0% { transform: translateY(0); } 50% { transform: translateY(-1px); } }
.px-ufo .uo { fill: #222; }
.px-ufo .us { fill: #b9c2cc; }
.px-ufo .ub { fill: #7ff0ff; }
.px-ufo .uw { fill: #ffffff; }
/* luces en cadena: cada tercio se enciende por turnos */
.px-ufo .ul0, .px-ufo .ul1, .px-ufo .ul2 { fill: #5a5f66; animation: ufoLight 0.9s steps(1) infinite; }
.px-ufo .ul1 { animation-delay: -0.3s; }
.px-ufo .ul2 { animation-delay: -0.6s; }
@keyframes ufoLight { 0% { fill: #ffbe0b; } 33% { fill: #ff5e8e; } 66% { fill: #5a5f66; } }
/* rayo tractor: parpadea suave */
.px-ufo .bm { fill: #7ff0ff; }
.px-ufo .ufo-beam { animation: ufoBeam 1.2s steps(1) infinite; }
@keyframes ufoBeam { 0% { opacity: 0.55; } 50% { opacity: 0.3; } }
body.deck-light .px-ufo .bm { fill: #38a8c9; }
body.lite #deck-progress span::before,
body.lite .px-ufo .ufo-body, body.lite .px-ufo .ufo-beam,
body.lite .px-ufo .ul0, body.lite .px-ufo .ul1, body.lite .px-ufo .ul2 { animation: none; }
/* el ovni sobresale por arriba de la barra: va por encima del topbar */
.deck #deck-progress { z-index: 101; }
/* la barra del cohete ocupa visor + miniaturas: arranca abajo, junto a las
   previews, y sube hasta el borde superior del visor */
.deck .col-projects .slider > .progress-bar { grid-row: 1 / span 2; }
/* ovni un poco más grande (2.5px por píxel) */
.px-ufo { width: 45px; height: 32.5px; right: -25px; margin-top: -10px; }
/* el ovni va DENTRO del final de la estela (no sobresale): al 100% su borde
   derecho toca el borde de la pantalla en vez de cortarse */
.px-ufo { right: 0; }
/* la barra del cohete empieza a ras del visor: al 100% la nariz del cohete
   sube casi hasta la línea de tecnologías */
.deck .col-projects .slider > .progress-bar { margin-top: 8px; }

/* precalentado: la diapositiva oculta se pinta una vez, casi invisible
   (opacity 0 haría que el navegador se salte el pintado) */
.deck #page > .stage.is-warming:not(.is-active):not(.is-leaving) {
  visibility: visible;
  opacity: 0.002;
  pointer-events: none !important;
}
/* la luz oscila junto con la nave: el vaivén va en el svg entero (1 unidad
   del dibujo = 2.5px) y no sólo en el cuerpo */
.px-ufo .ufo-body { animation: none; }
.px-ufo svg { animation: ufoBobAll 0.8s steps(1) infinite; }
@keyframes ufoBobAll { 0% { transform: translateY(0); } 50% { transform: translateY(-2.5px); } }
body.lite .px-ufo svg { animation: none; }

/* ===== BOTÓN "DOWNLOAD CV" EN PIXEL ART =====
   Esquinas en escalón (clip-path) y contorno de píxel cerrado (12 franjas);
   al hover el relleno se va y queda sólo el contorno crema. */
#topbar .btn-light {
  --n: 4px; --w: 2px; --fc: var(--cream);
  --g: linear-gradient(var(--fc), var(--fc));
  --pframe:
    var(--g) var(--n) 0 / calc(100% - 2 * var(--n)) var(--w),
    var(--g) var(--n) 100% / calc(100% - 2 * var(--n)) var(--w),
    var(--g) 0 var(--n) / var(--w) calc(100% - 2 * var(--n)),
    var(--g) 100% var(--n) / var(--w) calc(100% - 2 * var(--n)),
    var(--g) var(--n) 0 / var(--w) calc(var(--n) + var(--w)),
    var(--g) 0 var(--n) / calc(var(--n) + var(--w)) var(--w),
    var(--g) calc(100% - var(--n)) 0 / var(--w) calc(var(--n) + var(--w)),
    var(--g) 100% var(--n) / calc(var(--n) + var(--w)) var(--w),
    var(--g) var(--n) 100% / var(--w) calc(var(--n) + var(--w)),
    var(--g) 0 calc(100% - var(--n)) / calc(var(--n) + var(--w)) var(--w),
    var(--g) calc(100% - var(--n)) 100% / var(--w) calc(var(--n) + var(--w)),
    var(--g) 100% calc(100% - var(--n)) / calc(var(--n) + var(--w)) var(--w);
  border: 0;
  border-radius: 0;
  padding: calc(0.55rem + 1.5px) calc(1.3rem + 1.5px);
  clip-path: polygon(
    var(--n) 0, calc(100% - var(--n)) 0,
    calc(100% - var(--n)) var(--n), 100% var(--n),
    100% calc(100% - var(--n)), calc(100% - var(--n)) calc(100% - var(--n)),
    calc(100% - var(--n)) 100%, var(--n) 100%,
    var(--n) calc(100% - var(--n)), 0 calc(100% - var(--n)),
    0 var(--n), var(--n) var(--n));
  background: var(--pframe), var(--cream);
  background-repeat: no-repeat;
  /* el hover cambia de golpe, como un sprite */
  transition: color 0s, transform 0.15s steps(2);
}
#topbar .btn-light:hover {
  background: var(--pframe);
  background-repeat: no-repeat;
}
#topbar .btn-light .cv-icon { image-rendering: pixelated; transition: none; }
@media (max-width: 900px) {
  #topbar .btn-light { padding: calc(0.45rem + 1.5px); --n: 3px; }
}

/* DOWNLOAD CV del hero: mismo icono de descarga que el del topbar */
.hero-ctas .btn-cv {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.hero-ctas .btn-cv .cv-icon {
  width: 18px; height: 18px; object-fit: contain; flex: none;
  image-rendering: pixelated;
}
/* al hover el fondo se vuelve oscuro: icono en negativo */
.hero-ctas .btn-cv:hover .cv-icon { filter: none; }

/* ===== CURSOR EN PIXEL ART =====
   Sprites SVG nítidos (img/px): flecha por defecto, MANITO en enlaces y
   botones, LUPA +/− en imágenes ampliables y en el visor. Cada uno tiene su
   punto activo (--hx/--hy): punta de la flecha, yema del dedo, centro de la
   lente. Se mantienen glitch, estela, inversión sobre fondo oscuro y el
   blend de la lupa (reglas de arriba). */
#cursor {
  --hx: 1px; --hy: 1px;
  width: 24px; height: 38px;
  background: url('img/px/cursor.svg') 0 0 / 100% 100% no-repeat;
  image-rendering: pixelated;
  transform-origin: var(--hx) var(--hy);
  transform: translate(calc(-1 * var(--hx)), calc(-1 * var(--hy)));
  filter: drop-shadow(2px 2px 0 rgba(17, 17, 17, 0.3));
}
body.cur-link #cursor {
  --hx: 12px; --hy: 1px;
  width: 32px; height: 34px;
  background-image: url('img/px/hand.svg');
  transform: translate(calc(-1 * var(--hx)), calc(-1 * var(--hy))) scale(1.25);
}
body.mag-in #cursor,
body.zoom-open #cursor,
body.lb-open #cursor {
  --hx: 11px; --hy: 11px;
  width: 30px; height: 30px;
  transform: translate(calc(-1 * var(--hx)), calc(-1 * var(--hy)));
}
body.mag-in #cursor { background-image: url('img/px/zoomin.svg'); }
body.zoom-open #cursor,
body.lb-open #cursor { background-image: url('img/px/zoomout.svg'); }
body.zoom-open.zoom-ctrl #cursor,
body.lb-open.zoom-ctrl #cursor {
  --hx: 1px; --hy: 1px;
  width: 24px; height: 38px;
  background-image: url('img/px/cursor.svg');
  filter: drop-shadow(2px 2px 0 rgba(17, 17, 17, 0.3));
}
body.zoom-open.zoom-ctrl.cur-link #cursor,
body.lb-open.zoom-ctrl.cur-link #cursor { background-image: url('img/px/hand.svg'); }

/* estela: flecha roja; manito roja sobre enlaces; lupa en el visor */
.cursor-ghost {
  --hx: 1px; --hy: 1px;
  width: 24px; height: 38px;
  background: url('img/px/cursor-red.svg') 0 0 / 100% 100% no-repeat;
  image-rendering: pixelated;
  transform-origin: var(--hx) var(--hy);
  transform: translate(calc(-1 * var(--hx)), calc(-1 * var(--hy)));
  filter: drop-shadow(0 0 4px rgba(var(--red-rgb), 0.4));
}
.cursor-ghost.gh-hand { --hx: 12px; --hy: 1px; width: 32px; height: 34px; background-image: url('img/px/hand-red.svg'); }
.cursor-ghost.gz-in,
.cursor-ghost.gz-out { --hx: 11px; --hy: 11px; width: 30px; height: 30px; }
.cursor-ghost.gz-in  { background-image: url('img/px/zoomin.svg'); }
.cursor-ghost.gz-out { background-image: url('img/px/zoomout.svg'); }
@keyframes ghostFade {
  from { opacity: 0.38; }
  to   { opacity: 0; transform: translate(calc(-1 * var(--hx)), calc(-1 * var(--hy))) scale(0.7); }
}
@keyframes ghostFadeZoom {
  from { opacity: 0.55; }
  to   { opacity: 0; transform: translate(calc(-1 * var(--hx)), calc(-1 * var(--hy))) scale(0.7); }
}

/* DOWNLOAD CV del topbar: el texto nunca se parte en dos líneas y el botón no
   se encoge (el menú cede espacio antes que él) */
#topbar .btn-light { flex-shrink: 0; white-space: nowrap; min-width: max-content; }
#topbar .btn-light .cv-text { white-space: nowrap; }

/* ===== INSTRUCTIVO: "SCROLL · OR · PRESS TO NAVIGATE" =====
   Palabras en rojo en la columna izquierda de la rejilla: SCROLL junto al
   mouse, OR en medio y PRESS TO NAVIGATE junto a las flechas. Fijas en el
   hero; en el resto aparecen al pasar el mouse por el instructivo (a saltos,
   como texto de videojuego). Ocultas con opacidad: no mueven los iconos. */
@media (min-width: 901px) {
  .deck .kbd-hint { pointer-events: auto; }
}
.kbd-say {
  grid-column: 1;
  justify-self: end;
  font-family: 'PressStart', monospace;
  font-size: 9px; line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--red);
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.3s steps(3), transform 0.3s steps(3);
  pointer-events: none;
}
.kbd-say-or { font-size: 8px; opacity: 0; }
.kbd-hint .kbd-mouse { grid-column: 2; justify-self: center; }
.kbd-hint .kbd-keys  { grid-column: 2; }
.kbd-hint:hover .kbd-say { opacity: 1; transform: none; }
/* versión compacta (escalada al 70%): letra algo mayor para que se lea */
@media (min-width: 901px) and (max-height: 860px),
       (min-width: 901px) and (max-width: 1400px) {
  .kbd-say { font-size: 12px; }
  .kbd-say-or { font-size: 10px; }
}
/* palabras más pegadas a los iconos; "— OR —" centrado entre el mouse y las
   flechas (columna de los iconos), con rayas de píxel a los lados */
@media (min-width: 901px) {
  .deck .kbd-hint { column-gap: 0.45rem; }
}
.kbd-say-or {
  grid-column: 2;
  justify-self: center;
  display: flex; align-items: center; gap: 5px;
}
.kbd-say-or::before,
.kbd-say-or::after {
  content: '';
  width: 12px; height: 2px;
  background: currentColor;
}
/* palabras a 6px de su icono: SCROLL se mete hasta el mouse (centrado en una
   columna de 96px) y PRESS TO / NAVIGATE, en dos líneas, se mete en el hueco
   libre del pad: al lado de ▲ y encima de ◄ */
@media (min-width: 901px) {
  .deck .kbd-hint { column-gap: 6px; }
}
.kbd-scroll .kbd-say { margin-right: -34.5px; }
.kbd-say-press {
  align-self: start;
  margin-right: -33px;
  margin-top: 6px;
  line-height: 1.5;
  text-align: right;
}
/* versión compacta: PRESS TO / NAVIGATE debe caber en el alto de la tecla ▲
   (33px) para no montarse sobre ◄ */
@media (min-width: 901px) and (max-height: 860px),
       (min-width: 901px) and (max-width: 1400px) {
  .kbd-say { font-size: 10px; }
  .kbd-say-press { line-height: 1.3; margin-top: 3px; }
}
/* aparición del instructivo: suave (antes iba a saltos con steps(3) y se
   sentía como pocos fps) */
.kbd-say { transition: opacity 0.25s ease, transform 0.25s ease; }
/* sobre las diapositivas oscuras (body) el texto del instructivo va en blanco;
   en las claras (hero / about) sigue rojo */
body:not(.deck-light) .kbd-say { color: #fff; }

/* streaks del hero un poco más presentes: más opacos (0.7 → 1) y con un
   movimiento algo más rápido para que se note que están vivos (sólo
   opacity/transform: sigue corriendo en el compositor) */
#hero .hero-streak { opacity: 1; }
#hero .hero-streak span:nth-child(1) {
  animation-duration: 10s, 16s;
}
#hero .hero-streak span:nth-child(2) {
  opacity: 0.85;
  animation-duration: 12s, 20s;
}
#hero .hero-streak span:nth-child(n+3) { animation-duration: 40s; }
#hero .hero-streak span:nth-child(4) { animation-duration: 48s; }
#hero .hero-streak span:nth-child(5) { animation-duration: 56s; }
/* ajuste: color un poco más tenue (1 → 0.85) y más recorrido en el
   movimiento (deriva y vaivén más amplios, algo más rápidos) */
#hero .hero-streak { opacity: 0.85; }
#hero .hero-streak span:nth-child(1) {
  animation: heroPulse 8s ease-in-out infinite alternate,
             heroSway 13s ease-in-out infinite alternate;
}
#hero .hero-streak span:nth-child(2) {
  animation: heroPulse2 10s ease-in-out infinite alternate,
             heroSway 17s ease-in-out infinite alternate-reverse;
}
#hero .hero-streak span:nth-child(n+3) { animation-duration: 32s; }
#hero .hero-streak span:nth-child(4) { animation-duration: 38s; }
#hero .hero-streak span:nth-child(5) { animation-duration: 45s; }
@keyframes heroPulse {
  0%   { transform: translate3d(-9%, -6%, 0) rotate(-20deg) scale(0.92, 0.88); }
  33%  { transform: translate3d( 6%,  4%, 0) rotate(-12deg) scale(1.1, 1.14); }
  66%  { transform: translate3d(-4%,  8%, 0) rotate(-22deg) scale(1.04, 0.86); }
  100% { transform: translate3d( 8%,  0%, 0) rotate(-13deg) scale(1.14, 1.08); }
}
@keyframes heroPulse2 {
  0%   { transform: translate3d( 8%,  4%, 0) rotate(15deg) scale(1, 1); }
  40%  { transform: translate3d(-6%,  9%, 0) rotate(7deg)  scale(1.16, 1.12); }
  100% { transform: translate3d(-8%, -6%, 0) rotate(18deg) scale(1.08, 0.86); }
}
@keyframes heroSway {
  from { rotate: -20deg; }
  to   { rotate: 20deg; }
}

/* ===== FONDO FLUIDO DEL HERO (canvas WebGL, ver script.js) =====
   Va donde iban las franjas (.hero-streak), que se ocultan si hay WebGL.
   Se dibuja a baja resolución y se escala suavizado; multiply sobre el crema
   (el blanco del shader no tiñe nada). */
.hero-fluid {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.6;
}
#hero.has-fluid .hero-streak { display: none; }
/* el fondo fluido también va en el about: ahí reemplaza a sus franjas */
.has-fluid > .hero-streak,
.has-fluid > .sec-streak { display: none; }

/* ===== TEXTO DEL ABOUT EN TARJETA PIXEL ART =====
   Mismo lenguaje que el retrato y las tarjetas de experiencia: esquinas en
   escalón, contorno de píxel cerrado (12 franjas) y sombra dura desplazada.
   El fondo es blanco casi opaco para que el texto se lea sobre el aceite. */
.about-copy {
  --n: 8px; --w: 2px; --fc: #222;
  --g: linear-gradient(var(--fc), var(--fc));
  --pclip: polygon(
    var(--n) 0, calc(100% - var(--n)) 0,
    calc(100% - var(--n)) var(--n), 100% var(--n),
    100% calc(100% - var(--n)), calc(100% - var(--n)) calc(100% - var(--n)),
    calc(100% - var(--n)) 100%, var(--n) 100%,
    var(--n) calc(100% - var(--n)), 0 calc(100% - var(--n)),
    0 var(--n), var(--n) var(--n));
  --pframe:
    var(--g) var(--n) 0 / calc(100% - 2 * var(--n)) var(--w),
    var(--g) var(--n) 100% / calc(100% - 2 * var(--n)) var(--w),
    var(--g) 0 var(--n) / var(--w) calc(100% - 2 * var(--n)),
    var(--g) 100% var(--n) / var(--w) calc(100% - 2 * var(--n)),
    var(--g) var(--n) 0 / var(--w) calc(var(--n) + var(--w)),
    var(--g) 0 var(--n) / calc(var(--n) + var(--w)) var(--w),
    var(--g) calc(100% - var(--n)) 0 / var(--w) calc(var(--n) + var(--w)),
    var(--g) 100% var(--n) / calc(var(--n) + var(--w)) var(--w),
    var(--g) var(--n) 100% / var(--w) calc(var(--n) + var(--w)),
    var(--g) 0 calc(100% - var(--n)) / calc(var(--n) + var(--w)) var(--w),
    var(--g) calc(100% - var(--n)) 100% / var(--w) calc(var(--n) + var(--w)),
    var(--g) 100% calc(100% - var(--n)) / calc(var(--n) + var(--w)) var(--w);
  position: relative;
  isolation: isolate;
  padding: 1.3rem 1.6rem 0.4rem;
  margin: 0 10px 1.6rem 0;   /* deja sitio a la sombra */
}
/* tarjeta: relleno + contorno de píxel */
.about-copy::before {
  content: '';
  position: absolute; inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--pframe), rgba(255, 255, 255, 0.88);
  background-repeat: no-repeat;
  clip-path: var(--pclip);
}
/* sombra dura de píxel, desplazada abajo a la derecha */
.about-copy::after {
  content: '';
  position: absolute; inset: 0;
  z-index: -2;
  pointer-events: none;
  transform: translate(8px, 8px);
  background: rgba(17, 17, 17, 0.16);
  clip-path: var(--pclip);
}
@media (max-width: 900px) {
  .about-copy { padding: 1rem 1.1rem 0.2rem; --n: 6px; }
}

/* skills del about: relleno blanco y contorno oscuro como la tarjeta del
   texto; cada fila se reparte TODO el ancho (cada tag crece) para que no
   queden huecos al final de las filas */
#about .skills {
  display: flex; flex-wrap: wrap;
  gap: 8px;
  margin-right: 10px;      /* mismo ancho que la tarjeta (su sombra) */
}
#about .skill-tag {
  --c: #222;
  flex: 1 1 auto;
  display: block;          /* no flex: perdería los espacios entre palabras */
  text-align: center;
  background-color: #fff;
}
/* la tarjeta del about se teclea como un bloque: su ::after es la sombra de
   píxel, así que el caret genérico (.typing-in::after) no debe pisarla */
.about-copy.typing-in::after {
  display: block;
  position: absolute; inset: 0;
  width: auto; height: auto;
  margin: 0;
  vertical-align: baseline;
  background: rgba(17, 17, 17, 0.16);
  animation: none;
}
/* caret como elemento (bloques de varios párrafos): mismo rectángulo rojo */
.type-caret {
  display: inline-block;
  width: 0.5em; height: 0.9em;
  margin-left: 0.1em;
  background: var(--red);
  vertical-align: text-bottom;
  animation: blink 0.7s steps(1) infinite;
}
/* sombra dura de píxel en los tags del about (como la tarjeta y el retrato).
   Los tags se recortan con clip-path, que se comería un box-shadow: la
   sombra la pone drop-shadow en el contenedor, que sigue el escalón */
#about .skills { filter: drop-shadow(4px 4px 0 rgba(17, 17, 17, 0.16)); }

/* instructivo encima del zoom / la galería (z 9500), por debajo del cursor;
   abajo a la derecha del visor (la barra de contacto queda tapada) y con
   texto claro sobre el fondo oscuro del visor */
@media (min-width: 901px) {
  body.zoom-open .deck .kbd-hint, body.zoom-open.deck .kbd-hint,
  body.lb-open.deck .kbd-hint {
    z-index: 9600;
    bottom: 1.6rem;
    opacity: 1;
  }
}
body.zoom-open .kbd-say,
body.lb-open .kbd-say { color: #fff; }

/* barra espaciadora DEBAJO de las flechas, del ancho del pad */
.kbd-keys { grid-template-rows: 33px 33px auto; }
.kbd-keys .kc-space {
  grid-column: 1 / -1; grid-row: 3;
  width: 95px; height: 22.5px;
  justify-self: center;
}
/* PRESS TO NAVIGATE en una línea, a la izquierda de la barra espaciadora
   (centrado con ella: abajo del todo del pad) */
.kbd-say-press,
.kbd-hint .kbd-say-press {
  align-self: end;
  margin: 0 0 7px 0;
  line-height: 1;
}
/* sin "— OR —": el mouse queda pegado al pad de flechas */
@media (min-width: 901px) {
  .deck .kbd-hint { row-gap: 8px; }
}
/* instructivo sin texto: el mouse va a la IZQUIERDA del pad, centrado en
   vertical con él */
.kbd-hint .kbd-mouse { grid-column: 1; grid-row: 1; align-self: center; justify-self: end; margin: 0; }
.kbd-hint .kbd-keys  { grid-column: 2; grid-row: 1; }
@media (min-width: 901px) {
  .deck .kbd-hint { column-gap: 12px; }
}
/* instructivo en UNA fila: [ barra ] [ flechas ] [ mouse ]. La barra va
   junto a ◄ ▼ ► (misma fila, mismo alto) y el mouse al final, centrado */
.kbd-keys { grid-template-columns: 95px repeat(3, 30px); grid-template-rows: repeat(2, 33px); }
.kbd-keys .kc[data-key="ArrowUp"]    { grid-column: 3; grid-row: 1; }
.kbd-keys .kc[data-key="ArrowLeft"]  { grid-column: 2; grid-row: 2; }
.kbd-keys .kc[data-key="ArrowDown"]  { grid-column: 3; grid-row: 2; }
.kbd-keys .kc[data-key="ArrowRight"] { grid-column: 4; grid-row: 2; }
.kbd-keys .kc-space { grid-column: 1; grid-row: 2; width: 95px; height: 32.5px; justify-self: start; }
.kbd-hint .kbd-keys  { grid-column: 1; grid-row: 1; }
.kbd-hint .kbd-mouse { grid-column: 2; grid-row: 1; align-self: center; justify-self: start; margin: 0; }
/* mouse alineado abajo, con la fila de ◄ ▼ ► y la barra */
.kbd-hint .kbd-mouse { align-self: end; }
/* el mouse a la misma distancia que hay entre las teclas (3px) */
@media (min-width: 901px) {
  .deck .kbd-hint { column-gap: 3px; }
}
/* tags del about: fondo negro y letra clara (el contorno oscuro se funde con
   el fondo; las esquinas en escalón y la sombra de píxel se mantienen) */
#about .skill-tag { background-color: #161616; color: #f6f4ef; }
#about .skill-tag .mg-ch { color: inherit; }

/* RENDIMIENTO: las estelas de cohete (fuego, chispas, brasas: animaciones de
   box-shadow que obligan a repintar) sólo corren en el proyecto VISIBLE. Antes
   seguían animándose en todas las diapositivas ocultas y en los proyectos no
   actuales (~60 animaciones permanentes) y con el rato el equipo se calentaba */
.anim-off .col-projects *,
.anim-off .col-projects *::before,
.anim-off .col-projects *::after,
.col-projects > .project:not(.is-current):not(.is-leaving) *,
.col-projects > .project:not(.is-current):not(.is-leaving) *::before,
.col-projects > .project:not(.is-current):not(.is-leaving) *::after {
  animation-play-state: paused !important;
}

/* WEB DEVELOPER & DESIGNER es un botón: lleva a "see my work" (FAMA).
   Hover a saltos (pixel): la placa se oscurece y sube 2px; al pulsar baja */
a.hero-rolebig { text-decoration: none; color: inherit; cursor: none; }   /* sólo el cursor pixel del sitio */
/* (con `translate` y no `transform`: transform/opacity ya los usa la
   entrada del hero y no hay que pisar su transición) */
.deck #hero .hero-top a.hero-rolebig {
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(.22,.8,.2,1), translate 0.12s steps(2);
}
.deck #hero .hero-top a.hero-rolebig::before { transition: background-color 0.12s steps(2); }
.deck #hero .hero-top a.hero-rolebig:hover { translate: 0 -2px; }
.deck #hero .hero-top a.hero-rolebig:hover::before { background-color: #fff; }
/* hover INVERTIDO: placa blanca y letras rojas */
.deck #hero .hero-top a.hero-rolebig .px,
.deck #hero .hero-top a.hero-rolebig .role-amp { transition: color 0.12s steps(2); }
.deck #hero .hero-top a.hero-rolebig:hover .px,
.deck #hero .hero-top a.hero-rolebig:hover .role-amp { color: var(--red); }
.deck #hero .hero-top a.hero-rolebig:active { translate: 0 1px; }
.deck #hero .hero-top a.hero-rolebig:focus-visible { outline: 2px solid var(--on-band); outline-offset: 4px; }

/* flechas principales en hover / al pasar diapositiva: rojo SÓLIDO (sin el
   relieve retro, cuyos bordes claros quedaban encima del rojo) */
.deck-arrow:hover:not(:disabled),
body.deck-light .deck-arrow:hover:not(:disabled),
.deck-arrow.is-pulse:not(:disabled),
body.deck-light .deck-arrow.is-pulse:not(:disabled) {
  background: var(--red);
  color: #fff;
  box-shadow: none;
}
/* color, flecha y relieve cambian de golpe y JUNTOS. La transición suave
   del fondo venía de `.deck #deck-prev, .deck #deck-next` (más específica):
   al salir del hover el relieve volvía al instante pero el fondo tardaba
   ~0.3s en dejar el rojo → se veía rojo con relieve. Se mantienen sólo el
   desplazamiento vertical (top) y la opacidad */
.deck #deck-prev, .deck #deck-next,
.deck-arrow {
  transition: top 0.55s cubic-bezier(.4,0,.2,1), opacity var(--transition);
}

/* ===== FLECHAS DE LOS VISORES: COLOR SÓLIDO =====
   Sin mix-blend-mode (al invertirse con la imagen se fundían con el fondo y
   confundían): círculo pixelado crema con relieve y contorno oscuro, igual que
   las flechas principales, y una sombra suave que lo separa de cualquier
   imagen. El círculo va en ::before (recortado) para que la sombra
   (drop-shadow del botón) no se recorte. Hover: rojo sólido, instantáneo. */
.nav-btn {
  mix-blend-mode: normal;
  clip-path: none;
  background: transparent;
  color: #222;
  isolation: isolate;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45));
  transition: none;
}
.nav-btn::before {
  content: '';
  position: absolute; inset: 0;
  z-index: -1;
  background: #efebe3;
  clip-path: polygon(31.25% 0%, 68.75% 0%, 68.75% 6.25%, 81.25% 6.25%, 81.25% 12.5%, 87.5% 12.5%, 87.5% 18.75%, 93.75% 18.75%, 93.75% 31.25%, 100% 31.25%, 100% 68.75%, 93.75% 68.75%, 93.75% 81.25%, 87.5% 81.25%, 87.5% 87.5%, 81.25% 87.5%, 81.25% 93.75%, 68.75% 93.75%, 68.75% 100%, 31.25% 100%, 31.25% 93.75%, 18.75% 93.75%, 18.75% 87.5%, 12.5% 87.5%, 12.5% 81.25%, 6.25% 81.25%, 6.25% 68.75%, 0% 68.75%, 0% 31.25%, 6.25% 31.25%, 6.25% 18.75%, 12.5% 18.75%, 12.5% 12.5%, 18.75% 12.5%, 18.75% 6.25%, 31.25% 6.25%);
  box-shadow:
    inset 3px 3px 0 0 rgba(255, 255, 255, 0.9),
    inset -3px -3px 0 0 rgba(17, 17, 17, 0.2);
}
.nav-btn:hover, .nav-btn:focus-visible { color: #fff; box-shadow: none; mix-blend-mode: normal; }
.nav-btn:hover::before, .nav-btn:focus-visible::before { background: var(--red); box-shadow: none; }

/* ABOUT: video del saludo en lugar de la foto (mismo marco pixel, mismo
   tamaño; width/height del HTML dan la proporción cuadrada antes de cargar) */
.about-img .about-frame video,
.deck #about .about-img .about-frame video {
  display: block;
  border: 0;
  border-radius: 0;
  padding: 4px;
  background: #222;
  clip-path: var(--frame-clip);
  margin: 0;
  width: auto; height: auto;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.deck #about .about-img .about-frame video { max-height: calc(var(--stage-h) - 10rem); }
/* flechas del visor: plano (sin el relieve, que se veía como una textura
   rara) y con el color según el fondo que tienen detrás (ver navContrast en
   script.js): crema sobre zonas oscuras, NEGRA sobre zonas claras */
.nav-btn::before { box-shadow: none; background: #f6f4ef; }
.nav-btn { color: #161616; filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.4)); }
.nav-btn.on-light { color: #f6f4ef; filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.25)); }
.nav-btn.on-light::before { background: #161616; }
.nav-btn:hover, .nav-btn:focus-visible,
.nav-btn.on-light:hover, .nav-btn.on-light:focus-visible { color: #fff; }
.nav-btn:hover::before, .nav-btn:focus-visible::before,
.nav-btn.on-light:hover::before, .nav-btn.on-light:focus-visible::before { background: var(--red); }

/* al pasar el mouse por el video del about, el BORDE se ilumina: el marco
   oscuro (el padding del video) pasa a rojo y aparece un resplandor rojo
   alrededor, que se apaga solo en ~0.9 s */
.about-frame.is-poke { animation: aboutGlow 0.8s ease-out both; }
.about-frame.is-poke video { animation: aboutGlowBorder 0.8s ease-out both; }
/* el marco se pone blanco y brilla un instante: halo blanco + un contorno
   oscuro muy suave para que el blanco se lea sobre el fondo claro */
@keyframes aboutGlow {
  0%   { filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0)) drop-shadow(0 0 0 rgba(0, 0, 0, 0)); }
  22%  { filter: drop-shadow(0 0 12px rgba(255, 255, 255, 1)) drop-shadow(0 0 3px rgba(0, 0, 0, 0.35)); }
  100% { filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0)) drop-shadow(0 0 0 rgba(0, 0, 0, 0)); }
}
@keyframes aboutGlowBorder {
  0%, 100% { background-color: #222; filter: brightness(1); }
  18%, 40% { background-color: #fff; filter: brightness(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .about-frame.is-poke, .about-frame.is-poke video { animation: none; }
}

/* Home (antes "Back to top"): icono de casita pixel + texto, solo fuera del hero */
#bottombar .backtop { align-items: center; gap: 0.5em; }
#bottombar .backtop .home-ico {
  width: 18px; height: 16px; flex: 0 0 auto;
  fill: currentColor; display: block;
}
/* hover: la casita se pone blanca y brilla (sin pasar a rojo) */
#bottombar .backtop .home-ico { transition: fill 0.25s ease, filter 0.25s ease; }
#bottombar .backtop:hover .home-ico {
  fill: #fff;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 10px rgba(255, 255, 255, 0.55));
}
/* oculto en el home: "#bottombar a" (display:flex) le ganaba a ".backtop" */
#bottombar .backtop { display: none; }
#bottombar.show-backtop .backtop { display: flex; }
/* Home sin separador ni márgenes extra: se reparte igual que los demás iconos */
#bottombar .backtop { margin-left: 0; padding-left: 0; border-left: 0; }
/* Home: solo icono, sin subrayado (el halo blanco ::before se mantiene) */
#bottombar .backtop::after { display: none; }
#bottombar.open .backtop { padding-left: 0; }
#bottombar .backtop .home-ico { width: 20px; height: 18px; }
/* área clickeable más grande para la casita (el icono es pequeño) */
#bottombar .backtop { padding: 12px 22px; margin: -12px -22px; justify-content: center; }
#bottombar.open .backtop { padding: 33px 22px; margin-top: -29px; }
/* área clickeable más grande para la casita (padding + margen negativo:
   crece la zona de clic sin mover el reparto de los iconos) */
#bottombar .backtop { padding: 14px 20px; margin: -14px -20px; }
@media (min-width: 1104px) {
  #bottombar.open .backtop { padding: 33px 20px; margin: -29px -20px 0; }
}
/* texto "Back" junto a la casita; al hover brilla igual que el icono */
#bottombar .backtop span { display: inline-block; transition: text-shadow 0.25s ease; }
#bottombar .backtop:hover span { text-shadow: 0 0 6px rgba(255, 255, 255, 0.9), 0 0 14px rgba(255, 255, 255, 0.5); }

/* banderitas pixel junto al país en la ubicación */
.head-loc .flag {
  display: inline-block;
  height: 14px; width: auto;
  margin-left: 0.35em;
  vertical-align: -0.15em;
}

/* el país y su bandera nunca se separan en dos líneas */
.head-loc .loc-end { white-space: nowrap; }

/* pista del hero (abajo, una línea): atajos con números, scroll y teclas,
   con flecha hacia el instructivo de la esquina derecha */
.hint-arrow {
  display: inline-block;
  margin-left: 0.4em;
  color: var(--red);
  font-size: 1.3em;
  line-height: 1;
  vertical-align: -0.1em;
}
/* flecha que avanza a saltos (clon fijo) y su rastro (script.js) */
.hint-fly {
  position: fixed; z-index: 86;
  display: block; text-align: center;
  pointer-events: none;
}
.hint-fly.hint-ghost { z-index: 85; }
.hint-bit { position: fixed; z-index: 86; pointer-events: none; }

.deck #hero .side-label.side-bl { white-space: nowrap; }

/* "0" y "6" de la pista del hero: el mismo dibujo de tecla pixel que el
   instructivo (script.js, capSVG), a 2 px por píxel */
.kcap {
  display: inline-block;
  width: 24px; height: 26px;
  margin: 0 2px;
  font: inherit; color: inherit;
  vertical-align: middle;
}
.kcap svg { display: block; width: 100%; height: 100%; overflow: visible; }
.kcap .po { fill: #222; }
.kcap .pf { fill: #f6f4ef; }
.kcap .ps { fill: #b9b5ad; }
.kcap .pa { fill: #222; }
.kcap.is-down svg { transform: translateY(2px); }
.kcap.is-down .pf { fill: var(--red); }
.kcap.is-down .pa { fill: #fff; }
.kcap.is-down .ps { fill: #222; }

/* "Portfolio · 2026 …" también en el about: arriba a la derecha, como en el hero */
.deck #about .side-label.side-tr {
  writing-mode: horizontal-tb;
  bottom: auto; left: auto; transform: none;
  top: calc(var(--deck-top) + 1.4rem);
  right: 1.6rem;
  font-size: 10px;
  color: rgba(17, 17, 17, 0.78);
  letter-spacing: 0.12em;
}

/* ensayo invisible de las transiciones (script.js, warmTransition) */
.fx-warm {
  position: fixed; inset: 0; z-index: 0;
  opacity: 0.002;
  pointer-events: none !important;
}

/* flechas de las galerías "presionadas" (al pasar de imagen con teclado /
   rueda, o el aviso ocasional de que son interactivas): igual que su hover */
.nav-btn.is-pulse, .nav-btn.on-light.is-pulse { color: #fff; }
.nav-btn.is-pulse::before, .nav-btn.on-light.is-pulse::before { background: var(--red); }

/* "+3": menú desplegable con los demás sitios de FAMA. Va fijo en pantalla
   (el JS lo coloca junto al botón) para que no lo recorte la tarjeta ni
   cambie su alto; se cierra con el mismo botón, Escape o un clic afuera */
.site-pill.site-more { font-family: inherit; line-height: inherit; cursor: none; }
.deck .exp-intro .site-pill.site-more[aria-expanded="true"] { background: var(--on-band); color: var(--cream); }
.deck .exp-intro .site-pill.site-more[aria-expanded="true"]::before { opacity: 0; }
.site-menu {
  position: fixed; z-index: 120;
  display: flex; flex-direction: column;
  min-width: 190px;
  padding: 6px;
  background: #161616;
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: 0.95rem; letter-spacing: 0.05em;
  clip-path: polygon(4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%,
    4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px), 0 4px, 4px 4px);
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}
.site-menu[hidden] { display: none; }
.site-menu a {
  padding: 0.45rem 0.8rem;
  color: #f6f4ef;
  text-decoration: none;
  white-space: nowrap;
}
.site-menu a:hover, .site-menu a:focus-visible { background: var(--red); color: #fff; outline: none; }

/* BEFORE / AFTER: rótulo grande centrado con fondo oscuro translúcido
   (script.js, baFlash). El del Before se va con el primer hover; el del
   primer After aparece un instante y se va solo. También en el zoom. */
.ba-cover {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12, 12, 12, 0.55);
  color: #f6f4ef;
  font-family: 'PressStart', monospace;
  font-size: clamp(20px, 3.4vw, 44px);
  letter-spacing: 0.12em; text-transform: uppercase;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.6);
  pointer-events: none;
  transition: opacity 0.4s steps(4);
}
.ba-cover.is-gone { opacity: 0; }
.ba-flash { animation: baFlash 0.9s linear forwards; }
@keyframes baFlash {
  0%   { opacity: 0; }
  8%   { opacity: 1; }
  78%  { opacity: 1; }
  100% { opacity: 0; }
}
#zoom-ba { display: none; z-index: 9500; }
#zoom-ba.on { display: flex; }
#zoom > .ba-flash { z-index: 9500; font-size: clamp(28px, 5vw, 64px); }
#zoom-ba { font-size: clamp(28px, 5vw, 64px); }
/* etiquetas Before / After más grandes */
.slide .slide-tag, #zoom-tag {
  font-size: 11px;
  padding: 0.65rem 1.2rem;
}

/* about: espacios más compactos para que se vean todas las skills sin que
   las tape la barra de abajo */
.deck #about .section-head { margin-bottom: 0.6rem; }
.deck #about .about-copy { padding-top: 0.9rem; margin-bottom: 0.9rem; }
.deck #about .about-text p { margin-bottom: 0.45rem; line-height: 1.5; }
.deck #about .skills { margin-top: 0; margin-bottom: 0; gap: 6px; }
.deck #about .skill-tag { padding-top: 0.22rem; padding-bottom: 0.22rem; }
/* despedida en su propia línea y resaltada */
#about .about-text p strong.about-thanks {
  display: inline;
  margin-top: 0;
  white-space: normal;
  color: var(--red);
}

/* enlaces a los sitios debajo de la terminal del proyecto */
.deck .exp-intro .exp-projdesc + .exp-sites { margin-top: 1rem; }


/* tarjeta de experiencia: la fecha va arriba, en su propia línea, y la
   ubicación debajo */
.deck .exp-meta {
  flex-direction: column;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 0.3rem;
}
.deck .exp-intro .exp-meta .proj-num { order: -1; margin-left: 0; }
.deck .exp-meta .head-loc { flex: 0 0 auto; width: 100%; }
/* ubicación debajo del rol */
.deck .exp-intro .exp-loc { margin: -0.2rem 0 0.2rem; }

/* enlace al sitio del proyecto actual: borde rojo y el texto sube unos px */
.deck .exp-intro .site-pill.is-current {
  background: var(--red);
  padding-top: calc(0.45rem + 1.5px - 3px);
  padding-bottom: calc(0.45rem + 1.5px + 3px);
}
@media (min-width: 1000px) and (max-height: 860px) {
  .deck .exp-intro .site-pill.is-current {
    padding-top: calc(0.3rem + 1.5px - 3px);
    padding-bottom: calc(0.3rem + 1.5px + 3px);
  }
}

/* ícono de GitHub en los botones a los repositorios */
.site-pill .gh-ico {
  width: 1em; height: 1em;
  margin-right: 0.4em;
  vertical-align: -0.12em;
  fill: currentColor;
}

/* ===== RENDIMIENTO: glitch por ráfagas y reposo =====
   El glitch ya no corre en bucle: sólo durante .gl-burst (la parte visible
   del ciclo, del 88% al 100%, ~0.4 s). En reposo (.fx-idle, 60 s sin
   interacción) se pausan todas las animaciones CSS. */
.glitch::before, .glitch::after,
.px-glitch.glitch-on::before, .px-glitch.glitch-on::after,
#cursor::before, #cursor::after { animation: none; }
.glitch.gl-burst::before, .px-glitch.glitch-on.gl-burst::before, #cursor.gl-burst::before {
  animation: glitchA 3.2s linear -2.82s 1 forwards;
}
.glitch.gl-burst::after, .px-glitch.glitch-on.gl-burst::after, #cursor.gl-burst::after {
  animation: glitchB 3.2s linear -2.82s 1 forwards;
}
body.fx-idle *, body.fx-idle *::before, body.fx-idle *::after {
  animation-play-state: paused !important;
}

/* ícono de globo en los enlaces a sitios web (mismo tamaño que el de GitHub) */
.site-pill .web-ico, .site-menu .web-ico {
  width: 1em; height: 1em;
  margin-right: 0.4em;
  vertical-align: -0.12em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

/* botones de sitios más compactos */
.deck .exp-intro .exp-sites { gap: 0.45rem; }
.deck .exp-intro .site-pill {
  padding-left: 0.65rem; padding-right: 0.65rem;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}
.deck .exp-intro .site-pill .web-ico,
.deck .exp-intro .site-pill .gh-ico { margin-right: 0.3em; }

/* about: sin palabras sueltas en la última línea de cada párrafo */
#about .about-text p { text-wrap: pretty; }

/* salto de fila entre botones de sitios (FAMA: dos y dos) */
.exp-sites .sites-break { flex-basis: 100%; height: 0; }

/* la etiqueta pequeña Before / After aparece cuando se va el rótulo grande */
.slide .slide-tag, #zoom-tag { transition: opacity 0.3s steps(3); }
.slide:has(> .ba-cover:not(.is-gone)) .slide-tag,
#zoom:has(#zoom-ba.on:not(.is-gone)) #zoom-tag,
#zoom:has(> .ba-flash) #zoom-tag { opacity: 0; transition: none; }

/* nota bajo los botones de sitios (sólo FAMA: hosting / seguridad) */
.exp-sites .exp-note {
  flex-basis: 100%;
  margin: 0.35rem 0 0;
  font-size: 0.9rem; line-height: 1.4;
  color: rgba(17, 17, 17, 0.72);
  text-wrap: pretty;
}

/* roles de experiencia: 27px máx., bajan con el ancho de la ventana */
.deck .col-intro .exp-role { font-size: clamp(1.15rem, 2.1vw, 27px); }
@media (min-width: 1000px) and (max-height: 860px) {
  .deck .col-intro .exp-role { font-size: clamp(1.1rem, 1.7vw, 1.4rem); }
}

/* teléfono del bottombar: aclaración "(WhatsApp only)" más pequeña */
#bottombar .bb-note { font-size: 0.72em; opacity: 0.7; letter-spacing: 0.02em; white-space: nowrap; }

/* marca del topbar con el nombre completo: sin partir en dos líneas */
.nav-logo .brand strong,
.nav-logo .side-roles { white-space: nowrap; }
.nav-logo { margin-right: 1.4rem; flex-shrink: 0; }
/* nombre en una línea: el rol va pegado debajo */
.deck #hero .hero-top { gap: 0.45rem; }
.deck #hero .hero-top { justify-content: center; }
/* descripción y botones: exactamente el ancho del nombre (sin tope del contenedor) */
.deck #hero .hero-row,
.deck #hero .hero-ctas { max-width: none; }
/* una columna (tablet / escritorio angosto): la columna mide lo que el nombre,
   no el tope de 640px, para que recuadro y botones igualen su ancho */
@media (min-width: 720px) and (max-width: 1099px) {
  .deck #hero .hero-inner { grid-template-columns: max-content; max-width: none; }
}
/* el recuadro y los botones no ensanchan la columna (contain): la columna mide
   el nombre aunque el JS aún no haya puesto --hero-w (carga, resize) */
@media (min-width: 720px) and (max-width: 1099px) {
  .deck #hero .hero-row,
  .deck #hero .hero-ctas { contain: inline-size; width: 100%; }
}

/* ===== CAMBIO DE IDIOMA (EN / ES) =====
   Esquina superior izquierda, justo bajo el topbar, fijo en todas las
   secciones. El idioma actual va en rojo; el otro es el enlace. */
.lang-switch {
  position: fixed; z-index: 99;
  top: calc(var(--deck-top, 58px) + 16px); left: 0.75rem;
  display: inline-flex; align-items: center; gap: 0.4em;
  padding: 0.4rem 0.5rem 0.35rem;
  font-family: 'PressStart', monospace; font-size: 8px; line-height: 1;
  color: var(--cream); background: #111; text-decoration: none;
  border: 1px solid rgba(246, 244, 239, 0.18);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.lang-switch .ls-cur { color: var(--red); }
.lang-switch .ls-sep { opacity: 0.4; }
.lang-switch:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--red); }
.lang-switch:hover .ls-alt { text-decoration: underline; text-underline-offset: 3px; }
.lang-switch:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
/* móvil: la esquina la ocupa el título de cada sección; el botón sólo se
   muestra en el hero (Inicio), donde la esquina está libre */
.lang-switch { transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.3s ease; }
@media (max-width: 720px) {
  body.deck:not(.at-hero) .lang-switch { opacity: 0; pointer-events: none; }
}

/* EN / ES en pixel art, como "Download CV": relleno crema, contorno de píxel
   cerrado y esquinas en escalón. Al hover se invierte (fondo oscuro). */
.lang-switch {
  --n: 4px; --w: 2px; --fc: #111;
  --g: linear-gradient(var(--fc), var(--fc));
  --pframe:
    var(--g) var(--n) 0 / calc(100% - 2 * var(--n)) var(--w),
    var(--g) var(--n) 100% / calc(100% - 2 * var(--n)) var(--w),
    var(--g) 0 var(--n) / var(--w) calc(100% - 2 * var(--n)),
    var(--g) 100% var(--n) / var(--w) calc(100% - 2 * var(--n)),
    var(--g) var(--n) 0 / var(--w) calc(var(--n) + var(--w)),
    var(--g) 0 var(--n) / calc(var(--n) + var(--w)) var(--w),
    var(--g) calc(100% - var(--n)) 0 / var(--w) calc(var(--n) + var(--w)),
    var(--g) 100% var(--n) / calc(var(--n) + var(--w)) var(--w),
    var(--g) var(--n) 100% / var(--w) calc(var(--n) + var(--w)),
    var(--g) 0 calc(100% - var(--n)) / calc(var(--n) + var(--w)) var(--w),
    var(--g) calc(100% - var(--n)) 100% / var(--w) calc(var(--n) + var(--w)),
    var(--g) 100% calc(100% - var(--n)) / calc(var(--n) + var(--w)) var(--w);
  padding: 0.6rem 0.75rem 0.55rem;
  font-size: 11px;
  color: #111;
  border: 0;
  box-shadow: none;
  clip-path: polygon(
    var(--n) 0, calc(100% - var(--n)) 0,
    calc(100% - var(--n)) var(--n), 100% var(--n),
    100% calc(100% - var(--n)), calc(100% - var(--n)) calc(100% - var(--n)),
    calc(100% - var(--n)) 100%, var(--n) 100%,
    var(--n) calc(100% - var(--n)), 0 calc(100% - var(--n)),
    0 var(--n), var(--n) var(--n));
  background: var(--pframe), var(--cream);
  background-repeat: no-repeat;
  transition: transform 0.15s steps(2), opacity 0.3s ease;
}
.lang-switch .ls-cur { color: var(--red); }
.lang-switch .ls-sep { opacity: 0.35; }
.lang-switch:hover {
  --fc: var(--cream);
  color: var(--cream);
  background: var(--pframe), #111;
  background-repeat: no-repeat;
  transform: translateY(-2px);
  box-shadow: none;
}
.lang-switch:hover .ls-alt { text-decoration: none; }

/* ===== HERO EN MÓVIL =====
   En teléfonos con poco alto (barras del navegador) o con la barra de
   contacto abierta, el hero no cabía: subía hasta el botón EN/ES y las
   flechas del deck (abajo, en las esquinas) tapaban "See my work".
   · arriba se reserva el alto del botón EN/ES
   · abajo, el de las flechas
   · el recuadro "8+ years" se compacta para que el texto no ocupe 6 líneas */
@media (max-width: 900px) {
  .deck #hero { padding-bottom: calc(var(--deck-bottom) + 0.8rem + 44px + 0.8rem); }
}
@media (max-width: 720px) {
  .deck #hero { padding-top: calc(var(--deck-top) + 3.4rem); }
  .deck #hero .hero-top { gap: 0.6rem; margin-bottom: 0.9rem; }
  .deck #hero .hero-row { margin-bottom: 0.9rem; }
  .deck #hero .hero-desc { padding: 0.85rem 1rem; gap: 0.85rem; }
  .deck #hero .hd-stat { padding-right: 0.85rem; }
  .deck #hero .hd-num { font-size: 2.5rem; }
  .deck #hero .hd-unit { font-size: 0.75rem; }
  .deck #hero .hd-text { font-size: 1.02rem; line-height: 1.38; }
  .deck #hero .hero-ctas { gap: 0.6rem; }
}

/* ===== PLACEHOLDER DE CARGA =====
   Mientras una imagen o video de los sliders, miniaturas o diseños no ha
   cargado, se ve el logo en gris en el centro (máscara con el PNG del logo:
   así toma el color que se quiera). Al cargar, el JS pone .is-loaded y el
   logo se desvanece; queda detrás de la imagen (isolation + z-index -1). */
.slide, .thumb, .design-item { isolation: isolate; }
.thumb { position: relative; }
.slide::before, .thumb::before, .design-item::before {
  content: '';
  position: absolute; inset: 0; margin: auto; z-index: -1;
  width: 46px; height: 46px;
  background: #9b9b9b;
  -webkit-mask: url('img/siteico.png') center / contain no-repeat;
          mask: url('img/siteico.png') center / contain no-repeat;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.thumb::before { width: 22px; height: 22px; }
.slide.is-loaded::before, .thumb.is-loaded::before, .design-item.is-loaded::before { opacity: 0; }

/* ===== TOPBAR EN MÓVIL: el menú en su propia fila =====
   Junto al nombre y al botón de descarga sólo le quedaban ~65px (se veía
   media palabra). Debajo ocupa todo el ancho y lleva los números. El alto
   real del topbar lo mide el JS (--deck-top), así el contenido baja solo. */
@media (max-width: 720px) {
  #topbar { flex-wrap: wrap; row-gap: 0.3rem; padding-bottom: 0.45rem; }
  #topbar .nav-logo { margin-right: auto; }
  #topbar ul {
    order: 3; flex: 1 1 100%; min-width: 0;
    margin: 0; gap: 1.4rem; padding: 0.1rem 0.1rem 0;
  }
  #topbar ul a .micro { display: inline; }
}

/* ===== BARRA DE CONTACTO ABIERTA EN MÓVIL: compacta =====
   Antes medía ~175px (12vh + relleno grande). Ahora sólo lo justo: el
   título "CONTACT" arriba y la fila de iconos debajo, con algo de aire. */
@media (max-width: 720px) {
  #bottombar.open {
    height: 104px;
    padding: 0 1rem 0.9rem;
    align-items: flex-end;
  }
  #bottombar .bb-title { top: 8px; font-size: 1.9rem; }
  #bottombar .bb-toggle { top: 10px; }
  body.deck.bb-open { --deck-bottom: 104px; }
}

/* ===== TOQUES EN MÓVIL =====
   Dos toques seguidos en una flecha se interpretaban como "doble toque para
   zoom" (sobre todo en iPhone) y el segundo no llegaba al botón. Con
   touch-action: manipulation el navegador no espera ni hace zoom en estos
   controles. Al presionar, el botón se hunde un poco para confirmar el toque. */
.deck-arrow, .nav-btn, .thumb, .design-item, .site-pill, .lang-switch,
#topbar a, #bottombar a, #bottombar button, .hero-ctas a, .proj-pager button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.deck-arrow:active:not(:disabled) { scale: 0.9; }   /* "scale" no pisa el transform de posición */

/* flechas de los visores (zoom y diseños): SVG en lugar de los caracteres
   ← →, que cada fuente dibuja a distinta altura y quedaban desalineados */
.vw-arrow { width: 22px; height: 22px; display: block; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: square; }
#zoom-prev .vw-arrow, #lb-prev .vw-arrow { transform: rotate(180deg); }

/* swipe en sliders y visores: el navegador sólo se queda con el scroll
   vertical (y el pellizco); el gesto horizontal lo maneja el JS */
.slider-main, #zoom, #lightbox { touch-action: pan-y pinch-zoom; }

/* ===== PANTALLA DE CARGA =====
   Mientras el sitio termina de cargar y de acomodar el deck (se veían el hero
   y FAMA a medio armar), todo queda tras un desenfoque gaussiano con el logo
   al centro. El JS le pone .is-done al terminar y se desvanece. */
#loader {
  position: fixed; inset: 0; z-index: 10050;
  display: flex; align-items: center; justify-content: center;
  background: rgba(17, 17, 17, 0.55);
  -webkit-backdrop-filter: blur(18px);
          backdrop-filter: blur(18px);
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}
#loader img {
  width: 64px; height: 64px;
  image-rendering: pixelated;
  animation: loaderSpin 1.4s cubic-bezier(.65,0,.35,1) infinite;
}
/* un giro, pausa y otro giro, en bucle. Es media vuelta (180°): el logo
   |><| es simétrico y con 360° se veía "llegar" dos veces (a la mitad ya
   parece el original). Al terminar queda igual al inicio, así empalma. */
@keyframes loaderSpin {
  0%   { transform: rotate(0deg); }
  50%  { transform: rotate(180deg); }
  100% { transform: rotate(180deg); }
}
#loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { #loader img { animation: none; } }

/* estela (ghosting) del logo de carga: dos copias detrás que repiten el giro
   con un pequeño retraso y menos opacidad */
#loader::before,
#loader::after {
  content: '';
  position: absolute; left: 50%; top: 50%;
  width: 64px; height: 64px; margin: -32px 0 0 -32px;
  background: url('img/siteico.png') center / contain no-repeat;
  image-rendering: pixelated;
  pointer-events: none;
  animation: loaderSpin 1.4s cubic-bezier(.65,0,.35,1) infinite;
}
#loader::before { opacity: 0.35; animation-delay: 0.05s; }
#loader::after  { opacity: 0.15; animation-delay: 0.1s; }
#loader img { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { #loader::before, #loader::after { display: none; } }

/* nota de la experiencia que sólo acompaña a ciertos proyectos (FAMA:
   hosting/DNS/Cloudflare sólo en el proyecto 1): al pasar a otro se colapsa */
.exp-sites .exp-note[data-show-projs] {
  max-height: 14em; overflow: hidden;
  transition: max-height 0.45s ease, opacity 0.3s ease, margin 0.45s ease;
}
.exp-sites .exp-note[data-show-projs].is-collapsed { max-height: 0; opacity: 0; margin-top: 0; margin-bottom: 0; }

/* "CV.pdf": el texto ya va en mayúsculas; sin text-transform para que la extensión quede en minúscula */
#topbar .btn-light .cv-text, .hero-ctas .btn-cv span { text-transform: none; }

/* Flecha del botón CV.pdf: SVG rojo a la derecha del texto */
.cv-arrow { width: 13px; height: 13px; fill: var(--red); flex: none; }
#topbar .btn-light .cv-arrow, .hero-ctas .btn-cv .cv-arrow { width: 13px; height: 13px; }
.cv-arrow, #topbar .btn-light .cv-arrow { transition: transform 0.2s ease, fill 0.2s ease; }
#topbar .btn-light:hover .cv-arrow, .hero-ctas .btn-cv:hover .cv-arrow { transform: translate(3px, -3px); fill: #fff; }

/* ===== MÓVIL "REELS" (body.deck-reels, lo pone el JS en ≤720px) =====
   Pantalla 1 de cada sección: la tarjeta de la experiencia (sin proyectos).
   Luego una pantalla por proyecto: su descripción (terminal) y el slider. */
/* cada pantalla es un .container de la sección: apiladas en el mismo sitio;
   sólo se ve la actual (.reel-on) y, mientras se mueve, la que sale */
.deck-reels #page > .stage.has-reels > .container { position: absolute; inset: 0; margin: 0 auto; }
.deck-reels #page > .stage.has-reels > .container:not(.reel-on):not(.reel-out) { visibility: hidden; }
.deck-reels .project > .exp-projdesc { margin: 0 0 1rem; }
.deck-reels .project > .exp-projdesc .exp-projdesc-stack { height: auto !important; }
.deck-reels .project > .exp-projdesc .proj-desc {
  position: static;
  /* sin el relleno de .col-projects .proj-desc: la terminal ya tiene el suyo */
  margin: 0; padding: 0; font-size: 12px; line-height: 1.5;
}
/* el nombre ya va en la terminal ($ nombre) */
.deck-reels .project .proj-name { display: none; }

/* el ovni se arrastra para recorrer el sitio (área de toque más grande) */
.deck .px-ufo { pointer-events: auto; touch-action: none; }
.deck .px-ufo::after { content: ''; position: absolute; inset: -10px -8px; }
body.ufo-dragging #deck-progress span { transition: none; }
/* reels: sin miniaturas (el slider se recorre con sus flechas o deslizando)
   para que el proyecto quepa en una pantalla */
.deck-reels .col-projects .slider > .thumbs { display: none; }
/* la línea de progreso se toca como la de un video: área de toque más alta */
.deck #deck-progress { pointer-events: auto; touch-action: none; }
.deck #deck-progress::after { content: ''; position: absolute; left: 0; right: 0; top: -4px; bottom: -10px; z-index: -1; }   /* detrás del ovni */
/* About apilado (móvil y tablet): avatar y texto más juntos */
@media (max-width: 900px) {
  .about-grid { row-gap: 1.6rem; }
}

/* reels: encabezado "Project 0X / 0N" fijo de la sección (sin fondo): los
   proyectos pasan por debajo al cambiar. En la tarjeta de la experiencia no
   se muestra. Cada pantalla de proyecto guarda un hueco invisible del mismo alto */
.deck-reels .reel-head {
  position: absolute; left: 0; right: 0; z-index: 5;
  box-sizing: border-box;
  margin: 0;
  align-items: flex-end;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
.deck-reels .reel-head.is-on { opacity: 1; visibility: inherit; transition: opacity 0.3s ease; }
.deck-reels .reel-head-ph { visibility: hidden; }
/* pantallas de proyecto alineadas arriba (no centradas): el hueco del
   encabezado queda siempre a la misma altura y el encabezado no salta */
.deck-reels #page > .stage > .container.reel-proj > :first-child { margin-top: 0.6rem; }

/* táctil: el cursor se desvanece 2 s después del último toque */
#cursor { transition: transform 0.1s ease, opacity 0.4s ease; }
body.cursor-gone #cursor { opacity: 0; }

/* manos pixel art del cursor propio (sin la mano del sistema): abierta sobre
   el ovni y cerrada mientras se arrastra; la línea de progreso usa el puntero */
body.cur-grab #cursor,
body.ufo-dragging #cursor {
  --hx: 17px; --hy: 20px;            /* centro de la palma */
  width: 34px; height: 34px;         /* sprite de 17x17 a 2px por píxel */
  background-image: url('img/px/hand-open.svg');
  transform: translate(calc(-1 * var(--hx)), calc(-1 * var(--hy)));
}
body.ufo-dragging #cursor { background-image: url('img/px/hand-grab.svg'); }
/* arrastrando el ovni no se selecciona texto */
body.ufo-dragging, body.ufo-dragging * { user-select: none; -webkit-user-select: none; }

/* ABOUT: recorte (PNG sin fondo) con marco "arcade" fino: banda gris oscura
   de 8 px y una greca en escalón en cada esquina (img/opt/about-frame.png,
   generado con marcos/frame-arcade-fino.py). El marco va en una capa encima (::after
   con border-image) para que sólo él se escale "pixelated" y la foto se vea
   suave; sin fondo detrás de la foto */
.about-img .about-frame.about-cutout img,
.deck #about .about-img .about-frame.about-cutout img {
  padding: 8px; background: none; clip-path: none; border: 0;
  max-width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover;
  box-sizing: border-box;
}
.about-frame.about-cutout { --frame-clip: none; }
.about-frame.about-cutout::before { display: none; }
.about-frame.about-cutout::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  border: 24px solid transparent;
  border-image: url("img/opt/about-frame.png") 12 / 24px / 0 stretch;
  image-rendering: pixelated;
}
.deck #about .about-img .about-frame.about-cutout img { max-height: calc(var(--stage-h) - 10rem); width: auto; }

/* tres corazones pixel en la esquina superior izquierda que titilan */
.about-lives {
  position: absolute; top: 36px; left: 24px; z-index: 2;
  display: flex; gap: 5px; pointer-events: none;
}
.about-lives i {
  width: 20px; height: 20px; display: block;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 5' shape-rendering='crispEdges'%3E%3Cpath fill='%23e63946' d='M1 0h1v1H1zM3 0h1v1H3zM0 1h5v2H0zM1 3h3v1H1zM2 4h1v1H2z'/%3E%3Cpath fill='%23ffd0d8' d='M1 1h1v1H1z'/%3E%3C/svg%3E") center / contain no-repeat;
  image-rendering: pixelated;
  animation: lifeBlink 1.6s steps(1, end) infinite;
}
.about-lives i:nth-child(2) { animation-delay: 0.2s; }
.about-lives i:nth-child(3) { animation-delay: 0.4s; }
@keyframes lifeBlink {
  0%, 70% { opacity: 1; }
  75%, 85% { opacity: 0.15; }
  90% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .about-lives i { animation: none; } }
