
/* ==========================================================================
   LAYER 2: CURTAIN SLIDESHOW SECTION (.mm-layer in .mm-stack)
   ========================================================================== */
.curtain-slideshow-section {
    position: relative;
    top: 0;
    width: 100%;
    height: 105vh;
    min-height: 105vh;
    z-index: 2;
    background: #000000;
    overflow: hidden;
    box-sizing: border-box;
    display: block;
    padding: 0;
}

.curtain-slideshow-viewport {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000000;
}

/* Dip to Dark Black Overlay */
.curtain-dip-overlay {
    position: absolute;
    inset: 0;
    background: #000000;
    opacity: 0;
    z-index: 5;
    pointer-events: none;
    will-change: opacity;
}

/* Edge-to-Edge Slides */
.curtain-slides-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
}

.curtain-slide-item {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
}

.curtain-slide-item.active {
    opacity: 1;
    visibility: visible;
}

.curtain-slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    will-change: transform;
    transform: scale(1);
}


/* Soft Dark Gradient at bottom */
.curtain-bottom-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 52%;
    pointer-events: none;
    z-index: 4;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.45) 45%, transparent 100%);
}

/* ==========================================================================
   SLIDESHOW CONTROLS & CAPTIONS
   ========================================================================== */
.curtain-controls {
    position: absolute;
    left: clamp(32px, 4.5vw, 68px);
    bottom: clamp(66px, 5.5vh, 64px);
    z-index: 6;
    display: flex;
    align-items: flex-end;
    width: calc(100% - clamp(64px, 9vw, 136px));
    pointer-events: none;
    box-sizing: border-box;
}

/* Bottom-Left Block: Progress Line + Caption */
.curtain-left-block {
    width: 434px;
    max-width: 434px;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
}

/* Segmented Progress Line */
.curtain-progress-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 434px;
    max-width: 100%;
    margin-bottom: 24px;
}

.progress-segment {
    flex: 1;
    position: relative;
    height: 1px;
    background: transparent;
    border: none;
    padding: 12px 0;
    margin: -12px 0;
    cursor: pointer;
    outline: none;
}

.progress-segment:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 4px;
}

.segment-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%);
    pointer-events: none;
    transition: background 0.3s ease;
}

.progress-segment:hover .segment-track {
    background: rgba(255, 255, 255, 0.7);
}

.segment-dash {
    position: absolute;
    top: 50%;
    left: 0;
    width: 22px;
    height: 2px;
    background: #ffffff;
    border-radius: 1px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.95);
    transform: translateY(-50%) translateX(0px);
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

/* Captions (19px, line-height 1.08, letter-spacing -0.012em, medium weight, 434px wide) */
.curtain-caption-wrapper {
    position: relative;
    width: 434px;
    max-width: 100%;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.curtain-caption-slide {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 18px;
    line-height: 1.08;
    letter-spacing: -0.012em;
    font-weight: 500;
    color: #ffffff;
    margin: 0;
}

.curtain-caption-slide.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.caption-line-mask {
    display: block;
    overflow: hidden;
    line-height: 1.08;
    margin-bottom: 2px;
}

.caption-line {
    display: block;
    transform: translateY(0%);
    will-change: transform;
}

/* Action Block: View Projects Button at left: 33% of viewport */
.curtain-action-block {
    position: absolute;
    left: 50%;
    bottom: 0;
    pointer-events: auto;
}

.curtain-view-btn {
    position: relative;
    z-index: 3;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 13px 26px;
    border-radius: 2px;
    background: #c7c7c781;
    color: #111111;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    text-decoration: none;
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.28);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
    margin: auto;
}

.curtain-view-btn span {
    color: #111111;
    font-weight: 500;
}

.curtain-view-btn .dotted-circle {
    width: 18px;
    height: 18px;
    color: #111111;
    flex-shrink: 0;
    transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
}

.curtain-view-btn:hover {
    background: #ffffff;
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.curtain-view-btn:hover .dotted-circle {
    transform: rotate(90deg);
}

.curtain-view-btn:hover {
    background: #ffffff;
    color: #ffffff;
    border-color: #ffffff;
}

.curtain-view-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 4px;
}

/* Dotted Circle Spinner Icon (12 round dots, stroke-dasharray 0 4.19) */
.dotted-spinner {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: inline-block;
    transform-origin: center center;
    animation: spinnerSlow 9s linear infinite;
}

.curtain-view-btn:hover .dotted-spinner,
.curtain-view-btn:focus-visible .dotted-spinner {
    animation: spinnerFast 1.5s linear infinite;
}

@keyframes spinnerSlow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes spinnerFast {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Bottom-Right Shard Emblem */
.curtain-shard-block {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    flex-shrink: 0;
    margin-left: auto;
}

.curtain-shard-block .panel-shard-wrap {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: 120px;
    height: 120px;
}

.curtain-shard-block .shard-ring-svg {
    width: 120px;
    height: 120px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE & TABLET: < 760px)
   ========================================================================== */
@media (max-width: 1024px) {
    .curtain-action-block {
        left: 48%;
    }
}

@media (max-width: 768px) {
    .curtain-slideshow-section {
        position: relative;
        top: 0;
        width: 100%;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        background: #000000;
        overflow: hidden;
        display: block;
        padding: 0;
    }

    .curtain-slideshow-viewport {
        position: relative;
        inset: auto;
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        background: #000000;
        overflow: hidden;
    }

    /* Full Architectural Render Showcase (Complete Architecture Visible Without Cropping) */
    .curtain-slides-wrapper {
        position: relative;
        inset: auto;
        width: 100%;
        height: 48vh;
        min-height: 270px;
        max-height: 52vh;
        background: radial-gradient(circle at center, #141416 0%, #000000 100%);
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .curtain-slide-item {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s ease;
    }

    .curtain-slide-item.active {
        opacity: 1;
        visibility: visible;
    }

    /* Complete Uncropped Image: Zero Cropping of Architecture or Design */
    .curtain-slide-img {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        object-position: center;
        display: block;
        transform: scale(1);
    }

    /* Black Overlay for Dip-to-Dark Transition */
    .curtain-dip-overlay {
        position: absolute;
        inset: 0;
        background: #000000;
        opacity: 0;
        z-index: 5;
        pointer-events: none;
        will-change: opacity;
    }

    /* Soft Gradient is not needed over the image since text is placed cleanly below */
    .curtain-bottom-gradient {
        display: none;
    }

    /* Content & Controls Panel positioned cleanly below the render */
    .curtain-controls {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        width: 100%;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        background: linear-gradient(180deg, #09090b 0%, #000000 100%);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding: 20px 20px max(24px, env(safe-area-inset-bottom, 20px)) 20px;
        box-sizing: border-box;
        z-index: 6;
        pointer-events: auto;
        gap: 16px;
    }

    .curtain-left-block {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .curtain-progress-bar {
        width: 100%;
        gap: 8px;
        margin-bottom: 16px;
        display: flex;
        align-items: center;
    }

    .progress-segment {
        padding: 10px 0;
        margin: -10px 0;
    }

    .curtain-caption-wrapper {
        position: relative;
        width: 100%;
        min-height: 96px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .curtain-caption-slide {
        position: absolute;
        top: 0;
        left: 0;
        bottom: auto;
        width: 100%;
        font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        font-size: clamp(14px, 3.8vw, 15.5px);
        line-height: 1.45;
        letter-spacing: -0.01em;
        font-weight: 400;
        color: rgba(255, 255, 255, 0.9);
        margin: 0;
    }

    .caption-line-mask {
        line-height: 1.45;
        margin-bottom: 2px;
    }

    .curtain-action-block {
        position: relative;
        left: auto;
        bottom: auto;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: auto;
        padding-top: 10px;
        padding-right: 140px; /* Clearance for the bottom-right floating pill */
    }

    .curtain-view-btn {
        width: auto;
        max-width: 100%;
        height: 44px;
        padding: 0 20px;
        font-size: 13px;
        border-radius: 999px;
        margin: 0;
        display: inline-flex;
        align-items: center;
        gap: 12px;
        background: rgba(255, 255, 255, 0.12);
        color: #ffffff;
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
        white-space: nowrap;
    }

    .curtain-view-btn span {
        color: #ffffff;
    }

    .curtain-view-btn .dotted-circle {
        color: #ffffff;
    }

    .curtain-shard-block {
        display: none;
    }

    /* Mobile Pull-up Panel */
    .curtain-reveal-panel {
        height: 38vh;
        min-height: 240px;
        padding: 24px 20px;
    }

    .panel-inner {
        align-items: center;
        justify-content: center;
    }

    .panel-shard-wrap {
        position: static;
        transform: none;
        width: 80px;
        height: 80px;
        margin: 0 auto;
    }

    .shard-ring-svg {
        width: 80px;
        height: 80px;
    }
}

/* ==========================================================================
   PREFERS-REDUCED-MOTION SAFEGUARD
   Stack the slides as a plain gallery with the panel visible below.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .curtain-slideshow-section {
        height: auto !important;
        overflow: visible !important;
    }

    .curtain-slideshow-viewport {
        position: relative !important;
        height: auto !important;
        transform: none !important;
    }

    .curtain-slides-wrapper {
        position: relative !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 40px !important;
    }

    .curtain-slide-item {
        position: relative !important;
        opacity: 1 !important;
        visibility: visible !important;
        height: 70vh !important;
        min-height: 480px !important;
    }

    .curtain-reveal-panel {
        position: relative !important;
        height: auto !important;
        min-height: auto !important;
        padding: 60px 40px !important;
    }

    .curtain-dip-overlay {
        display: none !important;
    }

    .shard-ring-spinner,
    .shard-self-rotate,
    .dotted-spinner {
        animation: none !important;
    }

    .caption-line {
        transform: none !important;
    }
}
