:root {
    color-scheme: light;
    --gradient: linear-gradient(125deg, #fdf497 0%, #fd5949 35%, #d6249f 65%, #285AEB 100%);
    --gradient-soft: radial-gradient(circle at 18% 18%, rgba(253, 244, 151, 0.45) 0%, transparent 58%),
        radial-gradient(circle at 80% 0%, rgba(214, 36, 159, 0.36) 0%, transparent 56%),
        radial-gradient(circle at 12% 88%, rgba(40, 90, 235, 0.28) 0%, transparent 62%);
    --surface: rgba(255, 255, 255, 0.72);
    --surface-strong: rgba(255, 255, 255, 0.92);
    --surface-border: rgba(255, 255, 255, 0.45);
    --text-primary: #261f33;
    --text-secondary: #5f5470;
    --accent: #ff7eb3;
    --shadow: 0 40px 80px rgba(24, 14, 40, 0.24);
    --radius-lg: 28px;
    --radius-md: 20px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: 'Poppins', 'Noto Sans SC', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    background: #f8f5ff;
    scroll-behavior: smooth;
}

body.layout {
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}

.gradient {
    position: fixed;
    inset: 0;
    background: var(--gradient);
    filter: saturate(120%) contrast(110%);
    opacity: 0.9;
    z-index: -3;
}

.layout::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--gradient-soft), rgba(255, 255, 255, 0.26);
    backdrop-filter: blur(72px);
    z-index: -2;
}

main {
    position: relative;
    isolation: isolate;
    width: min(1120px, 92vw);
    margin: 0 auto;
    padding: 96px 32px 120px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.72));
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(46px);
    display: flex;
    flex-direction: column;
    gap: 64px;
    overflow: hidden;
}

main::before,
main::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(0);
    z-index: -1;
    opacity: 0.35;
}

main::before {
    width: 460px;
    height: 460px;
    top: -160px;
    left: -140px;
    background: radial-gradient(circle at 30% 30%, rgba(253, 244, 151, 0.7) 0%, rgba(253, 244, 151, 0.05) 70%);
}

main::after {
    width: 380px;
    height: 380px;
    right: -120px;
    bottom: -160px;
    background: radial-gradient(circle at 70% 70%, rgba(40, 90, 235, 0.55) 0%, rgba(40, 90, 235, 0.02) 80%);
}

main > * {
    position: relative;
    z-index: 1;
}


.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 22px;
}

.hero__title {
    font-family: 'ZCOOL KuaiLe', 'Poppins', cursive;
    font-size: clamp(40px, 7vw, 62px);
    margin: 0;
    text-shadow: 0 18px 32px rgba(38, 15, 51, 0.22);
}

.hero__subtitle {
    margin: 0;
    max-width: 560px;
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1.75;
}


.masonry {
    column-count: 3;
    column-gap: 32px;
}

.masonry__item {
    break-inside: avoid;
    margin-bottom: 32px;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 24px 60px rgba(35, 23, 48, 0.3);
    transform: translateY(0);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    opacity: 0;
    will-change: transform, opacity;
    backdrop-filter: blur(6px);
    isolation: isolate;
}

.masonry__item::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(160deg, rgba(253, 244, 151, 0) 0%, rgba(214, 36, 159, 0.22) 55%, rgba(40, 90, 235, 0.28) 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
    mix-blend-mode: screen;
    z-index: 1;
}

.masonry__item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.masonry__item:not(.is-visible) {
    transform: translateY(24px);
}

.masonry__item:hover {
    transform: translateY(-8px);
    box-shadow: 0 36px 80px rgba(35, 23, 48, 0.36);
}

.masonry__item:hover::after {
    opacity: 1;
}

.masonry__trigger {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: inherit;
    overflow: hidden;
}

.masonry__trigger::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.masonry__item:hover .masonry__trigger::before,
.masonry__item:focus-within .masonry__trigger::before {
    opacity: 1;
}

.masonry__trigger:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.9);
    outline-offset: 4px;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.35);
}

.masonry__image {
    width: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.6s ease, filter 0.6s ease;
    filter: saturate(108%) contrast(102%);
}

.masonry__item:hover .masonry__image,
.masonry__item:focus-within .masonry__image {
    transform: scale(1.04);
    filter: saturate(118%) contrast(105%);
}

.masonry__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 5, 20, 0) 40%, rgba(10, 5, 20, 0.4) 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 2;
}

.masonry__item:hover .masonry__overlay,
.masonry__item:focus-within .masonry__overlay {
    opacity: 1;
}


.button-reset {
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.lightbox {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 8, 25, 0.84);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 24px;
    z-index: 1000;
}

.lightbox--visible {
    display: flex;
}

.lightbox__image {
    max-width: min(90vw, 840px);
    max-height: 90vh;
    border-radius: var(--radius-md);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
}



.lightbox__close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(12px);
}

noscript {
    display: block;
    margin: 24px auto;
    max-width: 640px;
    padding: 16px 20px;
    background: rgba(0,0,0,0.65);
    color: #fff;
    border-radius: 12px;
    text-align: center;
}

@media (max-width: 1024px) {
    .masonry {
        column-count: 2;
        column-gap: 26px;
    }
}

@media (max-width: 640px) {
    :root {
        --radius-lg: 22px;
        --radius-md: 16px;
    }

    main {
        padding: 72px 20px 96px;
        gap: 44px;
    }

    .hero {
        gap: 18px;
    }

    .hero__title {
        font-size: clamp(32px, 9vw, 48px);
    }

    .masonry {
        column-count: 1;
    }

    .masonry__item {
        margin-bottom: 26px;
        box-shadow: 0 24px 55px rgba(35, 23, 48, 0.25);
    }

    .hero__subtitle {
        font-size: 16px;
    }
}

@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;
    }

    .masonry__item {
        transform: none !important;
    }
}
