@font-face {
  font-family: "Hanken Grotesk";
  src: url("/assets/fonts/HankenGrotesk-var-latin.woff2") format("woff2");
  font-weight: 200 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --fondo: #0c0e12;
  --texto: #e9f3ff;
  --suave: #8aa3bd;
  --azul: #31a8ff;
  --azul-claro: #7df4ff;
  --lado: clamp(16px, 4vw, 40px);
}

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

html { background: var(--fondo); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--fondo);
  color: var(--texto);
  font-family: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

/* Barra */
.barra {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) var(--lado) 18px;
  pointer-events: none;
}
.barra > * { pointer-events: auto; }
.marca {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 600; letter-spacing: -0.01em; font-size: 15px;
}
.marca b {
  font-weight: 700;
  color: #5cbcff;
}
.marca svg {
  width: 22px; height: 22px; fill: none; stroke: url(#azul);
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.pronto {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--suave);
  border: 1px solid rgba(127, 208, 255, .22); border-radius: 999px;
  padding: 7px 12px;
}

/* Escena fija */
.escena {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  overflow: hidden;
}
.halo {
  position: absolute; left: 50%; top: 42%;
  width: 120vmax; height: 120vmax; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(39, 137, 237, .16), rgba(39, 137, 237, .05) 45%, transparent 70%);
}
.pila {
  position: absolute; left: 50%; top: 42%;
  width: 0; height: 0;
}
.placa {
  position: absolute; left: 0; top: 0;
  will-change: transform, filter, opacity;
}
.placa svg { display: block; width: 100%; height: 100%; overflow: visible; }
.placa .cara { fill: rgba(100, 198, 255, .035); stroke: none; }
.placa .arriba, .placa .abajo {
  fill: none; stroke: url(#azul);
  stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.contador {
  position: absolute; left: calc(50% + var(--ancho-pila, 300px) / 2 + 36px); top: 42%;
  transform: translateY(-50%);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--suave); opacity: 0; white-space: nowrap;
}
.contador b { color: var(--azul-claro); font-weight: 400; }
.contador i { font-style: normal; }

.grano {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Escena 3D (si el navegador puede); la pila SVG queda de respaldo */
.lienzo3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tres .pila { display: none; }
.tres .halo { opacity: .55; }

/* Actos */
main { position: relative; z-index: 2; }
.acto {
  height: 100vh; height: 100svh;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 var(--lado) max(11vh, 72px);
  text-align: center;
}
.texto { will-change: filter, opacity, transform; }
h1, h2 { font-weight: 300; letter-spacing: -0.04em; line-height: .95; }
h1 { font-size: clamp(56px, 11vw, 148px); font-weight: 600; }
h1 b {
  font-weight: 700;
  background: linear-gradient(135deg, #7fd0ff 0%, #31a8ff 55%, #2789ed 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
h2 { font-size: clamp(36px, 6.4vw, 92px); }
.texto p {
  margin-top: 18px; font-size: clamp(16px, 1.6vw, 20px);
  color: var(--suave); letter-spacing: .01em;
}
.texto .pilares {
  margin-top: 14px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: clamp(11px, 1.25vw, 13px);
  letter-spacing: .28em;
  text-indent: .28em;
  text-transform: uppercase;
  color: var(--suave);
  opacity: .88;
}
.texto .pilares i {
  font-style: normal;
  color: var(--azul);
  padding: 0 .55em;
}

.desliza {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  width: 1px; height: 38px; overflow: hidden; background: rgba(127, 208, 255, .15);
}
.desliza span {
  position: absolute; left: 0; top: -40%; width: 1px; height: 40%;
  background: var(--azul-claro); animation: baja 2.2s cubic-bezier(.6, 0, .3, 1) infinite;
}
@keyframes baja { to { top: 110%; } }

.acto-final { position: relative; flex-direction: column; justify-content: flex-end; align-items: center; }
.acto-unico { position: relative; flex-direction: column; justify-content: flex-end; align-items: center; }
.acto-unico footer {
  position: absolute; left: 0; right: 0; bottom: max(20px, env(safe-area-inset-bottom));
  font-size: 12px; color: rgba(138, 163, 189, .6);
}
.firma { font-size: 15px !important; }
.firma a {
  color: var(--texto); text-decoration: none;
  border-bottom: 1px solid rgba(127, 208, 255, .45); padding-bottom: 2px;
  transition: border-color .3s, color .3s;
}
.firma a:hover { color: var(--azul-claro); border-color: var(--azul-claro); }
.acto-final footer {
  position: absolute; left: 0; right: 0; bottom: max(20px, env(safe-area-inset-bottom));
  font-size: 12px; color: rgba(138, 163, 189, .6);
}

@media (max-width: 699px) {
  .contador { left: 50%; top: 84px; transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .desliza span { animation: none; top: 30%; }
}
