/* Página completa: dos escenas fijas detrás (túnel y muro de código) y el contenido que pasa por delante. */
* { box-sizing: border-box; margin: 0; }
body { background: #06050f; color: #f4f2ff; font-family: "JetBrains Mono", ui-monospace, monospace; overflow-x: hidden; }
.bg { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#codigo { opacity: 0; }
main { position: relative; text-shadow: 0 0 18px #06050f, 0 0 6px #06050f, 0 0 2px #06050f; }
h2, h3, .mail, [data-logo] { font-family: "Unbounded", sans-serif; font-weight: 800; letter-spacing: -.035em; }
p { font-size: clamp(14px, 1.3vw, 18px); line-height: 1.65; max-width: 48ch; }
.kicker { font-size: 12px; letter-spacing: .24em; text-transform: uppercase; opacity: .7; }
section { min-height: 100vh; display: grid; place-content: center; gap: 28px; padding: 14vh clamp(16px, 7vw, 120px); }

/* Barra fija: el logo pequeño aparece al dejar la portada. */
.bar { position: fixed; inset: 0 0 auto 0; z-index: 3; display: flex; align-items: center; gap: 18px; padding: 18px clamp(16px, 3vw, 40px); font-size: 12px; letter-spacing: .14em; }
.bar [data-logo] { font-size: 21px; opacity: var(--brand, 0); margin-right: auto; }
.bar a, .bar button { color: inherit; text-decoration: none; opacity: .78; background: none; border: 0; font: inherit; letter-spacing: inherit; padding: 6px 2px; }
.bar a:hover, .bar button:hover, .bar :focus-visible { opacity: 1; text-decoration: underline; }
@media (max-width: 560px) { .bar .mailto { display: none; } }

/* Portada: se queda fija mientras la cámara se lanza; el logo viene hacia fuera al bajar. */
.hero-wrap { height: var(--hero, 100vh); }
.hero { position: sticky; top: 0; height: 100vh; min-height: 0; padding: 0 16px; justify-items: center; text-align: center; overflow: hidden; }
.hero-in { display: grid; justify-items: center; gap: clamp(20px, 4vh, 44px); will-change: transform, opacity; }
.hero [data-logo] { font-size: clamp(38px, 10.2vw, 184px); animation: hero-in 1.6s cubic-bezier(.2, .9, .2, 1) both .25s; }
.hero p { font-size: clamp(12px, 1.25vw, 17px); letter-spacing: .22em; text-transform: uppercase; opacity: .85; max-width: none; }
.hint { position: absolute; bottom: 26px; left: 50%; translate: -50%; font-size: 11px; letter-spacing: .3em; opacity: .55; animation: bob 2s ease-in-out infinite; }
@keyframes hero-in { from { opacity: 0; transform: scale(1.18); filter: blur(18px); } }
@keyframes bob { 50% { transform: translateY(7px); } }
.dive { height: var(--dive, 120vh); }                 /* tramo de scroll en el que el túnel se funde con el código */

/* Los cuatro verbos. */
.verbs { gap: clamp(36px, 7vh, 80px); }
.verbs article { display: grid; gap: 10px; }
.verbs h2 { font-size: clamp(34px, 7.4vw, 124px); line-height: .95; }
.verbs h2 em { font-style: normal; color: var(--c); transition: color .6s; }
html[lang="es"] .verbs h2 { color: var(--c); transition: color .6s; } /* en español el verbo es la palabra entera */

/* Las cinco líneas: el tramo es alto y la escena se queda fija; el scroll elige la línea. */
.stage-wrap { height: 520vh; }
.stage { position: sticky; top: 0; height: 100vh; min-height: 0; padding: 0; }
.panel { position: absolute; inset: 0; display: grid; place-content: center start; gap: 16px; padding: 12vh clamp(16px, 9vw, 160px);
         opacity: 0; transform: translateY(46px) scale(.96); transition: opacity .45s, transform .6s cubic-bezier(.2, 1.2, .3, 1); pointer-events: none; }
.panel.on { opacity: 1; transform: none; pointer-events: auto; }
/* Un fondo oscuro y difuso detrás del texto: el túnel sigue alrededor, pero no cruza las letras. */
.panel::before { content: ""; position: absolute; inset: 8% 30% 8% 0; z-index: -1; background: radial-gradient(closest-side, #06050fd9 30%, #06050f99 60%, transparent); }
@media (max-width: 800px) { .panel::before { inset: 8% 0; } }
.panel h2 { font-size: clamp(72px, 19vw, 320px); line-height: .82; color: var(--pc); text-shadow: 0 0 .25em color-mix(in srgb, var(--pc) 55%, transparent), 0 0 12px #06050f; }
.panel h3 { font-size: clamp(19px, 2.7vw, 42px); line-height: 1.1; max-width: 22ch; }

/* Contacto. */
.contact { justify-items: start; }
.contact h2 { font-size: clamp(30px, 6vw, 96px); line-height: 1; max-width: 14ch; }
.mail { font-size: clamp(22px, 5.4vw, 88px); color: var(--c); text-decoration: none; transition: color .6s; }
.mail:hover, .mail:focus-visible { text-decoration: underline; }
footer { padding: 28px clamp(16px, 3vw, 40px); font-size: 11px; letter-spacing: .14em; opacity: .55; position: relative; }

/* Cursor: mira de corchetes sobre el túnel, bloque de terminal sobre el código. base.js lo mueve. */
@media (pointer: fine) { body, a, button { cursor: none; } }
@media (pointer: coarse) { .cursor { display: none; } }
.cursor { position: fixed; left: 0; top: 0; z-index: 5; pointer-events: none; opacity: 0; transition: opacity .3s; will-change: transform; }
.cursor.on { opacity: 1; }
.cursor > * { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); transition: opacity .3s; }
body[data-scene="tunel"] .caret, body[data-scene="codigo"] .reticle { opacity: 0; }
.reticle { display: flex; align-items: center; gap: 16px; transition: gap .25s cubic-bezier(.3, 1.6, .4, 1), opacity .3s; }
.reticle svg { width: 13px; height: 32px; overflow: visible; fill: none; stroke: var(--c, #fff); stroke-width: 13; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 5px var(--c, #fff)); transition: stroke .5s; }
.reticle svg:last-child { transform: scaleX(-1); }
.reticle path { transition: d .6s cubic-bezier(.6, -.35, .25, 1.45); }
.reticle i { width: 4px; height: 4px; border-radius: 50%; background: #fff; }
.cursor.hot .reticle { gap: 5px; }
.cursor.down .reticle { gap: 1px; }
.caret { width: 10px; height: 21px; background: var(--c, #fff); box-shadow: 0 0 14px var(--c, #fff); animation: blink 1s steps(2, jump-none) infinite; }
.cursor.hot .caret { width: 22px; height: 4px; margin-top: 12px; }
@keyframes blink { 50% { opacity: .25; } }

@media (prefers-reduced-motion: reduce) { .hero .logo, .hint, .caret { animation: none !important; } .panel { transition: none; } }
