/*
 * Base de toda la interfaz: fuente, colores, unidad de medida y reglas comunes.
 *
 * Todas las medidas salen del reel (1080 x 1920). La unidad --u vale "un píxel del
 * video", así calc(72 * var(--u)) es "72 px del video" sea cual sea la pantalla.
 */

/* Montserrat variable, servida desde el proyecto (licencia OFL en fuentes/). */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fuentes/montserrat-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fuentes/montserrat-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Valor de arranque; vista/escena.js lo vuelve a fijar en px apenas carga. */
  --u: min(calc(100vw / 1080), calc(100vh / 1920));

  --fondo: #0b0e11;
  --fondo-tarjeta: #14181d;
  --cian: #3ddad7;
  --cian-oscuro: #1f8a8c;
  --cian-centro: #2ba9aa;
  --lima: #c4f534;
  --blanco: #f3f3ea;
  --gris-apagado: #23282d;
  --gris-texto: #8a9099;
  --borde: rgba(61, 218, 215, 0.45);
  --naranja: #ff8a3d;
  --rosa: #f0456b;
  --ambar: #ffb547;
  --tinta-lima: #10140a;

  --fuente: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --trazo-fino: max(1px, calc(1.5 * var(--u)));

  color-scheme: dark;
}

@supports (height: 100dvh) {
  :root {
    --u: min(calc(100vw / 1080), calc(100dvh / 1920));
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--fondo);
}

body {
  margin: 0;
  background: var(--fondo);
  color: var(--blanco);
  font-family: var(--fuente);
  font-weight: 700;
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* La interfaz y la pantalla de la clave no tienen scroll de página: la escena ocupa la ventana. */
html.fija,
html.fija body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

button,
input {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

/* Foco bien visible para quien usa teclado; con mouse o dedo no aparece. */
:focus {
  outline: none;
}

:focus-visible {
  outline: max(2px, calc(4 * var(--u))) solid var(--lima);
  outline-offset: max(2px, calc(5 * var(--u)));
}

.oculto-visual {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.icono {
  display: block;
  width: 100%;
  height: 100%;
}

.sin-script {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--fondo);
  color: var(--blanco);
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}
