/* ================================== */
/* BERTRAND BASSET - Portfolio V8     */
/* Mobile-first responsive            */
/* ================================== */

:root {
    --black: #0a0a0a;
    --white: #fafafa;
    --gray: #666;
    --light-gray: #e0e0e0;
    --red: #c41e1e;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    background: var(--white);
    color: var(--black);
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================== */
/* LANDING PAGE                       */
/* ================================== */
.landing {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100vh;
    width: 100vw;
}

.landing-image {
    position: relative;
    overflow: hidden;
    background: var(--black);
    order: 1;
}

.landing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.02);
    animation: imageReveal 1.6s ease-out 0.2s forwards;
}

@keyframes imageReveal {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.landing-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 4rem;
    position: relative;
    order: 2;
}

.brand-block {
    display: flex;
    align-items: stretch;
    gap: 1.2rem;
}

.logo-b {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.logo-b img {
    width: 100%;
    height: 100%;
}

.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.1rem;
}

.brand-name {
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.65rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gray);
    line-height: 1.2;
}

.enter-btn {
    height: 52px;
    padding: 0 1.8rem;
    border: 1px solid var(--black);
    background: transparent;
    color: var(--black);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.enter-btn:hover {
    background: var(--black);
    color: var(--white);
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 2rem;
    width: 100%;
    max-width: 500px;
    opacity: 0;
    animation: fadeUp 0.8s ease-out 0.5s forwards;
}

.lang-toggle {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    gap: 0.5rem;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    font-weight: 400;
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.9s forwards;
}

.lang-toggle a {
    color: var(--gray);
    text-decoration: none;
    transition: color 0.3s ease;
}

.lang-toggle a:hover,
.lang-toggle a.active {
    color: var(--black);
}

.lang-toggle span {
    color: var(--light-gray);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ================================== */
/* MAIN SITE                          */
/* ================================== */
.site {
    display: none;
    height: 100vh;
    overflow: hidden;
}

.site.active {
    display: grid;
    grid-template-columns: 220px 1fr;
}

.landing.hidden {
    display: none;
}

/* ================================== */
/* SIDEBAR                            */
/* ================================== */
.sidebar {
    background: var(--white);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--light-gray);
}

.sidebar-header {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--black);
}

.sidebar-logo {
    width: 24px;
    height: 24px;
}

.sidebar-brand-name {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sidebar-lang {
    display: flex;
    gap: 0.4rem;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    font-weight: 400;
}

.sidebar-lang a {
    color: var(--gray);
    text-decoration: none;
    transition: color 0.2s ease;
}

.sidebar-lang a:hover,
.sidebar-lang a.active {
    color: var(--black);
}

.sidebar-lang span {
    color: var(--light-gray);
}

/* Menu toggle - hidden on desktop */
.menu-toggle {
    display: none;
}

/* ================================== */
/* NAVIGATION                         */
/* ================================== */
.main-nav {
    flex: 1;
}

.nav-item {
    margin-bottom: 0.1rem;
}

.nav-link {
    display: block;
    padding: 0.35rem 0;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--black);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--red);
}

/* DROPDOWN */
.nav-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 0.8rem;
}

.nav-item.open > .nav-dropdown {
    max-height: 500px;
}

.dropdown-link {
    display: block;
    padding: 0.25rem 0;
    font-size: 0.72rem;
    font-weight: 300;
    color: var(--gray);
    text-decoration: none;
    transition: color 0.2s ease;
}

.dropdown-link:hover,
.dropdown-link.active {
    color: var(--red);
}

/* Sub-dropdown */
.nav-sub-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 0.8rem;
}

.dropdown-link.has-submenu.open + .nav-sub-dropdown {
    max-height: 200px;
}

.dropdown-sublink {
    display: block;
    padding: 0.2rem 0;
    font-size: 0.65rem;
    font-weight: 300;
    color: var(--gray);
    text-decoration: none;
    transition: color 0.2s ease;
}

.dropdown-sublink:hover,
.dropdown-sublink.active {
    color: var(--red);
}

/* ================================== */
/* SIDEBAR FOOTER                     */
/* ================================== */
.sidebar-footer {
    padding-top: 1.5rem;
    margin-top: auto;
    border-top: 1px solid var(--light-gray);
}

/* Project info */
.project-info {
    display: none;
    margin-bottom: 1rem;
}

.project-info.visible {
    display: block;
}

.project-title {
    display: block;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--black);
    margin-bottom: 0.25rem;
}

.project-link {
    font-size: 0.7rem;
    color: var(--gray);
    text-decoration: none;
    transition: color 0.2s ease;
}

.project-link:hover {
    color: var(--black);
}

/* Audio controls */
.audio-controls {
    display: none;
    margin-bottom: 1rem;
}

.audio-controls.visible {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audio-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: var(--black);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.audio-btn:hover {
    background: var(--gray);
}

.audio-btn.playing {
    background: var(--red);
}

.audio-icon {
    font-size: 0.8rem;
}

.audio-label {
    text-transform: lowercase;
}

/* Image caption */
.image-caption {
    font-size: 0.72rem;
    font-weight: 300;
    color: var(--black);
    margin-bottom: 0.8rem;
    line-height: 1.4;
    min-height: 1.4em;
}

/* Gallery footer nav */
.gallery-footer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.gallery-counter {
    font-size: 0.7rem;
    color: var(--gray);
}

.gallery-nav {
    display: flex;
    gap: 0.4rem;
    font-size: 0.75rem;
}

.gallery-nav a {
    color: var(--gray);
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
}

.gallery-nav a:hover {
    color: var(--black);
}

.gallery-nav span {
    color: var(--light-gray);
}

.show-thumbnails {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--gray);
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
}

.show-thumbnails:hover {
    color: var(--black);
}

/* ================================== */
/* MAIN CONTENT - GALLERY             */
/* ================================== */
.site-main {
    height: 100vh;
    overflow: hidden;
    background: var(--white);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.gallery-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: none;
}

.gallery-container.page-mode {
    cursor: default;
}

.gallery-image {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-image.loaded {
    opacity: 1;
}

.gallery-image.transitioning {
    opacity: 0;
}

/* ================================== */
/* DESCRIPTION SLIDE                  */
/* ================================== */
.description-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.description-slide.loaded {
    opacity: 1;
}

.description-content {
    max-width: 500px;
    padding: 3rem;
    background: var(--white);
    border: 1px solid var(--light-gray);
    text-align: center;
}

.description-title {
    font-size: 1.4rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    color: var(--black);
}

.description-text {
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.7;
    color: var(--gray);
}

/* ================================== */
/* VIDEO SLIDE                        */
/* ================================== */
.video-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.video-container.loaded {
    opacity: 1;
}

.video-container iframe {
    width: 100%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
    border: none;
}

/* ================================== */
/* PAGE CONTENT (About, Contact)      */
/* ================================== */
.page-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.page-text {
    max-width: 500px;
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.8;
    color: var(--black);
    text-align: center;
}

.page-text br + br {
    display: block;
    content: "";
    margin-top: 1em;
}

/* ================================== */
/* CUSTOM CURSOR                      */
/* ================================== */
.custom-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.15s ease;
    transform: translate(-50%, -50%);
}

.custom-cursor.visible {
    opacity: 1;
}

.custom-cursor svg {
    width: 20px;
    height: 20px;
    stroke: var(--black);
    stroke-width: 1.5;
    fill: none;
    filter: drop-shadow(0 0 1px white) drop-shadow(0 0 2px white);
}

/* ================================== */
/* THUMBNAILS PANEL                   */
/* ================================== */
.thumbnails-panel {
    position: fixed;
    bottom: 0;
    left: 220px;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--light-gray);
    padding: 1rem 2rem;
    display: none;
    z-index: 100;
}

.thumbnails-panel.active {
    display: block;
}

.thumbnails-close {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray);
    cursor: pointer;
    line-height: 1;
}

.thumbnails-close:hover {
    color: var(--black);
}

.thumbnails-grid {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.thumbnail-item {
    height: 60px;
    min-width: 60px;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail-item:hover,
.thumbnail-item.active {
    opacity: 1;
}

.thumbnail-item img {
    height: 100%;
    width: auto;
    object-fit: cover;
}

.thumbnail-item.thumb-description,
.thumbnail-item.thumb-video-item {
    background: var(--light-gray);
    width: 60px;
}

.thumb-text,
.thumb-video {
    font-size: 1.2rem;
    color: var(--gray);
}

/* ================================== */
/* MOBILE RESPONSIVE                  */
/* ================================== */

@media (max-width: 768px) {
    /* Landing */
    .landing {
        grid-template-columns: 1fr;
        grid-template-rows: 55vh 45vh;
    }
    
    .landing-image {
        order: 1;
    }
    
    .landing-content {
        order: 2;
        padding: 1.5rem;
        justify-content: center;
    }
    
    .brand-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        max-width: 100%;
    }
    
    .enter-btn {
        margin-left: 0;
        width: 100%;
    }
    
    .lang-toggle {
        top: 1rem;
        right: 1rem;
    }

    /* Site layout */
    .site.active {
        grid-template-columns: 1fr;
        grid-template-rows: 56px 1fr 50px;
    }

    /* Sidebar becomes top header */
    .sidebar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        height: 56px;
        padding: 0 1rem;
        border-right: none;
        border-bottom: 1px solid var(--light-gray);
        overflow: visible;
    }
    
    .sidebar-header {
        margin-bottom: 0;
        flex-direction: row;
        align-items: center;
        gap: 0.8rem;
    }
    
    .sidebar-lang {
        display: none;
    }
    
    .sidebar-brand-name {
        font-size: 0.7rem;
    }
    
    .sidebar-logo {
        width: 20px;
        height: 20px;
    }

    /* Menu toggle visible */
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 40px;
        height: 40px;
        padding: 10px;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 1001;
    }
    
    .menu-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        background: var(--black);
        transition: all 0.3s ease;
    }
    
    .menu-toggle.open span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .menu-toggle.open span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.open span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* Navigation - fullscreen overlay */
    .main-nav {
        display: none;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--white);
        padding: 2rem;
        z-index: 1000;
        overflow-y: auto;
    }
    
    .main-nav.open {
        display: block;
    }
    
    .nav-link {
        font-size: 1.1rem;
        padding: 0.8rem 0;
    }
    
    .dropdown-link {
        font-size: 0.95rem;
        padding: 0.6rem 0;
    }
    
    .dropdown-sublink {
        font-size: 0.85rem;
        padding: 0.5rem 0;
    }

    /* Footer - bottom bar */
    .sidebar-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--white);
        border-top: 1px solid var(--light-gray);
        padding: 0.8rem 1rem;
        margin-top: 0;
        z-index: 100;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .project-info,
    .image-caption {
        display: none !important;
    }
    
    .audio-controls.visible {
        display: flex;
    }
    
    .gallery-footer-nav {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }
    
    .gallery-counter {
        font-size: 0.75rem;
    }
    
    .gallery-nav {
        font-size: 0.85rem;
    }
    
    .show-thumbnails {
        font-size: 0.7rem;
    }

    /* Main gallery */
    .site-main {
        padding: 1rem;
        height: calc(100vh - 56px - 50px);
    }
    
    .gallery-container {
        cursor: pointer;
    }

    /* Description slide mobile */
    .description-content {
        padding: 2rem;
        margin: 1rem;
    }
    
    .description-title {
        font-size: 1.1rem;
    }
    
    .description-text {
        font-size: 0.85rem;
    }

    /* Page content mobile */
    .page-text {
        padding: 1rem;
        font-size: 0.85rem;
    }

    /* Thumbnails panel */
    .thumbnails-panel {
        left: 0;
        bottom: 50px;
        padding: 0.8rem 1rem;
    }
    
    .thumbnail-item {
        height: 50px;
        min-width: 50px;
    }

    /* Hide custom cursor on touch */
    .custom-cursor {
        display: none !important;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .landing {
        grid-template-rows: 50vh 50vh;
    }
    
    .brand-block {
        gap: 0.8rem;
    }
    
    .logo-b {
        width: 44px;
        height: 44px;
    }
    
    .enter-btn {
        height: 48px;
        font-size: 0.55rem;
    }
    
    .brand-name {
        font-size: 0.9rem;
    }
    
    .brand-subtitle {
        font-size: 0.55rem;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .landing {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr;
    }
    
    .landing-content {
        padding: 1rem;
    }
    
    .brand-wrapper {
        flex-direction: row;
        gap: 1rem;
    }
    
    .enter-btn {
        width: auto;
        margin-left: auto;
    }
}
