/* --- 1. IMPORTS & RESET --- */
@import "https://unpkg.com/open-props/easings.min.css"; 

:root {
    /* Light Mode */
    --bg-color: #ffffff;
    --text-color: #000000;
    --secondary-text: #666666;
    --icon-color: #000000;
    --spacing: 40px; 
    --header-height: 120px; 
    --font-main: 'Inter', sans-serif;
    --nav-position-left: 30vw; 
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --secondary-text: #aaaaaa;
    --icon-color: #ffffff;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-weight: 300;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 0.6;
}

ul {
    list-style: none;
}

/* --- 2. HEADER --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--spacing);
    display: flex;
    justify-content: space-between;
    align-items: center; 
    background: transparent;
    z-index: 3000;
    pointer-events: none;
    height: auto;
    min-height: 100px;
}

header:has(.hamburger.open) .header-left,
header:has(.hamburger.open) .header-right {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.header-left, .header-right {
    pointer-events: auto;
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease;
}

/* LOGO GROUP */
.logo-group {
    display: flex;
    align-items: flex-end; 
    gap: 12px;
    text-decoration: none !important;
    line-height: 1; 
}

.logo-symbol {
    width: 50px; 
    height: auto;
    display: block;
}

.brand-name {
    font-family: 'Helvetica', 'Arial', sans-serif;
    font-weight: 700;
    font-size: 16px; 
    color: var(--text-color);
    line-height: 1; 
    letter-spacing: -0.5px;
    position: relative;
    bottom: -1px; 
}

/* NAVIGATION */
.header-left nav {
    position: absolute;
    left: var(--nav-position-left); 
    bottom: var(--spacing); 
    line-height: 1;
}

.header-left nav ul, .header-right nav ul {
    display: flex;
    gap: 30px;
    align-items: center;
}

nav a {
    text-transform: lowercase;
    font-weight: 400;
    font-size: 15px;
    line-height: 1; 
}

nav a.active {
    border-bottom: 1px solid currentColor;
}

/* --- LANGUAGE SWITCHER --- */
.lang-container {
    position: relative;
    display: none; 
}

body.show-lang .lang-container {
    display: block;
}

.lang-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--bg-color);
    border: 1px solid var(--text-color);
    color: var(--text-color);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
}

.lang-dropdown {
    display: none !important; 
    position: absolute;
    top: 40px; 
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-color);
    border: 1px solid var(--text-color);
    padding: 5px 0;
    flex-direction: column;
    gap: 2px;
    min-width: 40px;
    z-index: 1001;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.lang-dropdown.open {
    display: flex !important;
}

.lang-dropdown li {
    font-size: 11px;
    font-weight: 500;
    padding: 6px 10px;
    cursor: pointer;
    text-align: center;
    text-transform: uppercase;
    color: var(--text-color);
}

.lang-dropdown li:hover {
    background-color: #f0f0f0;
    color: #000;
}

/* --- ANIMATED THEME TOGGLE --- */
.theme-toggle {
    background: none;
    border: none;
    padding: 0;
    inline-size: 20px; 
    block-size: 20px;
    aspect-ratio: 1;
    border-radius: 50%;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    outline-offset: 5px;
    color: var(--text-color); 
    margin-left: 25px; 
}

.theme-toggle > svg {
    inline-size: 100%;
    block-size: 100%;
    stroke-linecap: round;
}

.sun-and-moon > :is(.moon, .sun, .sun-beams) {
    transform-origin: center;
}

.sun-and-moon > :is(.moon, .sun) {
    fill: currentColor;
}

.theme-toggle:is(:hover, :focus-visible) {
    opacity: 0.7;
}

/* DEFAULT STATE (LIGHT) = MOON */
.sun-and-moon > .sun-beams {
    stroke: currentColor;
    stroke-width: 2px;
    opacity: 0; 
}
.sun-and-moon > .sun {
    transform: scale(1.75); 
}
.sun-and-moon > .moon > circle {
    transform: translateX(-7px); 
}

/* DARK MODE STATE = SUN */
[data-theme="dark"] .sun-and-moon > .sun {
    transform: scale(1);
}
[data-theme="dark"] .sun-and-moon > .sun-beams {
    opacity: 1;
    transform: rotate(45deg); 
}
[data-theme="dark"] .sun-and-moon > .moon > circle {
    transform: translateX(7px); 
}

/* Animations */
@media (prefers-reduced-motion: no-preference) {
    .sun-and-moon > .sun {
        transition: transform .5s var(--ease-elastic-3);
    }
    .sun-and-moon > .sun-beams {
        transition: transform .5s var(--ease-elastic-4), opacity .5s var(--ease-3);
    }
    .sun-and-moon .moon > circle {
        transition: transform .25s var(--ease-out-5);
    }

    [data-theme="dark"] .sun-and-moon > .sun {
        transition-timing-function: var(--ease-3);
        transition-duration: .25s;
    }
    [data-theme="dark"] .sun-and-moon > .sun-beams {
        transition-duration: .15s;
    }
    [data-theme="dark"] .sun-and-moon > .moon > circle {
        transition-duration: .5s;
        transition-delay: .25s;
    }
}

/* --- HAMBURGER --- */
.hamburger {
    display: none; 
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    pointer-events: auto;
    z-index: 3001; 
    position: absolute;
    top: var(--spacing);
    right: var(--spacing); 
    width: 30px; 
    height: 25px;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: all 0.3s ease-in-out;
    transform-origin: center;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
    opacity: 0;
}
.hamburger.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.mobile-menu-overlay {
    display: none; 
}

/* --- PAGE LAYOUTS --- */
.landing-container {
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: var(--spacing);
    padding-top: var(--header-height);
}

.video-wrapper {
    width: 65vw;
    height: 75vh;
    position: relative;
    overflow: hidden;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.arch-wrapper {
    padding-top: 160px;
    padding-left: var(--spacing);
    padding-right: var(--spacing);
    padding-bottom: var(--spacing);
    max-width: 1800px;
    margin: 0 auto;
}

.arch-grid {
    display: grid;
    grid-template-columns: 45% 1fr;
    gap: 60px;
    align-items: start; 
}

.arch-left img {
    width: 100%;
    height: auto;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
    background-color: #f0f0f0;
}

.clickable-image { cursor: pointer; }

.copyright {
    margin-top: 8px;
    font-size: 11px;
    color: var(--secondary-text);
}

.arch-right { padding-top: 0; }
.project-list li { margin-bottom: 6px; font-size: 15px; }
.project-list a { color: var(--text-color); }
.project-title { font-size: 15px; font-weight: 400; margin-bottom: 5px; }
.project-subtitle { font-size: 15px; font-weight: 400; margin-bottom: 25px; color: var(--text-color); }
.project-desc { max-width: 450px; color: var(--secondary-text); font-size: 14px; line-height: 1.6; }
.arch-contacts { margin-top: 40px; color: var(--secondary-text); font-size: 13px; line-height: 1.6; }

.viz-container {
    padding-top: 160px;
    padding-bottom: 100px;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

.view-toggle {
    position: absolute; 
    top: 110px; 
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    cursor: pointer;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--bg-color);
    color: var(--text-color);
    padding: 8px 12px;
    border: 1px solid #eee;
    transition: background 0.3s, color 0.3s;
}

/* LIST VIEW (Standard Scroll) */
.gallery-wrapper.list-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 100px;
    margin-top: 40px; 
}

.gallery-wrapper.list-view .gallery-item { 
    width: 40vw; 
    min-width: 300px; 
}

.gallery-item img { 
    width: 100%; 
    height: auto; 
    display: block; 
    cursor: zoom-in; 
}

.caption { 
    text-align: center; 
    margin-top: 12px; 
    font-size: 12px; 
    color: var(--secondary-text); 
}

/* MASONRY PUZZLE GRID VIEW */
.gallery-wrapper.grid-view {
    display: block;
    /* Creates the masonry column effect */
    column-count: 3; 
    column-gap: 20px; /* Space between columns */
    padding: 0 var(--spacing);
    margin-top: 40px;
}

.gallery-wrapper.grid-view .gallery-item {
    width: 100%;
    /* Prevents image from splitting between columns */
    break-inside: avoid; 
    margin-bottom: 20px; /* Vertical space between images */
}

.gallery-wrapper.grid-view .caption { 
    display: none; 
}

.text-page {
    padding-top: 200px;
    padding-left: var(--spacing);
    padding-right: var(--spacing);
    max-width: 800px;
    margin: 0 auto;
    text-align: center; 
}
.text-page h1 { font-weight: 400; font-size: 16px; margin-bottom: 30px; }
.text-block p { margin-bottom: 5px; color: var(--text-color); }
.text-block a { color: var(--text-color); border-bottom: 1px solid transparent; }
.text-block a:hover { border-bottom: 1px solid var(--text-color); opacity: 1; }
.spacer { height: 30px; }

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color); 
    justify-content: center;
    align-items: center;
}
.lightbox-img { max-width: 90vw; max-height: 85vh; object-fit: contain; }
.lightbox-controls {
    position: absolute; width: 100%; top: 50%; transform: translateY(-50%);
    display: flex; justify-content: space-between; padding: 0 30px; pointer-events: none;
}
.prev-btn, .next-btn {
    pointer-events: auto; cursor: pointer; font-size: 40px; font-weight: 100;
    user-select: none; color: var(--text-color);
}
.close-lightbox {
    position: absolute; top: 30px; right: 40px; font-size: 40px;
    font-weight: 100; cursor: pointer; color: var(--text-color);
}

/* --- 8. MOBILE RESPONSIVE --- */
@media (max-width: 1024px) {
    /* Tablet Masonry */
    .gallery-wrapper.grid-view {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .header-left nav, .header-right, .view-toggle { display: none !important; }
    .hamburger { display: flex; right: 20px; }
    header { padding: 20px; background: transparent; align-items: flex-start; }
    .arch-wrapper, .viz-container, .text-page { padding-top: 120px; }
    .arch-grid { grid-template-columns: 1fr; gap: 30px; }
    .video-wrapper { width: 100%; height: 50vh; }
    
    /* Mobile Masonry */
    .gallery-wrapper.grid-view {
        column-count: 1; /* Stack on mobile */
    }
    .gallery-wrapper.list-view .gallery-item { 
        width: 90vw; 
    }
    
    .mobile-menu-overlay {
        display: block; position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
        z-index: 2500; visibility: hidden; opacity: 0; transition: opacity 0.4s ease, visibility 0.4s ease;
    }
    .mobile-menu-overlay.open { visibility: visible; opacity: 1; }
    .mobile-menu-bg {
        position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background-image: url('img/mobile-bg.jpg'); background-size: cover;
        background-position: center; background-color: #f0f0f0; z-index: -1;
    }
    .mobile-menu-content {
        position: relative; width: 100%; height: 100%; overflow-y: auto; 
        padding: 120px 30px 0 30px; display: flex; flex-direction: column;
    }
    .mobile-menu-content a {
        font-size: 32px; font-weight: 300; color: #333; display: block;
        line-height: 1.2; margin-bottom: 5px;
    }
    .mobile-menu-content a:nth-of-type(3) { margin-top: 25vh; }
    .mobile-menu-footer {
        margin-top: 25vh; font-size: 24px; font-weight: 600; color: #000;
        padding-bottom: 20vh; margin-bottom: 50px;
    }

    /* Mobile Lang Switcher */
    body.show-lang .lang-container {
        display: block; position: fixed; bottom: 30px; right: 30px; z-index: 6000; 
    }
    .lang-dropdown {
        top: auto; bottom: 40px; left: auto; right: 0; transform: none;
        flex-direction: column-reverse; 
    }
}