:root {
    --color-brand: #842b16;
    --color-brand-dark: #5e1e0f;
    --color-text: #1f2937;
    --color-text-light: #6b7280;
    --color-bg: #F6F1E9;
    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Навигация */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 70px;
    display: flex;
    align-items: center;
    z-index: 1000;
    transition: var(--transition);
    padding: 0 5%;
    background: transparent;
    backdrop-filter: none;
    border-bottom: none;
}

.nav-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #000;
}

.logo span {
    color: var(--color-brand);
}

.logo img {
    height: 36px;
    width: auto;
    display: block;
    filter: brightness(0) saturate(100%) invert(16%) sepia(50%) saturate(1450%) hue-rotate(345deg) brightness(96%) contrast(92%);
}

.nav-links {
    display: none;
    gap: 2.5rem;
    align-items: center;
}

@media (min-width: 768px) {
    .nav-links { display: flex; }
}

.nav-links a {
    text-decoration: none;
    color: var(--color-text);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--color-brand);
    color: white !important;
    padding: 10px 24px;
    border-radius: 0; /* Убрано скругление */
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: var(--color-brand-dark);
}

/* Hero Grid - Высота во весь экран */
.hero-section {
    height: calc(100vh - 70px - 220px);
    width: 100%;
    padding: 70px 0 0 0; /* Отступ под нави */
    display: flex;
    flex-direction: column;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 1fr 220px; /* Больше высота первого ряда */
    gap: 16px; /* Более широкий зазор между картинками */
    height: 100%;
    width: 100%;
    background-color: #fff;
}

@media (max-width: 768px) {
    .hero-grid {
        grid-template-rows: 1fr 1fr 1fr 1fr;
        display: flex;
        flex-direction: column;
        height: auto;
    }
    .hero-section { height: auto; }
}

.grid-item {
    position: relative;
    overflow: hidden;
    background-color: #111;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
}

/* убрали приближение на ховер */

.item-main {
    grid-column: 1 / span 4;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 20px;
}

.hero-content h1 {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 6vh, 4.5rem);
    line-height: 1;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.hero-content p {
    font-size: 1rem;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 300;
    opacity: 0.9;
}

.item-sub {
    cursor: pointer;
}

.sub-caption {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 2;
    color: white;
}

.sub-caption h3 {
    font-family: var(--font-serif);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Портфолио */
.portfolio {
    padding: 100px 5%;
    background: #fff;
}

.section-header {
    max-width: 1400px;
    margin: 0 auto 60px;
}

.section-header h2 {
    font-family: var(--font-serif);
    font-size: 3rem;
    text-transform: uppercase;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 16px;
    max-width: 1600px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .gallery-container { grid-template-columns: 1fr; }
}

.project-card {
    height: 500px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* убрали приближение на ховер */

.project-info {
    position: absolute;
    inset: 0;
    background: rgba(132, 43, 22, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    opacity: 1;
    padding: 40px;
    text-align: center;
}

/* текст всегда поверх */

/* Модалка */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
}

.modal-body {
    position: relative;
    background: white;
    width: 100%;
    max-width: 900px;
    display: grid;
    grid-template-columns: 1fr;
    z-index: 2;
}

@media (min-width: 768px) {
    .modal-body { grid-template-columns: 1fr 1fr; }
}

.modal-form {
    padding: 60px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 15px 0;
    border: none;
    border-bottom: 1px solid #ddd;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-bottom-color: var(--color-brand);
}

.close-modal {
    position: absolute;
    top: 30px;
    right: 30px;
    background: none;
    border: none;
    cursor: pointer;
    color: #000;
}

footer {
    background: #000;
    color: white;
    padding: 60px 5%;
}

.footer-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 60px;
}

.footer-logo {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin-bottom: 20px;
    display: block;
    color: white;
    text-decoration: none;
}
