:root {
    color-scheme: dark;
    --background: #000;
    --foreground: #fff;
    --border: rgba(255, 255, 255, 0.94);
    --gap: clamp(12px, 1.5vw, 24px);
    --square-size: min(42vw, 78vh);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--foreground);
    font-family: Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button {
    font: inherit;
}

.story-layout {
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--gap);
    padding: clamp(14px, 2.2vw, 34px);
}

.square {
    width: var(--square-size);
    height: var(--square-size);
    aspect-ratio: 1 / 1;
    border: 1px solid var(--border);
    background: var(--background);
    overflow: hidden;
}

.image-panel img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    filter: grayscale(100%);
}

.text-panel {
    display: flex;
    flex-direction: column;
    padding: clamp(20px, 3vw, 48px);
}

.story-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 18px;
    padding-bottom: clamp(18px, 2vw, 30px);
    border-bottom: 1px solid var(--border);
}

.story-header h1 {
    margin: 0;
    font-size: clamp(16px, 1.3vw, 24px);
    line-height: 1.18;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.language-button {
    min-width: 42px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid currentColor;
    border-radius: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    line-height: 1.25;
    text-align: right;
}

.language-button:hover,
.language-button:focus-visible {
    opacity: 0.62;
}

.story-copy {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    padding-top: clamp(18px, 2vw, 32px);
    overflow: hidden;
}

.story-copy p {
    margin: 0;
    max-width: 38em;
    font-size: clamp(15px, 1.32vw, 22px);
    line-height: 1.42;
    font-weight: 400;
    letter-spacing: -0.015em;
}

@media (max-width: 760px) {
    :root {
        --square-size: calc(100vw - 28px);
    }

    .story-layout {
        min-height: auto;
        flex-direction: column;
        justify-content: flex-start;
        gap: 14px;
        padding: 14px;
    }

    .square {
        max-width: 560px;
        max-height: 560px;
    }

    .text-panel {
        padding: clamp(19px, 6vw, 28px);
    }

    .story-header {
        gap: 12px;
        padding-bottom: 16px;
    }

    .story-header h1 {
        font-size: clamp(15px, 4.1vw, 19px);
    }

    .story-copy {
        padding-top: 16px;
    }

    .story-copy p {
        font-size: clamp(13px, 3.75vw, 17px);
        line-height: 1.38;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .story-copy p {
        animation: reveal 260ms ease-out;
    }

    @keyframes reveal {
        from {
            opacity: 0;
            transform: translateY(4px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}
