:root {
    --bg-color: #141210; /* Темний, теплий еспресо (статусний чорний) */
    --text-color: #f7f5f2; /* М'який білий з теплим відтінком */
    --text-muted: #a8a29e; /* Теплий сірий / беж */
    --accent-color: #cba365; /* Благородне золото / бронза */
    --card-bg: #1c1917; /* Трохи світліший теплий фон для карток */
}

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

html {
    scroll-behavior: smooth; /* Плавний скролінг до якорів */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Хедер та Навігація --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 25px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    z-index: 1000;
    transition: all 0.3s ease;
}

header.scrolled {
    padding: 15px 50px;
    background: rgba(20, 18, 16, 0.85); /* Теплий напівпрозорий фон */
    backdrop-filter: blur(12px); /* Ефект матового скла */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 45px; /* Висота адаптована під хедер, ширина підлаштується автоматично */
    width: auto;
    object-fit: contain;
    /* Розкоментуйте рядки нижче для перевірки, якщо логотип чорний і зливається з фоном */
    /* background-color: #ffffff; */
    /* border-radius: 5px; */
    /* padding: 2px; */
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 35px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--text-color);
}

/* --- Головний екран (Hero) --- */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 20px;
    background-color: var(--bg-color);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0.25; /* Зменшена прозорість, щоб зробити фон ще темнішим */
}

.hero-content {
    position: relative;
    z-index: 2; /* Виводить текст поверх зображення */
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1.1;
    letter-spacing: -1px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8); /* Темна тінь для кращого читання на гіфці */
}

.hero h1 span {
    color: var(--accent-color);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8); /* Тінь для параграфу */
    max-width: 650px;
    margin: 0 auto 40px;
}

.btn {
    display: inline-block;
    padding: 16px 40px;
    background-color: var(--accent-color);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: #b58d51; /* Трохи темніше золото при наведенні */
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(203, 163, 101, 0.25); /* Золота тінь */
}

/* --- Загальні стилі секцій --- */
section {
    padding: 120px 20px;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
}

h2 {
    font-size: 3rem;
    margin-bottom: 60px;
    text-align: center;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* --- Секція послуг (Grid) --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.card {
    background-color: var(--card-bg);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: transform 0.4s ease, border-color 0.4s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.1);
}

.card-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.card:hover .card-image img {
    transform: scale(1.08);
}

.card-content {
    padding: 30px 40px;
    flex-grow: 1;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.card p {
    color: var(--text-muted);
}

/* --- Секція контактів --- */
.contact p {
    text-align: center;
    color: var(--text-muted);
    margin-top: -40px;
    margin-bottom: 40px;
}

.contact form,
.modal-content form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact input,
.contact textarea,
.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 18px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease, background 0.3s ease;
    outline: none;
}

.contact textarea,
.modal-content textarea {
    resize: vertical; /* Дозволяє змінювати розмір поля лише по вертикалі */
    min-height: 120px;
}

.contact input:focus,
.contact textarea:focus,
.modal-content input:focus,
.modal-content textarea:focus {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.05);
}

/* --- Модальне вікно --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(10, 9, 8, 0.9); /* Темний теплий фон */
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

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

.modal-content {
    background-color: var(--card-bg);
    padding: 50px 40px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    max-width: 500px;
    width: 90%;
    position: relative;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 32px;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close-btn:hover {
    color: var(--accent-color);
}

.modal-content h2 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    text-align: center;
}

.modal-content p {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 25px;
}

/* --- Футер --- */
footer {
    text-align: center;
    padding: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- Анімації (ефект Webflow) --- */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Преміум ефект розкриття тексту (стиль Omnerat) --- */
.reveal-text {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s cubic-bezier(0.215, 0.61, 0.355, 1),
                transform 1.2s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.reveal-text.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Адаптивність (Мобільні пристрої) --- */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 20px;
    }
    header.scrolled {
        padding: 15px 20px;
    }
    nav {
        margin-top: 15px;
    }
    nav a {
        margin: 0 10px;
        font-size: 12px;
    }
    .hero h1 {
        font-size: 2.8rem;
    }
    h2 {
        font-size: 2.2rem;
    }
}

/* --- Ефект появи "з пікселів" --- */
.pixel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: grid;
    background-color: var(--bg-color); /* Ховаємо сторінку доки завантажується JS */
    pointer-events: none;
}

.pixel {
    background-color: var(--bg-color); /* Колір пікселів збігається з фоном */
    border: 1px solid rgba(255, 255, 255, 0.05); /* Ледь помітні межі квадратів */
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto; /* Блокуємо кліки доки анімація не пройде */
}

.pixel.hide {
    opacity: 0;
    transform: scale(0.2); /* Пікселі "здуваються" */
    pointer-events: none;
}

/* --- Кастомний курсор --- */
body.has-custom-cursor,
body.has-custom-cursor * {
    cursor: none !important; /* Приховуємо стандартний курсор для всіх елементів */
}

.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    pointer-events: none; /* Щоб курсор не блокував кліки */
    z-index: 100000;
    opacity: 0;
}

.custom-cursor.visible {
    opacity: 1;
}

.custom-cursor::before,
.custom-cursor::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    background-color: #ffffff;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.custom-cursor::before {
    width: 2px;
    height: 20px;
    transform: translate(-50%, -50%);
}

.custom-cursor::after {
    width: 20px;
    height: 2px;
    transform: translate(-50%, -50%);
}

/* Ефект при наведенні (хрестик обертається в X і змінює колір) */
.custom-cursor.hover::before,
.custom-cursor.hover::after {
    background-color: var(--accent-color);
}

.custom-cursor.hover::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.custom-cursor.hover::after {
    transform: translate(-50%, -50%) rotate(45deg);
}
