/* === БАЗОВЫЕ НАСТРОЙКИ === */
@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

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

/* === КРАСИВЫЙ ФОН === */
body {
    position: relative;
    font-family: 'Montserrat', sans-serif;
    min-height: 100vh;
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(255, 236, 210, 0.8) 0%, transparent 40%),
        radial-gradient(ellipse at 80% 20%, rgba(200, 168, 233, 0.8) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, rgba(252, 182, 216, 0.6) 0%, transparent 60%),
        linear-gradient(135deg, #ffecd2 0%, #fcb6d8 25%, #c8a8e9 50%, #ff9a9e 75%, #a18cd1 100%);
    background-attachment: fixed;
    color: #4a2c4a;
    padding: 40px 20px;
    overflow-x: hidden;
}

.photo-card::after {
    content: "";
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: -18px;
    height: 40px;
    background: radial-gradient(ellipse at center, rgba(180, 128, 200, 0.30), rgba(180, 128, 200, 0.10) 35%, transparent 70%);
    filter: blur(14px);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

/* === АНИМАЦИЯ ГРАДИЕНТА ВОЛНОЙ === */
@keyframes gradientWave {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* === ЗАГОЛОВКИ === */
h1 {
    font-family: 'Caveat', cursive;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    text-align: center;
    color: #ffffff;
    text-shadow:
        0 0 10px rgba(255, 107, 157, 0.8),
        0 0 20px rgba(255, 107, 157, 0.6),
        0 0 40px rgba(255, 107, 157, 0.4),
        2px 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    opacity: 0;
    animation: dreamyReveal 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s forwards,
               pulseGlow 3s infinite alternate 1.5s;
}

/* === СЕТКА ФОТОАЛЬБОМА === */
.album {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 35px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.album-sentinel {
    grid-column: 1 / -1;
    width: 100%;
    height: 1px;
    display: block;
    margin-bottom: 12px;
}

/* === КАРТОЧКИ === */
.photo-card {
    position: relative;
    min-height: 360px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 12px 20px 12px;
    border-radius: 18px;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.25)),
        linear-gradient(135deg, rgba(255, 107, 157, 0.6), rgba(153, 122, 255, 0.6), rgba(255, 107, 157, 0.6), rgba(153, 122, 255, 0.6));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    background-size: 100% 100%, 200% 200%;
    background-position: 0 0, 0% 50%;
    border: 2px solid transparent;
    box-shadow:
        0 12px 18px rgba(192, 108, 200, 0.06),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 0 12px rgba(255, 255, 255, 0.15);
    overflow: visible;
    cursor: pointer;
    opacity: 1;
    filter: none;
    will-change: transform, box-shadow;
    transition: background 0.8s ease,
               box-shadow 0.8s ease,
               transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    animation: floatCard 6s ease-in-out infinite,
               gradientWave 8s ease infinite;
}

/* ЭФФЕКТ БЕГАЮЩЕГО НЕОНА */
.photo-card::before {
    content: "";
    position: absolute;
    inset: -2px;
    padding: 2px;
    border-radius: 18px;
    background: conic-gradient(
        from var(--angle),
        transparent 0%,
        #ff6b9d 15%,
        #997aff 30%,
        transparent 50%,
        #ff6b9d 65%,
        #997aff 80%,
        transparent 100%
    );
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: rotateNeon 4s linear infinite;
    pointer-events: none;
    z-index: 1;
}

.photo-card:hover::before {
    animation-duration: 1.5s;
    filter: brightness(1.2) drop-shadow(0 0 8px rgba(255, 107, 157, 0.6));
}

.photo-card:hover {
    background: rgba(255, 255, 255, 0.35);
    box-shadow:
        0 18px 32px rgba(192, 108, 200, 0.14),
        0 0 0 2px rgba(255, 107, 157, 0.5),
        0 0 20px rgba(255, 136, 196, 0.25),
        0 0 38px rgba(153, 122, 255, 0.18),
        inset 0 0 15px rgba(255, 255, 255, 0.25);
    z-index: 10;
    opacity: 1;
    transform: translateY(-10px) scale(1.012);
    animation: none;
    transition: background 0.7s ease,
                box-shadow 0.8s ease,
                transform 1.2s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.photo-card:hover img,
.photo-card:hover p {
    transform: none;
    transition: transform 0.3s ease;
}

.card-in {
    animation: cardMagicIn 0.55s ease-out both;
}

.photo-card img {
    width: 100%;
    height: 330px;
    min-height: 280px;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 5px;
    display: block;
    cursor: zoom-in;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                filter 0.7s ease;
    filter: saturate(1.05);
}

.photo-card p {
    padding: 8px 5px 0 5px;
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    color: #6a1b6a;
    font-family: 'Caveat', cursive;
    transform: rotate(-1deg);
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                filter 0.7s ease;
}

/* === ФУТЕР === */
.footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    font-size: 1.1rem;
    color: #8e44ad;
    font-weight: 600;
    opacity: 0;
    animation: dreamyReveal 1s ease 2.2s forwards;
}

.footer-quote {
    font-family: 'Caveat', cursive;
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1;
    letter-spacing: 0.04em;
    color: #fff7fb;
    text-shadow:
        0 0 12px rgba(255, 107, 157, 0.7),
        0 0 22px rgba(153, 122, 255, 0.5),
        2px 2px 6px rgba(74, 44, 74, 0.25);
    margin: 0;
}

.footer a {
    color: #d63384;
    text-decoration: none;
    border-bottom: 2px dashed #d63384;
    transition: all 0.3s;
}

.footer a:hover {
    color: #c2185b;
    border-bottom-style: solid;
}

/* === МОДАЛЬНОЕ ОКНО (LIGHTBOX) === */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

.lightbox img {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 40px rgba(255, 107, 157, 0.5);
    animation: zoomIn 0.3s ease;
}

#lightbox-caption {
    margin-top: 20px;
    max-width: 700px;
    padding: 0 20px;
    font-family: 'Caveat', cursive;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    line-height: 1.2;
    color: #fff3f8;
    text-align: center;
    text-shadow: 0 0 12px rgba(255, 107, 157, 0.5);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 50px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10000;
}

.close-btn:hover {
    color: #ff6b9d;
    transform: rotate(90deg);
}

/* === АНИМАЦИИ === */
@keyframes rotateNeon {
    0% { --angle: 0deg; }
    100% { --angle: 360deg; }
}

@keyframes pulseGlow {
    from {
        text-shadow:
            0 0 10px rgba(255, 107, 157, 0.8),
            0 0 20px rgba(255, 107, 157, 0.6),
            0 0 40px rgba(255, 107, 157, 0.4);
    }
    to {
        text-shadow:
            0 0 15px rgba(255, 107, 157, 1),
            0 0 30px rgba(255, 107, 157, 0.8),
            0 0 60px rgba(255, 107, 157, 0.6);
    }
}

@keyframes dreamyReveal {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

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

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes cardMagicIn {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
        filter: blur(0);
        box-shadow: none;
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
        box-shadow:
            0 12px 18px rgba(192, 108, 200, 0.06),
            0 0 0 1px rgba(255, 255, 255, 0.1);
    }
}

@keyframes floatCard {
    0%, 100% {
        transform: rotate(var(--rotation, -2deg)) translate3d(0, 4px, 0) scale(1);
    }
    50% {
        transform: rotate(var(--rotation, -2deg)) translate3d(0, -6px, 0) scale(1.004);
    }
}


#music-control {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 10000;
}

#music-toggle {
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#music-toggle:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

@media (max-width: 600px) {
    /* === СБРОС БЛЮРА ДЛЯ МОБИЛЬНЫХ === */

    /* 1. Отключаем размытие встроенного стекла карточки */
    .photo-card {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* 2. Отключаем размытие псевдо-тени под карточкой */
    .photo-card::after {
        filter: none !important;
    }

    /* === ОСТАЛЬНЫЕ НАСТРОЙКИ ДЛЯ МОБИЛЬНЫХ === */
    body { padding: 20px 10px; }
    
    .album {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
        padding: 10px;
        align-items: start; 
    }

    .photo-card {
        height: auto !important;
        min-height: 0 !important;
        padding: 8px 8px 12px 8px !important;
        animation: gradientWave 8s ease infinite !important;
        transform: none !important;
    }

    .photo-card:hover { 
        transform: scale(1.02) translateY(-3px) !important; 
    }
    
    .photo-card img { 
        height: 160px !important;
        min-height: 0 !important;
        aspect-ratio: auto !important;
        object-fit: cover;
    }
    
    .photo-card p {
        font-size: 1.3rem;
        padding: 4px 2px 0;
        height: 2.8em;
        line-height: 1.4em;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
}