/*
 * CX Spatial home — cinematic architectural showroom.
 */

.cx-page--home {
    --cx-cinema-inset: clamp(430px, 39vw, 670px);
}

.cx-page--home .cx-experience {
    background: #020304;
}

.cx-page--home .cx-experience::before {
    opacity: 0.08;
    background-size: 96px 96px;
}

.cx-page--home #stars-canvas {
    opacity: 0.18;
}

.cx-page--home #cx-experience-canvas {
    opacity: 0.025;
}

.cx-page--home .cx-orbital-field,
.cx-page--home .cx-smart-orb--white,
.cx-page--home .cx-smart-orb--ice {
    opacity: 0.28;
}

.cx-page--home .cx-media-stack {
    inset: clamp(20px, 2.5vh, 34px) clamp(18px, 2.4vw, 42px);
    border: 1px solid rgba(240, 235, 222, 0.1);
    border-radius: var(--cx-radius);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.045),
        0 40px 100px rgba(0, 0, 0, 0.42);
}

.cx-page--home .cx-media {
    background: #030405;
}

.cx-page--home .cx-media img,
.cx-page--home .cx-media video {
    transition:
        opacity 1250ms var(--cx-spatial-ease),
        transform 9s cubic-bezier(0.2, 0.7, 0.2, 1),
        filter 900ms ease;
}

.cx-page--home .cx-media.is-visible img,
.cx-page--home .cx-media.is-visible video {
    transform: scale(1.055);
}

.cx-page--home .cx-media::after {
    background:
        linear-gradient(90deg, rgba(2, 3, 4, 0.93) 0%, rgba(2, 3, 4, 0.78) 24%, rgba(2, 3, 4, 0.32) 42%, transparent 66%),
        linear-gradient(180deg, rgba(2, 3, 4, 0.36) 0%, transparent 24%, transparent 70%, rgba(2, 3, 4, 0.5) 100%);
}

.cx-page--home .cx-cinematic-grain {
    opacity: 0.035;
}

.cx-page--home .cx-cinematic-light {
    opacity: 0.34;
    filter: blur(22px);
}

.cx-page--home .cx-shell {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.36fr);
    gap: clamp(34px, 6vw, 110px);
    padding:
        clamp(118px, 14vh, 154px)
        clamp(36px, 4vw, 66px)
        clamp(96px, 11vh, 122px);
}

.cx-page--home .cx-main-copy {
    width: min(650px, 100%);
}

.cx-page--home .cx-scene-deck {
    min-height: clamp(500px, 60vh, 650px);
}

.cx-page--home .cx-scene-copy {
    gap: clamp(12px, 1.8vh, 20px);
}

.cx-page--home .cx-kicker {
    width: max-content;
    padding: 7px 11px 7px 38px;
    border: 1px solid rgba(215, 181, 109, 0.13);
    border-radius: 999px;
    background: rgba(4, 6, 8, 0.28);
    color: var(--cx-gold-bright);
    font-size: 0.56rem;
    letter-spacing: 0.24em;
    backdrop-filter: blur(10px);
}

.cx-page--home .cx-kicker::before {
    left: 12px;
    width: 16px;
    background: linear-gradient(90deg, transparent, var(--cx-gold-bright));
}

.cx-page--home .cx-title {
    max-width: 8.5ch;
    color: #f4f1e9;
    font-size: clamp(4.4rem, 6.2vw, 7.4rem);
    font-weight: 540;
    line-height: 0.82;
    letter-spacing: -0.075em;
    text-wrap: balance;
}

.cx-page--home .cx-title .is-outline {
    -webkit-text-stroke-color: rgba(238, 236, 228, 0.52);
}

.cx-page--home .cx-title .is-accent {
    color: var(--cx-gold-bright);
    text-shadow: 0 0 42px rgba(215, 181, 109, 0.16);
}

.cx-page--home .cx-body {
    max-width: 590px;
    color: rgba(227, 228, 224, 0.68);
    font-size: clamp(0.92rem, 1.12vw, 1.06rem);
    line-height: 1.72;
}

.cx-page--home .cx-chips {
    gap: 7px;
}

.cx-page--home .cx-stage-chip {
    min-height: 28px;
    border-color: rgba(240, 235, 222, 0.12);
    background: rgba(4, 6, 8, 0.32);
    color: rgba(231, 232, 228, 0.54);
    font-size: 0.56rem;
    letter-spacing: 0.1em;
    backdrop-filter: blur(14px);
}

.cx-page--home .cx-stage-chip.is-active {
    border-color: rgba(215, 181, 109, 0.42);
    background: rgba(215, 181, 109, 0.075);
    color: var(--cx-gold-bright);
}

.cx-page--home .cx-enter-row {
    gap: 8px;
    margin-top: 10px;
}

.cx-page--home .cx-primary,
.cx-page--home .cx-secondary,
.cx-page--home .cx-live-trigger {
    min-height: 48px;
    border-radius: 999px;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
}

.cx-page--home .cx-primary {
    border-color: var(--cx-gold-bright);
    background: linear-gradient(135deg, var(--cx-gold-bright), #c8a65f);
    color: #070706;
    box-shadow: 0 16px 40px rgba(215, 181, 109, 0.12);
}

.cx-page--home .cx-primary:hover,
.cx-page--home .cx-primary:focus-visible {
    border-color: #f3d38d;
    background: linear-gradient(135deg, #f3d38d, var(--cx-gold-bright));
    color: #070706;
    box-shadow: 0 20px 48px rgba(215, 181, 109, 0.22);
}

.cx-page--home .cx-actions .cx-link--app {
    gap: 7px;
    border: 1px solid rgba(255, 183, 0, 0.65);
    background: rgba(255, 183, 0, 0.16);
    color: #ffe3a0;
    box-shadow: inset 0 0 0 1px rgba(255, 183, 0, 0.08), 0 0 22px rgba(255, 183, 0, 0.15);
}

.cx-page--home .cx-actions .cx-link--app:hover,
.cx-page--home .cx-actions .cx-link--app:focus-visible {
    border-color: var(--cx-gold);
    background: rgba(255, 183, 0, 0.26);
    color: #fff;
}

.cx-page--home .cx-app-shortcut {
    display: none;
}

@media (max-width: 760px) {
    .cx-page--home .cx-actions .cx-link--app {
        grid-column: 1 / -1;
    }

    .cx-page--home .cx-app-shortcut {
        display: inline-flex;
        position: fixed;
        z-index: 310;
        top: max(20px, env(safe-area-inset-top));
        right: 72px;
        align-items: center;
        justify-content: center;
        gap: 5px;
        min-height: 36px;
        margin-left: auto;
        padding: 0 12px;
        border: 1px solid rgba(255, 183, 0, 0.7);
        border-radius: 999px;
        background: rgba(255, 183, 0, 0.18);
        color: #ffe3a0;
        box-shadow: 0 0 22px rgba(255, 183, 0, 0.17);
        font: 750 0.62rem/1 var(--cx-font);
        letter-spacing: 0.03em;
        white-space: nowrap;
        pointer-events: auto;
    }

    .cx-page--home .cx-app-shortcut:hover,
    .cx-page--home .cx-app-shortcut:focus-visible {
        background: rgba(255, 183, 0, 0.3);
        color: #fff;
    }

    .cx-page--home .cx-menu-toggle {
        display: block;
        position: fixed;
        z-index: 310;
        top: max(16px, env(safe-area-inset-top));
        right: 14px;
        margin: 0;
    }
}

.cx-page--home .cx-secondary,
.cx-page--home .cx-live-trigger {
    border: 1px solid rgba(240, 235, 222, 0.14);
    background: rgba(4, 6, 8, 0.38);
    color: rgba(244, 243, 237, 0.76);
    backdrop-filter: blur(18px);
}

/* Keep CX Vision recognizable after the intro instead of reducing it to a quiet dot. */
.cx-page--home .cx-ai.is-settled {
    --ai-size: 58px;
}

.cx-page--home .cx-ai.is-settled .cx-ai-btn {
    filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.46)) drop-shadow(0 0 14px rgba(215, 181, 109, 0.2));
}

.cx-page--home .cx-ai.is-settled .cx-ai-btn::before {
    border-color: rgba(240, 211, 149, 0.52);
    background:
        radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.16), transparent 32%),
        rgba(5, 6, 7, 0.82);
    box-shadow: inset 0 0 0 1px rgba(215, 181, 109, 0.08);
}

.cx-page--home .cx-ai.is-settled:not(.is-chat-open):not(.is-relocating) .cx-ai-btn::after {
    animation: cx-vision-attention-ring 4.8s ease-out infinite;
}

.cx-page--home .cx-ai.is-settled .cx-ai-core {
    inset: 21%;
    animation: cx-vision-idle-core 3.8s ease-in-out infinite;
}

.cx-page--home .cx-ai.is-settled .cx-ai-label {
    right: 70px;
    min-height: 40px;
    padding: 0 14px;
    gap: 5px;
    font-size: 0.5rem;
    letter-spacing: 0.09em;
    border-color: rgba(240, 211, 149, 0.38);
    background:
        linear-gradient(110deg, rgba(215, 181, 109, 0.12), transparent 52%),
        rgba(4, 6, 8, 0.9);
    color: rgba(248, 246, 239, 0.72);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    cursor: pointer;
    opacity: 1;
    transition: border-color 260ms ease, background 260ms ease, color 260ms ease, transform 260ms var(--ease-premium);
}

.cx-page--home .cx-ai.is-settled .cx-ai-label:hover,
.cx-page--home .cx-ai.is-settled .cx-ai-label:focus-visible {
    border-color: rgba(240, 211, 149, 0.68);
    background:
        linear-gradient(110deg, rgba(215, 181, 109, 0.2), transparent 58%),
        rgba(4, 6, 8, 0.96);
    color: rgba(255, 255, 255, 0.92);
    transform: translateY(-50%) translateX(-2px);
}

.cx-page--home .cx-ai.is-settled .cx-ai-label b,
.cx-page--home .cx-ai.is-settled .cx-ai-live-status {
    color: var(--cx-gold-bright);
}

.cx-page--home .cx-ai.is-settled .cx-ai-live-status {
    max-width: 76px;
    letter-spacing: 0.06em;
}

@keyframes cx-vision-attention-ring {
    0%, 70% { opacity: 0; transform: scale(0.78); }
    74% { opacity: 0.68; }
    100% { opacity: 0; transform: scale(1.45); }
}

@keyframes cx-vision-idle-core {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.18); }
}

.cx-page--home .cx-live-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 17px;
    cursor: pointer;
}

.cx-page--home .cx-live-trigger::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cx-gold-bright);
    box-shadow: 0 0 12px rgba(215, 181, 109, 0.72);
    animation: cx-live-pulse 2.4s ease-in-out infinite;
}

@keyframes cx-live-pulse {
    50% { opacity: 0.34; transform: scale(0.72); }
}

.cx-page--home .cx-side {
    width: min(250px, 100%);
    gap: 1px;
    padding: 14px 0;
    border-top: 1px solid rgba(240, 235, 222, 0.1);
    border-bottom: 1px solid rgba(240, 235, 222, 0.1);
}

.cx-page--home .cx-card {
    min-height: 54px;
    grid-template-columns: 34px 1fr;
    padding-left: 14px;
}

.cx-page--home .cx-card strong {
    font-size: 0.78rem;
    font-weight: 580;
    letter-spacing: 0.04em;
}

.cx-page--home .cx-card:not(.is-active) {
    opacity: 0.58;
}

.cx-page--home .cx-card.is-active {
    opacity: 1;
}

.cx-page--home .cx-stage-counter {
    right: clamp(40px, 4vw, 66px);
    bottom: 32px;
    left: clamp(40px, 4vw, 66px);
    color: rgba(235, 235, 230, 0.38);
    font-family: var(--cx-mono);
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.cx-page--home .cx-progress {
    background: rgba(240, 235, 222, 0.1);
}

.cx-page--home .cx-progress span {
    background: linear-gradient(90deg, var(--cx-gold-bright), var(--stage-accent, var(--cx-gold)));
}

.cx-space-hud {
    position: fixed;
    z-index: 38;
    top: 96px;
    right: 42px;
    display: grid;
    gap: 9px;
    justify-items: end;
    text-align: right;
    color: rgba(235, 235, 230, 0.32);
    font: 500 0.5rem/1 var(--cx-mono);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    pointer-events: none;
}

.cx-space-hud__status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cx-space-hud__status::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--cx-gold-bright);
    box-shadow: 0 0 12px rgba(215, 181, 109, 0.72);
}

.cx-space-hud__scene {
    color: rgba(245, 242, 233, 0.64);
}

.cx-gesture-cue {
    display: none;
}

.cx-page--home .cx-studio {
    background: rgba(1, 2, 3, 0.82);
    backdrop-filter: blur(30px) saturate(0.9);
}

.cx-page--home .cx-studio-panel {
    overflow: hidden;
    border-color: rgba(240, 235, 222, 0.14);
    border-radius: 28px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 32%),
        #050709;
    box-shadow: 0 42px 140px rgba(0, 0, 0, 0.72);
}

.cx-page--home .cx-studio-head {
    border-bottom-color: rgba(240, 235, 222, 0.1);
}

.cx-page--home .cx-studio-preview {
    background: #020304;
}

.cx-page--home .cx-studio-controls {
    background: rgba(7, 9, 11, 0.94);
}

.cx-live-range {
    display: grid;
    gap: 9px;
    margin-top: 18px;
    color: rgba(235, 235, 230, 0.54);
    font-size: 0.68rem;
}

.cx-live-range__head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.cx-live-range output {
    color: var(--cx-gold-bright);
    font-family: var(--cx-mono);
}

.cx-live-range input {
    width: 100%;
    min-height: 44px;
    accent-color: var(--cx-gold);
    cursor: pointer;
}

@media (max-width: 1180px) and (min-width: 761px) {
    .cx-page--home .cx-shell {
        grid-template-columns: 1fr;
    }

    .cx-page--home .cx-side {
        display: none !important;
    }

    .cx-space-hud {
        display: none;
    }
}

@media (max-width: 760px) {
    .cx-page--home {
        --cx-cinema-inset: 0;
    }

    .cx-page--home #stars-canvas {
        opacity: 0.08;
    }

    .cx-page--home #cx-experience-canvas,
    .cx-page--home .cx-orbital-field,
    .cx-page--home .cx-hero-art {
        display: none;
    }

    .cx-page--home .cx-media-stack {
        inset: 8px;
        border-radius: 20px;
    }

    .cx-page--home .cx-media::after {
        background:
            linear-gradient(180deg, rgba(2, 3, 4, 0.34) 0%, rgba(2, 3, 4, 0.08) 27%, rgba(2, 3, 4, 0.26) 45%, rgba(2, 3, 4, 0.94) 78%, #020304 100%),
            linear-gradient(90deg, rgba(2, 3, 4, 0.25), transparent 82%);
    }

    .cx-page--home .cx-shell {
        padding: 82px 18px 84px;
        align-items: end;
    }

    .cx-page--home .cx-main-copy {
        align-self: end;
    }

    .cx-page--home .cx-scene-deck {
        width: 100%;
        height: min(620px, 73svh) !important;
        min-height: min(620px, 73svh) !important;
    }

    .cx-page--home .cx-scene-copy {
        align-content: end !important;
        gap: 10px;
        padding: 0 0 94px !important;
    }

    .cx-page--home .cx-kicker {
        padding: 6px 10px 6px 32px;
        font-size: 0.5rem;
    }

    .cx-page--home .cx-title {
        max-width: 9ch;
        font-size: clamp(2.5rem, 12vw, 4rem);
        line-height: 0.86;
        letter-spacing: -0.07em;
    }

    .cx-page--home .cx-body {
        display: -webkit-box;
        max-width: 95%;
        font-size: clamp(0.82rem, 3.5vw, 0.94rem);
        line-height: 1.52;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 4;
        overflow: hidden;
    }

    .cx-page--home .cx-chips {
        max-width: calc(100vw - 36px);
        overflow-x: auto;
        scrollbar-width: none;
    }

    .cx-page--home .cx-stage-chip {
        flex: 0 0 auto;
    }

    .cx-page--home .cx-enter-row {
        position: static;
        display: none !important;
        margin-top: 0;
    }

    .cx-page--home .cx-primary,
    .cx-page--home .cx-secondary {
        display: none !important;
    }

    .cx-page--home .cx-live-trigger {
        min-height: 42px;
        padding-inline: 14px;
        font-size: 0.58rem;
        white-space: nowrap;
    }

    .cx-page--home .cx-dots {
        bottom: calc(max(10px, env(safe-area-inset-bottom)) + 76px);
        left: 22px;
    }

    .cx-space-hud {
        display: none;
    }

    .cx-gesture-cue {
        display: none;
    }

    .cx-gesture-cue::after {
        content: "↑";
        color: var(--cx-gold-bright);
        animation: cx-gesture-up 1.8s ease-in-out infinite;
    }

    @keyframes cx-gesture-up {
        50% { transform: translateY(-5px); opacity: 0.45; }
    }

    .cx-page--home .cx-studio {
        align-items: end;
        padding: 8px;
    }

    .cx-page--home .cx-studio-panel {
        max-height: calc(100svh - 16px);
        border-radius: 24px;
    }

    .cx-page--home .cx-studio-preview {
        min-height: 36svh;
    }

    .cx-page--home .cx-studio-controls {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 1023px) {
    .cx-page--home .cx-ai.is-settled {
        --ai-size: 54px;
        position: fixed;
        z-index: 307;
        top: auto;
        right: 18px;
        bottom: calc(max(10px, env(safe-area-inset-bottom)) + 74px);
        left: auto;
        display: grid !important;
        transform: none;
    }

    .cx-page--home .cx-ai.is-settled .cx-ai-label {
        right: 62px;
        min-height: 36px;
        padding-inline: 10px;
        font-size: 0.44rem;
        letter-spacing: 0.07em;
    }

    .cx-page--home .cx-ai.is-settled .cx-ai-live-status {
        max-width: 58px;
        font-size: 0.42rem;
        letter-spacing: 0.04em;
    }

    .cx-page--home .cx-chat {
        z-index: 320;
    }

    .cx-page--home .cx-ai.is-settled.is-chat-open {
        opacity: 0;
        pointer-events: none;
    }

    body.cx-page--home:has(.cx-ai.is-chat-open) .cx-mobile-dock {
        opacity: 0;
        transform: translateY(calc(100% + 24px));
        pointer-events: none;
    }
}

@media (max-width: 390px) {
    .cx-page--home .cx-shell {
        padding-inline: 16px;
    }

    .cx-page--home .cx-scene-copy {
        padding-bottom: 88px !important;
    }

    .cx-page--home .cx-title {
        font-size: clamp(2.25rem, 11.4vw, 2.85rem);
    }

    .cx-page--home .cx-body {
        max-width: 100%;
        -webkit-line-clamp: 3;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cx-page--home .cx-media img,
    .cx-page--home .cx-media video {
        transition: opacity 300ms ease, filter 300ms ease;
        transform: none !important;
    }

    .cx-page--home .cx-live-trigger::before,
    .cx-gesture-cue::after,
    .cx-page--home .cx-ai.is-settled .cx-ai-btn::after,
    .cx-page--home .cx-ai.is-settled .cx-ai-core {
        animation: none;
    }
}
