/* Dark style shared by the landing and the generator: Ballarin Consulting
   palette, self-hosted fonts, Utopia-style fluid type and space between
   320 and 1240 px viewports, mobile first. Header and footer included. */

@font-face {
    font-family: "Open Sans";
    src: url("../fonts/open-sans-latin-var.dcf31ebe1074.woff2") format("woff2");
    font-weight: 300 800;
    font-display: swap;
}

@font-face {
    font-family: "JetBrains Mono";
    src: url("../fonts/jetbrains-mono-latin-var.b636a65da4f0.woff2") format("woff2");
    font-weight: 100 800;
    font-display: swap;
}

:root {
    --fondo: #0B0E12;
    --fondo-cabecera: rgb(11 14 18 / .8);
    --superficie: #1C1F23;
    --superficie-2: #14171B;
    --texto: #F3F1EC;
    --texto-suave: #9D9D9C;
    --borde: #414346;
    --acento: #F39200;
    --ok: #6FBF73;
    --sobre-acento: #0B0E12;

    --step--2: clamp(0.6944rem, 0.6856rem + 0.0444vi, 0.7200rem);
    --step--1: clamp(0.8333rem, 0.8101rem + 0.1159vi, 0.9000rem);
    --step-0: clamp(1.0000rem, 0.9565rem + 0.2174vi, 1.1250rem);
    --step-1: clamp(1.2000rem, 1.1283rem + 0.3587vi, 1.4062rem);

    --space-3xs: clamp(0.2500rem, 0.2391rem + 0.0543vi, 0.2812rem);
    --space-2xs: clamp(0.5000rem, 0.4783rem + 0.1087vi, 0.5625rem);
    --space-xs: clamp(0.7500rem, 0.7174rem + 0.1630vi, 0.8438rem);
    --space-s: clamp(1.0000rem, 0.9565rem + 0.2174vi, 1.1250rem);
    --space-m: clamp(1.5000rem, 1.4348rem + 0.3261vi, 1.6875rem);
    --space-l: clamp(2.0000rem, 1.9130rem + 0.4348vi, 2.2500rem);
    --space-xl: clamp(3.0000rem, 2.8696rem + 0.6522vi, 3.3750rem);
    --space-s-l: clamp(1.0000rem, 0.5652rem + 2.1739vi, 2.2500rem);
    --space-m-xl: clamp(1.5000rem, 0.8478rem + 3.2609vi, 3.3750rem);
    --space-l-2xl: clamp(2.0000rem, 1.1304rem + 4.3478vi, 4.5000rem);

    --ancho: 90rem;
    --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

/* Nothing scrolls sideways: the header band (and the landing's tilted
   example) reach past the content width on purpose */
html { overflow-x: clip; }

body.oscura {
    margin: 0;
    min-height: 100vh;
    background: var(--fondo);
    color: var(--texto);
    font-family: "Open Sans", system-ui, sans-serif;
    font-size: var(--step-0);
    overflow-x: clip;
    /* native controls (lists, scrollbars) also dark */
    color-scheme: dark;
}

/* The generator uses the whole width: two columns need the room */
body.ancho-completo { --ancho: 100%; }

.contenedor {
    width: min(100% - 2 * var(--space-s-l), var(--ancho));
    margin-inline: auto;
}

/* Header: stays visible while scrolling */
.cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-s);
    padding-block: var(--space-s);
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Its slightly see-through background spans the full viewport width */
.cabecera::before {
    content: "";
    position: absolute;
    inset: 0 -100vmax;
    z-index: -1;
    border-bottom: 1px solid var(--borde);
    background: var(--fondo-cabecera);
    backdrop-filter: blur(8px);
}

.marca {
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    color: var(--texto);
    font-weight: 700;
    letter-spacing: .02em;
    text-decoration: none;
}

/* The app icon (same envelope as the favicon), in the accent colour */
.marca-icono {
    flex: none;
    width: calc(1.9 * var(--step--1));
    height: auto;
    stroke: var(--acento);
}

.idiomas { display: flex; gap: var(--space-3xs); }

.idiomas button {
    padding: var(--space-3xs) var(--space-2xs);
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--texto-suave);
    font: inherit;
    font-size: var(--step--1);
    cursor: pointer;
}

.idiomas button:hover { color: var(--texto); }
.idiomas button[aria-current] { background: var(--superficie); color: var(--texto); }

/* Footer */
.pie {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-s);
    padding-block: var(--space-m);
    border-top: 1px solid var(--borde);
    color: var(--texto-suave);
    font-size: var(--step--1);
}

.pie a { color: var(--texto-suave); }

/* With only the credit (the generator), centred */
.pie:has(> :only-child) { justify-content: center; }
