/* ════════════════════════════════════════════════════
   base.css — variables globales, reset, componentes
   Referente visual: gestualfabeto (src/estilos.css) — look
   "tecla de teclado mecánico": JetBrains Mono, paleta gris
   cálida neutra (sin color de marca), esquinas chicas
   redondeadas (3px), botones con sombra doble + hundido al
   presionar. Siempre en modo oscuro (caleidociclero no
   necesita el selector claro/oscuro de gestualfabeto).
════════════════════════════════════════════════════ */
:root {
  --fuente: 'JetBrains Mono', 'Courier New', monospace;

  /* Colores — derivados del CIAN DEL LOGO (#47b1c6 = H 190°, S 53%, L 53%).
     Los grises son ese mismo matiz muy desaturado (S 11–20%) y oscurecido,
     así que todo el gris del sitio "vibra" con el logo en vez de tirar a
     marrón. El acento es el cian tal cual, sin tocar. */
  --bg:      #0e1415;   /* H190 S20 L7  */
  --bg2:     #151c1e;   /* H190 S18 L10 */
  /* El color exacto con que renderer.js limpia el lienzo WebGL
     (renderer.setClearColor). No es una variable de la paleta: es una
     constante de sincronía con ese archivo, para que la barra de ayudas del
     visor pueda igualarlo sin duplicar el número a mano. Si el clear color
     cambia allá, cambia acá. */
  --bg-visor: #060b15;
  --bg3:     #202a2c;   /* H190 S16 L15 — hover */
  --tecla:   #2b383b;   /* H190 S15 L20 — fondo de botones/tarjetas */
  --texto:          #dce3e5;  /* H190 S14 L88 */
  --texto-brillante: #fff;
  --texto-tenue:    #809499;  /* H190 S11 L55 */
  --borde:          #38484c;  /* H190 S15 L26 */
  --acento:         #47b1c6;  /* el cian del logo, sin desaturar */
  --acento-2:       #6fd2e4;  /* cian más claro, para detalles secundarios */
  --acento-texto:   #0b1619;
  --peligro:        #d4614a;
  --glow:           none;
  --acento-tenue:   rgba(71, 177, 198, .13);

  /* Botones/cajas — look "tecla física" */
  --radio-sm: 3px;
  --radio:    4px;
  --radio-lg: 6px;
  --alto-btn: 28px;
  --sombra-btn:      0 3px 0 #141412, 0 4px 10px rgba(0,0,0,.25);
  --sombra-btn-pres: 0 1px 0 #141412, 0 1px 4px rgba(0,0,0,.20);
  --trans: .11s ease;

  --gap-s: clamp(8px, 2vw, 12px);
  --gap-m: clamp(14px, 3vw, 22px);
  --gap-l: clamp(24px, 5vw, 44px);

  color-scheme: only dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--texto);
  font-family: var(--fuente);
  font-size: .875rem;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select { font-family: inherit; }

/* ── Botones (".tecla" de gestualfabeto, mismas clases que ya usa
   caleidociclero: .tp-boton) ────────────────────────────────── */
.tp-boton {
  font-family: inherit;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--texto);
  background: var(--tecla);
  border: 1px solid var(--borde);
  border-radius: var(--radio-sm);
  padding: 0 .9rem;
  height: var(--alto-btn);
  box-shadow: var(--sombra-btn);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35em;
  transition: box-shadow var(--trans), transform var(--trans),
              background var(--trans), color var(--trans), opacity var(--trans);
}
.tp-boton:hover { background: var(--bg3); }
.tp-boton:active { box-shadow: var(--sombra-btn-pres); transform: translateY(2px); }
.tp-boton--primario { background: var(--acento); color: var(--acento-texto); border-color: var(--acento); }
.tp-boton--primario:hover { opacity: .86; }
.tp-boton--fantasma { background: transparent; border-color: transparent; color: var(--texto-tenue); box-shadow: none; }
.tp-boton--fantasma:hover { color: var(--texto); background: var(--bg3); }
.tp-boton--bloqueado, .tp-boton:disabled { opacity: .3; cursor: default; pointer-events: none; }

/* ── Interruptor de píldora ───────────────────────────────────── */
.tp-sw {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--texto-tenue);
  transition: color .18s;
}
.tp-sw__track {
  position: relative;
  width: 30px; height: 15px;
  border-radius: 999px;
  background: var(--tecla);
  border: 1px solid var(--borde);
  transition: background .2s ease, border-color .2s ease;
  flex-shrink: 0;
}
.tp-sw__knob {
  position: absolute;
  top: 1px; left: 1px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--texto-tenue);
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), background .2s ease;
}
.tp-sw.is-on { color: var(--texto-brillante); }
.tp-sw.is-on .tp-sw__track { background: var(--bg3); border-color: var(--acento); }
.tp-sw.is-on .tp-sw__knob { transform: translateX(15px); background: var(--acento); }
.tp-sw:focus-visible { outline: 1px solid var(--acento); outline-offset: 3px; }
