/* === REVEAL FALLBACK: visible por defecto; GSAP sobreescribe cuando carga === */
@keyframes gsRevealFallback {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.gs-reveal,
.gs-reveal-delay {
    animation: gsRevealFallback 0.7s ease both;
}

/* GSAP añade will-change cuando toma control; con eso cancelamos el fallback */
.gs-reveal[style*="opacity"],
.gs-reveal-delay[style*="opacity"] {
    animation: none;
}

/* === MAIN Y SECCIONES === */
main {
    position: relative;
    z-index: 10;
    padding-top: 80px;
}

section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* === GAPS DE SCROLL === */
.scene-gap   { height: 70vh; pointer-events: none; }
.newton-gap  { height: 140vh; pointer-events: none; }
.nosotros-gap { height: var(--nosotros-gap-h); pointer-events: none; }

:root {
    --nosotros-gap-h: 110vh;
    --portal-gap-h: 20vh;
    --portal-spacer-h: 10vh;
    --portal-sticky-top: 96px;
}

section#nosotros { min-height: 20vh; background: transparent; pointer-events: none; }

/* === NOSOTROS CARD FLOTANTE === */
#nosotrosCard.is-floating {
    position: fixed;
    top: 120px;
    right: 5%;
    margin: 0 !important;
    z-index: 160;
    width: min(700px, 92vw);
    max-width: 700px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    pointer-events: auto;
}

/* === INTRO CARD === */
.intro-card { max-width: 520px; padding: 34px 40px; text-align: center; }

/* === CONTACTO (VENTAJA COMPETITIVA) === */
section#contacto {
    align-items: flex-start;
    padding-top: 210px;
    padding-bottom: 40px;
}

.final-card {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: min(940px, 92vw);
    max-width: 940px;
    padding: 52px 56px;
    gap: 48px;
    text-align: left;
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(255,255,255,.85);
    border-radius: 26px;
    box-shadow: 0 26px 70px rgba(80,120,255,.14);
}

    .final-card h2 { margin: 0 0 18px 0; font-size: clamp(2.3rem,3.2vw,3.1rem); line-height: .92; }
    .final-card p  { margin: 0; font-size: 1.15rem; line-height: 1.65; max-width: 42ch; }

.final-media {
    width: clamp(170px, 20vw, 240px);
    aspect-ratio: 1/1;
    border-radius: 24px;
    background: rgba(80,120,255,.06);
    border: 1px solid rgba(15,23,42,.06);
    box-shadow: 0 16px 45px rgba(15,23,42,.10);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    flex-shrink: 0;
}

    .final-media img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        border-radius: 16px;
        box-shadow: none;
        border: none;
        background: transparent;
    }

.final-copy { flex: 1; min-width: 240px; }

/* === VITRUVIO / TARJETAS AMPLIAS === */
.vitruvio-card  { max-width: 780px; }
.vitruvio-subcopy { margin-top: 6px; font-size: .9rem; color: var(--text-gray); }

/* === EQUILIBRIO === */
.equilibrio-bullets {
    margin: 18px 0 0;
    padding-left: 18px;
    font-size: .92rem;
    line-height: 1.6;
    color: var(--text-gray);
}
    .equilibrio-bullets li + li { margin-top: 6px; }

section#equilibrio {
    align-items: flex-start;
    padding-top: 110px;
    padding-bottom: 30px;
}

.equilibrio-wide {
    width: min(1200px, 94vw);
    max-width: 1200px;
    padding: 54px 56px;
    text-align: left;
}

/* === TRI-SLIDER === */
.tri-slider {
    position: relative;
    width: 100%;
    border-radius: 26px;
    overflow: hidden;
    --pos: 50;
    --brain: 0;
    --heart: 0;
    --focus-x: 50%;
    background: radial-gradient(circle at center, #4c1d95 0%, #1f2937 70%);
    box-shadow: 0 18px 40px rgba(15,23,42,.40);
}
    .tri-slider::before { content: ""; display: block; padding-top: 45%; }

.tri-inner { position: absolute; inset: 0; }

.tri-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: var(--focus-x) 50%;
    pointer-events: none;
    user-select: none;
}

.tri-brain { z-index: 2; clip-path: inset(0 50% 0 calc(50% - (var(--brain) * 1%))); transition: clip-path .28s cubic-bezier(.16,1,.3,1); }
.tri-heart { z-index: 3; clip-path: inset(0 calc(50% - (var(--heart) * 1%)) 0 50%); transition: clip-path .28s cubic-bezier(.16,1,.3,1); }
.tri-vitruvio { z-index: 5; }

.tri-handle {
    position: absolute;
    top: 0;
    left: calc(var(--pos) * 1%);
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: rgba(255,255,255,.9);
    z-index: 15;
    pointer-events: none;
    transition: left .28s cubic-bezier(.16,1,.3,1);
}
    .tri-handle::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 26px;
        height: 26px;
        transform: translate(-50%, -50%);
        border-radius: 999px;
        border: 2px solid #fff;
        background: radial-gradient(circle at center, var(--pice-purple) 0%, var(--pice-blue) 70%);
        box-shadow: 0 0 0 3px rgba(15,23,42,.5);
    }

.tri-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,.10);
    background: rgba(255,255,255,.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 18px 40px rgba(15,23,42,.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 30;
    color: var(--pice-blue);
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 30px;
    line-height: 1;
    padding: 0;
}
    .tri-arrow:hover { transform: translateY(-50%) translateY(-2px); }

.tri-left  { left: 14px; }
.tri-right { right: 14px; }

.tri-range {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 64px;
    right: 64px;
    width: auto;
    height: 100%;
    opacity: 0;
    cursor: ew-resize;
    z-index: 20;
    touch-action: pan-y;
}

.er-label {
    position: absolute;
    bottom: 14px;
    font-size: .75rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #f9fafb;
    font-family: 'Montserrat', sans-serif;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15,23,42,.55);
    backdrop-filter: blur(8px);
    white-space: nowrap;
    z-index: 35;
    pointer-events: none;
}
.er-label-left  { left: 14px; }
.er-label-right { right: 14px; }

.mobile-static-img { display: none; }

/* === PORTAL Y CONTACTO FINAL === */
:root {
    --portal-ring: #7c3aed;
    --portal-core: #22d3ee;
    --portal-ui: var(--portal-core);
}

.portal-gap    { height: var(--portal-gap-h); pointer-events: none; }
.portal-spacer { height: var(--portal-spacer-h); pointer-events: none; }

section#contacto-final {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding-top: 0;
    padding-bottom: 90px;
    gap: 24px;
}

.portal-stage {
    width: min(980px, 94vw);
    position: sticky;
    top: var(--portal-sticky-top);
    height: calc(100vh - (var(--portal-sticky-top) + 12px));
    border-radius: 26px;
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 28px;
    pointer-events: none;
    z-index: 30;
    overflow: visible;
}
    .portal-stage::before {
        content: "";
        position: absolute;
        inset: -36px;
        border-radius: 34px;
        background: radial-gradient(circle at 50% 32%, rgba(80,120,255,0.10), rgba(255,255,255,0) 62%);
        pointer-events: none;
    }

.portal-stage-ui {
    pointer-events: auto;
    text-align: center;
    width: min(760px, 92vw);
    padding: 22px 24px;
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(255,255,255,0.92);
    border-radius: 22px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 26px 70px rgba(80,120,255,.14);
    transition: opacity .35s ease, transform .35s ease;
}
    .portal-stage-ui.is-hidden {
        opacity: 0;
        transform: translateY(-12px);
        pointer-events: none;
    }

.portal-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(80,120,255,.10);
    border: 1px solid rgba(80,120,255,.18);
    color: var(--pice-blue);
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
    font-size: .72rem;
}

.portal-stage-title {
    margin: 14px 0 10px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: clamp(2.4rem, 4.4vw, 3.6rem);
    line-height: .90;
    letter-spacing: .02em;
    color: var(--text-dark);
}
    .portal-stage-title span { color: var(--pice-blue); }

.portal-stage-sub {
    margin: 0 auto;
    color: var(--text-gray);
    font-size: 1.02rem;
    line-height: 1.6;
    max-width: 62ch;
}

.portal-stage-cta {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 18px;
}

.portal-stage-hint { margin-top: 14px; font-size: .86rem; color: #94a3b8; }

.portal-palette {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.portal-swatch {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,0.90);
    box-shadow: 0 10px 24px rgba(15,23,42,.18);
    background: var(--swatch, #fff);
    cursor: pointer;
    padding: 0;
    transition: transform .18s ease, box-shadow .18s ease;
}
    .portal-swatch:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(15,23,42,.22); }
    .portal-swatch.is-active { outline: 3px solid rgba(80,120,255,0.28); outline-offset: 2px; }

/* Formulario de contacto */
.contact-card { width: min(980px, 94vw); max-width: 980px; text-align: left; padding: 54px 56px; }
.contact-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.contact-form { margin-top: 22px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-top: 12px; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: .9rem; color: var(--text-gray); }
    .field span { font-family: 'Montserrat', sans-serif; font-weight: 700; letter-spacing: .02em; color: var(--text-dark); font-size: .85rem; }
    .field input, .field textarea {
        width: 100%;
        border-radius: 14px;
        border: 1px solid rgba(15,23,42,0.10);
        background: rgba(255,255,255,0.92);
        padding: 12px 14px;
        font-family: 'Inter', sans-serif;
        font-size: 1rem;
        outline: none;
        transition: box-shadow .2s ease, border-color .2s ease;
    }
    .field input:focus, .field textarea:focus {
        border-color: rgba(80,120,255,0.45);
        box-shadow: 0 0 0 4px rgba(80,120,255,0.12);
    }

.field-full { grid-column: 1 / -1; }
.contact-submit { margin-top: 14px; }
.contact-note { margin-top: 10px; font-size: .82rem; color: var(--text-gray); opacity: .85; }
.contact-final-card { margin: 0 auto; }
#contactFormCard { scroll-margin-top: 120px; }
