/* Fulanito · landing
   Tokens tomados de negocio/marca/identidad/tokens.css */

@font-face { font-family: "Funnel Display"; src: url("../fuentes/FunnelDisplay-VF.woff2") format("woff2"); font-weight: 300 800; font-display: swap; }
@font-face { font-family: "Funnel Sans"; src: url("../fuentes/FunnelSans-VF.woff2") format("woff2"); font-weight: 300 800; font-display: swap; }
@font-face { font-family: "Martian Mono"; src: url("../fuentes/MartianMono-VF.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --tramoya: #15161C;
  --estreno: #F7F4ED;
  --aurora: #1E6F5C;
  --aurora-clara: #6CCFAA;
  --foco: #F2B230;
  --n300: #C6C7CB; --n400: #A3A5AC; --n500: #7E8189; --n600: #63666F; --n700: #4A4D57; --n800: #33363F; --n900: #23252D;

  --font-display: "Funnel Display", system-ui, sans-serif;
  --font-sans: "Funnel Sans", system-ui, sans-serif;
  --font-mono: "Martian Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --gutter: max(16px, env(safe-area-inset-left));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(120% 90% at 50% 40%, #1b1c23 0%, var(--tramoya) 60%, #0d0e12 100%) fixed var(--tramoya);
  color: var(--estreno);
  font: 400 18px/1.6 var(--font-sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* Lambrequín: el borde superior del telón */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: 22px; z-index: 3; pointer-events: none;
  background: radial-gradient(circle at 50% 0, var(--n900) 15px, transparent 16px) 0 0 / 40px 22px repeat-x;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.4));
}

/* ── Capas fijas ───────────────────────────────────────── */
.escenario { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.elenco-delante .escenario { z-index: 2; }

.barra {
  position: fixed; z-index: 4; inset: 0 0 auto;
  display: flex; justify-content: flex-end; align-items: center;
  padding: calc(28px + env(safe-area-inset-top)) var(--gutter) 0;
  pointer-events: none;
}
.barra > * { pointer-events: auto; }

.boton {
  display: inline-block; font: 600 17px/1 var(--font-sans); text-decoration: none;
  color: var(--tramoya); background: var(--estreno); padding: 16px 24px; border-radius: 999px;
  transition: transform .3s var(--ease), background .3s;
}
.boton:hover { background: var(--aurora-clara); transform: translateY(-2px); }
.boton:focus-visible { outline: 2px solid var(--foco); outline-offset: 3px; }
.boton--chico { font-size: 14px; padding: 10px 16px; background: transparent; color: var(--estreno); box-shadow: inset 0 0 0 1px var(--n700); }
.boton--chico:hover { background: var(--estreno); color: var(--tramoya); }

/* Indicador de actos, como el de los reels */
.actos {
  position: fixed; z-index: 4; right: calc(var(--gutter) - 4px); top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.actos__num { font: 500 11px/1 var(--font-mono); color: var(--n400); writing-mode: vertical-rl; letter-spacing: .1em; }
.actos ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.actos button {
  display: block; width: 6px; height: 6px; padding: 0; border: 0; border-radius: 3px; cursor: pointer;
  background: var(--n700); transition: height .4s var(--ease), background .4s;
}
.actos button[aria-current="true"] { height: 26px; background: var(--estreno); }
.actos button:focus-visible { outline: 2px solid var(--foco); outline-offset: 3px; }

/* ── Escenas con snap vertical ─────────────────────────── */
.escenas {
  position: relative; z-index: 1;
  height: 100vh; height: 100svh;
  overflow-y: auto; overscroll-behavior: contain;
  scroll-snap-type: y mandatory; scrollbar-width: none;
}
.escenas::-webkit-scrollbar { display: none; }

.escena {
  position: relative; height: 100vh; height: 100svh;
  scroll-snap-align: start; scroll-snap-stop: always;
  display: grid; align-content: center;
  padding: 96px calc(var(--gutter) + 28px) 64px var(--gutter);
  overflow: hidden;
}
@media (min-width: 900px) {
  .escena { grid-template-columns: minmax(0, 520px) 1fr; column-gap: 6vw; padding-left: 8vw; padding-right: 8vw; align-items: center; }
}

.etiqueta { font: 500 12px/1.4 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--aurora-clara); margin: 0 0 16px; }
h2 { font: 700 clamp(32px, 4.6vw, 57px)/1.05 var(--font-display); letter-spacing: -.015em; margin: 0 0 20px; text-wrap: balance; }
/* Una palabra destacada por título: aurora clara; el problema queda apagado y el foco solo ilumina a «usted» */
.texto h2 em { font-style: normal; color: var(--aurora-clara); }
.texto h2 em.apagado { color: var(--n600); }
.texto h2 em.foco { color: var(--foco); }
.js h2 em.foco { color: var(--estreno); transition: color 1.2s var(--ease) .9s; }
.js .activa h2 em.foco { color: var(--foco); }
.texto p { margin: 0 0 1em; max-width: 46ch; color: #d9d7d1; font-size: clamp(16px, 1.5vw, 19px); }
.texto em { color: var(--estreno); }
.texto .etiqueta { color: var(--aurora-clara); }

/* Entrada de cada escena */
.js .escena:not(.escena--telon) .texto > * {
  opacity: 0; transform: translateY(24px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.js .escena.activa .texto > * { opacity: 1; transform: none; }
.js .escena.activa .texto > :nth-child(2) { transition-delay: .1s; }
.js .escena.activa .texto > :nth-child(3) { transition-delay: .2s; }
.js .escena.activa .texto > :nth-child(4) { transition-delay: .3s; }

/* Texto solo para lectores de pantalla y buscadores */
.solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Anclas: dónde y de qué tamaño se para cada fulanito en cada escena (data-rol, data-estado) */
.ancla { position: absolute; pointer-events: none; }

/* 1 · Telón */
.escena--telon { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 96px var(--gutter) 64px; }
.logo { margin: 0; width: min(86vw, 880px); line-height: 0; position: relative; z-index: 1; }
.logo img { width: 100%; height: auto; }
.entrada { font: 400 clamp(18px, 2vw, 24px)/1.4 var(--font-sans); margin: 28px 0 0; color: #d9d7d1; max-width: 30ch; }
.desliza { position: absolute; bottom: calc(28px + env(safe-area-inset-bottom)); left: 0; right: 0; margin: 0;
  font: 500 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--n400); }
.desliza span { display: inline-block; animation: bota 1.8s var(--ease) infinite; }
@keyframes bota { 50% { transform: translateY(5px); } }
.ancla--telon { left: 12%; right: 12%; bottom: 50%; height: min(30vh, 52vw); }
/* El director, sentado al frente (el ancla marca el asiento) */
.ancla--director { left: calc(var(--gutter) + 9vw); bottom: calc(10% + 4svh); width: 10px; height: 26svh; }
@media (max-width: 899px) { .ancla--director { left: calc(var(--gutter) + 46px); bottom: calc(7% + 2.4svh); height: 16svh; } }
/* Lo que grita el director: globo de cómic, ladeado y con rebote */
.llamado {
  position: absolute; left: 0; top: 0; margin: 0; z-index: 3; pointer-events: none; white-space: nowrap;
  padding: .5em .85em .55em; border-radius: 22px 22px 22px 8px; background: var(--estreno); color: var(--tramoya);
  border: 3px solid var(--tramoya); box-shadow: 0 0 0 2px var(--estreno), 5px 6px 0 2px rgba(0,0,0,.45);
  font: 800 clamp(15px, 1.6vw, 21px)/1.1 var(--font-display); letter-spacing: -.01em;
  opacity: 0; transform-origin: 0 100%; scale: .4; rotate: -8deg;
  transition: opacity .2s var(--ease), scale .45s cubic-bezier(.3, 1.8, .5, 1), rotate .45s cubic-bezier(.3, 1.8, .5, 1);
}
/* Cola del globo, apuntando a la cabeza del director */
.llamado::before, .llamado::after { content: ""; position: absolute; left: 10px; border-style: solid; border-color: transparent; }
.llamado::before { bottom: -17px; border-width: 15px 0 0 17px; border-top-color: var(--tramoya); }
.llamado::after { bottom: -10px; left: 13px; border-width: 10px 0 0 11px; border-top-color: var(--estreno); }
.llamado.visible { opacity: 1; scale: 1; rotate: -3deg; }

/* 2 · Problema */
.diapos { position: relative; height: 260px; display: none; }
.diapo {
  position: absolute; width: 240px; aspect-ratio: 16/10; padding: 16px; border-radius: 6px;
  background: var(--n300); color: var(--n700); display: flex; flex-direction: column; gap: 9px;
  box-shadow: 0 20px 40px rgba(0,0,0,.45); transform-origin: 50% 100%;
}
.diapo b { font: 700 13px/1 var(--font-sans); }
.diapo i { display: block; height: 6px; border-radius: 3px; background: var(--n400); width: 86%; }
.diapo i::before { content: "•"; margin-left: -12px; color: var(--n500); font-size: 10px; line-height: 6px; }
.diapo i:nth-child(odd) { width: 70%; }
.diapo:nth-child(1) { left: 0; top: 40px; transform: rotate(-9deg); }
.diapo:nth-child(2) { left: 50px; top: 20px; transform: rotate(4deg); }
.diapo:nth-child(3) { left: 110px; top: 60px; transform: rotate(-2deg); }
.escena--problema.activa .diapo { animation: cae 6s var(--ease) infinite; }
.escena--problema.activa .diapo:nth-child(2) { animation-delay: 2s; }
.escena--problema.activa .diapo:nth-child(3) { animation-delay: 4s; }
@keyframes cae { 0%, 60% { opacity: 1; } 80% { opacity: .15; translate: 0 30px; rotate: 8deg; } 100% { opacity: 1; translate: 0; rotate: 0deg; } }
.ancla--problema { right: 14%; bottom: 14%; width: 10px; height: 24vh; }
@media (min-width: 900px) {
  .diapos { display: block; justify-self: start; width: 360px; }
  .ancla--problema { right: 14%; bottom: 16%; height: 34vh; }
}

/* 3 y 6 · Pantalla vertical (simula un reel) */
.movil { margin: 0; justify-self: end; position: relative; }
.movil__pantalla {
  position: relative; overflow: hidden;
  height: min(46svh, 560px); aspect-ratio: 9/16; border-radius: 22px;
  background: var(--n800); box-shadow: 0 0 0 6px var(--n900), 0 30px 60px rgba(0,0,0,.5);
}
@media (min-width: 900px) { .movil__pantalla { height: min(72svh, 620px); } }
.movil video { width: 100%; height: 100%; object-fit: cover; display: block; }
.experta { width: 100%; height: 100%; display: block; }
.ancla--oficio { left: calc(var(--gutter) + 40px); bottom: 8%; width: 10px; height: 22vh; }
@media (min-width: 900px) {
  .ancla--oficio { left: auto; right: calc(8vw + min(72svh, 620px) * 9 / 16 + 130px); bottom: 14%; height: min(26vh, 17vw); }
}
/* Quiénes somos: todo el staff en fila (al frente del teléfono en móvil) */
.ancla--fila { left: var(--gutter); right: var(--gutter); bottom: 3%; height: 13svh; }
@media (min-width: 900px) { .ancla--fila { left: 8vw; right: auto; width: min(560px, 40vw); bottom: 10%; height: 22svh; } }

/* Animación de muestra: grabado → editado (ciclo de 9 s) */
.escena--oficio .movil__pantalla > * { animation-duration: 9s; animation-iteration-count: infinite; animation-timing-function: var(--ease); animation-play-state: paused; }
.escena--oficio.activa .movil__pantalla > * { animation-play-state: running; }
.escena--oficio .experta { animation-name: color; }
@keyframes color { 0%, 15% { filter: grayscale(1) brightness(.75); } 25%, 92% { filter: none; } 100% { filter: grayscale(1) brightness(.75); } }
.rotulo {
  position: absolute; left: 8%; top: 52%; display: grid; padding: 6px 10px 7px; border-left: 3px solid var(--foco);
  background: rgba(21,22,28,.85); animation-name: entraIzq;
}
.rotulo b { font: 700 13px/1.2 var(--font-display); }
.rotulo span { font: 500 9px/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .04em; color: var(--aurora-clara); }
@keyframes entraIzq { 0%, 25% { opacity: 0; transform: translateX(-20px); } 32%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.grafica {
  position: absolute; right: 8%; top: 8%; width: 34%; height: 18%; padding: 8px; border-radius: 8px;
  display: flex; align-items: flex-end; gap: 4px; background: rgba(247,244,237,.92); animation-name: aparece;
}
.grafica i { flex: 1; background: var(--aurora); height: calc(var(--h) * 100%); border-radius: 2px; transform-origin: bottom; }
.grafica i:last-child { background: var(--foco); }
@keyframes aparece { 0%, 45% { opacity: 0; transform: scale(.85); } 52%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.subtitulo {
  position: absolute; left: 6%; right: 6%; bottom: 9%; margin: 0; text-align: center;
  font: 800 clamp(14px, 1.6vw, 19px)/1.15 var(--font-display); text-transform: uppercase; color: var(--estreno);
  text-shadow: 0 2px 8px rgba(0,0,0,.6); animation: none !important;
}
.subtitulo span { opacity: 0; animation-duration: 9s; animation-iteration-count: infinite; animation-play-state: paused; }
.escena--oficio.activa .subtitulo span { animation-play-state: running; }
.subtitulo span:nth-child(8), .subtitulo span:nth-child(9) { color: var(--foco); }
.subtitulo span:nth-child(1) { animation-name: p1; } .subtitulo span:nth-child(2) { animation-name: p2; }
.subtitulo span:nth-child(3) { animation-name: p3; } .subtitulo span:nth-child(4) { animation-name: p4; }
.subtitulo span:nth-child(5) { animation-name: p5; } .subtitulo span:nth-child(6) { animation-name: p6; }
.subtitulo span:nth-child(7) { animation-name: p7; } .subtitulo span:nth-child(8) { animation-name: p8; }
.subtitulo span:nth-child(9) { animation-name: p9; }
@keyframes p1 { 0%, 20% { opacity: 0 } 21%, 92% { opacity: 1 } 93%, 100% { opacity: 0 } }
@keyframes p2 { 0%, 24% { opacity: 0 } 25%, 92% { opacity: 1 } 93%, 100% { opacity: 0 } }
@keyframes p3 { 0%, 29% { opacity: 0 } 30%, 92% { opacity: 1 } 93%, 100% { opacity: 0 } }
@keyframes p4 { 0%, 32% { opacity: 0 } 33%, 92% { opacity: 1 } 93%, 100% { opacity: 0 } }
@keyframes p5 { 0%, 35% { opacity: 0 } 36%, 92% { opacity: 1 } 93%, 100% { opacity: 0 } }
@keyframes p6 { 0%, 39% { opacity: 0 } 40%, 92% { opacity: 1 } 93%, 100% { opacity: 0 } }
@keyframes p7 { 0%, 48% { opacity: 0 } 49%, 92% { opacity: 1 } 93%, 100% { opacity: 0 } }
@keyframes p8 { 0%, 52% { opacity: 0 } 53%, 92% { opacity: 1 } 93%, 100% { opacity: 0 } }
@keyframes p9 { 0%, 56% { opacity: 0 } 57%, 92% { opacity: 1 } 93%, 100% { opacity: 0 } }
.movil__estado {
  position: absolute; top: 12px; left: 12px; font: 500 9px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
  animation: none !important;
}
.movil__estado em { font-style: normal; padding: 4px 6px; border-radius: 4px; position: absolute; white-space: nowrap; animation: 9s infinite paused; }
.movil__estado em:first-child { background: var(--n700); animation-name: est1; }
.movil__estado em:last-child { background: var(--aurora); opacity: 0; animation-name: est2; }
.escena--oficio.activa .movil__estado em { animation-play-state: running; }
@keyframes est1 { 0%, 18% { opacity: 1 } 22%, 96% { opacity: 0 } 100% { opacity: 1 } }
@keyframes est2 { 0%, 18% { opacity: 0 } 22%, 92% { opacity: 1 } 96%, 100% { opacity: 0 } }

/* 6 · Video pendiente */
.pendiente { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center;
  background: repeating-linear-gradient(-45deg, var(--n800) 0 14px, #2d3038 14px 28px); }
.pendiente p { margin: 0; font: 500 12px/1.5 var(--font-mono); text-transform: uppercase; letter-spacing: .04em; color: var(--n300); }
.pendiente small { color: var(--n400); }
.pendiente__play { width: 64px; height: 64px; border-radius: 50%; background: var(--estreno); position: relative; }
.pendiente__play::after { content: ""; position: absolute; left: 26px; top: 20px; border: 12px solid transparent; border-left: 18px solid var(--tramoya); border-right: 0; }

/* 4 · Coma */
.coma-grande { position: relative; justify-self: center; align-self: end; width: min(30vw, 13svh, 200px); margin-bottom: 1svh; }
.coma-grande svg { width: 100%; height: auto; display: block; fill: var(--aurora-clara); overflow: visible; }
/* El ejemplo: la misma frase, antes y después de la coma */
.texto .ejemplo { display: grid; gap: .3em; font: 700 clamp(21px, 2.3vw, 30px)/1.15 var(--font-display); letter-spacing: -.01em; color: var(--n500); margin-bottom: .8em; }
.ejemplo > span:last-child { color: var(--estreno); }
.ejemplo .coma-cae { color: var(--aurora-clara); display: inline-block; }
/* La coma cae en su lugar y la frase cambia de sentido */
@media (prefers-reduced-motion: no-preference) {
  .js .coma-cae { width: 0; opacity: 0; transform: translateY(-1.3em) rotate(-35deg); }
  .js .activa .coma-cae { animation: caeComa .8s 1.2s cubic-bezier(.3, 1.5, .5, 1) forwards; }
  @keyframes caeComa { 40% { width: .3em; } to { width: .3em; opacity: 1; transform: none; } }
}
.ancla--coma { left: 20%; right: 20%; bottom: 99%; height: min(22vh, 16svh); }
@media (min-width: 900px) {
  .coma-grande { width: min(20vw, 280px); align-self: center; margin: 22vh 0 0; }
  .ancla--coma { height: 34vh; height: 34svh; }
}

/* 5 · Promesa */
.tres { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.tres li { display: grid; grid-template-columns: 14px 1fr; gap: 14px; align-items: baseline; font-size: clamp(16px, 1.5vw, 19px); color: #d9d7d1; }
.tres i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.ancla--promesa { left: 50%; bottom: 7%; width: 10px; height: 20vh; }
@media (min-width: 900px) { .ancla--promesa { left: 70%; bottom: 16%; height: 34vh; } }

/* 7 · Usted */
.escena--usted { display: flex; justify-content: center; text-align: center; padding-left: var(--gutter); }
.texto--centro { display: flex; flex-direction: column; align-items: center; }
.texto--centro p { margin-inline: auto; }
.enorme { font: 800 clamp(44px, 8vw, 104px)/.98 var(--font-display); letter-spacing: -.02em; }
.ancla--usted { left: 112%; bottom: 10%; width: 10px; height: 30vh; }

/* Escritorio: en algunas escenas el texto va a la izquierda y lo visual a la derecha */
@media (max-width: 899px) {
  .escena--oficio, .escena--video { grid-template-rows: auto 1fr; align-content: start; gap: 20px; padding-top: 88px; }
  .escena--oficio .texto p:last-child, .escena--video .texto p:last-child { display: none; }
  .escena--oficio .movil, .escena--video .movil { align-self: end; }
  .escena--coma, .escena--promesa { align-content: start; padding-top: 88px; }
  .escena--coma { grid-template-rows: auto 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .escena .texto > * { opacity: 1; transform: none; }
  .subtitulo span, .rotulo, .grafica { opacity: 1; }
}

.captura *, .captura *::before, .captura *::after { transition: none !important; }

@media (max-width: 899px) {
  .actos__num { display: none; }
  .actos { right: 8px; }
  .logo { width: min(80vw, 880px); }
}

/* Espacio sobre el logo para que asomen el títere y su cruz de mando */
.logo { margin-top: calc(min(86vw, 880px) * .226 * 1.1); }
.etiqueta--pie { margin: 20px 0 0; max-width: 34ch; }
@media (max-width: 899px) { .logo { margin-top: calc(80vw * .226 * 2.2); } }
html:not(.js) .actos { display: none; }
