:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-blue: #2563eb;
    --border-color: #e2e8f0;
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-main); background-color: var(--bg-main); color: var(--text-primary); line-height: 1.5; font-size: 16px; }
a { color: inherit; text-decoration: none; }

/* UNIFIED HEADER */
.site-header {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(8px);
    color: #ffffff; padding: 1.1rem 5%;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.brand-logo { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; text-transform: uppercase; }
.brand-subtitle { font-size: 13px; color: #94a3b8; font-weight: 500; display: block; margin-top: 2px; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; font-size: 15px; font-weight: 600; }
.nav-links a:hover { color: #60a5fa; transition: color 0.2s; }

.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.65rem 1.25rem; border-radius: 6px; font-weight: 600; font-size: 15px;
    cursor: pointer; transition: all 0.2s ease; border: none; text-align: center;
}
.btn-primary { background-color: var(--accent-blue); color: #ffffff; }
.btn-primary:hover { background-color: #1d4ed8; }
.btn-outline { background: transparent; border: 1px solid #cbd5e1; color: var(--text-primary); }
.btn-outline:hover { background: #e2e8f0; }

/* TWO-COLUMN LAYOUT (INDEX) */
.main-layout {
    display: grid;
    grid-template-columns: 390px 1fr;
    gap: 2.5rem;
    max-width: 1440px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    align-items: start;
}

/* LEFT SIDEBAR */
.left-sidebar {
    position: sticky;
    top: 5.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.profile-name { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 0.5rem; }
.profile-role { font-size: 17px; color: var(--accent-blue); font-weight: 700; margin-bottom: 1.25rem; }
.profile-bio { font-size: 15px; color: var(--text-secondary); margin-bottom: 1.5rem; line-height: 1.6; }

.info-list { font-size: 15px; border-top: 1px solid var(--border-color); padding-top: 1.25rem; margin-bottom: 1.5rem; }
.info-item { margin-bottom: 0.65rem; color: var(--text-secondary); }
.info-item strong { color: var(--text-primary); }

.action-buttons { display: flex; flex-direction: column; gap: 0.75rem; }
.action-buttons .btn { justify-content: center; width: 100%; }

/* RIGHT CONTENT GRID */
.right-content-header { margin-bottom: 1.5rem; display: flex; justify-content: space-between; align-items: flex-end; }
.section-title { font-size: 24px; font-weight: 800; text-transform: uppercase; letter-spacing: -0.02em; }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.75rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}
.card-img-holder {
    height: 230px;
    background-color: #e2e8f0;
    position: relative;
    overflow: hidden;
}
.card-img-holder img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.project-card:hover .card-img-holder img { transform: scale(1.03); }

.card-content { padding: 1.25rem; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }
.card-location { font-size: 13px; font-weight: 700; color: var(--accent-blue); text-transform: uppercase; margin-bottom: 0.3rem; }
.card-title { font-size: 19px; font-weight: 700; line-height: 1.3; margin-bottom: 0.5rem; }
.card-desc { font-size: 15px; color: var(--text-secondary); line-height: 1.45; }

/* INNER CASE STUDY PAGE */
.case-container { max-width: 1440px; margin: 0 auto; padding: 3rem 1.5rem; }
.project-badge {
    display: inline-block; padding: 5px 13px; background: #dcfce7; color: #15803d;
    font-weight: 700; font-size: 13px; text-transform: uppercase; border-radius: 4px; margin-bottom: 0.75rem;
}
.project-title { font-size: 41px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 0.5rem; }
.project-subtitle { font-size: 28px; color: var(--text-secondary); font-weight: 600; margin-bottom: 2rem; }

.project-meta-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem;
    background: #ffffff; border: 1px solid var(--border-color);
    padding: 1.5rem; border-radius: 8px; margin-bottom: 3rem;
}
.meta-label { font-size: 13px; text-transform: uppercase; color: var(--text-secondary); font-weight: 700; display: block; margin-bottom: 3px; }
.meta-val { font-size: 16px; font-weight: 600; color: var(--text-primary); }

.case-section { margin-bottom: 3.5rem; }
.section-num { font-size: 15px; font-weight: 800; color: var(--accent-blue); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem; }
.section-heading { font-size: 25px; font-weight: 700; margin-bottom: 0.75rem; }
.section-text { font-size: 17px; color: var(--text-secondary); margin-bottom: 4.2rem; line-height: 1.7; }

/* ==========================================================
   ИСПРАВЛЕНИЕ ПРОПОРЦИЙ ИЗОБРАЖЕНИЙ (БЕЗ ОБРЕЗАНИЯ)
   ========================================================== */

/* Одиночные блоки изображений */
.img-block {
    width: 100%;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.img-block img {
    width: 100%;
    height: auto; /* Сохраняет оригинальные пропорции каждого рендера */
    display: block;
}

.img-caption { font-size: 14px; color: var(--text-secondary); font-style: italic; margin-bottom: 2rem; }

/* FOOTER */
.site-footer {
    background: #0f172a; color: #94a3b8; padding: 2.5rem 5%;
    font-size: 15px; margin-top: 4rem; border-top: 1px solid rgba(255,255,255,0.1);
}
.footer-flex { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }

@media (max-width: 992px) {
    .main-layout { grid-template-columns: 1fr; }
    .left-sidebar { position: static; }
    .site-header { flex-direction: column; gap: 1rem; align-items: flex-start; }
}
/* Сетка из 4 изображений (2х2) */
.img-grid-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 0.5rem;
    align-items: start; /* Предотвращает растягивание карточек по высоте */
}

.grid-img-item {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    /* Убрано свойство aspect-ratio: 4 / 3, заставлявшее обрезать кадр */
}

.grid-img-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.grid-img-item img {
    width: 100%;
    height: auto; /* Картинка полностью подстраивается по ширине и сохраняет 100% кадра */
    display: block;
}

.grid-img-item .placeholder-text {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* LIGHTBOX OVERLAY */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: zoom-out;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 6px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    object-fit: contain;
}

.lightbox-caption {
    position: absolute;
    bottom: 2rem;
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    background: rgba(15, 23, 42, 0.75);
    padding: 0.6rem 1.5rem;
    border-radius: 20px;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    color: #ffffff;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

@media (max-width: 640px) {
    .img-grid-4 { grid-template-columns: 1fr; }
}