/* ==========================================================================
   CSS Variables & Design System
   ========================================================================== */
:root {
    /* Colors */
    --clr-bg: #F5F5F3;
    /* Slightly cooler off-white for gallery feel */
    --clr-text-primary: #111111;
    --clr-text-secondary: #777777;
    --clr-accent: #E0E0E0;

    /* Typography - Strict Swiss Native Stack */
    --font-primary: "Helvetica Neue", Helvetica, Arial, sans-serif;

    --ds-title-massive: clamp(4rem, 9.5vw, 14rem);
    --ds-title-large: clamp(3rem, 8vw, 9rem);
    --ds-title-medium: clamp(1.5rem, 4vw, 3rem);
    --ds-body: clamp(0.85rem, 1.1vw, 1rem);
    --ds-meta: 0.65rem;

    /* Spacing */
    --space-s: clamp(0.5rem, 1.5vw, 1.5rem);
    --space-m: clamp(2rem, 4vw, 3rem);
    --space-l: clamp(4rem, 8vw, 6rem);
    --space-xl: clamp(8rem, 15vw, 12rem);

    /* Grid */
    --container-w: 94%;
    --container-max: 1800px;

    /* Easing */
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-in-out-expo: cubic-bezier(1, 0, 0, 1);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    /* Lenis smooth scrolling requirement */
    scroll-behavior: auto !important;
}

body {
    font-family: var(--font-primary);
    background-color: var(--clr-bg);
    color: var(--clr-text-primary);
    line-height: 1.4;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: none;
    /* Hide default cursor for custom cursor */
}

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

button {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: none;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Optional Custom Cursor */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    background-color: transparent;
    border: 1px solid var(--clr-text-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.4s var(--ease-out-expo), height 0.4s var(--ease-out-expo), background-color 0.4s var(--ease-out-expo), border-color 0.4s var(--ease-out-expo), backdrop-filter 0.4s var(--ease-out-expo);
    mix-blend-mode: difference;
    backdrop-filter: invert(1);
}

body:hover .custom-cursor {
    opacity: 1;
}

a:hover~.custom-cursor,
button:hover~.custom-cursor,
.gallery-item:hover~.custom-cursor {
    width: 80px;
    height: 80px;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
}

.container {
    width: var(--container-w);
    max-width: var(--container-max);
    margin: 0 auto;
}

.spacer-xl {
    height: var(--space-xl);
}

/* ==========================================================================
   Typography Classes
   ========================================================================== */
.text-massive {
    font-size: var(--ds-title-massive);
    font-weight: 300;
    line-height: 0.85;
    letter-spacing: -0.04em;
}

.text-meta {
    font-size: var(--ds-meta);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 400;
}

/* Replaced generic btn-link with a structural editorial link */
.editorial-link {
    display: block;
    width: 100%;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.4s ease;
}

.editorial-link:hover {
    opacity: 0.7;
}

/* ==========================================================================
   Header
   ========================================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.header__logo,
.nav-overlay__close {
    font-size: var(--ds-body);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.header__menu-btn {
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: #fff;
    color: #000;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.header__menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.header__logo-img {
    height: 100px;
    width: auto;
    display: block;
}

/* ==========================================================================
   Intro Section
   ========================================================================== */
.intro-section {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-m);
}

.intro-section__text {
    font-size: var(--ds-title-medium);
    font-weight: 300;
    line-height: 1.4;
    letter-spacing: -0.01em;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

/* ==========================================================================
   Full-Screen Navigation Overlay (Accordion)
   ========================================================================== */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1000;
    pointer-events: none;
    visibility: hidden;
    display: flex;
    flex-direction: column;
}

.nav-overlay.is-active {
    pointer-events: auto;
    visibility: visible;
}

.nav-overlay__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--clr-bg);
    transform: translateY(-100%);
    will-change: transform;
}

.nav-overlay__content {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    /* Opacity will NOT be animated via CSS, GSAP handles text reveal directly */
}

.nav-overlay__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-m) var(--space-s);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    color: var(--clr-text-primary);
    opacity: 0;
    /* Handled by GSAP */
}

.nav-overlay__list {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: stretch;
    align-items: stretch;
    gap: 0;
    height: 100vh;
    padding-top: calc(var(--space-m) * 2 + 20px);
    /* Leave space for header */
}

.nav-overlay__item {
    flex: 1;
    overflow: hidden;
    position: relative;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    transition: flex 1s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: flex;
    background-color: var(--clr-bg);
}

.nav-overlay__item:last-child {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-overlay__link {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center massive text */
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
}

.nav-overlay__text {
    font-size: var(--ds-title-large);
    font-weight: 200;
    letter-spacing: -0.02em;
    line-height: 1;
    position: relative;
    z-index: 2;
    color: var(--clr-text-primary);
    display: block;
    transform-origin: center;
    transition: transform 1s cubic-bezier(0.19, 1, 0.22, 1), color 0.4s ease;
    will-change: transform;
    pointer-events: none;
}

/* Accordion Hover Image */
.nav-overlay__img-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    opacity: 0;
    z-index: 0;
    will-change: opacity;
    transition: opacity 1s cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: none;
}

.nav-overlay__img-wrapper img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    transform: translate(-50%, -50%) scale(1.05);
    filter: brightness(0.7);
    transition: transform 1.5s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: transform;
}

/* Accordion Hover State Logic */
@media (hover: hover) {
    .nav-overlay__list:hover .nav-overlay__item {
        flex: 0.5;
        /* Shrink others heavily */
    }

    .nav-overlay__list .nav-overlay__item:hover {
        flex: 3;
        /* Expand hovered massively */
    }

    .nav-overlay__item:hover .nav-overlay__img-wrapper {
        opacity: 1;
    }

    .nav-overlay__item:hover .nav-overlay__img-wrapper img {
        transform: translate(-50%, -50%) scale(1);
        /* Calm zoom out effect */
    }

    .nav-overlay__item:hover .nav-overlay__text {
        color: #fff;
        /* Switch to white when hovering */
        transform: scale(1.15);
        /* Typographic scale */
    }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    padding-bottom: 0%;
}

.hero__image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero__image {
    width: 100%;
    height: 120%;
    /* Extra height for parallax */
    object-fit: cover;
    object-position: center;
    /* GSAP Parallax via data attribute or class */
}

.hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #ffffff;
}

.hero__title {
    font-size: var(--ds-title-massive);
    font-weight: 200;
    line-height: 0.85;
    letter-spacing: -0.03em;
    display: flex;
    flex-direction: column;
}

.hero__subtitle {
    font-size: 2rem;
    margin-top: 2rem;
    color: #ffffff;
}

.hero__scroll-indicator {
    margin-top: 50px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 2;
    color: #ffffff;
}

.hero__scroll-text {
    font-size: var(--ds-meta);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hero__scroll-line {
    width: 1px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.hero__scroll-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background-color: #fff;
    animation: scrollDrop 2s cubic-bezier(0.19, 1, 0.22, 1) infinite;
}

@keyframes scrollDrop {
    0% {
        transform: translateY(-100%);
    }

    50% {
        transform: translateY(200%);
    }

    100% {
        transform: translateY(200%);
    }
}

/* ==========================================================================
   Gallery Sections (Home & Pages)
   ========================================================================== */
.gallery-section {
    padding-top: var(--space-xl);
}

.gallery-block {
    display: flex;
    align-items: flex-end;
    gap: var(--space-m);
}

.gallery-block--left {
    justify-content: flex-start;
}

.gallery-block--right {
    justify-content: flex-end;
    text-align: right;
}

.gallery-block--center {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.gallery-block__image-wrapper {
    width: 100%;
    max-width: 55vw;
    aspect-ratio: 3/4;
    /* Portrait default */
    overflow: hidden;
}

.gallery-block__image-wrapper--large {
    max-width: 80vw;
    aspect-ratio: 16/9;
    /* Landscape */
}

.gallery-block__info {
    margin-bottom: var(--space-s);
}

.gallery-block__title {
    font-size: var(--ds-title-medium);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.gallery-block__image-wrapper img {
    width: 100%;
    height: 130%;
    /* for parallax */
    object-fit: cover;
    transform: translateY(-15%);
    /* initial offset */
}

/* Utils for GSAP reveals */
.reveal-mask {
    clip-path: inset(100% 0 0 0);
    /* will animate to inset(0 0 0 0) */
}

.reveal-text {
    opacity: 0;
    transform: translateY(30px);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    padding: var(--space-l) 0 var(--space-m);
    border-top: 1px solid var(--clr-accent);
}

.footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-m);
}

.footer__left p {
    font-size: var(--ds-body);
    color: var(--clr-text-secondary);
}

.footer__right {
    display: flex;
    gap: var(--space-s);
}

.footer__link {
    font-size: var(--ds-meta);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    padding-bottom: 0.25rem;
}

.footer__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.6s var(--ease-out-expo);
}

.footer__link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Footer Credits */
p.credits {
    font-size: 12px;
    padding: 0;
    margin: 0;
}

strong {
    font-weight: 700
}

span.made-with-love svg {
    fill: #9D825D;
    animation: beat .4s infinite alternate;
    transform-origin: center;
}

svg.fa {
    display: inline-block;
    height: 15px;
    padding: 0 3px;
    transform: translate(0, 0);
    vertical-align: middle;
}

svg:not(:root) {
    overflow: hidden;
}

@keyframes beat {
    to {
        transform: scale(1.2);
    }
}


/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .gallery-block {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .gallery-block--right {
        align-items: flex-start;
        text-align: left;
    }

    .gallery-block__image-wrapper,
    .gallery-block__image-wrapper--large {
        max-width: 100%;
    }

    .nav-overlay__text {
        font-size: clamp(2rem, 10vw, 4rem);
    }

    .hero__subtitle {
        font-size: 1rem !important;
    }
}

/* ==========================================================================
   Lightbox Overlay
   ========================================================================== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    /* Handled via GSAP */
}

.lightbox.is-active {
    pointer-events: auto;
}

.lightbox__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1;
}

.lightbox__close {
    position: absolute;
    top: var(--space-m);
    right: var(--space-m);
    z-index: 3;
    color: #fff;
    font-size: var(--ds-meta);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: none;
    /* Let custom cursor handle hovering */
    padding: 1rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.lightbox__close:hover {
    opacity: 1;
}

.lightbox__content {
    position: relative;
    z-index: 2;
    width: 90vw;
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox__content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}