/* Intro premium a medida — logo ICASA (SVG agrupado) */

.logo-container--full {
    position: relative;
    isolation: isolate;
    /* Contiene órbita, brillos y transforms dentro del logo */
    overflow: hidden;
    contain: paint;
    border-radius: 6px;
}

.logo-full--svg {
    display: block;
    height: 72px;
    width: auto;
    max-width: min(300px, 68vw);
    line-height: 0;
}

.logo-full--svg .logo-icasa-svg {
    display: block;
    width: auto;
    height: 72px;
    max-width: min(300px, 68vw);
    overflow: visible;
}

.logo-full-fx {
    display: block;
    position: relative;
    transform-origin: left center;
    will-change: transform, opacity, filter;
    overflow: hidden;
    contain: paint;
    border-radius: 4px;
}

.logo-full-shine {
    pointer-events: none;
    position: absolute;
    /* Solo dentro del logo, sin salirse al menú */
    inset: 0;
    width: 42%;
    border-radius: 4px;
    opacity: 0;
    z-index: 3;
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(109, 212, 0, 0.2) 30%,
        rgba(160, 236, 70, 0.65) 44%,
        rgba(109, 212, 0, 0.9) 52%,
        rgba(200, 255, 120, 0.7) 60%,
        rgba(109, 212, 0, 0.25) 70%,
        transparent 82%
    );
    mix-blend-mode: screen;
    transform: translateX(-120%);
}

.logo-full-orbit {
    pointer-events: none;
    position: absolute;
    /* Centro del globo en el viewBox (~21% x / ~49% y) */
    left: 21%;
    top: 49%;
    width: 26%;
    max-width: 3.55rem;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid rgba(109, 212, 0, 0);
    box-shadow: 0 0 0 0 rgba(109, 212, 0, 0);
    opacity: 0;
    z-index: 0;
    transform: translate(-50%, -50%);
}

/* —— Estado pendiente (antes del intro) —— */
.logo-container--full[data-logo-pending] .logo-icasa-svg__mark,
.logo-container--full[data-logo-pending] .logo-icasa-svg__word,
.logo-container--full[data-logo-pending] .logo-icasa-svg__cargo {
    opacity: 0;
}

.logo-container--full[data-logo-pending] .logo-icasa-svg__mark {
    transform: translate3d(-8px, 4px, 0) scale(0.86) rotate(-6deg);
    filter: blur(4px);
    transform-origin: 22% 48%;
}

.logo-container--full[data-logo-pending] .logo-icasa-svg__word path {
    opacity: 0;
    transform: translate3d(-12px, 4px, 0) skewX(-4deg);
    filter: blur(3px);
}

.logo-container--full[data-logo-pending] .logo-icasa-svg__cargo path {
    opacity: 0;
    transform: translate3d(0, 6px, 0);
}

.logo-icasa-svg__word path,
.logo-icasa-svg__cargo path,
.logo-icasa-svg__mark {
    transform-box: fill-box;
    transform-origin: center;
}

/* —— Coreografía intro —— */
.logo-container--full.is-logo-intro .logo-icasa-svg__mark {
    animation: icasaMarkIn 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}

.logo-container--full.is-logo-intro .logo-icasa-svg__mark .cls-6 {
    animation: icasaAccentStreak 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both;
    transform-box: fill-box;
    transform-origin: left center;
}

.logo-container--full.is-logo-intro .logo-icasa-svg__mark polygon.cls-6 {
    animation: icasaPlaneIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.48s both;
}

.logo-container--full.is-logo-intro .logo-icasa-svg__mark circle.cls-6,
.logo-container--full.is-logo-intro .logo-icasa-svg__mark ellipse.cls-3 {
    animation: icasaSpark 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.72s both;
}

.logo-container--full.is-logo-intro .logo-icasa-svg__word path {
    animation: icasaLetterIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.logo-container--full.is-logo-intro .logo-icasa-svg__word path:nth-child(1) { animation-delay: 0.42s; }
.logo-container--full.is-logo-intro .logo-icasa-svg__word path:nth-child(2) { animation-delay: 0.5s; }
.logo-container--full.is-logo-intro .logo-icasa-svg__word path:nth-child(3) { animation-delay: 0.58s; }
.logo-container--full.is-logo-intro .logo-icasa-svg__word path:nth-child(4) { animation-delay: 0.66s; }
.logo-container--full.is-logo-intro .logo-icasa-svg__word path:nth-child(5) { animation-delay: 0.74s; }

.logo-container--full.is-logo-intro .logo-icasa-svg__cargo path {
    animation: icasaCargoIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.logo-container--full.is-logo-intro .logo-icasa-svg__cargo path:nth-child(1) { animation-delay: 0.82s; }
.logo-container--full.is-logo-intro .logo-icasa-svg__cargo path:nth-child(2) { animation-delay: 0.88s; }
.logo-container--full.is-logo-intro .logo-icasa-svg__cargo path:nth-child(3) { animation-delay: 0.94s; }
.logo-container--full.is-logo-intro .logo-icasa-svg__cargo path:nth-child(4) { animation-delay: 1s; }
.logo-container--full.is-logo-intro .logo-icasa-svg__cargo path:nth-child(5) { animation-delay: 1.06s; }

.logo-container--full.is-logo-intro .logo-full-shine {
    animation: icasaShineSweep 1.45s cubic-bezier(0.22, 1, 0.36, 1) 1.05s both;
}

.logo-container--full.is-logo-intro .logo-full-orbit {
    animation: icasaOrbitPulse 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.logo-container--full.is-logo-intro .logo-full-fx {
    animation: icasaStageSettle 0.55s cubic-bezier(0.16, 1, 0.3, 1) 1.35s both;
}

@keyframes icasaMarkIn {
    0% {
        opacity: 0;
        transform: translate3d(-8px, 4px, 0) scale(0.86) rotate(-6deg);
        filter: blur(4px) drop-shadow(0 0 0 rgba(109, 212, 0, 0));
    }
    55% {
        opacity: 1;
        filter: blur(0) drop-shadow(0 0 6px rgba(109, 212, 0, 0.28));
    }
    78% {
        transform: translate3d(1px, -1px, 0) scale(1.02) rotate(0.8deg);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
        filter: blur(0) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
    }
}

@keyframes icasaAccentStreak {
    0% {
        opacity: 0;
        transform: translate3d(-16px, 8px, 0) scale(0.75);
        filter: brightness(1.5);
    }
    40% {
        opacity: 1;
        filter: brightness(1.2);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
        filter: brightness(1);
    }
}

@keyframes icasaPlaneIn {
    0% {
        opacity: 0;
        transform: translate3d(-20px, 10px, 0) scale(0.55) rotate(-14deg);
    }
    60% {
        opacity: 1;
        transform: translate3d(2px, -2px, 0) scale(1.04) rotate(2deg);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    }
}

@keyframes icasaSpark {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    55% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes icasaLetterIn {
    0% {
        opacity: 0;
        transform: translate3d(-12px, 5px, 0) skewX(-5deg) scale(0.94);
        filter: blur(3px);
    }
    60% {
        opacity: 1;
        filter: blur(0);
    }
    82% {
        transform: translate3d(0, -1px, 0) skewX(0deg) scale(1.015);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) skewX(0deg) scale(1);
        filter: blur(0);
    }
}

@keyframes icasaCargoIn {
    0% {
        opacity: 0;
        transform: translate3d(0, 8px, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes icasaShineSweep {
    0% {
        opacity: 0;
        transform: translateX(-20%);
    }
    12% {
        opacity: 1;
    }
    70% {
        opacity: 0.9;
    }
    100% {
        opacity: 0;
        transform: translateX(220%);
    }
}

@keyframes icasaOrbitPulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.72);
        border-color: rgba(109, 212, 0, 0);
        box-shadow:
            0 0 0 0 rgba(109, 212, 0, 0),
            inset 0 0 0 0 rgba(109, 212, 0, 0);
    }
    35% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        border-color: rgba(109, 212, 0, 0.95);
        box-shadow:
            0 0 10px 2px rgba(109, 212, 0, 0.55),
            0 0 18px 4px rgba(160, 236, 70, 0.35),
            inset 0 0 8px 1px rgba(109, 212, 0, 0.25);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.1);
        border-color: rgba(109, 212, 0, 0);
        box-shadow:
            0 0 0 0 rgba(109, 212, 0, 0),
            inset 0 0 0 0 rgba(109, 212, 0, 0);
    }
}

@keyframes icasaStageSettle {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    45% {
        transform: translate3d(0, -1px, 0) scale(1.01);
    }
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
}

.logo-container--full.is-logo-settled .logo-icasa-svg__mark,
.logo-container--full.is-logo-settled .logo-icasa-svg__word path,
.logo-container--full.is-logo-settled .logo-icasa-svg__cargo path,
.logo-container--full.is-logo-settled .logo-full-fx {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
}

@media (max-width: 768px) {
    .logo-full--svg,
    .logo-full--svg .logo-icasa-svg {
        height: 54px;
        max-width: min(240px, 68vw);
    }

    .logo-full-orbit {
        max-width: 2.85rem;
    }
}

@media (max-width: 576px) {
    .logo-full--svg,
    .logo-full--svg .logo-icasa-svg {
        height: 44px;
        max-width: min(200px, 72vw);
    }

    .logo-full-orbit {
        max-width: 2.4rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .logo-container--full[data-logo-pending] .logo-icasa-svg__mark,
    .logo-container--full[data-logo-pending] .logo-icasa-svg__word path,
    .logo-container--full[data-logo-pending] .logo-icasa-svg__cargo path,
    .logo-container--full.is-logo-intro .logo-icasa-svg__mark,
    .logo-container--full.is-logo-intro .logo-icasa-svg__mark .cls-6,
    .logo-container--full.is-logo-intro .logo-icasa-svg__word path,
    .logo-container--full.is-logo-intro .logo-icasa-svg__cargo path,
    .logo-container--full.is-logo-intro .logo-full-shine,
    .logo-container--full.is-logo-intro .logo-full-orbit,
    .logo-container--full.is-logo-intro .logo-full-fx {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }

    .logo-full-shine,
    .logo-full-orbit {
        display: none;
    }
}

/* ============================================================
   Intro SOLO modo oscuro — no altera la animación del modo claro
   Paleta: blanco + lima neón + cian suave (brilla en nav oscura)
   ============================================================ */

html[data-theme="dark"] body.icasa-theme-enabled .navbar-brand .logo-container.logo-container--full {
    overflow: hidden;
    contain: paint;
}

html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full .logo-full-shine {
    width: 48%;
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(120, 255, 210, 0.15) 28%,
        rgba(255, 255, 255, 0.75) 46%,
        rgba(160, 236, 70, 0.95) 54%,
        rgba(109, 212, 0, 0.55) 64%,
        transparent 82%
    );
    mix-blend-mode: screen;
}

html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full .logo-full-orbit {
    border-width: 2px;
}

html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full[data-logo-pending] .logo-icasa-svg__mark {
    transform: translate3d(0, 10px, 0) scale(0.78);
    filter: blur(6px);
}

html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full[data-logo-pending] .logo-icasa-svg__word path {
    transform: translate3d(0, 14px, 0);
    filter: blur(5px);
}

html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full[data-logo-pending] .logo-icasa-svg__cargo path {
    transform: translate3d(0, 10px, 0);
    filter: blur(3px);
}

/* Glow del logo blanco durante el intro (el filter de color va fuera del SVG invertido) */
html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-full {
    animation: icasaDarkLogoBloom 1.55s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}

html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-icasa-svg__mark {
    animation: icasaDarkMarkIn 1.05s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}

html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-icasa-svg__mark .cls-6 {
    animation: icasaDarkAccentIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.32s both;
}

html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-icasa-svg__mark polygon.cls-6 {
    animation: icasaDarkPlaneIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-icasa-svg__mark circle.cls-6,
html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-icasa-svg__mark ellipse.cls-3 {
    animation: icasaDarkSpark 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.78s both;
}

html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-icasa-svg__word path {
    animation: icasaDarkLetterIn 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
}

html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-icasa-svg__word path:nth-child(1) { animation-delay: 0.48s; }
html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-icasa-svg__word path:nth-child(2) { animation-delay: 0.56s; }
html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-icasa-svg__word path:nth-child(3) { animation-delay: 0.64s; }
html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-icasa-svg__word path:nth-child(4) { animation-delay: 0.72s; }
html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-icasa-svg__word path:nth-child(5) { animation-delay: 0.8s; }

html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-icasa-svg__cargo path {
    animation: icasaDarkCargoIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-icasa-svg__cargo path:nth-child(1) { animation-delay: 0.9s; }
html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-icasa-svg__cargo path:nth-child(2) { animation-delay: 0.96s; }
html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-icasa-svg__cargo path:nth-child(3) { animation-delay: 1.02s; }
html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-icasa-svg__cargo path:nth-child(4) { animation-delay: 1.08s; }
html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-icasa-svg__cargo path:nth-child(5) { animation-delay: 1.14s; }

html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-full-orbit {
    animation: icasaDarkOrbitPulse 1.15s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-full-shine {
    animation: icasaDarkShineSweep 1.55s cubic-bezier(0.22, 1, 0.36, 1) 1.1s both;
}

html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-full-fx {
    animation: icasaDarkStageSettle 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1.45s both;
}

html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-settled .logo-full {
    animation: none !important;
}

@keyframes icasaDarkLogoBloom {
    0% {
        filter: brightness(0) invert(1) drop-shadow(0 0 0 rgba(109, 212, 0, 0));
        opacity: 0.92;
    }
    40% {
        filter:
            brightness(0) invert(1)
            drop-shadow(0 0 8px rgba(160, 236, 70, 0.65))
            drop-shadow(0 0 18px rgba(100, 255, 200, 0.35));
    }
    100% {
        filter: brightness(0) invert(1) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
        opacity: 1;
    }
}

@keyframes icasaDarkMarkIn {
    0% {
        opacity: 0;
        transform: translate3d(0, 10px, 0) scale(0.78);
        filter: blur(6px);
    }
    55% {
        opacity: 1;
        filter: blur(0);
    }
    78% {
        transform: translate3d(0, -2px, 0) scale(1.04);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
        filter: blur(0);
    }
}

@keyframes icasaDarkAccentIn {
    0% {
        opacity: 0;
        transform: translate3d(0, 12px, 0) scale(0.7);
    }
    55% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes icasaDarkPlaneIn {
    0% {
        opacity: 0;
        transform: translate3d(-14px, 16px, 0) scale(0.5) rotate(-18deg);
    }
    65% {
        opacity: 1;
        transform: translate3d(2px, -3px, 0) scale(1.06) rotate(3deg);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    }
}

@keyframes icasaDarkSpark {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1.35);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes icasaDarkLetterIn {
    0% {
        opacity: 0;
        transform: translate3d(0, 14px, 0) scale(0.9);
        filter: blur(5px);
    }
    58% {
        opacity: 1;
        filter: blur(0);
    }
    82% {
        transform: translate3d(0, -2px, 0) scale(1.03);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
        filter: blur(0);
    }
}

@keyframes icasaDarkCargoIn {
    0% {
        opacity: 0;
        transform: translate3d(0, 12px, 0);
        filter: blur(2px);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
        filter: blur(0);
    }
}

@keyframes icasaDarkOrbitPulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.55);
        border-color: rgba(160, 236, 70, 0);
        box-shadow:
            0 0 0 0 rgba(109, 212, 0, 0),
            0 0 0 0 rgba(100, 255, 200, 0),
            inset 0 0 0 0 rgba(160, 236, 70, 0);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.95);
        border-color: rgba(200, 255, 120, 1);
        box-shadow:
            0 0 12px 2px rgba(109, 212, 0, 0.75),
            0 0 28px 6px rgba(100, 255, 200, 0.45),
            inset 0 0 10px 1px rgba(160, 236, 70, 0.35);
    }
    55% {
        opacity: 0.85;
        transform: translate(-50%, -50%) scale(1.05);
        border-color: rgba(160, 236, 70, 0.85);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.22);
        border-color: rgba(100, 255, 200, 0);
        box-shadow:
            0 0 0 0 rgba(109, 212, 0, 0),
            0 0 0 0 rgba(100, 255, 200, 0),
            inset 0 0 0 0 rgba(160, 236, 70, 0);
    }
}

@keyframes icasaDarkShineSweep {
    0% {
        opacity: 0;
        transform: translateX(-25%);
    }
    12% {
        opacity: 1;
    }
    72% {
        opacity: 0.9;
    }
    100% {
        opacity: 0;
        transform: translateX(230%);
    }
}

@keyframes icasaDarkStageSettle {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    40% {
        transform: translate3d(0, -2px, 0) scale(1.015);
    }
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    html[data-theme="dark"] body.icasa-theme-enabled .logo-container--full.is-logo-intro .logo-full {
        animation: none !important;
        filter: brightness(0) invert(1) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
    }
}
