/* =========================================================================
   ESPURNA STUDIO — experiencia inmersiva (scroll cinematográfico)
   Sistema visual «La Chispa»: negro cálido + ámbar + crema.
   Fuentes autohospedadas Fraunces (serif) + Inter (sans).
   ========================================================================= */

/* ── Fuentes ──────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ───────────────────────────────────────────────────────────── */
:root {
  --bg:        #100c09;
  --bg-2:      #17110b;
  --panel:     #1c150e;
  --ink:       #f5eee2;
  --ink-dim:   #b9ad9c;
  --muted:     #8a7e6d;
  --espurna:   #ff7a18;
  --espurna-2: #ffb25a;
  --gold:      #e3b85c;
  --line:      rgba(245, 238, 226, 0.12);
  --line-soft: rgba(245, 238, 226, 0.07);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --wrap: 72rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dock-h: calc(4.6rem + env(safe-area-inset-bottom, 0px));
}

/* ── Reset ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
html.js { scroll-behavior: auto; }               /* Lenis gestiona el scroll */

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.12rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.locked { overflow: hidden; height: 100vh; }  /* mientras la puerta está cerrada */

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
::selection { background: rgba(255, 122, 24, 0.32); color: #fff; }

/* ── Fondos y textura ─────────────────────────────────────────────────── */
#sparks {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; opacity: 0.9;
}
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none;
  opacity: 0.045; mix-blend-mode: overlay;
  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.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 30%, transparent 42%, rgba(0,0,0,0.55) 100%);
}
.cursor-glow {
  position: fixed; top: 0; left: 0; width: 40rem; height: 40rem; z-index: 2;
  margin: -20rem 0 0 -20rem; border-radius: 50%; pointer-events: none;
  opacity: 0; transition: opacity 0.6s ease;
  background: radial-gradient(circle, rgba(255,122,24,0.10), transparent 60%);
  will-change: transform;
}
body.has-cursor .cursor-glow { opacity: 1; }

/* Todo el contenido por encima de los fondos */
.hud, .rail, .progress, main, .dock, .gate, .overlay, .skip-link { position: relative; z-index: 5; }

/* ── Barra de progreso ────────────────────────────────────────────────── */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 20;
  background: var(--line-soft);
}
.progress span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--espurna), var(--espurna-2));
  box-shadow: 0 0 12px rgba(255, 122, 24, 0.6);
}

/* ── HUD superior ─────────────────────────────────────────────────────── */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 18;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.05rem clamp(1.1rem, 4vw, 2.4rem);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-family: var(--serif); font-weight: 600; letter-spacing: 0.01em; }
.brand img { width: 1.55rem; height: 1.55rem; filter: drop-shadow(0 0 8px rgba(255,122,24,0.5)); }
.brand__word { font-size: 1.12rem; }
.brand__dim { color: var(--muted); }
.lang { display: inline-flex; gap: 0.15rem; padding: 0.2rem; border: 1px solid var(--line); border-radius: 2rem; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); background: rgba(16,12,9,0.4); }
.lang button {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em;
  padding: 0.32rem 0.62rem; border-radius: 2rem; color: var(--muted);
  transition: color 0.25s, background 0.25s;
}
.lang button:hover { color: var(--ink); }
.lang button.is-on { color: #1a1109; background: var(--espurna); }

/* ── Raíl de secciones ────────────────────────────────────────────────── */
.rail { position: fixed; right: clamp(0.8rem, 2vw, 1.5rem); top: 50%; transform: translateY(-50%); z-index: 16; }
.rail ul { list-style: none; display: flex; flex-direction: column; gap: 0.85rem; align-items: flex-end; }
.rail button {
  display: flex; align-items: center; gap: 0.6rem; color: var(--muted);
  font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase;
  padding-block: 5px; margin-block: -5px;   /* área de pulsado ≥24px (WCAG 2.5.8) */
}
.rail .dot { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--muted); transition: all 0.3s var(--ease); }
.rail .txt { opacity: 0; transform: translateX(6px); transition: all 0.3s var(--ease); white-space: nowrap; }
.rail button:hover .txt { opacity: 1; transform: none; color: var(--ink); }
.rail li.is-on button { color: var(--ink); }
.rail li.is-on .dot { border-color: var(--espurna); background: var(--espurna); box-shadow: 0 0 10px rgba(255,122,24,0.7); transform: scale(1.25); }
.rail li.is-on .txt { opacity: 1; transform: none; }

/* ══ Puerta de entrada ════════════════════════════════════════════════ */
.gate {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  background: radial-gradient(120% 100% at 50% 40%, #1b140d 0%, var(--bg) 70%);
  transition: opacity 0.9s ease, visibility 0.9s ease;
}
.gate.is-gone { opacity: 0; visibility: hidden; pointer-events: none; }
.gate__inner { display: grid; justify-items: center; gap: 1.6rem; text-align: center; padding: 2rem; }
.gate__mark { position: relative; display: grid; place-items: center; width: 7rem; height: 7rem; }
.gate__mark img { width: 4.4rem; height: 4.4rem; filter: drop-shadow(0 0 22px rgba(255,122,24,0.7)); animation: pulseMark 2.6s ease-in-out infinite; }
.gate__ring { position: absolute; inset: 0; border: 1px solid rgba(255,122,24,0.4); border-radius: 50%; animation: gatePing 2.8s ease-out infinite; }
@keyframes pulseMark { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes gatePing { 0% { transform: scale(0.7); opacity: 0.8; } 100% { transform: scale(1.5); opacity: 0; } }
.gate__tagline { font-family: var(--serif); font-size: clamp(1.05rem, 3.4vw, 1.5rem); color: var(--ink-dim); max-width: 20ch; }
.gate__btn {
  margin-top: 0.4rem; padding: 0.85rem 2.4rem; border-radius: 3rem;
  font-weight: 600; letter-spacing: 0.05em; color: #1a1109;
  background: linear-gradient(135deg, var(--espurna), var(--espurna-2));
  box-shadow: 0 10px 40px rgba(255,122,24,0.35);
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.gate__btn:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 16px 50px rgba(255,122,24,0.5); }
.gate__btn:active { transform: translateY(0) scale(0.99); }

/* ══ Tipografía compartida ════════════════════════════════════════════ */
.wrap { width: min(var(--wrap), 100% - clamp(2.2rem, 8vw, 8rem)); margin-inline: auto; }

.kicker {
  display: inline-flex; align-items: center; gap: 0.7rem;
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--espurna-2); margin-bottom: 1.4rem;
}
.kicker::before { content: ''; width: 2.2rem; height: 1px; background: var(--espurna); opacity: 0.7; }
.kicker .num { color: var(--espurna-2); }

.big {
  font-family: var(--serif); font-weight: 500; line-height: 1.06;
  font-size: clamp(2rem, 1.2rem + 4.6vw, 4.6rem); letter-spacing: -0.02em;
  max-width: 18ch;
}
.big .dim { color: var(--muted); }
.lead {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(1.2rem, 1rem + 1.4vw, 1.9rem); color: var(--ink-dim);
  margin-top: 1.2rem; max-width: 26ch;
}
.say { font-size: clamp(1rem, 0.95rem + 0.3vw, 1.12rem); color: var(--ink-dim); max-width: 42ch; margin-top: 1.4rem; }
.turn { font-family: var(--serif); font-size: clamp(1.3rem, 1rem + 1.8vw, 2.2rem); margin-top: 2.4rem; color: var(--ink); max-width: 22ch; }
.ignite {
  background: linear-gradient(120deg, var(--espurna), var(--espurna-2) 55%, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.note { color: var(--muted); font-size: 0.9rem; margin-top: 1.8rem; letter-spacing: 0.02em; }
/* Justo después de ver las demos es cuando más apetece preguntar: aquí va el CTA */
.work__foot { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem 2rem; flex-wrap: wrap; }
.work__foot .note { margin-top: 1.8rem; }
.work__foot .btn { margin-top: 1.8rem; }

/* Secciones base */
.s { position: relative; padding-block: clamp(6rem, 14vh, 11rem); }

/* ── HERO ─────────────────────────────────────────────────────────────── */
.hero { min-height: 100vh; min-height: 100svh; display: grid; align-items: center; padding-block: 0; }
.hero__inner { padding-top: 4rem; }
.hero__claim { font-family: var(--serif); font-weight: 500; letter-spacing: -0.03em; line-height: 0.98; font-size: clamp(2.7rem, 1rem + 11vw, 8.5rem); }
.hero__claim .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero__claim .reveal { display: inline-block; will-change: transform; }
.hero__sub { margin-top: 1.8rem; font-size: clamp(1.02rem, 0.95rem + 0.7vw, 1.4rem); color: var(--ink-dim); max-width: 30ch; }
.scroll-hint {
  position: absolute; bottom: calc(var(--dock-h) + 1.2rem); left: 50%; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 0.5rem;
  font-size: 0.7rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted);
}
.scroll-hint__line { width: 1px; height: 2.4rem; background: linear-gradient(var(--espurna), transparent); animation: hintDrop 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes hintDrop { 0% { transform: scaleY(0); opacity: 0; } 40% { opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ── REVELACIÓN (montaje de demos a la deriva) ──────────────────────────
   OJO: la sección se llama `.scene-reveal`, NO `.reveal`. `.reveal` es la
   clase de los <span> que hacen el mask-reveal del texto; si la sección la
   compartiera, cada línea del titular heredaría `min-height:100svh` y se
   abriría un agujero enorme entre línea y línea. */
.scene-reveal { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; overflow: hidden; padding: 0; }
.reveal__bg { position: absolute; inset: -6% 0; z-index: 0; display: flex; align-items: center; will-change: transform; }
.reveal__track {
  display: flex; gap: clamp(1rem, 2.5vw, 2.4rem); width: max-content; padding-inline: 1.2rem;
  animation: revealDrift 48s linear infinite; will-change: transform;
}
.reveal__track img {
  width: clamp(15rem, 26vw, 30rem); aspect-ratio: 16 / 10; object-fit: cover; border-radius: 1rem;
  filter: brightness(0.42) saturate(0.85) contrast(1.02); box-shadow: 0 22px 60px rgba(0,0,0,0.55);
}
@keyframes revealDrift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.scene-reveal:hover .reveal__track { animation-play-state: paused; }
.reveal__scrim {
  position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(120% 92% at 50% 50%, rgba(16,12,9,0.52) 0%, rgba(16,12,9,0.86) 58%, var(--bg) 100%);
}
.reveal__inner { position: relative; z-index: 2; text-align: center; }
.reveal__text {
  font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em;
  font-size: clamp(1.9rem, 0.9rem + 4.8vw, 4.6rem); line-height: 1.12;
}
.reveal__text .line { display: block; overflow: hidden; padding-bottom: 0.08em; }
.reveal__text .reveal { display: inline-block; will-change: transform; }

/* ── TESIS ────────────────────────────────────────────────────────────── */
.thesis .lead { color: var(--espurna-2); }

/* ── SERVICIOS · «la mecha» (sin pin: el scroll sigue siendo del usuario) ─ */
.services__head { margin-bottom: clamp(2.4rem, 6vh, 4rem); }
.svc-track {
  --fuse-gap: clamp(1.4rem, 4.5vw, 3.2rem);
  position: relative; padding-left: var(--fuse-gap);
  display: grid; gap: clamp(3.4rem, 11vh, 7rem);
}
/* la mecha: hilo apagado + tramo quemado + brasa en la punta */
.svc-fuse { position: absolute; left: 0; top: 0.7rem; bottom: 0.7rem; width: 1px; background: var(--line); }
.svc-fuse__burn {
  position: absolute; inset: 0; transform-origin: top; transform: scaleY(var(--p, 0));
  background: linear-gradient(180deg, rgba(255,178,90,0.35), var(--espurna) 45%, var(--espurna-2));
  box-shadow: 0 0 10px rgba(255,122,24,0.65);
}
.svc-fuse__spark {
  position: absolute; left: 50%; top: calc(var(--p, 0) * 100%);
  width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
  background: #ffe1b0; box-shadow: 0 0 16px 4px rgba(255,122,24,0.75);
  opacity: calc(var(--p, 0) * 3); will-change: top;
}
.svc {
  position: relative; display: grid; align-items: center; gap: clamp(1.4rem, 4vw, 3.2rem);
  grid-template-columns: clamp(8rem, 18vw, 13rem) minmax(0, 1fr);
}
.svc__node {
  position: absolute; left: calc(-1 * var(--fuse-gap) - 4px); top: 0.7rem;
  width: 9px; height: 9px; border-radius: 50%; background: var(--bg);
  border: 1px solid var(--muted); transition: all 0.5s var(--ease);
}
.svc.is-lit .svc__node {
  background: var(--espurna); border-color: var(--espurna);
  box-shadow: 0 0 16px rgba(255,122,24,0.85); transform: scale(1.25);
}
.svc__visual { position: relative; width: 100%; aspect-ratio: 1; display: grid; place-items: center; }
.svc__body { display: grid; justify-items: start; }
.svc__idx { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.2em; color: var(--espurna); margin-bottom: 0.5rem; }
.svc__title {
  font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em;
  font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.5rem); line-height: 1.1;
}
.svc__desc { color: var(--ink-dim); max-width: 38ch; margin-top: 0.7rem; }

/* Visual 1 · orbe fluido (identidad viva) */
.svc__visual--orb { border-radius: 50%; }
.orb__core {
  position: absolute; inset: 22%;
  background: radial-gradient(circle at 35% 28%, #ffe1b0, var(--espurna-2) 34%, var(--espurna) 66%, #a83f08 100%);
  box-shadow: 0 0 70px rgba(255,122,24,0.55), inset 0 0 34px rgba(255,224,170,0.45);
  animation: orbMorph 9s ease-in-out infinite, orbBreath 4.5s ease-in-out infinite;
}
@keyframes orbMorph {
  0%, 100% { border-radius: 52% 48% 46% 54% / 54% 46% 54% 46%; }
  33% { border-radius: 44% 56% 58% 42% / 46% 58% 42% 54%; }
  66% { border-radius: 56% 44% 42% 58% / 52% 48% 56% 44%; }
}
@keyframes orbBreath { 0%, 100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.07) rotate(8deg); } }
.orb__halo {
  position: absolute; inset: 2%; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, rgba(255,122,24,0.5) 18%, transparent 42%, rgba(227,184,92,0.42) 66%, transparent 88%);
  filter: blur(16px); animation: orbSpin 13s linear infinite;
}
.orb__sheen {
  position: absolute; inset: 22%; border-radius: 50%; mix-blend-mode: screen;
  background: radial-gradient(circle at 68% 74%, rgba(255,255,255,0.28), transparent 46%);
  animation: orbSpin 10s linear infinite reverse;
}
@keyframes orbSpin { to { transform: rotate(360deg); } }
.orb__orbit i { position: absolute; inset: 0; }
.orb__orbit i::before {
  content: ''; position: absolute; top: 5%; left: 50%; width: 7px; height: 7px; margin-left: -3.5px;
  border-radius: 50%; background: var(--espurna-2); box-shadow: 0 0 12px var(--espurna);
}
.orb__orbit i:nth-child(1) { animation: orbSpin 15s linear infinite; }
.orb__orbit i:nth-child(2) { animation: orbSpin 22s linear infinite reverse; }
.orb__orbit i:nth-child(3) { animation: orbSpin 9s linear infinite; }
.orb__orbit i:nth-child(2)::before { top: auto; bottom: 8%; opacity: 0.72; width: 5px; height: 5px; }
.orb__orbit i:nth-child(3)::before { top: 50%; left: 6%; margin-top: -3px; opacity: 0.85; }

/* Visual 2 · corriente de ondas (movimiento, sin girar y sin arcoíris) */
.svc__visual--wave { border-radius: 1.1rem; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(160deg, #130e09, #0c0906); box-shadow: 0 30px 80px rgba(0,0,0,0.5); }
.wave__glow { position: absolute; inset: -20%; background: radial-gradient(circle at 50% 55%, rgba(255,122,24,0.28), transparent 62%); filter: blur(10px); }
.wave__svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.wave__lines { filter: drop-shadow(0 0 5px rgba(255,122,24,0.45)); }
.wave__lines path {
  stroke-width: 2.1; stroke-linecap: round; stroke-dasharray: 22 16;   /* patrón 38 */
  animation: waveDash 6s linear infinite, waveSway 6.5s ease-in-out infinite;
}
.wave__lines path:nth-child(2) { animation-duration: 7.2s, 7.4s; animation-delay: -1.1s, -0.5s; }
.wave__lines path:nth-child(3) { animation-duration: 5.1s, 8.2s; animation-delay: -2.3s, -1.4s; }
.wave__lines path:nth-child(4) { animation-duration: 8.1s, 6.9s; animation-delay: -0.7s, -2.2s; }
.wave__lines path:nth-child(5) { animation-duration: 6.6s, 7.8s; animation-delay: -3.1s, -0.9s; }
@keyframes waveDash { to { stroke-dashoffset: -380; } }   /* 10 patrones exactos */
@keyframes waveSway { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-5px) scaleY(1.07); } }
.wave__tag { position: absolute; right: 7%; bottom: 6%; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim); }

/* Visual 3 · radial */
.radial__glow { position: absolute; inset: 18%; border-radius: 50%; background: radial-gradient(circle, rgba(255,122,24,0.35), transparent 65%); filter: blur(8px); }
.radial__svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.radial__track { fill: none; stroke: var(--line); stroke-width: 6; }
.radial__fill { fill: none; stroke: url(#g); stroke: var(--espurna); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 301.6; stroke-dashoffset: 90; filter: drop-shadow(0 0 8px rgba(255,122,24,0.7)); }

/* ── INTERLUDIOS (lo que llena el aire entre bloque y bloque) ──────────── */
.interlude { position: relative; z-index: 5; display: grid; justify-items: center; gap: 1.1rem; padding-block: clamp(2.6rem, 9vh, 6rem); }
.il__label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); }
.il__thread { position: relative; width: 1px; height: clamp(6rem, 20vh, 12rem); background: linear-gradient(var(--line), transparent); }
.il__burn {
  position: absolute; inset: 0; transform-origin: top; transform: scaleY(var(--p, 0));
  background: linear-gradient(180deg, rgba(255,178,90,0.9), rgba(255,122,24,0.15));
}
.il__spark {
  position: absolute; left: 50%; top: calc(var(--p, 0) * 100%);
  width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%;
  background: #ffe1b0; box-shadow: 0 0 14px 3px rgba(255,122,24,0.7);
  opacity: calc(var(--p, 0) * 3); will-change: top;
}

/* Banda tipográfica: dos hileras que se cruzan y se mecen con el scroll */
.interlude--band { gap: 0.2rem; overflow: hidden; padding-block: clamp(2rem, 7vh, 4.5rem); }
.band__row { width: 100%; overflow: hidden; will-change: transform; }
.band__inner {
  display: flex; width: max-content; gap: 1.6rem; align-items: center;
  font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em;
  font-size: clamp(2.2rem, 8vw, 5.4rem); line-height: 1.12; white-space: nowrap;
  animation: bandDrift 34s linear infinite;
}
.band__row--a .band__inner { color: transparent; -webkit-text-stroke: 1px rgba(245,238,226,0.16); }
.band__row--b .band__inner { animation-direction: reverse; animation-duration: 42s; opacity: 0.85; }
.band__row--b .band__inner .w { background: linear-gradient(120deg, var(--espurna), var(--espurna-2) 55%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.band__inner .sep { color: var(--espurna); font-size: 0.5em; opacity: 0.7; }
@keyframes bandDrift { from { transform: translate3d(0,0,0); } to { transform: translate3d(-50%,0,0); } }

/* ── MÉTODO ───────────────────────────────────────────────────────────── */
.method__inner { display: grid; justify-items: start; }
.constel { width: min(46rem, 100%); height: min(40vh, 22rem); margin: 2rem 0 1rem; }
.constel-canvas { width: 100%; height: 100%; }
.counters { display: flex; gap: clamp(2rem, 8vw, 5rem); margin: 0.6rem 0 0.4rem; flex-wrap: wrap; }
.counter { display: grid; justify-items: start; padding: 0.6rem 0.8rem; margin: -0.6rem -0.8rem; border-radius: 0.9rem; border: 1px solid transparent; transition: background 0.3s, border-color 0.3s; text-align: left; }
.counter:hover { background: rgba(255,122,24,0.06); border-color: var(--line); }
.counter b { font-family: var(--serif); font-weight: 600; font-size: clamp(2.6rem, 1.6rem + 3vw, 4.4rem); line-height: 1; color: var(--espurna-2); }
.counter span { font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 0.3rem; }
.counter__more { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--espurna); opacity: 0; transform: translateY(4px); transition: all 0.3s var(--ease); margin-top: 0.5rem; font-style: normal; }
.counter:hover .counter__more { opacity: 1; transform: none; }

/* ── LA PRUEBA / DEMOS ────────────────────────────────────────────────── */
.work__grid {
  width: min(var(--wrap), 100% - clamp(2.2rem, 8vw, 8rem)); margin: 2.6rem auto 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1rem, 2.5vw, 1.8rem);
}
.work-card {
  position: relative; display: block; border-radius: 1rem; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-2); aspect-ratio: 4 / 3;
  transition: transform 0.5s var(--ease), border-color 0.4s, box-shadow 0.5s;
  will-change: transform;
}
.work-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); filter: saturate(0.9) brightness(0.82); }
.work-card__body { position: absolute; inset: auto 0 0; padding: 1.4rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; background: linear-gradient(transparent, rgba(8,6,4,0.9)); }
.work-card__body h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.1rem, 1rem + 0.8vw, 1.6rem); }
.work-card__body p { color: var(--ink-dim); font-size: 0.85rem; margin-top: 0.2rem; }
.work-card__go { flex-shrink: 0; width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--espurna-2); font-size: 1.1rem; transition: all 0.4s var(--ease); }
.work-card:hover { transform: translateY(-6px); border-color: rgba(255,122,24,0.5); box-shadow: 0 24px 60px rgba(0,0,0,0.5); }
.work-card:hover img { transform: scale(1.06); filter: saturate(1.05) brightness(0.95); }
.work-card:hover .work-card__go { background: var(--espurna); color: #1a1109; border-color: var(--espurna); transform: rotate(0) scale(1.05); }
.work-card:focus-visible { outline: 2px solid var(--espurna); outline-offset: 3px; }

/* ── MANIFIESTO ───────────────────────────────────────────────────────── */
.manifesto { display: grid; justify-items: center; text-align: center; overflow: hidden; }
.manifesto__spark { position: relative; width: min(30rem, 74vw); height: min(30rem, 74vw); margin-bottom: -3rem; }
#particle-canvas { width: 100%; height: 100%; }
.manifesto__quote { font-family: var(--serif); font-weight: 500; font-size: clamp(1.5rem, 1rem + 2.6vw, 2.8rem); line-height: 1.22; max-width: 20ch; }
.manifesto__quote span { display: block; }
.manifesto__author { margin-top: 1.6rem; color: var(--muted); font-size: 0.9rem; letter-spacing: 0.06em; }

/* ── FAQ ──────────────────────────────────────────────────────────────── */
.faq__list { margin-top: 2.6rem; border-top: 1px solid var(--line); max-width: 52rem; }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary {
  display: flex; align-items: center; gap: 1.1rem; padding: 1.35rem 0.3rem; cursor: pointer;
  list-style: none; font-family: var(--serif); font-size: clamp(1.1rem, 1rem + 0.9vw, 1.55rem); font-weight: 500;
  transition: color 0.25s;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary:hover { color: var(--espurna-2); }
.faq__n { color: var(--espurna); font-family: var(--sans); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.1em; min-width: 1.8rem; }
.faq__ico { margin-left: auto; position: relative; width: 1rem; height: 1rem; flex-shrink: 0; }
.faq__ico::before, .faq__ico::after { content: ''; position: absolute; background: var(--espurna-2); transition: transform 0.3s var(--ease); }
.faq__ico::before { top: 50%; left: 0; right: 0; height: 1.5px; transform: translateY(-50%); }
.faq__ico::after { left: 50%; top: 0; bottom: 0; width: 1.5px; transform: translateX(-50%); }
.faq__item[open] .faq__ico::after { transform: translateX(-50%) scaleY(0); }
.faq__a { padding: 0 0.3rem 1.5rem 3rem; color: var(--ink-dim); max-width: 60ch; animation: faqOpen 0.4s var(--ease); }
@keyframes faqOpen { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ── CONTACTO ─────────────────────────────────────────────────────────── */
.contact__inner { display: grid; justify-items: start; }
.form { margin-top: 2.6rem; width: min(42rem, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.2rem; }
.field { display: grid; gap: 0.4rem; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea {
  background: rgba(28,21,14,0.55); border: 1px solid var(--line); border-radius: 0.7rem;
  padding: 0.8rem 0.95rem; color: var(--ink); font-family: var(--sans); font-size: 1rem;
  transition: border-color 0.25s, box-shadow 0.25s; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--espurna); box-shadow: 0 0 0 3px rgba(255,122,24,0.18); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; margin-top: 0.4rem; }
.form__or { color: var(--muted); font-size: 0.9rem; }
.form__or a { display: inline-block; padding-block: 4px; color: var(--espurna-2); border-bottom: 1px solid rgba(255,178,90,0.4); }
.form-ok { grid-column: 1 / -1; color: var(--espurna-2); font-weight: 600; opacity: 0; transform: translateY(4px); transition: all 0.4s var(--ease); }
.form-ok.is-on { opacity: 1; transform: none; }

/* Consentimiento RGPD. Va DESPUÉS de `.field input` a propósito: hereda de
   `.field` pero tiene que deshacer el fondo, el borde y el relleno de una caja
   de texto, y sobre todo las versalitas con letterspacing de `.field label`
   —una frase legal en mayúsculas no la lee nadie. La casilla mide 24 px justos
   para cumplir el «Target Size» de WCAG 2.2 sin depender de la etiqueta. */
.consent { grid-template-columns: auto 1fr; align-items: start; gap: 0.75rem; margin-top: 0.2rem; }
.consent input[type="checkbox"] {
  -webkit-appearance: checkbox; appearance: auto;
  width: 1.5rem; height: 1.5rem; margin: 0; padding: 0;
  background: none; border: 0; border-radius: 0; box-shadow: none;
  accent-color: var(--espurna); cursor: pointer;
}
.consent input[type="checkbox"]:focus-visible { outline: 2px solid var(--espurna); outline-offset: 2px; }
.consent label {
  align-self: center; font-size: 0.9rem; letter-spacing: 0; text-transform: none;
  color: var(--ink-dim); line-height: 1.5; cursor: pointer;
}
.consent a { color: var(--espurna-2); border-bottom: 1px solid rgba(255,178,90,0.4); }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.85rem 1.8rem;
  border-radius: 3rem; font-weight: 600; letter-spacing: 0.02em;
  transition: transform 0.3s var(--ease), box-shadow 0.3s, background 0.3s;
}
.btn--fire { color: #1a1109; background: linear-gradient(135deg, var(--espurna), var(--espurna-2)); box-shadow: 0 10px 34px rgba(255,122,24,0.3); }
.btn--fire:hover { transform: translateY(-2px); box-shadow: 0 16px 44px rgba(255,122,24,0.45); }
.btn--ghost { border: 1px solid var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--espurna); background: rgba(255,122,24,0.08); }

/* ══ Footer ═══════════════════════════════════════════════════════════ */
.footer {
  position: relative; z-index: 5; overflow: hidden;
  padding-top: clamp(3rem, 8vh, 5rem);
  padding-bottom: calc(var(--dock-h) + 1.4rem);
  background: linear-gradient(180deg, transparent, rgba(28,21,14,0.5));
  border-top: 1px solid var(--line-soft);
}
.footer__grid {
  display: grid; gap: clamp(2rem, 5vw, 3.4rem);
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.2fr);
  align-items: start;
}
.footer__logo { margin-bottom: 1.1rem; }
.footer__claim { font-family: var(--serif); font-size: clamp(1.15rem, 1rem + 0.9vw, 1.55rem); line-height: 1.25; max-width: 16ch; }
.footer__note { color: var(--muted); font-size: 0.86rem; margin-top: 0.9rem; max-width: 32ch; }
.footer__h { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--espurna-2); margin-bottom: 1.1rem; }
.footer__col ul { list-style: none; display: grid; gap: 0.62rem; }
.footer__col a, .footer__where { color: var(--ink-dim); font-size: 0.92rem; }
/* inline-block + padding: el enlace llega a 24px de alto sin mover el diseño */
.footer__col a { position: relative; display: inline-block; padding-block: 4px; transition: color 0.25s; }
.footer__col a::after {
  content: ''; position: absolute; left: 0; bottom: 2px; height: 1px; width: 100%;
  background: var(--espurna); transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.footer__col a:hover { color: var(--ink); }
.footer__col a:hover::after { transform: scaleX(1); transform-origin: left; }
.footer__where { display: inline-block; color: var(--muted); }
.footer__langs { display: flex; align-items: center; gap: 0.3rem; margin-top: 1.15rem; color: var(--line); }
.footer__langs button {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; color: var(--muted);
  min-width: 2.2rem; min-height: 1.6rem; padding: 0.35rem 0.3rem; border-radius: 0.5rem;
  transition: color 0.25s, background 0.25s;
}
.footer__langs button:hover { background: rgba(255,122,24,0.08); }
.footer__langs button:hover { color: var(--ink); }
.footer__langs button.is-on { color: var(--espurna); }

/* firma tipográfica gigante, contenida y sutil */
.footer__word { margin: clamp(2.4rem, 7vh, 4.4rem) 0 clamp(1rem, 3vh, 2rem); text-align: center; line-height: 0.82; user-select: none; }
.footer__word span {
  display: inline-block; font-family: var(--serif); font-weight: 500; letter-spacing: -0.03em;
  font-size: clamp(4rem, 19vw, 15rem); color: transparent;
  -webkit-text-stroke: 1px rgba(245,238,226,0.12);
  background: linear-gradient(180deg, rgba(255,122,24,0.16), transparent 78%);
  -webkit-background-clip: text; background-clip: text;
}
.footer__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem 1.6rem; flex-wrap: wrap;
  padding-top: 1.3rem; border-top: 1px solid var(--line-soft);
  color: var(--muted); font-size: 0.8rem;
}
.footer__top { display: inline-block; padding-block: 4px; color: var(--espurna-2); font-weight: 600; transition: transform 0.3s var(--ease); }
.footer__top:hover { transform: translateY(-2px); }

/* ══ Dock permanente ══════════════════════════════════════════════════ */
.dock {
  position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 19; display: flex; gap: 0.6rem; padding: 0.5rem; border-radius: 3rem;
  background: rgba(16,12,9,0.72); border: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 16px 50px rgba(0,0,0,0.5);
  opacity: 0; transform: translate(-50%, 1.5rem); transition: opacity 0.6s ease, transform 0.6s var(--ease);
}
.dock.is-in { opacity: 1; transform: translateX(-50%); }
.dock__btn { padding: 0.7rem 1.5rem; border-radius: 3rem; font-weight: 600; font-size: 0.92rem; transition: transform 0.25s, background 0.3s, box-shadow 0.3s; }
.dock__btn--fire { color: #1a1109; background: linear-gradient(135deg, var(--espurna), var(--espurna-2)); }
.dock__btn--fire:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(255,122,24,0.45); }
.dock__btn--ghost:hover { background: rgba(255,122,24,0.1); }

/* ══ Overlays ═════════════════════════════════════════════════════════ */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(8, 6, 4, 0); -webkit-backdrop-filter: blur(0px); backdrop-filter: blur(0px);
  transition: background 0.5s ease, -webkit-backdrop-filter 0.5s ease, backdrop-filter 0.5s ease;
}
.overlay.is-open { background: rgba(8, 6, 4, 0.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.overlay[hidden] { display: none; }
.overlay__panel {
  /* `data-lenis-prevent` en el HTML deja que la rueda/el dedo scrollee aquí
     dentro aunque Lenis esté parado; `overscroll-behavior` evita que el
     scroll se encadene al fondo al llegar al final. */
  width: min(64rem, 100%); max-height: 88vh; max-height: 88svh; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line);
  border-radius: 1.4rem; padding: clamp(1.4rem, 4vw, 2.6rem);
  box-shadow: 0 40px 120px rgba(0,0,0,0.6);
  opacity: 0; transform: translateY(24px) scale(0.98); transition: opacity 0.5s ease, transform 0.55s var(--ease);
}
.overlay__panel--sm { width: min(34rem, 100%); }
.overlay.is-open .overlay__panel { opacity: 1; transform: none; }
.overlay__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.2rem; margin-bottom: 1.8rem; }
.overlay__head h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.4rem, 1.1rem + 1.6vw, 2.2rem); }
.overlay__head p { color: var(--ink-dim); margin-top: 0.5rem; max-width: 46ch; font-size: 0.95rem; }
.ov-close { flex-shrink: 0; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--line); font-size: 1.5rem; line-height: 1; color: var(--ink-dim); transition: all 0.25s; }
.ov-close:hover { background: rgba(255,122,24,0.12); color: var(--ink); border-color: var(--espurna); }
.overlay__cta { display: grid; gap: 0.8rem; }
.overlay__cta .btn { justify-content: center; }

.demo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
.demo-card { border-radius: 1rem; overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); transition: transform 0.4s var(--ease), border-color 0.3s; }
.demo-card img { width: 100%; aspect-ratio: 8/5; object-fit: cover; filter: brightness(0.85); transition: filter 0.4s, transform 0.6s var(--ease); }
.demo-card__body { padding: 1rem 1.1rem 1.2rem; }
.demo-card__body h3 { font-family: var(--serif); font-weight: 500; font-size: 1.2rem; }
.demo-card__body p { color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; }
.demo-card .go { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.7rem; color: var(--espurna-2); font-size: 0.85rem; font-weight: 600; }
.demo-card:hover { transform: translateY(-4px); border-color: rgba(255,122,24,0.5); }
.demo-card:hover img { filter: brightness(1); transform: scale(1.04); }
.demo-card:focus-visible { outline: 2px solid var(--espurna); outline-offset: 3px; }

.metodo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.9rem; }
.team-card { padding: 1rem 1.1rem; border-left: 2px solid var(--espurna); background: rgba(255,122,24,0.04); border-radius: 0 0.7rem 0.7rem 0; }
.team-card__top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem; }
.team-card__top h3 { font-family: var(--serif); font-weight: 500; font-size: 1.05rem; }
.team-card__count { color: var(--espurna-2); font-size: 0.72rem; letter-spacing: 0.08em; white-space: nowrap; }
.team-card p { color: var(--ink-dim); font-size: 0.85rem; margin-top: 0.35rem; line-height: 1.45; }

/* ══ Utilidades ═══════════════════════════════════════════════════════ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 0.6rem; left: 50%; transform: translate(-50%, -150%); z-index: 60; background: var(--espurna); color: #1a1109; padding: 0.6rem 1.2rem; border-radius: 0 0 0.6rem 0.6rem; font-weight: 600; transition: transform 0.25s; }
.skip-link:focus { transform: translate(-50%, 0); outline: none; }
:focus-visible { outline: 2px solid var(--espurna); outline-offset: 3px; border-radius: 3px; }

/* Estado inicial de las animaciones (solo con JS).
   El desplazamiento del héroe lo fija GSAP en unidades limpias (yPercent),
   no aquí, para no contaminar el transform con píxeles. */
html.js .anim { opacity: 0; transform: translateY(30px); }

/* ══ Responsive ═══════════════════════════════════════════════════════ */
@media (max-width: 60rem) {
  .rail { display: none; }
}
@media (max-width: 46rem) {
  :root { --dock-h: calc(4.2rem + env(safe-area-inset-bottom, 0px)); }
  .hud { padding: 0.85rem 1.1rem; }
  .brand__dim { display: none; }
  .work__grid { grid-template-columns: 1fr; }
  .demo-grid { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
  .reveal__track img { width: clamp(13rem, 62vw, 20rem); }
  .constel { height: min(34vh, 15rem); }
  .counters { gap: 2.6rem; }
  /* Servicios: en móvil, gráfico arriba y texto debajo (sin pin, sin trampas) */
  .svc { grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
  .svc__visual { width: min(56vw, 13rem); justify-self: start; }
  .footer__grid { grid-template-columns: 1fr; gap: 2.2rem; }
  .footer__bar { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .dock { width: calc(100% - 1.6rem); justify-content: center; }
  .dock__btn { flex: 1; text-align: center; padding: 0.72rem 0.8rem; font-size: 0.86rem; }
  .faq__a { padding-left: 0.3rem; }
}
@media (max-width: 30rem) {
  .hero__claim { font-size: clamp(2.3rem, 12vw, 3.4rem); }
  .reveal__text { font-size: clamp(1.4rem, 7vw, 2rem); }
}

/* ══ Movimiento reducido ══════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  html.js .anim { opacity: 1; transform: none; }
  html.js .hero__claim .reveal, html.js .reveal__text .reveal { transform: none; }
  .gate__mark img, .gate__ring, .scroll-hint__line, .radial__fill, .band__inner,
  .wave__lines path, .reveal__track, .orb__core, .orb__halo, .orb__sheen,
  .orb__orbit i, .faq__a { animation: none !important; }
  /* Los focos y estados siguen siendo instantáneos, no bruscos */
  .work-card, .demo-card, .btn, .dock__btn { transition-duration: 0.01ms !important; }
  * { scroll-behavior: auto !important; }
  /* Servicios ya no dependen de ninguna animación: solo se apagan las brasas */
  .svc-fuse__burn, .svc-fuse__spark, .il__burn, .il__spark { display: none; }
  .svc.is-lit .svc__node, .svc__node { background: var(--espurna); border-color: var(--espurna); }
  .interlude { padding-block: 2.5rem; }
  .il__thread { height: 3rem; }
  .radial__fill { stroke-dashoffset: 60; }
  /* Revelación: montaje estático y legible */
  .scene-reveal { min-height: auto; padding-block: 6rem; }
  .reveal__bg { opacity: 0.4; }
}
