:root {
    color-scheme: dark;
    --bg: #050505;
    --text: #ededed;
    --muted: #777;
    --line: #a7a7a7;
    --header-height: 66px;
    --side: clamp(18px, 3vw, 44px);
}

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

html { background: var(--bg); scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 300 16px/1.28 "Montserrat", Arial, sans-serif;
    word-spacing: 2px;
    min-width: 280px;
    overflow-x: hidden;
}

body.menu-open, body:has(dialog[open]) { overflow: hidden; }

a { color: inherit; text-decoration: none; }
a:hover { color: #fff; }
img { display: block; max-width: 100%; }
button { font: inherit; }

:focus-visible { outline: 1px solid #fff; outline-offset: 4px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    z-index: 1000;
    left: 1rem;
    top: 1rem;
    transform: translateY(-200%);
    padding: .55rem .8rem;
    background: #fff;
    color: #000;
}

.skip-link:focus { transform: none; }

.site-shell {
    width: min(100%, 1600px);
    min-height: 100svh;
    margin: 0 auto;
    padding: 0 var(--side);
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.site-header {
    height: var(--header-height);
    position: sticky;
    z-index: 100;
    top: 0;
    display: flex;
    align-items: center;
    gap: clamp(24px, 4vw, 60px);
    margin-inline: calc(0px - var(--side));
    background: rgba(5, 5, 5, .96);
}

.site-header::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: min(100vw, 1600px);
    border-bottom: 1px solid var(--line);
    transform: translateX(-50%);
    pointer-events: none;
}

.brand {
    flex: 0 1 346px;
    width: min(346px, 35vw);
    height: 28px;
}

.brand img { width: 100%; height: 100%; object-fit: contain; object-position: left center; }

.main-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: clamp(12px, 1.6vw, 26px);
    color: #8a8a8a;
    font-size: 17px;
    white-space: nowrap;
    text-transform: lowercase;
}

.main-nav a { position: relative; padding: 1rem 0; }
.main-nav a[aria-current="page"], .main-nav a:hover { color: #fff; }

.language-menu { position: relative; }
.language-current {
    appearance: none;
    border: 0;
    padding: 1rem 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
    cursor: pointer;
}
.language-current:hover { color: #fff; }
.language-options {
    position: absolute;
    z-index: 5;
    top: calc(100% - 8px);
    right: -10px;
    min-width: 44px;
    padding: 5px 10px;
    border: 1px solid #555;
    background: #050505;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    font-size: inherit;
}
.language-options a { display: block; padding: 4px 0; text-align: center; }
.language-menu.is-open .language-options { visibility: visible; opacity: 1; transform: none; }

.menu-toggle { display: none; }

main { min-height: 0; padding-bottom: 46px; }

.site-footer {
    position: fixed;
    z-index: 90;
    left: 50%;
    bottom: 0;
    width: min(100%, 1600px);
    min-height: 46px;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid var(--line);
    color: #8a8a8a;
    font-size: 16px;
    background: rgba(5, 5, 5, .97);
    transform: translateX(-50%);
}

.site-footer a { overflow-wrap: anywhere; text-align: right; }
.footer-breadcrumbs { display: flex; min-width: 0; align-items: center; gap: 7px; white-space: nowrap; overflow: hidden; text-transform: lowercase; }
.footer-breadcrumbs > * { flex: 0 0 auto; }
.footer-breadcrumbs > [aria-current="page"] { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.footer-breadcrumbs a:hover { color: #fff; }
.breadcrumb-label-mobile { display: none; }

/* Home */
.intro-screen {
    position: fixed;
    z-index: 500;
    inset: 0;
    display: grid;
    place-items: center;
    background: #000;
    opacity: 1;
    visibility: visible;
    transition: opacity 2.4s ease, visibility 2.4s;
}
.intro-screen.is-leaving { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-dismiss { width: 100%; height: 100%; padding: 0; border: 0; display: grid; place-items: center; background: #000; cursor: pointer; }
.intro-dismiss img { width: min(100vw, calc(100vh * 970 / 660)); height: auto; max-width: 100vw; max-height: 100vh; object-fit: contain; }

@keyframes intro-mobile-zoom {
    from { transform: scale(1); }
    to { transform: scale(1.65); }
}

.home-stage {
    position: relative;
    height: calc(100svh - var(--header-height) - 46px);
    min-height: 430px;
    display: grid;
    place-items: center;
}

.home-slides {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(calc(100% - clamp(40px, 9vw, 130px)), calc((100svh - var(--header-height) - 130px) * 1.72));
    aspect-ratio: 970 / 564;
    overflow: hidden;
    transform: translate(-50%, -50%);
    cursor: pointer;
}

.home-slide {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.4s ease, visibility 1.4s;
}

.home-slide.is-active { opacity: 1; visibility: visible; }
.home-slide img { width: 100%; height: auto; max-width: none; transform: translateY(-7.27%); }

.carousel-arrow {
    appearance: none;
    position: absolute;
    z-index: 4;
    top: 50%;
    width: 42px;
    height: 64px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #ddd;
    cursor: pointer;
}

.carousel-arrow span {
    display: block;
    width: 19px;
    height: 36px;
    border-top: 1px solid currentColor;
    border-left: 1px solid currentColor;
}

.carousel-prev { left: 0; }
.carousel-next { right: 0; }
.carousel-prev span { transform: rotate(-45deg); }
.carousel-next span { transform: rotate(135deg); }

.carousel-dots {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.carousel-dots button {
    appearance: none;
    width: 11px;
    height: 11px;
    padding: 0;
    border: 0;
    background: #333;
    cursor: pointer;
}

.carousel-dots button[aria-current="true"] { background: #aaa; }

/* Shared page headings */
.section-heading { padding: 34px 6% 18px; }
.section-heading p { margin: 0 0 2px; color: #737373; text-transform: lowercase; }
.section-heading h1 { margin: 0; font-weight: 200; font-size: clamp(27px, 3vw, 38px); text-transform: uppercase; }

/* Category index */
.project-index {
    width: min(100%, 1140px);
    margin: 0 auto;
    padding: 4px 0 70px;
}

.project-card {
    display: grid;
    grid-template-columns: minmax(210px, 27%) 1fr;
    gap: clamp(20px, 3vw, 44px);
    padding: 16px 0;
    border-top: 1px solid #222;
}

.project-card:first-child { border-top-color: #555; }
.project-card-image { display: block; overflow: hidden; aspect-ratio: 234 / 155; background: #000; }
.project-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease, opacity .3s; }
.project-card-image:hover img { transform: scale(1.025); opacity: .88; }
.project-card-copy { min-width: 0; padding-top: 2px; max-width: 780px; }
.project-card h2 { margin: 0 0 3px; font-weight: 200; font-size: clamp(17px, 1.5vw, 21px); text-transform: uppercase; }
.project-card h2 a { overflow-wrap: anywhere; }
.project-card p { margin: 6px 0 0; color: #bcbcbc; font-size: 15px; }
.project-card .project-location { color: #777; text-transform: uppercase; }

/* Project detail */
.project-breadcrumb {
    min-height: 40px;
    display: flex;
    gap: .45rem;
    align-items: center;
    color: #666;
    font-size: 14px;
    text-transform: lowercase;
}

.project-breadcrumb a:hover { color: #fff; }

.project-detail {
    display: grid;
    grid-template-columns: minmax(300px, 40%) minmax(380px, 560px);
    gap: clamp(20px, 2.5vw, 40px);
    width: min(100%, 1160px);
    margin: 44px auto 48px;
    justify-content: start;
    align-items: start;
}

.project-lead-image, .gallery-thumb {
    appearance: none;
    border: 0;
    padding: 0;
    background: #000;
    cursor: zoom-in;
}

.project-lead-image { display: flex; width: 100%; max-height: 620px; align-items: flex-start; justify-content: flex-start; }
.project-lead-image img { width: auto; max-width: 100%; height: auto; max-height: 620px; object-fit: contain; object-position: left top; }
.project-copy { width: 100%; min-width: 0; max-width: 560px; }
.project-copy h1 { margin: 0 0 20px; font-weight: 200; font-size: clamp(21px, 2.2vw, 34px); text-transform: uppercase; }
.project-fact { display: grid; grid-template-columns: 90px 1fr; gap: 16px; margin: 4px 0; color: #bbb; }
.project-fact strong { color: #686868; font-weight: 300; text-transform: lowercase; }
.project-fact span { min-width: 0; overflow-wrap: anywhere; }
.project-description { width: min(100%, 560px); margin-top: 24px; color: #d6d6d6; text-align: justify; overflow-wrap: anywhere; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: clamp(190px, 24vw, 360px);
    grid-auto-flow: dense;
    width: min(100%, 1160px);
    margin: 0 auto;
    gap: 8px;
    padding-bottom: 68px;
}

.gallery-thumb { grid-column: span 6; overflow: hidden; }
.gallery-thumb:nth-child(5n + 1) { grid-column: span 8; }
.gallery-thumb:nth-child(5n + 2) { grid-column: span 4; }
.gallery-thumb:nth-child(5n + 3) { grid-column: span 4; }
.gallery-thumb:nth-child(5n + 4) { grid-column: span 8; }
.gallery-thumb:nth-child(5n) { grid-column: span 12; }
.gallery-thumb:last-child:nth-child(5n + 1),
.gallery-thumb:last-child:nth-child(5n + 3) { grid-column: span 12; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .55s ease; }
.gallery-thumb:hover img { transform: scale(1.06); }

.lightbox {
    width: 100vw;
    max-width: none;
    height: 100vh;
    max-height: none;
    margin: 0;
    padding: 4px 4px;
    border: 0;
    background: rgba(0, 0, 0, .97);
    color: #fff;
    touch-action: pan-y pinch-zoom;
    user-select: none;
}

.lightbox::backdrop { background: #000; }
.lightbox[open] { display: grid; grid-template-columns: 45px 1fr 45px; place-items: center; }
.lightbox figure { grid-column: 2; margin: 0; width: 100%; height: 100%; display: grid; grid-template-rows: 1fr auto; place-items: center; min-height: 0; }
.lightbox-stage { width: 100%; height: 100%; min-width: 0; min-height: 0; display: grid; place-items: center; }
.lightbox-stage img { grid-area: 1 / 1; max-width: 100%; max-height: calc(100vh - 100px); width: auto; height: auto; opacity: 0; transition: opacity 1.2s ease; }
.lightbox-stage img.is-active { opacity: 1; }
.lightbox figcaption { padding-top: 10px; color: #777; }
.lightbox .carousel-arrow { position: relative; top: auto; width: 45px; height: 80px; transform: none; display: grid; place-items: center; opacity: .72; transition: opacity .2s ease; }
.lightbox .carousel-arrow:hover { opacity: 1; }
.lightbox .carousel-arrow img { width: auto; height: 54px; max-width: 100%; object-fit: contain; pointer-events: none; }
.lightbox .carousel-prev { grid-column: 1; grid-row: 1; }
.lightbox .carousel-next { grid-column: 3; grid-row: 1; }
.lightbox-close { position: fixed; top: 18px; right: 24px; width: 42px; height: 42px; border: 0; background: transparent; color: #aaa; font-size: 38px; line-height: 1; cursor: pointer; }

/* Team */
.team-list { padding: 28px 0 80px; }
.team-member {
    display: grid;
    grid-template-columns: auto minmax(360px, 1fr);
    column-gap: clamp(20px, 3vw, 42px);
    row-gap: 0;
    align-items: start;
    padding: 0 0 34px;
}
.team-member > img { width: 230px; max-width: none; height: 230px; object-fit: contain; filter: grayscale(1); }
.team-member h1 { margin: 0 0 4px; font-size: 18px; font-weight: 300; text-transform: uppercase; }
.team-about { color: #ccc; max-width: 780px; }
.team-member address { grid-column: 2; display: flex; flex-direction: column; align-items: flex-end; padding-top: 14px; font-style: normal; text-align: right; }

/* All projects */
.all-projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(28px, 7vw, 110px); width: min(100%, 1200px); margin: 0 auto; padding: 28px 3% 76px; }
.project-group h2 { margin: 0 0 9px; font-size: 18px; font-weight: 200; text-transform: uppercase; }
.project-group ul { list-style: none; margin: 0; padding: 0; }
.project-group li { display: grid; grid-template-columns: 5px minmax(0, 1fr); column-gap: 7px; align-items: start; margin: 2px 0; color: #ccc; }
.project-group li::before { content: ""; width: 5px; height: 5px; margin-top: .58em; border-radius: 50%; background: #888; }
.project-group li a { min-width: 0; overflow-wrap: anywhere; }
.project-group a:hover { text-decoration: underline; text-underline-offset: 3px; }

.error-message { min-height: 60vh; display: grid; place-content: center; text-align: center; }
.error-message p { margin: 0; color: #555; font-size: 70px; }
.error-message h1 { margin: 0 0 18px; font-weight: 300; }
.error-message a { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 1050px) {
    .site-header { gap: 20px; }
    .brand { flex-basis: 300px; width: min(300px, 31vw); }
    .main-nav { font-size: 16px; gap: 12px; }
    .project-detail { gap: clamp(20px, 2.5vw, 40px); }
}

@media (max-width: 950px) {
    :root { --header-height: 44px; }
    .site-header { display: grid; grid-template-columns: 44px 1fr 44px; gap: 0; }
    .brand { grid-column: 2; grid-row: 1; justify-self: center; width: min(208px, 54vw); height: auto; margin: 0; }
    .brand img { height: auto; object-position: center; }
    .menu-toggle {
        grid-column: 3;
        grid-row: 1;
        display: grid;
        justify-self: end;
        align-content: center;
        gap: 4px;
        width: 37px;
        height: 36px;
        padding: 7px 0 7px 7px;
        border: 0;
        background: transparent;
        color: #fff;
        cursor: pointer;
    }
    .menu-toggle i { display: block; height: 2px; background: currentColor; transition: transform .25s, opacity .25s; }
    .menu-open .menu-toggle i:first-of-type { transform: translateY(6px) rotate(45deg); }
    .menu-open .menu-toggle i:nth-of-type(2) { opacity: 0; }
    .menu-open .menu-toggle i:last-of-type { transform: translateY(-6px) rotate(-45deg); }
    .main-nav {
        position: fixed;
        z-index: 2;
        inset: var(--header-height) 0 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 0;
        padding: 20px 18px 40px;
        background: rgba(5, 5, 5, .98);
        font-size: 25px;
        text-align: center;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-10px);
        transition: opacity .2s, transform .2s, visibility .2s;
    }
    .menu-open .main-nav { visibility: visible; opacity: 1; transform: none; }
    .main-nav a { padding: 6px 0; }
    .language-menu { margin-top: 4px; }
    .language-current { padding: 6px 0; }
    .language-options { position: static; display: none; min-width: 0; margin-top: 2px; padding: 0; border: 0; font-size: inherit; transform: none; }
    .language-menu.is-open .language-options { display: block; }
}

@media (max-width: 760px) {
    :root { --header-height: 44px; --side: 18px; }
    body { font-size: 15px; }
    .site-shell { width: 100%; }
    .site-header { display: grid; grid-template-columns: 44px 1fr 44px; gap: 0; }
    .brand { grid-column: 2; grid-row: 1; justify-self: center; width: min(208px, 54vw); height: auto; margin: 0; }
    .brand img { height: auto; object-position: center; }
    .menu-toggle {
        grid-column: 3;
        grid-row: 1;
        display: grid;
        justify-self: end;
        align-content: center;
        gap: 4px;
        width: 37px;
        height: 36px;
        padding: 7px 0 7px 7px;
        border: 0;
        background: transparent;
        color: #fff;
        cursor: pointer;
    }
    .menu-toggle i { display: block; height: 2px; background: currentColor; transition: transform .25s, opacity .25s; }
    .menu-open .menu-toggle i:first-of-type { transform: translateY(6px) rotate(45deg); }
    .menu-open .menu-toggle i:nth-of-type(2) { opacity: 0; }
    .menu-open .menu-toggle i:last-of-type { transform: translateY(-6px) rotate(-45deg); }
    .main-nav {
        position: fixed;
        z-index: 2;
        inset: var(--header-height) 0 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 0;
        padding: 20px 18px 40px;
        background: rgba(5, 5, 5, .98);
        font-size: 25px;
        text-align: center;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-10px);
        transition: opacity .2s, transform .2s, visibility .2s;
    }
    .menu-open .main-nav { visibility: visible; opacity: 1; transform: none; }
    .main-nav a { padding: 6px 0; }
    .language-menu { margin-top: 4px; }
    .language-current { padding: 6px 0; }
    .language-options { position: static; display: none; min-width: 0; margin-top: 2px; padding: 0; border: 0; font-size: inherit; transform: none; }
    .language-menu.is-open .language-options { display: block; }
    .site-footer { min-height: 32px; padding-block: 3px; flex-wrap: nowrap; justify-content: space-between; align-content: center; gap: 8px; font-size: 12px; }
    .site-footer > a { display: block; flex: 0 0 auto; min-width: 0; max-width: 100%; margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(10px, 3vw, 12px); text-align: right; }
    .footer-breadcrumbs { flex: 0 1 auto; width: auto; }
    .site-footer.is-stacked { min-height: 54px; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; justify-content: stretch; gap: 2px; }
    .site-footer.is-stacked .footer-breadcrumbs { width: 100%; }
    .site-footer.is-stacked > a { justify-self: start; margin-left: 0; text-align: left; }
    .breadcrumb-label-full:has(+ .breadcrumb-label-mobile) { display: none; }
    .breadcrumb-label-mobile { display: inline; }
    main { padding-bottom: 32px; }
    body:has(.site-footer.is-stacked) main { padding-bottom: 54px; }

    .home-stage { height: calc(100svh - var(--header-height) - 32px); min-height: 420px; }
    body:has(.site-footer.is-stacked) .home-stage { height: calc(100svh - var(--header-height) - 54px); }
    .home-slides { width: 100%; }
    .section-heading { padding: 22px 0 13px; }
    .section-heading h1 { font-size: 28px; }
    .project-index { padding-bottom: 40px; }
    .project-card { grid-template-columns: minmax(118px, 44%) 1fr; gap: 12px; padding: 10px 0; align-items: start; }
    .project-card-copy { padding: 0; }
    .project-card h2 { font-size: 15px; line-height: 1.12; }
    .project-card p { margin-top: 3px; font-size: 13px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
    .project-card .project-location { font-size: 12px; }

    .project-breadcrumb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .project-detail { display: block; margin: 20px auto 30px; }
    .project-lead-image { margin-bottom: 18px; }
    .project-copy h1 { font-size: 22px; }
    .project-fact { grid-template-columns: 76px 1fr; gap: 8px; }
    .project-description { text-align: left; }
    .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 46vw; gap: 4px; padding-bottom: 45px; }
    .gallery-grid .gallery-thumb.gallery-thumb { grid-column: span 1; }
    .gallery-grid .gallery-thumb:nth-child(3n + 1) { grid-column: span 2; }
    .gallery-grid .gallery-thumb:last-child:nth-child(3n + 2) { grid-column: span 2; }
    .lightbox { height: 100dvh; max-height: 100dvh; padding: 4px; }
    .lightbox[open] { grid-template-columns: 1fr; }
    .lightbox figure { position: relative; grid-column: 1; grid-row: 1; grid-template-rows: 1fr; }
    .lightbox-stage img { max-height: calc(100vh - 8px); max-height: calc(100dvh - 8px); }
    .lightbox figcaption { position: absolute; z-index: 5; left: 50%; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); padding: 4px 7px; background: rgba(0, 0, 0, .78); color: #aaa; font-size: 13px; line-height: 1.2; white-space: nowrap; transform: translateX(-50%); }
    .lightbox .carousel-arrow { display: none; }
    .lightbox-close { z-index: 3; top: 4px; right: 4px; }

    .team-list { padding-top: 32px; }
    .team-member { display: block; }
    .team-member::after { content: ""; display: block; clear: both; }
    .team-member > img { float: left; width: 50%; max-width: 50%; height: auto; margin: 0 12px 8px 0; }
    .team-member h1 { font-size: 15px; }
    .team-about { font-size: 14px; line-height: 1.2; }
    .team-member address { clear: both; padding-top: 14px; align-items: flex-end; font-size: 14px; }

    .all-projects { display: block; padding: 28px max(8%, 20px) 56px; }
    .project-group { margin-bottom: 28px; }
    .project-group h2 { font-size: 18px; }
    .project-group li { font-size: 17px; line-height: 1.18; margin: 4px 0; }
}

@media (max-width: 760px) and (orientation: portrait) {
    .intro-dismiss { overflow: hidden; }
    .intro-dismiss img {
        transform-origin: center;
        animation: intro-mobile-zoom 5s ease-in-out forwards;
        will-change: transform;
    }
}

@media (max-width: 390px) {
    :root { --side: 12px; }
    .site-header { grid-template-columns: 44px 1fr 44px; }
    .brand { width: min(185px, 54vw); }
    .project-card { grid-template-columns: 112px 1fr; }
    .project-card p { -webkit-line-clamp: 3; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
