/* Landing de BEEC by Hanka. HTML + CSS + JS sin dependencias: se sube tal cual a DreamHost. Paleta tomada del portal (apps/portal/src/styles.css). */
:root {
  --bg: #faf7f2; --soft: #f3eee6; --line: #e7dfd3; --ink: #111827; --muted: #4a5163;
  --side: #0f1722; --side-ink: #f3ede4; --accent: #9c5424; --glow: #e3a15f; --sand: #fce4cc;
  --radius: 18px; --gutter: clamp(16px, 5vw, 64px); --max: 1180px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2 { line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.3rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
em { font-style: italic; color: var(--accent); font-weight: inherit; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--glow); outline-offset: 3px; border-radius: 6px; }

/* Un solo idioma a la vez; lang lo fija el script del <head> antes de pintar. */
html[lang="es"] .en, html[lang="en"] .es { display: none !important; }

/* ---------- Pantalla de carga con información del producto (solo si tarda) ---------- */
.boot { position: fixed; inset: 0; z-index: 100; background: var(--side); color: var(--side-ink); display: grid; place-items: center; padding: 24px;
  opacity: 0; animation: bootIn .4s ease .7s forwards; transition: opacity .5s ease, visibility .5s; }
.boot.out { opacity: 0 !important; visibility: hidden; animation: none; }
html:not(.js) .boot { display: none; }
@keyframes bootIn { to { opacity: 1; } }
.boot-card { width: min(440px, 100%); }
.boot-card img { margin-bottom: 14px; }
.boot-name { font-size: 1.6rem; font-weight: 800; margin: 0 0 6px; letter-spacing: -0.01em; }
.boot-name span { font-size: .9rem; font-weight: 500; color: var(--glow); }
.boot-line { color: var(--side-ink); font-size: 1.15rem; margin-bottom: 16px; }
.boot-points { list-style: none; padding: 0; margin: 0 0 22px; color: #c9c2b8; }
.boot-points li { padding-left: 18px; position: relative; margin-bottom: 6px; }
.boot-points li::before { content: ""; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; border-radius: 50%; background: var(--glow); }
.boot-wait { color: #8d96a6; font-size: .9rem; margin: 12px 0 0; }
.skel-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; }
.skel, .shot { background: linear-gradient(100deg, #1b2636 30%, #26354a 50%, #1b2636 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
.skel { height: 12px; border-radius: 6px; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* ---------- Cabecera ---------- */
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 14px; border-radius: 8px; z-index: 120; }
.skip:focus { left: 8px; }
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; align-items: center; gap: 18px; padding: 12px var(--gutter);
  background: rgba(15, 23, 34, .92); color: var(--side-ink); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-name { font-weight: 800; letter-spacing: .01em; }
.brand-name b { color: var(--glow); }
.brand-name small { font-weight: 500; font-size: .75rem; opacity: .8; }
.top nav { display: flex; gap: 22px; margin-left: 12px; }
.top nav a { text-decoration: none; font-size: .95rem; opacity: .85; }
.top nav a:hover { opacity: 1; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.chip, .lang button { background: transparent; color: inherit; border: 1px solid rgba(243, 237, 228, .35); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .8rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--glow); color: #1a1208; border-color: var(--glow); }
.lang { display: flex; }
.lang button { border-radius: 0; padding: 6px 10px; }
.lang button:first-child { border-radius: 999px 0 0 999px; }
.lang button:last-child { border-radius: 0 999px 999px 0; border-left: 0; }
html[lang="es"] .lang [data-set-lang="es"], html[lang="en"] .lang [data-set-lang="en"] { background: var(--side-ink); color: var(--side); }

.cta, .ghost { display: inline-block; text-decoration: none; font-weight: 700; border-radius: 999px; padding: 14px 26px; transition: transform .2s, box-shadow .2s, background .2s; }
.cta { background: var(--accent); color: #fff; box-shadow: 0 6px 24px rgba(156, 84, 36, .35); }
.cta:hover { transform: translateY(-2px); background: #b2622c; }
.cta.small { padding: 8px 16px; font-size: .85rem; box-shadow: none; white-space: nowrap; }
.cta.big { padding: 18px 38px; font-size: 1.1rem; }
.ghost { border: 1.5px solid rgba(243, 237, 228, .5); color: var(--side-ink); }
.ghost:hover { background: rgba(243, 237, 228, .1); }

/* ---------- Capas con parallax (app.js mueve cada [data-speed]) ---------- */
.layer, [data-speed] { will-change: transform; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--accent); margin-bottom: 14px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 56ch; }

/* ---------- Hero ---------- */
/* Hero fijo (estilo "pista pegajosa"): .hero-track da el recorrido de scroll; app.js reparte el progreso 0→1 entre el canvas, los textos y la tablet. */
.hero-track { height: 200vh; background: var(--side); }
.hero { position: sticky; top: 0; height: 100svh; overflow: hidden; background: var(--side); color: var(--side-ink); display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 24px; padding: 90px var(--gutter) 50px; }
.hero .eyebrow { color: var(--glow); }
.hero .lead { color: #c9c2b8; }
.hero em { color: var(--glow); }
.bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 50% at 75% 40%, rgba(227, 161, 95, .22), transparent 70%); }
.hero-second { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; margin: 0; padding: 0 var(--gutter); text-align: center; font-size: clamp(2.6rem, 8vw, 7rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1; opacity: 0; pointer-events: none; text-shadow: 0 6px 40px rgba(15, 23, 34, .8); }
.hero-in, .hero-shot, .hero-second, .sc-device { will-change: transform, opacity; }
.dots { background-image: radial-gradient(circle, rgba(243, 237, 228, .5) 1.6px, transparent 2px); background-size: 34px 34px; }
.dots-a { opacity: .18; }
.dots-b { opacity: .12; background-size: 62px 62px; background-position: 17px 11px; }
.hero-in { position: relative; z-index: 2; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0; }
.scroll-hint { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: #8d96a6; margin-top: 34px; }
.hero-shot { position: relative; z-index: 2; margin: 0; }
.hero-shot img, .device img { border-radius: 14px; }

/* La captura es un “marco de tablet”; mientras la imagen carga se ve el esqueleto. */
.shot { position: relative; margin: 0; border-radius: 22px; border: 10px solid #0b1118; background-color: #1b2636; box-shadow: 0 30px 70px rgba(15, 23, 34, .35); aspect-ratio: 1400 / 1015; overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.js .shot img { opacity: 0; transition: opacity .6s ease; }
.js .shot.loaded { animation: none; }
.js .shot.loaded img { opacity: 1; }

/* ---------- Frase que se enciende palabra por palabra ---------- */
.statement-track { height: 170vh; background: var(--side); color: var(--side-ink); }
.statement-stage { position: sticky; top: 0; height: 100svh; display: grid; place-items: center; padding: 0 var(--gutter); }
.statement { max-width: 18ch; margin: 0; text-align: center; font-size: clamp(2.4rem, 7vw, 6rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.statement .w { opacity: .14; transition: opacity .25s linear, color .25s linear; }
.statement .w.on { opacity: 1; }
.statement .w.hot { color: var(--glow); }

/* ---------- Recorrido: tablet fija que cambia de pantalla ---------- */
.showcase { height: 400vh; background: var(--bg); }
.sc-stage { position: sticky; top: 0; height: 100svh; display: grid; grid-template-columns: .9fr 1.2fr; gap: clamp(24px, 5vw, 80px); align-items: center; max-width: var(--max); margin: 0 auto; padding: 90px var(--gutter) 40px; }
.sc-steps { position: relative; min-height: 15em; }
.sc-step { position: absolute; inset: 0 0 auto 0; opacity: 0; transform: translateY(24px); transition: opacity .45s ease, transform .45s ease; pointer-events: none; }
.sc-step.on { opacity: 1; transform: none; pointer-events: auto; }
.sc-step p { color: var(--muted); max-width: 40ch; }
.sc-device { position: relative; transform: scale(.82) perspective(1200px) rotateX(8deg); transform-origin: 50% 60%; }
.sc-device .sc-img { position: absolute; inset: 0; }
.js .sc-device.shot img.sc-img, .js .sc-device.shot.loaded img.sc-img { opacity: 0; transition: opacity .5s ease; }
.js .sc-device.shot img.sc-img.on { opacity: 1; }
html:not(.js) .sc-device .sc-img:first-child { opacity: 1; }
.sc-dots { display: flex; gap: 8px; margin-top: 18px; }

/* ---------- Cifras ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.stat { background: var(--bg); padding: 34px var(--gutter); display: flex; flex-direction: column; gap: 4px; }
.stat b { font-size: clamp(2.4rem, 5vw, 3.6rem); color: var(--accent); line-height: 1; letter-spacing: -0.03em; }
.stat span { color: var(--muted); font-size: .95rem; }

/* ---------- Escenas ---------- */
.scene { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(28px, 6vw, 90px); align-items: center; max-width: var(--max); margin: 0 auto; padding: clamp(64px, 11vw, 140px) var(--gutter); }
.scene.flip { grid-template-columns: 1.15fr 1fr; }
.scene.flip .copy { order: 2; }
.scene .copy { position: sticky; top: 110px; align-self: start; }
.scene p:not(.eyebrow) { color: var(--muted); max-width: 52ch; }
.scene .note { border-left: 3px solid var(--glow); padding-left: 14px; color: var(--ink); font-size: .95rem; }
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
html:not(.js) .reveal { opacity: 1; transform: none; }

/* ---------- Portal ---------- */
.portal { background: var(--soft); text-align: center; padding: clamp(70px, 11vw, 140px) var(--gutter); overflow: hidden; }
.portal .lead { margin-inline: auto; }
.portal-shots .shot { aspect-ratio: 2880 / 1736; } /* las capturas del portal son más anchas que las de la tablet: sin esto se recortan */
.portal-shots { max-width: var(--max); margin: 56px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(18px, 4vw, 48px); }

/* ---------- Preguntas ---------- */
.faq { max-width: 820px; margin: 0 auto; padding: clamp(64px, 10vw, 120px) var(--gutter); }
details { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; list-style: none; padding: 20px 36px 20px 0; font-weight: 700; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 16px; font-size: 1.5rem; color: var(--accent); transition: transform .25s; }
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--muted); padding-bottom: 8px; }

/* ---------- Cierre ---------- */
.closing { position: relative; overflow: hidden; background: var(--side); color: var(--side-ink); text-align: center; padding: clamp(80px, 12vw, 160px) var(--gutter); }
.closing > *:not(.layer) { position: relative; z-index: 2; }
.closing .layer { position: absolute; left: 0; right: 0; top: -30%; bottom: -30%; }
.closing em { color: var(--glow); }
.closing .lead { margin-inline: auto; color: #c9c2b8; }
.back { font-size: .9rem; opacity: .7; }
footer { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: center; padding: 22px var(--gutter); background: #0a1018; color: #8d96a6; font-size: .85rem; }

/* ---------- Móvil ---------- */
@media (max-width: 860px) {
  .top nav, .chip, .brand-name small { display: none; }
  .top { gap: 10px; }
  .hero { grid-template-columns: 1fr; padding-top: 96px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .scene, .scene.flip { grid-template-columns: 1fr; }
  .scene.flip .copy { order: 0; }
  .scene .copy { position: static; }
  .portal-shots { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .hero-track { height: 180vh; }
  .hero { grid-template-columns: 1fr; align-content: center; gap: 12px; padding-top: 84px; }
  .hero h1 { font-size: clamp(2rem, 9vw, 3rem); }
  .hero-shot { display: none; }
  .showcase { height: 360vh; }
  .sc-stage { grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: center; align-items: start; gap: 18px; padding-top: 84px; padding-bottom: 24px; }
  .scene, .scene.flip { padding-block: 44px; gap: 22px; }
  .lang button { padding: 10px 13px; }
  .cta.small { padding: 11px 15px; }
  .portal, .faq, .closing { padding-block: 64px; }
  .stat { padding: 24px var(--gutter); }
  .sc-steps { min-height: 11em; }
  .sc-step h2 { font-size: 1.6rem; }
  .sc-device { transform: scale(.95); }
}

/* Sin movimiento (sistema o botón «Pausar movimiento»): se quitan las pistas fijas y todo se lee de corrido. */
html.paused .hero-track, html.paused .statement-track, html.paused .showcase { height: auto; }
html.paused .hero, html.paused .statement-stage, html.paused .sc-stage { position: static; height: auto; min-height: 70svh; }
html.paused .hero { min-height: 100svh; }
html.paused .hero-second, html.paused .bg { display: none; }
html.paused .hero-in, html.paused .hero-shot { opacity: 1 !important; transform: none !important; }
html.paused .statement .w { opacity: 1 !important; }
html.paused .sc-steps { min-height: 0; display: grid; gap: 28px; }
html.paused .sc-step { position: static; opacity: 1; transform: none; }
html.paused .sc-device { transform: none; }
html.paused .sc-device img.sc-img { opacity: 0; }
html.paused .sc-device img.sc-img:first-child { opacity: 1 !important; }
html.paused .sc-stage { padding-block: 60px; }

/* Sin movimiento: el sistema lo pide o el visitante pulsa «Pausar movimiento». */
html.paused *, html.paused *::before, html.paused *::after { animation-play-state: paused !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
