:root {
    --bg-color: #0f1115;
    --card-bg: #1a1d24;
    --text-main: #b0b3b8;
    --text-header: #e0e0e0;
    --accent-gold: #c5a059;
    --accent-glow: rgba(197, 160, 89, 0.2);
    --font-heading: 'Cinzel', serif;
    --font-body: 'Lato', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    /* Текстура шума */
    background-image: url("image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%%' height='100%%' filter='url(%%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 { font-family: var(--font-heading); color: var(--text-header); text-transform: uppercase; letter-spacing: 2px; }
a { text-decoration: none; color: var(--text-main); transition: 0.3s ease; }
a:hover { color: var(--accent-gold); }

/* Навигация */
nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.5rem 5%; position: fixed; width: 100%; top: 0; z-index: 1000;
    background: linear-gradient(to bottom, rgba(15,17,21,0.95), transparent);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(197, 160, 89, 0.1);
}

.logo { font-size: 1.5rem; font-weight: bold; color: var(--accent-gold); font-family: var(--font-heading); cursor: pointer; }
.nav-links { list-style: none; display: flex; gap: 2rem; }
.nav-links a { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; position: relative; cursor: pointer; }
.nav-links a::after { content: ''; position: absolute; width: 0; height: 1px; bottom: -5px; left: 0; background-color: var(--accent-gold); transition: width 0.3s; }
.nav-links a:hover::after { width: 100%; }

/* Контейнер */
.container { max-width: 1200px; margin: 0 auto; padding: 120px 20px 50px; flex: 1; width: 100%; }

/* Герой-блок */
.hero-section { height: 80vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; position: relative; }
.hero-title { font-size: 4rem; margin-bottom: 1rem; text-shadow: 0 0 20px rgba(0,0,0,0.8); }
.hero-subtitle { font-size: 1.2rem; max-width: 600px; margin-bottom: 3rem; color: var(--text-main); }

.btn-fantasy {
    padding: 15px 40px; border: 1px solid var(--accent-gold); color: var(--accent-gold);
    font-family: var(--font-heading); font-size: 1rem; cursor: pointer;
    background: transparent; transition: all 0.4s ease; display: inline-block;
}
.btn-fantasy:hover { background: var(--accent-gold); color: var(--bg-color); box-shadow: 0 0 20px var(--accent-glow); }

.fog-effect { position: absolute; bottom: 0; left: 0; width: 100%; height: 150px; background: linear-gradient(to top, var(--bg-color), transparent); pointer-events: none; }

/* --- АДАПТИВНАЯ ГАЛЕРЕЯ (ИСПРАВЛЕНО) --- */
.gallery-grid {
    display: grid;
    /* Магия адаптивности: колонки создаются автоматически. 
       Минимальная ширина карточки 300px. Если места меньше, они переносятся. */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    width: 100%;
}

.art-card {
    background-color: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%; /* Карточка растягивается на всю высоту ячейки */
}

.art-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-color: var(--accent-gold);
}

.image-wrapper {
    width: 100%;
    /* Соотношение сторон для превью, чтобы все были одинаковыми */
    aspect-ratio: 4 / 3; 
    background-color: #2a2d36;
    overflow: hidden;
    position: relative;
}

.art-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Картинка заполняет блок, не искажаясь */
    transition: transform 0.5s ease;
    display: block;
}

.art-card:hover .art-image { transform: scale(1.05); }

.art-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.art-title { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--text-header); }
.art-desc { font-size: 0.9rem; color: #7a7d85; }

/* Контакты */
.contact-wrapper {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    background: var(--card-bg); padding: 3rem; border: 1px solid rgba(197, 160, 89, 0.1); border-radius: 8px;
    max-width: 800px;
    margin: 0 auto;
}
.contact-form { width: 100%; margin-top: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
input, textarea {
    background: rgba(0,0,0,0.3); border: 1px solid #333; padding: 15px;
    color: var(--text-header); font-family: var(--font-body); outline: none; transition: 0.3s; width: 100%;
}
input:focus, textarea:focus { border-color: var(--accent-gold); background: rgba(0,0,0,0.5); }

footer {
    text-align: center; padding: 2rem; font-size: 0.8rem;
    border-top: 1px solid rgba(255,255,255,0.05); color: #555; margin-top: auto;
}

/* --- МЕДИА ЗАПРОСЫ (АДАПТИВНОСТЬ) --- */
@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
    
    /* Скрываем меню на мобильном для простоты, или можно сделать бургер */
    .nav-links { display: none; } 
    
    /* На мобильных карточки могут быть чуть уже, но сетка auto-fill сама это сделает */
    .gallery-grid {
        grid-template-columns: 1fr; /* Принудительно 1 колонка на очень узких экранах, если нужно */
        gap: 1.5rem;
    }
    
    .container { padding-top: 100px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    /* Планшеты: обычно 2 колонки */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}