:root {
    --bg-color: #ffffff;
    --text-color: #111111;
    --accent-color: #333333;
    --gray-light: #f4f4f4;
    --gray-medium: #888888;
    --footer-bg: #050505;
    --footer-text: #ffffff;

    --spacing-container: 5vw;
    --spacing-section: 120px;

    --font-main: 'Inter', sans-serif;
    --tracking-tight: -0.04em;
    /* "Modny" spacing */
}

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

body {
    font-family: var(--font-main);
    background-color: #ffffff;
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    opacity: 0;
    /* JS will fade it in */
    transition: opacity 0.5s ease;
}

body.loaded {
    opacity: 1;
}

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

ul {
    list-style: none;
}

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

/* =========================================
   TYPOGRAPHY
   ========================================= */
h1,
h2,
h3,
h4,
.nav-link,
.btn {
    letter-spacing: var(--tracking-tight);
}

.title-xl {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
}

.title-lg {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
    font-weight: 500;
}

.subtitle {
    font-size: clamp(1rem, 1.25vw, 1.15rem);
    font-weight: 400;
    color: var(--text-color);
    max-width: 550px;
}

.text-meta {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-medium);
    margin-bottom: 0.75rem;
}

/* =========================================
   LAYOUT
   ========================================= */
.container {
    padding: 0 var(--spacing-container);
    max-width: 1800px;
    margin: 0 auto;
}

section {
    margin-bottom: var(--spacing-section);
}

/* =========================================
   HEADER
   ========================================= */
header {
    padding: 2rem var(--spacing-container);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.logo {
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: var(--tracking-tight);
    text-transform: uppercase;
}

nav ul {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 400;
    opacity: 0.6;
}

.nav-link:hover {
    opacity: 1;
}

/* Mobile Nav Toggle (Hidden on Desktop) */
.menu-toggle {
    display: none;
    cursor: pointer;
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    padding-top: 120px;
    padding-bottom: 60px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: center;
}

.hero-content {
    max-width: 800px;
    z-index: 10;
}

.hero h1 {
    margin-bottom: 1.5rem;
}

.hero .subtitle {
    margin-bottom: 2rem;
    line-height: 1.5;
    max-width: 500px;
}

/* Hero Composition: overlapping images */
.hero-visuals {
    position: relative;
    width: 100%;
}

.hero-img-pose {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    /* Optional slight rounding for polish */
}



/* =========================================
   PROJECTS GRID
   ========================================= */
/* =========================================
   PROJECTS LIST (Refactored from Grid)
   ========================================= */
.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Removing gap, using padding/margin on cards for separator spacing */
}

.project-card {
    display: grid;
    grid-template-columns: 350px 1.2fr 1fr;
    /* Larger Image, Title, Desc */
    gap: 2rem;
    /* Reduced gap to bring text columns closer */
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    position: relative;
    /* For pseudo-element positioning */
    padding-bottom: 4rem;
    margin-bottom: 4rem;
}

/* Subtle Gradient Separator */
.project-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.15) 30%, rgba(0, 0, 0, 0.15) 70%, rgba(0, 0, 0, 0) 100%);
}

.project-card:last-child {
    margin-bottom: 150px;
    /* Increased spacing after last case */
    padding-bottom: 0;
}

.project-card:last-child::after {
    display: none;
}

.project-thumb-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    /* Square images */
    background-color: var(--gray-light);
    overflow: hidden;
    margin-bottom: 0;
}

.project-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-card:hover .project-thumb {
    transform: scale(1.05);
}

.project-title {
    font-size: 2.2rem;
    /* Larger title */
    font-weight: 600;
    /* Bolder title */
    margin-bottom: 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.project-desc {
    font-size: 1rem;
    color: var(--gray-medium);
    font-weight: 400;
    line-height: 1.5;
}

.view-project-btn {
    display: none !important;
    /* Hide the button added in valid-ru.js if present, keeping clean list look */
}

/* =========================================
   CASE STUDY PAGE
   ========================================= */
.case-header {
    padding-top: 150px;
    padding-bottom: 60px;
}

.case-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    border-top: 1px solid #eee;
    padding-top: 2rem;
    margin-top: 3rem;
}

.meta-item h4 {
    font-size: 0.75rem;
    color: var(--gray-medium);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.meta-item p {
    font-size: 1rem;
}

.case-hero-image {
    width: 100%;
    height: 70vh;
    object-fit: cover;
    margin-bottom: 60px;
}

.case-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    margin-bottom: 100px;
}

.case-gallery {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.case-gallery img {
    width: 100%;
    height: auto;
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 100px var(--spacing-container);
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.footer-cta {
    margin-bottom: 4rem;
}

.footer-cta h2 {
    font-size: clamp(3rem, 7vw, 6rem);
    line-height: 1.1;
    font-weight: 500;
    /* Gradient Text Logic */
    background: linear-gradient(180deg, #FFFFFF 0%, #666666 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-bottom: 0.2em;
    /* Ensure descenders aren't cut off */
}

.footer-links {
    margin-top: auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 2rem;
}

/* Shared Contact Links Style */
/* Shared Contact Links Style */
.contact-email,
.contact-telegram {
    display: flex;
    /* Changed from block to match usage */
    align-items: center;
    width: fit-content;
    font-size: 1.25rem;
    /* Smaller text */
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 5px;
    margin-bottom: 1.5rem;
    transition: opacity 0.3s ease, border-color 0.3s ease;
    color: #fff;
}

.contact-email:hover,
.contact-telegram:hover {
    border-bottom-color: #fff;
    opacity: 0.8;
}

/* New Footer Helper Classes (Replacing Inline) */
.footer-contacts-wrapper {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-visuals {
        height: auto;
        margin-top: 0;
        margin-bottom: 2rem;
    }

    .hero-img-pose {
        width: 100%;
    }

    .case-content {
        grid-template-columns: 1fr;
    }

    .nav-links-desktop {
        display: none;
    }

    .nav-links-desktop.show {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        bottom: 0;
        background: #ffffff;
        padding: 40px var(--spacing-container);
        gap: 2rem;
        z-index: 99;
        height: 100vh;
        overflow-y: auto;
    }

    .nav-links-desktop.show .nav-link {
        font-size: 1.5rem;
        font-weight: 500;
        color: var(--text-color);
        opacity: 1;
    }

    /* 1. Menu Toggle Styling */
    .menu-toggle {
        display: block;
        font-weight: 600;
        font-size: 1.1rem;
        text-transform: uppercase;
        color: #cccccc;
        /* Very light gray */
        letter-spacing: var(--tracking-tight);
        cursor: pointer;
    }

    /* 2. Hero Title (Mobile Increase) */
    .title-xl {
        font-size: 3.2rem;
        /* Increased size */
    }

    /* 3. Selected Projects Label (English Only Match) */
    html:lang(en) #work h2.title-lg {
        font-size: 0.75rem;
        /* Match text-meta size */
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #cccccc;
        /* Very light gray */
        margin-bottom: 2rem;
        font-weight: 400;
        line-height: 1.5;
    }

    /* 4. Project Cards (Square) */
    .project-card {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding-bottom: 2rem;
    }

    .project-thumb-container {
        max-width: 100%;
        aspect-ratio: 1 / 1;
        /* Square ratio */
    }

    /* 5. Footer Layout Fixes */
    .footer-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 40px;
    }

    .footer-contacts-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        width: 100%;
    }

    .footer-copyright-wrapper p {
        color: #cccccc;
        /* Very light gray */
        font-size: 0.85rem;
        /* Smaller size */
        text-align: left;
        margin: 0;
    }
}