/* Vinoc — Home. Se apoya en css/vinoc-wholesale.css (.wh) y agrega la portada, el recorrido animado
   al hacer scroll y el modo claro / oscuro (html[data-theme]). */

/* ── Tema: el home usa estas variables; .hm-dark vuelve al oscuro dentro de un bloque ── */
.wh.hm {
    --hm-text-soft: #dcd7e6;
    --hm-band: #151216;
    --hm-ghost: rgba(255, 255, 255, .28);
    --hm-ghost-hover: rgba(255, 255, 255, .06);
    transition: background-color .3s ease, color .3s ease;
}

html[data-theme="light"] .wh.hm {
    --wh-bg: #ffffff;
    --wh-surface: #f6f4f9;
    --wh-surface-2: #eeebf4;
    --wh-line: rgba(26, 22, 28, .14);
    --wh-text: #1a161c;
    --wh-muted: #5d566a;
    --wh-accent: #5b51a0;
    --hm-text-soft: #37313c;
    --hm-band: #f6f4f9;
    --hm-ghost: rgba(26, 22, 28, .3);
    --hm-ghost-hover: rgba(26, 22, 28, .05);
}

html[data-theme="light"] .wh.hm .hm-dark,
.wh.hm .hm-dark {
    --wh-bg: #120f12;
    --wh-surface: #1c181d;
    --wh-line: rgba(255, 255, 255, .1);
    --wh-text: #ffffff;
    --wh-muted: #b9b3c4;
    --wh-accent: #a79df0;
    --hm-text-soft: #dcd7e6;
    --hm-ghost: rgba(255, 255, 255, .28);
    --hm-ghost-hover: rgba(255, 255, 255, .06);
    color: var(--wh-text);
}

.wh.hm .wh-band {
    background: var(--hm-band);
}

.wh.hm .wh-btn--ghost {
    border-color: var(--hm-ghost);
    color: var(--wh-text) !important;
}

.wh.hm .wh-btn--ghost:hover {
    border-color: var(--wh-text);
    background: var(--hm-ghost-hover);
}

/* Botón de tema (lo agrega js/vinoc-home.js al menú, que siempre es oscuro).
   Va siempre al final de la barra, a la derecha de ES / EN; nunca junto al logo. */
.vn-theme {
    order: 3;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 34px;
    margin-left: -12px;
    padding: 0 12px 0 10px;
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font-family: 'Noto Sans', sans-serif;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

.vn-theme:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, .08);
}

.vn-theme:focus-visible {
    outline: 2px solid #a79df0;
    outline-offset: 2px;
}

.vn-theme svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #ffc400;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* muestra el modo al que cambia: luna en claro, sol en oscuro */
.vn-theme .vn-theme__moon,
html[data-theme="light"] .vn-theme .vn-theme__sun {
    display: none;
}

html[data-theme="light"] .vn-theme .vn-theme__moon {
    display: block;
}

/* En el home, la página completa sigue el tema (también lo que asoma al rebotar el scroll) */
html[data-theme="dark"] body {
    background: #120f12;
}

@media (max-width: 1139.98px) {
    /* sin espacio para el texto: queda solo el icono, en un círculo */
    .vn-theme {
        width: 36px;
        padding: 0;
    }

    .vn-theme__label {
        display: none;
    }
}

@media (max-width: 991.98px) {
    /* logo a la izquierda; a la derecha: ES / EN, tema y menú */
    .vn-header.has-theme .vn-lang {
        order: 1;
        margin-left: auto;
    }

    .vn-theme {
        order: 2;
        width: 38px;
        height: 38px;
        margin-left: 4px;
    }

    .vn-header:not(.has-lang) .vn-theme {
        margin-left: auto;
    }

    .vn-header.has-theme .vn-toggle {
        order: 3;
        margin-left: 4px;
    }
}

/* ── Aparición al hacer scroll ── */
.hm-reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1);
    transition-delay: calc(var(--hm-i, 0) * 80ms);
}

.hm-reveal.is-in {
    opacity: 1;
    transform: none;
}

/* ── Portada: el video es parte del fondo, no un recuadro ── */
.hm-hero {
    position: relative;
    isolation: isolate;
    min-height: calc(100vh - 68px);
    min-height: calc(100svh - 68px);
    display: flex;
    align-items: center;
    padding: 72px 0 112px;
    overflow: hidden;
    background: var(--wh-bg);
}

.hm-hero__art {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    width: 72%;
    /* los bordes se disuelven en el fondo de la página */
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 42%, #000 86%, transparent 100%), linear-gradient(180deg, transparent 0%, #000 22%, #000 74%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 42%, #000 86%, transparent 100%), linear-gradient(180deg, transparent 0%, #000 22%, #000 74%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
    opacity: 0;
    animation: hm-fade 1.6s ease .15s forwards;
}

/* En modo claro el mismo clip se invierte: hilos violeta sobre fondo blanco */
html[data-theme="light"] .hm-hero__art {
    filter: invert(1) hue-rotate(180deg) saturate(1.5) contrast(1.08);
    mix-blend-mode: multiply;
}

@keyframes hm-fade {
    to {
        opacity: 1;
    }
}

.hm-hero__copy {
    max-width: 640px;
}

.hm-hero h1 {
    font-size: clamp(40px, 5.4vw, 72px);
    line-height: 1.03;
    letter-spacing: -.02em;
}

.hm-hero h1 em {
    font-style: normal;
    color: var(--wh-accent);
}

.hm-hero__lead {
    max-width: 50ch;
    margin-top: 24px !important;
    font-size: clamp(17px, 1.5vw, 20px);
    color: var(--hm-text-soft) !important;
}

.hm-hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 36px;
}

.wh .hm-hero__media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

/* entrada escalonada */
.hm-hero__copy > * {
    opacity: 0;
    transform: translateY(22px);
    animation: hm-rise .9s cubic-bezier(.2, .7, .2, 1) forwards;
}

.hm-hero__copy > :nth-child(2) { animation-delay: .12s; }
.hm-hero__copy > :nth-child(3) { animation-delay: .24s; }
.hm-hero__copy > :nth-child(4) { animation-delay: .36s; }

@keyframes hm-rise {
    to {
        opacity: 1;
        transform: none;
    }
}

.hm-scroll {
    position: absolute;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--wh-muted) !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
    text-decoration: none;
    text-transform: uppercase;
}

.hm-scroll::after {
    content: "";
    width: 1px;
    height: 30px;
    background: linear-gradient(180deg, var(--wh-accent), transparent);
    animation: hm-drip 1.8s ease-in-out infinite;
    transform-origin: top;
}

@keyframes hm-drip {
    0% { transform: scaleY(0); opacity: 0; }
    40% { transform: scaleY(1); opacity: 1; }
    100% { transform: scaleY(1) translateY(14px); opacity: 0; }
}

/* ── Recorrido: conectividad, empresa, talento ── */
.hm-story {
    position: relative;
    padding: 40px 0 0;
    background: #120f12;
}

/* el tema pone overflow: hidden en <section>; aquí rompería el video fijo */
.wh .hm-story {
    overflow: visible;
}

.hm-story__intro {
    padding: 72px 0 8px;
}

.hm-story__grid {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 64px;
    align-items: start;
}

.hm-stage {
    position: sticky;
    top: calc(68px + (100vh - 68px - min(70vh, 600px)) / 2);
    height: min(70vh, 600px);
    margin-right: -48px;
    /* sin marco: los bordes del video se disuelven en el fondo */
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 22%, #000 88%, transparent 100%), linear-gradient(180deg, transparent 0%, #000 16%, #000 84%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 22%, #000 88%, transparent 100%), linear-gradient(180deg, transparent 0%, #000 16%, #000 84%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
}

.wh .hm-stage__clip {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity .8s ease, transform 1.4s ease;
}

.wh .hm-stage__clip.is-active {
    opacity: 1;
    transform: none;
}

.hm-stage__bar {
    position: absolute;
    left: 26%;
    right: 16%;
    bottom: 19%;
    display: flex;
    gap: 8px;
}

.hm-stage__bar span {
    flex: 1;
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .28);
    transition: background-color .4s ease;
}

.hm-stage__bar span.is-active {
    background: var(--wh-gold);
}

.hm-step {
    min-height: 88vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 0;
    opacity: .3;
    transition: opacity .5s ease;
}

.hm-step.is-active {
    opacity: 1;
}

.hm-step__n {
    display: block;
    margin-bottom: 14px;
    color: var(--wh-accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.hm-step h3 {
    font-size: clamp(28px, 3.2vw, 40px);
    line-height: 1.12;
}

.hm-step > p {
    max-width: 46ch;
    margin-top: 16px;
    font-size: 18px;
}

.hm-links {
    margin-top: 26px !important;
    display: grid;
    gap: 0;
    border-top: 1px solid var(--wh-line);
}

.hm-links li {
    border-bottom: 1px solid var(--wh-line);
}

.hm-links a,
.hm-links span.hm-links__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 2px;
    color: var(--wh-text) !important;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
    transition: padding-left .2s ease, color .2s ease;
}

.hm-links small {
    color: var(--wh-muted);
    font-size: 14px;
    font-weight: 400;
    text-align: right;
}

.hm-links a {
    position: relative;
    padding-right: 30px;
}

.hm-links a::after {
    content: "→";
    position: absolute;
    right: 2px;
    top: 14px;
    color: var(--wh-accent);
    transition: transform .2s ease;
}

.hm-links a small {
    margin-left: auto;
}

.hm-links a:hover {
    padding-left: 8px;
    color: var(--wh-accent) !important;
}

.hm-links a:hover::after {
    transform: translateX(4px);
}

/* ── N3T (siempre oscuro) ── */
.hm-n3t {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid rgba(167, 157, 240, .35);
    border-radius: 20px;
    background: linear-gradient(120deg, #2a2350 0%, #1c181d 62%);
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    align-items: stretch;
}

.hm-n3t__copy {
    padding: 52px 48px;
}

.hm-n3t__copy h2 {
    font-size: clamp(28px, 3.2vw, 40px);
}

.hm-n3t__copy p {
    max-width: 48ch;
    margin-top: 14px;
    font-size: 18px;
    color: var(--hm-text-soft);
}

.hm-n3t__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.wh .hm-n3t__img {
    width: 100%;
    height: 100%;
    min-height: 280px;
    max-width: none;
    object-fit: cover;
}

/* ── Confianza ── */
.hm-trust {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-top: 44px;
}

.hm-trust > div {
    padding-top: 22px;
    border-top: 2px solid var(--wh-purple);
}

.hm-trust h3 {
    font-size: 20px;
}

.hm-trust p {
    margin-top: 8px;
    font-size: 16px;
}

/* ── Contacto (siempre oscuro) ── */
.wh.hm .wh-contact {
    background: #120f12;
}

.hm-contact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 40px;
}

.hm-contact a {
    display: block;
    padding: 26px 24px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 14px;
    background: rgba(18, 15, 18, .78);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    text-decoration: none;
    transition: border-color .2s ease, transform .2s ease;
}

.hm-contact a:hover {
    border-color: var(--wh-gold);
    transform: translateY(-3px);
}

.hm-contact strong {
    display: block;
    color: #fff;
    font-size: 20px;
}

.hm-contact span {
    display: block;
    margin-top: 6px;
    color: var(--wh-muted);
    font-size: 15.5px;
}

/* ───────── Tablet ───────── */
@media (max-width: 991.98px) {
    .hm-hero {
        min-height: 0;
        padding: 64px 0 72px;
    }

    .hm-hero__art {
        width: 100%;
        opacity: 0;
        -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 70%, transparent 100%);
        mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 70%, transparent 100%);
        animation-name: hm-fade-soft;
    }

    @keyframes hm-fade-soft {
        to {
            opacity: .5;
        }
    }

    .hm-scroll {
        display: none;
    }

    /* El video queda fijo arriba y los textos pasan por debajo */
    .hm-story__grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .hm-stage {
        order: -1;
        top: 60px;
        z-index: 2;
        height: 38vh;
        margin: 0 -24px;
        background: #120f12;
        -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 78%, transparent 100%);
        mask-image: linear-gradient(180deg, #000 0%, #000 78%, transparent 100%);
    }

    .hm-stage__bar {
        left: 24px;
        right: 24px;
        bottom: 26%;
    }

    .hm-step {
        min-height: 62vh;
        justify-content: flex-start;
        padding: 44px 0 24px;
    }

    .hm-trust,
    .hm-contact {
        grid-template-columns: 1fr 1fr;
    }

    .hm-n3t {
        grid-template-columns: 1fr;
    }

    .wh .hm-n3t__img {
        order: -1;
        height: 260px;
        min-height: 0;
    }
}

/* ───────── Móvil ───────── */
@media (max-width: 599.98px) {
    .hm-hero {
        padding: 48px 0 56px;
    }

    .hm-hero__cta .wh-btn {
        width: 100%;
    }

    .hm-stage {
        height: 32vh;
        margin: 0 -16px;
    }

    .hm-story__intro {
        padding: 48px 0 0;
    }

    .hm-trust,
    .hm-contact {
        grid-template-columns: 1fr;
    }

    .hm-n3t__copy {
        padding: 32px 22px 36px;
    }

    .hm-links a,
    .hm-links span.hm-links__row {
        flex-wrap: wrap;
        gap: 2px 12px;
    }

    .hm-links small {
        flex-basis: 100%;
        order: 2;
        text-align: left;
        margin-left: 0 !important;
    }
}

/* ───────── Sin animaciones ───────── */
@media (prefers-reduced-motion: reduce) {
    .hm-reveal,
    .hm-hero__copy > *,
    .hm-hero__art {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
    }

    .hm-scroll::after {
        animation: none;
    }

    .hm-step {
        opacity: 1;
    }
}
