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

html,
body {
    height: 100%;
    overflow: hidden;
    background: white;
    font-family: 'Mulish', sans-serif;
}

body {
    padding: 5vh 5vw;
    display: flex;
    align-items: stretch;
}

.rectangle {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 0.5fr 1fr;
    overflow: hidden;
}

/* ── LEFT PANEL ── */
.left-panel {
    background: #e8e8e8;
    color: #2c2c2c;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 50px 1.5rem 2rem;
}

/* Language buttons — top-right, 15px from top, flush with right border */
.lang-buttons {
    position: absolute;
    top: 15px;
    right: 0;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    width: 180px;
}

.lang-btn {
    height: 25px;
    width: fit-content;
    justify-self: center;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 1.125rem;
    font-family: 'Mulish', sans-serif;
    color: inherit;
    letter-spacing: 0.05em;
    transition: border-color 0.15s;
}

.lang-btn:hover,
.lang-btn.active {
    border-bottom-color: #2c2c2c;
}

/* Main content — vertically centered */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    width: 100%;
}

.title {
    text-align: center;
    font-size: clamp(1.75rem, 9vw, 2.875rem);
    font-family: Mulish, serif;
    line-height: 1.4;
    letter-spacing: 0.05em;
}

.title .ampersand {
    font-size: 0.52em;
}

.explanation {
    text-align: center;
    font-size: clamp(1rem, 4vw, 1.375rem);
    line-height: 1.5;
    max-width: 85%;
    font-style: italic;
}

.puzzle-input {
    width: 85%;
    padding: 0.45rem 0.75rem;
    border: 1px solid #bbb;
    background: white;
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.puzzle-input:focus {
    border-color: #888;
}

.submit-btn {
    background: black;
    color: white;
    border: none;
    padding: 0.5rem 2.5rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.submit-btn:hover {
    background: #333;
}

/* ── RIGHT PANEL ── */
.right-panel {
    overflow: hidden;
}

.right-panel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 42%;
    display: block;
}

/* ── SMALL SCREENS: stack, allow vertical scroll ── */
@media (max-width: 768px) {
    html, body {
        height: auto;
        overflow: visible;
    }

    .rectangle {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        min-height: 0;
    }

    .right-panel {
        min-height: 45vh;
    }

    .left-panel {
        padding-top: 50px;
        padding-bottom: 1rem;
    }

    .main-content {
        gap: 0.75rem;
    }
}
