/* ─────────────────────────────────────────
   Casa de la Makana — Home Styles
   Sección 1: Hero "El Arte del Tiempo"
───────────────────────────────────────── */

/* Animación de entrada sutil y elegante (Apple style) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes vitrinaCarousel {
    0%,
    100% {
        opacity: 1;
        filter: brightness(1.06) saturate(1.06);
        transform: translate3d(0, -4%, 170px) rotateY(0deg) scale(1.08);
        z-index: 4;
    }
    16% {
        opacity: 0.9;
        filter: brightness(0.9) saturate(0.96);
        transform: translate3d(68%, 0, 10px) rotateY(-26deg) scale(0.94);
        z-index: 3;
    }
    33.333% {
        opacity: 0.74;
        filter: brightness(0.72) saturate(0.88);
        transform: translate3d(112%, 7%, -210px) rotateY(-54deg) scale(0.78);
        z-index: 2;
    }
    50% {
        opacity: 0.58;
        filter: brightness(0.58) saturate(0.82);
        transform: translate3d(0, 12%, -330px) rotateY(180deg) scale(0.68);
        z-index: 1;
    }
    66.666% {
        opacity: 0.74;
        filter: brightness(0.72) saturate(0.88);
        transform: translate3d(-112%, 7%, -210px) rotateY(54deg) scale(0.78);
        z-index: 2;
    }
    84% {
        opacity: 0.9;
        filter: brightness(0.9) saturate(0.96);
        transform: translate3d(-68%, 0, 10px) rotateY(26deg) scale(0.94);
        z-index: 3;
    }
}

@keyframes vitrinaFloat {
    0%,
    100% {
        translate: 0 0;
    }
    50% {
        translate: 0 -14px;
    }
}

.scroll-anim-ready .stagger-text {
    opacity: 0;
    filter: blur(8px);
    transform: translate3d(0, 34px, 0) scale(0.985);
    animation: none;
    transition:
        opacity 900ms cubic-bezier(0.16, 1, 0.3, 1),
        filter 900ms cubic-bezier(0.16, 1, 0.3, 1),
        transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--scroll-delay, 0ms);
    will-change: opacity, filter, transform;
}

.scroll-anim-ready .stagger-text.is-visible {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) scale(1);
}

.parallax-bg {
    transform:
        perspective(1200px)
        translate3d(0, var(--parallax-y, 0), 0)
        rotateX(var(--parallax-rotate-x, 0deg))
        rotateY(var(--parallax-rotate-y, 0deg))
        scale(var(--parallax-scale, 1.08));
    transform-origin: center center;
    will-change: transform;
    transition: none;
    backface-visibility: hidden;
}


/* ── HERO (ESTRUCTURA DE FONDO PURO A PANTALLA COMPLETA) ── */
#hero {
    position: relative;
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    overflow: hidden;
    display: flex;
    align-items: center;
    z-index: 1;
}

/* Video de fondo absoluto y 100% puro (sin overlays ni degradados artificiales) */
.hero__video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    display: block;
}

/* ── COLUMNA DE TEXTO FLOTANTE ───────── */
.hero__text {
    position: relative;
    width: 100%;
    max-width: 42rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

/* Título editorial contenido en el área oscura izquierda del hero */
.hero__title {
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    word-spacing: 0.12em;
    line-height: 1.24;
    color: #f4ad67;
    white-space: normal;
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.hero__title span {
    display: block;
}

.hero__subtitle {
    font-family: var(--font-primary);
    font-size: clamp(1.05rem, 1.15vw, 1.25rem); /* Un poco más grande para mejor presencia */
    font-weight: 300;
    line-height: 2.1;                           /* Interlineado amplio y elegante */
    letter-spacing: 0.02em;                     /* Espaciado sutil entre letras */
    color: #e0e0e0;                             /* Contraste pulido y suave */
    max-width: 800px;                           /* Mayor amplitud para asegurar que quepa en exactamente 2 líneas */
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}

/* ── Ajustes Responsivos ──────────────── */
@media (min-width: 961px) and (max-width: 1440px) {
    .hero__text {
        max-width: 35rem;
    }

    .hero__title {
        font-size: 2.3rem;
    }

    .hero__subtitle {
        max-width: 32rem;
    }
}

@media (max-width: 960px) {
    .parallax-bg {
        will-change: auto;
    }

    #hero {
        justify-content: center;
        text-align: center;
    }

    #hero::after {
        content: '';
        position: absolute;
        inset: 0;
        z-index: 1;
        pointer-events: none;
        background:
            radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.58) 0%, rgba(0, 0, 0, 0.34) 44%, rgba(0, 0, 0, 0) 76%);
    }

    .hero__video {
        object-position: 66% center;
    }

    #hero .container {
        padding: 0 1.6rem;
    }

    .hero__text {
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
        align-items: center;
        text-align: center;
    }
    
    .hero__title {
        font-size: 1.8rem;
        letter-spacing: 0.1em;
        word-spacing: 0.15em;
        white-space: normal; /* Permite saltar de línea en móviles */
    }

    .hero__subtitle {
        max-width: 100%;
        text-align: center;
    }
}


/* ═══════════════════════════════════════════════
   SECCIÓN 2: REVELACIÓN DEL PROCESO (Don José)
════════════════════════════════════════════════ */

#don-jose {
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

#don-jose,
#vitrina-section,
#mano-makana {
    content-visibility: auto;
    contain-intrinsic-size: 100vh;
}

/* ── Imagen de fondo absoluto a pantalla completa (100% puro) ── */
.dj__visual {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.dj__img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Llenado a pantalla completa exacto como el video */
    object-position: center;
    display: block;
}

/* Capa de mezcla sutil integrada para asegurar contraste visual del texto a la derecha */
#don-jose::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 2;
    pointer-events: none;
}

/* ── Contenido Flotante alineado a la derecha ── */
.dj__content {
    position: relative;
    z-index: 3; /* Flota sobre la imagen y el gradiente */
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;        /* Centra horizontalmente todos los elementos de la columna */
    padding-left: 55vw; /* Desplaza el bloque a la derecha sobre la zona oscura */
    padding-right: 8vw;
    gap: 2rem;
    transform: translateY(-5vh); /* Sube la posición del bloque exactamente un 5% de la pantalla */
}

.dj__title {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2.2vw, 2.6rem);
    font-weight: 400;
    letter-spacing: 0.12em;
    line-height: 1.4;
    color: #f4ad67;
    text-align: center;         /* Centra el texto del título */
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.dj__body {
    font-family: var(--font-primary);
    font-size: clamp(1.05rem, 1.1vw, 1.2rem);   /* Un poco más grande para mejor presencia y balance */
    font-weight: 300;
    line-height: 2.1;                           /* Interlineado cómodo y elegante */
    letter-spacing: 0.015em;                    /* Espaciado sutil */
    color: #cccccc;                             /* Tono refinado de alta gama */
    max-width: 720px;                           /* Ajustado para encajar exactamente en 4 líneas */
    text-align: center;         /* Centra el texto del párrafo */
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.45s forwards;
}

/* CTA: Botón pill */
.dj__cta,
.vitrina__cta {
    --glass-shine: rgba(255, 255, 255, 0.64);
    --glass-edge: rgba(255, 255, 255, 0.2);
    font-family: var(--font-primary);
    font-size: clamp(0.78rem, 0.72vw, 0.9rem);
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.96);
    text-decoration: none;
    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.52),
        0 0 18px rgba(255, 255, 255, 0.28);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.15rem;
    padding: 0.9rem 3rem;
    overflow: hidden;
    border-radius: 999px;
    border: 1px solid var(--glass-edge);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0.08) 42%, rgba(8, 10, 12, 0.26) 100%),
        radial-gradient(120% 165% at 14% 8%, rgba(255, 255, 255, 0.48) 0%, rgba(255, 255, 255, 0.11) 34%, transparent 62%),
        rgba(28, 31, 31, 0.2);
    backdrop-filter: blur(22px) saturate(1.35) contrast(1.04);
    -webkit-backdrop-filter: blur(22px) saturate(1.35) contrast(1.04);
    box-shadow:
        0 22px 46px rgba(0, 0, 0, 0.46),
        0 7px 16px rgba(0, 0, 0, 0.26),
        inset 0 1px 1px var(--glass-shine),
        inset 0 -14px 22px rgba(0, 0, 0, 0.22),
        inset 0 0 0 1px rgba(255, 255, 255, 0.035);
    isolation: isolate;
    transition:
        color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        background 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.dj__cta {
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.65s forwards;
}

.dj__cta::before,
.vitrina__cta::before {
    content: "";
    position: absolute;
    inset: 4px 8px auto 8px;
    height: 48%;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.05));
    opacity: 0.58;
    pointer-events: none;
    z-index: 0;
}

.dj__cta::after,
.vitrina__cta::after {
    content: "";
    position: absolute;
    inset: -32% auto -28% -36%;
    width: 52%;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.46), transparent);
    filter: blur(7px);
    opacity: 0.38;
    transform: rotate(18deg);
    pointer-events: none;
    z-index: 0;
}

/* Sobrescribir la transición de entrada del scroll anim una vez visible */
.scroll-anim-ready .stagger-text.dj__cta.is-visible {
    transition:
        color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        background 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.scroll-anim-ready .dj__cta.is-visible:hover,
.scroll-anim-ready .vitrina__cta.is-visible:hover,
.dj__cta:hover,
.vitrina__cta:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.34);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.11) 44%, rgba(10, 12, 14, 0.22) 100%),
        radial-gradient(120% 165% at 14% 8%, rgba(255, 255, 255, 0.58) 0%, rgba(255, 255, 255, 0.15) 34%, transparent 62%),
        rgba(46, 51, 50, 0.24);
    transform: translateY(-6px) scale(1.055) !important;
    filter: saturate(1.14);
    box-shadow:
        0 32px 64px rgba(0, 0, 0, 0.58),
        0 11px 22px rgba(0, 0, 0, 0.34),
        inset 0 1px 1px rgba(255, 255, 255, 0.9),
        inset 0 -12px 20px rgba(0, 0, 0, 0.16),
        inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.dj__cta:focus-visible,
.vitrina__cta:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.86);
    outline-offset: 5px;
}

/* ── Responsivo Sección 2 ──────────────────── */
@media (max-width: 960px) {
    .dj__cta,
    .vitrina__cta {
        width: min(100%, 18rem);
        min-height: 3rem;
        padding: 0.82rem 1.45rem;
        font-size: 0.72rem;
        letter-spacing: 0.11em;
    }

    #don-jose {
        height: auto;
        display: block;
    }

    .dj__visual {
        position: relative;
        height: 60vh;
        width: 100%;
    }

    .dj__img {
        object-fit: cover;
        object-position: 25% center;
    }

    #don-jose::after {
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.9) 100%);
    }

    .dj__content {
        position: relative;
        padding: 4rem 2rem;
        width: 100%;
        height: auto;
        background-color: #000000;
    }
}


/* ═══════════════════════════════════════════════
   SECCIÓN 3: LA VITRINA
════════════════════════════════════════════════ */

#vitrina-section {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ── Capa 1: Fondo absoluto puro ──────────── */
.vitrina__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 1;
    display: block;
}

/* ── Capa 2: Contenido flotante ───────────── */
.vitrina__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.4rem;
    width: min(100%, 1180px);
    padding: 0 2rem;
}

/* Título */
.vitrina__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.5vw, 4rem);
    font-weight: 400;
    letter-spacing: 0.18em;
    color: #f4ad67;
    text-align: center;
    translate: 0 -8vh;
    margin-bottom: -2.2rem;
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

/* ── Contenedor de tarjetas ───────────────── */
.vitrina__cards {
    position: relative;
    width: min(86vw, 980px);
    height: clamp(330px, 44vw, 560px);
    display: grid;
    place-items: center;
    perspective: 1400px;
    transform-style: preserve-3d;
    animation: vitrinaFloat 6.6s ease-in-out infinite;
    isolation: isolate;
    touch-action: pan-y;
    cursor: grab;
    user-select: none;
}

.vitrina__cards.is-dragging {
    cursor: grabbing;
}

/* Tarjeta base */
.vitrina__card {
    position: absolute;
    width: clamp(210px, 25vw, 360px);
    height: clamp(285px, 34vw, 500px);
    border-radius: 32px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow:
        0 38px 90px rgba(0, 0, 0, 0.52),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transform-style: preserve-3d;
    transform-origin: center center;
    backface-visibility: hidden;
    will-change: transform, filter, opacity;
    animation: vitrinaCarousel 15s linear infinite;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    pointer-events: auto;
}

.vitrina__cards.is-touching .vitrina__card {
    animation-play-state: paused;
}

.vitrina__card::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 38%),
        linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.26));
}

.vitrina__card-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translateZ(1px) scale(1.02);
}

/* Tarjetas laterales */
.vitrina__card--side {
    z-index: 2;
}

/* Tarjeta central — Foco principal */
.vitrina__card--center {
    z-index: 3;
    box-shadow:
        0 44px 110px rgba(0, 0, 0, 0.66),
        inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

#vitrina-1 {
    animation-delay: -10s;
}

#vitrina-2 {
    animation-delay: -5s;
}

#vitrina-3 {
    animation-delay: 0s;
}

.vitrina__card:hover {
    filter: brightness(1.08) saturate(1.08);
    box-shadow:
        0 52px 120px rgba(0, 0, 0, 0.72),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

/* ── Botón CTA Pill ───────────────────────── */
.vitrina__cta {
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.65s forwards;
}

/* Sobrescribir la transición de entrada del scroll anim una vez visible */
.scroll-anim-ready .stagger-text.vitrina__cta.is-visible {
    transition:
        color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        background 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* ── Responsivo Sección 3 ──────────────────── */
@media (max-width: 960px) {
    #vitrina-section {
        min-height: 100vh;
        height: auto;
        padding: 6rem 1rem;
        gap: 2rem;
    }

    .vitrina__content {
        gap: 1.6rem;
        padding: 0;
    }

    .vitrina__title {
        margin-bottom: -0.8rem;
    }

    .vitrina__cards {
        width: 100%;
        height: clamp(310px, 86vw, 470px);
        perspective: 900px;
    }

    .vitrina__card {
        width: clamp(190px, 58vw, 280px);
        height: clamp(260px, 78vw, 400px);
        border-radius: 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vitrina__cards,
    .vitrina__card {
        animation: none;
    }

    .vitrina__cards {
        display: flex;
        gap: 1rem;
        height: auto;
        perspective: none;
    }

    .vitrina__card {
        position: relative;
        width: clamp(150px, 24vw, 260px);
        height: clamp(220px, 34vw, 380px);
        opacity: 1;
        filter: none;
        transform: none;
    }
}


/* ═══════════════════════════════════════════════
   SECCIÓN 4: MANO MAKANA
════════════════════════════════════════════════ */

#mano-makana {
    width: 100vw;
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    background: #000000;
}

.mano__frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000000;
    box-shadow: none;
}

.mano__frame::before,
.mano__frame::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 0;
    z-index: 2;
    pointer-events: none;
    background: #000000;
}

.mano__frame::before {
    top: 0;
}

.mano__frame::after {
    bottom: 0;
}

.mano__video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center center;
}

.mano__title {
    position: absolute;
    left: 53%;
    top: 44%;
    z-index: 3;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: clamp(1.55rem, 3vw, 3.4rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0.16em;
    color: #ffffff;
    text-align: center;
    white-space: nowrap;
    text-shadow: 0 16px 42px rgba(0, 0, 0, 0.72);
}

@media (max-width: 960px) {
    #mano-makana {
        height: 100vh;
        padding: 0;
    }

    .mano__frame {
        width: 100vw;
        height: 100%;
        box-shadow: none;
    }

    .mano__frame::before,
    .mano__frame::after {
        height: 0;
        display: none;
    }

    .mano__title {
        top: 45%;
        font-size: clamp(1.35rem, 7vw, 2.2rem);
        letter-spacing: 0.12em;
    }

    .mano__video {
        width: 194%;
        max-width: none;
        transform: translateX(-47%);
    }
}

.zootipo-signature {
    position: fixed;
    right: clamp(1rem, 2vw, 1.5rem);
    bottom: clamp(1rem, 2vw, 1.5rem);
    z-index: 30;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.42rem;
    border: 1px solid rgba(214, 183, 142, 0.26);
    border-radius: 999px;
    background: rgba(255, 252, 246, 0.92);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
    opacity: 0.82;
    transition:
        opacity 180ms ease,
        transform 180ms ease,
        border-color 180ms ease;
}

.zootipo-signature:hover {
    opacity: 1;
    transform: translateY(-2px);
    border-color: rgba(214, 183, 142, 0.72);
}

.zootipo-signature__logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 768px) {
    .zootipo-signature {
        right: 0.85rem;
        bottom: 0.85rem;
        width: 46px;
        height: 46px;
        padding: 0.36rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zootipo-signature {
        transition: none;
    }
}
