/* ── Reset & Base ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f5f3ef;
    --text: #1a1a1a;
    --text-muted: #666;
    --nav-height: 3.8rem;
    --font: "Times New Roman", "Georgia", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

html {
    font-size: 16px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.7rem 2rem 0;
    z-index: 100;
    background: var(--bg);
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.site-title {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text);
    white-space: nowrap;
}

.site-title a {
    color: var(--text);
    text-decoration: none;
}

/* ── Ticker (scrolling text) ── */
.ticker-wrap {
    overflow: hidden;
    width: 100%;
    max-width: 50vw;
}

.ticker {
    display: inline-flex;
    white-space: nowrap;
    animation: ticker-scroll 20s linear infinite;
}

.ticker-text {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding-right: 4rem;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ── Nav links (right side) ── */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-right a {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.2s;
}

.header-right a:hover,
.header-right a.active {
    color: var(--text);
}

/* ── Marquee Gallery ── */
.marquee-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
    cursor: grab;
}

.marquee-container.dragging {
    cursor: grabbing;
}

.marquee-track {
    display: flex;
    will-change: transform;
    padding: 2rem 0;
}

.marquee-images {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 0.75rem;
    white-space: nowrap;
}

.gallery-item {
    flex-shrink: 0;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: opacity 0.3s;
}

.gallery-item:hover {
    opacity: 0.88;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    -webkit-user-drag: none;
}

/* ── Lightbox ── */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.visible {
    opacity: 1;
    pointer-events: auto;
    touch-action: none;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    font-family: var(--font-sans);
    line-height: 1;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    opacity: 0;
    min-width: 40vw;
    min-height: 50vh;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
}

.lightbox-img.loaded {
    opacity: 1;
    border-color: transparent;
    min-width: 0;
    min-height: 0;
}

.lightbox-info {
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    margin-top: 1.5rem;
    text-align: center;
    line-height: 1.6;
}

/* ── Works Page ── */
.page-body {
    overflow-y: auto;
    overflow-x: hidden;
    height: 100vh;
}

.works-list {
    padding: calc(var(--nav-height) + 3rem) 4rem 6rem;
    max-width: 1400px;
    margin: 0 auto;
}

.work-item {
    display: flex;
    gap: 4rem;
    align-items: flex-start;
    margin-bottom: 6rem;
}

.work-item:nth-child(even) {
    flex-direction: row-reverse;
}

.work-image {
    flex: 0 0 55%;
    max-width: 55%;
}

.work-image img {
    display: block;
    width: 100%;
    height: auto;
    cursor: pointer;
    transition: opacity 0.3s;
}

.work-image img:hover {
    opacity: 0.88;
}

.work-details {
    flex: 1;
    padding-top: 1rem;
}

.work-details h2 {
    font-family: var(--font);
    font-size: 1.6rem;
    font-weight: 400;
    margin-bottom: 1.2rem;
    font-style: italic;
}

.work-details .meta {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    line-height: 2;
}

.work-details .description {
    font-family: var(--font);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-top: 1.5rem;
    color: var(--text);
    max-width: 40ch;
}

/* ── About Page ── */
.about-page {
    padding: calc(var(--nav-height) + 4rem) 4rem 6rem;
    max-width: 1000px;
    margin: 0 auto;
}

.about-section {
    display: flex;
    gap: 4rem;
    margin-bottom: 6rem;
    align-items: flex-start;
}

.about-section:nth-child(even) {
    flex-direction: row-reverse;
}

.about-photo {
    flex: 0 0 40%;
    max-width: 40%;
}

.about-photo img {
    width: 100%;
    height: auto;
    display: block;
}

.about-text {
    flex: 1;
}

.about-text h1 {
    font-family: var(--font);
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.about-text p {
    font-family: var(--font);
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 1rem;
}

.about-text .contact {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2rem;
    letter-spacing: 0.03em;
}

.about-text .contact a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--text-muted);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    :root {
        --nav-height: 3.2rem;
    }

    /* Header: compact, single row */
    .site-header {
        padding: 0.6rem 1rem 0;
    }

    .site-title {
        font-size: 0.85rem;
    }

    .ticker-wrap {
        max-width: 100%;
    }

    .ticker-text {
        font-size: 0.6rem;
    }

    .header-right a {
        font-size: 0.7rem;
        letter-spacing: 0.05em;
    }

    /* Gallery: tighter gaps, images scale via JS --mobile-scale */
    .marquee-images {
        gap: 0.8rem;
        padding: 0 0.4rem;
    }

    /* Lightbox: bigger touch targets */
    .lightbox-close {
        top: 1rem;
        right: 1rem;
        font-size: 2.5rem;
        padding: 0.5rem;
    }

    .lightbox-img {
        max-width: 95vw;
        max-height: 75vh;
    }

    .lightbox-info {
        font-size: 0.7rem;
        margin-top: 1rem;
        padding: 0 1rem;
    }

    /* Works page: stacked layout */
    .works-list {
        padding: calc(var(--nav-height) + 1.5rem) 1.2rem 4rem;
    }

    .work-item {
        margin-bottom: 3.5rem;
    }

    .work-item,
    .work-item:nth-child(even) {
        flex-direction: column;
        gap: 1.2rem;
    }

    .work-image {
        flex: none;
        max-width: 100%;
        width: 100%;
    }

    .work-details h2 {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
    }

    .work-details .meta {
        font-size: 0.75rem;
    }

    .work-details .description {
        font-size: 0.95rem;
        margin-top: 1rem;
        max-width: none;
    }

    /* About page: stacked layout */
    .about-page {
        padding: calc(var(--nav-height) + 2rem) 1.2rem 4rem;
    }

    .about-section,
    .about-section:nth-child(even) {
        flex-direction: column;
        gap: 1.5rem;
        margin-bottom: 4rem;
    }

    .about-photo {
        flex: none;
        max-width: 100%;
        width: 100%;
    }

    .about-text h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .about-text p {
        font-size: 0.95rem;
    }
}
