:root {
    --bg: #050606;
    --panel: rgba(6, 9, 10, 0.7);
    --accent: #f7c35f;
    --text: #f8fbff;
    --muted: #8a939b;
    --border: rgba(255, 255, 255, 0.12);
}

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

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    font-family: 'Space Grotesk', 'Manrope', system-ui, -apple-system, sans-serif;
    color: var(--text);
}

.stage {
    position: relative;
    width: 100%;
    height: 100vh;
    background: var(--bg);
    isolation: isolate;
}

.video-layer-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #000;
    display: none;
    z-index: 1;
}

#heroVideoBackground {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
}

.video-blur-overlay {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2;
}

.video-dark-overlay {
    position: absolute;
    inset: 0;
    background: #000;
    opacity: 0;
    transition: opacity 800ms ease;
    z-index: 3;
}

.video-dark-overlay.visible {
    opacity: 0.65;
}

.video-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #000;
    z-index: 2;
}

#heroVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
}

.video-fallback {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 300ms ease, visibility 300ms ease;
}

body.needs-interaction .video-fallback {
    opacity: 1;
    visibility: visible;
}

.fallback-text {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text);
}

.ghost-button {
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 200ms ease, border-color 200ms ease, background 200ms ease;
}

.ghost-button:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
}

.overlay-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 800ms ease;
    pointer-events: none;
    z-index: 5;
}

.overlay-layer.visible {
    opacity: 0.65;
}

.overlay-image,
.overlay-glow {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 800ms ease;
}

.overlay-layer.visible .overlay-image,
.overlay-layer.visible .overlay-glow {
    opacity: 1;
}

.overlay-glow { display: none; }

@keyframes glowPulse {
    0% { opacity: 0.1; }
    50% { opacity: 0.75; }
    100% { opacity: 0.1; }
}

.scene-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 6;
}

.scene-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 400ms ease;
}

.scene-image.active {
    opacity: 1;
}

.info-panel-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: clamp(18px, 3vw, 32px);
    pointer-events: none;
    z-index: 99;
}

.info-panel {
    position: absolute;
    width: 97%;
    /*max-width: 800px;*/
    padding: clamp(20px, 3vw, 32px);
    background: rgba(20, 20, 20, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(247, 195, 95, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scaleX(0) scaleY(0);
    transform-origin: center;
    opacity: 0;
    transition: none;
}

.info-panel.active {
    animation: tvTurnOn 450ms ease-out forwards;
}

.info-panel.closing {
    animation: tvTurnOff 450ms ease-in forwards;
}

@keyframes tvTurnOn {
    0% {
        transform: scaleX(0.01) scaleY(0);
        opacity: 0;
    }
    40% {
        transform: scaleX(1) scaleY(0.05);
        opacity: 0.5;
    }
    100% {
        transform: scaleX(1) scaleY(1);
        opacity: 1;
    }
}

@keyframes tvTurnOff {
    0% {
        transform: scaleX(1) scaleY(1);
        opacity: 1;
    }
    60% {
        transform: scaleX(1) scaleY(0.05);
        opacity: 0.5;
    }
    100% {
        transform: scaleX(0.01) scaleY(0);
        opacity: 0;
    }
}

.info-panel p {
    color: var(--light);
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.4;
    text-align: center;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.ui-layer {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(10px, 3vw, 32px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 700ms ease;
    z-index: 8;
}

.ui-layer.visible {
    opacity: 1;
    pointer-events: auto;
}

.top-nav {
    position: absolute;
    top: clamp(12px, 3vw, 22px);
    right: clamp(14px, 4vw, 32px);
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 12;
    pointer-events: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(12px, 2vw, 20px);
}

.nav-link {
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    padding: 6px 0;
    transition: color 180ms ease, text-shadow 180ms ease;
}

.nav-link:hover {
    color: var(--accent);
    text-shadow: 0 0 10px rgba(247, 195, 95, 0.6), 0 0 18px rgba(247, 195, 95, 0.35);
}

.burger {
    display: none;
    width: 40px;
    height: 32px;
    padding: 8px 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    transition: border-color 160ms ease, background 160ms ease;
}

.burger span {
    display: block;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.78);
    border-radius: 4px;
}

.burger:hover {
    border-color: rgba(247, 195, 95, 0.55);
    background: rgba(247, 195, 95, 0.08);
}

.side-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, visibility 200ms ease;
    z-index: 300;
}

.side-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: min(280px, 72vw);
    height: 100%;
    padding: 18px 20px;
    background: rgba(10, 12, 14, 0.78);
    backdrop-filter: blur(16px);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -18px 0 36px rgba(0, 0, 0, 0.45);
    transform: translateX(105%);
    transition: transform 240ms ease;
    z-index: 310;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.side-menu nav {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 10px;
}

.side-menu a {
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 600;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.82);
    padding: 6px 2px;
    transition: color 160ms ease, text-shadow 160ms ease;
}

.side-menu a:hover {
    color: var(--accent);
    text-shadow: 0 0 10px rgba(247, 195, 95, 0.6), 0 0 18px rgba(247, 195, 95, 0.35);
}

body.nav-open .side-menu {
    transform: translateX(0);
}

body.nav-open .side-menu-overlay {
    opacity: 1;
    visibility: visible;
}

body.nav-open {
    overflow: hidden;
}

.leader-line {
    z-index: 6 !important;
    pointer-events: none !important;
}
.hero-copy {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.hero-copy h1 {
    font-size: clamp(1.6rem, 3vw, 2.5rem);
    font-weight: 700;
    line-height: 1.1;
    opacity: 0;
}

.hero-copy h1.typing {
    opacity: 1;
    position: relative;
}

.hero-copy h1.typing::after {
    content: '|';
    color: var(--accent);
    animation: blink-caret 0.75s step-end infinite;
}

.hero-copy h1.typing-complete {
    opacity: 1;
}

.hero-copy h1.typing-complete::after {
    display: none;
}

@keyframes blink-caret {
    50% { opacity: 0; }
}

/* Chivato visual para debugging de conectores en inputs */
.flow-card.input::after {
    content: '';
    position: absolute;
    right: 8%;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    opacity: 0;
    pointer-events: none;
}

/* Chivato visual para debugging de conectores en outputs */
.flow-card.output::after {
    content: '';
    position: absolute;
    left: 8%;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    opacity: 0;
    pointer-events: none;
}

/* Chivato visual para punto central izquierdo */
.flow-area::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 35%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    opacity: 0;
    pointer-events: none;
}

/* Chivato visual para punto central derecho */
.flow-area::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 55%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    opacity: 0;
    pointer-events: none;
}

.hero-copy p {
    color: var(--muted);
    font-size: clamp(0.95rem, 1.6vw, 1.05rem);
    line-height: 1.35;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms ease, transform 800ms ease;
}

.hero-copy p.visible {
    opacity: 1;
    transform: translateY(0);
}

.flow-area {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    justify-items: center;
    gap: clamp(12px, 3vw, 32px);
    padding: 0 6vw;
}

.column {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.5vw, 18px);
    min-height: 60vh;
}

.column.inputs {
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    transform: translateX(-6%);
}

.column.outputs {
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    transform: translateX(6%);
}
.column.outputs .flow-card {
    align-items: flex-end;
    text-align: right;
    transform: translateX(30px);
    background: url('cardBackground_reversal.png') center / cover no-repeat;
    padding: 14px 3% 26px 5%;
}

/* Hover effect para outputs - igual que inputs */
.column.outputs .flow-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('cardBackground_reversal_hover.png') center / cover no-repeat;
    z-index: 1;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 500ms ease;
    pointer-events: none;
}

.column.outputs .flow-card:hover::before {
    clip-path: inset(0 0 0 0);
}

.flow-card > * {
    position: relative;
    z-index: 1;
}

.flow-card {
    position: relative;
    width: min(240px, 30vw);
    aspect-ratio: 5 / 2;
    padding: 14px 5% 26px 3%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    align-items: flex-start;
    border-radius: 0;
    background: url('cardBackground.png') center / cover no-repeat;
    border: none;
    box-shadow: none;
    color: inherit;
    font-weight: inherit;
    letter-spacing: -0.01em;
    overflow: hidden;
    clip-path: inset(0 0 0 0 round 0);
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 600ms ease, transform 600ms ease;
    cursor: pointer;
}

/* Hover effect para inputs - reveal de izquierda a derecha */
.flow-card.input::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('cardBackground_hover.png') center / cover no-repeat;
    z-index: 1;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 500ms ease;
    pointer-events: none;
}

.flow-card.input:hover::before {
    clip-path: inset(0 0 0 0);
}

.flow-card h3 {
    font-size: 0.95rem;
    line-height: 1.25;
    margin-top: 2px;
    max-width: 26ch;
    font-weight: 700;
    text-transform: uppercase;
}

.flow-card.visible {
    opacity: 1;
    transform: translateX(0);
}

.column.outputs .flow-card.visible {
    transform: translateX(0);
}

.plot-anchor {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 1px;
    margin-left: -0.5px;
    margin-top: -0.5px;
    opacity: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
}

.cta {
    align-self: flex-start;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 14px;
    border: 1.5px solid #f7c35f;
    background: linear-gradient(135deg, #f7c35f 0%, #f2b13f 100%);
    color: #2b1c05;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4), 0 0 22px rgba(247, 195, 95, 0.4);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
    overflow: hidden;
}

.cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 500ms ease;
}

.cta:hover::before {
    left: 100%;
}

.cta:hover {
    transform: translateY(-2px) scale(1.02);
    border-color: rgba(247, 195, 95, 0.8);
    box-shadow: 0 16px 56px rgba(0, 0, 0, 0.45), 0 0 32px rgba(247, 195, 95, 0.6);
}

.cta:active {
    transform: translateY(0) scale(0.98);
}

.cta i {
    transition: transform 180ms ease;
}

.cta:hover i {
    transform: scale(1.15);
}

.cta-panel {
    position: absolute;
    left: 50%;
    bottom: clamp(12px, 3vw, 22px);
    transform: translateX(-50%) translateY(100px);
    padding: 12px 16px;
    max-width: 520px;
    background: rgba(10, 12, 14, 0.55);
    border: 1.5px solid #ffffff99;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 0 16px rgba(155, 155, 155, 0.25);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    opacity: 0;
    transition: opacity 800ms ease, transform 800ms ease;
}

.cta-panel.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.cta-panel p {
    margin: 0;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.cta-text-mobile {
    display: none;
}

.burger-mobile {
    display: none;
}

.flow-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
}

.flow-path {
    stroke: url(#glowStroke);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    filter: drop-shadow(0 0 10px rgba(247, 195, 95, 0.4));
    stroke-dasharray: 10 14;
    animation: dashFlow 3.4s linear infinite;
}

@keyframes dashFlow {
    to { stroke-dashoffset: -160; }
}

@media (max-width: 900px) {
    .nav-links {
        display: none;
    }

    .burger {
        display: flex;
    }

    .flow-area {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 18px;
        align-items: center;
    }

    .column.inputs,
    .column.outputs {
        align-items: center;
    }

    .flow-card {
        width: min(90vw, 360px);
        text-align: center;
        align-items: center;
    }

    .cta {
        align-self: center;
    }
}

.status-chip,
.status-chip .status-copy {
    display: none;
}

@media (max-width: 768px) {
    .cta {
        width: 100%;
        justify-content: center;
    }

    .cta-panel {
        flex-direction: column;
        gap: 10px;
        max-width: 90vw;
    }

    .cta-panel p {
        text-align: center;
    }

    /* Ajuste del title centrado en mobile (sin burger arriba) */
    .hero-copy {
        max-width: 100%;
        z-index: 1;
        text-align: center;
        align-items: center;
    }

    .hero-copy h1 {
        font-size: clamp(0.9rem, 2vh, 1.2rem);
        padding-right: 0;
        max-height: min(8vh, 60px);
        overflow: hidden;
        line-height: 1.2;
    }

    .hero-copy p {
        display: none;
    }

    /* Ocultar burger del top-nav en mobile */
    .burger {
        display: none;
    }

    /* Video de fondo: activar y ocupar toda la pantalla con blur */
    .video-layer-background {
        display: block;
    }

    /* Video principal: 70vh desplazado hacia arriba */
    .video-layer {
        position: absolute;
        top: 8vh;
        left: 0;
        right: 0;
        height: 70vh;
        background: transparent;
    }

    #heroVideo {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Overlay y scene images: misma posición y tamaño exacto que el video principal */
    .overlay-layer {
        position: absolute;
        top: 8vh;
        left: 0;
        right: 0;
        height: 70vh;
    }

    .overlay-image,
    .overlay-glow {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .scene-layer {
        position: absolute;
        top: 8vh;
        left: 0;
        right: 0;
        height: 70vh;
    }

    .scene-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Flow-area: eliminar espacio superior y alinear desde arriba */
    .flow-area {
        align-items: flex-start;
        padding: 0;
        gap: min(1vh, 8px);
    }

    /* Chivatos centrales del flow-area ocultos */
    .flow-area::before {
        opacity: 0;
    }

    .flow-area::after {
        opacity: 0;
    }

    .column {
        min-height: auto;
        gap: min(0.8vh, 6px);
    }

    .column.inputs {
        position: absolute;
        top: 3%;
        left: 0;
        right: 0;
        width: 100%;
        transform: none;
        align-items: stretch;
        justify-content: flex-start;
    }

    .column.outputs {
        position: absolute;
        bottom: 10%;
        left: 0;
        right: 0;
        width: 100%;
        transform: none;
        align-items: stretch;
        justify-content: flex-start;
    }

    /* Flow-cards: backgrounds mobile y aspect ratio ajustado */
    .flow-card.input {
        background: url('cardBgMobile.png') center / cover no-repeat;
        aspect-ratio: 1526 / 261;
        width: 100%;
        max-height: min(8vh, 60px);
        padding: min(0.8vh, 6px) 3% min(1vh, 8px) 3%;
        margin: min(0.3vh, 2px) 0;
    }

    .flow-card.input::before {
        background: url('cardBgMobile_hover.png') center / cover no-repeat;
        clip-path: inset(0 100% 0 0);
        transition: clip-path 500ms ease;
    }

    .flow-card.input.active::before {
        clip-path: inset(0 0 0 0);
    }

    /* Chivato de las flow-cards input oculto y reposicionado */
    .flow-card.input::after {
        opacity: 0;
        right: 2%;
    }

    .column.outputs .flow-card {
        background: url('cardBgMobile_reversal.png') center / cover no-repeat;
        aspect-ratio: 1526 / 261;
        width: 100%;
        max-height: min(8vh, 60px);
        padding: min(0.8vh, 6px) 3% min(1vh, 8px) 3%;
        margin: min(0.3vh, 2px) 0;
        text-align: center;
        align-items: center;
    }

    .column.outputs .flow-card::before {
        background: url('cardBgMobile_reversal_hover.png') center / cover no-repeat;
        clip-path: inset(0 100% 0 0);
        transition: clip-path 500ms ease;
    }

    .column.outputs .flow-card.active::before {
        clip-path: inset(0 0 0 0);
    }

    /* Chivato de las flow-cards output oculto y reposicionado */
    .flow-card.output::after {
        opacity: 0;
        left: 2%;
    }

    .flow-card h3 {
        font-size: clamp(0.7rem, 2.2vw, 0.8rem);
    }

    /* Info panel layer ajustes para mobile */
    .info-panel-layer {
        padding-top: 5px;
        z-index: 100;
    }

    .info-panel {
        height: 35%;
    }

    /* Side menu por encima de leader-lines */
    .side-menu-overlay {
        z-index: 100;
    }

    .side-menu {
        z-index: 101;
    }

    /* CTA Panel como mini pie de página en mobile */
    .cta-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        max-width: 100%;
        border-radius: 0;
        border: none;
        border-top: 1.5px solid #ffffff99;
        padding: min(1.5vh, 12px) 3vw;
        flex-direction: row;
        gap: 2vw;
        justify-content: space-between;
        align-items: stretch;
    }

    .cta-panel.visible {
        transform: none;
    }

    /* Ocultar texto del CTA panel en mobile */
    .cta-text {
        display: none;
    }

    /* Textos del botón CTA */
    .cta-text-desktop {
        display: none;
    }

    .cta-text-mobile {
        display: inline;
    }

    /* Botón CTA más estrecho en mobile */
    .cta {
        flex: 1;
        width: auto;
        padding: min(1.5vh, 12px) 3vw;
        font-size: clamp(0.75rem, 2.5vw, 0.9rem);
        justify-content: center;
    }

    /* Burger mobile visible en CTA panel con altura igual al CTA */
    .burger-mobile {
        display: flex;
        flex-direction: column;
        flex-shrink: 0;
        width: 44px;
        height: auto;
        padding: 0 10px;
        justify-content: center;
        align-items: center;
        align-self: stretch;
        gap: 4px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.03);
        cursor: pointer;
        transition: border-color 160ms ease, background 160ms ease;
    }

    .burger-mobile span {
        display: block;
        width: 20px;
        height: 2px;
        background: rgba(255, 255, 255, 0.78);
        border-radius: 4px;
    }

    .burger-mobile:hover {
        border-color: rgba(247, 195, 95, 0.55);
        background: rgba(247, 195, 95, 0.08);
    }


    /* Ajustar chivato rojo más abajo en mobile */
    .flow-area::before {
        top: 38%;
    }
}
