*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background: #000;
}

.portal-container {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100vw;
}

.portal-half {
    position: relative;
    flex: 1;
    height: 100%;
    overflow: hidden;
    transition: flex 1.1s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease;
}

/* Each half is a hard style boundary — the iframe document loads its own
   framework (SNES.css for kayak, Puppertino for mentor) with zero risk of
   the two global stylesheets colliding, since iframes are separate documents. */
.portal-half iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.portal-half.expanded {
    flex: 100;
}

.portal-half.shrunk {
    flex: 0.0001;
    opacity: 0;
    pointer-events: none;
}

/* Sits above the iframe so a click anywhere on an unexpanded half is
   caught by the parent page (clicks inside an iframe's own document can't
   be observed from here — this is what makes "click panel to expand"
   possible at all). Removed from interaction once a half is expanded, so
   the iframe's own "Enter This World" link becomes clickable. */
.click-catcher {
    position: absolute;
    inset: 0;
    z-index: 10;
    cursor: pointer;
}

.portal-container.has-expanded .click-catcher {
    pointer-events: none;
}

@media screen and (max-width: 900px) {
    .portal-container {
        flex-direction: column;
    }
}
