/* ============================================================
   DESIGNX STUDIO - 3D Grand Architectural Door Opening Intro
   Photorealistic 3D double door portal with rich obsidian/gold
   high-contrast foreground presentation & dynamic depth.
   ============================================================ */

/* Skip / instant bypass state */
html.intro-skipped #studio-intro,
html.intro-ready  #studio-intro {
    display: none !important;
    visibility: hidden !important;
}
html.intro-skipped body,
html.intro-ready  body {
    overflow: auto !important;
}
body.intro-locked {
    overflow: hidden !important;
}

/* Master full-screen container */
#studio-intro {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: transparent;
    user-select: none;
    pointer-events: all;
    perspective: 1400px;
    perspective-origin: 50% 50%;
}
#studio-intro.intro-finished {
    pointer-events: none;
    visibility: hidden;
    display: none !important;
}

/* 3D Doors Viewport Stage */
.portal-doors-stage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    perspective: 1400px;
    perspective-origin: 50% 50%;
    transform-style: preserve-3d;
    overflow: hidden;
    background: transparent;
    pointer-events: none;
}

/* Individual 3D Door Leaf */
.portal-door {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    will-change: transform, box-shadow;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 50%, rgba(55, 45, 30, 0.2) 0%, transparent 85%),
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.015) 0px,
            rgba(255, 255, 255, 0.015) 1px,
            transparent 1px,
            transparent 36px
        ),
        linear-gradient(165deg, #1c1710 0%, #13100a 50%, #0c0a07 100%);
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.9);
}

/* Left Door — Hinged at screen left */
.portal-door-left {
    left: 0;
    transform-origin: left center;
    border-right: 1px solid rgba(212, 170, 100, 0.4);
    border-top: 1px solid rgba(212, 170, 100, 0.15);
    border-bottom: 1px solid rgba(212, 170, 100, 0.15);
    box-shadow:
        inset -2px 0 30px rgba(212, 170, 100, 0.1),
        inset 0 0 90px rgba(0, 0, 0, 0.85),
        10px 0 40px rgba(0, 0, 0, 0.8);
}

/* Right Door — Hinged at screen right */
.portal-door-right {
    right: 0;
    transform-origin: right center;
    border-left: 1px solid rgba(212, 170, 100, 0.4);
    border-top: 1px solid rgba(212, 170, 100, 0.15);
    border-bottom: 1px solid rgba(212, 170, 100, 0.15);
    box-shadow:
        inset 2px 0 30px rgba(212, 170, 100, 0.1),
        inset 0 0 90px rgba(0, 0, 0, 0.85),
        -10px 0 40px rgba(0, 0, 0, 0.8);
}

/* Realistic Architectural Door Hinges (Left & Right Outers) */
.portal-door-hinge {
    position: absolute;
    width: 9px;
    height: 52px;
    background: linear-gradient(180deg, #6e5020 0%, #e0ba74 50%, #6e5020 100%);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(212, 170, 100, 0.4), 0 3px 10px rgba(0, 0, 0, 0.9);
    z-index: 6;
}
.portal-door-left .portal-door-hinge {
    left: 6px;
}
.portal-door-right .portal-door-hinge {
    right: 6px;
}
.portal-door-hinge.hinge-top { top: 10%; }
.portal-door-hinge.hinge-mid { top: 48%; }
.portal-door-hinge.hinge-bot { bottom: 10%; }

/* Multi-tier Bevelled Inset Panels (Classic Luxury Architectural Mouldings) */
.portal-door-panel {
    position: absolute;
    left: 6%;
    right: 6%;
    border: 1px solid rgba(212, 170, 100, 0.22);
    border-radius: 2px;
    background: linear-gradient(145deg, rgba(28, 23, 15, 0.9) 0%, rgba(10, 8, 5, 0.98) 100%);
    box-shadow:
        inset 0 4px 20px rgba(0, 0, 0, 0.9),
        inset 0 0 50px rgba(0, 0, 0, 0.7),
        0 1px 1px rgba(212, 170, 100, 0.15);
    pointer-events: none;
}
.portal-door-panel.panel-upper {
    top: 5%;
    height: 38%;
}
.portal-door-panel.panel-lower {
    top: 47%;
    bottom: 5%;
}

.portal-door-panel-inner {
    position: absolute;
    inset: 18px;
    border: 1px solid rgba(212, 170, 100, 0.12);
    background: radial-gradient(circle at 50% 50%, rgba(212, 170, 100, 0.03) 0%, transparent 80%);
    box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.6);
}

.portal-door-filigree {
    position: absolute;
    inset: 8px;
    border: 1px dashed rgba(212, 170, 100, 0.07);
}

/* Luxury Vertical Brass Pull Handle Assembly */
.portal-door-handle-assembly {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}
.portal-door-left .portal-door-handle-assembly {
    right: 32px;
}
.portal-door-right .portal-door-handle-assembly {
    left: 32px;
}

.handle-mount {
    width: 16px;
    height: 7px;
    background: linear-gradient(180deg, #ecd08d 0%, #8e6221 100%);
    border-radius: 1px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.95);
}

.portal-door-handle {
    width: 7px;
    height: 200px;
    background: linear-gradient(
        180deg,
        #4f3713 0%,
        #a77b2b 15%,
        #f5d792 45%,
        #fff1c4 50%,
        #cf9f54 55%,
        #8e6221 85%,
        #3b260b 100%
    );
    border-radius: 3.5px;
    box-shadow:
        0 0 16px rgba(212, 170, 100, 0.45),
        0 10px 30px rgba(0, 0, 0, 0.85),
        inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

/* Center Seam Glow & Threshold */
.portal-seam-glow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(215, 175, 95, 0.6) 25%,
        rgba(255, 235, 185, 0.95) 50%,
        rgba(215, 175, 95, 0.6) 75%,
        transparent 100%
    );
    box-shadow:
        0 0 12px 3px rgba(212, 170, 100, 0.6),
        0 0 40px 10px rgba(180, 130, 45, 0.3);
    z-index: 5;
    pointer-events: none;
}

/* Volumetric Golden Light Burst Behind Doors */
.portal-light-burst {
    position: absolute;
    width: 120vw;
    height: 120vh;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(
        ellipse at center,
        rgba(255, 245, 210, 0.8) 0%,
        rgba(235, 185, 90, 0.5) 30%,
        rgba(180, 130, 45, 0.2) 60%,
        transparent 80%
    );
    filter: blur(50px);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    mix-blend-mode: screen;
    will-change: opacity;
}

/* Viewport Corner Framing */
.intro-corner-mark {
    position: fixed;
    z-index: 25;
    pointer-events: none;
    opacity: 0;
    width: 28px;
    height: 28px;
}
.intro-corner-line {
    position: absolute;
    background: rgba(212, 170, 100, 0.55);
    box-shadow: 0 0 8px rgba(212, 170, 100, 0.35);
}
.intro-corner-line-h {
    height: 1px;
    width: 28px;
    top: 0;
    left: 0;
}
.intro-corner-line-v {
    width: 1px;
    height: 28px;
    top: 0;
    left: 0;
}
.intro-corner-top-left    { top: 2.2rem; left: 2.2rem; }
.intro-corner-top-right   { top: 2.2rem; right: 2.2rem; transform: scaleX(-1); }
.intro-corner-bottom-left { bottom: 2.2rem; left: 2.2rem; transform: scaleY(-1); }
.intro-corner-bottom-right{ bottom: 2.2rem; right: 2.2rem; transform: scale(-1); }

/* Skip Intro Button */
.intro-skip-btn {
    position: fixed;
    bottom: 2.2rem;
    right: 2.2rem;
    z-index: 30;
    background: rgba(18, 15, 11, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(212, 170, 100, 0.45);
    color: #f0cf85;
    font-family: var(--font-sans, 'Plus Jakarta Sans', system-ui, sans-serif);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    padding: 0.6rem 1.25rem;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.55rem;
    pointer-events: all;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}
.intro-skip-btn:hover {
    border-color: rgba(212, 170, 100, 0.9);
    color: #ffffff;
    background: rgba(45, 36, 22, 0.95);
    box-shadow: 0 0 20px rgba(212, 170, 100, 0.5), 0 8px 24px rgba(0, 0, 0, 0.7);
    transform: translateY(-1px);
}
.intro-skip-btn svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    transition: transform 0.25s ease;
}
.intro-skip-btn:hover svg {
    transform: translateX(3px);
}

/* ============================================================
   FOREGROUND PRESENTATION SHOWCASE (High-Contrast & Distinct)
   ============================================================ */

.intro-card-wrapper {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 620px;
    padding: 1.5rem;
    pointer-events: none;
}

/* Obsidian Glassmorphism Presentation Card */
.intro-card {
    position: relative;
    width: 100%;
    border-radius: 18px;
    background: rgba(14, 12, 9, 0.92);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(212, 170, 100, 0.45);
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.9),
        0 0 45px rgba(212, 170, 100, 0.15),
        inset 0 0 30px rgba(212, 170, 100, 0.08),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
    padding: 2.75rem 2.5rem 2.25rem;
    text-align: center;
    overflow: hidden;
    will-change: opacity, transform;
}

.intro-card-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 0%, rgba(212, 170, 100, 0.16) 0%, transparent 65%),
        radial-gradient(circle at 50% 100%, rgba(0, 0, 0, 0.7) 0%, transparent 70%);
    pointer-events: none;
}

.intro-card-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 1. Golden Welcome Pill Badge */
.intro-welcome {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    padding: 0.55rem 1.75rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(212, 170, 100, 0.25) 0%, rgba(35, 28, 18, 0.98) 50%, rgba(212, 170, 100, 0.25) 100%);
    border: 1px solid rgba(212, 170, 100, 0.65);
    box-shadow:
        0 0 28px rgba(212, 170, 100, 0.4),
        inset 0 0 16px rgba(212, 170, 100, 0.25),
        0 4px 18px rgba(0, 0, 0, 0.7);
    margin-bottom: 1.35rem;
    position: relative;
    overflow: hidden;
    will-change: opacity, transform;
}

.intro-welcome::after {
    content: '';
    position: absolute;
    top: 0;
    left: -130%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 245, 220, 0.6) 50%, transparent 100%);
    transform: skewX(-25deg);
    animation: introGoldSweep 4s infinite cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

@keyframes introGoldSweep {
    0%, 20% { left: -130%; }
    60%, 100% { left: 220%; }
}

.intro-welcome-text {
    font-family: var(--font-sans, 'Plus Jakarta Sans', system-ui, sans-serif);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #FFFFFF 0%, #F5DEB3 35%, #FFF0D0 70%, #C89B53 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(212, 170, 100, 0.5));
    line-height: 1.25;
}

.intro-welcome-star {
    font-size: 1.1rem;
    color: #f0cf85;
    filter: drop-shadow(0 0 8px rgba(240, 207, 133, 0.9));
    animation: introStarPulse 2.2s ease-in-out infinite alternate;
    line-height: 1;
}

@keyframes introStarPulse {
    0%   { opacity: 0.7; transform: scale(0.9); }
    100% { opacity: 1;   transform: scale(1.2); }
}

/* 2. Eyebrow Sub-tagline */
.intro-eyebrow {
    font-family: var(--font-sans, 'Plus Jakarta Sans', system-ui, sans-serif);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.36em;
    color: #dfba73;
    text-transform: uppercase;
    margin-bottom: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-shadow: 0 0 12px rgba(212, 170, 100, 0.4);
}
.intro-eyebrow-dot {
    color: rgba(212, 170, 100, 0.7);
    font-size: 0.6rem;
}

/* 3. High-Resolution Logo with Warm Ambient Backlight */
.intro-logo-wrap {
    position: relative;
    display: inline-block;
    margin: 0 auto;
    will-change: opacity, transform;
}
.intro-logo-wrap::before {
    content: '';
    position: absolute;
    inset: -24px;
    background: radial-gradient(circle, rgba(212, 170, 100, 0.3) 0%, transparent 70%);
    filter: blur(18px);
    z-index: -1;
    pointer-events: none;
}
.intro-logo-img {
    display: block;
    width: auto;
    max-width: 250px;
    height: auto;
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 24px rgba(212, 170, 100, 0.4)) brightness(1.1);
}

/* 4. Refined Hairline Brass Divider */
.intro-divider {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 170px;
    margin: 1.6rem auto 1.35rem;
    transform-origin: center;
}
.intro-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 170, 100, 0.65));
}
.intro-divider .intro-divider-line:last-child {
    background: linear-gradient(90deg, rgba(212, 170, 100, 0.65), transparent);
}
.intro-divider-diamond {
    font-size: 0.45rem;
    color: #dfba73;
    filter: drop-shadow(0 0 6px rgba(223, 186, 115, 0.8));
    line-height: 1;
    flex-shrink: 0;
}

/* 5. Architectural Statement Subtitle */
.intro-subtitle {
    font-family: var(--font-serif, 'Cormorant Garamond', Georgia, serif);
    font-size: 1.15rem;
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0.16em;
    color: #f0e6d6;
    margin: 0 0 2rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

/* 6. Precision Loading Tracker */
.intro-progress-container {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.intro-progress-track {
    width: 100%;
    height: 2px;
    background: rgba(212, 170, 100, 0.22);
    border-radius: 1px;
    position: relative;
    overflow: hidden;
}
.intro-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #875c1d 0%, #d4aa62 50%, #fff0d0 100%);
    box-shadow: 0 0 12px rgba(212, 170, 100, 0.9);
    border-radius: 1px;
    will-change: width;
}
.intro-progress-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.intro-phase-text {
    font-family: var(--font-sans, 'Plus Jakarta Sans', system-ui, sans-serif);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #cbb898;
    font-weight: 500;
}
.intro-percentage {
    font-family: var(--font-sans, 'Plus Jakarta Sans', system-ui, sans-serif);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #f0cf85;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 8px rgba(240, 207, 133, 0.6);
}

/* ============================================================
   RESPONSIVE DESIGN (Tablets & Mobile)
   ============================================================ */

@media (max-width: 768px) {
    .portal-door-left .portal-door-handle-assembly { right: 14px; }
    .portal-door-right .portal-door-handle-assembly { left: 14px; }
    .portal-door-handle { height: 130px; width: 5px; }
    .handle-mount { width: 12px; height: 5px; }
    .portal-door-hinge { width: 7px; height: 38px; }

    .intro-corner-mark { display: none; }
    .intro-skip-btn {
        bottom: 1.25rem;
        right: 1.25rem;
        padding: 0.5rem 1rem;
        font-size: 0.68rem;
    }

    .intro-card {
        padding: 2rem 1.5rem 1.75rem;
        border-radius: 14px;
    }
    .intro-welcome {
        padding: 0.45rem 1.25rem;
        margin-bottom: 1rem;
        gap: 0.65rem;
    }
    .intro-welcome-text { font-size: 0.92rem; letter-spacing: 0.16em; }
    .intro-welcome-star { font-size: 0.85rem; }

    .intro-eyebrow {
        font-size: 0.62rem;
        letter-spacing: 0.26em;
        margin-bottom: 1.15rem;
    }
    .intro-logo-img { max-width: 190px; }
    .intro-divider { margin: 1.25rem auto 1.1rem; width: 130px; }
    .intro-subtitle { font-size: 1rem; margin-bottom: 1.5rem; }
    .intro-progress-container { max-width: 260px; }
}

@media (max-width: 480px) {
    .intro-welcome-text { font-size: 0.82rem; letter-spacing: 0.12em; }
    .intro-card { padding: 1.75rem 1.2rem 1.5rem; }
    .intro-logo-img { max-width: 160px; }
}