/*
Theme Name: bddd
Theme URI: https://bddd.ch
Author: Bénédict Donnier

*/

/* Reset */

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

* {
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    line-height: 1.5;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #ffffff;
    color: #111111;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
canvas,
svg,
model-viewer {
    display: block;
    max-width: 100%;
}

input,
button,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
    border: 0;
    background: none;
}

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

ul,
ol {
    list-style: none;
}

/* Layout */



.site-footer {
    border-top: 1px solid #eeeeee;
    padding: 24px 6vw;
}

.site-branding a {
    font-weight: 700;
    font-size: clamp(20px, 2.2vw, 42px);
    line-height: 1;
    letter-spacing: -0.04em;
}

.site-footer p {
    color: #555555;
    font-size: clamp(12px, 1.1vw, 18px);
    line-height: 1.3;
}


.site-main {
    min-height: 80vh;
}

/* Front page */

.hero-3d {
    min-height: 80vh;
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 48px;
    align-items: center;
    padding: 80px 6vw;
}

.hero-3d__content h1 {
    font-size: clamp(40px, 7vw, 96px);
    line-height: 0.95;
    letter-spacing: -0.06em;
    margin-bottom: 24px;
}

.hero-3d__content p {
    max-width: 520px;
    font-size: clamp(18px, 2vw, 24px);
    color: #555555;
}

.hero-3d__viewer {
    width: 100%;
}


.viewer-controls {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.viewer-controls button {
    padding: 10px 16px;
    border-radius: 999px;
    background: #111111;
    color: #ffffff;
}

.viewer-controls button:hover {
    background: #333333;
}

.hero-3d__viewer {
    width: 100%;
}

#archviz-viewer {
    width: 100%;
    height: 650px;
    background: #f5f5f5;
    border-radius: 24px;
    overflow: hidden;
}

#archviz-viewer canvas {
    display: block;
    width: 100%;
    height: 100%;
}

@media (max-width: 900px) {
    #archviz-viewer {
        height: 460px;
    }
}


.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 6vw;
}



.hero-3d {
    min-height: 80vh;
    display: grid;
    align-items: center;
    padding: 80px 6vw;
}

.hero-3d:not(.is-viewing) {
    grid-template-columns: 1fr;
}

.hero-3d.is-viewing {
    display: block;
    min-height: calc(100vh - 80px);
    padding: 0;
}

.hero-3d__intro {
    max-width: 720px;
}

.hero-3d__intro h1 {
    font-size: clamp(40px, 7vw, 96px);
    line-height: 0.95;
    letter-spacing: -0.06em;
    margin-bottom: 24px;
}



.access-form {
    max-width: 520px;
}

.access-form__label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.access-form__row {
    display: flex;
    gap: 12px;
}
.access-form input {
    flex: 1;
    min-width: 0;

    padding: 14px 18px;

    border: 1px solid #d8dfdb;
    border-radius: 999px;

    background: #ffffff;
    color: #111111;

    font-size: 15px;

    transition:
        border-color 0.2s ease,
        background-color 0.2s ease;
}

.access-form input::placeholder {
    color: #8d8d8d;
}

.access-form input:focus {
    outline: none;

    border-color: #5d7f73;
}


.access-form button {
    padding: 14px 22px;

    border-radius: 999px;

    background: #45685d;
    color: #ffffff;

    font-weight: 600;
    letter-spacing: 0.01em;

    transition:
        background-color 0.2s ease,
        opacity 0.2s ease;
}

.access-form button:hover {
    background: #55796d;
}

.access-form button:active {
    background: #3d5c53;
}

.access-form button:focus-visible {
    outline: none;

    box-shadow: 0 0 0 3px rgba(69, 104, 93, 0.18);
}




.access-form__message {
    margin-top: 12px;
    color: #555;
    font-size: 14px;
}

.hero-3d__viewer {
    width: 100%;
}

#archviz-viewer {
    width: 100%;
    height: calc(100vh - 81px);
    background: #f5f5f5;
    overflow: hidden;
}

#archviz-viewer canvas {
    display: block;
    width: 100%;
    height: 100%;
}

[hidden] {
    display: none !important;
}

@media (max-width: 900px) {
    .site-header {
        padding: 18px 24px;
    }

    .hero-3d {
        padding: 48px 24px;
    }

    .access-form__row {
        flex-direction: column;
    }

    #archviz-viewer {
        height: calc(100vh - 73px);
    }
}


.site-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-button,
.home-button,
.three-d-button,
.images-button {
    padding: 5px 16px;
    border-radius: 999px;
    background: #3d5c53;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

.info-button,
.home-button,
.three-d-button,
.images-button {
    font-size: clamp(14px, 0.9vw, 16px);
}



.home-button:hover, .info-button:hover, .three-d-button:hover, .images-button:hover {
    background: #333333;
}

.model-description {
    padding: 0 6vw;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333333;
}

.model-info-panel {
    padding: 24px 6vw;
    border-bottom: 1px solid #dddddd;
    font-size: 16px;
    color: #222222;
}

.model-info-panel p + p {
    margin-top: 12px;
}

.model-info-panel strong {
    font-weight: 700;
}

.hero-3d.is-viewing {
    display: block;
    min-height: calc(100vh - 80px);
    padding: 0;
}

#archviz-viewer {
    width: 100%;
    height: calc(100vh - 138px);
    background: #f5f5f5;
    overflow: hidden;
}

.model-info-panel:not([hidden]) ~ #archviz-viewer {
    height: calc(100vh - 260px);
}


button {
    -webkit-tap-highlight-color: transparent;
}

button:focus {
    outline: none;
}

button:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
}



#archviz-viewer[hidden],
.model-gallery[hidden] {
    display: none !important;
}

.model-gallery {
    width: 100%;
    padding: 32px 6vw 80px;

    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 400px;
    grid-auto-flow: dense;
    gap: 24px;
}

.model-gallery__item {
    display: block;
    width: 100%;
    height: 100%;

    border-radius: 18px;
    overflow: hidden;
    background: #eeeeee;
    cursor: pointer;
}

.model-gallery__item:first-child.is-portrait {
    grid-column: span 1;
    grid-row: span 2;
}

.model-gallery__item:first-child.is-landscape {
    grid-column: span 2;
    grid-row: span 1;
}

.model-gallery__item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}




.model-gallery[hidden],
#archviz-viewer[hidden],
.image-lightbox[hidden] {
    display: none !important;
}

@media (max-width: 1100px) {
    .model-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 400px;
        gap: 18px;
    }

    .model-gallery__item:first-child.is-landscape {
        grid-column: span 2;
        grid-row: span 1;
    }

    .model-gallery__item:first-child.is-portrait {
        grid-column: span 1;
        grid-row: span 2;
    }
}

@media (max-width: 700px) {
    .model-gallery {
        padding: 24px 24px 64px;
        display: block;
    }

    .model-gallery__item,
    .model-gallery__item:first-child.is-portrait,
    .model-gallery__item:first-child.is-landscape {
        width: 100%;
        height: auto;
        margin-bottom: 18px;
        border-radius: 14px;
    }

    .model-gallery__item img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }
}

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    overflow: hidden;
}

.image-lightbox__close {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 10001;
    padding: 5px 16px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.image-lightbox__inner {
    position: absolute;
    inset: 72px 24px 48px;
    overflow: auto;
    overscroll-behavior: contain;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.lightbox-image {
    display: block;
    max-width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
    transform-origin: 0 0;
    cursor: zoom-in;
}

.lightbox-image.is-zoomed {
    max-width: none;
    cursor: grab;
}

.lightbox-image.is-dragging {
    cursor: grabbing;
}

body.has-lightbox {
    overflow: hidden;
}