@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url('assets/fonts/manrope-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url('assets/fonts/manrope-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('assets/fonts/playfair-display-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('assets/fonts/playfair-display-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
    --marble-accent: #e7e5e4;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

body {
    font-family: 'Manrope', sans-serif;
    background-color: #0c0a09;
    color: #d6d3d1;
    animation: fadeIn 0.8s ease-in-out;
}

/* Фон на фиксированном слое: на мобильных background-attachment/cover на body
   даёт швы и видимые края картинки, слой размером с вьюпорт — нет. */
#page-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    /* 100lvh: высота НЕ меняется при схлопывании адресной строки на телефоне,
       иначе cover пересчитывается и фон «зумится» при прокрутке */
    height: 100vh;
    height: 100lvh;
    z-index: -1;
    background-image:
        linear-gradient(to right, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.55)),
        url('assets/home.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Виньетка по краям — глубина и фокус на контенте */
#page-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* Лёгкое зерно поверх фона — убирает «плоский» вид градиентов */
#page-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Playfair Display вместо Cinzel: у Cinzel нет кириллицы,
   русские заголовки рендерились запасным шрифтом */
.font-marble { font-family: 'Playfair Display', 'Cinzel', serif; }

/* «Металлический» градиент для главного заголовка */
.text-metal {
    background: linear-gradient(180deg, #fafaf9 0%, #e7e5e4 45%, #a8a29e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Мягкое растворение краёв иллюстраций в фоне */
.img-fade {
    -webkit-mask-image: radial-gradient(ellipse 70% 70% at center, black 55%, transparent 98%);
    mask-image: radial-gradient(ellipse 70% 70% at center, black 55%, transparent 98%);
}

/* Мобильная шторка: плавное раскрытие высоты + каскадное появление пунктов */
#mobile-menu {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
    pointer-events: none;
    margin-bottom: 0;
    transition:
        grid-template-rows 0.45s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.3s ease,
        transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
        margin-bottom 0.45s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.45s;
}
#mobile-menu.open {
    grid-template-rows: 1fr;
    opacity: 1;
    transform: none;
    visibility: visible;
    pointer-events: auto;
    margin-bottom: 1rem;
}
#mobile-menu .nav-link {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
#mobile-menu.open .nav-link {
    opacity: 1;
    transform: none;
}
#mobile-menu.open .nav-link:nth-child(1) { transition-delay: 0.06s; }
#mobile-menu.open .nav-link:nth-child(2) { transition-delay: 0.11s; }
#mobile-menu.open .nav-link:nth-child(3) { transition-delay: 0.16s; }
#mobile-menu.open .nav-link:nth-child(4) { transition-delay: 0.21s; }
@media (min-width: 768px) {
    #mobile-menu { display: none; }
}

/* Тонкий тёмный скроллбар в тон сайта */
html {
    scrollbar-width: thin;
    scrollbar-color: #44403c #0c0a09;
}
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0c0a09; }
::-webkit-scrollbar-thumb { background: #44403c; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #57534e; }

.text-marble {
    color: #e5e7eb;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

.concrete-panel {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.marble-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
}

.marble-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Reveal Animation Styles */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.animate-slide-in-left {
    animation: slideInFromLeft 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    opacity: 0;
    transform: translateX(-50px);
}

/* Появление героя: проявляется из размытия на месте, без «выезда» сбоку */
.animate-rise {
    animation: riseIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
    opacity: 0;
    transform: translateY(18px);
    filter: blur(10px);
}

@keyframes riseIn {
    to { opacity: 1; transform: none; filter: blur(0); }
}

.animate-slide-in-right {
    animation: slideInFromRight 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    opacity: 0;
    transform: translateX(50px);
}

@keyframes slideInFromLeft {
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInFromRight {
    to { opacity: 1; transform: translateX(0); }
}

@keyframes shine {
    to { background-position: 200% center; }
}

.animate-float {
    animation: float 10s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-30px); }
}

.brain-container {
    position: relative;
}

.brain-container::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 80px 80px #0c0a09;
    pointer-events: none;
}

/* Плавное появление вкладки при переключении */
.view {
    animation: fadeIn 0.45s ease-in-out;
}

/* Экспериментально: вкладка «собирается» из размытия при переключении */
.view-enter {
    animation: viewAssemble 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes viewAssemble {
    from {
        opacity: 0;
        filter: blur(16px);
        transform: translateY(10px) scale(0.985);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: none;
    }
}

/* Видимый фокус для клавиатурной навигации */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #a8a29e;
    outline-offset: 3px;
    border-radius: 4px;
}

/* Уважение к настройке «уменьшить движение» */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal,
    .animate-slide-in-left,
    .animate-slide-in-right,
    .animate-rise {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
}

/* Крупные зоны нажатия на сенсорных экранах */
@media (pointer: coarse) {
    .nav-link {
        min-height: 44px;
    }
}

/* iOS не поддерживает background-attachment: fixed — отключаем на сенсорных устройствах */
@media (pointer: coarse) {
    body {
        background-attachment: scroll;
    }
}