/* ============================================================
   Страница памяти — «живой» тёплый дизайн
   Насыщенная тёплая палитра, мягкие анимации, эффекты
   ============================================================ */

:root {
    --bg:          #faf0df;
    --bg-deep:     #f3e3c8;
    --paper:       #fff9ec;
    --cream:       #fdf4e3;
    --sand:        #ecd7b4;
    --sand-dark:   #ddc093;
    --amber:       #c58a3e;
    --caramel:     #b06f2f;
    --terracotta:  #a35c33;
    --clay:        #8f4a26;
    --brown:       #6f3f22;
    --choco:       #4e2a13;
    --ink:         #3b2312;
    --muted:       #9a7b56;
    --gold:        #d9a352;
    --gold-soft:   #e8c58a;
    --shadow-soft:  0 10px 34px rgba(94, 62, 32, 0.14);
    --shadow-hover: 0 24px 60px rgba(94, 62, 32, 0.22);
    --radius: 16px;
    --radius-lg: 24px;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, 'Segoe UI', Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--ink);
    background:
        radial-gradient(circle at 15% 10%, rgba(230, 196, 141, 0.5) 0, transparent 40%),
        radial-gradient(circle at 88% 28%, rgba(217, 163, 82, 0.28) 0, transparent 42%),
        radial-gradient(circle at 40% 100%, rgba(226, 197, 152, 0.4) 0, transparent 46%),
        var(--bg);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

/* Зерно бумаги */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }
a { color: var(--caramel); text-decoration: none; }

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

::selection { background: rgba(217, 163, 82, 0.45); }

/* Тонкий скроллбар */
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--sand-dark), var(--amber)); border-radius: 99px; border: 2px solid var(--bg); }

/* Индикатор прокрутки */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 100%;
    transform-origin: 0 50%;
    transform: scaleX(0);
    background: linear-gradient(90deg, var(--gold), var(--terracotta), var(--gold));
    background-size: 200% 100%;
    animation: goldShift 4s linear infinite;
    z-index: 200;
    pointer-events: none;
}

@keyframes goldShift { 0% { background-position: 0% 0; } 100% { background-position: 200% 0; } }

/* ---------- Шапка ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 240, 223, 0.8);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    backdrop-filter: blur(16px) saturate(1.3);
    border-bottom: 1px solid rgba(221, 192, 147, 0.5);
    transition: box-shadow 0.4s ease, background 0.4s ease;
}

.site-header.scrolled {
    background: rgba(250, 240, 223, 0.92);
    box-shadow: 0 8px 30px rgba(94, 62, 32, 0.12);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.logo { display: flex; align-items: center; gap: 12px; }

.logo-mark {
    width: 42px; height: 42px;
    display: grid; place-items: center;
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--paper);
    background: linear-gradient(150deg, var(--caramel), var(--clay));
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(163, 92, 51, 0.4);
    transition: transform 0.4s var(--ease);
}

.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.06); }

.logo-text {
    font-family: var(--font-display);
    font-size: 23px;
    font-weight: 600;
    color: var(--choco);
    letter-spacing: 0.4px;
}

.nav { display: flex; gap: 8px; }

.nav a {
    padding: 9px 18px;
    border-radius: 99px;
    color: var(--brown);
    font-size: 15px;
    font-weight: 500;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s var(--ease);
}

.nav a:hover { color: var(--choco); background: rgba(230, 196, 141, 0.4); transform: translateY(-1px); }
.nav a.nav-active { background: linear-gradient(150deg, var(--brown), var(--caramel)); color: #fff6e8; box-shadow: 0 8px 20px rgba(111, 63, 34, 0.3); }

/* ---------- Мобильное меню ---------- */
.mnav-burger {
    display: none;
    width: 44px; height: 44px;
    border: 1px solid rgba(221, 192, 147, 0.9);
    border-radius: 12px;
    background: rgba(255, 249, 236, 0.8);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    z-index: 320;
}

.mnav-burger span {
    display: block;
    width: 20px; height: 2px;
    border-radius: 2px;
    background: var(--choco);
    transition: transform 0.3s var(--ease), opacity 0.2s ease;
}

.mnav { display: none; }

@media (max-width: 860px) {
    .site-header .nav { display: none; }

    .mnav-burger { display: inline-flex; }

    html.mnav-open { overflow: hidden; }

    .mnav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 290;
        background: rgba(62, 35, 16, 0.4);
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s;
    }

    html.mnav-open .mnav-backdrop { opacity: 1; visibility: visible; }

    .mnav {
        display: flex;
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: min(320px, 84vw);
        z-index: 310;
        flex-direction: column;
        gap: 8px;
        padding: 92px 24px 28px;
        background: linear-gradient(165deg, var(--paper), var(--cream));
        box-shadow: 24px 0 70px rgba(62, 35, 16, 0.25);
        transform: translateX(-110%);
        transition: transform 0.4s var(--ease);
        overflow-y: auto;
    }

    html.mnav-open .mnav { transform: none; }

    .mnav a {
        padding: 13px 18px;
        border-radius: 13px;
        color: var(--choco);
        font-size: 16px;
        font-weight: 500;
        border: 1px solid transparent;
        transition: background 0.25s ease, transform 0.25s var(--ease);
    }

    .mnav a:hover { background: rgba(236, 215, 180, 0.6); transform: translateX(4px); }

    .mnav a.active {
        background: linear-gradient(150deg, var(--brown), var(--caramel));
        color: #fff6e8;
        box-shadow: 0 10px 24px rgba(111, 63, 34, 0.28);
    }

    html.mnav-open .mnav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    html.mnav-open .mnav-burger span:nth-child(2) { opacity: 0; }
    html.mnav-open .mnav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Декоративные пятна ---------- */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    pointer-events: none;
    animation: blobDrift 14s ease-in-out infinite alternate;
}

.blob-a { width: 480px; height: 480px; top: -160px; left: -120px; background: radial-gradient(circle, rgba(230, 188, 122, 0.9), rgba(230, 188, 122, 0)); }
.blob-b { width: 560px; height: 560px; bottom: -220px; right: -140px; background: radial-gradient(circle, rgba(197, 138, 62, 0.55), rgba(197, 138, 62, 0)); animation-delay: -7s; }

@keyframes blobDrift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 30px) scale(1.12); }
}

/* ---------- Hero / страница о человеке ---------- */
.hero {
    position: relative;
    overflow: hidden;
    padding: 88px 0 40px;
}

.hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    gap: 60px;
    align-items: center;
}

.hero-copy { position: relative; z-index: 2; }

.hero-overline {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 15px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--caramel);
}

.orn-dot { width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(150deg, var(--gold), var(--terracotta)); box-shadow: 0 0 0 4px rgba(217, 163, 82, 0.2); }

.hero-name {
    margin: 22px 0 6px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(42px, 6vw, 76px);
    line-height: 1.06;
    letter-spacing: 0.3px;
    color: var(--choco);
}

.hero-name-row {
    background: linear-gradient(115deg, var(--choco) 20%, var(--caramel) 55%, var(--terracotta) 80%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-years {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(19px, 2.6vw, 26px);
    color: var(--terracotta);
    display: inline-block;
    padding: 4px 18px;
    border-radius: 99px;
    background: rgba(255, 249, 236, 0.7);
    border: 1px solid rgba(221, 192, 147, 0.8);
}

.hero-tribute {
    margin-top: 26px;
    max-width: 560px;
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(17px, 2vw, 21px);
    line-height: 1.75;
    color: var(--brown);
    white-space: pre-line;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
}

/* Кнопки */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 30px;
    border: none;
    border-radius: 99px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    overflow: hidden;
    color: #fff6e8;
    background: linear-gradient(120deg, var(--brown), var(--caramel));
    box-shadow: 0 12px 30px rgba(111, 63, 34, 0.35);
    transition: transform 0.35s var(--ease), box-shadow 0.35s ease, background 0.3s ease;
}

.btn-primary {
    color: #fff6e8;
    background: linear-gradient(120deg, var(--brown), var(--caramel));
    box-shadow: 0 12px 30px rgba(111, 63, 34, 0.35);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0; left: -130%;
    width: 55%; height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0.7s ease;
}

.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 18px 42px rgba(111, 63, 34, 0.42); }
.btn-primary:hover::after { left: 160%; }

.btn-ghost {
    color: var(--brown);
    background: rgba(255, 249, 236, 0.65);
    border: 1.5px solid var(--sand-dark);
}

.btn-ghost:hover { transform: translateY(-3px); background: var(--paper); box-shadow: var(--shadow-soft); }

.btn-light {
    color: var(--choco);
    background: linear-gradient(120deg, var(--gold-soft), var(--paper));
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.btn-light:hover { transform: translateY(-3px); box-shadow: 0 20px 44px rgba(0, 0, 0, 0.25); }

.btn-sm { padding: 9px 16px; font-size: 14px; }

/* Портрет */
.hero-visual { position: relative; display: flex; justify-content: center; z-index: 2; }

.portrait-stage {
    position: relative;
    width: min(400px, 88vw);
    perspective: 1100px;
}

.portrait-card {
    position: relative;
    aspect-ratio: 4 / 5;
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(150deg, #fffdf5, #f5e4c8);
    box-shadow:
        0 34px 80px rgba(94, 62, 32, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        inset 0 0 0 1.5px rgba(176, 120, 55, 0.4);
    transform-style: preserve-3d;
    transition: transform 0.18s ease-out, box-shadow 0.4s ease;
}

/* золотая линия паспарту */
.portrait-card::before {
    content: '';
    position: absolute;
    inset: 9px;
    z-index: 1;
    border: 1px solid rgba(197, 138, 62, 0.55);
    border-radius: 13px;
    pointer-events: none;
}

/* блик, следящий за курсором */
.portrait-card::after {
    content: '';
    position: absolute;
    inset: 18px;
    z-index: 3;
    border-radius: 7px;
    opacity: 0;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 246, 232, 0.45), transparent 46%);
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.portrait-card:hover::after { opacity: 1; }

.portrait-card img {
    position: relative;
    z-index: 2;
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center 30%;
    border-radius: 7px;
    filter: sepia(0.12) saturate(1.08) contrast(1.02);
    box-shadow: 0 12px 26px rgba(94, 62, 32, 0.22);
    transition: transform 1.4s var(--ease);
}

.portrait-card:hover img { transform: scale(1.04); }

.portrait-card.monogram {
    display: grid;
    place-items: center;
    background: linear-gradient(150deg, #fffdf5, #f5e4c8);
}

.portrait-card.monogram span {
    font-family: var(--font-display);
    font-size: clamp(120px, 24vw, 190px);
    line-height: 1;
    color: rgba(94, 62, 32, 0.28);
    text-shadow: 0 14px 36px rgba(176, 120, 55, 0.35);
}

/* декоративное кольцо за портретом */
.portrait-stage::before {
    content: '';
    position: absolute;
    inset: -34px;
    z-index: -1;
    border-radius: 40px;
    background:
        radial-gradient(circle at 20% 20%, rgba(217, 163, 82, 0.35), transparent 55%),
        radial-gradient(circle at 80% 80%, rgba(163, 92, 51, 0.22), transparent 55%);
    filter: blur(6px);
}

.hero-scroll {
    position: relative;
    margin-top: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--caramel);
}

.scroll-line {
    width: 1.5px; height: 52px;
    background: linear-gradient(to bottom, var(--amber), transparent);
    animation: scrollPulse 2.4s ease-in-out infinite;
}

.scroll-label { font-size: 11.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }

@keyframes scrollPulse {
    0%, 100% { transform: scaleY(0.5); transform-origin: top; opacity: 0.5; }
    50% { transform: scaleY(1); opacity: 1; }
}

/* ---------- Секции ---------- */
.section { position: relative; padding: 80px 0; z-index: 2; }

.section-alt {
    background: linear-gradient(180deg, rgba(243, 227, 200, 0.75), rgba(250, 240, 223, 0.4));
    border-top: 1px solid rgba(221, 192, 147, 0.45);
    border-bottom: 1px solid rgba(221, 192, 147, 0.45);
}

.section-head { text-align: center; margin-bottom: 48px; }

.section-head h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(32px, 4.4vw, 46px);
    color: var(--choco);
}

.section-head h2::after {
    content: '';
    display: block;
    width: 72px; height: 3px;
    margin: 16px auto 0;
    border-radius: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.section-sub { margin-top: 12px; color: var(--muted); font-size: 15.5px; }

#life, #moments, #allphotos, #albums, #remember { scroll-margin-top: 96px; }

/* ---------- О жизни ---------- */
.life-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.1fr);
    gap: 44px;
    align-items: start;
}

.life-text p {
    font-size: 17px;
    color: var(--ink);
    white-space: pre-line;
    margin-bottom: 18px;
}

.life-sign {
    margin-top: 26px;
    font-family: var(--font-display);
    font-style: italic;
    color: var(--caramel);
}

.life-quote {
    position: sticky;
    top: 110px;
    background: linear-gradient(160deg, var(--paper), var(--cream));
    border: 1px solid rgba(221, 192, 147, 0.8);
    border-radius: var(--radius-lg);
    padding: 34px 32px;
    box-shadow: var(--shadow-soft);
    background-image:
        radial-gradient(circle at 90% 10%, rgba(217, 163, 82, 0.18), transparent 45%);
}

.life-quote .quote-mark {
    font-family: var(--font-display);
    font-size: 64px;
    line-height: 0.5;
    color: var(--gold);
    display: block;
    margin-bottom: 16px;
}

.life-quote p {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 20px;
    line-height: 1.6;
    color: var(--brown);
    white-space: pre-line;
}

/* ---------- Лента мгновений ---------- */
.moments-strip {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}

.moments-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 3 / 4;
    box-shadow: var(--shadow-soft);
    transform: translateY(0);
    transition: transform 0.4s var(--ease), box-shadow 0.4s ease;
}

.moments-card:nth-child(even) { transform: translateY(14px); }
.moments-card:nth-child(even):hover { transform: translateY(4px) scale(1.03); }
.moments-card:hover { transform: translateY(-6px) scale(1.03); box-shadow: var(--shadow-hover); }

.moments-card img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 1.2s var(--ease);
}

.moments-card:hover img { transform: scale(1.09); }

.moments-caption {
    position: absolute;
    left: 12px; right: 12px; bottom: 12px;
    z-index: 2;
    color: #fff6e8;
    font-size: 12.5px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 99px;
    background: rgba(62, 35, 16, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.35s var(--ease);
    text-align: center;
}

.moments-card:hover .moments-caption { opacity: 1; transform: none; }

.moments-more { text-align: center; margin-top: 40px; }

/* Эффект блеска на фото */
.media-hover { position: relative; overflow: hidden; }

.media-hover::after {
    content: '';
    position: absolute;
    top: 0; left: -130%;
    width: 55%; height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255, 246, 232, 0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0.8s ease;
    pointer-events: none;
    z-index: 3;
}

.media-hover:hover::after { left: 150%; }

/* ---------- Карточки альбомов ---------- */
.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 30px;
    align-items: start;
}

.album-card {
    display: block;
    background: var(--paper);
    border: 1px solid rgba(221, 192, 147, 0.9);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transform: translateY(0) rotate(0);
    transition: transform 0.5s var(--ease), box-shadow 0.5s ease;
}

.album-card:hover {
    transform: translateY(-10px) rotate(-0.6deg);
    box-shadow: var(--shadow-hover);
}

.album-card:nth-child(even):hover { transform: translateY(-10px) rotate(0.6deg); }

/* Обложка: фото целиком, без паспарту и без обрезки.
   Высота подстраивается под пропорции снимка — одинаково на ПК и телефоне. */
.album-cover {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px 12px 4px;
    min-height: 150px;
    background:
        linear-gradient(150deg, rgba(255, 249, 236, 0.5), rgba(236, 215, 180, 0.22)),
        var(--sand);
}

.album-cover img {
    max-width: 100%;
    max-height: min(460px, 46vh);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(94, 62, 32, 0.2);
    transition: transform 0.9s var(--ease), box-shadow 0.5s ease;
}

.album-card:hover .album-cover img {
    transform: scale(1.02);
    box-shadow: 0 16px 34px rgba(94, 62, 32, 0.28);
}

.album-info { padding: 16px 20px 22px; }

.album-info h3 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--choco);
    margin-bottom: 6px;
    transition: color 0.3s ease;
}

.album-card:hover .album-info h3 { color: var(--terracotta); }

.album-desc { font-size: 14px; color: var(--muted); margin-bottom: 14px; }

.album-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--caramel); font-weight: 600; }

.meta-dot { width: 4px; height: 4px; background: var(--sand-dark); border-radius: 50%; }

.cover-empty {
    min-height: 150px;
    display: grid; place-items: center;
    color: var(--muted); font-style: italic;
    font-size: 14px; padding: 16px; text-align: center;
}

/* ---------- Page hero (фотографии) ---------- */
.page-hero { position: relative; overflow: hidden; padding: 84px 0 40px; text-align: center; }

.page-hero-inner { position: relative; z-index: 2; }

.page-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(40px, 6vw, 68px);
    color: var(--choco);
}

.page-sub { margin: 16px auto 0; max-width: 640px; color: var(--muted); font-size: 17px; }

/* ---------- Галерея (ровная сетка плиток) ---------- */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
}

.gallery-item {
    position: relative;
    display: block;
    aspect-ratio: 1;
    border-radius: 14px;
    overflow: hidden;
    background: var(--sand);
    box-shadow: var(--shadow-soft);
    cursor: zoom-in;
    transform: translateY(0);
    transition: transform 0.45s var(--ease), box-shadow 0.45s ease;
}

.gallery-item:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }

.gallery-item img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center 35%;
    transition: transform 1.2s var(--ease);
}

.gallery-item:hover img { transform: scale(1.06); }

/* Видео в плитке галереи — заполняет плитку так же, как фото */
.gallery-item.media-video { background: #160c05; }

.gallery-item.media-video .media-video-el {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    min-height: 0;
}

.gallery-album {
    position: absolute;
    left: 12px; bottom: 12px;
    z-index: 4;
    color: #fff6e8;
    font-size: 12.5px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 99px;
    background: rgba(62, 35, 16, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.35s var(--ease);
    pointer-events: none;
}

.gallery-item:hover .gallery-album { opacity: 1; transform: none; }

/* ---------- Видео в галереях ---------- */
.gallery-item.media-video {
    background: #150c05;
    cursor: pointer;
}

.media-video-el {
    display: block;
    width: 100%;
    height: auto;
    min-height: 170px;
    background: radial-gradient(120% 120% at 50% 0%, #2c1a0d 0%, #160c05 62%);
    object-fit: contain;
}

.v-play { display: none; }

.v-play {
    position: absolute;
    top: 50%; left: 50%;
    width: 66px; height: 66px;
    margin: -33px 0 0 -33px;
    border-radius: 50%;
    background: rgba(24, 14, 6, 0.45);
    border: 1px solid rgba(255, 244, 226, 0.65);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 1;
    visibility: visible;
    z-index: 3;
    transition: opacity 0.3s ease, transform 0.3s var(--ease), visibility 0.3s;
}

.v-play::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    margin: -13px 0 0 -7px;
    border-left: 20px solid #fff4e2;
    border-top: 13px solid transparent;
    border-bottom: 13px solid transparent;
}

.media-video.is-playing .v-play,
.media-video.is-playing:hover .v-play { opacity: 0; visibility: hidden; }
.media-video:hover .v-play { transform: scale(1.1); }

/* Страница «Видео» */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}

.video-card {
    background: var(--paper);
    border: 1px solid rgba(221, 192, 147, 0.9);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform 0.45s var(--ease), box-shadow 0.45s ease;
}

.video-card:hover { transform: translateY(-7px); box-shadow: var(--shadow-hover); }

.video-frame {
    position: relative;
    overflow: hidden;
    background: #150c05;
}

.video-frame .media-video-el { width: 100%; height: 100%; object-fit: contain; }

.video-card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 18px 16px;
}

/* Видео на главной */
.home-videos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.video-album { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--caramel); }
.video-name { font-size: 15px; color: var(--choco); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Фильтр */
.filter-bar { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 34px; }
.filter-label { font-size: 14.5px; font-weight: 600; color: var(--muted); }

.filter-select {
    padding: 10px 40px 10px 16px;
    border: 1.5px solid var(--sand-dark);
    border-radius: 12px;
    background: var(--paper);
    color: var(--choco);
    font-family: var(--font-body);
    font-size: 14.5px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23b06f2f' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.filter-select:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 4px rgba(197, 138, 62, 0.18); }

.filter-clear { color: var(--caramel); font-size: 14px; border-bottom: 1px dashed var(--sand-dark); }
.filter-clear:hover { color: var(--terracotta); }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; flex-wrap: wrap; }

/* ---------- Album page ---------- */
.album-hero { position: relative; padding: 56px 0 16px; z-index: 2; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--caramel);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 22px;
    transition: transform 0.3s var(--ease), color 0.3s ease;
}

.back-link:hover { color: var(--terracotta); transform: translateX(-5px); }

.album-title {
    font-family: var(--font-display);
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 600;
    color: var(--choco);
    margin-bottom: 12px;
}

.album-lead { font-size: 17px; color: var(--muted); max-width: 680px; margin-bottom: 20px; }

.album-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--caramel);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 42px;
}

/* ---------- Пустые состояния ---------- */
.empty-state {
    text-align: center;
    padding: 70px 24px;
    background: rgba(255, 249, 236, 0.75);
    border: 1.5px dashed var(--sand-dark);
    border-radius: var(--radius-lg);
}

.empty-icon { font-size: 46px; margin-bottom: 12px; }

.empty-state h3 { font-family: var(--font-display); font-size: 26px; color: var(--choco); margin-bottom: 8px; }
.empty-state p { color: var(--muted); margin-bottom: 22px; }

/* ---------- CTA-полоса ---------- */
.cta-band {
    padding: 96px 0;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.cta-band::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(217, 163, 82, 0.5), transparent 42%),
        radial-gradient(circle at 85% 75%, rgba(163, 92, 51, 0.42), transparent 40%),
        linear-gradient(120deg, var(--caramel), var(--terracotta) 55%, var(--clay));
    background-size: 160% 160%;
    animation: bandPan 12s ease-in-out infinite alternate;
    z-index: -1;
}

@keyframes bandPan { 0% { background-position: 0% 30%; } 100% { background-position: 100% 70%; } }

.cta-inner { color: #fff6e8; max-width: 780px; }

.cta-kicker { font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: rgba(255, 246, 232, 0.85); margin-bottom: 14px; }

.cta-inner h2 {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: clamp(28px, 4.4vw, 46px);
    line-height: 1.35;
    white-space: pre-line;
}

.cta-sub { margin: 18px 0 34px; color: rgba(255, 246, 232, 0.85); }

/* ---------- Футер ---------- */
.site-footer {
    background: linear-gradient(160deg, #5a3117, #3a1e0b);
    color: #ecd7b4;
    padding: 48px 0 40px;
}

.footer-inner { text-align: center; }

.footer-brand { font-family: var(--font-display); font-size: 24px; color: #fbe9d2; margin-bottom: 6px; }
.footer-note { font-size: 14px; opacity: 0.85; }
.footer-year { font-size: 13px; opacity: 0.5; margin-top: 10px; }

/* ---------- Кнопка «наверх» ---------- */
.to-top {
    position: fixed;
    right: 24px; bottom: 24px;
    z-index: 150;
    width: 50px; height: 50px;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    color: #fff6e8;
    background: linear-gradient(150deg, var(--caramel), var(--clay));
    box-shadow: 0 12px 30px rgba(94, 62, 32, 0.4);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: opacity 0.35s ease, transform 0.35s var(--ease), visibility 0.35s;
}

.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { transform: translateY(-4px) scale(1.06); }

/* ---------- Лайтбокс ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(28, 15, 5, 0.94);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.lightbox.open { opacity: 1; visibility: visible; }

.lightbox-figure { max-width: min(1200px, 92vw); max-height: 88vh; margin: 0; display: flex; flex-direction: column; align-items: center; }

.lightbox-figure img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
    transform: scale(0.96);
    transition: transform 0.35s var(--ease);
}

.lightbox.open .lightbox-figure img { transform: scale(1); }

.lightbox-figure figcaption { margin-top: 14px; color: var(--sand); font-size: 14px; }
.lightbox-figure figcaption:empty { display: none; }

.lightbox-close, .lightbox-nav {
    position: absolute;
    background: rgba(255, 246, 232, 0.1);
    border: none;
    color: #fff6e8;
    cursor: pointer;
    border-radius: 50%;
    display: grid;
    place-items: center;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: background 0.3s ease, transform 0.3s var(--ease);
}

.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255, 246, 232, 0.25); transform: scale(1.1); }

.lightbox-close { top: 24px; right: 24px; width: 48px; height: 48px; font-size: 28px; }
.lightbox-nav { top: 50%; width: 54px; height: 54px; font-size: 34px; margin-top: -27px; }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

.lightbox-counter {
    position: absolute;
    bottom: 22px; left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 246, 232, 0.75);
    font-size: 13.5px;
    letter-spacing: 1px;
}

/* ---------- Появление при загрузке (hero) ---------- */
html.js .hero-anim {
    opacity: 0;
    transform: translateY(26px);
    filter: blur(6px);
    transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease);
    transition-delay: var(--d, 0s);
}

html.js.ready .hero-anim { opacity: 1; transform: none; filter: blur(0); }

/* Появление при скролле */
html.js .reveal {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(5px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), filter 0.9s var(--ease);
}

html.js .reveal.visible { opacity: 1; transform: none; filter: blur(0); }

/* Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--sand) 25%, var(--cream) 50%, var(--sand) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: var(--radius);
}

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001s !important;
    }
    html.js .hero-anim, html.js .reveal { opacity: 1 !important; transform: none !important; filter: none !important; }
    .moments-card:nth-child(even) { transform: none; }
}

/* ---------- Адаптивность ---------- */
@media (max-width: 1020px) {
    .hero-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
    .hero-copy { display: flex; flex-direction: column; align-items: center; }
    .hero-tribute { margin-left: auto; margin-right: auto; }
    .hero-actions { justify-content: center; }
    .hero-visual { order: -1; }
    .life-layout { grid-template-columns: 1fr; }
    .life-quote { position: static; }
    .moments-strip { grid-template-columns: repeat(3, 1fr); }
    .moments-card:nth-child(even) { transform: none; }
}

@media (max-width: 760px) {
    .gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .moments-strip { grid-template-columns: repeat(2, 1fr); }
    .albums-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .header-inner { height: 60px; }
    .nav { gap: 4px; }
    .nav a { padding: 7px 10px; font-size: 12.5px; }
    .logo-mark { width: 36px; height: 36px; font-size: 18px; }
    .hero { padding: 56px 0 20px; }
    .section { padding: 56px 0; }
    .moments-strip { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .moments-card:nth-child(even) { transform: none; }
    .moments-card:hover, .moments-card:nth-child(even):hover { transform: translateY(-4px); }
    .to-top { right: 16px; bottom: 16px; width: 46px; height: 46px; }
    .videos-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
    .logo-text { font-size: 18px; }
    .nav a { padding: 6px 8px; font-size: 12px; }
}
