/* === RESET & VARIABLES === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --white: #faf9f7;
    --cream: #f3f1ed;
    --beige: #e8e4de;
    --gray-light: #d4d0ca;
    --gray: #a09a90;
    --gray-dark: #6b6560;
    --dark: #2c2824;
    --black: #1a1714;
    --font-display: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;
    --nav-height: 104px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--white);
    color: var(--dark);
    overflow-x: hidden;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

/* === NAV === */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 1.8rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(250,249,247,0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--beige);
}

.nav-name {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--dark);
}

.nav-name-sub {
    font-size: 0.55rem;
    font-weight: 200;
    letter-spacing: 0.5px;
    text-transform: none;
    color: var(--gray);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}
.nav-links a {
    font-size: 0.7rem;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gray);
    transition: color 0.3s;
}
.nav-links a:hover, .nav-links a.active { color: var(--dark); }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    flex-shrink: 0;
}
.nav-toggle span {
    display: block;
    width: 100%;
    height: 1px;
    background: var(--dark);
    transition: transform 0.3s, opacity 0.3s;
}
.nav.open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav.open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* === MAIN CONTENT OFFSET === */
/* Nav is fixed; --nav-height accounts for padding + text + 1px border. */
body { padding-top: var(--nav-height); }

/* === HOME HERO === */
.home-hero {
    height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream);
    position: relative;
    padding: 3rem;
}

.home-hero img {
    max-height: 75vh;
    max-width: 70vw;
    object-fit: contain;
    box-shadow: 0 8px 60px rgba(0,0,0,0.12);
}

.home-hero-caption {
    position: absolute;
    bottom: 3rem;
    left: 3rem;
}
.home-hero-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 300;
    font-style: italic;
    color: var(--dark);
    margin-bottom: 0.3rem;
}
.home-hero-meta {
    font-size: 0.75rem;
    color: var(--gray);
    font-weight: 200;
}

/* --- Hero variant: gallery wall (full-bleed painting + centered identity) --- */
.home-hero-wall {
    padding: 0;
    overflow: hidden;
}
.home-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.5) saturate(0.9);
}
.home-hero-wall::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(20,17,14,0.25), rgba(20,17,14,0.55));
}
.home-hero-intro {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 2rem;
    color: var(--white);
}
.home-hero-intro-name {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    font-weight: 300;
    letter-spacing: 1px;
}
.home-hero-intro-role {
    margin-top: 0.9rem;
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(250,249,247,0.75);
}
.home-hero-intro-line {
    margin: 1.4rem auto 0;
    font-size: 0.95rem;
    font-weight: 200;
    color: rgba(250,249,247,0.85);
}
.home-hero-credit {
    position: absolute;
    z-index: 2;
    bottom: 2rem;
    left: 3rem;
    max-width: calc(100% - 6rem - 12rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    color: rgba(250,249,247,0.7);
    transition: color 0.3s;
}
.home-hero-credit:hover {
    color: var(--white);
    text-decoration: underline;
}
.home-hero-copyright {
    position: absolute;
    z-index: 2;
    bottom: 2rem;
    right: 3rem;
    font-size: 0.7rem;
    color: rgba(250,249,247,0.7);
    text-align: right;
}

/* === HOME SERIES GRID === */
.home-series {
    padding: 4rem 3rem 8rem;
    max-width: 1400px;
    margin: 0 auto;
}
.home-series-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 300;
    text-align: center;
    margin-bottom: 1rem;
}
.home-series-sub {
    text-align: center;
    font-size: 0.8rem;
    color: var(--gray);
    font-weight: 200;
    margin-bottom: 5rem;
}

.home-series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 3rem;
}

.series-card {
    cursor: pointer;
    transition: transform 0.3s;
    display: block;
}
.series-card:hover { transform: translateY(-4px); }

.series-card img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    box-shadow: 0 4px 30px rgba(0,0,0,0.06);
    margin-bottom: 1.2rem;
}

.series-card-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--cream);
    border: 1px solid var(--beige);
    margin-bottom: 1.2rem;
}

.series-card-name {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 300;
    font-style: italic;
    margin-bottom: 0.3rem;
}
.series-card-detail {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    font-size: 0.7rem;
    color: var(--gray);
    font-weight: 200;
    letter-spacing: 0.5px;
}
.series-card-detail-sep {
    color: var(--gray-light);
}

/* === SERIES PAGE === */
.series-page-header {
    padding: 4rem 3rem 2rem;
    border-bottom: 1px solid var(--beige);
}
.series-page-back {
    margin-bottom: 1.5rem;
}

.series-page-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 300;
    font-style: italic;
    margin-bottom: 0.5rem;
}
.series-page-meta {
    font-size: 0.8rem;
    color: var(--gray);
    font-weight: 200;
    line-height: 1.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.series-page-gallery {
    padding: 4rem 0;
    position: relative;
}

.series-track-wrapper {
    position: relative;
    padding: 0 3rem;
}

.series-track {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding-bottom: 2rem;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
.series-track::-webkit-scrollbar { height: 2px; }
.series-track::-webkit-scrollbar-track { background: var(--beige); }
.series-track::-webkit-scrollbar-thumb { background: var(--gray-light); }

/* Arrow buttons */
.series-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-60%);
    z-index: 10;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--beige);
    background: rgba(250,249,247,0.9);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--gray-dark);
    transition: background 0.3s, border-color 0.3s, color 0.3s, opacity 0.3s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.series-arrow:hover {
    background: var(--white);
    border-color: var(--gray);
    color: var(--dark);
}
.series-arrow.disabled {
    opacity: 0.3;
    pointer-events: none;
}
.series-arrow-left { left: 1rem; }
.series-arrow-right { right: 1rem; }

/* Counter + scroll hint */
.series-gallery-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 3rem 0;
}

.series-counter {
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: var(--gray);
    font-weight: 200;
}
.series-counter .current {
    color: var(--dark);
    font-weight: 400;
}

.series-scroll-hint {
    font-size: 0.65rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.6s;
}
.series-scroll-hint.hidden { opacity: 0; }

.series-scroll-hint-arrow {
    display: inline-block;
    animation: nudge 1.5s ease-in-out infinite;
}
@keyframes nudge {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

.series-painting {
    flex: 0 0 auto;
    scroll-snap-align: start;
    cursor: pointer;
    display: block;
}
.series-painting:last-child { margin-right: 3rem; }

.series-painting img {
    height: 55vh;
    min-height: 350px;
    max-height: 550px;
    width: auto;
    object-fit: contain;
    box-shadow: 0 4px 30px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}
.series-painting:hover img { transform: scale(1.03); }

.series-painting-info {
    padding: 1rem 0;
}
.series-painting-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 300;
    font-style: italic;
    color: var(--dark);
    margin-bottom: 0.2rem;
}
.series-painting-detail {
    font-size: 0.7rem;
    color: var(--gray);
    font-weight: 200;
}

/* === SINGLE PAINTING PAGE === */
.painting-page {
    min-height: calc(100vh - var(--nav-height));
    display: grid;
    grid-template-columns: 1fr 360px;
}

.painting-canvas {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: var(--white);
    min-height: calc(100vh - var(--nav-height));
}

.painting-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--beige);
    background: rgba(250,249,247,0.9);
    backdrop-filter: blur(6px);
    color: var(--gray-dark);
    font-size: 1.1rem;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.painting-nav-arrow:hover {
    background: var(--white);
    border-color: var(--gray);
    color: var(--dark);
}
.painting-nav-arrow-left { left: 1.5rem; }
.painting-nav-arrow-right { right: 1.5rem; }

.painting-canvas img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    box-shadow: 0 8px 50px rgba(0,0,0,0.1);
}

.painting-sidebar {
    padding: 4rem 2.5rem;
    border-left: 1px solid var(--beige);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.back-button {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    background: rgba(250,249,247,0.9);
    backdrop-filter: blur(6px);
    font-size: 0.65rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gray);
    transition: color 0.3s, background 0.3s;
}
.back-button:hover { color: var(--dark); background: var(--white); }

.painting-canvas-back {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 10;
}

.painting-sidebar-series {
    font-size: 0.6rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 1rem;
}

.painting-sidebar-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 300;
    font-style: italic;
    line-height: 1.3;
    margin-bottom: 2rem;
}

.painting-details {
    list-style: none;
    margin-bottom: 2.5rem;
}
.painting-details li {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--beige);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.painting-details .label {
    font-size: 0.6rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gray);
}
.painting-details .value {
    font-size: 0.85rem;
    color: var(--dark);
    font-weight: 200;
}

.painting-link-actions {
    display: flex;
    gap: 0.5rem;
}
.painting-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--beige);
    background: none;
    color: var(--gray-dark);
    cursor: pointer;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.painting-link-btn:hover {
    background: var(--cream);
    border-color: var(--gray);
    color: var(--dark);
}
.painting-link-btn.copied {
    color: var(--white);
    background: var(--gray-dark);
    border-color: var(--gray-dark);
}

.painting-link-row {
    position: relative;
    flex-wrap: wrap;
}
.painting-qr-popover {
    display: none;
    width: 100%;
    margin-top: 0.8rem;
}
.painting-qr-popover.is-open {
    display: block;
}
.painting-qr-img {
    display: block;
    width: 160px;
    height: 160px;
    background: var(--white);
    border: 1px solid var(--beige);
    padding: 0.5rem;
}
.painting-qr-download {
    display: inline-block;
    margin-top: 0.6rem;
    font-size: 0.65rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gray-dark);
    border-bottom: 1px solid var(--gray-light);
}
.painting-qr-download:hover {
    color: var(--dark);
    border-color: var(--gray-dark);
}
.painting-qr-hint {
    margin-top: 0.6rem;
    max-width: 320px;
    font-size: 0.7rem;
    font-weight: 200;
    color: var(--gray);
}

/* === PLACEHOLDER PAGE (sections in progress) === */
.placeholder-page {
    min-height: calc(100vh - var(--nav-height) - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 3rem;
    background: var(--white);
}

.placeholder-inner {
    text-align: center;
    max-width: 640px;
}

.placeholder-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 300;
    color: var(--dark);
    margin-bottom: 1.5rem;
}

.placeholder-text {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 200;
    letter-spacing: 0.3px;
    line-height: 1.8;
    color: var(--gray-dark);
}

/* === BIOGRAFIA PAGE === */
.bio-page {
    max-width: 860px;
    margin: 0 auto;
    padding: 5rem 3rem 6rem;
}

.bio-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.bio-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3rem);
    font-weight: 300;
    color: var(--dark);
    margin-bottom: 0.6rem;
}

.bio-subtitle {
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gray);
}

.bio-body {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 3rem;
    align-items: start;
}

.bio-portrait img {
    width: 100%;
    border-radius: 2px;
    filter: grayscale(15%);
}

.bio-text {
    font-size: 0.95rem;
    line-height: 1.9;
    color: var(--gray-dark);
}

.bio-text p {
    margin-bottom: 1.4rem;
}

/* === FOOTER === */
.footer {
    border-top: 1px solid var(--beige);
    padding: 4rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--cream);
}
.footer-copy {
    font-size: 0.7rem;
    color: var(--gray);
    font-weight: 200;
}
.footer-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}
.footer-links a {
    font-size: 0.65rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gray);
    transition: color 0.3s;
}
.footer-links a:hover, .footer-links a.active { color: var(--dark); }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .painting-page { grid-template-columns: 1fr; }
    .painting-sidebar {
        border-left: none;
        border-top: 1px solid var(--beige);
        padding: 2.5rem;
    }
    .painting-canvas { min-height: 60vh; }
    .home-series-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    :root { --nav-height: 72px; }

    .nav {
        padding: 1rem 1.2rem;
        flex-wrap: wrap;
    }
    .nav-name { font-size: 0.85rem; letter-spacing: 3px; }
    .nav-name-sub { display: none; }
    .nav-toggle { display: flex; }

    .nav-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--beige);
        box-shadow: 0 12px 24px rgba(0,0,0,0.08);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    .nav.open .nav-links { max-height: 70vh; }
    .nav-links li { width: 100%; }
    .nav-links a {
        display: block;
        padding: 1rem 1.2rem;
        font-size: 0.75rem;
        letter-spacing: 1px;
        border-bottom: 1px solid var(--beige);
    }

    .home-hero { padding: 1.5rem; }
    .home-hero img { max-width: 90vw; max-height: 65vh; }
    .home-hero-credit,
    .home-hero-copyright {
        position: static;
        display: block;
        max-width: none;
        white-space: normal;
        text-align: center;
    }
    .home-hero-intro { padding: 0 1.2rem; }
    .home-hero-credit { margin: 0 auto 0.4rem; }
    .home-hero-copyright { margin: 0 auto; }
    .home-hero-wall {
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        padding-bottom: 1.5rem;
    }

    .home-series { padding: 4rem 1.5rem; }
    .series-page-header { padding: 3rem 1.5rem 1.5rem; }
    .series-page-gallery { padding: 2rem 0; }
    .series-track-wrapper { padding: 0 1.5rem; }
    .series-painting img { height: 40vh; min-height: 250px; }
    .series-arrow { display: none; }
    .series-gallery-footer { padding: 1rem 1.5rem 0; }

    .painting-canvas { padding: 1.5rem; min-height: 50vh; }
    .painting-canvas-back { top: 0.75rem; left: 0.75rem; }
    .painting-nav-arrow { display: none; }

    .footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 3rem 1.5rem;
    }
    .footer-links { flex-wrap: wrap; justify-content: center; gap: 1rem 1.2rem; }

    .bio-page { padding: 3rem 1.5rem 4rem; }
    .bio-body {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .bio-portrait { max-width: 220px; margin: 0 auto; }
}
