:root {
    /* Палитра: чистые, глубокие цвета */
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --accent-color: #1d4ed8; /* Более насыщенный синий */
    --accent-light: rgba(29, 78, 216, 0.1);
    --header-bg: rgba(248, 250, 252, 0.7); /* Slightly more transparent */
    --border-color: rgba(15, 23, 42, 0.08);
    --hero-bg: #ffffff;
    --muted-text: #64748b;
    --card-bg: #ffffff;
    --modal-overlay: rgba(15, 23, 42, 0.4);
    
    /* Шрифты */
    --mono-font: 'IBM Plex Mono', 'Fira Code', monospace;
    --main-font: 'Inter', system-ui, -apple-system, sans-serif;
    --card-radius: 12px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Тени */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.03);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.05), 0 10px 10px -5px rgba(0,0,0,0.02);
}

body.dark-theme {
    --bg-color: #020617;
    --text-color: #f1f5f9;
    --accent-color: #38bdf8; /* Возвращаем яркий голубой из понравившейся версии */
    --accent-light: rgba(56, 189, 248, 0.15);
    --header-bg: rgba(2, 6, 23, 0.6); /* Slightly more transparent */
    --border-color: rgba(241, 245, 249, 0.1);
    --hero-bg: #030712;
    --muted-text: #94a3b8;
    --card-bg: #0f172a;
    --modal-overlay: rgba(0, 0, 0, 0.8);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 15px; -webkit-tap-highlight-color: transparent; }

body {
    font-family: var(--main-font);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    overscroll-behavior-y: none; /* Убирает эффект "резиновой ленты" и пустое место сверху */
    transition: background-color 0.5s ease, color 0.5s ease, opacity 0.3s ease;
}

/* Глобальные переходы для смены темы */
*, *::before, *::after {
    transition: background-color 0.5s ease, border-color 0.5s ease, color 0.5s ease, box-shadow 0.5s ease;
}

/* Исключаем из анимации элементы, где она мешает (например, слайдер или пятна) */
.slider, .blob, .bg-blobs, .slider *, .bg-blobs * {
    transition: none !important;
}

::selection { background: var(--accent-color); color: white; }

/* Кастомный скроллбар */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-text); }

/* Анимированные фоновые пятна */
.bg-blobs {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0;
    overflow: hidden;
    filter: blur(100px);
    opacity: 0.75;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
}

.blob-1 { 
    width: 450px; height: 450px; top: -150px; left: -100px; 
    background: var(--accent-color); 
    animation: float-1 18s infinite alternate ease-in-out; 
}
.blob-2 { 
    width: 400px; height: 400px; bottom: -100px; right: -50px; 
    background: #8b5cf6; 
    animation: float-2 22s infinite alternate-reverse ease-in-out; 
}
.blob-3 { 
    width: 350px; height: 350px; top: 35%; left: 55%; 
    background: #06b6d4; 
    animation: float-3 20s infinite alternate ease-in-out; 
}

@keyframes float-1 {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    50% { transform: translate(120px, 100px) scale(1.1) rotate(10deg); }
    100% { transform: translate(-40px, 180px) scale(0.9) rotate(-15deg); }
}

@keyframes float-2 {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    50% { transform: translate(-100px, -80px) scale(1.15) rotate(-15deg); }
    100% { transform: translate(60px, -150px) scale(0.95) rotate(10deg); }
}

@keyframes float-3 {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-80px, 120px) scale(1.1); }
    66% { transform: translate(100px, -60px) scale(0.9); }
    100% { transform: translate(40px, 80px) scale(1.05); }
}

/* Секции с фоном */
.hero, .contact, .projects-page, .project-hero, footer {
    position: relative;
    overflow: hidden;
}

.hero .bg-blobs, .projects-page .bg-blobs, .project-hero .bg-blobs, .projects-archive-hero .bg-blobs {
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

.contact .bg-blobs, footer .bg-blobs {
    top: auto;
    bottom: 0;
    height: 100%;
    opacity: 0.6;
    mask-image: linear-gradient(to top, black 40%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, black 40%, transparent 100%);
}

/* All Projects Page Hero */
.projects-archive-hero {
    position: relative;
    padding: 8rem 2rem 0;
    width: 100%;
    overflow: hidden;
}
.projects-archive-hero-inner {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Header */
header {
    background-color: transparent;
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    padding: 1.5rem 2rem; /* Возвращаем увеличенный исходный отступ */
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: background-color 0.2s ease-out, backdrop-filter 0.2s ease-out, padding 0.2s ease-out, border-bottom 0.2s ease-out;
    border-bottom: 1px solid transparent;
}

header.scrolled {
    background-color: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 1rem 2rem; /* Возвращаем компактный отступ при скролле */
    border-bottom: 1px solid var(--border-color);
}

nav { 
    display: grid; 
    grid-template-columns: 1fr auto 1fr; 
    align-items: center; 
    max-width: 1200px; 
    margin: 0 auto; 
}
.logo { font-size: 1.1rem; font-weight: 600; font-family: var(--mono-font); letter-spacing: -0.02em; transition: var(--transition); justify-self: start; }
.logo:hover { color: var(--accent-color); }
.logo a { text-decoration: none; color: inherit; }

.nav-links { display: flex; list-style: none; gap: 2.5rem; align-items: center; justify-self: center; }
.nav-links a { 
    text-decoration: none; 
    color: var(--text-color); 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    letter-spacing: 0.1em; 
    opacity: 0.6; 
    font-family: var(--mono-font); 
    transition: var(--transition); 
}
.nav-links a:hover { opacity: 1; color: var(--accent-color); }

/* Header Controls */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    justify-self: end;
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--mono-font);
    font-size: 0.75rem;
    color: var(--muted-text);
}

.lang-switcher .sep {
    opacity: 0.3;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--muted-text);
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    transition: var(--transition);
    opacity: 0.5;
}

.lang-btn.active {
    color: var(--accent-color);
    opacity: 1;
    font-weight: 600;
}

.lang-btn:hover {
    opacity: 1;
}

.theme-select {
    position: relative;
    display: inline-block;
}

.theme-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    list-style: none;
    min-width: 140px;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1100;
}

.theme-select.open .theme-dropdown {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

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

.theme-option {
    padding: 0.7rem 1rem;
    font-size: 0.75rem;
    font-family: var(--mono-font);
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.theme-option:hover {
    background: var(--accent-light);
    color: var(--accent-color);
}

.theme-option.active {
    color: var(--accent-color);
    background: var(--accent-light);
    font-weight: 600;
}

.theme-icon-btn { 
    background: var(--accent-light); 
    border: 1px solid var(--border-color);
    color: var(--accent-color); 
    cursor: pointer; 
    width: 38px; height: 38px; 
    border-radius: 8px; 
    display: flex; align-items: center; justify-content: center; 
    transition: var(--transition); 
    position: relative;
}
.theme-icon-btn:hover { background: var(--accent-color); color: white; border-color: var(--accent-color); }

.sun-icon, .moon-icon { display: none; width: 18px; height: 18px; }

/* Логика отображения иконок */
/* 1. Если выбрана конкретная тема */
.theme-icon-btn[data-active-theme="light"] .sun-icon { display: block; }
.theme-icon-btn[data-active-theme="dark"] .moon-icon { display: block; }

/* 2. Если выбрано АВТО — показываем иконку системной темы */
.theme-icon-btn[data-active-theme="auto"][data-system-pref="light"] .sun-icon { display: block; }
.theme-icon-btn[data-active-theme="auto"][data-system-pref="dark"] .moon-icon { display: block; }

/* Бейдж буквы "А" для режима Авто */
.auto-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-family: var(--mono-font);
    font-size: 8px;
    font-weight: 600;
    display: none;
    pointer-events: none;
    color: var(--accent-color);
    line-height: 1;
    opacity: 0.8;
}

.theme-icon-btn:hover .auto-badge {
    color: white;
}

.theme-icon-btn[data-active-theme="auto"] .auto-badge {
    display: block;
}

.mobile-controls { display: none; }

.burger-menu { 
    display: none; 
    flex-direction: column; 
    gap: 5px; 
    background: transparent; 
    border: none; 
    cursor: pointer; 
    padding: 5px;
    z-index: 1100;
}

.burger-menu span { 
    display: block; 
    width: 22px; 
    height: 1.5px; 
    background-color: var(--text-color); 
    transition: var(--transition); 
}

@media (max-width: 768px) {
    nav { display: flex; justify-content: space-between; }
    header .nav-controls { display: none; } /* Прячем в основной шапке на мобилках */
    
    .nav-links .mobile-controls { 
        display: flex; 
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        margin-top: 2rem;
        padding-top: 2rem;
        border-top: 1px solid var(--border-color);
        width: 100%;
    }
    
    .mobile-controls .lang-switcher {
        font-size: 1.2rem;
    }
    
    .mobile-controls .theme-icon-btn {
        width: 48px;
        height: 48px;
    }
    
    .mobile-controls .theme-icon-btn svg {
        width: 22px;
        height: 22px;
    }

    .nav-links {
        position: fixed;
        top: 0; right: -100%;
        width: 100%; height: 100vh;
        background: var(--bg-color);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: var(--transition);
        z-index: 1050;
        justify-self: stretch;
    }
    
    .nav-links.active { right: 0; }
    .burger-menu { display: flex; }
    
    .nav-links a { font-size: 1.5rem; }
}

/* Stats Refinement */
.stat-num { font-size: 2.5rem; font-weight: 500; display: block; font-family: var(--mono-font); color: var(--accent-color); line-height: 1; letter-spacing: -0.05em; }
.stat-desc { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.25em; color: var(--muted-text); font-family: var(--mono-font); margin-top: 1rem; }

/* Section Header Refinement */
.section-header h2 { font-size: 2rem; font-weight: 300; margin: 0; letter-spacing: -0.03em; }
.section-subtitle { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.4em; color: var(--accent-color); font-family: var(--mono-font); opacity: 0.8; }


/* Hero */
.hero {
    min-height: 72vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 80px;
    text-align: center;
    contain: content;
}
.hero-content { max-width: 750px; padding: 0 2rem; position: relative; z-index: 1; }
.hero-kicker {
    display: inline-block;
    margin-bottom: 1.5rem;
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.28em;
}
.hero h1 { font-size: clamp(2.5rem, 7vw, 4rem); font-weight: 200; margin-bottom: 2rem; letter-spacing: -0.05em; line-height: 1.1; }
.hero p { font-size: 1.15rem; color: var(--muted-text); font-weight: 300; max-width: 550px; margin: 0 auto; line-height: 1.7; }
.hero-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}
.primary-btn {
    display: inline-block;
    padding: 1rem 2rem;
    border: 1px solid var(--accent-color);
    color: white;
    background: var(--accent-color);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-radius: 4px;
    transition: var(--transition);
    font-family: var(--mono-font);
    box-shadow: 0 14px 30px var(--accent-light);
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 36px var(--accent-light); }
.hero-stack {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 2.5rem auto 0;
    max-width: 680px;
}
.hero-stack span,
.slide-tags span {
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.4);
    color: var(--muted-text);
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    font-family: var(--mono-font);
    font-size: 0.65rem;
    line-height: 1;
}
body.dark-theme .hero-stack span { background: rgba(15, 23, 42, 0.6); }

/* Stats */
.stats { padding: 4rem 2rem; border-bottom: 1px solid var(--border-color); }
.stats-container { max-width: 1100px; margin: 0 auto; display: flex; justify-content: center; gap: 7rem; flex-wrap: wrap; }
.stat-item { text-align: center; display: flex; flex-direction: column; align-items: center; }
.stat-num { font-size: 2.2rem; font-weight: 500; display: block; font-family: var(--mono-font); color: var(--accent-color); line-height: 1; }
.stat-desc { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--muted-text); font-family: var(--mono-font); margin-top: 0.75rem; text-align: center; width: 100%; }

/* Sections */
.section-header { display: flex; align-items: baseline; gap: 1.5rem; margin-bottom: 5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border-color); }
.section-header h2 { font-size: 1.8rem; font-weight: 400; margin: 0; letter-spacing: -0.02em; }
.section-subtitle { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.3em; color: var(--muted-text); font-family: var(--mono-font); }

/* Projects Slider */
.projects { padding: 5rem 2rem; max-width: 1100px; margin: 0 auto; }
.all-projects-link { margin-left: auto; font-size: 0.75rem; text-transform: uppercase; color: var(--accent-color); text-decoration: none; font-family: var(--mono-font); padding-bottom: 4px; border-bottom: 1.5px solid transparent; transition: var(--transition); }
.all-projects-link:hover { border-bottom-color: var(--accent-color); padding-right: 8px; }

.slider-container { position: relative; overflow: hidden; border-radius: var(--card-radius); background: var(--card-bg); border: 1px solid var(--border-color); box-shadow: var(--shadow-md); }
.slider { display: flex; transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.slide { min-width: 100%; cursor: pointer; position: relative; text-decoration: none; color: inherit; display: block; }
.slide-image { aspect-ratio: 21 / 9; overflow: hidden; background-color: var(--hero-bg); }
.slide-image img { 
    width: 100%; height: 100%; object-fit: cover; 
    transition: var(--transition); 
    transform: scale(1); 
    opacity: 0.9; 
    filter: blur(0);
}
.slide:hover img { transform: scale(1.03); opacity: 1; }

.slide-overlay { 
    position: absolute; inset: 0; padding: 3rem 4rem; 
    display: flex; flex-direction: column; justify-content: flex-end; 
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 70%); 
    color: white; transition: var(--transition); 
}
.slide-overlay h3 { font-size: 1.6rem; font-weight: 300; margin-bottom: 0.5rem; transition: var(--transition); }
.slide-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.slide-tags span {
    border-color: rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.86);
}
.slide-overlay strong {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.82);
    font-family: var(--mono-font);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}
.slide-overlay p { font-size: 0.85rem; opacity: 0; font-family: var(--mono-font); transform: translateY(15px); transition: var(--transition); }
.slide:hover .slide-overlay p { opacity: 0.8; transform: translateY(0); }

.prev, .next { 
    position: absolute; top: 50%; transform: translateY(-50%); 
    background: rgba(0,0,0,0.3); backdrop-filter: blur(8px); 
    border: 1px solid rgba(255,255,255,0.1); color: white; 
    width: 48px; height: 48px; border-radius: 50%; 
    cursor: pointer; z-index: 10; display: flex; align-items: center; justify-content: center; 
    transition: var(--transition); 
}
.prev:hover, .next:hover { background: var(--accent-color); border-color: var(--accent-color); transform: translateY(-50%) scale(1.1); }
.prev { left: 25px; }
.next { right: 25px; }

/* Expertise Cards */
.services, .process { padding: 5rem 2rem; max-width: 1100px; margin: 0 auto; width: 100%; }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 3rem; }
.service-card { padding: 3rem; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--card-radius); transition: var(--transition); position: relative; }
.service-card:hover { border-color: var(--accent-color); transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.service-card h3 { font-size: 1.2rem; margin-bottom: 1.5rem; font-family: var(--mono-font); text-transform: lowercase; color: var(--accent-color); }
.service-card h3::before { content: "class "; font-weight: 400; opacity: 0.5; }
.service-card p { font-size: 1rem; color: var(--muted-text); font-weight: 300; line-height: 1.8; }
.section-lead {
    max-width: 420px;
    margin-left: auto;
    color: var(--muted-text);
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.7;
}

/* About / Approach */
.about { padding: 5rem 2rem; background-color: var(--hero-bg); border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); position: relative; }
.about-container { 
    max-width: 1100px; 
    margin: 0 auto; 
    display: grid; 
    grid-template-columns: 350px 1fr; 
    align-items: center; 
    gap: 8rem; 
}
.about-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}
.abstract-shape { 
    width: 250px; height: 250px; background: linear-gradient(135deg, var(--accent-color), #2563eb); 
    border-radius: 50%; opacity: 0.28; 
    filter: drop-shadow(0 0 20px var(--accent-light));
    animation: morph 12s ease-in-out infinite; 
}
.expert-card {
    width: 280px;
    min-height: 280px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    background: var(--card-bg);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-align: left;
    position: relative;
    overflow: hidden;
}
.expert-card::before {
    content: "";
    position: absolute;
    width: 190px;
    height: 190px;
    top: -70px;
    right: -60px;
    border-radius: 50%;
    background: var(--accent-light);
}
.expert-card span {
    font-family: var(--mono-font);
    font-size: 0.65rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-bottom: 1rem;
    position: relative;
}
.expert-card strong {
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    position: relative;
}
.expert-card p {
    color: var(--muted-text);
    font-weight: 300;
    line-height: 1.7;
    position: relative;
}
@keyframes morph { 
    0%, 100% { border-radius: 50%; transform: rotate(0deg) scale(1); } 
    20% { border-radius: 42% 58% 45% 55% / 55% 45% 58% 42%; transform: rotate(35deg) scale(1.08); }
    40% { border-radius: 58% 42% 55% 45% / 42% 58% 45% 55%; transform: rotate(-15deg) scale(1.03); }
    60% { border-radius: 45% 55% 42% 58% / 58% 42% 55% 45%; transform: rotate(75deg) scale(1.12); }
    80% { border-radius: 55% 45% 58% 42% / 45% 55% 42% 58%; transform: rotate(120deg) scale(0.96); }
}
.approach-list { list-style: none; display: flex; flex-direction: column; gap: 2.5rem; counter-reset: item; }
.approach-list li { 
    font-size: 1.05rem; 
    color: var(--text-color); 
    display: flex;
    align-items: center;
    gap: 2.5rem;
    font-weight: 300; 
}
.approach-list li::before { 
    content: "0" counter(item); counter-increment: item; 
    color: var(--accent-color); 
    font-family: var(--mono-font); font-weight: 600; font-size: 0.75rem; 
    opacity: 0.6; 
    flex-shrink: 0;
}

/* Contact */
.contact { padding: 5rem 2rem; text-align: center; width: 100%; position: relative; }
.contact h2, .contact p, .contact .contact-actions { max-width: 1100px; margin-left: auto; margin-right: auto; position: relative; z-index: 2; }
.contact h2 { font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 200; letter-spacing: -0.05em; line-height: 1.1; margin-bottom: 1.5rem; }
.contact p { max-width: 660px; font-size: 1.05rem; color: var(--muted-text); margin-bottom: 3rem; font-family: var(--main-font); font-weight: 300; line-height: 1.8; }
.contact-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.ghost-btn { 
    display: inline-block; padding: 1rem 3rem; 
    border: 1px solid var(--accent-color); color: var(--accent-color); 
    text-decoration: none; font-size: 0.75rem; font-weight: 500; 
    text-transform: uppercase; letter-spacing: 0.15em; border-radius: 4px; 
    transition: var(--transition); font-family: var(--mono-font); 
    background: transparent; 
}
.ghost-btn:hover { background-color: var(--accent-color); color: white; box-shadow: 0 10px 25px var(--accent-light); }

/* Process */
.process { border-top: 1px solid var(--border-color); }
.process-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    overflow: hidden;
}
.process-step {
    background: var(--card-bg);
    padding: 2rem;
    min-height: 260px;
}
.process-step span {
    display: block;
    color: var(--accent-color);
    font-family: var(--mono-font);
    font-size: 0.7rem;
    margin-bottom: 3rem;
    opacity: 0.8;
}
.process-step h3 {
    font-size: 1rem;
    font-family: var(--mono-font);
    color: var(--text-color);
    margin-bottom: 1rem;
}
.process-step p {
    color: var(--muted-text);
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.75;
}

/* Footer */
footer { padding: 4rem 2rem; border-top: 1px solid var(--border-color); text-align: center; background: var(--header-bg); }
.footer-text { font-size: 0.75rem; color: var(--muted-text); font-family: var(--mono-font); opacity: 0.7; }

/* Layout Stability Refinement */
main { 
    min-height: calc(100vh - 80px - 100px); /* Высота экрана минус хедер и футер */
    display: flex;
    flex-direction: column;
}

.hero, .projects-page, .project-detail {
    contain: content; /* Изолирует рендеринг, предотвращая влияние на фон */
}

/* All Projects Page */
.projects-page { padding-top: 0; }
.projects-grid-section { padding: 5rem 2rem; max-width: 1100px; margin: 0 auto; }
.all-projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4rem; }
.project-card { 
    border-radius: var(--card-radius); overflow: hidden; 
    background: var(--card-bg); border: 1px solid var(--border-color); 
    transition: var(--transition); text-decoration: none; color: inherit; display: block; box-shadow: var(--shadow-sm);
    position: relative;
}
.project-card:hover { transform: translateY(-10px); border-color: var(--accent-color); box-shadow: var(--shadow-lg); background: var(--bg-color); }
.project-card img { 
    width: 100%; aspect-ratio: 16/10; object-fit: cover; 
    transition: var(--transition); 
    filter: blur(0);
}
.project-card:hover img { opacity: 0.8; transform: scale(1.02); }
.project-card-info { padding: 2.5rem; }
.project-card-info h3 { font-size: 1.3rem; margin-bottom: 0.75rem; font-weight: 400; }
.project-card-info p { font-size: 0.8rem; color: var(--muted-text); margin-bottom: 2rem; font-family: var(--mono-font); }
.text-link { font-size: 0.75rem; color: var(--accent-color); text-transform: uppercase; letter-spacing: 0.15em; font-weight: 600; font-family: var(--mono-font); }

/* Breadcrumbs - Engineering Style */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--mono-font);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 2rem;
}

.breadcrumbs a {
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
    opacity: 0.5;
}

.breadcrumbs a:hover { color: var(--accent-color); opacity: 1; }
.breadcrumbs .sep { opacity: 0.3; font-weight: 400; }
.breadcrumbs .current { opacity: 1; color: var(--accent-color); font-weight: 500; }

/* Project Detail Refinement */
.project-detail { padding-top: 0; }
.project-hero { 
    padding: 8rem 2rem 4rem; 
    text-align: left; 
    width: 100%;
}

.project-hero .breadcrumbs {
    justify-content: flex-start;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
}

.project-hero .project-header, 
.project-hero .project-main-image {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.project-header { margin-bottom: 3.5rem; }
.project-header h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 200; margin-top: 0.8rem; letter-spacing: -0.03em; line-height: 1.1; }

.project-category { font-family: var(--mono-font); font-size: 0.65rem; color: var(--accent-color); font-weight: 500; text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 0.5rem; display: block; opacity: 0.9; }

.project-main-image { 
    border-radius: var(--card-radius); 
    overflow: hidden; 
    box-shadow: var(--shadow-md);
    background-color: var(--card-bg);
    aspect-ratio: 21 / 9;
}
.project-main-image img { width: 100%; height: 100%; display: block; object-fit: cover; }

.meta-item span { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.15rem; color: var(--accent-color); font-family: var(--mono-font); opacity: 0.6; display: block; margin-bottom: 0.6rem; }
.meta-item p { font-size: 0.95rem; margin-top: 0; font-weight: 400; font-family: var(--main-font); line-height: 1.4; }

/* Service Cards Refinement */
.service-card h3 { font-size: 1.1rem; margin-bottom: 1.25rem; font-family: var(--mono-font); text-transform: lowercase; color: var(--accent-color); }
.service-card h3::before { content: "func "; font-weight: 400; opacity: 0.4; font-size: 0.8em; }
.service-card h3::after { content: "()"; opacity: 0.4; }


.project-description {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 6rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 6rem 2rem;
    align-items: start;
}
.project-meta-grid { 
    display: flex; 
    flex-direction: column; 
    gap: 2.5rem; 
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--card-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 120px;
}

.project-text h3 { font-size: 2rem; font-weight: 300; margin-bottom: 3rem; letter-spacing: -0.03em; }
.project-text p { font-size: 1.15rem; color: var(--muted-text); line-height: 1.8; margin-bottom: 2rem; font-weight: 300; }

@media (max-width: 1024px) {
    .project-description { grid-template-columns: 1fr; gap: 4rem; padding: 4rem 2rem; }
    .project-meta-grid { 
        position: static; 
        padding: 0; 
        border-right: none;
        border-bottom: 1px solid var(--border-color); 
        padding-bottom: 4rem; 
    }
    .about-container { grid-template-columns: 1fr; text-align: center; gap: 5rem; }
    .about-visual { display: flex; justify-content: center; }
    .process-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .stats-container { gap: 3rem; justify-content: space-around; }
    .stat-num { font-size: 1.8rem; }

    .projects, .services, .process, .about, .contact { padding: 4rem 1.25rem; }
    .section-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; margin-bottom: 2.5rem; }
    .section-lead { margin-left: 0; }
    .hero-actions, .contact-actions { align-items: stretch; }
    .hero-actions a, .contact-actions a { width: 100%; text-align: center; }
    .hero-stack { justify-content: flex-start; }

    .slide-image { aspect-ratio: 16 / 10; }
    .slide-overlay { padding: 2rem; }
    .slide-overlay h3 { font-size: 1.2rem; }
    .slide-tags { display: none; }
    .prev, .next { width: 36px; height: 36px; }
    .prev { left: 10px; }
    .next { right: 10px; }

    .services-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .service-card { padding: 2rem; }
    .process-grid { grid-template-columns: 1fr; }
    .process-step { min-height: auto; }
    .process-step span { margin-bottom: 2rem; }

    .about-container { gap: 3rem; }
    .abstract-shape { width: 180px; height: 180px; }

    .approach-list li {
        padding-left: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .approach-list li::before {
        position: static;
        margin-bottom: 0.75rem;
        display: block;
    }

    .all-projects-grid { grid-template-columns: 1fr; gap: 2rem; }
    .projects-grid-section { padding: 4rem 1.25rem; }

    .project-hero h1 { font-size: 2.8rem; }
    .project-hero { padding-top: 6rem; }
    .project-header { margin-bottom: 2.5rem; }
}

@media (max-width: 480px) {
    .stats-container { flex-direction: column; gap: 2rem; }
    .hero h1 { font-size: 2.5rem; }
    .hero-content { padding: 0 1.25rem; text-align: left; }
    .hero-actions { justify-content: stretch; }
    .hero-stack span { font-size: 0.6rem; }
}
