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

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f7f7f4;
    color: #111;
    line-height: 1.5;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(247, 247, 244, 0.92);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px;
    border-bottom: 1px solid #ddd;
}

.logo {
    font-size: 18px;
    letter-spacing: 0.04em;
}

.nav-links {
    display: flex;
    gap: 24px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.nav-links a:hover {
    opacity: 0.5;
}

/* Hero */
.hero {
    min-height: 70vh;
    padding: 120px 40px 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 1100px;
}

.eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #777;
    margin-bottom: 18px;
}

h1 {
    font-size: clamp(48px, 8vw, 110px);
    line-height: 0.95;
    font-weight: 400;
    letter-spacing: -0.06em;
    max-width: 950px;
}

.hero-text {
    margin-top: 32px;
    font-size: 20px;
    max-width: 620px;
    color: #444;
}

.hero-image {
    padding: 0 40px 80px;
}

.hero-image img {
    width: 100%;
    height: 78vh;
    object-fit: cover;
}

/* General sections */
.section {
    padding: 100px 40px;
}

.section-heading {
    max-width: 850px;
    margin-bottom: 48px;
}

h2 {
    font-size: clamp(30px, 4vw, 56px);
    line-height: 1.05;
    font-weight: 400;
    letter-spacing: -0.04em;
}

h3 {
    font-size: 36px;
    font-weight: 400;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

/* Selected Works */
.gallery-grid {
    display: grid;
}

/* 
   Selected Works layout:
   - designed but not too rigid
   - keeps image proportions
   - avoids tiny thumbnails
   - avoids full-screen masonry
*/
.selected-grid {
    max-width: 1180px;
    margin: 64px auto 0;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: 32px;
    row-gap: 64px;
    align-items: center;
}

.selected-grid img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.selected-grid img:hover {
    opacity: 0.82;
    transform: translateY(-4px);
}

/* Row 1 */
.selected-grid img:nth-child(1) {
    grid-column: 1 / span 4;
}

.selected-grid img:nth-child(2) {
    grid-column: 5 / span 4;
    margin-top: 56px;
}

.selected-grid img:nth-child(3) {
    grid-column: 9 / span 4;
}

/* Row 2 */
.selected-grid img:nth-child(4) {
    grid-column: 2 / span 5;
}

.selected-grid img:nth-child(5) {
    grid-column: 7 / span 3;
    margin-top: 72px;
}

.selected-grid img:nth-child(6) {
    grid-column: 10 / span 3;
    margin-top: 24px;
}

/* Projects */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 72px;
}

.project-block {
    display: grid;
    grid-template-columns: 0.8fr 1.6fr;
    gap: 48px;
    border-top: 1px solid #ccc;
    padding-top: 36px;
}

.project-number {
    font-size: 12px;
    color: #777;
    margin-bottom: 24px;
}

.project-text p {
    color: #555;
    max-width: 420px;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.mini-grid img {
    width: 100%;
    height: 320px;
    object-fit: cover;
}

/* About */
.about-section {
    max-width: 1000px;
}

.about-section p:last-child {
    margin-top: 28px;
    max-width: 650px;
    font-size: 18px;
    color: #444;
}

/* Contact */
.contact-section {
    border-top: 1px solid #ccc;
}

.contact-section a {
    border-bottom: 1px solid #111;
}

/* Footer */
footer {
    padding: 40px;
    color: #777;
    font-size: 13px;
}

/* Mobile version */
@media (max-width: 800px) {
    .site-header {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .nav-links {
        gap: 16px;
        flex-wrap: wrap;
    }

    .hero,
    .section,
    .hero-image {
        padding-left: 20px;
        padding-right: 20px;
    }

    .hero {
        padding-top: 90px;
    }

    h1 {
        font-size: clamp(44px, 14vw, 72px);
    }

    h2 {
        font-size: clamp(30px, 9vw, 48px);
    }

    .hero-image img {
        height: 60vh;
    }

    .project-block,
    .mini-grid {
        grid-template-columns: 1fr;
    }

    .selected-grid {
        display: flex;
        flex-direction: column;
        gap: 28px;
        max-width: 100%;
        margin-top: 36px;
    }

    .selected-grid img,
    .selected-grid img:nth-child(1),
    .selected-grid img:nth-child(2),
    .selected-grid img:nth-child(3),
    .selected-grid img:nth-child(4),
    .selected-grid img:nth-child(5),
    .selected-grid img:nth-child(6) {
        width: 100%;
        margin-top: 0;
        height: auto;
    }

    .mini-grid img {
        height: auto;
    }
}

/* FINAL OVERRIDE: Selected Works layout */
#works .selected-grid {
    max-width: 1180px !important;
    margin: 72px auto 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 56px 64px !important;
}

#works .selected-grid img {
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 !important;
}

/* Row 1 */
#works .selected-grid img:nth-child(1) {
    width: clamp(260px, 25vw, 360px) !important;
}

#works .selected-grid img:nth-child(2) {
    width: clamp(280px, 28vw, 420px) !important;
    margin-top: 64px !important;
}

#works .selected-grid img:nth-child(3) {
    width: clamp(260px, 25vw, 360px) !important;
    margin-top: 20px !important;
}

/* Row 2 */
#works .selected-grid img:nth-child(4) {
    width: clamp(360px, 38vw, 540px) !important;
    margin-left: 80px !important;
}

#works .selected-grid img:nth-child(5) {
    width: clamp(220px, 20vw, 300px) !important;
    margin-top: 80px !important;
}

#works .selected-grid img:nth-child(6) {
    width: clamp(260px, 25vw, 360px) !important;
    margin-top: 32px !important;
}

/* Mobile override */
@media (max-width: 800px) {
    #works .selected-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 28px !important;
        margin-top: 36px !important;
        max-width: 100% !important;
    }

    #works .selected-grid img,
    #works .selected-grid img:nth-child(1),
    #works .selected-grid img:nth-child(2),
    #works .selected-grid img:nth-child(3),
    #works .selected-grid img:nth-child(4),
    #works .selected-grid img:nth-child(5),
    #works .selected-grid img:nth-child(6) {
        width: 100% !important;
        margin: 0 !important;
        height: auto !important;
    }
}

/* Clickable project blocks */
.project-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.project-link .project-block {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.project-link:hover .project-block {
    opacity: 0.78;
    transform: translateY(-4px);
}

/* Project detail pages */
.project-page {
    padding: 120px 40px 80px;
}

.project-page-header {
    max-width: 920px;
    margin-bottom: 80px;
}

.back-link {
    display: inline-block;
    margin-bottom: 48px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #666;
}

.back-link:hover {
    color: #111;
}

.project-page-title {
    font-size: clamp(56px, 8vw, 120px);
    line-height: 0.9;
    font-weight: 400;
    letter-spacing: -0.06em;
    margin-bottom: 32px;
}

.project-page-description {
    max-width: 620px;
    font-size: 19px;
    color: #444;
}

/* Full project gallery */
.full-gallery {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 36px;
    align-items: start;
}

.full-gallery img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Editorial rhythm for project pages */
.full-gallery img:nth-child(1) {
    grid-column: span 5;
}

.full-gallery img:nth-child(2) {
    grid-column: span 3;
    margin-top: 80px;
}

.full-gallery img:nth-child(3) {
    grid-column: span 4;
}

.full-gallery img:nth-child(4) {
    grid-column: span 4;
}

.full-gallery img:nth-child(5) {
    grid-column: span 5;
    margin-top: 64px;
}

.full-gallery img:nth-child(6) {
    grid-column: span 3;
}

.full-gallery img:nth-child(7) {
    grid-column: span 6;
}

.full-gallery img:nth-child(8) {
    grid-column: span 3;
    margin-top: 72px;
}

.full-gallery img:nth-child(9) {
    grid-column: span 3;
}

.full-gallery img:nth-child(10) {
    grid-column: span 4;
}

.full-gallery img:nth-child(11) {
    grid-column: span 4;
    margin-top: 60px;
}

.full-gallery img:nth-child(12) {
    grid-column: span 4;
}

/* Mobile project pages */
@media (max-width: 800px) {
    .project-page {
        padding: 90px 20px 60px;
    }

    .project-page-header {
        margin-bottom: 56px;
    }

    .full-gallery {
        display: flex;
        flex-direction: column;
        gap: 28px;
        max-width: 100%;
    }

    .full-gallery img,
    .full-gallery img:nth-child(1),
    .full-gallery img:nth-child(2),
    .full-gallery img:nth-child(3),
    .full-gallery img:nth-child(4),
    .full-gallery img:nth-child(5),
    .full-gallery img:nth-child(6),
    .full-gallery img:nth-child(7),
    .full-gallery img:nth-child(8),
    .full-gallery img:nth-child(9),
    .full-gallery img:nth-child(10),
    .full-gallery img:nth-child(11),
    .full-gallery img:nth-child(12) {
        width: 100%;
        grid-column: auto;
        margin-top: 0;
    }
}

/* Extra images after 12: keep editorial rhythm */
.full-gallery img:nth-child(13) {
    grid-column: span 5;
    margin-top: 40px;
}

.full-gallery img:nth-child(14) {
    grid-column: span 3;
    margin-top: 100px;
}

.full-gallery img:nth-child(15) {
    grid-column: span 4;
    margin-top: 0;
}

.full-gallery img:nth-child(16) {
    grid-column: span 4;
    margin-top: 80px;
}

.full-gallery img:nth-child(17) {
    grid-column: span 5;
    margin-top: 20px;
}

.full-gallery img:nth-child(18) {
    grid-column: span 3;
    margin-top: 120px;
}

/* If you add even more images later, repeat a designed pattern */
.full-gallery img:nth-child(n+19) {
    grid-column: span 4;
    margin-top: 40px;
}

.full-gallery img:nth-child(3n + 19) {
    grid-column: span 5;
    margin-top: 0;
}

.full-gallery img:nth-child(3n + 20) {
    grid-column: span 3;
    margin-top: 90px;
}

.full-gallery img:nth-child(3n + 21) {
    grid-column: span 4;
    margin-top: 30px;
}

/* FINAL MOBILE CLEANUP */
@media (max-width: 800px) {
    body {
        overflow-x: hidden;
    }

    .site-header {
        position: sticky;
        top: 0;
        padding: 18px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .logo {
        font-size: 16px;
    }

    .nav-links {
        display: flex;
        flex-wrap: wrap;
        gap: 12px 18px;
        font-size: 11px;
        letter-spacing: 0.1em;
    }

    .hero {
        min-height: auto;
        padding: 88px 20px 56px;
    }

    h1 {
        font-size: clamp(42px, 14vw, 68px);
        line-height: 0.95;
        letter-spacing: -0.06em;
    }

    h2 {
        font-size: clamp(30px, 9vw, 46px);
        line-height: 1.05;
    }

    h3 {
        font-size: 32px;
    }

    .hero-text {
        font-size: 17px;
        margin-top: 24px;
    }

    .hero-image {
        padding: 0 20px 56px;
    }

    .hero-image img {
        height: auto;
        max-height: none;
        object-fit: contain;
    }

    .section {
        padding: 72px 20px;
    }

    .section-heading {
        margin-bottom: 36px;
    }

    /* Selected works mobile */
    #works .selected-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 28px !important;
        max-width: 100% !important;
        margin-top: 40px !important;
    }

    #works .selected-grid img,
    #works .selected-grid img:nth-child(1),
    #works .selected-grid img:nth-child(2),
    #works .selected-grid img:nth-child(3),
    #works .selected-grid img:nth-child(4),
    #works .selected-grid img:nth-child(5),
    #works .selected-grid img:nth-child(6) {
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        object-fit: contain !important;
    }

    /* Project blocks on homepage */
    .project-block {
        display: grid;
        grid-template-columns: 1fr;
        gap: 28px;
        padding-top: 28px;
    }

    .mini-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .mini-grid img {
        height: auto;
        object-fit: contain;
    }

    /* Project detail pages */
    .project-page {
        padding: 88px 20px 60px;
    }

    .project-page-header {
        margin-bottom: 52px;
    }

    .back-link {
        margin-bottom: 36px;
        font-size: 11px;
    }

    .project-page-title {
        font-size: clamp(48px, 16vw, 76px);
        line-height: 0.92;
    }

    .project-page-description {
        font-size: 17px;
    }

    .full-gallery {
        display: flex !important;
        flex-direction: column !important;
        gap: 28px !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .full-gallery img,
    .full-gallery img:nth-child(1),
    .full-gallery img:nth-child(2),
    .full-gallery img:nth-child(3),
    .full-gallery img:nth-child(4),
    .full-gallery img:nth-child(5),
    .full-gallery img:nth-child(6),
    .full-gallery img:nth-child(7),
    .full-gallery img:nth-child(8),
    .full-gallery img:nth-child(9),
    .full-gallery img:nth-child(10),
    .full-gallery img:nth-child(11),
    .full-gallery img:nth-child(12),
    .full-gallery img:nth-child(13),
    .full-gallery img:nth-child(14),
    .full-gallery img:nth-child(15),
    .full-gallery img:nth-child(16),
    .full-gallery img:nth-child(17),
    .full-gallery img:nth-child(18),
    .full-gallery img:nth-child(n+19) {
        width: 100% !important;
        height: auto !important;
        grid-column: auto !important;
        margin: 0 !important;
        object-fit: contain !important;
    }

    footer {
        padding: 32px 20px;
    }
}

.project-navigation {
    max-width: 1280px;
    margin: 100px auto 0;
    padding-top: 32px;
    border-top: 1px solid #ccc;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.project-navigation a {
    color: #666;
    transition: color 0.3s ease;
}

.project-navigation a:hover {
    color: #111;
}

@media (max-width: 800px) {
    .project-navigation {
        flex-direction: column;
        margin-top: 64px;
    }
}