/* =========================================================================
   QLIKSY GROUP — sistema visual
   Paleta derivada del logo (#4C2FF9) sobre tintas profundas, con el
   horizonte llevado a hora dorada: ámbar y rosa quemado justo sobre el
   agua, índigo y violeta por encima.
   ========================================================================= */

:root {
  --ink-900: #05070E;
  --ink-800: #080B15;
  --ink-700: #0B0F1B;
  --ink-600: #0E1220;

  --foam: #F2F4FA;
  --haze: #AEB6CE;
  --haze-dim: #78819C;

  --qliksy: #4C2FF9;
  --qliksy-lift: #8478FF;
  /* Tinta de la frase del héroe */
  --serif-ink: #FFFFFF;

  /* Hora dorada */
  --sun: #E8975F;
  --sun-soft: #C97C6B;
  --dusk: #6E4A78;

  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.055);

  --display: "Outfit", "Segoe UI", system-ui, sans-serif;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;

  --t-hero: clamp(2.7rem, 8.4vw, 7.2rem);
  --t-h2: clamp(1.85rem, 3.6vw, 3.2rem);
  --t-lead: clamp(1rem, 1.2vw, 1.15rem);
  --t-small: 0.855rem;

  --gutter: clamp(1.35rem, 5vw, 5.5rem);
  --section-y: clamp(5.5rem, 12vh, 10rem);
  --max: 1320px;

  --bcard: 380px;            /* tarjeta de marca, ancho */
  --bcard-h: 494px;          /* 30% más alta que el cuadrado original */
  --scard-w: 332px;          /* ficha de servicio */
  --scard-h: 448px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0.05, 0.2, 1);
}

/* ---------- base ---------- */

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

html { background: var(--ink-900); -webkit-text-size-adjust: 100%; overflow-x: clip; overscroll-behavior-x: none; }
html.js:not(.reduced-motion) { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--foam);
  background: var(--ink-900);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
body.is-locked {
  overflow: hidden;
  touch-action: none;
}

img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

:where(a, button, input, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--qliksy-lift);
  outline-offset: 3px;
  border-radius: 3px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: fixed; top: 0; left: 50%;
  transform: translate(-50%, -110%);
  z-index: 200; padding: 0.7rem 1.2rem;
  background: var(--foam); color: var(--ink-900);
  font-size: var(--t-small); font-weight: 500;
  border-radius: 0 0 8px 8px;
  transition: transform 0.25s var(--ease-out);
}
.skip:focus-visible { transform: translate(-50%, 0); }

/* ---------- tipografía ---------- */

.h2 {
  margin: 0;
  font-family: var(--display);
  font-size: var(--t-h2);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.028em;
  max-width: 21ch;
  text-wrap: balance;
}
.lead {
  margin: 1.2rem 0 0;
  font-size: var(--t-lead);
  color: var(--haze);
  max-width: 52ch;
}
.section-head {
  max-width: var(--max);
  margin: 0 auto clamp(2.4rem, 6vh, 4rem);
  padding-inline: var(--gutter);
}

/* ---------- botones ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.86em 1.7em;
  font-size: var(--t-small); font-weight: 500;
  border: 1px solid transparent; border-radius: 100px;
  cursor: pointer;
  transition: background 0.4s var(--ease-soft), transform 0.4s var(--ease-out);
}
.btn--solid {
  background: var(--qliksy); color: #fff;
  box-shadow: 0 10px 34px -14px rgba(76, 47, 249, 0.9);
}
.btn--solid:hover { background: #5B41FF; transform: translateY(-2px); }

/* ---------- pantalla de entrada ---------- */

.loader {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  background: var(--ink-900);
  transition: opacity 0.7s var(--ease-soft), visibility 0.7s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__inner { width: min(240px, 62vw); text-align: center; }
.loader__logo { width: 100%; opacity: 0.92; }
.loader__track { margin-top: 2rem; height: 1px; background: rgba(255, 255, 255, 0.13); overflow: hidden; }
.loader__bar { display: block; height: 100%; width: 0%; background: var(--qliksy-lift); transition: width 0.35s var(--ease-soft); }
.loader__pct { margin: 0.8rem 0 0; font-size: 0.72rem; letter-spacing: 0.16em; color: var(--haze-dim); font-variant-numeric: tabular-nums; }
html.no-js .loader { display: none; }

/* ---------- cursor ---------- */

.cursor {
  position: fixed; top: 0; left: 0; z-index: 150;
  width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%; pointer-events: none; opacity: 0;
  transition: opacity 0.3s, width 0.35s var(--ease-out), height 0.35s var(--ease-out),
              margin 0.35s var(--ease-out), background 0.35s, border-color 0.35s;
}
.cursor.is-on { opacity: 1; }
.cursor.is-hot {
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  background: rgba(132, 120, 255, 0.12); border-color: rgba(132, 120, 255, 0.55);
}
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- escena: cielo de hora dorada ---------- */

.stage { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: var(--ink-900); overflow: hidden; }
.stage.is-hidden { opacity: 0; transition: opacity 0.6s var(--ease-soft); }
.stage__canvas { display: block; width: 100%; height: 100%; position: relative; z-index: 2; }

/* El cielo se pinta en CSS y el agua se disuelve dentro de él */
.stage__sky {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(58% 26% at 50% 33%, rgba(255, 186, 132, 0.30) 0%, rgba(233, 141, 108, 0.12) 45%, transparent 74%),
    linear-gradient(180deg,
      #060918 0%,
      #0F1636 13%,
      #23225A 23%,
      #4C3A78 28.5%,
      #8A5B76 31.5%,
      #C2825F 34%,
      #6B4569 38%,
      #2A2A55 48%,
      #121730 66%,
      #06080F 100%);
}
/* Neblina cálida justo sobre la línea de agua */
.stage__horizon {
  position: absolute; left: -10%; right: -10%; top: 27%; height: 16vh; z-index: 3;
  background:
    radial-gradient(46% 100% at 50% 82%, rgba(255, 198, 148, 0.34) 0%, transparent 72%),
    linear-gradient(180deg, transparent 0%, rgba(255, 176, 132, 0.12) 55%, transparent 100%);
  filter: blur(26px);
}
.stage__grain {
  position: absolute; inset: 0; z-index: 4;
  background-image: url("../assets/images/grain.png");
  background-size: 128px 128px;
  opacity: 0.03; mix-blend-mode: overlay;
}

/* Sin WebGL la atmósfera se sostiene sola */
html.no-webgl .stage__canvas { display: none; }
html.no-webgl .stage::after {
  content: ""; position: absolute; left: 0; right: 0; top: 34%; bottom: 0; z-index: 2;
  background:
    repeating-linear-gradient(180deg, rgba(255, 210, 170, 0.05) 0 1px, transparent 1px 8px),
    linear-gradient(180deg, rgba(212, 140, 104, 0.3) 0%, rgba(42, 42, 85, 0.55) 26%, rgba(5, 7, 14, 0.94) 78%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 100%);
}

/* ---------- header ---------- */

.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; gap: clamp(0.8rem, 2.4vw, 2rem);
  padding: calc(1.15rem + env(safe-area-inset-top, 0px)) var(--gutter) 1.15rem;
  border-bottom: 1px solid transparent;
  transition: padding 0.5s var(--ease-soft), background 0.5s var(--ease-soft), border-color 0.5s var(--ease-soft);
}
.header.is-stuck {
  padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
  padding-bottom: 0.75rem;
  background: rgba(6, 8, 16, 0.6);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom-color: var(--line-soft);
}
/* Logo un 25% más grande que el original, con una sombra que le da cuerpo */
.header__brand img {
  width: clamp(110px, 11.25vw, 145px);
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 24px rgba(76, 47, 249, 0.32));
}

.pills { display: flex; gap: 0.5rem; margin-left: auto; }
.pill {
  display: inline-flex; align-items: center;
  padding: 0.58em 1.5em;
  font-size: var(--t-small); font-weight: 500;
  border-radius: 100px;
  background: var(--qliksy);
  color: #fff;
  box-shadow: 0 8px 24px -14px rgba(76, 47, 249, 0.95);
  transition: background 0.35s var(--ease-soft), transform 0.35s var(--ease-out), box-shadow 0.35s;
}
.pill:hover { background: #5B41FF; transform: translateY(-2px); box-shadow: 0 14px 30px -14px rgba(92, 66, 255, 1); }
.pill.is-current { background: #6A52FF; }

.lang { display: flex; align-items: center; gap: 0.55rem; margin-left: clamp(0.7rem, 2vw, 1.8rem); font-size: 0.78rem; letter-spacing: 0.06em; }
.lang button {
  background: none; border: 0; padding: 0.35rem 0.15rem; cursor: pointer;
  color: var(--haze-dim); transition: color 0.3s;
}
.lang button:hover { color: var(--foam); }
.lang button[aria-pressed="true"] { color: var(--foam); }
.lang__sep { color: var(--haze-dim); opacity: 0.6; }

.burger { display: none; background: none; border: 0; padding: 0.5rem; cursor: pointer; }
.burger__box { display: block; width: 26px; }
.burger__box i { display: block; height: 1px; background: var(--foam); transition: transform 0.4s var(--ease-out); }
.burger__box i:first-child { margin-bottom: 7px; }
.burger[aria-expanded="true"] i:first-child { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded="true"] i:last-child { transform: translateY(-4px) rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column; justify-content: center;
  gap: 2rem;
  padding: calc(var(--gutter) + env(safe-area-inset-top, 0px)) var(--gutter) calc(var(--gutter) + env(safe-area-inset-bottom, 0px));
  background: rgba(5, 7, 14, 0.95);
  backdrop-filter: blur(26px); -webkit-backdrop-filter: blur(26px);
}
.menu[hidden] { display: none; }
.menu__nav { display: flex; flex-direction: column; gap: 0.4rem; }
.menu__nav a {
  font-family: var(--display); font-size: clamp(2rem, 9vw, 2.8rem); font-weight: 300;
  letter-spacing: -0.03em; padding-block: 0.35rem;
  border-bottom: 1px solid var(--line-soft);
}

/* ---------- SCROLL 1 · héroe ---------- */

main { position: relative; z-index: 2; }

.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 7rem var(--gutter) 6rem;
  text-align: center;
}
.hero__title {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--t-hero);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.045em;
  text-wrap: balance;
  text-shadow: 0 8px 60px rgba(5, 7, 14, 0.55);
}
.hero__serif {
  /* 30ch fuerza el quiebre en dos renglones tanto en escritorio como en móvil */
  margin: clamp(1rem, 2.4vw, 1.6rem) auto 0;
  max-width: 30ch;
  min-height: 2.7em;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.08rem, 2.1vw, 1.8rem);
  line-height: 1.34;
  color: var(--serif-ink);
  /* La sombra oscurece el fondo justo detrás, no ilumina la letra */
  text-shadow:
    0 2px 16px rgba(4, 6, 14, 0.9),
    0 0 46px rgba(4, 6, 14, 0.75);
}
.hero__serif .type { white-space: pre-line; }
.type::after {
  content: ""; display: inline-block;
  width: 2px; height: 0.95em; margin-left: 0.1em;
  vertical-align: -0.1em;
  background: #FFFFFF;
  box-shadow: 0 0 10px rgba(4, 6, 14, 0.8);
  animation: caret 1.05s steps(1) infinite;
}
@keyframes caret { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

.scroller {
  position: absolute; bottom: clamp(1.2rem, 3vh, 2.2rem); left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  font-size: 0.68rem; letter-spacing: 0.2em; color: var(--haze-dim);
}
.scroller__line {
  display: block; width: 1px; height: 40px; position: relative; overflow: hidden;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.4));
}
.scroller__line::after {
  content: ""; position: absolute; inset: 0; background: var(--sun);
  animation: drip 2.6s var(--ease-soft) infinite;
}
@keyframes drip { 0% { transform: translateY(-100%); } 55%, 100% { transform: translateY(100%); } }

/* ---------- hero · banner de capacidades ---------- */

.flow {
  /* 0–90%: la luz entra, recorre el riel entero y sale por el extremo.
     90–100%: se encienden las letras. La última se apaga justo al cerrar el ciclo. */
  --cycle: 11.1s;
  position: relative;
  width: min(1080px, 100%);
  margin: clamp(1.2rem, 3vh, 2.2rem) auto 0;
  aspect-ratio: 1000 / 280;
}
/* El circuito queda congelado en el fotograma cero hasta que la intro del héroe lo
   descubre. Sin esto la primera vuelta transcurre detrás del loader y el visitante
   la ve empezada por la mitad, con las fichas ya fuera de fase. */
.flow:not(.is-live) .flow__pulse,
.flow:not(.is-live) .fbox,
.flow:not(.is-live) .fbox *,
.flow:not(.is-live) .flow__ai-t i { animation-play-state: paused; }
.flow__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; z-index: 1; pointer-events: none; }
.flow__track {
  fill: none; stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.flow__pulse {
  fill: none; stroke: #C6BEFF;
  /* Sin non-scaling-stroke a propósito: junto a pathLength="1000" hace que Chrome mida
     el patrón de guiones en píxeles de pantalla contra un trazado normalizado a 1000
     unidades, y la luz avanza 1/escala veces más rápido de lo pedido. En escritorio la
     escala es ~1.08 y no se nota; en móvil es ~0.37 y el riel se recorría en 4.5s.
     El grosor pasa a unidades del viewBox: 3.15 x 1.08 = los 3.4px de siempre. */
  stroke-width: 3.15; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 52 2000; stroke-dashoffset: 52;
  filter: drop-shadow(0 0 5px rgba(183, 171, 255, 1))
          drop-shadow(0 0 14px rgba(132, 120, 255, 0.9))
          drop-shadow(0 0 34px rgba(132, 120, 255, 0.55));
  animation: flowRun var(--cycle) linear infinite;
}
/* La cabeza recorre el riel entero a velocidad constante y toca el extremo en el 89%,
   justo antes de que arranquen las letras (90%). Entre 89 y 91% la cola termina de salir
   mientras la luz se disuelve: no queda nada encendido sobre la línea. */
@keyframes flowRun {
  0%   { stroke-dashoffset: 52; opacity: 1; }
  89%  { stroke-dashoffset: -948; opacity: 1; }
  91%  { stroke-dashoffset: -1000; opacity: 0; }
  100% { stroke-dashoffset: -1000; opacity: 0; }
}
.flow__svg--t { display: none; }

/* ---------- pilares ---------- */

.fbox {
  --fbox-w: 15%;
  --fbox-w-on: 20.5%;
  --ffig-h: 64px;
  position: absolute; left: var(--fx); top: var(--fy);
  z-index: 2; width: var(--fbox-w);
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center;
  padding: 0.62em 0.7em;
  text-align: center;
  font-size: clamp(0.55rem, 0.9vw, 0.72rem);
  font-weight: 500; letter-spacing: 0.035em; line-height: 1.22;
  color: var(--haze);
  border: 1px solid rgba(132, 120, 255, 0.30);
  border-radius: 12px;
  background: rgba(8, 11, 22, 0.62);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  /* delay - cycle: el offset se repite en cada loop, no solo la primera vuelta */
  animation: fboxLit var(--cycle) linear infinite;
  animation-delay: calc(var(--dl, 0s) - var(--cycle));
}
/* pre-line respeta el salto explícito de "ESTRATEGIA / E-COMMERCE" */
.fbox__t { white-space: pre-line; }
.fbox--1 { --fx: 16%; --fy: 42%; }
.fbox--2 { --fx: 39%; --fy: 35%; }
.fbox--3 { --fx: 62%; --fy: 42%; }
.fbox--4 { --fx: 85%; --fy: 35%; }

@keyframes fboxLit {
  0% {
    width: var(--fbox-w); padding: 0.62em 0.7em; z-index: 2;
    transform: translate(-50%, -50%) scale(1);
    border-color: rgba(132, 120, 255, 0.30);
    background: rgba(8, 11, 22, 0.62);
    color: var(--haze); box-shadow: none;
  }
  4% {
    width: var(--fbox-w-on); padding: 0.85em 0.8em 0.95em; z-index: 3;
    transform: translate(-50%, -50%) scale(1.06);
    border-color: rgba(168, 158, 255, 0.95);
    background: rgba(17, 15, 46, 0.92);
    color: var(--foam);
    box-shadow: 0 0 46px -8px rgba(132, 120, 255, 0.95),
                inset 0 0 34px -16px rgba(183, 171, 255, 0.95);
  }
  16% {
    width: var(--fbox-w-on); padding: 0.85em 0.8em 0.95em; z-index: 3;
    transform: translate(-50%, -50%) scale(1.06);
    border-color: rgba(168, 158, 255, 0.95);
    background: rgba(17, 15, 46, 0.92);
    color: var(--foam);
    box-shadow: 0 0 46px -8px rgba(132, 120, 255, 0.95),
                inset 0 0 34px -16px rgba(183, 171, 255, 0.95);
  }
  20%, 100% {
    width: var(--fbox-w); padding: 0.62em 0.7em; z-index: 2;
    transform: translate(-50%, -50%) scale(1);
    border-color: rgba(132, 120, 255, 0.30);
    background: rgba(8, 11, 22, 0.62);
    color: var(--haze); box-shadow: none;
  }
}

.fbox__fig {
  display: block; width: 100%;
  max-height: 0; opacity: 0; margin-top: 0; overflow: hidden;
  animation: ffigLit var(--cycle) linear infinite;
  animation-delay: calc(var(--dl, 0s) - var(--cycle));
}
@keyframes ffigLit {
  0%, 4%    { max-height: 0; opacity: 0; margin-top: 0; }
  7%        { max-height: var(--ffig-h); opacity: 1; margin-top: 0.45rem; }
  16%       { max-height: var(--ffig-h); opacity: 1; margin-top: 0.45rem; }
  19%, 100% { max-height: 0; opacity: 0; margin-top: 0; }
}

/* proporción áurea: la espiral se traza sola */
.ffig-svg { display: block; width: 66px; height: auto; margin: 0 auto; }
.gr { fill: none; stroke: #8478FF; stroke-width: 1; opacity: 0.4; }
.gr--out { opacity: 0.72; }
.gs2 {
  fill: none; stroke: #FBCE17; stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: 100;
  animation: goldDraw var(--cycle) ease-out infinite;
  animation-delay: calc(var(--dl, 0s) - var(--cycle) + var(--i) * 0.13s);
}
@keyframes goldDraw {
  0%, 7%      { stroke-dashoffset: 100; }
  13%         { stroke-dashoffset: 0; }
  17%         { stroke-dashoffset: 0; }
  17.5%, 100% { stroke-dashoffset: 100; }
}

/* caracteres HTML: se escriben renglón a renglón */
.ffig-code {
  display: block; text-align: left;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.46rem; line-height: 1.6; letter-spacing: 0;
  color: #C7CEE4;
}
.ffig-code .l {
  display: block; overflow: hidden; white-space: nowrap; width: 0;
  animation: typeLine var(--cycle) steps(24, end) infinite;
  animation-delay: calc(var(--dl, 0s) - var(--cycle) + var(--i) * 0.30s);
}
@keyframes typeLine {
  0%, 6%      { width: 0; }
  12%         { width: 100%; }
  17%         { width: 100%; }
  17.5%, 100% { width: 0; }
}
.ffig-code b { color: #B7ABFF; font-weight: 500; }
.ffig-code i { color: #FBCE17; font-style: normal; }
.ffig-code u { color: #8DE0B4; text-decoration: none; }

/* herramientas: aparecen una por una */
.ffig-tools { display: block; width: 96px; height: auto; margin: 0 auto; }
.ffig-tools path { fill: none; stroke: #B7ABFF; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ffig-tools .tool {
  opacity: 0; transform-box: fill-box; transform-origin: 50% 50%;
  animation: toolIn var(--cycle) var(--ease-out) infinite;
  animation-delay: calc(var(--dl, 0s) - var(--cycle) + var(--i) * 0.17s);
}
@keyframes toolIn {
  0%, 6%      { opacity: 0; transform: translateY(4px) scale(0.86); }
  10%         { opacity: 1; transform: none; }
  17%         { opacity: 1; transform: none; }
  17.5%, 100% { opacity: 0; transform: translateY(4px) scale(0.86); }
}

/* carrito que cruza en bucle */
.ffig-cart { display: block; position: relative; width: 100%; height: 28px; overflow: hidden; }
.ffig-cart svg {
  position: absolute; top: 1px; left: 0; width: 30px; height: 26px;
  animation: cartRun 2.6s linear infinite;
}
.ffig-cart path { fill: none; stroke: #FBCE17; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ffig-cart circle { fill: #FBCE17; }
.ffig-cart .spark { stroke: #FFE38A; stroke-width: 1.6; opacity: 0.8; }
@keyframes cartRun {
  0%   { transform: translateX(-40px); opacity: 0; }
  14%  { opacity: 1; }
  86%  { opacity: 1; }
  100% { transform: translateX(var(--cart-to, 205px)); opacity: 0; }
}

/* ---------- AI POWERED: cierre del circuito, de la D hasta la A ---------- */

.flow__ai {
  position: absolute; left: 50%; top: 89%; z-index: 3;
  transform: translate(-50%, -50%);
  margin: 0; white-space: nowrap;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(0.82rem, 1.4vw, 1.15rem);
  letter-spacing: 0.34em; text-indent: 0.34em;
}
.flow__ai-t i {
  font-style: italic; color: var(--qliksy);
  /* Delay negativo: el escalonado se mantiene en cada vuelta, no solo en la primera. */
  animation: aiLetter var(--cycle) linear infinite;
  animation-delay: calc((var(--last) - var(--n)) * 0.07s - var(--cycle));
}
.flow__ai-t .sp { animation: none; }
@keyframes aiLetter {
  0%, 90% { color: var(--qliksy); text-shadow: none; }
  91.5% {
    color: #FFFFFF;
    text-shadow: 0 0 10px #C6BEFF, 0 0 26px rgba(76, 47, 249, 0.95),
                 0 0 54px rgba(76, 47, 249, 0.6);
  }
  93.5% {
    color: var(--qliksy-lift);
    text-shadow: 0 0 8px rgba(132, 120, 255, 0.85), 0 0 24px rgba(76, 47, 249, 0.55);
  }
  95%, 100% { color: var(--qliksy); text-shadow: none; }
}

/* ---------- carruseles (base compartida) ---------- */

.deck-wrap { position: relative; perspective: 1600px; perspective-origin: 50% 46%; }
.deck-wrap--brands { height: calc(var(--bcard-h) + 130px); }
.deck-wrap--services { height: calc(var(--scard-h) + 110px); }
.deck { position: absolute; inset: 0; transform-style: preserve-3d; touch-action: pan-y; cursor: grab; overflow: visible; }
.deck.is-dragging { cursor: grabbing; }
/* Solo durante el arrastre conviene promover la capa */
.deck.is-dragging .card { will-change: transform; }
.deck__fallback { padding: var(--gutter); }
.deck__fallback a { text-decoration: underline; }

.card {
  --rot: 0deg; --rm: 1; --sc: 1;
  position: absolute; left: 50%; top: 50%;
  margin: 0; transform-style: preserve-3d;
  cursor: pointer;
}
.card__inner {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  transition: box-shadow 0.55s var(--ease-soft), border-color 0.55s var(--ease-soft);
}
.card__shadow {
  position: absolute; left: 50%; bottom: -42px; width: 76%; height: 40px;
  transform: translateX(-50%) rotateX(84deg);
  background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, 0.7) 0%, transparent 72%);
  filter: blur(11px); pointer-events: none;
}

.deck-ui {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(0.9rem, 2.4vw, 1.8rem);
  margin-top: clamp(2rem, 5vh, 3.2rem);
  padding-inline: var(--gutter);
}
.deck-ui__arrow {
  width: 46px; height: 46px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--glass);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: background 0.35s, border-color 0.35s, transform 0.35s var(--ease-out);
}
.deck-ui__arrow:hover { background: var(--glass-strong); border-color: rgba(255, 255, 255, 0.24); }
.deck-ui__arrow:active { transform: scale(0.94); }
.deck-ui__arrow svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.deck-ui__dots { display: flex; gap: 0.5rem; }
.deck-ui__dots button { width: 26px; height: 26px; padding: 0; display: grid; place-items: center; border: 0; background: none; cursor: pointer; }
.deck-ui__dots button::before { content: ""; width: 100%; height: 1px; background: rgba(255, 255, 255, 0.22); transition: background 0.4s, height 0.4s; }
.deck-ui__dots button[aria-selected="true"]::before { background: var(--qliksy-lift); height: 2px; }

/* ---------- SCROLL 2 · marcas: paneles sólidos flotando ---------- */

.brands { padding: var(--section-y) 0 clamp(6rem, 14vh, 10rem); }
.brands .section-head .lead { max-width: 42ch; }

.card--brand { width: var(--bcard); height: var(--bcard-h); }
.card--brand .card__inner {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--ink-800);
  box-shadow: 0 50px 100px -44px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.card--brand:hover .card__inner {
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 62px 120px -46px rgba(0, 0, 0, 0.98),
              0 0 80px -30px color-mix(in srgb, var(--accent) 55%, transparent),
              inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
/* Fondo animado de la ficha: transformadas y opacidad, nada que repinte */
.bgfx {
  position: absolute; inset: 0; width: 100%; height: 100%;
  transition: transform 1.4s var(--ease-out);
}
.card--brand:hover .bgfx { transform: scale(1.04); }

/* Luminelle · puntos luminosos que titilan, como el fondo de la marca */
.dot {
  opacity: 0;
  animation: dotGlow var(--d, 5s) ease-in-out infinite var(--dl, 0s);
}
@keyframes dotGlow {
  0%, 100% { opacity: calc(var(--o, 0.5) * 0.18); }
  50%      { opacity: var(--o, 0.5); }
}
.dot-set {
  animation: dotDrift 34s ease-in-out infinite;
  transform-box: fill-box; transform-origin: 50% 50%;
  /* Los puntos se desvanecen hacia la línea del horizonte (arriba) y se
     intensifican hacia el primer plano (abajo), como en luminelle.art */
  -webkit-mask-image: linear-gradient(180deg, transparent 6%, rgba(0,0,0,0.35) 26%, #000 62%);
          mask-image: linear-gradient(180deg, transparent 6%, rgba(0,0,0,0.35) 26%, #000 62%);
}
@keyframes dotDrift {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(-2.5px, -3.5px); }
}

/* Homies · huellas de perro cruzando y después de gato, en otra dirección */
.paw path, .paw ellipse { fill: #FFFFFF; }
.paw {
  opacity: 0; transform-box: fill-box; transform-origin: 50% 50%;
  animation: pawStep 24s linear infinite;
}
.paw--dog { animation-delay: calc(var(--i) * 0.17s); }
.paw--cat { animation-delay: calc(12s + var(--i) * 0.17s); }
@keyframes pawStep {
  0%        { opacity: 0; transform: scale(0.7); }
  2%        { opacity: 0.30; transform: scale(1); }
  26%       { opacity: 0.30; transform: scale(1); }
  38%, 100% { opacity: 0; transform: scale(1); }
}

/* Coffradia · taza bosquejada abajo y humo que sube en bucle */
.cup ellipse, .cup path { fill: none; stroke: #F2D479; stroke-width: 1.3; stroke-linecap: round; opacity: 0.26; }
.cup-in { opacity: 0.13; }
.steam {
  fill: none; stroke: #F2D479; stroke-width: 1.4; stroke-linecap: round;
  stroke-dasharray: 40 100; stroke-dashoffset: 40; opacity: 0;
  transform-box: fill-box; transform-origin: 50% 100%;
  animation: steamRise 7s ease-in-out infinite;
  animation-delay: calc(var(--i) * 1.55s);
}
@keyframes steamRise {
  0%   { stroke-dashoffset: 40; opacity: 0; transform: translateY(4px) scaleX(0.85); }
  22%  { opacity: 0.26; }
  70%  { opacity: 0.2; }
  100% { stroke-dashoffset: -100; opacity: 0; transform: translateY(-10px) scaleX(1.2); }
}

/* Marvento · olas que se expanden por la ficha */
.sn { fill: none; stroke: #F7D046; stroke-width: 1.6; opacity: 0.5; }
.ray {
  stroke: #F7D046; stroke-width: 1.3; stroke-linecap: round; opacity: 0.4;
  animation: rayPulse 5s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.22s);
}
@keyframes rayPulse { 0%, 100% { opacity: 0.22; } 50% { opacity: 0.6; } }
.wv {
  fill: none; stroke: #F7D046; stroke-width: 1.5; stroke-linecap: round; opacity: 0;
  transform-box: fill-box; transform-origin: 50% 0;
  animation: waveOut 8s linear infinite;
  animation-delay: calc(var(--i) * -1.33s);
}
@keyframes waveOut {
  0%   { transform: translateY(-6px) scaleX(0.5); opacity: 0; }
  18%  { opacity: 0.3; }
  78%  { opacity: 0.2; }
  100% { transform: translateY(32px) scaleX(1.55); opacity: 0; }
}

/* GiftLab · el moño se desata y se vuelve a atar */
.bow-set { opacity: 0.26; }
.bow-loop, .bow-tail, .bow-loose { fill: none; stroke: #FF3355; stroke-width: 6.6; stroke-linecap: round; stroke-linejoin: round; }
.bow-knot { fill: #FF3355; transform-box: fill-box; transform-origin: 50% 50%; }
.bow-loop {
  stroke-dasharray: 100; stroke-dashoffset: 0;
  animation: bowLoop 9s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.18s);
}
@keyframes bowLoop {
  0%, 20%   { stroke-dashoffset: 0; }
  52%, 70%  { stroke-dashoffset: 100; }
  92%, 100% { stroke-dashoffset: 0; }
}
/* Sin rotaciones: una transformada compuesta rasteriza el trazo y lo dentaba.
   El desatado se lee solo con el dibujado de los cabos. */
.bow-tail {
  stroke-dasharray: 100; stroke-dashoffset: 58;
  animation: bowTail 9s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.18s);
}
@keyframes bowTail {
  0%, 20%   { stroke-dashoffset: 58; }
  56%, 70%  { stroke-dashoffset: 0; }
  92%, 100% { stroke-dashoffset: 58; }
}
.bow-loose {
  stroke-dasharray: 100; stroke-dashoffset: 100;
  animation: bowLoose 9s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.18s);
}
@keyframes bowLoose {
  0%, 22%   { stroke-dashoffset: 100; }
  58%, 72%  { stroke-dashoffset: 0; }
  92%, 100% { stroke-dashoffset: 100; }
}
.bow-knot { animation: bowKnot 9s ease-in-out infinite; }
@keyframes bowKnot {
  0%, 20%   { opacity: 1; }
  56%, 70%  { opacity: 0.25; }
  92%, 100% { opacity: 1; }
}

/* Fuera de pantalla no se anima nada */
.brands:not(.is-live) .paw, .brands:not(.is-live) .steam,
.brands:not(.is-live) .wv, .brands:not(.is-live) .ray,
.brands:not(.is-live) .bow-loop, .brands:not(.is-live) .bow-tail,
.brands:not(.is-live) .bow-loose, .brands:not(.is-live) .dot, .brands:not(.is-live) .dot-set,
.brands:not(.is-live) .bow-knot { animation-play-state: paused; }

.brand__logo {
  position: absolute; left: 6%; right: 6%; top: 46%;
  transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
}
.brand__logo img {
  width: var(--logo-w, 100%);
  height: auto;
  object-fit: contain;
  mix-blend-mode: var(--logo-blend, normal);
  filter: drop-shadow(0 8px 34px rgba(0, 0, 0, 0.7));
}
.brand__logo .brand__wordmark {
  font-family: var(--display); font-weight: 300;
  font-size: clamp(1.5rem, 3.4vw, 2.3rem);
  letter-spacing: -0.02em; color: var(--foam); text-align: center;
}
.brand__tag {
  position: absolute; left: 7%; right: 7%; bottom: 10%;
  margin: 0; text-align: center;
  font-size: clamp(0.72rem, 0.88vw, 0.8rem);
  line-height: 1.4; color: #E4E8F4;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
}
.brand__link { position: absolute; inset: 0; z-index: 3; }

/* ---------- SCROLL 3 · servicios ---------- */

/* Servicios y Contacto viven sobre un mismo lienzo: sin costura entre ambos */
.lower {
  position: relative; z-index: 2;
  background: var(--ink-900);
  overflow: hidden;
  isolation: isolate;
}
/* Entrada desde el océano, por encima del borde superior */
.lower::before {
  content: ""; position: absolute; left: 0; right: 0; top: -42vh; height: 42vh;
  background: linear-gradient(180deg, rgba(5, 7, 14, 0) 0%, rgba(5, 7, 14, 0.7) 52%, var(--ink-900) 100%);
  pointer-events: none;
}
/* Un único resplandor que cruza las dos secciones */
.lower::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(46% 34% at 50% 22%, rgba(76, 47, 249, 0.17) 0%, transparent 72%),
    radial-gradient(44% 30% at 50% 82%, rgba(76, 47, 249, 0.11) 0%, transparent 74%);
  pointer-events: none; z-index: -1;
}
.services, .contact { position: relative; z-index: 1; background: transparent; }
.footer { position: relative; z-index: 2; background: #0D1226; }
.services { padding: var(--section-y) 0 clamp(4rem, 9vh, 6.5rem); }

.card--service { width: var(--scard-w); height: var(--scard-h); }
.card--service .card__inner {
  display: flex; flex-direction: column;
  padding: 1.6rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(15, 19, 38, 0.975) 0%, rgba(7, 9, 20, 0.985) 100%);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 40px 90px -46px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.card--service .card__inner::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--qliksy-lift) 25%, var(--qliksy-lift) 75%, transparent);
  opacity: 0; transition: opacity 0.55s var(--ease-soft);
}
.card--service.is-active .card__inner::before { opacity: 0.85; }
.card--service:hover .card__inner { border-color: rgba(132, 120, 255, 0.4); }

.svc__icon {
  width: 34px; height: 34px; margin: 0 0 0.9rem;
  fill: none; stroke: var(--qliksy-lift); stroke-width: 1.2;
  stroke-linecap: round; stroke-linejoin: round;
}
.svc__title {
  margin: 0; font-family: var(--display); font-weight: 400;
  font-size: 1.12rem; line-height: 1.18; letter-spacing: -0.01em;
}
.svc__desc { margin: 0.6rem 0 0; font-size: 0.82rem; line-height: 1.46; color: var(--haze); }
.svc__list { margin: 0.85rem 0 0; display: flex; flex-direction: column; gap: 0.34rem; }
.svc__list li {
  position: relative; padding-left: 0.9rem;
  font-size: 0.76rem; line-height: 1.4; color: var(--haze);
}
.svc__list li::before {
  content: ""; position: absolute; left: 0; top: 0.6em;
  width: 4px; height: 4px; border-radius: 50%; background: var(--qliksy-lift); opacity: 0.75;
}
.svc__chips { margin-top: auto; padding-top: 1.1rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.svc__chips span {
  padding: 0.32em 0.7em; font-size: 0.7rem; color: var(--haze);
  border: 1px solid var(--line); border-radius: 100px;
}

/* ---------- SCROLL 4 · contacto ---------- */

.contact { padding: 0 0 var(--section-y); }

.mailcard {
  display: flex; flex-direction: column; align-items: center; gap: clamp(1.2rem, 3vw, 2rem);
  width: min(720px, calc(100% - var(--gutter) * 2));
  margin: clamp(2.5rem, 6vh, 4rem) auto 0;
  padding: clamp(1.5rem, 3.4vw, 2.2rem);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(24, 28, 54, 0.75) 0%, rgba(10, 13, 26, 0.85) 100%);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 40px 90px -50px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.5s var(--ease-out), border-color 0.5s var(--ease-soft), box-shadow 0.5s var(--ease-soft);
}
.mailcard::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 2px;
  background: linear-gradient(90deg, transparent, var(--qliksy-lift) 28%, var(--qliksy-lift) 72%, transparent);
  opacity: 0.7;
}
.mailcard { position: relative; overflow: hidden; }
.mailcard:hover {
  transform: translateY(-4px);
  border-color: rgba(132, 120, 255, 0.45);
  box-shadow: 0 52px 110px -50px rgba(0, 0, 0, 0.98), 0 0 70px -34px rgba(132, 120, 255, 0.9);
}
.mailcard__art {
  flex: none; display: block; width: min(240px, 62%);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 26px 60px -32px rgba(0, 0, 0, 0.95), inset 0 0 0 1px rgba(255, 255, 255, 0.10);
}
.mailcard__art img {
  display: block; width: 100%; height: auto;
  transition: transform 1.2s var(--ease-out);
}
.mailcard:hover .mailcard__art img { transform: scale(1.04); }
.mailcard__text { display: flex; flex-direction: column; gap: 0.95rem; }

@media (min-width: 620px) {
  /* El bloque de texto se centra entre el borde de la imagen y el del banner */
  .mailcard { flex-direction: row; align-items: center; text-align: center; gap: 0; }
  .mailcard__art { width: 232px; flex: none; }
  .mailcard__text { flex: 1; align-items: center; }
}

.mailcard__title {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.78em 2.1em;
  font-family: var(--display); font-weight: 500;
  font-size: clamp(0.92rem, 1.35vw, 1.08rem);
  letter-spacing: 0.005em; color: #FFFFFF;
  background: var(--qliksy); border-radius: 100px;
  box-shadow: 0 12px 34px -14px rgba(76, 47, 249, 0.95);
  transition: background 0.4s var(--ease-soft), transform 0.4s var(--ease-out);
}
.mailcard:hover .mailcard__title { background: #5B41FF; transform: translateY(-2px); }
.mailcard__mail {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--haze);
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 3px;
  transition: color 0.4s, border-color 0.4s;
}
.mailcard:hover .mailcard__mail { color: var(--foam); border-bottom-color: var(--qliksy-lift); }

/* ---------- footer ---------- */

.footer { padding: clamp(3.4rem, 7vh, 5rem) var(--gutter) 1.6rem; border-top: 0; }
/* La transición hacia el fondo más claro se hace antes del borde superior */
.footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: -14vh; height: 14vh;
  background: linear-gradient(180deg, rgba(13, 18, 38, 0) 0%, rgba(13, 18, 38, 0.55) 60%, #0D1226 100%);
  pointer-events: none;
}
.footer__brand { display: block; width: 128px; margin: 0 auto clamp(2.6rem, 6vh, 4rem); }
.footer__brand img { opacity: 0.92; }

.footer__cols {
  max-width: var(--max); margin-inline: auto;
  display: grid; gap: 2.2rem;
}
@media (min-width: 760px) { .footer__cols { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; } }
.footer__label { margin: 0 0 1.1rem; font-size: 0.95rem; font-weight: 600; color: var(--foam); }
.footer__col ul { display: flex; flex-direction: column; gap: 0.7rem; }
.footer__col a { font-size: var(--t-small); color: var(--haze); transition: color 0.3s; }
.footer__col a[data-mail] { font-family: var(--serif); font-style: italic; font-size: 0.95rem; letter-spacing: 0.01em; }
.footer__col a:hover { color: var(--foam); }
/* LinkedIn en su versión larga, con su azul original */
.footer__social { display: inline-flex; }
.li {
  display: inline-flex; align-items: center;
  font-family: var(--sans); font-weight: 700;
  font-size: 1.15rem; letter-spacing: -0.035em; line-height: 1;
  color: #0A66C2;
  transition: filter 0.3s;
}
.li__box {
  margin-left: 1px; padding: 0.12em 0.2em 0.16em;
  border-radius: 4px; background: #0A66C2; color: #fff;
}
.footer__social:hover .li { filter: brightness(1.25); }

.footer__rights {
  max-width: var(--max);
  margin: clamp(2.4rem, 6vh, 3.6rem) auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-soft);
  text-align: center;
  font-family: var(--serif); font-style: italic;
  font-size: 0.86rem; color: var(--haze-dim);
}

/* ---------- revelados ---------- */

html.gsap-ready [data-fade] { opacity: 0; }

/* ---------- responsive ---------- */

@media (max-width: 1200px) {
  :root { --bcard: 330px; --bcard-h: 429px; --scard-w: 300px; --scard-h: 430px; }
  .deck-wrap { perspective: 1350px; }
}

@media (max-width: 960px) {
  .pills, .lang { display: none; }
  .burger { display: block; margin-left: auto; }
  .menu .lang { display: flex; }
}

/* Móvil: riel más amplio para que las fichas quepan al agrandarse; delays --dlm en loop */
@media (max-width: 900px) {
  /* margin auto: el bloque se reparte el aire libre del héroe y queda centrado
     entre la frase de arriba y el botón "Desliza" */
  /* Ciclo más largo que en escritorio: el riel móvil es casi tan largo como el de
     escritorio pero cabe en un tercio del ancho, así que a 11.1s la luz se veía
     disparada. A 14s recorre la línea con el mismo aire que arriba. */
  .flow { aspect-ratio: 100 / 96; margin: auto; overflow: visible; --cycle: 14s; }
  .flow__svg--w { display: none; }
  .flow__svg--t { display: block; z-index: 7; }
  .flow__track { stroke-width: 1.7; }
  /* Mismo trazo fino y mismo halo que en escritorio, pero expresados en unidades del
     viewBox: el circuito móvil se dibuja a ~0.37, y tanto stroke-width como los radios
     de drop-shadow se miden en ese espacio, no en píxeles de pantalla. De ahí el factor
     ~2.7, sin el cual el halo se pintaba a un tercio de su tamaño y la luz se veía como
     una línea plana. En pantalla rinden 3.4px de trazo y 4/11/24/48px de halo. */
  .flow__pulse {
    stroke-width: 9.1;
    filter: drop-shadow(0 0 11px rgba(255, 255, 255, 0.95))
            drop-shadow(0 0 30px rgba(198, 190, 255, 1))
            drop-shadow(0 0 65px rgba(132, 120, 255, 0.95))
            drop-shadow(0 0 129px rgba(76, 47, 249, 0.65));
  }

  /* El ciclo es más largo para que la luz vaya despacio, pero las fichas deben abrir
     y cerrar al mismo ritmo que antes: sus tramos se reescalan por 11.1/14 = 0.7929
     para que duren los mismos segundos que con el ciclo corto. */
  @keyframes fboxLit {
    0% {
      width: var(--fbox-w); padding: 0.62em 0.7em; z-index: 2;
      transform: translate(-50%, -50%) scale(1);
      border-color: rgba(132, 120, 255, 0.30);
      background: rgba(8, 11, 22, 0.62);
      color: var(--haze); box-shadow: none;
    }
    3.17% {
      width: var(--fbox-w-on); padding: 0.85em 0.8em 0.95em; z-index: 3;
      transform: translate(-50%, -50%) scale(1.06);
      border-color: rgba(168, 158, 255, 0.95);
      background: rgba(17, 15, 46, 0.92);
      color: var(--foam);
      box-shadow: 0 0 46px -8px rgba(132, 120, 255, 0.95),
                  inset 0 0 34px -16px rgba(183, 171, 255, 0.95);
    }
    12.69% {
      width: var(--fbox-w-on); padding: 0.85em 0.8em 0.95em; z-index: 3;
      transform: translate(-50%, -50%) scale(1.06);
      border-color: rgba(168, 158, 255, 0.95);
      background: rgba(17, 15, 46, 0.92);
      color: var(--foam);
      box-shadow: 0 0 46px -8px rgba(132, 120, 255, 0.95),
                  inset 0 0 34px -16px rgba(183, 171, 255, 0.95);
    }
    15.86%, 100% {
      width: var(--fbox-w); padding: 0.62em 0.7em; z-index: 2;
      transform: translate(-50%, -50%) scale(1);
      border-color: rgba(132, 120, 255, 0.30);
      background: rgba(8, 11, 22, 0.62);
      color: var(--haze); box-shadow: none;
    }
  }
  @keyframes ffigLit {
    0%, 3.17%     { max-height: 0; opacity: 0; margin-top: 0; }
    5.55%         { max-height: var(--ffig-h); opacity: 1; margin-top: 0.45rem; }
    12.69%        { max-height: var(--ffig-h); opacity: 1; margin-top: 0.45rem; }
    15.06%, 100%  { max-height: 0; opacity: 0; margin-top: 0; }
  }
  @keyframes goldDraw {
    0%, 5.55%     { stroke-dashoffset: 100; }
    10.31%        { stroke-dashoffset: 0; }
    13.48%        { stroke-dashoffset: 0; }
    13.88%, 100%  { stroke-dashoffset: 100; }
  }
  @keyframes typeLine {
    0%, 4.76%     { width: 0; }
    9.51%         { width: 100%; }
    13.48%        { width: 100%; }
    13.88%, 100%  { width: 0; }
  }
  @keyframes toolIn {
    0%, 4.76%     { opacity: 0; transform: translateY(4px) scale(0.86); }
    7.93%         { opacity: 1; transform: none; }
    13.48%        { opacity: 1; transform: none; }
    13.88%, 100%  { opacity: 0; transform: translateY(4px) scale(0.86); }
  }
  .fbox {
    --fbox-w: 28%;
    --fbox-w-on: 36%;
    --ffig-h: 44px;
    animation-delay: calc(var(--dlm, 0s) - var(--cycle));
    font-size: 0.62rem;
    --cart-to: 88px;
  }
  .fbox__fig { animation-delay: calc(var(--dlm, 0s) - var(--cycle)); }
  /* Centradas entre los dos rieles que las rodean, para que al agrandarse no los toquen */
  .fbox--1 { --fx: 26%; --fy: 18%; }
  .fbox--2 { --fx: 74%; --fy: 18%; }
  .fbox--3 { --fx: 26%; --fy: 51.5%; }
  .fbox--4 { --fx: 74%; --fy: 51.5%; }
  .gs2 { animation-delay: calc(var(--dlm, 0s) - var(--cycle) + var(--i) * 0.13s); }
  .ffig-code .l { animation-delay: calc(var(--dlm, 0s) - var(--cycle) + var(--i) * 0.30s); }
  .ffig-tools .tool { animation-delay: calc(var(--dlm, 0s) - var(--cycle) + var(--i) * 0.17s); }
  .ffig-cart svg { animation-delay: calc(var(--dlm, 0s) - var(--cycle)); }
  /* 84.2% = y 808 del viewBox: las letras quedan sobre la misma línea del riel */
  .flow__ai { left: 50%; top: 84.2%; font-size: 0.82rem; z-index: 8; }
  /* 0.09s de escalonado: con el ciclo de 14s la última letra se apaga justo al cerrarlo */
  .flow__ai-t i { animation-delay: calc(var(--n) * 0.09s - var(--cycle)); }
  .ffig-svg { width: 40px; }
  .ffig-tools { width: 70px; }
  .ffig-code { font-size: 0.36rem; }
}

@media (max-width: 760px) {
  :root {
    --bcard: min(300px, 78vw);
    --bcard-h: calc(min(300px, 78vw) * 1.3);
    --scard-w: min(300px, 78vw);
    --scard-h: 358px;
    --gutter: 1.25rem;
    --section-y: 4.2rem;
    --t-hero: clamp(2.15rem, 9vw, 2.7rem);
  }
  .deck-wrap {
    perspective: 1050px;
    overflow-x: clip;
    overflow-y: visible;
  }
  .deck { transform-style: preserve-3d; }
  .card { transform-style: preserve-3d; }
  .deck-wrap--brands { height: calc(var(--bcard-h) + 52px); }
  .deck-wrap--services { height: 416px; }
  .deck-ui { margin-top: 1.1rem; }
  .deck-ui__dots { display: none; }
  .deck-ui__arrow { width: 48px; height: 48px; }

  /* Sombra circular suave: sin rotateX, que en móvil se veía como franja negra */
  .card__shadow {
    bottom: -14px;
    width: 62%;
    height: 28px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, 0.42) 0%, transparent 72%);
    filter: blur(10px);
  }

  .hero {
    min-height: 100svh;
    min-height: 100dvh;
    justify-content: center;
    padding: calc(6.2rem + env(safe-area-inset-top, 0px)) var(--gutter) 5.4rem;
  }
  .scroller {
    display: flex;
    bottom: calc(0.9rem + env(safe-area-inset-bottom, 0px));
  }
  .hero__serif { font-size: 1.12rem; min-height: 2.5em; }
  .h2 { max-width: 18ch; }
  .lead { max-width: 38ch; }
  .section-head { margin-bottom: 1.6rem; }

  .brands { padding: 3.4rem 0 3.2rem; }
  .card--brand .card__inner { border-radius: 16px; }
  .brand__logo { top: 42%; }
  .brand__tag { font-size: 0.78rem; bottom: 8%; }

  .card--service { height: var(--scard-h); }
  .card--service .card__inner {
    padding: 1.2rem 1.15rem 1.15rem;
    overflow: hidden;
  }
  .svc__desc { font-size: 0.78rem; line-height: 1.4; }
  .svc__list { margin-top: 0.7rem; gap: 0.28rem; }
  .svc__list li { font-size: 0.72rem; }

  .services { padding: 3.4rem 0 2.6rem; }
  .contact { padding: 0 0 3.4rem; }
  .mailcard { width: calc(100% - var(--gutter) * 2); }

  .footer {
    padding: 2.6rem var(--gutter) calc(2.2rem + env(safe-area-inset-bottom, 0px));
  }
  .footer__brand { margin-bottom: 2rem; }
  .footer__cols { grid-template-columns: 1fr 1fr; gap: 1.5rem 1.1rem; }
  .footer__label { margin-bottom: 0.7rem; }
  .footer__col ul { gap: 0.45rem; }
  .footer__rights { margin-top: 2rem; }
}

@media (max-width: 460px) {
  :root { --bcard: min(280px, 82vw); --bcard-h: calc(min(280px, 82vw) * 1.3); --scard-w: min(280px, 82vw); --scard-h: 392px; }
  .deck-wrap--brands { height: calc(var(--bcard-h) + 48px); }
  .deck-wrap--services { height: 448px; }
}

/* ---------- movimiento reducido ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .flow__pulse { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; opacity: 0.5; }
  .fbox, .fbox__fig, .ffig-cart svg, .flow__ai-t i,
  .gs2, .ffig-code .l, .ffig-tools g { animation: none !important; }
  .gs2 { stroke-dashoffset: 0; }
  .ffig-code .l { width: 100%; }
  .ffig-tools g { opacity: 1; transform: none; }
  .flow__ai-t i { color: var(--qliksy); }
  .fbox__fig { max-height: 64px; opacity: 1; margin-top: 0.45rem; }
  .fbox { color: var(--foam); border-color: rgba(132, 120, 255, 0.5); }
  .dot, .dot-set, .paw, .steam, .wv, .bow-loop, .bow-tail, .bow-loose, .bow-knot { animation: none !important; }
  .dot { opacity: var(--o, 0.5); }
  .paw { opacity: 0.24; }
  .steam { opacity: 0.4; stroke-dashoffset: 0; }
  .wv { opacity: 0.4; }
  .hero__serif .type { white-space: pre-line; }
.type::after { display: none; }
}
