/* 
   Aesthetic variables:
   Stark minimalist, brutalist architecture inspired.
   High contrast, no film grain.
*/
:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --accent-color: #555555;

    --font-heading: "Anton SC", sans-serif;
    --font-body: "Special Gothic Expanded One", sans-serif;

    --spacing-sm: 1rem;
    --spacing-md: 2.5rem;
    --spacing-lg: 5rem;
    --spacing-xl: 10rem;

    --header-height: 80px;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1 {
    font-family: var(--font-heading);
    font-weight: 400;
    font-style: normal;
}

h2,
h3 {
    font-weight: normal;
}

a {
    color: var(--text-color);
    text-decoration: none;
}

a:hover {
    color: var(--accent-color);
}

/* Top Mini Menu (like reference site's very top directory) */
.l-menu {
    text-align: center;
    padding: 10px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid #eee;
    background: #fff;
    position: relative;
    z-index: 100;
}

/* Layout Containers */
.container--full {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 4%;
}

.container--text {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 4%;
}

/* Header */
.l-header {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 999;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.l-header__left,
.l-header__right {
    flex: 1;
}

.l-header__right {
    text-align: right;
}

.l-header__center {
    flex: 2;
    text-align: center;
}

.site--logo h1 {
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: -0.1 px;
}

.mobile-nav-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: flex-end;
}

.hamburger-icon {
    width: 24px;
    height: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

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

.mobile-nav-toggle.is-open .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg);
}

.mobile-nav-toggle.is-open .hamburger-icon span:nth-child(2) {
    opacity: 0;
    width: 0;
}

.mobile-nav-toggle.is-open .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg);
}

/* Mobile Nav Backdrop */
.mobile-nav-backdrop {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100vw;
    height: calc(100vh - var(--header-height));
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-nav-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.desktop-link {
    display: inline;
}

/* Masonry Gallery */
.l-main {
    padding-top: var(--spacing-md);
    padding-bottom: var(--spacing-xl);
}

/* Layout Toggle Button */
.layout-toggle-btn {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: #000;
    color: #fff;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.3s;
}

.layout-toggle-btn:hover {
    background: var(--accent-color);
}

.layout-toggle-btn svg {
    position: absolute;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

/* Default state: Masonry visible, Grid hidden */
.layout-toggle-btn .icon-grid {
    opacity: 0;
    transform: scale(0.5) rotate(-45deg);
}

.layout-toggle-btn .icon-masonry {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Toggled state: Grid visible, Masonry hidden */
.layout-toggle-btn.is-toggled .icon-masonry {
    opacity: 0;
    transform: scale(0.5) rotate(45deg);
}

.layout-toggle-btn.is-toggled .icon-grid {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Base Gallery Container (Default Masonry) */
.projects {
    column-count: 2;
    column-gap: 40px;
    transition: opacity 0.4s ease;
}

.c-project {
    break-inside: avoid;
    margin-bottom: 60px;
}

/* Toggled Grid Layout (3 Columns) */
.projects.is-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.projects.is-grid .c-project {
    margin-bottom: 0;
    max-width: 100%;
}

.projects.is-animating {
    opacity: 0;
}

.c-project__container {
    display: block;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.lazy-image {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.lazy-image.loaded {
    opacity: 1;
    transform: translateY(0) translateX(0);
}

.c-project__container:hover .lazy-image.loaded {
    transform: translateY(0) translateX(40px);
}

.c-project__title {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 40px;
    margin: 0;
    padding: 10px 0;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-align: right;
    text-transform: uppercase;
    font-size: 1rem;
    color: var(--text-color);

    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.c-project__container:hover .c-project__title {
    opacity: 1;
}

/* Information / Journal Section */
.information-section {
    padding: var(--spacing-xl) 0;
    background-color: #fafafa;
    border-top: 1px solid #eee;
}

.information-section h2 {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-content {
    font-size: 0.9rem;
}

.info-content p {
    margin-bottom: 1.5rem;
}

/* Footer */
.l-footer {
    padding: var(--spacing-md) 0;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
}

.l-footer .container--full {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Responsive - Tablet & Mobile Navigation */
@media (max-width: 900px) {

    /* Header & Navigation */
    .header-row {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        height: var(--header-height);
        padding: 0;
    }

    .l-header__left,
    .l-header__center,
    .l-header__right {
        text-align: center;
        flex: 1;
        display: flex;
    }

    .l-header__left {
        justify-content: flex-start;
    }

    .l-header__right {
        justify-content: flex-end;
    }

    .l-header__center {
        flex: 2;
        justify-content: center;
    }

    .desktop-link {
        display: none;
    }

    .mobile-nav-toggle {
        display: inline-flex;
    }

    .l-menu {
        display: none;
    }

    .l-menu.is-open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        padding: 20px 0;
        border-bottom: 1px solid #eee;
        animation: slideDown 0.3s ease forwards;
        z-index: 1000;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    }

    .l-menu.is-open nav {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .l-menu.is-open nav a {
        display: block;
        padding: 15px 20px;
        font-size: 1.2rem;
    }

    .nav-separator {
        display: none;
    }

    /* Projects Tablet */
    .projects {
        column-count: 2;
        /* Switch to 2 columns on tablet */
    }

    .projects.is-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive - Mobile */
@media (max-width: 600px) {

    /* Projects */
    .projects {
        column-count: 1;
        /* Single column on mobile */
    }

    .projects.is-grid {
        grid-template-columns: 1fr;
    }

    .layout-toggle-btn {
        width: 40px;
        height: 40px;
        right: 15px;
        bottom: 20px;
        top: auto;
        transform: none;
    }

    /* Disable hover effects on mobile and show captions below images */
    .c-project__container {
        overflow: visible;
        margin-bottom: 20px;
    }

    .c-project__container:hover .lazy-image.loaded {
        transform: none;
        /* Disable slide effect */
    }

    .c-project__title {
        position: static;
        width: 100%;
        writing-mode: horizontal-tb;
        transform: none;
        text-align: left;
        text-transform: uppercase;
        opacity: 1;
        /* Always visible */
        color: var(--text-color);
        padding: 10px 0 0 0;
        font-size: 1rem;
    }

    .l-footer .container--full {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}