/*
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 */


/* Base layout */

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

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

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


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

.bddd-button {
    padding: 5px 16px;
    border-radius: 999px;
    background: #3d5c53;
    color: #ffffff;
    font-size: clamp(14px, 0.9vw, 16px);
    font-weight: 600;
}

.bddd-button:hover {
    background: #333333;
}

.bddd-button:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

/* Footer */

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

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

/* App */

.bddd-app {
    position: relative;
    min-height: 80vh;
    display: grid;
    grid-template-columns: 1fr;
    align-items: end;
    padding: 80px 6vw;
    overflow: hidden;
    background: #ffffff;
}

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

.bddd-login,
.bddd-project-view {
    position: relative;
    z-index: 1;
}

.bddd-login {
    max-width: 720px;
}

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

/* Login video */

.bddd-login-video {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    animation: bdddVideoFadeIn 2s ease-out 0.2s forwards;
    pointer-events: none;
}

.bddd-app.is-viewing .bddd-login-video {
    display: none;
}

@keyframes bdddVideoFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Access form */

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

.bddd-access-form__row {
    display: flex;
    gap: 12px;
}

.bddd-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;
}

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

.bddd-access-form input:focus {
    outline: none;
    border-color: #5d7f73;
}

.bddd-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;
}

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

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

.bddd-access-form button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(69, 104, 93, 0.18);
}

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

/* Project view */

.bddd-project-view {
    width: 100%;
}

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

/* Project page */

.bddd-project-page {
    width: 100%;
    padding: 48px 6vw 96px;
}

.bddd-project-page__heading {
    max-width: 960px;
    font-size: clamp(32px, 5vw, 72px);
    line-height: 1;
    letter-spacing: -0.05em;
    margin-bottom: 24px;
}

.bddd-project-page__heading--small {
    font-size: clamp(24px, 3vw, 42px);
}

.bddd-project-page__heading--muted {
    color: #666666;
}

.bddd-project-page__paragraph {
    max-width: 760px;
    font-size: clamp(18px, 2vw, 26px);
    color: #333333;
    margin-bottom: 32px;
}

.bddd-project-page__paragraph--lead {
    max-width: 960px;
    font-size: clamp(22px, 3vw, 36px);
    line-height: 1.25;
    letter-spacing: -0.03em;
}

.bddd-project-page__paragraph--small {
    max-width: 640px;
    font-size: 16px;
    color: #555555;
}

.bddd-project-page__paragraph--muted {
    color: #777777;
}

.bddd-project-page__heading--center,
.bddd-project-page__paragraph--center,
.bddd-project-page__quote--center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.bddd-project-page__heading--left,
.bddd-project-page__paragraph--left,
.bddd-project-page__quote--left {
    margin-left: 0;
    margin-right: auto;
    text-align: left;
}

.bddd-project-page__heading--right,
.bddd-project-page__paragraph--right,
.bddd-project-page__quote--right {
    margin-left: auto;
    margin-right: 0;
    text-align: right;
}



.bddd-project-page__heading--width-wide,
.bddd-project-page__paragraph--width-wide {
    max-width: 1120px;
}

.bddd-project-page__heading--width-narrow,
.bddd-project-page__paragraph--width-narrow {
    max-width: 620px;
}

.bddd-project-page__quote {
    max-width: 760px;
    margin: 48px 0;
    padding-left: 24px;
    border-left: 4px solid #3d5c53;
    font-size: clamp(22px, 3vw, 38px);
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: #222222;
}

.bddd-project-page__quote--muted {
    color: #666666;
    border-left-color: #dddddd;
}

.bddd-project-page__spacer {
    height: 32px;
}

.bddd-project-page__spacer--small {
    height: 16px;
}

.bddd-project-page__spacer--large {
    height: 72px;
}

.bddd-project-page__columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
    margin: 48px 0;
}

.bddd-project-page__columns--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bddd-project-page__columns--compact {
    gap: 16px;
}

.bddd-project-page__column {
    padding: 24px;
    border-radius: 18px;
    background: #f5f5f5;
}

.bddd-project-page__columns--plain .bddd-project-page__column {
    padding: 0;
    border-radius: 0;
    background: transparent;
}

.bddd-project-page__column h3 {
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.bddd-project-page__column p {
    color: #444444;
}

.bddd-project-page__image {
    display: block;
    width: 100%;
    margin: 32px 0;
    border-radius: 18px;
    overflow: hidden;
    background: #eeeeee;
}

.bddd-project-page__image img {
    display: block;
    width: 100%;
    height: auto;
}

.bddd-project-page__image--square img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.bddd-project-page__image--landscape img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.bddd-project-page__image--portrait img {
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.bddd-project-page__image--center {
    margin-left: auto;
    margin-right: auto;
}

.bddd-project-page__image--left {
    margin-left: 0;
    margin-right: auto;
}

.bddd-project-page__image--right {
    margin-left: auto;
    margin-right: 0;
}


.bddd-project-page__image--width-narrow {
    max-width: 760px;
}

.bddd-project-page__image--width-wide {
    max-width: 1280px;
}

.bddd-project-page__image--align-center {
    margin-left: auto;
    margin-right: auto;
}

/* Carousel */

.bddd-project-page__carousel {
    display: flex;
    gap: 18px;
    margin: 40px -6vw 56px;
    padding: 0 6vw 18px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}

.bddd-project-page__carousel-item {
    flex: 0 0 min(72vw, 820px);
    scroll-snap-align: center;
    border-radius: 18px;
    overflow: hidden;
    background: #eeeeee;
}

.bddd-project-page__carousel-item img {
    width: 100%;
    height: auto;
}

.bddd-project-page__carousel-item--square img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.bddd-project-page__carousel-item--wide img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.bddd-project-page__carousel--small .bddd-project-page__carousel-item {
    flex-basis: min(54vw, 520px);
}

.bddd-project-page__carousel-item--square img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.bddd-project-page__carousel-item--portrait img {
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.bddd-project-page__carousel-item--landscape img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}



/* Gallery */

.bddd-project-page__gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 40px 0 56px;
}

.bddd-project-page__gallery-item {
    border-radius: 14px;
    overflow: hidden;
    background: #eeeeee;
}

.bddd-project-page__gallery-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.bddd-project-page__gallery--large {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.bddd-project-page__gallery--large .bddd-project-page__gallery-item {
    border-radius: 18px;
}

.bddd-project-page__gallery-item--square img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.bddd-project-page__gallery-item--portrait img {
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.bddd-project-page__gallery-item--landscape img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.bddd-project-page__gallery--center {
    margin-left: auto;
    margin-right: auto;
}

.bddd-project-page__gallery--left {
    margin-left: 0;
    margin-right: auto;
}

.bddd-project-page__gallery--right {
    margin-left: auto;
    margin-right: 0;
}



/* Viewer */

.bddd-viewer-wrap {
    position: relative;
}

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

.bddd-viewer canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Viewer controls */

.bddd-view-pills {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    max-width: min(32rem, calc(100% - 2rem));
}

.bddd-view-pill {
    border-radius: 999px;
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.88);
    color: #111111;
    backdrop-filter: blur(8px);
    font: inherit;
}

.bddd-view-pill:hover,
.bddd-view-pill.is-active {
    background: #3d5c53;
    color: #ffffff;
}

.bddd-wireframe-toggle {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    z-index: 10;
    border-radius: 999px;
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.88);
    color: #111111;
    backdrop-filter: blur(8px);
    font: inherit;
}

.bddd-wireframe-toggle.is-active {
    background: #111111;
    color: #ffffff;
}

.bddd-wireframe-toggle:hover {
    background: #ffffff;
    color: #555555;
}

/* Lightbox */

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

.bddd-lightbox__close {
    position: fixed;
    top: max(20px, env(safe-area-inset-top));
    right: max(24px, env(safe-area-inset-right));
    z-index: 10001;
    padding: 5px 16px;
    border-radius: 999px;
    background: #111111;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

.bddd-lightbox__inner {
    position: absolute;
    inset: 0;
    overflow: hidden;
    touch-action: none;
}

.lightbox-image {
    position: absolute;
    left: 0;
    top: 0;
    display: block;
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
    transform-origin: 0 0;
    will-change: transform;
    cursor: grab;
}

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

body.has-lightbox {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Utilities */

[hidden] {
    display: none !important;
}

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

button:focus {
    outline: none;
}

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



.bddd-access-form input[hidden] {
    display: none;
}

.bddd-access-form input[readonly] {
    opacity: 0.7;
}


.bddd-access-form__notice {
    margin-top: 12px;
    color: #555555;
    font-size: 14px;
    line-height: 1.4;
}

#bddd-access-back {
    margin-top: 12px;
    padding: 0;
    background: none;
    border: none;
    color: #555;
    font-size: 14px;
    cursor: pointer;
}

/* Responsive */

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

    .bddd-app {
        padding: 48px 24px;
    }

    .bddd-app.is-viewing {
        padding: 0;
    }

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

    .bddd-viewer {
        height: calc(100vh - 73px);
    }


    .bddd-model-description {
        padding: 24px 24px 0;
    }

    .bddd-project-page {
        padding: 32px 24px 72px;
    }

    .bddd-project-page__columns,
    .bddd-project-page__columns--3 {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .bddd-project-page__carousel {
        margin-left: -24px;
        margin-right: -24px;
        padding-left: 24px;
        padding-right: 24px;
    }

    .bddd-project-page__carousel-item {
        flex-basis: 82vw;
    }

    .bddd-project-page__gallery,
    .bddd-project-page__gallery--large {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .bddd-login-video {
        max-height: 60vh;
    }
}

@media (max-width: 600px) {
    .bddd-login-video {
        max-width: 100%;
    }
}
