/*
==============================================================
REVAMED MANSION — ACT II VISUAL SYSTEM
Pseudo-3D subterranean foundation vault.
==============================================================
*/

.act2-foundation-vault {
    position: relative;
    min-height: clamp(520px, 72vh, 820px);
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at 50% 42%, rgba(62, 122, 135, 0.18), transparent 34%),
        linear-gradient(180deg, #111519 0%, #090c0f 58%, #050607 100%);
    perspective: 1100px;
    color: #e8e1d4;
}

.act2-foundation-vault::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 8%),
        linear-gradient(180deg, transparent 0 58%, rgba(0,0,0,0.68) 100%);
    z-index: 8;
}

.act2-depth-layer {
    position: absolute;
    left: 50%;
    transform-origin: center bottom;
    pointer-events: none;
}

.act2-depth-back {
    top: 13%;
    width: min(70vw, 760px);
    height: 45%;
    transform: translateX(-50%) translateZ(-220px) rotateX(4deg);
    border: 2px solid rgba(183, 161, 121, 0.18);
    background:
        linear-gradient(90deg, rgba(0,0,0,0.64), transparent 25% 75%, rgba(0,0,0,0.64)),
        repeating-linear-gradient(0deg, #171b1d 0 30px, #121619 30px 32px),
        repeating-linear-gradient(90deg, transparent 0 76px, rgba(255,255,255,0.03) 76px 78px);
    box-shadow: inset 0 0 80px rgba(0,0,0,0.75);
}

.act2-depth-mid {
    bottom: -12%;
    width: 92%;
    height: 58%;
    transform: translateX(-50%) rotateX(62deg);
    background:
        linear-gradient(90deg, rgba(13,17,19,0.96), rgba(28,33,34,0.96) 50%, rgba(13,17,19,0.96)),
        repeating-linear-gradient(90deg, transparent 0 94px, rgba(219,199,159,0.05) 94px 96px);
    border-top: 1px solid rgba(205, 180, 131, 0.16);
}

.act2-depth-front {
    inset: auto 0 0 0;
    width: 100%;
    height: 26%;
    transform: none;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.7));
}

.act2-scene-copy {
    position: absolute;
    top: clamp(18px, 3vw, 34px);
    left: clamp(18px, 4vw, 52px);
    width: min(420px, calc(100% - 36px));
    z-index: 15;
    text-shadow: 0 2px 16px #000;
}

.act2-kicker,
.act2-console-label {
    margin: 0 0 8px;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #bca574;
}

.act2-scene-copy h3,
.act2-complete-card h3 {
    margin: 0 0 10px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.7rem, 4vw, 3rem);
    font-weight: 500;
}

.act2-scene-copy p:last-child {
    margin: 0;
    max-width: 56ch;
    color: #c8c1b6;
    line-height: 1.55;
}

.act2-vault-frame {
    position: absolute;
    top: 25%;
    left: 50%;
    width: clamp(180px, 30vw, 330px);
    height: clamp(220px, 41vw, 420px);
    transform: translateX(-50%) translateZ(36px);
    border: clamp(10px, 1.5vw, 18px) solid #211d19;
    border-bottom-width: clamp(18px, 2vw, 28px);
    background: #030405;
    box-shadow:
        0 0 0 2px rgba(184,154,101,0.22),
        0 28px 80px rgba(0,0,0,0.8),
        inset 0 0 48px rgba(0,0,0,0.9);
    z-index: 10;
}

.act2-vault-gate {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: space-around;
    padding: 0 10%;
    transition: transform 900ms cubic-bezier(.2,.85,.2,1), opacity 700ms ease;
    background: linear-gradient(180deg, rgba(105,89,65,0.2), rgba(17,15,13,0.8));
}

.act2-vault-gate span {
    display: block;
    width: clamp(7px, 1.3vw, 13px);
    height: 100%;
    background: linear-gradient(90deg, #171513, #6a5a44 50%, #171513);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.7);
}

.vault-is-open .act2-vault-gate {
    transform: translateY(-96%);
    opacity: 0.2;
}

.act2-vault-glow {
    position: absolute;
    inset: 28% 20% 10%;
    opacity: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96, 192, 178, 0.42), rgba(62, 114, 109, 0.1) 55%, transparent 72%);
    filter: blur(8px);
    transition: opacity 700ms ease 250ms;
}

.vault-is-open .act2-vault-glow {
    opacity: 1;
}

.act2-plate-zone {
    position: absolute;
    left: 50%;
    bottom: clamp(88px, 14vh, 140px);
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(4, minmax(64px, 96px));
    gap: clamp(12px, 2vw, 22px);
    z-index: 18;
}

.act2-pressure-plate {
    min-height: 66px;
    border: 1px solid rgba(204, 178, 127, 0.48);
    border-radius: 4px;
    color: #d8c59d;
    background:
        linear-gradient(180deg, rgba(62,58,50,0.94), rgba(22,22,20,0.98));
    box-shadow:
        inset 0 1px rgba(255,255,255,0.08),
        0 8px 0 #080909,
        0 16px 28px rgba(0,0,0,0.48);
    font: 700 1rem/1 Georgia, serif;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
    touch-action: manipulation;
}

.act2-pressure-plate:hover,
.act2-pressure-plate:focus-visible {
    border-color: #d4bb87;
    outline: 2px solid rgba(128, 210, 198, 0.68);
    outline-offset: 3px;
}

.act2-pressure-plate.is-pressed,
.act2-pressure-plate:active {
    transform: translateY(7px);
    box-shadow: inset 0 1px rgba(255,255,255,0.05), 0 1px 0 #080909;
}

.act2-console {
    position: absolute;
    right: clamp(14px, 3vw, 38px);
    bottom: clamp(18px, 3vw, 34px);
    width: min(300px, calc(100% - 28px));
    z-index: 22;
    padding: 16px;
    border: 1px solid rgba(185, 158, 107, 0.26);
    border-radius: 8px;
    background: rgba(7, 10, 11, 0.88);
    backdrop-filter: blur(10px);
    box-shadow: 0 18px 48px rgba(0,0,0,0.38);
}

.act2-sequence {
    margin: 0 0 8px;
    font: 600 1.35rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.12em;
    color: #80c9be;
}

.act2-status {
    min-height: 3.4em;
    margin: 0 0 12px;
    color: #c8c3ba;
    line-height: 1.4;
    font-size: 0.9rem;
}

.act2-console .secondary-button,
.act2-return-button,
.act2-foundation-seal,
.act2-title-button {
    min-height: 44px;
}

.act2-foundation-seal {
    position: absolute;
    top: 52%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 25;
    display: grid;
    gap: 7px;
    place-items: center;
    min-width: 190px;
    padding: 14px 18px;
    border: 1px solid rgba(128, 210, 198, 0.66);
    border-radius: 8px;
    color: #e8e1d4;
    background: rgba(17, 34, 32, 0.9);
    box-shadow: 0 0 42px rgba(82, 167, 154, 0.3);
    cursor: pointer;
}

.act2-foundation-seal span {
    font-size: 2rem;
    color: #84d3c7;
}

.act2-return-button {
    position: absolute;
    left: clamp(14px, 3vw, 38px);
    bottom: clamp(18px, 3vw, 34px);
    z-index: 22;
}

.act2-vault-descend-button {
    position: absolute;
    right: clamp(14px, 3vw, 38px);
    bottom: clamp(18px, 3vw, 34px);
    z-index: 22;
    min-height: 44px;
}

.act2-complete-card {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    width: min(520px, calc(100% - 32px));
    padding: clamp(22px, 5vw, 38px);
    border: 1px solid rgba(191, 163, 109, 0.46);
    border-radius: 12px;
    background: rgba(8, 11, 12, 0.96);
    box-shadow: 0 28px 90px rgba(0,0,0,0.75);
    text-align: center;
}

.act2-complete-card p:not(.act2-kicker) {
    color: #c8c1b6;
    line-height: 1.55;
}

.act2-complete-card .primary-button {
    min-height: 48px;
    margin-top: 8px;
}

@media (max-width: 760px) {
    .act2-foundation-vault {
        min-height: 720px;
    }

    .act2-scene-copy {
        top: 16px;
        left: 16px;
        right: 16px;
        width: auto;
    }

    .act2-scene-copy p:last-child {
        font-size: 0.9rem;
    }

    .act2-vault-frame {
        top: 29%;
        width: min(52vw, 250px);
        height: min(62vw, 310px);
    }

    .act2-plate-zone {
        bottom: 196px;
        grid-template-columns: repeat(4, minmax(54px, 68px));
        gap: 10px;
    }

    .act2-console {
        left: 14px;
        right: 14px;
        bottom: 14px;
        width: auto;
    }

    .act2-return-button {
        left: 14px;
        bottom: 178px;
    }

    .act2-vault-descend-button {
        right: 14px;
        bottom: 178px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .act2-foundation-vault *,
    .act2-foundation-vault *::before,
    .act2-foundation-vault *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}
