/**
 * 3D Cut Screen Canvas Scrubber Stylesheet
 * Songma Investment (S.M.I) - Home V2
 */

:root {
    --cs-bg: #030A14;
    --cs-cyan: #38BDF8;
    --cs-cyan-glow: rgba(56, 189, 248, 0.35);
    --cs-emerald: #10B981;
    --cs-gold: #F59E0B;
    --cs-card-bg: rgba(7, 23, 43, 0.72);
    --cs-border: rgba(56, 189, 248, 0.22);
}

/* ==========================================================================
   SCROLL TRACK & STICKY STAGE
   ========================================================================== */
.cutscreen-section {
    position: relative;
    background: transparent;
    color: #F8FAFC;
    /* 320vh gives 2.2 viewport heights of pure scrubbing travel */
    height: 320vh;
    z-index: 102;
}

/* Collapsed State: Section thu gọn hoàn toàn vào logo, hero banner kéo về vị trí gốc */
.cutscreen-section.collapsed {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: hidden !important;
}

.cutscreen-section.collapsed .cutscreen-sticky {
    height: 0 !important;
    display: none !important;
}

.cutscreen-demo-bar.collapsed {
    display: none !important;
}

.cutscreen-sticky {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    perspective: 1400px;
    transform-style: preserve-3d;
    background: transparent;
}

/* Atmospheric Background Layer */
.cutscreen-bg-layer {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 40%, #0A2240 0%, #030A14 80%);
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.15s linear;
}

/* Background Atmospheric Grid */
.cutscreen-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(56, 189, 248, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
    background-size: 64px 64px;
    pointer-events: none;
    opacity: 0.6;
    z-index: 2;
    transition: opacity 0.35s ease;
}

/* 3D Canvas Stage */
.cutscreen-canvas-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    will-change: transform, opacity, border-radius;
    overflow: hidden;
    z-index: 5;
}

.cutscreen-canvas-stage.smooth-transition {
    transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease, border-radius 0.6s ease !important;
}

/* Hero Section Rising State During Convergence */
#heroV3Section.hero-rising {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 95 !important;
    pointer-events: none !important;
    will-change: transform;
}

.cutscreen-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: drop-shadow(0 20px 45px rgba(0, 0, 0, 0.8));
    will-change: transform;
}

/* HTML5 Video Fallback if frames loading or JS fallback */
.cutscreen-video-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

/* Vignette & Cinematic Shadow Overlay */
.cutscreen-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at center, transparent 45%, rgba(3, 10, 20, 0.75) 90%),
                linear-gradient(to bottom, rgba(3, 10, 20, 0.6) 0%, transparent 20%, transparent 80%, var(--cs-bg) 100%);
    z-index: 2;
}

/* ==========================================================================
   CINEMATIC HUD & FLOATING OVERLAYS
   ========================================================================== */
.cutscreen-hud-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 32px 40px;
}

/* Top Bar: Brand, Status, Skip */
.cutscreen-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: auto;
}

.cutscreen-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 9999px;
    background: rgba(15, 33, 58, 0.85);
    border: 1px solid var(--cs-border);
    backdrop-filter: blur(12px);
    font-size: 12px;
    font-weight: 600;
    color: #E2E8F0;
    letter-spacing: 0.04em;
}

.cutscreen-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cs-emerald);
    box-shadow: 0 0 10px var(--cs-emerald);
    animation: csPulse 2s infinite ease-in-out;
}

@keyframes csPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
}

.cutscreen-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cutscreen-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    text-decoration: none;
    transition: all 0.25s ease;
    backdrop-filter: blur(12px);
}

.cutscreen-btn-outline {
    background: rgba(15, 33, 58, 0.7);
    color: #E2E8F0;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.cutscreen-btn-outline:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--cs-cyan);
    color: #FFFFFF;
    transform: translateY(-1px);
}

.cutscreen-btn-primary {
    background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
    color: #FFFFFF;
    border: 1px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35);
}

.cutscreen-btn-primary:hover {
    background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
    transform: translateY(-1px);
}

/* Center Cinematic Titles (Phase Transitions) */
.cutscreen-center-titles {
    position: absolute;
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 90%;
    max-width: 860px;
    pointer-events: none;
}

.cutscreen-title-step {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: absolute;
    left: 0;
    right: 0;
    margin: auto;
}

.cutscreen-title-step.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    position: relative;
}

.cutscreen-eyebrow {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--cs-cyan);
    margin-bottom: 12px;
    text-shadow: 0 0 16px var(--cs-cyan-glow);
}

.cutscreen-main-heading {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(28px, 4.5vw, 54px);
    font-weight: 800;
    line-height: 1.15;
    color: #FFFFFF;
    margin-bottom: 16px;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.7);
}

.cutscreen-main-heading .text-cyan {
    background: linear-gradient(135deg, #38BDF8 0%, #818CF8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cutscreen-subtext {
    font-size: clamp(14px, 1.25vw, 18px);
    line-height: 1.6;
    color: #CBD5E1;
    max-width: 680px;
    margin: 0 auto;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

/* Floating HUD Widgets (Lateral Data Telemetrics) */
.cutscreen-hud-widgets {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hud-widget {
    position: absolute;
    background: var(--cs-card-bg);
    border: 1px solid var(--cs-border);
    backdrop-filter: blur(14px);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hud-widget.active {
    opacity: 1;
    transform: translateY(0);
}

.hud-widget-left {
    left: 40px;
    top: 38%;
}

.hud-widget-right {
    right: 40px;
    top: 55%;
}

.hud-widget-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hud-widget-icon.icon-cyan {
    background: rgba(56, 189, 248, 0.15);
    color: var(--cs-cyan);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.hud-widget-icon.icon-emerald {
    background: rgba(16, 185, 129, 0.15);
    color: var(--cs-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.hud-widget-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.hud-widget-value {
    display: block;
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 18px;
    font-weight: 700;
    color: #FFFFFF;
}

/* Bottom Bar: Telemetry Progress & Scroll Indicator */
.cutscreen-bottombar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: auto;
}

.cutscreen-telemetry {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cutscreen-frame-counter {
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--cs-cyan);
    letter-spacing: 0.05em;
}

.cutscreen-progress-track {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    overflow: hidden;
}

.cutscreen-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #38BDF8, #10B981);
    box-shadow: 0 0 10px var(--cs-cyan-glow);
    transition: width 0.05s linear;
}

/* Mouse Scroll Prompt */
.cutscreen-scroll-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #94A3B8;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.cutscreen-scroll-prompt:hover {
    color: #FFFFFF;
}

.cutscreen-mouse {
    width: 22px;
    height: 34px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    position: relative;
}

.cutscreen-wheel {
    width: 4px;
    height: 7px;
    background: var(--cs-cyan);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: mouseWheelMove 1.8s infinite cubic-bezier(0.65, 0, 0.35, 1);
}

@keyframes mouseWheelMove {
    0% { transform: translate(-50%, 0); opacity: 1; }
    70% { transform: translate(-50%, 12px); opacity: 0; }
    100% { transform: translate(-50%, 0); opacity: 0; }
}

/* Preloader Overlay */
.cutscreen-preloader {
    position: absolute;
    inset: 0;
    background: #030A14;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 50;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.cutscreen-preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.cutscreen-spinner {
    width: 46px;
    height: 46px;
    border: 3px solid rgba(56, 189, 248, 0.15);
    border-top-color: var(--cs-cyan);
    border-radius: 50%;
    animation: csSpin 0.9s linear infinite;
}

@keyframes csSpin {
    to { transform: rotate(360deg); }
}

.cutscreen-preloader-text {
    font-size: 14px;
    font-weight: 600;
    color: #CBD5E1;
    letter-spacing: 0.03em;
}

/* ==========================================================================
   3D FOLD TRANSITION TO HERO V3 (Bottom Docking)
   ========================================================================== */
.cutscreen-dock-trigger {
    position: relative;
    z-index: 101;
    margin-top: -1px;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .cutscreen-hud-layer {
        padding: 24px 20px;
    }
    .hud-widget-left {
        left: 20px;
        top: 28%;
    }
    .hud-widget-right {
        right: 20px;
        top: 66%;
    }
    .cutscreen-progress-track {
        width: 140px;
    }
}

@media (max-width: 767px) {
    .cutscreen-hud-widgets {
        display: none; /* Hide side HUDs on mobile to keep focus on 3D canvas and title */
    }
    .cutscreen-section {
        height: 250vh; /* slightly shorter scroll for mobile */
    }
    .cutscreen-topbar-actions .cutscreen-btn span {
        display: none;
    }
    .cutscreen-btn {
        padding: 8px 12px;
    }
}

/* ==========================================================================
   HIỆU ỨNG THU PHÓNG VÀO LOGO & PHÁT LẠI KHI CUỘN LÊN ĐẦU TRANG
   ========================================================================== */
.logo-box {
    position: relative;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Khi logo nhận luồng thu gọn từ 3D Cutscreen */
.logo-box.logo-absorbed {
    animation: logoAbsorbPulse 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

/* Khi logo kích hoạt bung mở trở lại 3D Cutscreen */
.logo-box.logo-emitting {
    animation: logoEmitPulse 1.0s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes logoAbsorbPulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(56, 189, 248, 0));
    }
    30% {
        transform: scale(1.25);
        filter: drop-shadow(0 0 22px #38BDF8) drop-shadow(0 0 45px rgba(56, 189, 248, 0.85)) brightness(1.4);
    }
    65% {
        transform: scale(1.08);
        filter: drop-shadow(0 0 14px #10B981) brightness(1.2);
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(56, 189, 248, 0));
    }
}

@keyframes logoEmitPulse {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.3);
        filter: drop-shadow(0 0 28px #38BDF8) drop-shadow(0 0 50px rgba(56, 189, 248, 0.9)) brightness(1.45);
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(56, 189, 248, 0));
    }
}

