/* ==========================================================================
   Portada del portal — campo de piezas 3D orbitando el título.

   Es el mismo motor que la portada de raver.com.py: un campo de cuerpos con
   física de líquido fingida, dibujado con Three.js. El título no es HTML sobre
   el canvas: se dibuja dentro de la escena, así las piezas pasan por delante y
   por detrás de verdad, y el fluido se espesa al pasar el mouse por encima.

   El <h1> del marcado existe igual, pero solo para los lectores de pantalla y
   los buscadores: se oculta a la vista.
   ========================================================================== */

.raver-hero {
    position: relative;
    width: 100%;
    /* Alto de pantalla menos el encabezado pegajoso del portal. La variable la
       publica el propio encabezado; el valor de reserva cubre el caso en que
       todavía no se midió. */
    height: calc(100svh - var(--raver-header-h, 68px));
    min-height: 420px;
    overflow: hidden;
    background: #000;
}

/* En pantallas bajas y apaisadas (un portátil chico, un celular acostado) el
   100svh deja el hero más alto que ancho y el texto se come todo el aire. */
@media (max-height: 560px) {
    .raver-hero {
        height: 420px;
    }
}

.raver-hero-lienzo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    /* El canvas no intercepta: el script escucha en el documento, y así los
       enlaces del encabezado siguen siendo clicables por encima. */
    pointer-events: none;
}

/* El título va dentro de la escena 3D. Este bloque queda en el DOM por dos
   motivos: el script mide su rectángulo para saber por dónde no pasar, y es el
   encabezado real de la página para quien no ve el canvas. */
.raver-hero-texto {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.raver-hero-texto h1 {
    /* Invisible pero medible: con display:none el script no podría leer su
       tamaño y las piezas atravesarían el título. */
    margin: 0;
    font-family: 'Syne', sans-serif;
    font-size: clamp(34px, 8vw, 92px);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: 0.5px;
    text-align: center;
    color: transparent;
    user-select: none;
}

.raver-hero-texto .raver-hero-sub {
    margin: 14px 0 0;
    font-size: clamp(11px, 1.4vw, 15px);
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    color: transparent;
    user-select: none;
}

/* Sin WebGL o con movimiento reducido no hay escena, así que el título tiene
   que verse. La clase la pone el propio script cuando no puede montar. */
.raver-hero.raver-hero-sin-3d .raver-hero-texto h1 {
    color: var(--tinta-texto-fuerte);
}

.raver-hero.raver-hero-sin-3d .raver-hero-texto .raver-hero-sub {
    color: var(--tinta-suave);
}

@media (prefers-reduced-motion: reduce) {
    .raver-hero-texto .raver-hero-sub {
        color: var(--tinta-suave);
    }
}

.raver-hero.raver-hero-sin-3d {
    height: auto;
    min-height: 0;
    padding: 90px 20px;
}

.raver-hero.raver-hero-sin-3d .raver-hero-texto {
    position: static;
}

@media (prefers-reduced-motion: reduce) {
    .raver-hero-texto h1 {
        color: var(--tinta-texto-fuerte);
    }
}

/* ==========================================================================
   Panel de ajuste del movimiento (?raverdebug=1, sólo administradores).

   Va con la paleta del portal pero deliberadamente sobrio: es una herramienta,
   no parte del sitio. Se dibuja por encima de todo porque el hero ocupa la
   pantalla entera.
   ========================================================================== */

.raver-hero-debug {
    position: fixed;
    top: 84px;
    right: 14px;
    z-index: 100000;
    width: 292px;
    max-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
    background: rgb(var(--tinta-fondo-rgb) / 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--tinta-borde-fuerte);
    border-radius: 6px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
    font-family: var(--raver-fuente, -apple-system, sans-serif);
    font-size: 11px;
    color: var(--tinta-texto-3);
}

.raver-hero-debug .rhd-cab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--tinta-borde);
    color: var(--tinta-texto-fuerte);
    letter-spacing: 0.5px;
}

.raver-hero-debug .rhd-plegar {
    background: var(--tinta-sup);
    border: 1px solid var(--tinta-borde-fuerte);
    color: var(--tinta-texto-3);
    width: 24px;
    height: 22px;
    border-radius: 3px;
    cursor: pointer;
    line-height: 1;
}

.raver-hero-debug .rhd-cuerpo {
    padding: 10px 12px 12px;
    overflow-y: auto;
}

.raver-hero-debug.rhd-plegado .rhd-cuerpo {
    display: none;
}

.raver-hero-debug .rhd-grupo {
    margin: 12px 0 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--tinta-acento-claro);
}

.raver-hero-debug .rhd-grupo:first-child {
    margin-top: 0;
}

.raver-hero-debug .rhd-fila {
    display: grid;
    grid-template-columns: 84px 1fr 56px;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px;
    cursor: help;
}

.raver-hero-debug .rhd-nom {
    font-size: 10px;
    color: var(--tinta-suave);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.raver-hero-debug input[type="range"] {
    width: 100%;
    accent-color: var(--tinta-acento);
    margin: 0;
}

.raver-hero-debug .rhd-num {
    width: 100%;
    background: var(--tinta-sup);
    border: 1px solid var(--tinta-borde-fuerte);
    color: var(--tinta-texto);
    border-radius: 5px;
    padding: 3px 5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 10px;
}

.raver-hero-debug .rhd-nota {
    margin: 10px 0 0;
    font-size: 9.5px;
    color: var(--tinta-apagado);
}

.raver-hero-debug .rhd-pie {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}

.raver-hero-debug .rhd-pie button {
    flex: 1;
    padding: 7px 4px;
    border-radius: 3px;
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
    background: var(--tinta-sup);
    border: 1px solid var(--tinta-borde-fuerte);
    color: var(--tinta-texto);
}

.raver-hero-debug .rhd-guardar {
    background: linear-gradient(135deg, var(--tinta-acento) 0%, var(--tinta-acento) 100%) !important;
    border-color: transparent !important;
    color: var(--tinta-sobre-acento) !important;
}

.raver-hero-debug .rhd-pie button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.raver-hero-debug .rhd-estado {
    margin: 9px 0 0;
    min-height: 13px;
    font-size: 10px;
    line-height: 1.4;
    color: var(--tinta-suave);
}

.raver-hero-debug .rhd-estado.rhd-error {
    color: var(--tinta-mal);
}

/* En celular el panel taparía el hero entero: se apoya abajo y se pliega. */
@media (max-width: 700px) {
    .raver-hero-debug {
        top: auto;
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-height: 50vh;
    }
}
