/* --- Variables & Roots --- */
:root {
    --clr-bg: #EFECE0;
    --clr-text: #000000;
    --clr-text-muted: #333333;

    --font-main: 'Inter', sans-serif;

    --transition-slow: all 1s cubic-bezier(0.215, 0.61, 0.355, 1);
    --sidebar-width: 25vw;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--clr-bg);
}

body {
    font-family: var(--font-main);
    color: var(--clr-text);
    background-color: var(--clr-bg);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    opacity: 0.6;
}

/* --- Layout Wrapper --- */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    padding: 4rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 10;
}

.main-nav ul {
    list-style: none;
}

.main-nav li {
    margin-bottom: 0.85rem;
}

.main-nav a,
.social-links a {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 400;
}

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.logo-link {
    display: block;
    max-width: 100%;
}

.logo-img {
    max-width: 100%;
    height: auto;
    width: 220px;
}

/* --- Main Content Area --- */
.content-area {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
}

.section {
    padding: 10vh 15%;
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Typography styles inside content */
h2 {
    font-size: 1.5rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
}

p {
    font-size: 1.125rem;
    font-weight: 300;
    margin-bottom: 1.5rem;
    max-width: 550px;
    color: var(--clr-text-muted);
    line-height: 1.8;
}

.text-section {
    padding-top: 12vh;
    padding-bottom: 8vh;
}

/* Images */
.hero-section {
    padding: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image {
    width: 100%;
    height: 100vh;
    object-fit: cover;
}

.editorial-image {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
    margin: 0;
}

/* Services List */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 550px;
}

.service-item h3 {
    font-size: 1rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 0.5rem;
}

.service-item p {
    font-size: 1rem;
    margin-bottom: 0;
}

/* Image + Text Section */
.image-text-section {
    position: relative;
    padding-bottom: 20vh;
}

.text-block {
    margin-top: 4vh;
}

/* Footer Section */
.footer-section {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mt-auto {
    margin-top: auto;
}

.footer-bottom p {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.margin-top-lg {
    margin-top: 15vh;
}

/* --- Home Gallery Section --- */
.home-section {
    padding: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    position: relative;
    background-color: var(--clr-bg);
}

.gallery-track-wrapper {
    width: 100%;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s ease, transform 0.3s ease;
    user-select: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.gallery-arrow:hover {
    background: rgba(255, 255, 255, 0.32);
    transform: translateY(-50%) scale(1.08);
}

.gallery-arrow.prev {
    left: 1.5rem;
}

.gallery-arrow.next {
    right: 1.5rem;
}

.gallery-track {
    display: flex;
    gap: 1.5rem;
    width: max-content;
    animation: gallery-scroll 140s linear infinite;
}

.gallery-track:hover {
    animation-play-state: paused;
}

.gallery-item {
    display: block;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.gallery-item img {
    height: 72vh;
    width: auto;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease, opacity 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.04);
    opacity: 0.85;
}

.gallery-item-label {
    position: absolute;
    bottom: 1.2rem;
    left: 1.2rem;
    color: #fff;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 400;
    opacity: 0;
    transition: opacity 0.4s ease;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.gallery-item:hover .gallery-item-label {
    opacity: 1;
}

@keyframes gallery-scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}



/* --- Reveal Animations --- */
.reveal-wrapper {
    overflow: hidden;
    width: 100%;
}

.reveal-element {
    opacity: 0;
    transform: translateY(40px);
    transition: var(--transition-slow);
    will-change: opacity, transform;
}

/* Subtle scaling effect for images to make it look even more premium */
img.reveal-element {
    transform: translateY(40px) scale(1.02);
}

.reveal-element.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 200px;
    }

    .section {
        padding: 10vh 10%;
    }
}

@media (max-width: 768px) {
    .layout-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 2rem;
        flex-direction: row;
        align-items: flex-end;
    }

    .sidebar-bottom {
        gap: 1rem;
        align-items: flex-end;
        text-align: right;
    }

    .logo-img {
        width: 150px;
        margin-top: 1rem;
    }

    .content-area {
        margin-left: 0;
        width: 100%;
    }

    .hero-image {
        height: 70vh;
    }

    .section {
        padding: 5vh 8%;
    }
}

/* --- Navigation Scroll & Layout Fixes --- */

/* Ensure sections always fill the screen so the next page isn't visible when clicking */
.section {
    min-height: 100vh !important;
}

/* Add a margin at the top so linked sections aren't flush against the top of the browser */
.project-entry, .project-subsection {
    scroll-margin-top: 5vh;
}

/* Ensure the hero image and title fit within a single screen (100vh) without being cut off */
.project-entry .hero-image,
.project-subsection .hero-image {
    height: 60vh !important;
    max-height: 60vh !important;
}

.project-entry .text-block,
.project-subsection .text-block {
    margin-bottom: 4vh !important;
}

/* Add some spacing for the grid elements below the main image */
.project-grid {
    margin-top: 10vh !important;
}

/* Push the 'projects' section further down so it never peeks into the 'process' section viewport */
#projects {
    margin-top: 20vh !important;
}

/* --- Language Switcher (fisso in alto a destra) --- */
.lang-btn {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    background: rgba(239, 236, 224, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(0, 0, 0, 0.45);
    border-radius: 2rem;
    padding: 0.45rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    color: var(--clr-text);
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 1px 6px rgba(0,0,0,0.12);
}

.lang-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.7);
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.lang-opt {
    font-weight: 400;
    opacity: 0.38;
    transition: opacity 0.3s ease;
}

.lang-opt.active {
    opacity: 1;
    font-weight: 600;
}

.lang-sep {
    opacity: 0.3;
    font-weight: 300;
}

@media (prefers-reduced-motion: reduce) {
    .lang-btn,
    .lang-opt {
        transition: none;
    }
}