/* ───────── Tokens ───────── */
:root {
  --bg: #fafafa; --bg2: #f0f0f2; --ink: #09090b; --mute: #52525b; --accent: #2563eb; --on-accent: #ffffff;
  --glass: rgba(251, 251, 253, .55); --line: rgba(0, 0, 0, .14); --ph: #dcdce2;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-in: cubic-bezier(.8, .2, .8, .2);   /* inversa de --ease-out: ida y vuelta simétricas */
  --pad-x: max(1.25rem, 5vw);
  /* Radios (una sola regla): interactivos = píldora, contenedores = 20px, medios interiores = 12px */
  --r-pill: 980px; --r-box: 20px; --r-inner: 12px;
  --font: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Archivo", "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  /* Vidrio */
  --card: rgba(255, 255, 255, .55);
  --card-edge: rgba(255, 255, 255, .75);
  --card-shadow: 0 24px 60px rgba(24, 28, 48, .12), 0 2px 8px rgba(24, 28, 48, .06);   /* tintada, no negro puro */
  --card-shadow-hover: 0 30px 70px rgba(24, 28, 48, .2), 0 2px 8px rgba(24, 28, 48, .08);
  --ambient-op: .42;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b0b0d; --bg2: #151518; --ink: #fafafa; --mute: #a1a1aa; --accent: #60a5fa; --on-accent: #09090b;
  --glass: rgba(22, 22, 24, .55); --line: rgba(255, 255, 255, .18); --ph: #232327;
  --card: rgba(38, 38, 42, .55);
  --card-edge: rgba(255, 255, 255, .14);
  --card-shadow: 0 24px 70px rgba(2, 2, 6, .6), 0 2px 8px rgba(2, 2, 6, .35);
  --card-shadow-hover: 0 30px 80px rgba(2, 2, 6, .8), 0 2px 8px rgba(2, 2, 6, .45);
  --ambient-op: .65;
  color-scheme: dark;
}

/* ───────── Base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(4rem + env(safe-area-inset-top, 0px)); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transition: background-color .3s ease, color .3s ease;   /* sin saltos bruscos de brillo al cambiar tema */
}
a { color: inherit; }
img, video, svg { display: block; }
.in { max-width: 1100px; margin: 0 auto; }

.skip { position: absolute; left: 1rem; top: -3rem; z-index: 100; padding: .5rem 1rem; border-radius: 9px; background: var(--ink); color: var(--bg); text-decoration: none; }
.skip:focus { top: 1rem; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ───────── Barra (material translúcido) ───────── */
header.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  height: calc(3.5rem + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) var(--pad-x) 0;
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .06);
}
/* efecto de borde de scroll: solo cuando hay contenido debajo */
header.bar::after {
  content: ""; position: absolute; inset: auto 0 0; height: 1px; background: var(--line);
  opacity: 0; transition: opacity .2s ease;
}
header.bar.scrolled::after { opacity: 1; }

.logo { display: flex; align-items: center; color: var(--ink); text-decoration: none; margin-right: auto; }
.logo-svg { height: 1.5rem; width: auto; transition: opacity .2s ease-out; }
.logo:hover .logo-svg { opacity: .7; }
.logo:active .logo-svg { opacity: .5; transition-duration: 0s; }
/* logo 3D (logo3d.js): lienzo encima del SVG; se cambian el uno por el otro */
.logo { position: relative; }
.logo-3d { position: absolute; pointer-events: none; opacity: 0; transition: opacity .15s ease-out; z-index: 1; }
.logo.is-3d .logo-3d { opacity: 1; }
.logo.is-3d .logo-svg { opacity: 0; transition-duration: .15s; }

.menu { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.menu > li { position: relative; }
.has-sub::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 12px; } /* puente de hover */

.top {
  position: relative; display: inline-flex; align-items: center; gap: .35rem;
  background: none; border: 0; color: var(--ink); font: inherit;
  font-size: .75rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; /* tracking positivo en texto pequeño */
  text-decoration: none; padding: .6rem .7rem; cursor: pointer;
}
/* Subrayado con transition (interrumpible): si el puntero sale a mitad, vuelve desde donde está */
.top::after {
  content: ""; position: absolute; left: .7rem; right: .7rem; bottom: .35rem; height: 1.5px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease-out);
}
.top:hover::after, .has-sub.open > .top::after, .top:focus-visible::after, .top[aria-current="true"]::after { transform: scaleX(1); }
.top:active { opacity: .6; }

.chev { width: 9px; height: 9px; transition: transform .2s var(--ease-out); }
.has-sub.open .chev { transform: rotate(180deg); }
@media (hover: hover) { .has-sub:hover .chev { transform: rotate(180deg); } }

/* Submenú: nace del botón que lo abre (transform-origin = esquina del disparador) */
.sub {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 210px; margin: 0; padding: 6px; list-style: none;
  /* casi opaco: va dentro de la barra de vidrio y ahí el desenfoque del navegador no funciona,
     así que con el fondo translúcido no se leía sobre vídeos y fotos */
  background: color-mix(in srgb, var(--bg) 97%, transparent);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--card-shadow);
  opacity: 0; visibility: hidden; transform: translate3d(0, -6px, 0) scale(.96); transform-origin: top left;
  transition: opacity .16s var(--ease-in), transform .16s var(--ease-in), visibility 0s .16s;
}
.has-sub.open .sub { opacity: 1; visibility: visible; transform: none; transition: opacity .22s var(--ease-out), transform .22s var(--ease-out), visibility 0s; }
@media (hover: hover) {
  .has-sub:hover .sub { opacity: 1; visibility: visible; transform: none; transition: opacity .22s var(--ease-out), transform .22s var(--ease-out), visibility 0s; }
}
.sub a { display: block; padding: .55rem .8rem; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: .9375rem; }
.sub a:hover, .sub a:focus-visible { background: var(--bg2); outline: none; }
.sub a:active { background: var(--line); }
.sub a[aria-current="true"] { color: var(--accent); font-weight: 600; }

/* ───────── Botones ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.75rem; padding: 0 1.4rem; border-radius: 980px; border: 1px solid transparent;
  font: inherit; font-size: .9375rem; font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer;
  transition: transform .1s ease-out, background-color .2s ease, border-color .2s ease, opacity .2s ease;
}
.btn:active { transform: scale(.96); }               /* feedback al presionar, no al soltar */
.primary { background: var(--accent); color: var(--on-accent); }   /* 5.2:1 claro, 8.3:1 oscuro */
.primary:hover { opacity: .88; }
.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.ghost:hover { background: var(--bg2); }
.small { min-height: 2.25rem; padding: 0 1rem; font-size: .875rem; }
.icon { width: 2.375rem; min-height: 2.375rem; padding: 0; color: var(--ink); background: transparent; border-color: var(--line); }
.icon:hover { background: var(--bg2); }
.icon svg { width: 18px; height: 18px; }

/* ───────── Hero ───────── */
[hidden] { display: none !important; }   /* que .btn (display:inline-flex) no anule el atributo hidden */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────── Demo reel: a todo lo ancho, pasando por debajo del header de vidrio ───────── */
.reel { margin-top: calc(-3.5rem - env(safe-area-inset-top, 0px)); }
.reel-btn.video {
  aspect-ratio: auto; width: 100%;
  height: min(100svh, 56.25vw);              /* 16:9 a lo ancho, nunca más alto que la pantalla */
  min-height: 15rem;
  border-radius: 0; box-shadow: none;
}
.reel-btn.video:active { transform: none; }  /* a pantalla completa el encogido se ve como un hueco */
.cta { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 2rem; }

/* ───────── Work ───────── */
/* "Work" solo existe para lectores de pantalla; la franja aparece únicamente con un filtro activo */
.workhead { padding: 0 var(--pad-x); max-width: calc(1100px + 2 * var(--pad-x)); margin: 0 auto; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.workhead.filtered { padding-block: clamp(2rem, 5vw, 3rem) .5rem; }
.work-title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 3.6vw, 2.4rem); letter-spacing: -.035em; line-height: 1.05; color: var(--ink); }
.workhead:not(.filtered) { padding-bottom: clamp(1rem, 2.5vw, 1.5rem); }
/* página 3D (3d.html): el título abre la página, con aire bajo la barra */
.workhead.page-head { padding-top: clamp(2.5rem, 7vw, 5rem); }
.workhead.page-head .work-title { font-size: clamp(2rem, 5vw, 3.6rem); letter-spacing: -.04em; }
.workhead.filtered .work-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#flabel { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.03em; color: var(--ink); }
#empty { max-width: 1100px; margin: 0 auto; padding: 3rem var(--pad-x); color: var(--mute); }

/* Cambio de filtro: fundido, no corte */

.proj { padding: clamp(3rem, 8vw, 6rem) var(--pad-x); border-top: 1px solid var(--line); }
.proj.alt { background: var(--bg2); }
.proj[hidden] { display: none; }
.proj h2 { font-size: clamp(2.25rem, 6vw, 4.25rem); line-height: 1; letter-spacing: -.045em; font-weight: 650; margin: 0 0 1.75rem; text-wrap: balance; }

.video {
  position: relative; display: block; width: 100%; padding: 0; border: 0;
  aspect-ratio: 16 / 9; border-radius: var(--r-box); background: var(--ph); overflow: hidden;
  cursor: zoom-in; color: inherit; font: inherit;
  transition: transform .12s ease-out;
}
.video:active { transform: scale(.985); }
.video video { width: 100%; height: 100%; object-fit: cover; }
/* píldora de vidrio: se lee sobre cualquier fotograma */
.pill {
  position: absolute; left: 1rem; top: 1rem;
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .8rem .45rem .65rem; border-radius: 980px;
  background: rgba(20, 20, 22, .55); color: #fff;
  -webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
  font-size: .8125rem; font-weight: 600; letter-spacing: .01em;
  transition: background-color .2s ease;
}
.pill svg { width: .7rem; height: .7rem; fill: currentColor; }
/* El vidrio pequeño no aparece ni desaparece con el hover: un backdrop-filter que pasa de
   opacidad 0 a 1 pinta mal su primer fotograma (destello). Siempre visible, solo se oscurece. */
@media (hover: hover) { .video:hover .pill, .video:focus-visible .pill { background: rgba(20, 20, 22, .72); } }

.meta { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 2rem 4rem; margin-top: 2rem; }
.meta p { margin: 0; max-width: 56ch; text-wrap: pretty; }
.meta a { color: var(--accent); text-decoration: none; }
.meta a:hover { text-decoration: underline; text-underline-offset: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; align-content: flex-start; }
.chips span, .chips .chip { border: 1px solid var(--line); border-radius: 980px; padding: .3rem .8rem; font-size: .875rem; color: var(--mute); }
/* las cápsulas son enlaces a tags.html: mismo aspecto, pero responden al ratón */
.chips .chip { text-decoration: none; transition: background-color .45s var(--ease-out), color .45s var(--ease-out), border-color .45s var(--ease-out), transform .1s ease-out; }
/* al pasar el ratón: relleno al 70 % (no blanco/negro total) y sin subrayado */
.chips .chip:hover {
  text-decoration: none; opacity: 1; color: var(--bg);
  background: color-mix(in srgb, var(--ink) 70%, transparent); border-color: color-mix(in srgb, var(--ink) 70%, transparent);
}
.chips .chip:active { transform: scale(.96); }

.stage.o-v { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 3rem; align-items: center; }
.o-v .video { aspect-ratio: 9 / 16; }
.o-v .meta { grid-template-columns: 1fr; margin-top: 0; gap: 1.5rem; }

/* ───────── Fichas técnicas ───────── */
.sheets {
  display: grid; gap: 1rem; margin-top: 2.5rem;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  grid-template-areas: "a b" "a c";
}
.sheets > :nth-child(1) { grid-area: a; }
.sheets > :nth-child(2) { grid-area: b; }
.sheets > :nth-child(3) { grid-area: c; }
.sheets > :nth-child(1) { display: flex; flex-direction: column; }
.sheets > :nth-child(1) .sheet-btn { flex: 1; aspect-ratio: auto; min-height: 16rem; }
.proj.alt .sheets { grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); grid-template-areas: "b a" "c a"; }
.sheet { margin: 0; }
.sheet-btn {
  position: relative; display: grid; place-items: center; width: 100%; padding: 0;
  border: 1px solid var(--line); border-radius: 12px; background: var(--ph); overflow: hidden;
  cursor: zoom-in; aspect-ratio: 4 / 3; color: var(--mute); font: inherit; font-size: .8125rem;
  transition: transform .12s ease-out;
}
.sheet-btn::before { content: "Ficha técnica"; }
.sheet-btn.has-img::before { content: none; }
.sheet-btn:active { transform: scale(.98); }
.sheet-btn img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease-out), opacity .3s ease; }
.sheet-btn img.broken { opacity: 0; }
.sheet-btn.is-empty { cursor: default; }
.sheet-btn.is-empty:active { transform: none; }
.sheet figcaption { font-size: .9375rem; margin-top: .6rem; font-weight: 500; letter-spacing: -.01em; }

/* ───────── About ───────── */
.about { padding: clamp(3rem, 8vw, 6rem) var(--pad-x); border-top: 1px solid var(--line); }
.about h2 { font-size: clamp(2rem, 6vw, 4rem); letter-spacing: -.04em; line-height: 1.02; margin: 0 0 1.25rem; }
.about p { max-width: 52ch; color: var(--mute); margin: 0; text-wrap: pretty; }
.about-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 6vw, 5rem); align-items: end; }
.about-photo { margin: 0; aspect-ratio: 4 / 5; border-radius: var(--r-box); overflow: hidden; background: var(--ph); box-shadow: var(--card-shadow); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-photo img.broken { display: none; }
.about-copy { padding-bottom: clamp(0rem, 4vw, 3rem); }

/* ───────── Contacto (debajo de About) ───────── */
.contact { padding: clamp(3rem, 8vw, 6rem) var(--pad-x); border-top: 1px solid var(--line); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.contact h2 { font-size: clamp(2rem, 6vw, 4rem); letter-spacing: -.04em; line-height: 1.02; margin: 0 0 1.25rem; }
.contact-copy p { max-width: 40ch; color: var(--mute); margin: 0 0 1rem; text-wrap: pretty; }
.contact-copy .link { display: flex; width: max-content; }   /* correo e Instagram, uno debajo del otro */
.contact-form { display: grid; gap: 1rem; padding: clamp(1.25rem, 3vw, 2rem); border-radius: var(--r-box); background: var(--card); border: 1px solid var(--card-edge); box-shadow: var(--card-shadow); }
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cf-field { display: grid; gap: .4rem; font-size: .875rem; font-weight: 600; }
.cf-field em { font-style: normal; font-weight: 400; color: var(--mute); }
.cf-field input, .cf-field textarea {
  width: 100%; box-sizing: border-box; padding: .75rem .9rem; border-radius: var(--r-inner);
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font: inherit; font-size: 1rem; font-weight: 400;   /* 16px: iOS no hace zoom al enfocar */
  transition: border-color .2s ease, box-shadow .2s ease;
}
.cf-field textarea { resize: vertical; min-height: 8rem; }
.cf-field input:focus-visible, .cf-field textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 25%, transparent); }
.cf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-send { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.cf-send .btn:disabled { opacity: .5; cursor: progress; }
.cf-status { margin: 0; font-size: .875rem; color: var(--mute); }
.cf-status.ok { color: var(--ink); }
.cf-status.err { color: #dc2626; }
[data-theme="dark"] .cf-status.err { color: #f87171; }
.link { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.75rem; font-weight: 600; font-size: .9375rem; text-decoration: none; color: var(--ink); }
.link svg { width: .7rem; height: .7rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; transition: transform .25s var(--ease-out); }
.link:hover svg { transform: translate(2px, -2px); }
.link:active { opacity: .6; }
.foot { display: flex; justify-content: space-between; gap: 1rem; max-width: calc(1100px + 2 * var(--pad-x)); margin: 0 auto; padding: 2rem var(--pad-x) 3rem; font-size: .8125rem; color: var(--mute); border-top: 1px solid var(--line); }
.foot a { color: var(--mute); text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* ───────── Visor ───────── */
#viewer {
  position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden;
}
#viewer::backdrop { background: transparent; }
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .86); opacity: 0; }
.v-stage {
  position: absolute; inset: 0; display: grid; place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  touch-action: none;   /* el arrastre lo gestionamos nosotros */
}
.v-media {
  max-width: min(100%, 1400px); max-height: 100%; border-radius: var(--r-inner); background: #000;
  will-change: transform; transform-origin: center; user-select: none; -webkit-user-drag: none;
  cursor: grab;
}
.v-media.dragging { cursor: grabbing; }
.v-close {
  position: absolute; top: max(1rem, env(safe-area-inset-top)); right: 1rem; z-index: 2;
  width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); cursor: pointer;
  display: grid; place-items: center;
  background: rgba(40, 40, 44, .55); color: #fff;
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  opacity: 0; transition: opacity .2s ease, transform .1s ease-out;
}
#viewer.shown .v-close { opacity: 1; }
.v-close:active { transform: scale(.92); }
.v-close svg { width: 1.1rem; height: 1.1rem; stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }

/* ───────── Móvil ───────── */
@media (max-width: 760px) {
  .logo-svg { height: 1.125rem; }
  header.bar { gap: .5rem; }
  .top { padding: .6rem .5rem; }
  .sub { left: auto; right: 0; transform-origin: top right; }   /* sigue naciendo del botón, sin salirse de pantalla */
  .meta { grid-template-columns: 1fr; }
  .stage.o-v { grid-template-columns: 1fr; gap: 2rem; }
  .o-v .video { max-width: 340px; margin: 0 auto; }
  .sheets, .proj.alt .sheets { grid-template-columns: 1fr 1fr; grid-template-areas: "a a" "b c"; }
  .sheets > :nth-child(1) .sheet-btn { min-height: 0; aspect-ratio: 4 / 3; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 22rem; }
  .contact-grid, .cf-row { grid-template-columns: 1fr; }
}

/* ───────── Accesibilidad ───────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .top::after, .chev, .sub, .sheet-btn img, .pill, #projects { transition-duration: 0s; }
  .btn:active, .video:active, .sheet-btn:active { transform: none; }
}
/* Transparencia reducida: vidrio más esmerilado (más opaco), no eliminado */
@media (prefers-reduced-transparency: reduce) {
  :root { --glass: rgba(251, 251, 253, .55); --card: rgba(255, 255, 255, .55); }
  :root[data-theme="dark"] { --glass: rgba(22, 22, 24, .55); --card: rgba(38, 38, 42, .55); }
  .pill, .v-close { background: rgba(20, 20, 22, .8); }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(0, 0, 0, .5); --mute: #3a3a3c; }
  :root[data-theme="dark"] { --line: rgba(255, 255, 255, .6); --mute: #d1d1d6; }
  header.bar, .sub { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 1px solid var(--line); }
}

/* ═════════ Vidrio en proyectos ═════════
   El vidrio necesita algo detrás: cada proyecto tiene un fondo ambiental
   difuminado tomado de su propia imagen. Encima, la información flota
   en una tarjeta de vidrio que se monta sobre el vídeo.                */
#cards    { --tint: #d9714a; }
#delacruz { --tint: #c9a227; }
#leon     { --tint: #5fae6a; }
#nova     { --tint: #5b6b8f; }
#polar    { --tint: #2f6fd6; }
#residency { --tint: #4a5cf0; }
#yogis    { --tint: #e5602a; }

.proj { position: relative; isolation: isolate; overflow: hidden; border-top: 0; }
.proj.alt { background: transparent; }
.proj::before {                                   /* luz ambiental */
  content: ""; position: absolute; inset: -15%; z-index: -2;
  background-image: var(--ambient, linear-gradient(transparent, transparent)),
                    radial-gradient(circle at 30% 35%, var(--tint), transparent 65%);
  background-size: cover; background-position: center;
  filter: blur(90px) saturate(160%);
  opacity: var(--ambient-op);
  transform: translateZ(0);
}
.proj::after {                                    /* funde con el fondo arriba y abajo */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(var(--bg), transparent 22%, transparent 78%, var(--bg));
}

.glass {
  background: var(--card);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--card-edge);
  box-shadow: var(--card-shadow), var(--bevel);   /* biselado profundo: ver "Vidrio líquido" al final */
}

/* Tarjeta de información sobre el vídeo */
.o-h .meta {
  position: relative; z-index: 1;
  margin: -4.5rem clamp(1rem, 3vw, 2.5rem) 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: var(--r-box);
}
.o-h .video { box-shadow: var(--card-shadow); }
/* Legibilidad sobre vidrio: más contraste y un pelo más de peso, nunca gris plano */
.meta.glass p { color: var(--ink); letter-spacing: .003em; }
.meta.glass .chips span, .meta.glass .chips .chip { color: var(--ink); border-color: var(--line); font-weight: 500; opacity: .85; }
.meta.glass .chips .chip:hover { color: var(--bg); opacity: 1; }

/* Fichas como tarjetas de vidrio */
.sheet.glass { padding: .5rem .5rem .75rem; border-radius: var(--r-box); }
.sheet.glass .sheet-btn { border-radius: var(--r-inner); border-color: transparent; }
.sheet.glass figcaption { margin: .65rem .35rem 0; }
.sheet-btn .zoom {
  position: absolute; right: .6rem; bottom: .6rem; z-index: 1;
  display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%;
  background: rgba(20, 20, 22, .5); color: #fff;
  -webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
  display: none; transition: background-color .2s ease;
}
.sheet-btn .zoom svg { width: .95rem; height: .95rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sheet-btn.has-img .zoom { display: grid; }   /* solo existe si hay imagen; nunca se funde con el hover */
@media (hover: hover) { .sheet-btn.has-img:hover .zoom, .sheet-btn.has-img:focus-visible .zoom { background: rgba(20, 20, 22, .72); } }

/* Visor: la imagen ampliada se arrastra */
.v-media { cursor: zoom-in; }
video.v-media { cursor: default; }
.v-media.zoomed { cursor: grab; }
.v-media.dragging { cursor: grabbing; }

@media (max-width: 760px) {
  .o-h .meta { margin: -2rem .75rem 0; }
}
@media (prefers-reduced-transparency: reduce) {
  .sheet-btn .zoom { background: rgba(20, 20, 22, .8); }
}
@media (prefers-contrast: more) {
  .glass { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: var(--line); box-shadow: none; }
  .proj::before { opacity: .15; }
}

.reel { position: relative; }
.reel-btn.video { cursor: default; }

/* Proyectos alternos: la tarjeta de vidrio se desplaza a un lado u otro (ritmo, no repetición) */
@media (min-width: 761px) {
  .proj:not(.alt) .o-h .meta { margin-left: clamp(1rem, 3vw, 2.5rem); margin-right: clamp(3rem, 12vw, 9rem); }
  .proj.alt .o-h .meta { margin-left: clamp(3rem, 12vw, 9rem); margin-right: clamp(1rem, 3vw, 2.5rem); }
}

/* Grano: textura muy sutil sobre todo, fija y sin eventos (no repinta al hacer scroll) */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 30; pointer-events: none;
  opacity: .03;   /* sin mix-blend-mode: la fusión obligaba a recomponer todos los desenfoques en cada hover */
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-contrast: more) { body::after { display: none; } }

/* ═════════ Movimiento (design-motion-principles · Jakub principal, Jhey secundario) ═════════
   Regla: solo se anima lo que ocurre pocas veces (llegada, entrada de cada proyecto, cambios
   de estado). Menú y botones, que se usan a menudo, siguen siendo inmediatos.
   Solo se animan transform, opacity, filter y clip-path.                                      */
:root {
  /* muelle críticamente amortiguado (sin rebote), generado en CSS linear() */
  --spring: linear(0, 0.035, 0.116, 0.218, 0.325, 0.428, 0.522, 0.605, 0.677, 0.737, 0.788, 0.830, 0.864, 0.892, 0.914, 0.932, 0.947, 0.958, 0.967, 0.974, 0.980, 0.984, 0.988, 0.991, 1);
  --exit: cubic-bezier(.4, 0, 1, 1);
}

/* 1 · Llegada (una vez por visita): la barra baja 8px y el reel se asienta desde 1.03 */
.js-intro header.bar { opacity: 0; transform: translateY(-8px); }
.js-intro .reel-btn video { opacity: 0; transform: scale(1.03); }
header.bar { transition: opacity .9s var(--spring), transform 1.1s var(--spring); }
.reel-btn video { transition: opacity 1.4s var(--spring), transform 1.9s var(--spring); }

/* 2 · Títulos: rampa letra a letra (motion.js parte el texto). Cada letra sube desde abajo
   y se enfoca 34 ms después de la anterior; las palabras no se parten al saltar de línea. */
.js-reveal .rv-text .rv-w { display: inline-block; white-space: nowrap; }
.js-reveal .rv-text .rv-l { display: inline-block; opacity: 0; transform: translate3d(0, .55em, 0); filter: blur(6px);
  transition: opacity .9s var(--spring), transform 1.2s var(--spring), filter 1s var(--spring);
  transition-delay: calc(var(--d, 0ms) + var(--i, 0) * 34ms); }
.js-reveal .rv-text.is-in .rv-l { opacity: 1; transform: none; filter: blur(0); }

/* 3 · Vídeo y foto: el recorte se abre de abajo hacia arriba (sin blur: sobre vídeo sería caro) */
.js-reveal .rv-clip { clip-path: inset(32% 0 0 0 round var(--r-box)); opacity: 0; transform: translate3d(0, 32px, 0);
  transition: clip-path 1.5s var(--spring), opacity 1s var(--spring), transform 1.5s var(--spring);
  transition-delay: var(--d, 0ms); }
.js-reveal .rv-clip.is-in { clip-path: inset(0 round var(--r-box)); opacity: 1; transform: none; }
.js-reveal .rv-clip.rv-done { clip-path: none; }

/* 4 · Bloques: suben desde abajo (opacidad + 32px + desenfoque que se enfoca), lentos y en rampa;
   motion.js reparte los retrasos de abajo hacia arriba entre los que entran juntos. */
.js-reveal .rv { opacity: 0; transform: translate3d(0, 32px, 0); filter: blur(6px);
  transition: opacity 1.1s var(--spring), transform 1.4s var(--spring), filter 1.1s var(--spring);
  transition-delay: var(--d, 0ms); }
.js-reveal .rv.is-in { opacity: 1; transform: none; filter: blur(0); }
/* sin desenfoque en lo grande o lo que lleva 3D/vidrio dentro (el filter rompería el backdrop o costaría mucho) */
.js-reveal .flow.rv, .js-reveal .cf-infos.rv, .js-reveal canvas.rv { filter: none; }

/* 5 · Vidrio estable. En Chrome/Edge un elemento con backdrop-filter destella si cambia de capa
   (al empezar/acabar una transform, o si lleva un filter encima). Por eso:
   - todo bloque de vidrio vive en una capa fija desde el principio (translateZ),
   - su entrada no usa filter (solo opacidad y desplazamiento),
   - el hover de las fichas solo cambia la sombra, sin moverlas,
   - nada se anima por debajo del vidrio al pasar el ratón.                                   */
.glass, .sub { will-change: transform; }   /* capa fija explícita para el vidrio */
.js-reveal .glass.rv, .js-reveal .glass.rv.is-in { filter: none; }
.js-reveal .glass.rv { transform: translate3d(0, 32px, 0); }
.js-reveal .glass.rv.is-in { transform: none; }
.sheet.glass { transition: box-shadow .2s ease; }
@media (hover: hover) {
  .sheet.glass:has(.has-img):hover { box-shadow: var(--card-shadow-hover), var(--bevel); }
}
/* la imagen de la ficha sí hace zoom, pero también en su propia capa fija */
.sheet-btn img { will-change: transform; }
@media (hover: hover) { .sheet-btn:not(.is-empty):hover img { transform: scale(1.03); } }

/* 6 · Filtros: la salida es más corta y discreta que la entrada */
#projects { transition: opacity .6s var(--spring), transform .8s var(--spring); }
#projects.swapping { opacity: 0; transform: translateY(6px); transition: opacity .25s var(--exit), transform .25s var(--exit); }

/* 7 · Cambios de icono (tema): escala + desenfoque, nunca un corte seco */
.icon { position: relative; }
.icon svg { position: absolute; inset: 0; margin: auto; transition: opacity .2s var(--spring), transform .25s var(--spring), filter .2s var(--spring); }
.sun, [data-theme="dark"] .moon {
  opacity: 0; transform: scale(.6) rotate(-25deg); filter: blur(4px); }
[data-theme="dark"] .sun, .moon {
  opacity: 1; transform: none; filter: none; }

/* Movimiento reducido: sin desplazamientos, escalas ni recortes; solo fundidos cortos */
@media (prefers-reduced-motion: reduce) {
  .js-intro header.bar, .js-intro .reel-btn video,
  .js-reveal .rv, .js-reveal .rv-clip, .js-reveal .rv-text .rv-l { transform: none; filter: none; clip-path: none; }
  header.bar, .reel-btn video, .js-reveal .rv, .js-reveal .rv-clip, .js-reveal .rv-text .rv-l, #projects {
    transition-property: opacity; transition-duration: .3s; transition-delay: 0s; }
  #projects.swapping { transform: none; }
  .js-reveal .glass.rv, .js-reveal .glass.rv.is-in { transform: none; }
  .js-reveal .rv-clip.is-in { clip-path: none; }
  .icon svg { transition: opacity .15s linear; transform: none !important; filter: none !important; }
}

/* ═════════ Foco de luz bajo el vidrio ═════════
   Una forma redonda y desenfocada sigue al cursor por detrás de la superficie de vidrio.
   Va por debajo del contenido (z-index -1 dentro del bloque aislado), así el texto no se tapa. */
.glass { position: relative; isolation: isolate; overflow: hidden; }
.glow {
  position: absolute; left: 0; top: 0; z-index: -1; pointer-events: none;
  width: 15rem; height: 15rem; margin: -7.5rem 0 0 -7.5rem; border-radius: 50%;
  background: radial-gradient(circle, var(--glow) 0%, transparent 68%);
  filter: blur(26px);
  opacity: 0; will-change: transform, opacity;
  transition: opacity .25s var(--exit);            /* salida: más rápida */
}
.glass.glowing .glow { opacity: 1; transition: opacity .35s var(--spring); }   /* entrada */
:root { --glow: color-mix(in oklch, var(--tint, #2563eb) 55%, transparent); }
:root[data-theme="dark"] { --glow: color-mix(in oklch, var(--tint, #60a5fa) 75%, white 25%); }
.proj { --glow: color-mix(in oklch, var(--tint) 55%, transparent); }
[data-theme="dark"] .proj { --glow: color-mix(in oklch, var(--tint) 70%, white 30%); }
@media (prefers-contrast: more) { .glow { display: none; } }

/* ═════════ Presentación sobre el reel: una línea sin caja + botón "Ver reel" ═════════ */
.reel-tag {
  position: absolute; left: var(--pad-x); right: var(--pad-x); bottom: clamp(1.25rem, 3.5vw, 2.5rem); z-index: 2;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap;
  color: #fff; pointer-events: none;
}
.reel-tag h1 {
  margin: 0; max-width: 40rem; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1rem, 1.5vw, 1.25rem); line-height: 1.2; letter-spacing: -.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 24px rgba(0, 0, 0, .35);     /* se lee sobre cualquier plano */
}
.reel-tag .rt-name { display: block; font-size: 1.9em; line-height: 1; letter-spacing: -.04em; }
.reel-tag .rt-what { display: block; margin-top: .2rem; font-weight: 500; opacity: .85; }
.reel-play {
  pointer-events: auto; display: inline-flex; align-items: center; gap: .55rem;
  padding: .75rem 1.2rem; border: 0; border-radius: var(--r-pill); cursor: pointer;
  background: rgba(20, 20, 22, .5); color: #fff; font: 600 .9375rem/1 var(--font-body, inherit);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  transition: background .3s ease, transform .5s var(--spring, ease);
}
.reel-play svg { width: .8rem; height: .8rem; fill: currentColor; }
@media (hover: hover) { .reel-play:hover { background: rgba(20, 20, 22, .72); transform: scale(1.03); } }
.reel-play:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* llegada: entra justo después del reel */
.reel-tag { transition: opacity 1s var(--spring) .45s, transform 1.3s var(--spring) .45s; }
.js-intro .reel-tag { opacity: 0; transform: translate3d(0, 16px, 0); }

/* móvil: el vídeo es bajo, así que la línea va debajo, sobre el fondo de la página */
@media (max-width: 760px) {
  .reel-tag { position: relative; left: auto; right: auto; bottom: auto; padding: 1.1rem var(--pad-x) 0; color: var(--ink); align-items: center; }
  .reel-tag h1 { text-shadow: none; font-size: 1.15rem; }
  .reel-play { background: var(--ink); color: var(--bg); }
}
@media (prefers-reduced-motion: reduce) {
  .reel-tag { transition: opacity .3s linear; }
  .js-intro .reel-tag { transform: none; }
}

/* ═════════ Vidrio líquido ═════════
   Biselado profundo y curvo: brillo ancho arriba a la izquierda, sombra interna abajo a la derecha
   y un filo especular arriba. La refracción la pone glass-fx.js (Chrome/Edge). */
:root {
  --bevel:
    inset 0 1.5px 0 rgba(255, 255, 255, .75),
    inset 0 -1px 0 rgba(255, 255, 255, .25),
    inset 14px 16px 26px -16px rgba(255, 255, 255, .7),
    inset -16px -20px 30px -18px rgba(18, 22, 48, .2);
}
:root[data-theme="dark"] {
  --bevel:
    inset 0 1.5px 0 rgba(255, 255, 255, .28),
    inset 0 -1px 0 rgba(255, 255, 255, .08),
    inset 14px 16px 26px -16px rgba(255, 255, 255, .16),
    inset -16px -20px 30px -18px rgba(0, 0, 0, .55);
}
/* Chrome/Edge: la refracción ya incluye el desenfoque; el tinte se aclara para que se vea la curva */
.gfx-refract .glass { background: color-mix(in srgb, var(--card) 70%, transparent); }

/* ═════════ Animación estilo Apple (motion.js) ═════════
   Los muelles los calcula motion.js fotograma a fotograma: sin transiciones CSS. */
@media (prefers-reduced-motion: no-preference) {
  .motion-apple.js-reveal .rv, .motion-apple.js-reveal .rv-clip, .motion-apple.js-reveal .rv-text .rv-l { transition: none !important; }
}

/* ═════════ About me: retrato en nube de puntos (nube.js) ═════════
   La foto queda debajo como respaldo y se funde cuando la nube está lista. */
.about-photo { position: relative; }
.about-photo img { transition: opacity 1.2s var(--spring); }
.about-cloud { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s var(--spring); }
.about-photo.cloud-on .about-cloud { opacity: 1; }
.about-photo.cloud-on img { opacity: 0; }
.cloud-tilt {
  position: absolute; left: 50%; top: .75rem; transform: translateX(-50%); z-index: 2;
  border: 1px solid var(--line); background: var(--glass); color: var(--ink);
  -webkit-backdrop-filter: blur(16px) saturate(170%); backdrop-filter: blur(16px) saturate(170%);
}
.cloud-tilt { min-height: 2.25rem; padding: 0 .9rem; border-radius: var(--r-pill); font: 600 .75rem/1 var(--font); cursor: pointer; }
.cloud-tilt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .about-photo img, .about-cloud { transition: opacity .3s linear; } }

/* ═════════ Cintillo de marcas (entre el banner y los proyectos) ═════════ */
.clients { padding: clamp(1.75rem, 4vw, 2.75rem) 0; border-bottom: 1px solid var(--line); overflow: hidden; }
.clients-title { margin: 0 var(--pad-x) 1.1rem; text-align: center; font-size: .75rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--mute); }
.marquee {
  overflow: hidden;
  /* los bordes se funden con el fondo */
  -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
          mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; align-items: center; gap: clamp(2.5rem, 6vw, 4.5rem); width: max-content; margin: 0; padding: 0 0 0 clamp(2.5rem, 6vw, 4.5rem); list-style: none; }
.marquee-track.run { animation: marquee var(--dur, 40s) linear infinite; }
.marquee:hover .marquee-track.run { animation-play-state: paused; }
@keyframes marquee { to { transform: translate3d(-50%, 0, 0); } }
.marquee-track li {
  flex: none; white-space: nowrap; color: var(--mute);
  font: 700 clamp(1rem, 2vw, 1.25rem)/1 var(--font-display); letter-spacing: -.02em;
  transition: color .3s ease;
}
.marquee-track li:hover { color: var(--ink); }
/* logo flat: la imagen solo da la forma; el color es el del texto */
.logo-mark {
  display: block; height: calc(var(--h, 1.25) * clamp(1.1rem, 2.6vw, 1.45rem)); aspect-ratio: var(--ratio, 3);
  background: currentColor;
  -webkit-mask: var(--logo) center / contain no-repeat;
          mask: var(--logo) center / contain no-repeat;
}
.marquee-track.static { flex-wrap: wrap; justify-content: center; width: auto; padding: 0 var(--pad-x); row-gap: 1.25rem; }
@media (prefers-reduced-motion: reduce) { .marquee-track.run { animation: none; } }

/* ═════════ Contacto en la barra: burbuja negra, siempre visible ═════════ */
.bar-cta {
  flex: none; display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0 1rem;
  border-radius: var(--r-pill); background: #000; color: #fff; text-decoration: none; white-space: nowrap;
  font: 600 .8125rem/1 var(--font);
  transition: transform .1s ease-out, background-color .2s ease;
}
.bar-cta:hover { background: #1d1d1f; }
.bar-cta:active { transform: scale(.96); }
[data-theme="dark"] .bar-cta { box-shadow: 0 0 0 1px rgba(255, 255, 255, .22); }   /* que no se pierda sobre fondo oscuro */
.bar-cta svg { display: none; width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
/* en móvil no cabe todo: la burbuja se queda solo con el icono y el menú se compacta */
@media (max-width: 600px) {
  .bar-cta { width: 2.5rem; height: 2.5rem; min-height: 0; padding: 0; justify-content: center; border-radius: 50%; }
  .bar-cta span { display: none; }
  .bar-cta svg { display: block; }
  .menu { gap: 0; }
  .top { padding: .6rem .4rem; font-size: .75rem; }
}

/* ═════════ Selector de idioma (i18n.js) ═════════ */
.lang-switch { flex: none; display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--r-pill); border: 1px solid var(--line); }
.lang-switch button {
  min-width: 2rem; min-height: 1.75rem; padding: 0 .5rem; border: 0; border-radius: var(--r-pill); background: none; cursor: pointer;
  color: var(--mute); font: 600 .6875rem/1 var(--font); letter-spacing: .06em;
}
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.lang-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* en la barra no cabe en móvil: allí queda solo el del pie */
@media (max-width: 760px) { header.bar .lang-switch { display: none; } }
.foot .lang-switch { margin-right: auto; }   /* a la izquierda: a la derecha lo taparía el guía 3D */
/* mientras se traduce al español no se ve el inglés (i18n.js quita la clase; el seguro la quita a los 2 s) */
.i18n-wait body { visibility: hidden; }

/* ═════════ Pie: enlaces legales ═════════ */
.foot { flex-wrap: wrap; align-items: center; }
.foot-legal { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.foot-legal a, .foot > a { color: var(--mute); text-decoration: none; }
.foot-legal a:hover, .foot > a:hover { color: var(--ink); }
/* aviso de privacidad bajo el formulario */
.cf-legal { margin: 0; font-size: .75rem; line-height: 1.5; color: var(--mute); }
.cf-legal a { color: inherit; }

/* ═════════ Móvil: contacto flotante y menú con aire ═════════
   En móvil la burbuja de contacto sale de la barra y flota abajo a la izquierda (el guía 3D está a
   la derecha): así el menú tiene sitio. El submenú de Work ocupa el ancho de la pantalla, con
   fondo sólido para que se lea bien sobre cualquier fondo. */
.fab-contact { display: none; }
@media (max-width: 600px) {
  header.bar .bar-cta { display: none; }
  .fab-contact {
    position: fixed; left: max(1rem, env(safe-area-inset-left)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 30;
    display: inline-flex; align-items: center; gap: .5rem; min-height: 3rem; padding: 0 1.15rem 0 1rem;
    border-radius: var(--r-pill); background: #000; color: #fff; text-decoration: none;
    font: 600 .875rem/1 var(--font);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25), 0 2px 6px rgba(0, 0, 0, .2);
    transition: transform .1s ease-out;
  }
  [data-theme="dark"] .fab-contact { box-shadow: 0 0 0 1px rgba(255, 255, 255, .22), 0 10px 30px rgba(0, 0, 0, .5); }
  .fab-contact:active { transform: scale(.96); }
  .fab-contact svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
  .foot { padding-bottom: 5.5rem; }                 /* que el botón flotante no tape el pie */
  .m-about { display: revert; }                     /* ahora sí cabe About */
  .top { padding: .6rem .45rem; font-size: .8125rem; }
  /* submenú: a lo ancho, bajo la barra, casi opaco */
  .sub {
    position: fixed; top: calc(3.5rem + env(safe-area-inset-top, 0px) + 6px); left: var(--pad-x); right: var(--pad-x);
    min-width: 0; padding: 8px; transform-origin: top center;
    background: var(--bg);                         /* sólido: dentro de la barra de vidrio el desenfoque no funciona */
    -webkit-backdrop-filter: none; backdrop-filter: none;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
  }
  .sub a { padding: .85rem 1rem; font-size: 1rem; }
}
@media (max-width: 380px) { .logo-svg { height: 1rem; } .top { padding: .6rem .35rem; } }
@media (prefers-reduced-motion: reduce) { .fab-contact { transition: none; } }

/* ───────── Intro de carga (intro.js): logo 3D metálico sobre negro, 1.ª visita de la sesión ───────── */
html.intro-on { overflow: hidden; }
html.intro-on::after { content: ""; position: fixed; inset: 0; z-index: 9998; background: #000; }  /* telón desde el primer pintado */
.intro { position: fixed; inset: 0; z-index: 9999; background: #000; cursor: pointer;
  transition: opacity 1s cubic-bezier(.2, .8, .2, 1), visibility 0s linear 1s; }
.intro canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 1.2s ease; }
.intro.ready canvas { opacity: 1; }
.intro.out { opacity: 0; visibility: hidden; pointer-events: none; }

/* ───────── Programa Clientes Fundadores (fundadores.js + fundadores.json) ───────── */
.fnd { padding: clamp(2rem, 6vw, 4rem) var(--svc-gutter, var(--pad-x)) 0; scroll-margin-top: 4rem; }
/* título que anuncia el programa, entre los servicios y la tarjeta (mismo estilo en dos tonos que "Servicios.") */
.fnd-head { padding: clamp(1.5rem, 5vw, 3.5rem) 0 clamp(1.25rem, 3vw, 2rem); }
.fnd-head h2 { margin: 0; max-width: 24ch; font: 700 clamp(1.75rem, 4.2vw, 3rem)/1.08 var(--font-display); letter-spacing: -.03em; text-wrap: balance; }
.fnd-head h2 span { color: var(--mute); }
.fnd-new {
  display: inline-block; margin: 0 0 .9rem; padding: .3rem .7rem; border-radius: var(--r-pill);
  background: var(--ink); color: var(--bg); font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
}
.fnd-card {
  max-width: 64rem; padding: clamp(1.5rem, 4vw, 3rem); border-radius: calc(var(--r-box) + 8px);
  background: #09090b; color: #fafafa; box-shadow: var(--card-shadow);
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.5rem clamp(2rem, 5vw, 4rem); align-items: start;
}
[data-theme="dark"] .fnd-card { background: #f4f4f5; color: #09090b; }
.fnd-card > * { grid-column: 1; }
.fnd-kicker { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; opacity: .6; }
.fnd-card h2 { margin: 0; font: 800 clamp(1.7rem, 3.6vw, 2.6rem)/1.06 var(--font-display); letter-spacing: -.035em; text-wrap: balance; }
.fnd-card h2 span { opacity: .55; }
.fnd-count { display: grid; gap: .6rem; }
.fnd-dots { display: flex; gap: .4rem; }
.fnd-dots i { width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 1.5px solid currentColor; background: currentColor; }   /* llena = libre */
.fnd-dots i.taken { background: none; opacity: .4; }
.fnd-left { margin: 0; font-size: .9375rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.fnd-steps { margin: 0; padding: 0; list-style: none; counter-reset: fnd; display: grid; gap: .8rem; }
.fnd-steps li { counter-increment: fnd; position: relative; padding-left: 2.5rem; min-height: 1.75rem; font-size: .9375rem; line-height: 1.45; opacity: .85; }
.fnd-steps li::before { content: counter(fnd); position: absolute; left: 0; top: -.1rem; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; border: 1.5px solid currentColor; font-weight: 700; font-size: .8rem; }
.fnd-ex { grid-column: 2; grid-row: 1 / span 4; width: 100%; border-collapse: collapse; font-size: .9375rem; font-variant-numeric: tabular-nums;
  border-collapse: separate; border-spacing: 0; }
.fnd-ex tr { background: color-mix(in srgb, currentColor 7%, transparent); }
.fnd-ex tr:first-child th { border-top-left-radius: var(--r-box); } .fnd-ex tr:first-child td { border-top-right-radius: var(--r-box); }
.fnd-ex tr:last-child th { border-bottom-left-radius: var(--r-box); } .fnd-ex tr:last-child td { border-bottom-right-radius: var(--r-box); }
.fnd-ex caption { caption-side: top; text-align: left; padding: 0 0 .6rem; font-size: .75rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; opacity: .6; }
.fnd-ex th, .fnd-ex td { padding: .85rem 1.1rem; border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent); }
.fnd-ex th { text-align: left; font-weight: 500; opacity: .8; }
.fnd-ex td { text-align: right; font-weight: 600; white-space: nowrap; }
.fnd-ex .fnd-total th, .fnd-ex .fnd-total td { border-bottom: 0; font-weight: 800; font-size: 1.05rem; opacity: 1; }
.fnd-ok { margin: 0; padding: .8rem 1rem; border-radius: var(--r-inner); background: #22c55e; color: #052e12; font-weight: 600; }
.fnd-cta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.fnd-card .fnd-pay { background: #fafafa; color: #09090b; }
[data-theme="dark"] .fnd-card .fnd-pay { background: #09090b; color: #fafafa; }
.fnd-terms { color: inherit; opacity: .7; font-size: .875rem; text-underline-offset: 3px; }
.fnd-terms:hover { opacity: 1; }
.fnd.is-full .fnd-steps, .fnd.is-full .fnd-ex { opacity: .5; }
@media (max-width: 760px) {
  .fnd-card { grid-template-columns: 1fr; }
  .fnd-ex { grid-column: 1; grid-row: auto; }
}

/* franja en la home */
.fnd-strip { padding: 0 var(--pad-x); margin: clamp(.5rem, 2vw, 1.25rem) 0 clamp(1.5rem, 4vw, 2.5rem); }
.fnd-strip a {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem 1rem;
  max-width: 64rem; margin: 0 auto; padding: .8rem 1.25rem; border-radius: var(--r-pill);
  background: var(--ink); color: var(--bg); text-decoration: none; font-size: .9375rem;
  transition: transform .5s var(--spring, ease);
}
@media (hover: hover) { .fnd-strip a:hover { transform: scale(1.015); } }
.fnd-tag { font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; opacity: .65; }
.fnd-txt { font-weight: 600; }
.fnd-strip .fnd-left { opacity: .75; font-variant-numeric: tabular-nums; }
.fnd-go { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.fnd-go::after { content: " →"; }
.h-mode .fnd-strip { display: none; }
/* botón de sonidos (sfx.js): ondas cuando suena, aspa cuando está en silencio */
#sfx .sfx-off { display: none; }
#sfx.muted .sfx-on { display: none; }
#sfx.muted .sfx-off { display: inline; }

/* ═════════ Home: mosaico de las 4 secciones (3D, VFX, Ilustración, Fotografía) ═════════
   A todo el ancho y sin huecos; el nombre en grande se invierte con la imagen (fusión "diferencia"). */
.work-tiles { display: grid; grid-template-columns: 1fr 1fr; }
.wt {
  position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 10;
  background: var(--bg2); color: #fff; text-decoration: none; isolation: isolate;
}
.wt img, .wt video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 1.1s cubic-bezier(.2, .8, .2, 1), filter .4s ease;
}
.wt-name {
  position: absolute; left: var(--pad-x); top: clamp(1rem, 3vw, 2.25rem); z-index: 1;   /* arriba a la izquierda */
  color: #fff; mix-blend-mode: difference; pointer-events: none;
  font: 800 clamp(2.4rem, 7vw, 6.5rem)/.9 var(--font-display); letter-spacing: -.05em;
  transition: transform .8s cubic-bezier(.2, .8, .2, 1);
}
@media (hover: hover) {
  .wt:hover img, .wt:hover video { transform: scale(1.05); filter: brightness(1.04); }
  .wt:hover .wt-name { transform: translateX(.6rem); }
}
.wt:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
@media (max-width: 640px) {
  .work-tiles { grid-template-columns: 1fr; }
  .wt { aspect-ratio: 4 / 3; }
}
@media (prefers-reduced-motion: reduce) {
  .wt img, .wt video, .wt-name { transition: none; }
}
