:root {
  --bg: #05070e;
  --bg-alt: #0a0f1c;
  --panel: #0d1322;
  --text: #eef1fb;
  --muted: #98a2bd;
  --line: rgba(255,255,255,0.09);
  --primary: #3f63ff;
  --primary-2: #5b8cff;
  --accent: #35e08b;
  --accent-text: #04140c;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --fs-h1: clamp(2.3rem, 5.2vw, 4.1rem);
  --fs-h2: clamp(1.8rem, 3.6vw, 2.7rem);
  --fs-h3: clamp(1.15rem, 2vw, 1.4rem);
  --fs-body: clamp(1rem, 1.1vw, 1.1rem);

  --radius: 12px;
  --header-h: 64px;
  --maxw: 1200px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { overflow-x: clip; max-width: 100vw; -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
html.lenis-smooth { scroll-behavior: auto !important; }
html.lenis.lenis-stopped { overflow: hidden; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: clip;
  max-width: 100vw;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; letter-spacing: -0.015em; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--primary); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: clamp(20px, 5vw, 48px); }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 10000; background: var(--accent); color: var(--accent-text); padding: 10px 18px; border-radius: var(--radius); font-weight: 600; font-size: 0.85rem; transition: top 0.2s var(--ease); }
.skip-link:focus { top: 12px; }

.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0%; background: var(--accent); z-index: 9998; transition: width 0.1s linear; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.01em;
  padding: 14px 28px; border-radius: 100px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
  line-height: 1; text-align: center;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--accent-text); box-shadow: 0 10px 30px -12px rgba(53,224,139,0.55); }
.btn-primary:hover { background: #4bf09d; transform: translateY(-2px); box-shadow: 0 16px 38px -14px rgba(53,224,139,0.7); }
.btn-ghost { background: rgba(255,255,255,0.04); color: var(--text); border-color: var(--line); backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.08); transform: translateY(-2px); }
.btn-sm { padding: 11px 20px; font-size: 0.85rem; }
.btn-lg { padding: 17px 34px; font-size: 1.02rem; }

.eyebrow { font-family: var(--font-display); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); display: inline-flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 24px; height: 2px; background: var(--accent); display: inline-block; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(28px, 4vw, 64px); position: relative; z-index: 1; background: var(--bg); }
.section-head { max-width: 780px; margin-bottom: clamp(28px, 4vw, 52px); }
.section-title { font-size: var(--fs-h2); margin-top: 14px; color: var(--text); }

/* ---------- Header ---------- */
.site-header { position: relative; z-index: 15; height: var(--header-h); margin: 18px auto 0; max-width: calc(var(--maxw) + 40px); padding-inline: clamp(12px, 4vw, 24px); overflow: visible; }
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; background: rgba(10,15,28,0.72); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 40px; padding: 0 12px 0 22px; box-shadow: 0 10px 34px -18px rgba(0,0,0,0.7); }
.brand img { height: 40px; width: auto; display: block; }
.nav { display: flex; gap: 28px; font-family: var(--font-display); font-size: 0.92rem; font-weight: 500; }
.nav a { position: relative; color: var(--text); padding: 4px 0; }
.nav a::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease); }
.nav a:hover::after { transform: scaleX(1); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; width: 44px; height: 44px; align-items: center; justify-content: center; background: none; border: none; cursor: pointer; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu { position: fixed; inset: 0 0 0 auto; width: 78%; max-width: 340px; z-index: 40; background: var(--bg-alt); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform 0.38s var(--ease); padding: calc(var(--header-h) + 44px) 32px 40px; box-shadow: -20px 0 50px -30px rgba(0,0,0,0.8); }
.mobile-menu.open { transform: translateX(0); }
.mobile-menu nav { display: flex; flex-direction: column; gap: 6px; }
.mobile-menu nav a { font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.mobile-menu nav a.btn { border: none; margin-top: 20px; justify-content: center; }

/* ---------- Hero (recorrido largo: cada una de las 40 previews tiene tiempo de lectura) ---------- */
.hero { position: relative; z-index: 0; min-height: 1200vh; min-height: 1200svh; margin-top: -102px; }
.hero-bg { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; z-index: 0; pointer-events: none; background: var(--bg); }
.hero-scrim {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(0deg, rgba(5,7,14,0.22), rgba(5,7,14,0.22)),
    radial-gradient(130% 95% at 50% 48%, rgba(5,7,14,0.5) 0%, rgba(5,7,14,0.2) 46%, rgba(5,7,14,0) 80%);
}
.hero-stage { position: relative; z-index: 2; --portal-rgb: 53, 224, 139; --portal-pulse: 0; --portal-turn: 0deg; }
.hero-beat { position: relative; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 0 clamp(20px, 6vw, 60px); will-change: transform, opacity, filter; }
.beat-main { padding: 0; }
.beat-main-inner { width: 100%; flex: 1; max-width: var(--maxw); margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 clamp(20px, 5vw, 48px); }

/* Tipografía a lo Trionn: display compacto en mayúsculas, la espiral serpentea alrededor */
.hero-eyebrow { margin-bottom: 14px; }
.hero-title { font-size: clamp(1.7rem, 4.4vw, 3.4rem); max-width: 16ch; color: var(--text); text-transform: uppercase; line-height: 1.02; letter-spacing: -0.02em; font-weight: 700; text-shadow: 0 2px 44px rgba(5,7,14,0.95); }
.hero-title em { font-style: normal; color: var(--accent); }
.hero-sub { font-size: clamp(0.92rem, 1.15vw, 1.05rem); color: var(--muted); max-width: 44ch; margin-top: 14px; line-height: 1.5; text-shadow: 0 1px 20px rgba(5,7,14,0.9); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 20px; justify-content: center; }
.hero-cue { display: inline-flex; align-items: center; gap: 12px; margin-top: 28px; font-family: var(--font-display); font-size: 0.76rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.hero-cue span { position: relative; width: 22px; height: 34px; border: 1.5px solid var(--muted); border-radius: 12px; flex: none; }
.hero-cue span::after { content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 6px; border-radius: 3px; background: var(--accent); transform: translateX(-50%); animation: cue 1.6s var(--ease) infinite; }
@keyframes cue { 0% { opacity: 0; transform: translate(-50%, 0); } 40% { opacity: 1; } 80% { opacity: 0; transform: translate(-50%, 12px); } 100% { opacity: 0; } }

.beat-lead { font-family: var(--font-display); font-weight: 600; font-size: clamp(0.74rem, 1vw, 0.86rem); letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent); }
.beat-big { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 3.8vw, 3.1rem); line-height: 1.04; letter-spacing: -0.015em; text-transform: uppercase; color: var(--text); max-width: 20ch; text-shadow: 0 2px 40px rgba(5,7,14,0.95), 0 1px 6px rgba(5,7,14,0.9); }
.beat-note { font-size: clamp(0.9rem, 1.1vw, 1.02rem); color: var(--muted); max-width: 46ch; text-shadow: 0 1px 20px rgba(5,7,14,0.9); }
.beat-link { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; color: var(--accent); margin-top: 4px; border-bottom: 1.5px solid transparent; transition: border-color 0.25s var(--ease); }
.beat-link:hover { border-color: var(--accent); }
.beat-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; justify-content: center; }

/* Espiral de previews (estilo Trionn): la crea home.js solo en modo túnel.
   OJO: sin z-index propio → las cards compiten una a una contra los beats de
   texto (z 60): las lejanas (z<60) pasan por detrás, las cercanas por delante */
.hero-ribbon { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }

/* Fondo cromático reactivo: dos capas se cruzan al cambiar de proyecto para
   que el color nunca corte en seco. */
.spiral-aura { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.spiral-aura-layer { position: absolute; inset: -18%; opacity: 0; transform: scale(0.88); filter: blur(18px); transition: opacity 0.9s var(--ease), transform 1.2s var(--ease); will-change: opacity, transform; }
.spiral-aura-layer.is-active { opacity: 1; transform: scale(1); }

/* La estela se dibuja con la proyección real de las cards: dos trazos, uno
   difuso y otro nítido, avanzan únicamente cuando avanza el scroll. */
.spiral-trail { position: absolute; inset: 0; z-index: 8; width: 100%; height: 100%; overflow: visible; pointer-events: none; mix-blend-mode: screen; }
.spiral-trail path { fill: none; stroke: rgb(var(--portal-rgb)); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spiral-trail-glow { stroke-width: 17; opacity: 0.12; filter: blur(7px); stroke-dasharray: 34 54; }
.spiral-trail-core { stroke-width: 1.35; opacity: 0.66; stroke-dasharray: 2 15; }

.ribbon-card {
  position: absolute; left: 0; top: 0; width: var(--card-w, 300px); aspect-ratio: 16/10;
  border-radius: 8px; overflow: hidden; visibility: hidden;
  border: 1px solid rgba(255,255,255,0.16); background: #0a0e1a;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,0.92), 0 0 60px -28px rgba(63,99,255,0.32);
  pointer-events: auto; contain: layout paint;
  opacity: var(--portal-opacity, 1);
}
.ribbon-card img { width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; user-select: none; -webkit-user-drag: none; transition: opacity 0.2s var(--ease), transform 0.35s var(--ease); }
.ribbon-card.is-loaded img { opacity: 1; }
.ribbon-card.is-visible { will-change: transform, opacity; }
.ribbon-card:hover img { transform: scale(1.05); }
.ribbon-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5,7,14,0.32), rgba(5,7,14,0.06)); transition: opacity 0.3s var(--ease); pointer-events: none; }
.ribbon-card:hover::after, .ribbon-card:focus-visible::after { opacity: 0; }
/* Dorso: cuando la card va de espaldas (girando los 180°), se apaga gradualmente */
.ribbon-card::before { content: ""; position: absolute; inset: 0; z-index: 2; background: #05070e; opacity: var(--backdim, 0); pointer-events: none; }
.ribbon-name {
  position: absolute; left: 10px; bottom: 10px; z-index: 3; pointer-events: none;
  font-family: var(--font-display); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.02em; color: #fff;
  background: rgba(5,7,14,0.74); border: 1px solid rgba(255,255,255,0.14); padding: 5px 12px; border-radius: 100px;
  opacity: 0; transform: translateY(6px); transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}
.ribbon-card:hover .ribbon-name, .ribbon-card:focus-visible .ribbon-name { opacity: 1; transform: translateY(0); }

/* Celular 3D gigante (lo crea home.js en modo túnel): el eje de la escalera.
   z 58: debajo de los textos (60); el carril frontal de cards pasa por delante.
   El canto se dibuja con 8 lonjas apiladas en Z entre la cara frontal (+8.4px)
   y la trasera (-8.4px): de canto se ve el espesor real, no desaparece. */
/* perspective larga (1600) a propósito: con el celular a 93vh, una fuga corta
   agrandaba el canto cercano ~15% al rotar y lo recortaba contra el viewport */
.hero-phone { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 58; pointer-events: none; perspective: 1600px; }
.hero-phone.has-link.is-facing { pointer-events: auto; cursor: pointer; }
.hero-phone::before { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(calc(1 + var(--portal-pulse) * 0.14)); width: 180%; height: 122%; opacity: calc(0.48 + var(--portal-pulse) * 0.52); background: radial-gradient(closest-side, rgba(var(--portal-rgb),0.34), rgba(var(--portal-rgb),0.1) 56%, transparent 79%); }
.ph { position: relative; height: min(93vh, 900px); aspect-ratio: 9 / 19.4; transform-style: preserve-3d; will-change: transform; }
.ph-slice, .ph-front, .ph-back { position: absolute; inset: 0; border-radius: clamp(38px, 6.4vh, 62px); }
.ph-slice { background: #0d1424; border: 1px solid #26304c; }
/* las DOS caras son pantalla: mismo tratamiento, una girada 180° */
.ph-front, .ph-back { backface-visibility: hidden; background: #05070e; border: 3px solid #202a44; overflow: hidden; box-shadow: 0 30px 90px -25px rgba(5,7,14,0.9); transition: border-color 0.28s var(--ease), box-shadow 0.28s var(--ease); }
.hero-phone.has-link.is-facing:hover .ph-front, .hero-phone.has-link.is-facing:hover .ph-back, .hero-phone.has-link:focus-visible .ph-front, .hero-phone.has-link:focus-visible .ph-back { border-color: rgba(var(--portal-rgb),0.9); box-shadow: 0 30px 90px -25px rgba(5,7,14,0.9), 0 0 42px rgba(var(--portal-rgb),0.34); }
.ph-front { transform: translateZ(12px); }
.ph-back { transform: translateZ(-12px) rotateY(180deg); }
/* Dos capas de pantalla que se cruzan (una carga mientras la otra se ve): el
   cambio de preview es un fundido, no un corte */
/* ancho/alto explícitos, NO inset: en un <img> (elemento reemplazado) los
   cuatro insets no estiran la caja, queda con su tamaño intrínseco */
.ph-screen { position: absolute; top: 12px; left: 12px; width: calc(100% - 24px); height: calc(100% - 24px); z-index: 1; object-fit: cover; object-position: top; border-radius: clamp(28px, 5vh, 50px); background: #0a0e1a; opacity: 0; transition: opacity 0.24s var(--ease); }
.ph-screen.is-on { opacity: 1; }
/* Primera escena: el logo de GokyWebs, hasta que la primera preview llega al frente */
.ph-splash { position: absolute; inset: 12px; z-index: 2; border-radius: clamp(28px, 5vh, 50px); background: linear-gradient(165deg, #16203c 0%, #0a0f1c 52%, #05070e 100%); display: flex; align-items: center; justify-content: center; opacity: 1; transition: opacity 0.6s var(--ease); }
.ph-splash.is-off { opacity: 0; }
.ph-splash img { width: 64%; height: auto; }
.ph-notch { position: absolute; z-index: 4; top: 20px; left: 50%; transform: translateX(-50%); width: 34%; height: 28px; background: #05070e; border-radius: 100px; }
.ph-glare { position: absolute; z-index: 3; inset: 0; border-radius: inherit; background: linear-gradient(115deg, rgba(255,255,255,0.13) 0%, rgba(255,255,255,0.04) 26%, transparent 45%); }
.ph-link-cue { position: absolute; left: 50%; bottom: clamp(20px, 3.2vh, 34px); z-index: 9; transform: translate(-50%, 7px); opacity: 0; pointer-events: none; white-space: nowrap; padding: 7px 13px; border: 1px solid rgba(255,255,255,0.2); border-radius: 100px; background: rgba(5,7,14,0.78); backdrop-filter: blur(10px); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 0.65rem; letter-spacing: 0.11em; text-transform: uppercase; transition: transform 0.28s var(--ease), background 0.28s var(--ease), color 0.28s var(--ease); }
.hero-phone.has-link .ph-link-cue { opacity: var(--phone-facing, 0); transform: translate(-50%, 0); }
.hero-phone.has-link.is-facing:hover .ph-link-cue, .hero-phone.has-link:focus-visible .ph-link-cue { background: rgb(var(--portal-rgb)); color: #05070e; }
.ph-link-cue i { font-style: normal; margin-left: 4px; }

/* Anillos del portal: el giro y el pulso salen del mismo progreso de scroll
   que mueve las cards, por eso se sienten físicamente conectados. */
.spiral-portal-core { position: absolute; left: 50%; top: 50%; z-index: 57; width: min(70vh, 700px); aspect-ratio: 1; pointer-events: none; opacity: calc(0.42 + var(--portal-pulse) * 0.48); transform: translate(-50%, -50%) scale(calc(0.92 + var(--portal-pulse) * 0.11)); will-change: transform, opacity; }
.spiral-portal-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(var(--portal-rgb),0.46); box-shadow: inset 0 0 34px rgba(var(--portal-rgb),0.09), 0 0 34px rgba(var(--portal-rgb),0.12); }
.spiral-portal-ring::before, .spiral-portal-ring::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--portal-rgb)); box-shadow: 0 0 18px 5px rgba(var(--portal-rgb),0.58); }
.spiral-portal-ring::before { left: 11%; top: 22%; }
.spiral-portal-ring::after { right: 7%; bottom: 29%; }
.spiral-portal-ring.ring-a { inset: 4%; transform: rotate(var(--portal-turn)); border-style: dashed; }
.spiral-portal-ring.ring-b { inset: 20%; transform: rotate(calc(0deg - var(--portal-turn))); opacity: 0.74; }
.spiral-portal-dot { position: absolute; left: 50%; top: 50%; width: calc(10px + var(--portal-pulse) * 18px); height: calc(10px + var(--portal-pulse) * 18px); transform: translate(-50%, -50%); border-radius: 50%; background: #fff; box-shadow: 0 0 22px 8px rgba(var(--portal-rgb),0.78), 0 0 76px 28px rgba(var(--portal-rgb),0.28); opacity: calc(0.25 + var(--portal-pulse) * 0.75); }

/* Contador editorial del proyecto que está cruzando el núcleo. */
.spiral-status { position: absolute; z-index: 122; left: clamp(18px, 4vw, 62px); top: clamp(94px, 12vh, 128px); width: min(290px, 34vw); pointer-events: none; opacity: 0; transform: translateY(12px); transition: opacity 0.45s var(--ease), transform 0.55s var(--ease); text-shadow: 0 2px 24px rgba(5,7,14,0.96); }
.spiral-status.has-project { opacity: 1; transform: translateY(0); }
.spiral-status-kicker { display: block; color: rgb(var(--portal-rgb)); font-family: var(--font-display); font-weight: 700; font-size: 0.66rem; letter-spacing: 0.17em; text-transform: uppercase; }
.spiral-status-count { display: flex; align-items: baseline; margin-top: 5px; font-family: var(--font-display); line-height: 0.9; }
.spiral-status-count strong { color: var(--text); font-size: clamp(2.7rem, 5vw, 5.4rem); letter-spacing: -0.08em; }
.spiral-status-count span { margin-left: 9px; color: rgba(255,255,255,0.5); font-size: clamp(0.9rem, 1.35vw, 1.2rem); letter-spacing: 0.08em; }
.spiral-status-name { margin-top: 10px; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: clamp(0.9rem, 1.45vw, 1.2rem); line-height: 1.08; letter-spacing: 0.015em; text-transform: uppercase; }
.spiral-status-cat { display: block; margin-top: 5px; color: rgba(255,255,255,0.58); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }
.spiral-status.is-changing .spiral-status-count, .spiral-status.is-changing .spiral-status-name, .spiral-status.is-changing .spiral-status-cat { animation: spiral-status-in 0.52s var(--ease) both; }
@keyframes spiral-status-in { from { opacity: 0; transform: translateY(12px); filter: blur(5px); } to { opacity: 1; transform: translateY(0); filter: blur(0); } }
@keyframes spiral-status-mobile-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Esquinas persistentes (a lo Trionn): acompañan todo el viaje del hero */
.hero-corner { position: absolute; bottom: 26px; z-index: 120; font-size: 0.8rem; line-height: 1.5; }
.hero-corner-br { right: clamp(88px, 9vw, 120px); font-family: var(--font-display); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text); padding-bottom: 3px; border-bottom: 1.5px solid rgba(255,255,255,0.3); transition: border-color 0.25s var(--ease), color 0.25s var(--ease); }
.hero-corner-br span { display: inline-block; transition: transform 0.25s var(--ease); }
.hero-corner-br:hover { color: var(--accent); border-color: var(--accent); }
.hero-corner-br:hover span { transform: translateX(4px); }

/* Modo túnel: activo solo con JS+GSAP (clase hero--tunnel); sin JS los beats se apilan verticales */
.hero--tunnel .hero-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
/* Los textos van ARRIBA (el carril frontal de la espiral cruza por el medio):
   las cards lejanas pasan por detrás, las cercanas por delante al salir */
.hero--tunnel .hero-beat { position: absolute; inset: 0; min-height: 0; z-index: 60; pointer-events: none; justify-content: flex-start; padding-top: 7vh; }
.hero--tunnel .hero-beat.beat-final { justify-content: flex-start; padding-top: clamp(78px, 11vh, 116px); }
/* Los títulos alternan esquinas (clase puesta por home.js): arriba-derecha ↔
   abajo-izquierda. Así el centro queda libre para el celular gigante. */
.hero--tunnel .hero-beat.beat-tr { align-items: flex-end; justify-content: flex-start; text-align: right; padding: clamp(92px, 13vh, 140px) clamp(20px, 5vw, 64px) 0 0; }
.hero--tunnel .hero-beat.beat-bl { align-items: flex-start; justify-content: flex-end; text-align: left; padding: 0 0 clamp(74px, 10vh, 112px) clamp(20px, 5vw, 64px); }
.hero--tunnel .beat-tr .beat-big, .hero--tunnel .beat-bl .beat-big { max-width: 13ch; }
.hero--tunnel .hero-beat a { pointer-events: auto; }
.hero--tunnel .hero-beat + .hero-beat { opacity: 0; visibility: hidden; }
.hero--tunnel .beat-main-inner { justify-content: flex-start; flex: none; padding-top: clamp(78px, 10vh, 108px); padding-bottom: 0; }

/* ---------- Servicios: filas tipográficas (a lo Trionn) ---------- */
.serv-rows { border-top: 1px solid var(--line); }
.serv-row { position: relative; display: grid; grid-template-columns: 64px 1.1fr 1.5fr auto; align-items: center; gap: clamp(16px, 3vw, 48px); padding: clamp(24px, 3.4vw, 42px) clamp(8px, 1.4vw, 20px); border-bottom: 1px solid var(--line); overflow: hidden; }
.serv-row::before { content: ""; position: absolute; inset: 0; background: var(--accent); transform: scaleY(0); transform-origin: bottom; transition: transform 0.35s var(--ease); }
.serv-row:hover::before, .serv-row:focus-visible::before { transform: scaleY(1); }
.serv-row > * { position: relative; transition: color 0.3s var(--ease), transform 0.3s var(--ease); }
.serv-num { font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; color: var(--muted); letter-spacing: 0.08em; }
.serv-name { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 3.2vw, 2.5rem); text-transform: uppercase; letter-spacing: -0.015em; color: var(--text); line-height: 1.05; }
.serv-desc { color: var(--muted); font-size: 0.96rem; line-height: 1.55; max-width: 52ch; }
.serv-arrow { font-size: clamp(1.4rem, 2.2vw, 1.9rem); color: var(--text); line-height: 1; }
.serv-row:hover > *, .serv-row:focus-visible > * { color: var(--accent-text); }
.serv-row:hover .serv-arrow { transform: translateX(10px); }

/* ---------- Portfolio: plano y tipográfico (a lo Trionn) ---------- */
.portfolio { background: var(--bg-alt); }
.pf-filters { display: flex; flex-wrap: wrap; gap: 6px 26px; margin-bottom: 34px; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.pf-cat { position: relative; font-family: var(--font-display); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); background: none; border: none; padding: 6px 0; cursor: pointer; transition: color 0.25s var(--ease); }
.pf-cat::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease); }
.pf-cat:hover { color: var(--text); }
.pf-cat.active { color: var(--text); }
.pf-cat.active::after { transform: scaleX(1); }
.pf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 2vw, 28px) clamp(12px, 1.3vw, 18px); }
.pf-card { position: relative; display: flex; flex-direction: column; }
.pf-card.pf-hidden { display: none; }
.pf-visuals { position: relative; aspect-ratio: 16/10; overflow: hidden; background: #0a0e1a; border: 1px solid var(--line); border-radius: 8px; transition: border-color 0.3s var(--ease); }
.pf-card:hover .pf-visuals { border-color: rgba(53,224,139,0.6); }
.pf-web { width: 100%; height: 100%; }
.pf-web img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.55s var(--ease); }
.pf-card:hover .pf-web img { transform: scale(1.05); }
.pf-info { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 14px 2px 0; }
.pf-info h4 { font-family: var(--font-display); font-size: 0.98rem; color: var(--text); font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }
.pf-meta { display: block; font-size: 0.76rem; color: var(--muted); margin-top: 3px; font-family: var(--font-body); font-weight: 400; text-transform: none; letter-spacing: 0; }
.pf-cta { font-family: var(--font-display); font-weight: 600; font-size: 0.85rem; color: var(--accent); white-space: nowrap; transition: transform 0.3s var(--ease); }
.pf-card:hover .pf-cta { transform: translate(3px, -3px); }

/* ---------- Proceso ---------- */
.pasos { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.paso { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; display: flex; flex-direction: column; gap: 12px; }
.paso-num { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: var(--accent); line-height: 1; }
.paso h3 { font-size: 1.1rem; color: var(--text); margin-bottom: 6px; }
.paso p { color: var(--muted); font-size: 0.94rem; line-height: 1.55; }

/* ---------- CTA final ---------- */
.cta-final { position: relative; z-index: 1; background: linear-gradient(135deg, rgba(63,99,255,0.16) 0%, rgba(5,7,14,0) 45%, rgba(53,224,139,0.13) 100%), var(--bg-alt); border-block: 1px solid var(--line); padding-block: clamp(48px, 7vw, 96px); }
.cta-inner { text-align: center; max-width: 720px; }
.cta-inner h2 { font-size: var(--fs-h2); color: var(--text); }
.cta-inner p { color: var(--muted); margin-top: 14px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 30px; }

/* ---------- Footer ---------- */
.site-footer { position: relative; z-index: 1; background: #030509; color: var(--muted); padding-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.footer-brand img { height: 42px; width: auto; }
.footer-brand p { color: var(--muted); margin-top: 16px; max-width: 36ch; font-size: 0.95rem; }
.footer-col h4 { font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.45); margin-bottom: 14px; font-weight: 600; }
.footer-col a { display: block; color: var(--muted); padding: 5px 0; transition: color 0.25s var(--ease); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--line); padding: 20px clamp(20px, 5vw, 48px); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; max-width: var(--maxw); margin-inline: auto; font-size: 0.85rem; color: rgba(255,255,255,0.4); }
.footer-tag { font-style: italic; }

/* ---------- WhatsApp float ---------- */
.wsp-float { position: fixed; right: 22px; bottom: 22px; z-index: 60; width: 58px; height: 58px; border-radius: 50%; background: #25d366; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px -8px rgba(37,211,102,0.55); opacity: 0; visibility: hidden; transform: translateY(20px) scale(0.85); transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s; }
.wsp-float.visible { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.wsp-float svg { width: 30px; height: 30px; }
.wsp-float::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #25d366; animation: pulse-ring 2.2s var(--ease) infinite; }
@keyframes pulse-ring { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(1.7); opacity: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .serv-row { grid-template-columns: 44px 1fr auto; }
  .serv-name { grid-row: 1; grid-column: 2; }
  .serv-arrow { grid-row: 1; grid-column: 3; }
  .serv-desc { grid-row: 2; grid-column: 2 / -1; }
  .pf-grid { grid-template-columns: repeat(2, 1fr); }
  .spiral-status { width: min(240px, 38vw); }
  .pasos { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .beat-main-inner { padding-top: 130px; }
  .hero-title { max-width: 100%; }
  /* nombre bien chico, clavado en la esquina inferior izquierda de la card */
  .ribbon-name { opacity: 1; transform: none; left: 7px; bottom: 7px; font-size: 0.52rem; padding: 3px 8px; letter-spacing: 0.01em; }
  .ph { height: min(54vh, 470px); height: min(54svh, 470px); }
  .ph-link-cue { bottom: 15px; padding: 6px 10px; font-size: 0.54rem; letter-spacing: 0.08em; backdrop-filter: none; }
  .ribbon-card { box-shadow: 0 20px 46px -28px rgba(0,0,0,0.86); }
  .hero-beat { will-change: transform, opacity; }
  .spiral-aura-layer { inset: -6%; filter: none; transition-duration: 0.45s; }
  .spiral-trail { mix-blend-mode: normal; }
  .spiral-portal-core { width: min(96vw, 520px); }
  .spiral-trail-glow { display: none; }
  .spiral-trail-core { opacity: 0.5; }
  .spiral-portal-ring { box-shadow: none; }
  .spiral-status { left: 14px; top: 82px; width: min(36vw, 140px); }
  .spiral-status-kicker { font-size: 0.52rem; letter-spacing: 0.12em; }
  .spiral-status-count { margin-top: 3px; }
  .spiral-status-count strong { font-size: clamp(2rem, 10vw, 2.75rem); }
  .spiral-status-count span { margin-left: 6px; font-size: 0.72rem; }
  .spiral-status-name { margin-top: 7px; font-size: 0.72rem; max-width: 16ch; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .spiral-status-cat { display: none; }
  .spiral-status.is-changing .spiral-status-count, .spiral-status.is-changing .spiral-status-name { animation-name: spiral-status-mobile-in; animation-duration: 0.28s; }
  /* con el celular más chico, marco/notch/radios bajan en proporción */
  .ph-splash { inset: 9px; }
  .ph-screen { top: 9px; left: 9px; width: calc(100% - 18px); height: calc(100% - 18px); }
  .ph-screen, .ph-splash { border-radius: clamp(20px, 3.4vh, 34px); }
  .ph-slice, .ph-front, .ph-back { border-radius: clamp(26px, 4.4vh, 42px); }
  .ph-notch { top: 14px; height: 20px; }
  /* en pantalla angosta los títulos se pegan más a la esquina y ocupan menos ancho */
  .hero--tunnel .hero-beat.beat-tr { padding: clamp(84px, 12vh, 120px) 18px 0 0; }
  .hero--tunnel .hero-beat.beat-bl { padding: 0 0 clamp(76px, 11vh, 108px) 18px; }
  .hero--tunnel .beat-tr .beat-big, .hero--tunnel .beat-bl .beat-big { max-width: 11ch; }
  .hero-corner-br { right: auto; left: 50%; transform: translateX(-50%); bottom: 18px; white-space: nowrap; }
  .pf-grid { grid-template-columns: 1fr; }
  .pasos { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .wsp-float { right: 16px; bottom: 16px; }
}

@media (max-width: 560px) and (max-height: 700px) {
  .ph { height: min(50vh, 350px); height: min(50svh, 350px); }
  .spiral-status { top: 76px; }
  .spiral-status-kicker { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .hero-cue span::after, .wsp-float::before { animation: none; }
  [data-animate] { opacity: 1 !important; transform: none !important; }
}
