/*    Home Hero    */

html.is-hero-scroll-lock,
html.is-hero-scroll-lock body {
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
}

html {
    scrollbar-gutter: stable;
}

.home-hero {
    --seleccion-time: 1000ms;
    --home-hero-grid-size: 60px;
    position: relative;
    width: 100%;
    overflow-x: clip;
    overflow-y: visible;
    box-sizing: border-box;
    background: #fff;
}

.home-hero *,
.home-hero *::before,
.home-hero *::after {
    box-sizing: border-box;
}

.home-hero__inner {
    --hero-title-center: calc(50% - 50px);
    position: relative;
    width: 100%;
    min-height: 550px;
    height: calc(100vh - 100px);
    height: calc(100dvh - 100px);
    margin: 0 auto;
    overflow: visible;
}

.home-hero__grilla {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: grid;
    pointer-events: auto;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.home-hero.is-started .home-hero__grilla {
    opacity: 1;
}

.home-hero__grilla-celda {
    /* Alpha bajo en el color, no en el contenedor — así el hover (is-lit) no se diluye */
    --celda-border: 1px dashed rgba(18, 18, 19, 0.1);
    border: var(--celda-border);
    background-color: transparent;
    transition: background-color 600ms ease;
    border-bottom: none;
    border-right: none;
}

.home-hero__grilla-celda.home-hero__grilla-celda--ultima-fila {
    border-bottom: var(--celda-border);
}

.home-hero__grilla-celda.home-hero__grilla-celda--ultima-columna {
    border-right: var(--celda-border);
}

.home-hero__grilla-celda.is-lit {
    background-color: #F8F8F8;
}

.home-hero__seleccion {
    position: absolute;
    top: var(--hero-title-center);
    left: 50%;
    transform: translate(-50%, -50%);
    width: 727px;
    height: 189px;
    z-index: 1;
    pointer-events: none;
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    opacity: 0;
    transition: opacity var(--seleccion-time) ease-in-out;
}

.home-hero__seleccion.is-selected {
    opacity: 1;
    pointer-events: auto;
}

.home-hero__seleccion-borde {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px dashed rgba(18, 18, 19, 0.2);
    overflow: visible;
    opacity: 1;
}

.home-hero__handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 1px solid rgba(18, 18, 19, 0.2);
    z-index: 2;
    opacity: 1;
}

.home-hero__handle--tl { top: -5px; left: -5px; }
.home-hero__handle--tr { top: -5px; right: -5px; }
.home-hero__handle--tc { top: -5px; left: 50%; margin-left: -5px; }
.home-hero__handle--bl { bottom: -5px; left: -5px; }
.home-hero__handle--br { bottom: -5px; right: -5px; }
.home-hero__handle--bc { bottom: -5px; left: 50%; margin-left: -5px; }

.home-hero__titulo {
    position: absolute;
    top: var(--hero-title-center);
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--wp--preset--font-family--inter-display);
    font-weight: 700;
    font-size: 180px;
    line-height: 95px;
    letter-spacing: -1.8px;
    color: var(--wp--preset--color--custom-titulos);
    text-align: center;
    white-space: nowrap;
    z-index: 5;
    margin: 0;
    padding: 0;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.home-hero__elemento {
    --he-rot: 0deg;
    --he-scale: 1;
    position: absolute;
    z-index: 5;
    opacity: 0;
    transform: rotate(var(--he-rot)) scale(var(--he-scale));
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.home-hero__elemento.is-visible {
    opacity: 1;
}

.home-hero__wireframe {
    top: calc(var(--hero-title-center) - 202px);
    left: 36px;
    width: 214px;
    height: 160px;
    --he-rot: 5.83deg;
}

.home-hero__wireframe img {
    width: 100%;
    height: 100%;
}

.home-hero__codigo {
    top: calc(var(--hero-title-center) + 172px);
    right: 164px;
    width: 214px;
    height: 160px;
    --he-rot: -5.94deg;
}

.home-hero__codigo-fondo {
    position: relative;
    width: 100%;
    height: 100%;
}

.home-hero__codigo-fondo img {
    width: 100%;
    height: 100%;
}

.home-hero__codigo-texto {
    position: absolute;
    top: 39px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    font-family: var(--wp--preset--font-family--jetbrains-mono);
    font-weight: 700;
    font-size: 8px;
    line-height: 1.2;
    letter-spacing: -0.08px;
    color: #d2d2d2;
    white-space: pre-wrap;
    overflow: hidden;
}

.home-hero__codigo-texto .js-typing-cursor {
    display: inline-block;
    width: 1px;
    height: 10px;
    background: #d2d2d2;
    margin-left: 1px;
    vertical-align: text-bottom;
    animation: home-hero-blink 0.8s step-end infinite;
}

@keyframes home-hero-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.home-hero__chat {
    top: calc(var(--hero-title-center) + 150px);
    left: 352px;
    width: 214px;
    height: 160px;
    --he-rot: 4.85deg;
}

.home-hero__chat img {
    width: 100%;
    height: 100%;
}

.home-hero__diseno {
    top: calc(var(--hero-title-center) - 232px);
    right: -50px;
    width: 312px;
    height: 237px;
    --he-rot: -3.52deg;
}

.home-hero__diseno-borde {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(18, 18, 19, 0.2);
    border-radius: 8px;
    z-index: 1;
}

.home-hero__diseno img {
    position: relative;
    width: 300px;
    height: auto;
    border-radius: 4px;
    display: block;
    margin: 6px 6px 0;
    z-index: 2;
}

.home-hero__pc {
    top: calc(var(--hero-title-center) + 26px);
    left: -236px;
    width: 546px;
    --he-rot: -4.32deg;
}

.home-hero__pc-contenedor {
    position: relative;
}

.home-hero__pc-frame {
    display: block;
    width: 100%;
    height: auto;
}

.home-hero__pc-screen {
    position: absolute;
    top: 7.2%;
    left: 11.6%;
    width: 77.4%;
    height: auto;
}

.home-hero__celular {
    top: calc(var(--hero-title-center) + 20px);
    right: -32px;
    width: 162px;
    --he-rot: 3.74deg;
}

.home-hero__celular-contenedor {
    position: relative;
}

.home-hero__celular-frame {
    display: block;
    width: 100%;
    height: auto;
}

.home-hero__celular-screen {
    position: absolute;
    top: 14%;
    left: 11.5%;
    width: 77%;
    height: auto;
}

.home-hero__switch {
    top: calc(var(--hero-title-center) - 178px);
    left: 50%;
    transform: translateX(-50%) scale(var(--he-scale));
    z-index: 6;
    --he-scale: 1;
}

.home-hero__switch-pill {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0px 15px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 20px;
    box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    height: 50px;
}

.home-hero__switch-label {
    font-family: var(--wp--preset--font-family--inter-display);
    font-weight: 500;
    font-size: 13px;
    line-height: 1.45;
    letter-spacing: 0.01em;
    color: var(--wp--preset--color--custom-titulos);
}

.home-hero__switch-toggle {
    --switch-height: 24px;
    --switch-px: 1px;
    display: flex;
    align-items: center;
    width: auto;
    height: var(--switch-height);
    aspect-ratio: 40 / 24;
    background: #0070F3;
    border-radius: 20px;
    padding: 0 var(--switch-px);
    justify-content: flex-end;
    flex-shrink: 0;
    box-sizing: border-box;
}

.home-hero__switch-toggle-knob {
    --knob-size: calc(var(--switch-height) - var(--switch-px) * 2);
    width: var(--knob-size);
    height: var(--knob-size);
    background: #fff;
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
}

.home-hero__comentario {
    z-index: 7;
}

.home-hero__comentario--1 {
    top: calc(var(--hero-title-center) - 134px);
    right: 172px;
}

.home-hero__comentario--2 {
    top: calc(var(--hero-title-center) + 150px);
    left: 60%;
    transform: translateX(-50%) scale(var(--he-scale));
}

.home-hero__app {
    position: absolute;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 10px;
    box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);
    z-index: 6;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.home-hero__app.is-visible {
    opacity: 1;
}

.home-hero__app img {
    display: block;
    max-width: 30px;
    max-height: 30px;
    transform: scale(0.5);
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.home-hero__app.is-visible img {
    transform: scale(1);
}

.home-hero__app--vscode { top: calc(var(--hero-title-center) - 250px); left: 430px; }
.home-hero__app--figma { top: calc(var(--hero-title-center) - 254px); right: 372px; }
.home-hero__app--notion { top: calc(var(--hero-title-center) - 84px); left: 304px; }
.home-hero__app--notion2 { top: calc(var(--hero-title-center) + 133px); left: 265px; }
.home-hero__app--wordpress { top: calc(var(--hero-title-center) + 256px); left: 50%; transform: translateX(-50%); }

.home-hero__titulo.is-draggable {
    cursor: move;
}

.home-hero__cursores {
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
}

.home-hero__cursor {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    opacity: 0;
    transition: opacity 0.5s ease;
    will-change: transform;
}

.home-hero__cursor.is-visible {
    opacity: 1;
}


.home-hero__cursor svg {
    width: 15px;
    height: 17px;
    display: block;
    flex-shrink: 0;
    transform-origin: top left;
    transition: transform 0.16s ease;
}

.home-hero__cursor.is-clicking svg {
    transform: scale(0.9);
}

.home-hero__cursor-label {
    display: inline-flex;
    align-items: center;
    padding: 0 6px;
    margin-left: 9px;
    margin-top: 2px;
    font-family: var(--wp--preset--font-family--inter-display);
    font-weight: 500;
    font-size: 13px;
    line-height: 1.45;
    letter-spacing: 0.13px;
    color: #fff;
    white-space: nowrap;
    border-radius: 0 5px 5px 5px;
    transition: transform 0.16s ease;
}

.home-hero__cursor.is-clicking .home-hero__cursor-label {
    transform: translate(1px, 1px);
}

.home-hero__cursor--desarrollador  { top: calc(var(--hero-title-center) + 306px); left: 402px; }
.home-hero__cursor--cliente        { top: calc(var(--hero-title-center) + 102px); right: 184px; }
.home-hero__cursor--director       { top: calc(var(--hero-title-center) - 156px); left: 604px; }
.home-hero__cursor--ui             { top: calc(var(--hero-title-center) - 42px); left: 188px; }
.home-hero__cursor--ux             { top: calc(var(--hero-title-center) + 60px); left: 336px; }
.home-hero__cursor--pm             { top: calc(var(--hero-title-center) + 14px); right: 264px; }
.home-hero__cursor--desarrollador2 { top: calc(var(--hero-title-center) + 354px); left: 58%; }

/* ---- Cursores: movimiento controlado por JS (scroll-driven) ----
   Sin transition de transform sobre el cursor: el recorrido lo escribe el RAF
   frame a frame y una transición CSS encima lo vuelve arrastrado. */

.home-hero__switch-pill,
.home-hero__switch-toggle,
.home-hero__switch-toggle-knob {
    transition: none;
}

.home-hero-editor {
    position: relative;
}

.home-hero-editor__preview {
    position: relative;
    min-height: 400px;
    background: #fafafa;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.home-hero-editor__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

.home-hero-editor__selection {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 100px;
}

.home-hero-editor__selection-border {
    position: absolute;
    inset: 0;
    border: 1px dashed rgba(18, 18, 19, 0.2);
}

.home-hero-editor__handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #fff;
    border: 1px solid rgba(18, 18, 19, 0.2);
}

.home-hero-editor__handle--tl { top: -4px; left: -4px; }
.home-hero-editor__handle--tr { top: -4px; right: -4px; }
.home-hero-editor__handle--tc { top: -4px; left: 50%; transform: translateX(-50%); }
.home-hero-editor__handle--bl { bottom: -4px; left: -4px; }
.home-hero-editor__handle--br { bottom: -4px; right: -4px; }
.home-hero-editor__handle--bc { bottom: -4px; left: 50%; transform: translateX(-50%); }

.home-hero-editor__titulo-wrap {
    position: relative;
    z-index: 5;
    text-align: center;
}

.home-hero-editor__titulo {
    font-family: var(--wp--preset--font-family--inter-display);
    font-weight: 700;
    font-size: 72px;
    line-height: 1;
    letter-spacing: -1.8px;
    color: var(--wp--preset--color--custom-titulos);
    margin: 0;
}

.home-hero-editor__cursores {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.home-hero-editor__cursor {
    position: absolute;
    display: inline-block;
    padding: 2px 8px;
    font-family: var(--wp--preset--font-family--inter-display);
    font-weight: 500;
    font-size: 11px;
    color: #fff;
    border-radius: 0 4px 4px 4px;
    white-space: nowrap;
}

.home-hero-editor__label {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    font-family: var(--wp--preset--font-family--inter-display);
}

@media (max-width: 1023px) {
    .home-hero {
        --home-hero-grid-size: 45px;
    }

    .home-hero__inner {
        --hero-title-center: calc(50% - 97px);
        min-height: 550px;
        height: calc(100vh - 100px);
        height: calc(100svh - 100px);
    }

    .home-hero__titulo {
        font-size: 64px;
        line-height: 64px;
    }

    .home-hero__seleccion {
        width: 80%;
        height: 100px;
        top: var(--hero-title-center);
    }

    .home-hero__elemento {
        --he-scale: 0.6;
    }

    .home-hero__wireframe {
        top: -10px;
        left: -50px;
    }

    .home-hero__codigo {
        top: 350px;
        right: -30px;
    }

    .home-hero__chat {
        bottom: 40px;
        left: 20%;
    }

    .home-hero__diseno {
        top: 60px;
        right: -80px;
        width: 200px;
    }

    .home-hero__pc {
        top: 280px;
        left: -200px;
        width: 350px;
    }

    .home-hero__celular {
        top: 260px;
        right: -50px;
        width: 100px;
    }

    .home-hero__switch {
        top: 20px;
        --he-scale: 1;
    }

    .home-hero__switch-pill {
        padding: 0px 12px;
        gap: 8px;
        height: 38px;
    }

    .home-hero__switch-label {
        font-size: 11px;
    }

    .home-hero__switch-toggle {
        --switch-height: 18px;
    }

    .home-hero__switch-toggle-knob {
    }

    .home-hero__comentario--1 {
        top: 110px;
        right: 40px;
    }

    .home-hero__comentario--2 {
        top: 330px;
        left: 40%;
    }

    .home-hero__app {
        width: 40px;
        height: 40px;
    }

    .home-hero__app img {
        max-width: 20px;
        max-height: 20px;
        width: auto;
    }

    .home-hero__app--vscode { top: 70px; left: 25%; }
    .home-hero__app--figma { top: 60px; right: 25%; }
    .home-hero__app--notion { top: 270px; left: 15%; }
    .home-hero__app--notion2 { top: 450px; left: 15%; }
    .home-hero__app--wordpress { top: 400px; left: 45%; }

    .home-hero__cursor-label {
        font-size: 10px;
        padding: 0 4px;
    }

    .home-hero__cursor--desarrollador  { top: 400px; left: 20%; }
    .home-hero__cursor--cliente        { top: 310px; right: 10%; }
    .home-hero__cursor--director       { top: 140px; left: 35%; }
    .home-hero__cursor--ui             { top: 220px; left: 8%; }
    .home-hero__cursor--ux             { top: 280px; left: 18%; }
    .home-hero__cursor--pm             { top: 260px; right: 15%; }
    .home-hero__cursor--desarrollador2 { top: 430px; left: 50%; }

    .home-hero-editor__titulo {
        font-size: 40px;
    }

}

.home-hero {
    transition: background-color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* El borde de las ~500 celdas de la grilla cambia al instante en dark mode:
   animarlo todo junto repinta un área enorme y tilda el toggle. */

.home-hero__seleccion-borde {
    transition: border-color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.home-hero__handle {
    transition: background-color 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.home-hero__titulo {
    transition: color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.home-hero__switch-label {
    transition: color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.home-hero__diseno-borde {
    transition: border-color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Las burbujas/apps con backdrop-filter cambian de fondo al instante (sin transición):
   animar su fondo obliga a recalcular el desenfoque en cada frame y tilda el toggle. */
.home-hero .comentario-figma__header,
.home-hero .comentario-figma__texto {
    transition: color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

body.is-dark .home-hero {
    background: #010101;
}

body.is-dark .home-hero__grilla-celda {
    border-color: rgba(255, 255, 255, 0.08);
}

body.is-dark .home-hero__grilla-celda.is-lit {
    background-color: rgba(255, 255, 255, 0.05);
}

body.is-dark .home-hero__seleccion-borde {
    border-color: rgba(255, 255, 255, 0.2);
}

body.is-dark .home-hero__handle {
    background: #111;
    border-color: rgba(255, 255, 255, 0.2);
}

body.is-dark .home-hero__titulo {
    color: #fff;
}

body.is-dark .home-hero__switch-pill {
    background: rgba(17, 17, 17, 0.86);
    box-shadow: 0px 1px 6px rgba(0, 0, 0, 0.35);
}

body.is-dark .home-hero__switch-label {
    color: #fff;
}

body.is-dark .home-hero__app {
    background: rgba(17, 17, 17, 0.86);
    box-shadow: 0px 1px 6px rgba(0, 0, 0, 0.35);
}

body.is-dark .home-hero__diseno-borde {
    border-color: rgba(255, 255, 255, 0.2);
}

body.is-dark .home-hero .comentario-figma__burbuja {
    background: rgba(17, 17, 17, 0.86);
    box-shadow: 0px 1px 8px rgba(0, 0, 0, 0.32);
}

body.is-dark .home-hero .comentario-figma__header,
body.is-dark .home-hero .comentario-figma__texto {
    color: #fff;
}

body.is-dark .home-hero .comentario-figma__header span {
    color: rgba(255, 255, 255, 0.55);
}

/* Durante el cambio de tema, los elementos con backdrop-filter desactivan el desenfoque:
   recalcularlo en cada frame mientras el fondo de la sección se funde detrás tilda el toggle. */
body.theme-switching .home-hero__app,
body.theme-switching .home-hero__switch-pill,
body.theme-switching .home-hero .comentario-figma__burbuja {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
