/* ==========================================================================
   Base: tipografias, tokens, reset y todo lo que comparten las seis paginas.
   Lo especifico de cada pagina vive en home.css y pages.css.
   ========================================================================== */

/* -- Tipografias autoalojadas ---------------------------------------------
   Manrope es variable: un unico archivo cubre los pesos 400 a 800.
   Se declaran los dos subconjuntos latinos y el navegador descarga solo el
   que necesite segun los caracteres de la pagina.
   ------------------------------------------------------------------------- */

@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('../fonts/manrope-400800-latin.woff2') format('woff2');
    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;
}

@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('../fonts/manrope-400800-latin-ext.woff2') format('woff2');
    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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'DM Mono';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('../fonts/dmmono-300-latin.woff2') format('woff2');
    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;
}

@font-face {
    font-family: 'DM Mono';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('../fonts/dmmono-300-latin-ext.woff2') format('woff2');
    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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'DM Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/dmmono-400-latin.woff2') format('woff2');
    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;
}

@font-face {
    font-family: 'DM Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/dmmono-400-latin-ext.woff2') format('woff2');
    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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'DM Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/dmmono-500-latin.woff2') format('woff2');
    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;
}

@font-face {
    font-family: 'DM Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/dmmono-500-latin-ext.woff2') format('woff2');
    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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* -- Tokens ---------------------------------------------------------------- */

:root {
    color-scheme: dark;

    --bg: #050609;
    --surface: #0b0d12;
    --surface-2: #10131a;
    --line: rgba(255, 255, 255, 0.1);
    --line-bright: rgba(255, 255, 255, 0.18);

    --text: #f3f5f7;
    --muted: #969daa;

    --blue: #4169ff;
    --cyan: #53e7ff;
    --violet: #8b5cf6;
    /* Verde de terminal. Reservado para estado y seguridad: disponibilidad,
       etapas en curso y todo lo que tenga que ver con proteger un sistema. */
    --green: #54f0ae;

    --mono: 'DM Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
    --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* -- Reset y elementos base ------------------------------------------------ */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--blue);
    color: #fff;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    color: inherit;
    font: inherit;
}

img {
    display: block;
    max-width: 100%;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 28px;
    font-size: clamp(42px, 5.3vw, 82px);
    line-height: 0.98;
    letter-spacing: -0.065em;
    font-weight: 600;
    /* Reparte las lineas en vez de dejar una palabra suelta al final. */
    text-wrap: balance;
}

/* El degradado del titular se aplica con <em>, no con una clase, porque
   acompana siempre a una parte del texto dentro del encabezado. */
h1 em,
h2 em {
    font-style: normal;
    color: transparent;
    background: linear-gradient(100deg, #7291ff, #a372ff 52%, #55e8ff);
    background-clip: text;
    -webkit-background-clip: text;
}

/* El diseno no definia foco visible. Es requisito, asi que se fija aqui una
   vez para todo el sitio. */
:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

/* -- Salto al contenido ---------------------------------------------------- */

.skip-link {
    position: absolute;
    left: 50%;
    top: 0;
    z-index: 200;
    padding: 13px 22px;
    transform: translate(-50%, -130%);
    background: #3355e0;
    color: #fff;
    font: 500 11px var(--mono);
    letter-spacing: 0.03em;
    transition: transform 0.2s;
}

.skip-link:focus {
    transform: translate(-50%, 0);
}

/* Oculta a la vista sin quitarlo del arbol de accesibilidad: para textos que
   solo necesitan los lectores de pantalla y para el campo trampa antispam. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* -- Armazon --------------------------------------------------------------- */

.site-shell {
    min-height: 100vh;
    /* clip y no hidden: recorta igual lo que se sale, pero no convierte la
       caja en contenedor de scroll, y asi position: sticky sigue funcionando
       dentro (lo usa el lienzo 3D de Mi historia). */
    overflow: clip;
    background:
        radial-gradient(circle at 50% 10%, rgba(45, 61, 126, 0.08), transparent 28%),
        var(--bg);
}

.noise {
    position: fixed;
    inset: 0;
    z-index: 20;
    opacity: 0.035;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

/* -- Intro de carga --------------------------------------------------------
   Se muestra una vez por sesion. El JS la retira a los 2,1 s; la animacion
   termina en visibility:hidden para que, si el JS nunca llega a ejecutarse,
   deje de cubrir la pagina por si sola en lugar de interceptar los clics.
   ------------------------------------------------------------------------- */

.intro-seen .loader {
    display: none;
}

.loader {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #020305;
    animation: loader-out 0.6s ease 1.9s both;
}

.loader-grid {
    position: absolute;
    inset: 0;
    opacity: 0.13;
    background-image:
        linear-gradient(rgba(81, 132, 255, 0.25) 1px, transparent 1px),
        linear-gradient(90deg, rgba(81, 132, 255, 0.25) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(circle, black, transparent 65%);
}

.loader-visual {
    position: relative;
    width: 210px;
    height: 210px;
    display: grid;
    place-items: center;
}

/* Escudo: el contorno se traza, la linea de escaneo lo recorre y al final
   aparece la marca de verificado. */
.loader-shield {
    width: 96px;
    height: 112px;
    overflow: visible;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 22px rgba(76, 97, 255, 0.6));
}

.shield-outline {
    stroke: var(--blue);
    stroke-dasharray: 400;
    animation: shield-draw 1.1s ease both;
}

.shield-check {
    stroke: var(--green);
    stroke-dasharray: 60;
    animation: shield-draw 0.45s ease 1.25s both;
}

.loader-scan {
    position: absolute;
    left: 50%;
    width: 132px;
    height: 2px;
    margin-left: -66px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    box-shadow: 0 0 16px var(--cyan);
    animation: shield-scan 1.25s ease-in-out both;
}

.loader-orbit {
    position: absolute;
    inset: 12px;
    border: 1px dashed rgba(88, 135, 255, 0.3);
    border-radius: 50%;
    animation: spin 6s linear infinite;
}

.loader-orbit i {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 18px var(--cyan);
}

@keyframes shield-draw {
    from {
        stroke-dashoffset: 400;
    }
}

@keyframes shield-scan {
    0% {
        top: 22%;
        opacity: 0;
    }

    15%,
    85% {
        opacity: 1;
    }

    100% {
        top: 78%;
        opacity: 0;
    }
}

.loader-copy {
    position: absolute;
    top: calc(50% + 140px);
    text-align: center;
}

.loader-copy span {
    font: 400 9px var(--mono);
    letter-spacing: 0.25em;
    color: var(--cyan);
}

.loader-copy strong {
    display: block;
    margin-top: 10px;
    font-size: 14px;
    letter-spacing: 0.02em;
}

.loader-bar {
    width: 260px;
    height: 1px;
    margin-top: 24px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.12);
}

.loader-bar i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    animation: load 1.8s ease both;
}

.loader-skip {
    position: absolute;
    right: 30px;
    bottom: 24px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: 400 10px var(--mono);
    cursor: pointer;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes load {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes loader-out {
    to {
        opacity: 0;
        transform: scale(1.04);
        visibility: hidden;
    }
}

/* Mismo cargador cuando un cambio de pagina tarda. Va despues de .intro-seen
   para ganarle con la misma especificidad. */
.loader.is-navigating {
    display: grid;
    animation: loader-in 0.25s ease both;
}

.loader.is-navigating .loader-bar i,
.loader.is-navigating .loader-scan {
    animation-iteration-count: infinite;
}

/* Entre paginas no se sabe cuanto falta: el escaneo va y vuelve sin parar. */
.loader.is-navigating .loader-scan {
    animation-direction: alternate;
}

.loader.is-navigating .loader-skip {
    display: none;
}

@keyframes loader-in {
    from {
        opacity: 0;
    }
}

/* -- Cabecera -------------------------------------------------------------- */

.nav-shell {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: 78px;
    padding: 0 clamp(24px, 5vw, 80px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: rgba(5, 6, 9, 0.72);
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: -0.01em;
}

.brand > span {
    width: 37px;
    height: 37px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(112, 143, 255, 0.5);
    background: linear-gradient(145deg, rgba(77, 107, 255, 0.28), rgba(128, 72, 255, 0.1));
    font: 500 12px var(--mono);
}

/* Logo subido: llena el cuadro de la marca, sin su degradado ni su borde. */
.brand > .brand-logo {
    overflow: hidden;
    border: 0;
    background: none;
}

.brand-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font: 400 8px var(--mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    color: #aab0ba;
    font: 500 11px var(--mono);
}

.nav-links > a:not(.nav-cta) {
    transition: color 0.2s;
}

.nav-links > a:not(.nav-cta):hover,
.nav-links > a.active:not(.nav-cta) {
    color: #fff;
}

.nav-links > a.active:not(.nav-cta)::after {
    content: "";
    display: block;
    height: 1px;
    margin-top: 5px;
    background: var(--blue);
}

.nav-cta {
    height: 40px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    border: 1px solid var(--line-bright);
    background: rgba(255, 255, 255, 0.04);
    transition: 0.3s;
}

.nav-cta:hover {
    background: #fff;
    color: #050609;
}

.menu-button {
    display: none;
    padding: 8px;
    border: 0;
    background: transparent;
}

/* -- Botones y enlaces de accion ------------------------------------------- */

.button {
    min-height: 52px;
    padding: 0 22px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 17px;
    border: 1px solid;
    font: 500 11px var(--mono);
    letter-spacing: 0.03em;
    transition: 0.3s;
}

.button.primary {
    color: #fff;
    border-color: #5976ff;
    background: linear-gradient(135deg, #3e5de6, #6842d3);
    box-shadow: 0 10px 40px rgba(66, 74, 226, 0.2);
}

.button.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 50px rgba(66, 74, 226, 0.4);
}

.button.secondary {
    border-color: var(--line-bright);
    background: rgba(255, 255, 255, 0.025);
}

.button.secondary:hover {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.07);
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line-bright);
    font: 400 10px var(--mono);
}

/* -- Piezas de seccion compartidas ----------------------------------------- */

.section {
    padding: 130px clamp(24px, 8vw, 140px);
}

.section-index {
    /* Subido desde el #697181 del diseno: a 9px no llegaba a 4,5:1. */
    color: #767f90;
    font: 400 9px var(--mono);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.section-heading {
    margin-bottom: 80px;
    display: grid;
    grid-template-columns: 1.1fr 0.6fr;
    gap: 80px;
    align-items: end;
}

.section-heading h2 {
    margin: 20px 0 0;
    font-size: clamp(35px, 4.3vw, 68px);
    line-height: 1.06;
    letter-spacing: -0.055em;
    font-weight: 600;
}

.section-heading > p {
    max-width: 480px;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    color: #aeb5c1;
    font: 400 10px var(--mono);
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.eyebrow i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 16px var(--green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    50% {
        opacity: 0.4;
        transform: scale(0.75);
    }
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tag-row span {
    padding: 6px 9px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    color: #9ca4b2;
    font: 400 8px var(--mono);
}

/* Los valores aparecen en la portada y en Proyectos, por eso viven aqui. */
.value-grid {
    grid-column: 1 / -1;
    margin-top: 45px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.value-card {
    min-height: 210px;
    padding: 28px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    transition: 0.35s;
}

.value-card:hover {
    background: rgba(66, 92, 214, 0.07);
}

.value-card > span {
    color: var(--blue);
    font: 400 9px var(--mono);
}

.value-card h3 {
    margin: 50px 0 10px;
    font-size: 18px;
}

.value-card p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

/* -- Lienzo 3D -------------------------------------------------------------
   Va detras de la cabecera de cada pagina. Nace invisible y solo aparece
   cuando js/hero-3d.js ha dibujado el primer fotograma: si el 3D no llega a
   cargarse no queda ningun hueco negro. Como se coloca la escena dentro de
   cada cabecera lo decide home.css (portada) o pages.css (resto).
   ------------------------------------------------------------------------- */

.hero-stage {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0;
    transition: opacity 1.4s ease;
    pointer-events: none;
}

.hero-stage.is-ready {
    opacity: 1;
}

.hero-stage canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* -- Aviso de entrada -------------------------------------------------------
   Barra discreta abajo, por encima del contenido pero sin taparlo entero. Se
   cierra con un boton y no vuelve.
   ------------------------------------------------------------------------- */

.site-notice {
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 90;
    max-width: 760px;
    margin: 0 auto;
    padding: 16px 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px 20px;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--line-bright);
    border-radius: 12px;
    background: rgba(9, 11, 16, 0.96);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.site-notice[hidden] {
    display: none;
}

.site-notice p {
    flex: 1 1 320px;
    margin: 0;
    color: #c6ccd6;
    font-size: 13px;
    line-height: 1.6;
}

.site-notice a {
    color: var(--cyan);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.site-notice-close {
    min-height: 44px;
}

/* Los dos enlaces legales del pie, juntos. */
.footer-legal {
    display: flex;
    gap: 16px;
}

/* -- Cambio de pagina ------------------------------------------------------
   Fundido entre una pagina y la siguiente en vez del corte seco de una
   recarga. Lo hace el navegador y no necesita JavaScript; donde no existe,
   la navegacion es la de siempre. La cabecera lleva nombre propio para que
   se quede quieta mientras cambia el contenido.
   ------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
    @view-transition {
        navigation: auto;
    }

    .nav-shell {
        view-transition-name: cabecera;
    }
}

/* -- Aparicion al hacer scroll --------------------------------------------
   Condicionado a .js: sin JavaScript no hay nada que anada .is-visible, asi
   que el contenido debe verse desde el principio.
   ------------------------------------------------------------------------- */

.js .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* -- Pie ------------------------------------------------------------------- */

.global-footer {
    padding: 70px clamp(24px, 8vw, 140px) 25px;
    position: relative;
    z-index: 2;
    border-top: 1px solid var(--line);
    background:
        radial-gradient(ellipse 65% 130% at 50% 0%, rgba(65, 105, 255, 0.06), transparent 68%),
        #050609;
}

/* Linea de acento con los cuatro colores de la marca. El pie es identico en
   las siete paginas, asi que un solo cambio aqui las alcanza todas. */
.global-footer::before {
    content: "";
    position: absolute;
    top: -1px;
    right: 0;
    left: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        var(--blue) 18%,
        var(--violet) 41%,
        var(--cyan) 64%,
        var(--green) 85%,
        transparent);
    opacity: 0.8;
}

.footer-main {
    padding-bottom: 60px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.footer-links {
    display: flex;
    gap: 100px;
}

.footer-links > div {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links strong {
    margin-bottom: 8px;
    color: #737b89;
    font: 400 8px var(--mono);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.footer-links a {
    color: #b6bcc5;
    font-size: 11px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    padding-top: 23px;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--line);
}

/* Puerta al acceso privado: casi transparente, pero con area tactil completa y
   visible en cuanto recibe el foco o el raton. */
.private-door {
    padding: 14px 16px;
    display: inline-grid;
    min-width: 44px;
    min-height: 44px;
    opacity: 0.12;
    place-items: center;
    transition: opacity 0.3s;
    vertical-align: middle;
}

.private-door:hover,
.private-door:focus-visible {
    opacity: 1;
}

.footer-bottom p,
.footer-bottom a {
    margin: 0;
    /* Subido desde el #686f7a del diseno: a 8px no llegaba a 4,5:1. */
    color: #747c8a;
    font: 400 8px var(--mono);
    letter-spacing: 0.06em;
}

/* -- Tablet y movil -------------------------------------------------------- */

@media (max-width: 980px) {
    .nav-links {
        position: fixed;
        top: 78px;
        left: 0;
        right: 0;
        padding: 30px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 22px;
        border-bottom: 1px solid var(--line);
        /* Opaco a proposito: con la transparencia del diseno original los
           titulares grandes se leian a traves del menu abierto. */
        background: #060709;
    }

    .nav-links.open {
        display: flex;
    }

    /* En el menu desplegado cada enlace es una fila entera de 44px: es donde
       se navega con el dedo. El hueco entre filas lo da ya la altura. */
    .nav-links {
        gap: 0;
    }

    .nav-links a:not(.nav-cta) {
        display: flex;
        align-items: center;
        min-height: 44px;
    }

    .nav-links .nav-cta {
        margin-top: 14px;
    }

    .menu-button {
        display: block;
    }

    .section-heading {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .value-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .nav-shell {
        height: 68px;
        padding: 0 18px;
    }

    .nav-links {
        top: 68px;
    }

    .brand {
        font-size: 11px;
    }

    .brand > span {
        width: 33px;
        height: 33px;
    }

    h1 {
        font-size: 43px;
    }

    .section {
        padding: 90px 22px;
    }

    .section-heading {
        margin-bottom: 55px;
    }

    .value-grid {
        grid-template-columns: 1fr;
    }

    .value-card {
        min-height: 170px;
    }

    .value-card h3 {
        margin-top: 32px;
    }

    .global-footer {
        padding: 60px 22px 25px;
    }

    .footer-main {
        flex-direction: column;
        gap: 45px;
    }

    .footer-links {
        width: 100%;
        gap: 50px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 12px;
    }
}

/* -- Movimiento reducido --------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .js .reveal {
        opacity: 1;
        transform: none;
    }
}

/* -- Pantallas tactiles -----------------------------------------------------
   Los enlaces de texto del pie y los de "seguir leyendo" miden lo que su
   letra, que con el dedo es poco. En tactil ganan 44px de alto; con raton se
   quedan como estan, que es donde el diseno compacto tiene sentido.
   ------------------------------------------------------------------------- */

@media (pointer: coarse) {
    .footer-links > div {
        gap: 0;
    }

    .footer-links a,
    .footer-bottom > a,
    .text-link {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }
}
