/* Base: reset, tipografía, botones y estado de scroll.
   Los colores, fuentes y radios llegan como variables desde config/theme.json (js/modules/theme.js).
   Las variables "vivas" (--hero-in, --prompt-y, ...) las actualiza js/modules/overlay.js en cada frame (una regla por capa);
   aquí solo se declaran sus valores iniciales. */

:root {
  --track-vh: 900;

  --nav-in: 0;
  --hero-in: 0;
  --hero-out: 0;

  --prompt-o: 0;
  --prompt-ty: 16;
  --prompt-y: 42;

  --soon: 0;
  --ol: 0;
  --ol-zoom: 1;
  --ol-outside: 0;
  --ol-video-b: 0.6;
  --ol-fill: 1;
  --ol-brand: 0;
  --join: 0;
  --j1: 0; --j2: 0; --j3: 0; --j4: 0; --j5: 0; --j6: 0; --j7: 0;
}

*, *::before, *::after { box-sizing: border-box; }

/* Única excepción a "colores desde theme.json": negro de respaldo (var(--c-bg, black)) para el
   primer pintado, antes de que JS cargue el tema; evita un destello blanco. */
html {
  background: var(--c-bg, black);
  color: var(--c-fg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body { margin: 0; }

/* Sin barra de scroll visible: el canvas ocupa todo el ancho y todo queda centrado de verdad */
html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }

body {
  min-height: 100vh;
  background: var(--c-bg, black);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video, canvas { display: block; max-width: 100%; }
h1, h2, h3, p, ol, ul { margin: 0; padding: 0; font-weight: inherit; }
ol, ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }

::selection { background: var(--neon-soft); color: var(--c-fg); }
:focus-visible { outline: 2px solid var(--neon); outline-offset: 3px; border-radius: var(--r-button); }

/* Lenis (equivalente mínimo de lenis.css) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* Durante el intro no se puede hacer scroll */
html.is-locked, html.is-locked body { overflow: hidden; }

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  padding: 0 20px 0 22px;
  border: 1px solid transparent;
  border-radius: var(--r-button);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
  transition:
    background-color 320ms var(--ease-in-out),
    border-color 320ms var(--ease-in-out),
    color 320ms var(--ease-in-out),
    transform 320ms var(--ease-in-out),
    opacity 320ms var(--ease-in-out);
}
.btn svg { width: 14px; height: 14px; flex: none; }
.btn--sm { height: 40px; padding: 0 16px 0 18px; font-size: 14px; }
.btn--light { background: var(--c-button-bg); color: var(--c-button-fg); }
.btn--light:hover { transform: translateY(-1px); }
.btn--ghost { border-color: var(--c-fg-faint); color: var(--c-fg); }
.btn--ghost:hover { border-color: var(--c-fg-soft); }
.btn--glass {
  color: var(--c-fg);
  background: linear-gradient(180deg, var(--c-liquid-top), var(--c-liquid-bottom)), var(--c-liquid-tint);
  border-color: var(--c-liquid-border);
  box-shadow: inset 1px 1px 0 var(--c-liquid-highlight), inset -1px -1px 0 var(--c-liquid-lowlight), 0 8px 24px var(--c-liquid-shadow);
  -webkit-backdrop-filter: blur(6px) saturate(190%) brightness(1.08);
  backdrop-filter: blur(6px) saturate(190%) brightness(1.08);
}
.btn--glass:hover { border-color: var(--c-fg-soft); transform: translateY(-1px); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: progress; transform: none; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--c-fg-faint);
  border-radius: var(--r-tag);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-fg);
}

/* Vidrio líquido (estilo iOS 26).
   En el prompt y el formulario lo dibuja WebGL (refracción real de la escena, ver shaders/lib/glass.glsl):
   ahí el elemento queda transparente (.is-gl-glass) y solo aporta el texto. Esta versión CSS es el respaldo
   (otros navegadores, botones chicos): vidrio claro, poco desenfoque, mucha saturación, borde al 25 % y
   brillo especular arriba a la izquierda y abajo a la derecha. */
.liquid {
  position: relative;
  isolation: isolate;
  background: linear-gradient(180deg, var(--c-liquid-top), var(--c-liquid-bottom)), var(--c-liquid-tint);
  border: 1px solid var(--c-liquid-border);
  -webkit-backdrop-filter: blur(6px) saturate(190%) brightness(1.08);
  backdrop-filter: blur(6px) saturate(190%) brightness(1.08);
  box-shadow:
    inset 1px 1px 0 var(--c-liquid-highlight),
    inset -1px -1px 0 var(--c-liquid-lowlight),
    inset 0 0 14px var(--c-liquid-lowlight),
    0 12px 34px var(--c-liquid-shadow);
}
.liquid::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(120% 140% at 0% 0%, var(--c-liquid-sheen), transparent 45%),
    radial-gradient(120% 140% at 100% 100%, var(--c-liquid-lowlight), transparent 40%);
}
.liquid.is-gl-glass {
  background: none;
  border-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.liquid.is-gl-glass::before { display: none; }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
