/* --- ШРИФТЫ И БАЗОВЫЕ НАСТРОЙКИ --- */
:root {
    --text-color: #24221f;
    --bg-color: #ffffff;
}

@font-face {
    font-family: "Formular Neutral";
    src: url("fonts/FormularNeutral.woff2") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: "Formular Neutral", system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.45;
    font-size: 18px; 
    overflow-x: hidden;
}

@media (min-width: 1400px) { body { font-size: 19px; } }
@media (min-width: 1600px) { body { font-size: 21px; } }

/* --- ГЛОБАЛЬНЫЕ ССЫЛКИ --- */
a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.26em;
}

/* Толстое подчеркивание для ссылок в заголовках */
h2 a {
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.24em;
}


/* --- СЕТКА И КОНТЕЙНЕРЫ --- */
.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 50px 60px;
    transition: padding 0.3s ease;
}


.container-wide {
    width: 100%;
    max-width: 1900px;
}

.container {
    width: 100%;
    max-width: 1280px; 
}

/* --- АНИМАЦИИ --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

.delay-1 { animation-delay: 0.1s; } 
.delay-2 { animation-delay: 0.2s; } 
.delay-3 { animation-delay: 0.3s; } 
.delay-4 { animation-delay: 0.4s; } 

/* --- ХЕДЕР И HERO --- */
.header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 0;
}

.col-name { flex: 0 0 10%; min-width: 130px; line-height: 1.45; }
.col-contacts { flex: 0 0 17%; min-width: 200px; line-height: 1.45; }
.col-language { flex: 0 0 20%; padding-left: 20px; }
.col-hero { flex: 1; }
.email-link, .email-br { display: inline; }

.arrow {
  display: inline;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.85em;
  font-weight: 500;
  vertical-align: -0.05em; 
}

h1, h2 {
    font-size: 28px;
    font-weight: 400;
    letter-spacing: -0.03em;
    line-height: 1.3;
    font-feature-settings: "liga" 1;
}

h1 {
    max-width: 830px;
    margin: 0 auto;
}

/* --- РАЗДЕЛИТЕЛЬ С SVG --- */
.divider {
    display: flex;
    justify-content: center;
    margin-top: 60px;
    margin-bottom: 100px;
    width: 100%;
}

.svg-desktop { display: block; width: 100%; max-width: 100%; height: auto; }
.svg-mobile { display: none; }

/* --- ПРОЦЕСС (3 ШАГА) --- */
.process {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 150px;
}

.process-step { border-top: 2px solid var(--text-color); padding-top: 15px; }

/* --- ПРОЕКТЫ (КЕЙСЫ) --- */
.projects {
    display: flex;
    flex-direction: column;
    gap: 150px;
    align-items: center;
    margin-bottom: 150px;
}

.project { width: 100%; }
a.project-image-link { border-bottom: none; display: block; }

.project-image {
    display: grid; 
    border-radius: 8px;
    margin-bottom: 44px; 
    background: transparent; 
}

.project-image img {
    grid-area: 1 / 1;
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    transition: opacity 0.8s ease-in-out; 
    will-change: opacity; 
    transform: translateZ(0); 
}

.img-hover {
    opacity: 0;
}

/* Десктопный ховер */
@media (min-width: 951px) {
    body:not(.is-safari) .img-hover {
        filter: drop-shadow(3px 3px 3px rgba(0, 0, 0, 0.06)) 
                drop-shadow(8px 8px 8px rgba(0, 0, 0, 0.05)) 
                drop-shadow(15px 15px 15px rgba(0, 0, 0, 0.05));
    }

    .project:hover .img-hover { opacity: 1; }
    .project:hover .img-base { opacity: 0; }
}

@media (min-width: 901px) {
    .col-hero a { display: none; }
}

/* Мобильный ховер */
@media (max-width: 950px) {
    .project.is-active .img-hover { opacity: 1; }
    .project.is-active .img-base { opacity: 0; }
}

.project-text { display: flex; align-items: flex-start; }
.project-left { width: 50%; padding-right: 32px; }
.project-right { width: 50%; padding-top: 12px; }
.project h2 { margin-bottom: 16px; }
.project p { margin-bottom: 20px; }
.project-left p { margin-bottom: 0; }


/* --- ЗАГОЛОВОК САЙД-КВЕСТОВ (Внутри секции проектов) --- */
.side-quests-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.side-quests-icon {
    display: block;
    width: 64px; 
    height: auto;
    transition: width 0.3s ease;
}

/* Исправлен селектор с h1 на h2 */
h2.side-quests-title {
    margin: 0;
    max-width: none;
    text-align: right;
}


/* --- ФУТЕР --- */
.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-top: 2px solid var(--text-color);
    padding-top: 35px;
}

.footer-left { flex: 1; }
.footer-center { flex: 2; display: flex; justify-content: center; }
.footer-center img { width: 250px; height: auto; }

.footer-right { flex: 1; display: flex; justify-content: flex-end; }
.footer-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
    line-height: 1.45;
    gap: 0px;
}


.footer-links a,
.col-contacts .cv-link {
    border-bottom: none; 
    text-decoration: underline; 
    text-decoration-thickness: 1.5px; 
    text-underline-offset: 0.26em; /* Увеличили отступ, чтобы он визуально совпал с border-bottom обычных ссылок */
}


.footer-bio {
    max-width: 700px;
    margin: 80px auto;
}
.footer-bio p { margin-bottom: 28px; }

/* --- АДАПТИВНОСТЬ И МАСШТАБИРОВАНИЕ ЗАГОЛОВКОВ --- */

@media (min-width: 1400px) { 
    h1, h2 { font-size: 36px; line-height: 1.35; }
    .side-quests-icon { width: 82px; } 
}

@media (min-width: 1600px) { 
    h1, h2 { font-size: 44px; letter-spacing: -0.05em; line-height: 1.3; }
    .side-quests-icon { width: 100px; } 
}

@media (max-width: 1399px) {
    .footer-bio { max-width: 600px; }
    .project-right { padding-top: 7px; }
}

@media (max-width: 1080px) {
    .col-spacer { flex: 0 0 10%; }
}

@media (max-width: 900px) {
    .page-wrapper { padding: 24px 32px; }
    
    .header { flex-direction: row; margin-bottom: 0; align-items: flex-start; } 
    
    .col-name { order: 1; flex: 0 0 auto; min-width: 0; line-height: 1.3; }
    .col-language { order: 2; flex: 1; padding-left: 0; padding-right: 24px; text-align: right; line-height: 1.3; }
    .col-contacts { order: 3; flex: 0 0 auto; min-width: 0; text-align: right; line-height: 1.3; }
    
    .divider { order: 4; margin-top: 40px; margin-bottom: 40px; }
    
    .col-spacer { display: none; }
    .email-link, .email-br { display: none; } 
    .col-hero { order: 5; flex: 0 0 100%; margin-top: 0; margin-bottom: 80px; }
    
    h1 { font-size: 24px; max-width: 550px; }
    .side-quests-icon { width: 54px; } 

    /* Делаем заголовок сайд-квестов на мобильных таким же, как h1 */
    h2 { font-size: 18px; letter-spacing: 0; line-height: 1.45;}
    h2.side-quests-title { font-size: 24px; letter-spacing: -0.03em; line-height: 1.3; }

    .svg-desktop { 
        display: block; 
        width: 118%; 
        max-width: none; 
        flex-shrink: 0; 
        height: auto;
        position: relative;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .process { display: none; }
    
    .projects { gap: 40px; margin-bottom: 40px; max-width: 550px; }
    .project-image { border-radius: 3px; margin-bottom: 16px; }
    .project-image img { border-radius: 3px; }
    .project-text { flex-direction: column; }
    .project-left, .project-right { width: 100%; padding-right: 0; }
    .project-right { display: none; }

    .project a { text-decoration: none; }
    
    .desktop-only { display: none; }

    .side-quests-header { margin-bottom: 32px; }

    .footer-grid { flex-direction: column; align-items: center; text-align: center; border-top: none; gap: 4px; }
    .footer-left { display: none; }
    .footer-center img { width: 180px; padding-bottom: 8px; }
    .footer-right { display: none; }
    .footer-links { align-items: center; }
    .footer-center { order: -1; }
    .footer-bio { margin-top: 40px; }
}

@media (max-width: 700px) {
    .page-wrapper { padding: 16px; }
    .svg-desktop { display: none; }
    .svg-mobile { 
        display: block; 
        width: 120%; 
        max-width: none; 
        flex-shrink: 0; 
        height: auto;
        position: relative;
        left: 50%;
        transform: translateX(-46%);
    }
}