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

:root {
    --bg:     #f5f4f0;
    --fg:     #111;
    --muted:  #888;
    --border: #d8d5cc;
    --serif:  'Cormorant', serif;
    --sans:   'Inter', sans-serif;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--sans);
    font-weight: 300;
    font-size: 12px;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
}

/* ── Lang visibility ──────────────────────── */

.lang-es [data-lang="en"],
.lang-en [data-lang="es"] {
    display: none !important;
}

/* ── Spread layout ────────────────────────── */

.spread {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Left column ──────────────────────────── */

.col-left {
    width: 50%;
    min-width: 50%;
    padding: 52px 48px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    position: relative;
}

.hero-text {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(32px, 3.8vw, 56px);
    line-height: 1.08;
    letter-spacing: -0.01em;
    color: var(--fg);
}

/* ── Right column ─────────────────────────── */

.col-right {
    width: 50%;
    min-width: 50%;
    position: relative;
    overflow-y: auto;
}

/* ── Panels ───────────────────────────────── */

.panel {
    display: none;
    padding: 52px 48px 96px;
    min-height: 100%;
}

.panel.is-active {
    display: block;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 56px;
}

.panel-label {
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.panel-number {
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--muted);
}

/* ── Work list ────────────────────────────── */

.work-section {
    margin-bottom: 44px;
}

.work-section-title {
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.work-list {
    list-style: none;
}

.work-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: opacity 0.2s;
}

.work-item:hover {
    opacity: 0.45;
}

.work-item-title {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: 19px;
    color: var(--fg);
}

.work-item-meta {
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--muted);
    white-space: nowrap;
    padding-left: 16px;
}

/* ── About panel ──────────────────────────── */

.about-intro {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: 23px;
    line-height: 1.45;
    color: var(--fg);
    margin-bottom: 52px;
}

.cv-section {
    margin-bottom: 40px;
}

.cv-section-title {
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.cv-entry {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 0 16px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    line-height: 1.5;
}

.cv-year {
    font-size: 10px;
    color: var(--muted);
    padding-top: 1px;
}

/* ── Contact panel ────────────────────────── */

.contact-block {
    margin-bottom: 44px;
}

.contact-label {
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.contact-value {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: 22px;
    line-height: 1.3;
    color: var(--fg);
}

.contact-value a {
    color: inherit;
    text-decoration: none;
}

.contact-value a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ── Project overlay ──────────────────────── */

.project-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 50%;
    height: 100vh;
    background: var(--bg);
    border-left: 1px solid var(--border);
    padding: 52px 48px 96px;
    overflow-y: auto;
    z-index: 100;
    opacity: 0;
    transform: translateX(36px);
    pointer-events: none;
    transition: opacity 0.38s ease, transform 0.38s ease;
}

.project-overlay.is-open {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 44px;
}

.overlay-close {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--sans);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0;
    transition: color 0.2s;
}

.overlay-close:hover {
    color: var(--fg);
}

.project-title {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: 28px;
    line-height: 1.2;
    margin-bottom: 6px;
}

.project-meta {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 36px;
}

.project-image {
    width: 100%;
    aspect-ratio: 4/3;
    background: #dddad2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
}

.project-image span {
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #aaa;
}

.project-body {
    columns: 2;
    column-gap: 24px;
    font-size: 11px;
    line-height: 1.85;
}

.project-body p + p {
    margin-top: 12px;
}

/* ── Bottom navigation ────────────────────── */

.bottom-nav {
    position: fixed;
    bottom: 30px;
    left: 48px;
    display: flex;
    align-items: center;
    gap: 18px;
    z-index: 10;
}

.bottom-nav button,
.bottom-nav a {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--sans);
    font-weight: 300;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0;
    text-decoration: none;
    transition: color 0.2s;
}

.bottom-nav button:hover,
.bottom-nav a:hover,
.bottom-nav button.is-active {
    color: var(--fg);
}

.nav-sep {
    width: 1px;
    height: 9px;
    background: var(--border);
    display: inline-block;
}

/* ── Lang toggle ──────────────────────────── */

.lang-toggle {
    position: fixed;
    bottom: 30px;
    right: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
}

.lang-toggle button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--sans);
    font-weight: 300;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0;
    transition: color 0.2s;
}

.lang-toggle button.is-active {
    color: var(--fg);
}

.lang-toggle button:hover {
    color: var(--fg);
}

.lang-sep {
    font-size: 10px;
    color: var(--border);
}

/* ── Responsive: tablet ───────────────────── */

@media (max-width: 768px) {
    .spread {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .col-left {
        width: 100%;
        min-width: unset;
        height: 44vh;
        padding: 36px 28px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        justify-content: flex-start;
    }

    .col-right {
        width: 100%;
        min-width: unset;
        overflow-y: visible;
    }

    .panel {
        padding: 36px 28px 100px;
    }

    .project-overlay {
        width: 100%;
        left: 0;
        border-left: none;
        border-top: 1px solid var(--border);
    }

    .bottom-nav {
        left: 28px;
        bottom: 22px;
    }

    .lang-toggle {
        right: 28px;
        bottom: 22px;
    }
}

/* ── Responsive: mobile ───────────────────── */

@media (max-width: 576px) {
    .col-left {
        padding: 28px 20px;
        height: 38vh;
    }

    .panel {
        padding: 28px 20px 100px;
    }

    .project-body {
        columns: 1;
    }

    .bottom-nav {
        left: 20px;
        bottom: 18px;
    }

    .lang-toggle {
        right: 20px;
        bottom: 18px;
    }
}

@media (max-width: 375px) {
    .hero-text {
        font-size: 38px;
    }

    .work-item-title {
        font-size: 16px;
    }
}
