/* Cultural Capital Group · capa de movimiento v2
   Intro de visor, cursor de enfoque, hero vivo y animaciones de scroll.
   Todo se desactiva con prefers-reduced-motion. */

:root { --intro: 2.3s; }
.skip-intro { --intro: 0s; }

/* ---------- Intro: el visor enfoca "ccg" y el obturador se abre ---------- */
.intro {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: var(--ccg-blanco);
  pointer-events: none;
  animation: intro-out .7s cubic-bezier(.76,0,.24,1) calc(var(--intro) - .6s) forwards;
}
.no-js .intro, .skip-intro .intro { display: none; }
.intro-shutter {
  position: absolute; inset: 0; background: var(--ccg-azul);
  transform: translateY(100%);
  animation: shutter-in .55s cubic-bezier(.76,0,.24,1) calc(var(--intro) - 1s) forwards;
}
.intro-stage { position: relative; width: min(64vw, 340px); aspect-ratio: 1.68; display: grid; place-items: center; }
.intro-c {
  position: absolute; width: 18%; aspect-ratio: 1; border: 0 solid var(--ccg-azul);
  animation: corner-in .9s cubic-bezier(.16,1,.3,1) .1s both;
}
.intro-c:nth-child(1) { top: 0; left: 0;  border-width: 5px 0 0 5px; --fx: -50vw; --fy: -50vh; }
.intro-c:nth-child(2) { top: 0; right: 0; border-width: 5px 5px 0 0; --fx: 50vw;  --fy: -50vh; }
.intro-c:nth-child(3) { bottom: 0; left: 0;  border-width: 0 0 5px 5px; --fx: -50vw; --fy: 50vh; }
.intro-c:nth-child(4) { bottom: 0; right: 0; border-width: 0 5px 5px 0; --fx: 50vw;  --fy: 50vh; }
.intro-word {
  font-family: var(--mono); font-weight: 500; color: var(--ccg-azul);
  font-size: min(20vw, 108px); letter-spacing: -.02em; line-height: 1;
  display: flex; margin-top: -.08em;
}
.intro-word span { display: inline-block; opacity: 0; transform: translateY(40%); animation: letter-in .5s cubic-bezier(.16,1,.3,1) both; }
.intro-word span:nth-child(1) { animation-delay: .55s; }
.intro-word span:nth-child(2) { animation-delay: .65s; }
.intro-word span:nth-child(3) { animation-delay: .75s; }
.intro-cap {
  position: absolute; top: calc(100% + 26px); left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 13px; color: var(--ccg-gris); white-space: nowrap;
  overflow: hidden; width: 0; border-right: 1.5px solid var(--ccg-azul);
  animation: type 0.75s steps(34, end) .95s forwards, caret .5s steps(2, start) 4 .9s;
}
.intro-rec { position: absolute; top: 24px; left: 24px; font-family: var(--mono); font-size: 12px; color: var(--ccg-azul); display: flex; gap: 8px; align-items: center; opacity: 0; animation: fade .3s .3s forwards; }
.intro-rec::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ccg-azul); animation: blink 1s steps(2, start) infinite; }
.intro-tc { position: absolute; bottom: 24px; right: 24px; font-family: var(--mono); font-size: 12px; color: var(--ccg-gris); opacity: 0; animation: fade .3s .3s forwards; }
@keyframes corner-in { from { transform: translate(var(--fx), var(--fy)) scale(2.4); opacity: 0; } 30% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes letter-in { to { opacity: 1; transform: none; } }
@keyframes type { to { width: 34ch; } }
@keyframes caret { to { border-right-color: transparent; } }
@keyframes fade { to { opacity: 1; } }
@keyframes shutter-in { to { transform: none; } }
@keyframes intro-out { to { transform: translateY(-100%); visibility: hidden; } }
html.intro-lock body { overflow: hidden; }

/* ---------- Palabras que suben desde una máscara ---------- */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .12em; margin-bottom: -.12em; }
.w--free { overflow: visible; }
.wi { display: inline-block; transform: translateY(105%); transition: transform 1s cubic-bezier(.16,1,.3,1); transition-delay: calc(var(--i, 0) * 55ms + var(--d, 0ms)); }
.w--free .wi { transform: translateY(30%); opacity: 0; transition-property: transform, opacity; }
.split-in .wi { transform: none; opacity: 1; }

/* Hero: entrada orquestada tras la intro */
.hero h1 .wi { --d: 0ms; }
.hero .label, .hero .lead, .hero-cta > *, .hero-visual, .facts > div {
  opacity: 0; transform: translateY(24px);
  transition: opacity .9s cubic-bezier(.16,1,.3,1), transform .9s cubic-bezier(.16,1,.3,1);
}
.hero-visual.reveal { opacity: 0; } /* la gestiona la entrada del hero */
.is-ready .hero .label { opacity: 1; transform: none; transition-delay: 0s; }
.is-ready .hero .lead { opacity: 1; transform: none; transition-delay: .55s; }
.is-ready .hero-cta > *:nth-child(1) { opacity: 1; transform: none; transition-delay: .7s; }
.is-ready .hero-cta > *:nth-child(2) { opacity: 1; transform: none; transition-delay: .8s; }
.is-ready .hero-visual { opacity: 1; transform: none; transition-delay: .35s; transition-duration: 1.3s; }
.is-ready .facts > div { opacity: 1; transform: none; }
.is-ready .facts > div:nth-child(1) { transition-delay: .9s; }
.is-ready .facts > div:nth-child(2) { transition-delay: 1s; }
.is-ready .facts > div:nth-child(3) { transition-delay: 1.1s; }
.facts.reveal { opacity: 1; transform: none; }
.frame i { transition-delay: .9s; }

/* Retícula viva: un foco azul sigue al cursor (o deriva solo en móvil) */
.hero { --mx: 70%; --my: 30%; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(47,59,255,.38) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(47,59,255,.38) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle 260px at var(--mx) var(--my), #000 0%, transparent 70%);
          mask-image: radial-gradient(circle 260px at var(--mx) var(--my), #000 0%, transparent 70%);
  opacity: 0; transition: opacity .6s;
}
.is-ready .hero::after { opacity: 1; }
.hero.auto-drift::after { animation: drift 14s ease-in-out infinite alternate; }
@keyframes drift {
  0%   { -webkit-mask-position: 0 0; mask-position: 0 0; }
  100% { -webkit-mask-position: -40vw 30vh; mask-position: -40vw 30vh; }
}

/* Consola con inclinación 3D */
.hero-visual { perspective: 1200px; }
.console { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transform-style: preserve-3d; transition: transform .5s cubic-bezier(.16,1,.3,1); will-change: transform; }
.console::after { /* barrido de escaneo */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 80px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.10), transparent);
  animation: scan 4.5s linear infinite;
}
@keyframes scan { from { transform: translateY(-80px); } to { transform: translateY(560px); } }
.steps-mini li { transition: opacity .4s; }
.steps-mini li .ok { display: inline-block; transition: transform .4s cubic-bezier(.34,1.56,.64,1); }
.steps-mini li.done .ok { transform: scale(1); }
.steps-mini li.flash { animation: flash .6s; }
@keyframes flash { 0% { background: rgba(255,255,255,.22); } 100% { background: transparent; } }
.bar { display: none; }
.steps-mini li.now .bar { display: block; }
.bar::after { animation: none; transform: scaleX(var(--p, 0)); transition: transform .1s linear; }
.console.closed .rec::before { animation: none; }

/* ---------- Cursor de enfoque (solo escritorio) ---------- */
.has-cursor, .has-cursor a, .has-cursor button, .has-cursor label { cursor: none; }
.has-cursor input, .has-cursor textarea { cursor: text; }
.has-cursor input[type="checkbox"], .has-cursor input[type="radio"] { cursor: none; }
.cursor { position: fixed; left: 0; top: 0; z-index: 150; pointer-events: none; mix-blend-mode: normal; }
.cursor-dot { position: fixed; left: 0; top: 0; width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--ccg-azul); border-radius: 50%; z-index: 151; pointer-events: none; transition: opacity .2s, transform .2s; }
.cursor-frame { position: fixed; left: 0; top: 0; width: 34px; height: 34px; pointer-events: none; z-index: 150; transition: opacity .2s; }
.cursor-frame i { position: absolute; width: 9px; height: 9px; border: 0 solid var(--ccg-azul); transition: border-color .2s; }
.cursor-frame i:nth-child(1) { top: 0; left: 0; border-width: 2px 0 0 2px; }
.cursor-frame i:nth-child(2) { top: 0; right: 0; border-width: 2px 2px 0 0; }
.cursor-frame i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.cursor-frame i:nth-child(4) { bottom: 0; right: 0; border-width: 0 2px 2px 0; }
.cursor-tag { position: absolute; top: calc(100% + 6px); left: 0; font-family: var(--mono); font-size: 10px; color: var(--ccg-azul); white-space: nowrap; opacity: .8; }
.cursor.on-dark .cursor-frame i { border-color: #fff; }
.cursor.on-dark .cursor-tag { color: #fff; }
.cursor.on-dark ~ .cursor-dot, .cursor-dot.on-dark { background: #fff; }
.cursor.locked .cursor-tag { opacity: 0; }
.cursor.hide .cursor-frame, .cursor.hide ~ .cursor-dot { opacity: 0; }

/* ---------- Scroll ---------- */
.reveal { transform: translateY(40px); filter: blur(6px); transition: opacity 1s cubic-bezier(.16,1,.3,1), transform 1s cubic-bezier(.16,1,.3,1), filter 1s cubic-bezier(.16,1,.3,1); }
.reveal.in { filter: none; }

/* Proceso: línea de progreso y fase activa */
.steps { position: relative; }
.steps::before, .steps::after { content: ""; position: absolute; left: 8px; top: 0; width: 2px; }
.steps::before { bottom: 0; background: var(--linea); }
.steps::after { height: calc(var(--p, 0) * 100%); background: var(--ccg-azul); }
.step { padding-left: 32px; position: relative; }
.step::before { content: ""; position: absolute; left: 2px; top: 34px; width: 10px; height: 10px; background: var(--ccg-blanco); border: 2px solid var(--linea); z-index: 1; transition: background .3s, border-color .3s, transform .3s; }
.step.passed::before { border-color: var(--ccg-azul); background: var(--ccg-azul); }
.step.is-active::before { transform: scale(1.5); }
.step.is-active h3 { color: var(--ccg-azul); }
.step:hover { padding-left: 40px; }
.step h3 { transition: color .3s; }

/* Principios: la banda azul se abre como un obturador */
#principios { clip-path: inset(0 calc(var(--c, 0) * 1%) round calc(var(--c, 0) * 1px)); will-change: clip-path; }

/* Cinta: la mueve JS según la velocidad de scroll */
.ticker-track { animation: none; will-change: transform; }

/* Cifras y etiquetas que se descodifican */
.scramble { font-variant-numeric: tabular-nums; }

/* Botones magnéticos */
.btn { transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .35s cubic-bezier(.16,1,.3,1); }
.btn::before { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.18); transform: translateX(-101%); transition: transform .5s cubic-bezier(.16,1,.3,1); pointer-events: none; }
.btn { position: relative; overflow: hidden; }
.btn:hover::before { transform: translateX(101%); }

/* Cierre: lema gigante en movimiento */
.mega { overflow: hidden; background: var(--ccg-azul); color: #fff; padding: clamp(40px, 6vw, 80px) 0 0; border-bottom: 1px solid var(--linea-azul); }
.mega-track { display: flex; width: max-content; will-change: transform; }
.mega span { font-family: var(--sans); font-weight: 600; letter-spacing: -.05em; font-size: clamp(64px, 13vw, 210px); line-height: 1; white-space: nowrap; padding-right: .4em; }
.mega span b { font-weight: 600; color: transparent; -webkit-text-stroke: 1.5px #fff; }
.mega + .site-footer { padding-top: clamp(48px, 6vw, 80px); }

@media (prefers-reduced-motion: reduce) {
  .intro { display: none; }
  .wi, .hero .label, .hero .lead, .hero-cta > *, .hero-visual, .facts > div { opacity: 1 !important; transform: none !important; }
  #principios { clip-path: none; }
  .reveal { filter: none; }
}
@media (hover: none), (pointer: coarse) {
  .cursor, .cursor-dot { display: none; }
}
