/* ==========================================================================
   MAD.CEO · Sistema visual "Abismo"
   --------------------------------------------------------------------------
   Reglas de marca (manual MAD.CEO):
   - Tema único oscuro (el Abismo). No hay secciones claras.
   - Verde Eldritch = acción (botones primarios). Cian = interfaz
     (portal, foco, enlaces activos). Púrpura Arcano = solo atmósfera.
   - Radio de esquinas: 4px en botones, tarjetas y campos. Solo el botón
     flotante de WhatsApp es circular.
   - Playfair Display para titulares, Inter para lectura,
     JetBrains Mono para etiquetas de sistema.
   ========================================================================== */

/* ---------- Tipografías autoalojadas ---------- */
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url('../fonts/playfair-display-latin-wght-normal.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: 'Playfair Display';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url('../fonts/playfair-display-latin-ext-wght-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Playfair Display';
    font-style: italic;
    font-weight: 400 900;
    font-display: swap;
    src: url('../fonts/playfair-display-latin-wght-italic.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: 'Playfair Display';
    font-style: italic;
    font-weight: 400 900;
    font-display: swap;
    src: url('../fonts/playfair-display-latin-ext-wght-italic.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter-latin-wght-normal.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: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter-latin-ext-wght-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2');
}

/* ---------- Tokens de marca ---------- */
:root {
    /* Manual MAD.CEO */
    --bg-dark: #121212;            /* Fondo Oscuro / Abismo */
    --primary-green: #3A6351;      /* Verde Eldritch */
    --accent-cyan: #90E0EF;        /* Cian Eléctrico Interfaz */
    --purple-arcane: #4B3F72;      /* Púrpura Arcano */
    --text-light: #CACFD2;         /* Gris Piedra Neutro */
    --text-white: #F2F2EE;         /* Blanco Ceniza */

    /* Derivados para profundidad y contraste AA */
    --abyss-950: #0B0D0C;
    --abyss-900: var(--bg-dark);
    --abyss-850: #161817;
    --abyss-800: #1B1F1D;
    --abyss-750: #222725;
    --line: #262B29;
    --line-strong: #36423C;
    --eldritch: var(--primary-green);
    --eldritch-hover: #457862;
    --eldritch-deep: #1F3329;
    --eldritch-text: #7FB59A;      /* verde legible sobre fondo oscuro */
    --cyan: var(--accent-cyan);
    --cyan-dim: rgba(144, 224, 239, 0.35);
    --arcane: var(--purple-arcane);
    --text: var(--text-light);
    --text-strong: var(--text-white);
    --text-muted: #8E9599;

    --font-heading: 'Playfair Display', 'Iowan Old Style', Georgia, serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

    --radius: 4px;
    --header-h: 72px;
    --gutter: clamp(1rem, 4vw, 2.5rem);
    --section-y: clamp(5.5rem, 11vw, 10rem);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    /* Escala de capas */
    --z-canvas: 0;
    --z-content: 1;
    --z-float: 80;
    --z-menu: 90;
    --z-header: 100;
    --z-grain: 110;
    --z-skip: 120;

    color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 1rem);
    background-color: var(--bg-dark);
}

body {
    min-height: 100dvh;
    overflow-x: hidden;
    background-color: var(--bg-dark);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: rgba(144, 224, 239, 0.15);
    touch-action: manipulation;
}

body.menu-open { overflow: hidden; }
/* evita que animaciones fuera de pantalla ensanchen el viewport móvil (clip no rompe position: sticky) */
main { overflow-x: clip; }

img, svg, canvas { display: block; max-width: 100%; }
.icon { display: inline-block; flex-shrink: 0; width: 1.15em; height: 1.15em; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; }

h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    color: var(--text-strong);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.012em;
    text-wrap: balance;
}
h1 em, h2 em, h3 em, p em { font-style: italic; }
h1 em, h2 em { color: var(--eldritch-text); font-weight: 500; }
p { text-wrap: pretty; overflow-wrap: break-word; }

a {
    color: var(--cyan);
    text-decoration: none;
    transition: color 0.25s ease;
}
a:hover { color: var(--text-strong); }

:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
    border-radius: 2px;
}

::selection { background: var(--eldritch); color: var(--text-strong); }

[id] { scroll-margin-top: calc(var(--header-h) + 1.5rem); }

.container {
    width: 100%;
    max-width: 1320px;
    margin-inline: auto;
    padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

.skip-link {
    position: fixed;
    top: 0.75rem; left: 0.75rem;
    z-index: var(--z-skip);
    padding: 0.7rem 1rem;
    background: var(--cyan);
    color: var(--bg-dark);
    font-weight: 600;
    border-radius: var(--radius);
    transform: translateY(-160%);
    transition: transform 0.2s ease;
}
.skip-link:focus-visible { transform: translateY(0); color: var(--bg-dark); }

/* Grano analógico: fijo y sin eventos para no costar repintados al hacer scroll */
.grain {
    position: fixed;
    inset: 0;
    z-index: var(--z-grain);
    pointer-events: none;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Tipografía utilitaria ---------- */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--eldritch-text);
}

.section-title {
    font-size: clamp(2.1rem, 4.2vw, 3.6rem);
    max-width: 22ch;
}
.section-title.wide { max-width: 28ch; }

.lead {
    font-size: clamp(1.1rem, 1.5vw, 1.3rem);
    line-height: 1.6;
    color: var(--text);
    max-width: 58ch;
}

.muted { color: var(--text-muted); }

.mono { font-family: var(--font-mono); }

/* ---------- Botones ---------- */
.btn {
    --btn-pad-y: 0.95rem;
    --btn-pad-x: 1.5rem;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: var(--btn-pad-y) var(--btn-pad-x);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out), border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), transform 0.2s var(--ease-out);
}
.btn:active { transform: translateY(1px) scale(0.985); }
.btn .icon { width: 1.2em; height: 1.2em; transition: transform 0.3s var(--ease-out); }
.btn:hover .icon-arrow-right,
.btn:hover > .icon:last-child:not(:first-child) { transform: translateX(3px); }

.btn-sm { --btn-pad-y: 0.7rem; --btn-pad-x: 1.05rem; font-size: 0.74rem; }
.btn-lg { --btn-pad-y: 1.15rem; --btn-pad-x: 1.9rem; font-size: 0.86rem; }

.btn-primary {
    background-color: var(--eldritch);
    border-color: var(--eldritch);
    color: var(--text-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 30px -12px rgba(58, 99, 81, 0.6);
}
.btn-primary:hover {
    background-color: var(--eldritch-hover);
    border-color: var(--eldritch-hover);
    color: var(--text-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 14px 36px -12px rgba(58, 99, 81, 0.85);
}

.btn-ghost {
    background-color: rgba(18, 18, 18, 0.35);
    border-color: var(--line-strong);
    color: var(--text-strong);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

.btn-portal {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--cyan);
    border-color: var(--cyan-dim);
    background-color: rgba(144, 224, 239, 0.04);
    --btn-pad-y: 0.7rem;
    --btn-pad-x: 1rem;
}
.btn-portal span::before { content: '[ '; opacity: 0.6; }
.btn-portal span::after { content: ' ]'; opacity: 0.6; }
.btn-portal:hover {
    background-color: var(--cyan);
    border-color: var(--cyan);
    color: var(--bg-dark);
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--cyan);
}
.link-arrow .icon { transition: transform 0.3s var(--ease-out); }
.link-arrow:hover { color: var(--text-strong); }
.link-arrow:hover .icon { transform: translateX(4px); }

/* ---------- Cabecera ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    height: var(--header-h);
    border-bottom: 1px solid transparent;
    transition: background-color 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
    padding-top: env(safe-area-inset-top);
    box-sizing: content-box;
}
.site-header.is-scrolled,
body.menu-open .site-header {
    background-color: rgba(14, 16, 15, 0.82);
    border-bottom-color: var(--line);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-strong);
    flex-shrink: 0;
}
.brand:hover { color: var(--text-strong); }
.brand-mark { width: 30px; height: 30px; color: var(--eldritch-text); transition: color 0.3s ease, transform 0.6s var(--ease-out); }
.brand:hover .brand-mark { color: var(--cyan); transform: rotate(-6deg); }
.brand-word {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
}
.brand-lg .brand-mark { width: 40px; height: 40px; }
.brand-lg .brand-word { font-size: 2rem; }

.main-nav { margin-inline: auto; }
.nav-list { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.9rem;
    font-size: 0.93rem;
    font-weight: 500;
    color: var(--text);
    border-radius: var(--radius);
    transition: color 0.25s ease, background-color 0.25s ease;
}
.nav-link:hover { color: var(--text-strong); background-color: rgba(255, 255, 255, 0.04); }
.nav-link[aria-current='page'],
.nav-link.is-current { color: var(--text-strong); }
.nav-link[aria-current='page']::after,
.nav-link.is-current::after {
    content: '';
    position: absolute;
    left: 0.9rem; right: 0.9rem; bottom: 0.2rem;
    height: 1px;
    background: var(--cyan);
}
.nav-link .caret { width: 0.85em; height: 0.85em; transition: transform 0.3s var(--ease-out); }

.has-sub { position: relative; }
.sub-panel {
    position: absolute;
    top: calc(100% + 0.9rem);
    left: 50%;
    width: min(620px, 90vw);
    padding: 0.6rem;
    background: rgba(18, 20, 19, 0.96);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -6px);
    transition: opacity 0.25s var(--ease-out), transform 0.35s var(--ease-out), visibility 0s linear 0.35s;
}
/* puente invisible para que el hover no se corte */
.sub-panel::before { content: ''; position: absolute; left: 0; right: 0; top: -1rem; height: 1rem; }
.has-sub.is-open .sub-panel {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition: opacity 0.25s var(--ease-out), transform 0.35s var(--ease-out), visibility 0s;
}
.has-sub.is-open .caret { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) {
    .has-sub:hover .sub-panel {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, 0);
        transition: opacity 0.25s var(--ease-out), transform 0.35s var(--ease-out), visibility 0s;
    }
    .has-sub:hover .caret { transform: rotate(180deg); }
}

.sub-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem; }
.sub-link {
    display: flex;
    gap: 0.85rem;
    padding: 0.95rem;
    border-radius: var(--radius);
    color: var(--text);
    transition: background-color 0.25s ease;
}
.sub-link:hover, .sub-link[aria-current='page'] { background: var(--abyss-750); color: var(--text); }
.sub-icon {
    display: grid;
    place-items: center;
    width: 2.4rem; height: 2.4rem;
    flex-shrink: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--eldritch-text);
    font-size: 1.15rem;
    transition: color 0.25s ease, border-color 0.25s ease;
}
.sub-link:hover .sub-icon { color: var(--cyan); border-color: var(--cyan-dim); }
.sub-text { display: grid; gap: 0.2rem; min-width: 0; }
.sub-title { font-weight: 600; color: var(--text-strong); font-size: 0.95rem; line-height: 1.3; }
.sub-desc { font-size: 0.83rem; color: var(--text-muted); line-height: 1.45; }

.header-actions { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }

.menu-toggle {
    display: none;
    position: relative;
    width: 44px; height: 44px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
}
.menu-toggle-bar {
    position: absolute;
    left: 12px; right: 12px;
    height: 1.5px;
    background: var(--text-strong);
    transition: transform 0.35s var(--ease-out), top 0.35s var(--ease-out);
}
.menu-toggle-bar:first-child { top: 17px; }
.menu-toggle-bar:last-child { top: 25px; }
.menu-toggle[aria-expanded='true'] .menu-toggle-bar:first-child { top: 21px; transform: rotate(45deg); }
.menu-toggle[aria-expanded='true'] .menu-toggle-bar:last-child { top: 21px; transform: rotate(-45deg); }

.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: var(--z-menu);
    padding-top: calc(var(--header-h) + env(safe-area-inset-top) + 1.5rem);
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    background:
        radial-gradient(120% 60% at 100% 100%, rgba(58, 99, 81, 0.28), transparent 60%),
        radial-gradient(80% 50% at 0% 0%, rgba(75, 63, 114, 0.18), transparent 60%),
        var(--abyss-950);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu-inner { display: flex; flex-direction: column; gap: 2.5rem; }
.mobile-list { display: grid; gap: 0.15rem; }
.mobile-list a {
    display: block;
    padding: 0.55rem 0;
    font-family: var(--font-heading);
    font-size: clamp(1.7rem, 7vw, 2.4rem);
    font-weight: 500;
    line-height: 1.15;
    color: var(--text-strong);
    border-bottom: 1px solid var(--line);
}
.mobile-list a[aria-current='page'] { color: var(--eldritch-text); }
.mobile-actions { display: grid; gap: 0.75rem; }
.mobile-actions .btn { width: 100%; }

@media (max-width: 1140px) {
    .main-nav, .header-actions .btn { display: none; }
    .menu-toggle { display: inline-grid; }
    .header-actions { margin-left: auto; }
}

/* ---------- Secciones ---------- */
.section { position: relative; padding-block: var(--section-y); }
.section-tight { padding-block: clamp(4rem, 8vw, 6.5rem); }
.section-head { display: grid; gap: 1.25rem; margin-bottom: clamp(2.75rem, 5vw, 4.5rem); }
.section-head .lead { margin-top: 0.25rem; }
.section-alt { background: linear-gradient(180deg, transparent, rgba(22, 24, 23, 0.9) 18%, rgba(22, 24, 23, 0.9) 82%, transparent); }

/* ---------- HERO (home) ---------- */
.hero {
    position: relative;
    isolation: isolate;
    display: grid;
    align-items: center;
    min-height: calc(100svh - var(--header-h));
    margin-top: calc(var(--header-h) * -1);
    padding-top: calc(var(--header-h) + clamp(2rem, 5vw, 4rem));
    padding-bottom: clamp(4rem, 8vw, 6rem);
    overflow: hidden;
}
.hero-canvas, .page-hero-canvas, .cta-canvas {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(60% 70% at 85% 75%, rgba(58, 99, 81, 0.32), transparent 65%),
        radial-gradient(40% 45% at 70% 20%, rgba(75, 63, 114, 0.22), transparent 70%),
        radial-gradient(50% 60% at 5% 100%, rgba(144, 224, 239, 0.05), transparent 70%),
        var(--bg-dark);
}
.hero::after {
    /* bruma inferior para fundir con la siguiente sección */
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 28%;
    z-index: -1;
    background: linear-gradient(180deg, transparent, var(--bg-dark));
    pointer-events: none;
}
.hero-content { position: relative; z-index: var(--z-content); }
.hero-copy { position: relative; max-width: 920px; display: grid; gap: 1.6rem; }
.hero-copy::before {
    /* velo que protege la lectura sobre el visual */
    content: '';
    position: absolute;
    inset: -12% -18% -12% -30%;
    z-index: -1;
    background: radial-gradient(closest-side, rgba(18, 18, 18, 0.82), rgba(18, 18, 18, 0.55) 55%, transparent);
    pointer-events: none;
}
.hero-title {
    font-size: clamp(2.9rem, 6.6vw, 6.1rem);
    font-weight: 600;
    line-height: 1.02;
    letter-spacing: -0.022em;
    max-width: 14ch;
}
.hero-title em { display: inline-block; padding-bottom: 0.08em; }
.hero-sub {
    font-size: clamp(1.1rem, 1.55vw, 1.32rem);
    color: var(--text);
    max-width: 46ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 0.4rem; }

/* Texto dividido por palabras (animación) */
.split-word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.split-word > span { display: inline-block; will-change: transform; }

/* ---------- Marquesina de capacidades ---------- */
.marquee {
    position: relative;
    display: flex;
    align-items: center;
    border-block: 1px solid var(--line);
    background: var(--abyss-950);
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
    display: flex;
    flex-shrink: 0;
    width: max-content;
    animation: marquee 48s linear infinite;
}
.marquee:hover .marquee-track,
.marquee.is-paused .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; align-items: center; flex-shrink: 0; }
.marquee-item {
    display: inline-flex;
    align-items: center;
    gap: 2.25rem;
    padding: 1.6rem 1.125rem;
    font-family: var(--font-heading);
    font-size: clamp(1.25rem, 2.1vw, 1.75rem);
    font-style: italic;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
}
.marquee-item .icon { color: var(--eldritch-text); width: 1rem; height: 1rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Manifiesto ---------- */
.manifesto { text-align: left; }
.manifesto-inner { max-width: 1100px; }
.manifesto-text {
    font-family: var(--font-heading);
    font-size: clamp(1.7rem, 3.6vw, 3.15rem);
    line-height: 1.22;
    font-weight: 500;
    color: var(--text-strong);
    letter-spacing: -0.01em;
}
.manifesto-text .scrub-word { opacity: 1; transition: none; }
.motion-ok .manifesto-text .scrub-word { opacity: 0.14; }
.manifesto-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem 2.5rem;
    margin-top: clamp(2.5rem, 5vw, 3.5rem);
}
.manifesto-foot p { max-width: 48ch; color: var(--text-muted); }

/* ---------- Bento de soluciones ---------- */
.bento {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: minmax(270px, auto);
    grid-auto-flow: dense;
    gap: 1rem;
}
.cell {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.9rem;
    padding: clamp(1.5rem, 2.6vw, 2.25rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--abyss-850);
    overflow: hidden;
    transition: border-color 0.4s ease, transform 0.5s var(--ease-out);
}
.cell-xl { grid-column: span 2; grid-row: span 2; min-height: 560px; }
.cell-wide { grid-column: span 2; }
.cell:hover { border-color: var(--line-strong); }
.cell-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.cell-bg-sap {
    background:
        radial-gradient(90% 120% at 100% 0%, rgba(58, 99, 81, 0.42), transparent 60%),
        linear-gradient(160deg, var(--abyss-800), var(--abyss-850));
}
.cell-bg-ia {
    background:
        radial-gradient(110% 90% at 0% 0%, rgba(75, 63, 114, 0.55), transparent 60%),
        var(--abyss-850);
}
.cell-bg-3d { background: var(--abyss-900); }
.cell-ghost-icon {
    position: absolute;
    top: -8%; right: -6%;
    width: 58%;
    height: auto;
    color: rgba(144, 224, 239, 0.07);
    z-index: -1;
    transition: transform 1.2s var(--ease-out), color 0.6s ease;
}
.cell:hover .cell-ghost-icon { transform: rotate(-8deg) scale(1.06); color: rgba(144, 224, 239, 0.12); }
.cell-icon {
    display: grid;
    place-items: center;
    width: 2.9rem; height: 2.9rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(18, 18, 18, 0.55);
    color: var(--eldritch-text);
    font-size: 1.4rem;
    margin-bottom: auto;
}
.cell h3 { font-size: clamp(1.45rem, 2.1vw, 1.95rem); }
.cell-xl h3 { font-size: clamp(1.9rem, 3vw, 2.75rem); max-width: 14ch; }
.cell p { color: var(--text); max-width: 44ch; font-size: 0.98rem; }
.cell .link-arrow::after { content: ''; position: absolute; inset: 0; z-index: 2; }
/* Borde que se ilumina bajo el cursor */
.cell::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
    padding: 1px;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(144, 224, 239, 0.55), transparent 45%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.cell:hover::after { opacity: 1; }
.cell:has(.link-arrow:focus-visible) { outline: 2px solid var(--cyan); outline-offset: 3px; }
.cell .link-arrow:focus-visible { outline: none; }

/* ---------- Método (sección fijada) ---------- */
.method-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(2.5rem, 6vw, 6rem);
    align-items: start;
}
.method-aside {
    position: sticky;
    top: calc(var(--header-h) + 3rem);
    display: grid;
    gap: 1.5rem;
}
.method-progress {
    position: relative;
    width: 1px;
    height: 140px;
    margin-top: 1rem;
    background: var(--line-strong);
}
.method-progress span {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, var(--cyan), var(--eldritch-text));
    transform-origin: top;
    transform: scaleY(0);
}
.reduce-motion .method-progress span, .motion-fallback .method-progress span { transform: scaleY(1); }
.method-steps { display: grid; gap: clamp(1rem, 2vw, 1.5rem); }
.step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    padding: clamp(1.75rem, 3vw, 2.5rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(27, 31, 29, 0.9), rgba(18, 18, 18, 0.9));
    transition: border-color 0.5s ease, background-color 0.5s ease;
}
.step-icon {
    display: grid;
    place-items: center;
    width: 3.2rem; height: 3.2rem;
    border-radius: var(--radius);
    border: 1px solid var(--line-strong);
    color: var(--text-muted);
    font-size: 1.5rem;
    transition: color 0.5s ease, border-color 0.5s ease;
}
.step h3 { font-size: clamp(1.5rem, 2.4vw, 2.1rem); margin-bottom: 0.6rem; }
.step p { color: var(--text-muted); max-width: 52ch; transition: color 0.5s ease; }
.step.is-active { border-color: var(--line-strong); }
.step.is-active .step-icon { color: var(--cyan); border-color: var(--cyan-dim); }
.step.is-active p { color: var(--text); }
.reduce-motion .step .step-icon, .motion-fallback .step .step-icon { color: var(--eldritch-text); }
.reduce-motion .step p, .motion-fallback .step p { color: var(--text); }

/* ---------- Portal ---------- */
.portal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(2.5rem, 6vw, 6rem);
    align-items: center;
}
.portal-visual {
    position: relative;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        radial-gradient(50% 50% at 50% 50%, rgba(58, 99, 81, 0.25), transparent 70%),
        var(--abyss-950);
    overflow: hidden;
}
.portal-visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.portal-copy { display: grid; gap: 1.5rem; }
.feature-rows { display: grid; gap: 0; margin-block: 0.5rem 0.75rem; }
.feature-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    padding-block: 1.15rem;
    border-top: 1px solid var(--line);
}
.feature-row:last-child { border-bottom: 1px solid var(--line); }
.feature-row .icon { width: 1.5rem; height: 1.5rem; color: var(--cyan); margin-top: 0.15rem; }
.feature-row strong { display: block; color: var(--text-strong); font-weight: 600; margin-bottom: 0.15rem; }
.feature-row p { color: var(--text-muted); font-size: 0.97rem; }

/* ---------- Banda CTA ---------- */
.cta-band {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-block: clamp(6rem, 13vw, 11rem);
    border-top: 1px solid var(--line);
    background:
        radial-gradient(70% 90% at 50% 120%, rgba(58, 99, 81, 0.45), transparent 70%),
        var(--abyss-950);
}
.cta-inner { display: grid; justify-items: center; text-align: center; gap: 1.5rem; }
.cta-title { font-size: clamp(2.2rem, 5.2vw, 4.6rem); max-width: 20ch; }
.cta-text { max-width: 48ch; color: var(--text); font-size: 1.1rem; }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.85rem; margin-top: 0.75rem; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--abyss-950);
    border-top: 1px solid var(--line);
    padding-top: clamp(4rem, 8vw, 6rem);
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
}
.footer-top {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
    gap: 3rem 2rem;
    padding-bottom: clamp(3rem, 6vw, 4.5rem);
}
.footer-brand { display: grid; gap: 1rem; align-content: start; }
.footer-lema {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--text);
}
.footer-lema em { color: var(--eldritch-text); }
.footer-heading {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.1rem;
}
.footer-col ul { display: grid; gap: 0.65rem; }
.footer-col a { color: var(--text); font-size: 0.97rem; }
.footer-col a:hover { color: var(--cyan); }
.footer-contact a { display: inline-flex; align-items: center; gap: 0.6rem; min-width: 0; }
.footer-contact a span { overflow-wrap: anywhere; }
.footer-contact .icon { color: var(--eldritch-text); }
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    font-size: 0.88rem;
    color: var(--text-muted);
}
.footer-legal { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer-legal a, .motion-toggle { color: var(--text-muted); font-size: 0.88rem; }
.footer-legal a:hover, .motion-toggle:hover { color: var(--cyan); }
.motion-toggle { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }

/* ---------- WhatsApp flotante ---------- */
.whatsapp-float {
    position: fixed;
    right: max(1.5rem, env(safe-area-inset-right));
    bottom: max(1.5rem, env(safe-area-inset-bottom));
    z-index: var(--z-float);
    display: grid;
    place-items: center;
    width: 58px; height: 58px;
    border-radius: 50%;
    background: var(--eldritch);
    color: var(--text-strong);
    font-size: 1.75rem;
    box-shadow: 0 12px 30px -8px rgba(58, 99, 81, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: transform 0.35s var(--ease-out), background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}
.whatsapp-float .icon { width: 1.75rem; height: 1.75rem; }
.whatsapp-float:hover { background: var(--cyan); color: var(--bg-dark); transform: translateY(-3px) scale(1.04); }
body.menu-open .whatsapp-float { opacity: 0; pointer-events: none; }

/* ==========================================================================
   PÁGINAS INTERNAS
   ========================================================================== */
.page-hero {
    position: relative;
    isolation: isolate;
    display: grid;
    align-items: end;
    min-height: min(78svh, 760px);
    margin-top: calc(var(--header-h) * -1);
    padding-top: calc(var(--header-h) + clamp(3rem, 7vw, 5rem));
    padding-bottom: clamp(3.5rem, 7vw, 5.5rem);
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(55% 75% at 88% 40%, rgba(58, 99, 81, 0.3), transparent 70%),
        radial-gradient(35% 40% at 65% 10%, rgba(75, 63, 114, 0.2), transparent 70%),
        var(--bg-dark);
}
.page-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, var(--bg-dark) 0%, rgba(18, 18, 18, 0.85) 38%, rgba(18, 18, 18, 0) 72%);
    pointer-events: none;
}
.page-hero-copy { display: grid; gap: 1.4rem; max-width: 820px; }
.page-hero h1 { font-size: clamp(2.6rem, 5.6vw, 5rem); line-height: 1.04; letter-spacing: -0.02em; }
.page-hero .lead { max-width: 54ch; }
.page-hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 0.4rem; }

.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.breadcrumb li { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); }
.breadcrumb li + li::before { content: '/'; color: var(--line-strong); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--cyan); }
.breadcrumb [aria-current='page'] { color: var(--eldritch-text); }

/* Bloque de texto dividido: titular arriba, columnas abajo */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(2.5rem, 6vw, 6rem);
    align-items: start;
}
.split-sticky { position: sticky; top: calc(var(--header-h) + 2.5rem); display: grid; gap: 1.25rem; }
.prose-block { display: grid; gap: 1.25rem; }
.prose-block p { color: var(--text); max-width: 62ch; }
.prose-block p.big {
    font-family: var(--font-heading);
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    line-height: 1.4;
    color: var(--text-strong);
}

/* Rejilla de pilares 2x2 */
.pillars {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}
.pillar {
    display: grid;
    gap: 0.9rem;
    align-content: start;
    padding: clamp(1.75rem, 3.5vw, 3rem);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    transition: background-color 0.4s ease;
}
.pillar:hover { background-color: rgba(27, 31, 29, 0.7); }
.pillar .icon { width: 1.9rem; height: 1.9rem; color: var(--eldritch-text); }
.pillar h3 { font-size: clamp(1.35rem, 2vw, 1.75rem); }
.pillar p { color: var(--text-muted); max-width: 46ch; }

/* Tarjetas de capacidades (rejilla asimétrica 3 + 2) */
.cap-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
}
.cap {
    grid-column: span 2;
    position: relative;
    display: grid;
    gap: 0.85rem;
    align-content: start;
    padding: clamp(1.5rem, 2.5vw, 2rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--abyss-850);
    transition: border-color 0.4s ease, transform 0.5s var(--ease-out);
}
.cap:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.cap-grid .cap:nth-last-child(-n+2):nth-child(3n+1),
.cap-grid .cap:nth-last-child(-n+2):nth-child(3n+1) ~ .cap { grid-column: span 3; }
.cap .icon { width: 1.75rem; height: 1.75rem; color: var(--cyan); }
.cap h3 { font-size: 1.35rem; }
.cap p { color: var(--text-muted); font-size: 0.98rem; }
.cap-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.35rem; }
.tag {
    display: inline-block;
    padding: 0.28rem 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(18, 18, 18, 0.6);
}

/* Acordeón (details) */
.accordion { display: grid; gap: 0.75rem; }
.acc {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--abyss-850);
    transition: border-color 0.3s ease;
    interpolate-size: allow-keywords;
}
.acc:hover, .acc[open] { border-color: var(--line-strong); }
.acc summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem 1.5rem;
    cursor: pointer;
    list-style: none;
    font-family: var(--font-heading);
    font-size: clamp(1.15rem, 1.7vw, 1.4rem);
    font-weight: 600;
    color: var(--text-strong);
    border-radius: var(--radius);
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary .acc-mark { display: inline-flex; align-items: center; gap: 0.9rem; min-width: 0; }
.acc summary .acc-mark .icon { color: var(--eldritch-text); width: 1.4rem; height: 1.4rem; }
.acc summary > .icon { width: 1.2rem; height: 1.2rem; color: var(--text-muted); transition: transform 0.35s var(--ease-out); }
.acc[open] summary > .icon { transform: rotate(45deg); color: var(--cyan); }
.acc-body { padding: 0 1.5rem 1.5rem; display: grid; gap: 0.9rem; color: var(--text); }
.acc-body p { max-width: 68ch; }
.acc-body ul { display: grid; gap: 0.45rem; }
.acc-body li { position: relative; padding-left: 1.2rem; color: var(--text); }
.acc-body li::before { content: ''; position: absolute; left: 0; top: 0.72em; width: 0.45rem; height: 1px; background: var(--eldritch-text); }
.acc::details-content { block-size: 0; overflow: hidden; transition: block-size 0.45s var(--ease-out), content-visibility 0.45s allow-discrete; }
.acc[open]::details-content { block-size: auto; }

/* Línea de proceso horizontal */
.process {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    counter-reset: none;
}
.process-item {
    position: relative;
    display: grid;
    gap: 0.75rem;
    align-content: start;
    padding-top: 1.75rem;
    border-top: 1px solid var(--line-strong);
}
.process-item::before {
    content: '';
    position: absolute;
    top: -4px; left: 0;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 0 4px rgba(144, 224, 239, 0.12);
}
.process-item .icon { width: 1.6rem; height: 1.6rem; color: var(--eldritch-text); }
.process-item h3 { font-size: 1.3rem; }
.process-item p { color: var(--text-muted); font-size: 0.97rem; }

/* Cita / frase destacada */
.statement {
    position: relative;
    padding: clamp(2.5rem, 6vw, 4.5rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        radial-gradient(70% 120% at 100% 0%, rgba(75, 63, 114, 0.3), transparent 60%),
        radial-gradient(60% 100% at 0% 100%, rgba(58, 99, 81, 0.3), transparent 60%),
        var(--abyss-850);
    overflow: hidden;
}
.statement p {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 3.2vw, 2.7rem);
    line-height: 1.25;
    color: var(--text-strong);
    max-width: 28ch;
}
.statement-mark { position: absolute; right: -2rem; bottom: -3rem; width: 260px; color: rgba(127, 181, 154, 0.08); }

/* Visión y misión */
.vision-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 1rem;
}
.vision-card {
    display: grid;
    gap: 1rem;
    align-content: start;
    padding: clamp(2rem, 4vw, 3.25rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--abyss-850);
}
.vision-card.primary {
    background:
        radial-gradient(80% 100% at 100% 100%, rgba(58, 99, 81, 0.4), transparent 65%),
        var(--abyss-850);
}
.vision-card h3 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.vision-card p { color: var(--text); max-width: 52ch; }
.vision-card .label { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--eldritch-text); }

/* Visual de laboratorio */
.lab-visual {
    position: relative;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: radial-gradient(60% 60% at 50% 55%, rgba(144, 224, 239, 0.07), transparent 70%), var(--abyss-950);
    overflow: hidden;
}
.lab-visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; }


/* Hero interno compacto (contacto, legales) */
.page-hero-compact { min-height: auto; padding-top: calc(var(--header-h) + clamp(3.5rem, 8vw, 6rem)); padding-bottom: clamp(3rem, 6vw, 4.5rem); }
.page-hero-compact h1 { font-size: clamp(2.4rem, 5vw, 4.25rem); }

/* Filas de producto: descripción a la izquierda, capacidades a la derecha */
.product-rows { display: grid; }
.product-row {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(1.75rem, 5vw, 5rem);
    padding-block: clamp(2.5rem, 5vw, 4rem);
    border-top: 1px solid var(--line);
}
.product-row:last-child { border-bottom: 1px solid var(--line); }
.product-head { display: grid; gap: 1rem; align-content: start; }
.product-head .icon { width: 2.2rem; height: 2.2rem; color: var(--eldritch-text); }
.product-head h3 { font-size: clamp(1.7rem, 2.8vw, 2.4rem); }
.product-head p { color: var(--text); max-width: 46ch; }
.check-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem 2rem; align-content: start; padding-top: 0.4rem; }
.check-list li { display: flex; gap: 0.75rem; align-items: flex-start; color: var(--text); }
.check-list .icon { width: 1.2rem; height: 1.2rem; margin-top: 0.2rem; color: var(--cyan); }

/* Dúo de paneles (talento) */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.duo-panel {
    position: relative;
    isolation: isolate;
    display: grid;
    gap: 1.25rem;
    align-content: start;
    padding: clamp(2rem, 4vw, 3.25rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.duo-panel.tone-green { background: radial-gradient(90% 90% at 100% 0%, rgba(58, 99, 81, 0.42), transparent 65%), var(--abyss-850); }
.duo-panel.tone-arcane { background: radial-gradient(90% 90% at 0% 100%, rgba(75, 63, 114, 0.5), transparent 65%), var(--abyss-850); }
.duo-panel > .icon { width: 2.4rem; height: 2.4rem; color: var(--cyan); }
.duo-panel h3 { font-size: clamp(1.7rem, 2.8vw, 2.4rem); }
.duo-panel p { color: var(--text); max-width: 50ch; }
.duo-panel .check-list { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 860px) {
    .product-row, .duo { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .check-list { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Contacto ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
}
.contact-card {
    position: relative;
    padding: clamp(1.75rem, 4vw, 3rem);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: linear-gradient(170deg, var(--abyss-800), var(--abyss-850));
    box-shadow: 0 40px 80px -40px rgba(58, 99, 81, 0.35);
}
.form { display: grid; gap: 1.4rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.field { display: grid; gap: 0.5rem; min-width: 0; }
.field label, .field .label {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-strong);
}
.field .optional { font-weight: 400; color: var(--text-muted); text-transform: none; letter-spacing: 0; }
.field input:not([type='checkbox']),
.field select,
.field textarea {
    width: 100%;
    padding: 0.95rem 1rem;
    background-color: var(--bg-dark);
    color: var(--text-strong);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    font-size: 1rem;
    line-height: 1.4;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%23CACFD2'%3E%3Cpath d='M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    padding-right: 2.75rem;
}
.field select option { background-color: var(--bg-dark); color: var(--text-strong); }
.field textarea { min-height: 170px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #7D858A; }
.field input:not([type='checkbox']):hover, .field select:hover, .field textarea:hover { border-color: #4A5A52; }
.field input:not([type='checkbox']):focus-visible, .field select:focus-visible, .field textarea:focus-visible {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(144, 224, 239, 0.18);
}
.field-help { font-size: 0.85rem; color: var(--text-muted); }
.field-error { display: none; align-items: center; gap: 0.4rem; font-size: 0.87rem; color: #F2A7A0; }
.field.has-error .field-error { display: flex; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #C9675D; }
.field-error .icon { width: 1rem; height: 1rem; }

.check { display: flex; align-items: flex-start; gap: 0.75rem; cursor: pointer; font-size: 0.93rem; color: var(--text); }
.check input {
    appearance: none;
    flex-shrink: 0;
    width: 1.25rem; height: 1.25rem;
    margin-top: 0.15rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--bg-dark);
    display: grid;
    place-items: center;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}
.check input::after { content: ''; width: 0.55rem; height: 0.3rem; border-left: 2px solid var(--bg-dark); border-bottom: 2px solid var(--bg-dark); transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.check input:checked { background: var(--cyan); border-color: var(--cyan); }
.check input:checked::after { opacity: 1; }
.check input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.check a { text-decoration: underline; text-underline-offset: 3px; }

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.btn .spinner { display: none; width: 1.1em; height: 1.1em; animation: spin 0.9s linear infinite; }
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading > .icon:not(.spinner) { display: none; }
.btn.is-loading .btn-label-idle { display: none; }
.btn .btn-label-busy { display: none; }
.btn.is-loading .btn-label-busy { display: inline; }
.btn.is-loading { pointer-events: none; opacity: 0.85; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-status {
    display: none;
    gap: 0.8rem;
    align-items: flex-start;
    padding: 1rem 1.15rem;
    border-radius: var(--radius);
    border: 1px solid;
    font-size: 0.95rem;
}
.form-status.is-visible { display: flex; }
.form-status .icon { width: 1.3rem; height: 1.3rem; margin-top: 0.1rem; }
.form-status.is-error { border-color: rgba(201, 103, 93, 0.5); background: rgba(201, 103, 93, 0.08); color: #F2C7C2; }
.form-status.is-success { border-color: rgba(127, 181, 154, 0.5); background: rgba(58, 99, 81, 0.15); color: var(--text-strong); }
.form-status a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }

.form-success {
    display: grid;
    gap: 1.1rem;
    justify-items: start;
    padding-block: 1rem;
}
.form-success .icon-big { width: 3.25rem; height: 3.25rem; color: var(--eldritch-text); }
.form-success h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.form-success p { color: var(--text); max-width: 48ch; }

.contact-aside { display: grid; gap: 1rem; }
.channel {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 1.35rem 1.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--abyss-850);
    color: var(--text);
    transition: border-color 0.3s ease, background-color 0.3s ease;
}
.channel:hover { border-color: var(--cyan-dim); color: var(--text); background: var(--abyss-800); }
.channel > .icon:first-child { width: 1.6rem; height: 1.6rem; color: var(--eldritch-text); }
.channel > .icon:last-child { width: 1.1rem; height: 1.1rem; color: var(--text-muted); transition: transform 0.3s var(--ease-out), color 0.3s ease; }
.channel:hover > .icon:last-child { transform: translate(2px, -2px); color: var(--cyan); }
.channel strong { display: block; color: var(--text-strong); font-weight: 600; }
.channel span { display: block; font-size: 0.92rem; color: var(--text-muted); overflow-wrap: anywhere; }
.aside-note {
    padding: 1.4rem;
    border-left: 1px solid var(--eldritch-text);
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ---------- Páginas legales ---------- */
.legal { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.legal-toc { position: sticky; top: calc(var(--header-h) + 2rem); display: grid; gap: 0.5rem; }
.legal-toc a { font-size: 0.92rem; color: var(--text-muted); }
.legal-toc a:hover { color: var(--cyan); }
.legal-toc .footer-heading { margin-bottom: 0.5rem; }
.prose { max-width: 72ch; }
.prose h2 { font-size: clamp(1.45rem, 2.4vw, 1.9rem); margin: 2.75rem 0 1rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.2rem; margin: 1.75rem 0 0.6rem; }
.prose p, .prose li { color: var(--text); margin-bottom: 1rem; }
.prose ul { margin: 0 0 1.25rem; display: grid; gap: 0.35rem; }
.prose ul li { position: relative; padding-left: 1.2rem; margin-bottom: 0; }
.prose ul li::before { content: ''; position: absolute; left: 0; top: 0.75em; width: 0.45rem; height: 1px; background: var(--eldritch-text); }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose .note {
    margin-bottom: 2rem;
    padding: 1rem 1.2rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.92rem;
}
.updated { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }

/* ---------- 404 ---------- */
.notfound { min-height: calc(100svh - var(--header-h)); align-items: center; }
.notfound .code { font-family: var(--font-mono); color: var(--eldritch-text); font-size: 0.9rem; letter-spacing: 0.12em; }

/* ==========================================================================
   ESTADOS DE ANIMACIÓN
   Con JS + movimiento permitido, los elementos parten ocultos y GSAP los revela.
   ========================================================================== */
.motion-ok [data-reveal],
.motion-ok [data-hero-fade] { opacity: 0; }
.motion-ok [data-split]:not(.is-split) { opacity: 0; }
.motion-fallback [data-reveal],
.motion-fallback [data-hero-fade],
.motion-fallback [data-split] { opacity: 1 !important; transform: none !important; }

.reduce-motion .marquee-track { animation: none; }
.reduce-motion .marquee { -webkit-mask-image: none; mask-image: none; }
.reduce-motion .marquee-track { flex-wrap: wrap; width: 100%; justify-content: center; }
.reduce-motion .marquee-group[aria-hidden='true'] { display: none; }
.reduce-motion .marquee-group { flex-wrap: wrap; justify-content: center; }
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { scroll-behavior: auto !important; }

@media (prefers-reduced-motion: reduce) {
    .marquee-track { animation: none; }
    .btn, .cell, .cap, .whatsapp-float { transition-duration: 0.01ms; }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
    .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cell-xl { grid-column: span 2; grid-row: span 1; min-height: 440px; }
    .cell-wide { grid-column: span 2; }
    .footer-top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .footer-brand { grid-column: 1 / -1; }
    .process { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2.5rem; }
    .cap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cap, .cap-grid .cap:nth-last-child(-n+2):nth-child(3n+1),
    .cap-grid .cap:nth-last-child(-n+2):nth-child(3n+1) ~ .cap { grid-column: span 1; }
    .cap-grid .cap:last-child:nth-child(odd) { grid-column: span 2; }
}

@media (max-width: 860px) {
    .method-grid, .portal-grid, .split, .contact-grid, .vision-grid, .legal { grid-template-columns: minmax(0, 1fr); }
    .method-aside, .split-sticky, .legal-toc { position: static; }
    .method-progress { display: none; }
    .portal-visual { max-width: 520px; width: 100%; }
    .page-hero::after { background: linear-gradient(180deg, rgba(18, 18, 18, 0.2) 0%, rgba(18, 18, 18, 0.9) 70%); }
    .legal-toc { display: none; }
}

@media (max-width: 767px) {
    body { font-size: 1rem; }
    .bento { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
    .cell, .cell-xl, .cell-wide { grid-column: span 1; grid-row: span 1; min-height: 300px; }
    .cell-xl { min-height: 420px; }
    .pillars { grid-template-columns: minmax(0, 1fr); }
    .cap-grid { grid-template-columns: minmax(0, 1fr); }
    .cap-grid .cap:last-child:nth-child(odd) { grid-column: span 1; }
    .process { grid-template-columns: minmax(0, 1fr); }
    .form-row { grid-template-columns: minmax(0, 1fr); }
    .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
    .hero { align-items: end; }
    .hero-actions .btn, .page-hero-actions .btn, .cta-actions .btn { flex: 1 1 100%; }
    .step { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
    .channel { grid-template-columns: auto 1fr; }
    .channel > .icon:last-child { display: none; }
    .whatsapp-float { width: 52px; height: 52px; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); }
}

@media (max-width: 480px) {
    .footer-top { grid-template-columns: minmax(0, 1fr); }
}
.prose code { font-family: var(--font-mono); font-size: 0.88em; color: var(--cyan); }
.field .check { font-size: 0.93rem; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--text); }
