/* =========================================
   БАЗОВЫЕ СТИЛИ (Общие для всех страниц)
   ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-y: scroll !important; }
body { background-color: #ffffff; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: #111111; line-height: 1.6; user-select: none; }
img { pointer-events: none; max-width: 100%; max-height: 100%; display: block; margin: 0 auto; -webkit-user-drag: none; object-fit: contain; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Навигация */
.navbar { width: 100%; background-color: #ffffff; border-bottom: 1px solid #f2f2f2; position: sticky; top: 0; z-index: 100; }
.nav-container { max-width: 850px; margin: 0 auto; display: flex; justify-content: space-between; }
.nav-link { flex: 1; text-align: center; padding: 12px 10px; text-decoration: none; color: #8c8c8c; font-size: 13px; font-weight: 400; letter-spacing: 0.5px; transition: color 0.2s ease; }
.nav-link:hover { color: #111111; }
.nav-link.active { color: #111111; font-weight: 400; background-color: transparent; }

/* Основной контент */
.main-content { max-width: 850px; margin: 0 auto; padding: 50px 30px; }

/* Подвал */
.minimal-footer { 
    border-top: 1px solid #f2f2f2; 
    padding: 20px 0; 
    text-align: center; 
    font-size: 11px; 
    color: #444444; 
    margin-top: 15px; 
    letter-spacing: 2px; 
    text-transform: uppercase; 
}

/* =========================================
   СТРАНИЦА СЕТКИ ПОРТФОЛИО (Contact Sheets)
   ========================================= */
.view-toggle-container { text-align: left; margin-bottom: 50px; border-bottom: 1px solid #f5f5f5; padding-bottom: 25px; }
.btn-toggle-view { display: inline-block; font-size: 12.5px; font-weight: 400; color: #8c8c8c; text-decoration: none; padding: 8px 24px; border: 1px solid #e5e5e7; border-radius: 20px; background-color: #ffffff; letter-spacing: 0.3px; transition: all 0.2s ease; }
.btn-toggle-view:hover { border-color: #111111; color: #111111; }

.portfolio-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 60px 80px; margin-bottom: 60px; }
.project-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform 0.25s ease; }

.preview-wrapper { 
    width: 100%; 
    height: 180px; 
    background-color: #ffffff; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    overflow: hidden; 
    border: 1px solid #f5f5f5; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.02); 
    padding: 10px;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.project-card:hover { transform: translateY(-3px); }
.project-card:hover .preview-wrapper { box-shadow: 0 10px 25px rgba(0,0,0,0.06); border-color: #e5e5e7; }

.project-meta { margin-top: 20px; text-align: left; line-height: 1.4; padding-left: 2px; }
.project-name-en { font-size: 15px; font-weight: 400; color: #111111; letter-spacing: 0.2px; transition: color 0.2s ease; }
.project-card:hover .project-name-en { color: #cc6633; }
.project-name-ru { font-size: 13px; font-weight: 400; color: #666666; margin-top: 4px; font-style: italic; }
.project-year { font-size: 11.5px; font-weight: normal; color: #cc6633; font-family: monospace; margin-top: 6px; letter-spacing: 0.5px; }

/* =========================================
   СТРАНИЦА СПИСКА ПРОЕКТОВ (projects.htm)
   ========================================= */
.sheets-box { width: 100%; margin-bottom: 35px; font-size: 13px; height: 20px; display: block; }
.sheets-link { color: #555555; text-decoration: none; border-bottom: 1px solid #e0e0e0; transition: color 0.2s, border-bottom-color 0.2s; font-weight: 400; }
.sheets-link:hover { color: #111111; border-bottom-color: #111111; }

.project-list-block { margin-top: 20px; font-size: 14px; }
.project_list_item { margin-bottom: 28px; display: flex; flex-direction: column; gap: 2px; transition: transform 0.15s ease; }
.project_list_item:hover { transform: translateX(4px); }

.project-title-en { font-size: 17px; color: #111111; font-weight: 400; letter-spacing: 0.2px; text-decoration: none; transition: color 0.2s; display: inline-block; }
.project-title-en:hover { color: #555555; }
.project-title-en span { font-size: 13px; color: #999999; font-family: inherit; margin-left: 6px; }
.project-title-en .project-marker { font-size: 11.5px; color: #b0b0b0; font-family: -apple-system, sans-serif; margin-left: 10px; letter-spacing: 0px; }

.project-title-ru { font-size: 15px; color: #555555; }
.project-title-ru span { color: #999999; font-size: 11px; margin-left: 3px; }

.hover-preview-box { 
    position: fixed; pointer-events: none; width: auto; height: auto; max-width: 320px; max-height: 400px;
    object-fit: contain; z-index: 9999; display: none; opacity: 0;
    border: 1px solid #e0e0e0; background-color: #ffffff; padding: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15); left: 0; top: 0;
    transition: opacity 0.2s ease-in-out;
}
.hover-preview-box.is-visible { display: block; opacity: 1; }

/* =========================================
   СТРАНИЦА РЕЗЮМЕ (cv.htm)
   ========================================= */
.bio-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 40px; width: 100%; border-bottom: 1px solid #f5f5f5; padding-bottom: 8px; }
h1.bio-title-main { font-size: 11.5px; font-weight: bold; color: #cc6633; text-transform: uppercase; letter-spacing: 1px; width: 300px; flex-shrink: 0; margin: 0; }

.lang-switcher { font-size: 11.5px; color: #aaaaaa; text-align: right; flex-grow: 1; }
.lang-link { color: #8c8c8c; text-decoration: none; font-weight: normal; cursor: pointer; transition: color 0.2s; }
.lang-link:hover { color: #111111; }
.lang-link.active { color: #111111; font-weight: normal; }

.lang-block { display: none; }
.lang-block.active { display: block; }

.cv-section { margin-bottom: 45px; text-align: justify; }
h2.cv-section-title { font-size: 11.5px; font-weight: bold; color: #cc6633; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 20px; border-bottom: 1px solid #f5f5f5; padding-bottom: 5px; width: 100%; }

.bio-essay-paragraph { font-size: 14.5px; line-height: 1.65; color: #222222; margin-bottom: 16px; text-align: justify; }
.cv-list { width: 100%; margin-bottom: 40px; }
.cv-item { display: flex; margin-bottom: 14px; font-size: 14px; align-items: flex-start; line-height: 1.5; }
.cv-year { font-family: monospace; font-size: 13px; color: #cc6633; width: 70px; flex-shrink: 0; }
.cv-text { color: #222222; text-align: justify; }

/* =========================================
   СТРАНИЦА КОНТАКТОВ (contacts.htm)
   ========================================= */
.contact-block { margin-top: 20px; font-size: 14px; }
.contact-item { margin-bottom: 28px; display: flex; flex-direction: column; gap: 4px; }
.contact-label { font-size: 11.5px; font-weight: bold; color: #cc6633; text-transform: uppercase; letter-spacing: 1px; }
.contact-value { color: #222222; font-size: 15px; }
.email-link { color: #111111; text-decoration: none; border-bottom: 1px solid #e0e0e0; transition: color 0.2s, border-bottom-color 0.2s; display: inline-block; margin-right: 15px; }
.email-link:hover { color: #cc6633; border-bottom-color: #cc6633; }

/* =========================================
   СТРАНИЦА ПУБЛИКАЦИЙ (publications.htm)
   ========================================= */
.biblio-box { width: 100%; margin-bottom: 35px; font-size: 13px; }
.biblio-link { color: #555555; text-decoration: none; border-bottom: 1px solid #e0e0e0; transition: color 0.2s, border-bottom-color 0.2s; font-weight: 400; }
.biblio-link:hover { color: #111111; border-bottom-color: #111111; }

.pub-section-title { font-size: 11.5px; font-weight: bold; color: #cc6633; text-transform: uppercase; letter-spacing: 1px; margin-top: 40px; margin-bottom: 20px; border-bottom: 1px solid #f5f5f5; padding-bottom: 5px; }

.pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 25px; margin-bottom: 40px; }
.pub-card { background: #ffffff; border: 1px solid #f2f2f2; padding: 15px; display: flex; flex-direction: column; justify-content: space-between; transition: border-color 0.2s ease, transform 0.2s ease; }
.pub-card:hover { border-color: #d0d0d0; transform: translateY(-2px); }

.pub-img-wrapper { width: 100%; height: 180px; display: flex; align-items: center; justify-content: center; background-color: #fafafa; margin-bottom: 12px; overflow: hidden; }
.pub-img-wrapper img { max-width: 100%; max-height: 100%; object-fit: contain; }

.pub-info { display: flex; flex-direction: column; gap: 4px; }
.pub-title-en { font-size: 14px; color: #111111; font-weight: 500; }
.pub-title-ru { font-size: 12.5px; color: #666666; line-height: 1.4; }
.pub-year { font-size: 11.5px; font-family: monospace; color: #cc6633; margin-top: 4px; }

/* =========================================
   МОБИЛЬНАЯ АДАПТАЦИЯ (Для всех страниц)
   ========================================= */
@media (max-width: 768px) { 
    .nav-container { flex-wrap: wrap; } 
    .nav-link { width: 50%; flex: none; padding: 12px 5px; } 
    .main-content { padding: 40px 20px; } 
    
    .portfolio-grid { grid-template-columns: 1fr; gap: 45px; } 
    .preview-wrapper { height: 210px; } 
    
    .hover-preview-box { display: none !important; } 
    .project_list_item:hover { transform: none; }

    .bio-header { flex-direction: column; gap: 10px; align-items: flex-start; } 
    .cv-item { flex-direction: column; } 
    .cv-year { margin-bottom: 2px; } 

    .pub-grid { grid-template-columns: 1fr; }
}