:root {
    --accent: #a55fff;
    --accent-light: #c18cff;
    --accent-glow: rgba(165, 95, 255, 0.28);

    --bg: #08080b;
    --bg-soft: #0d0d12;
    --glass: rgba(255, 255, 255, 0.045);
    --glass-hover: rgba(255, 255, 255, 0.075);
    --glass-border: rgba(255, 255, 255, 0.09);

    --text: #f4f1f8;
    --text-dim: #a7a3ae;
    --text-muted: #716d79;

    --success: #7be0a7;

    --rounded: 18px;
    --rounded-small: 12px;

    --container: 1180px;

    --shadow:
        0 12px 40px rgba(0, 0, 0, 0.28);

    --transition:
        180ms cubic-bezier(.2, .8, .2, 1);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;

    background:
        radial-gradient(
            circle at 50% -15%,
            rgba(165, 95, 255, 0.10),
            transparent 42%
        ),
        var(--bg);

    color: var(--text);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    line-height: 1.55;
}

body::before {
    content: "";

    position: fixed;
    inset: 0;

    pointer-events: none;

    background:
        linear-gradient(
            120deg,
            transparent 0%,
            rgba(165, 95, 255, 0.015) 50%,
            transparent 100%
        );

    z-index: -1;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}


/* ============================================================
   LAYOUT
   ============================================================ */

.container {
    width: min(
        calc(100% - 40px),
        var(--container)
    );

    margin: 0 auto;

    padding:
        22px
        0
        80px;
}


/* ============================================================
   HEADER
   ============================================================ */

.site-header {
    position: sticky;
    top: 16px;
    z-index: 20;

    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 62px;

    margin-bottom: 42px;
    padding: 10px 14px 10px 18px;

    background:
        rgba(14, 13, 19, 0.76);

    border: 1px solid var(--glass-border);
    border-radius: 16px;

    box-shadow: var(--shadow);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;

    font-weight: 700;
    letter-spacing: -0.01em;

    transition:
        transform var(--transition),
        opacity var(--transition);
}

.site-brand:hover {
    transform: translateY(-1px);
    opacity: .9;
}

.brand-mark {
    display: grid;
    place-items: center;

    width: 34px;
    height: 34px;

    border-radius: 10px;

    color: white;

    background:
        linear-gradient(
            135deg,
            var(--accent),
            #7440c5
        );

    box-shadow:
        0 0 24px var(--accent-glow);
}

.brand-name {
    font-size: 15px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-link {
    padding: 8px 12px;

    color: var(--text-dim);

    border-radius: 9px;

    font-size: 14px;
    font-weight: 600;

    transition:
        color var(--transition),
        background var(--transition);
}

.nav-link:hover {
    color: var(--text);
    background: var(--glass-hover);
}


/* ============================================================
   HERO
   ============================================================ */

.hero {
    position: relative;

    margin-bottom: 28px;
    padding: 42px 42px 38px;

    overflow: hidden;

    background:
        linear-gradient(
            135deg,
            rgba(165, 95, 255, 0.11),
            rgba(255, 255, 255, 0.025)
        );

    border: 1px solid var(--glass-border);
    border-radius: 24px;

    box-shadow: var(--shadow);
}

.hero::after {
    content: "";

    position: absolute;

    width: 280px;
    height: 280px;

    right: -100px;
    top: -130px;

    border-radius: 50%;

    background:
        rgba(165, 95, 255, 0.12);

    filter: blur(55px);

    pointer-events: none;
}

.hero-copy {
    position: relative;
    z-index: 1;

    max-width: 700px;
}

.eyebrow {
    margin-bottom: 10px;

    color: var(--accent-light);

    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em;
}

.hero h1 {
    margin: 0 0 9px;

    font-size:
        clamp(30px, 5vw, 48px);

    line-height: 1.08;

    letter-spacing: -.035em;
}

.hero p {
    max-width: 620px;

    margin: 0;

    color: var(--text-dim);

    font-size: 16px;
}


/* ============================================================
   SEARCH
   ============================================================ */

.search-box {
    margin-bottom: 20px;
    padding: 14px;

    background: var(--glass);

    border: 1px solid var(--glass-border);
    border-radius: var(--rounded);

    box-shadow: var(--shadow);

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.search-label {
    display: block;

    margin: 0 0 8px 4px;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.search-row {
    display: flex;
    gap: 10px;
}

.search-row input {
    flex: 1;

    min-width: 0;

    height: 46px;

    padding: 0 15px;

    color: var(--text);

    background:
        rgba(0, 0, 0, 0.22);

    border: 1px solid var(--glass-border);
    border-radius: 11px;

    outline: none;

    transition:
        border var(--transition),
        box-shadow var(--transition),
        background var(--transition);
}

.search-row input::placeholder {
    color: var(--text-muted);
}

.search-row input:focus {
    background:
        rgba(0, 0, 0, 0.32);

    border-color:
        rgba(165, 95, 255, .65);

    box-shadow:
        0 0 0 3px rgba(165, 95, 255, .10),
        0 0 25px rgba(165, 95, 255, .08);
}


/* ============================================================
   BUTTONS
   ============================================================ */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;

    padding: 0 17px;

    color: white;

    background:
        linear-gradient(
            135deg,
            var(--accent),
            #8147d0
        );

    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 11px;

    font-weight: 700;
    font-size: 14px;

    box-shadow:
        0 8px 24px rgba(165, 95, 255, .18);

    transition:
        transform var(--transition),
        filter var(--transition),
        box-shadow var(--transition);
}

.button:hover {
    transform: translateY(-1px);

    filter: brightness(1.08);

    box-shadow:
        0 11px 30px rgba(165, 95, 255, .28);
}

.button:active {
    transform: translateY(0);
}

.button-secondary {
    color: var(--text);

    background: var(--glass);

    box-shadow: none;
}


/* ============================================================
   QUICK ACTIONS
   ============================================================ */

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin-bottom: 42px;
}

.quick-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 9px 13px;

    color: var(--text-dim);

    background: var(--glass);

    border: 1px solid var(--glass-border);
    border-radius: 10px;

    font-size: 13px;
    font-weight: 600;

    transition:
        color var(--transition),
        background var(--transition),
        border var(--transition),
        transform var(--transition);
}

.quick-action:hover {
    color: var(--text);

    background: var(--glass-hover);

    transform: translateY(-1px);
}

.quick-action.active {
    color: var(--accent-light);

    border-color:
        rgba(165, 95, 255, .30);

    background:
        rgba(165, 95, 255, .08);
}


/* ============================================================
   SECTION HEADINGS
   ============================================================ */

.catalog-heading,
.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 17px;
}

.catalog-heading h1,
.catalog-heading h2,
.section-heading h1,
.section-heading h2 {
    margin: 0;

    font-size: 23px;
    line-height: 1.2;

    letter-spacing: -.02em;
}

.catalog-count,
.section-heading p {
    margin: 4px 0 0;

    color: var(--text-muted);

    font-size: 13px;
}

.section-link {
    flex-shrink: 0;

    color: var(--accent-light);

    font-size: 13px;
    font-weight: 700;

    transition:
        opacity var(--transition);
}

.section-link:hover {
    opacity: .75;
}


/* ============================================================
   VIEW SWITCH
   ============================================================ */

.view-switch {
    display: flex;

    padding: 3px;

    background: var(--glass);

    border: 1px solid var(--glass-border);
    border-radius: 10px;
}

.view-switch-link {
    padding: 6px 10px;

    color: var(--text-muted);

    border-radius: 7px;

    font-size: 12px;
    font-weight: 700;

    transition:
        color var(--transition),
        background var(--transition);
}

.view-switch-link:hover {
    color: var(--text);
}

.view-switch-link.active {
    color: var(--text);

    background:
        rgba(255, 255, 255, .08);
}


/* ============================================================
   CATALOG GRID
   ============================================================ */

.catalog-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(220px, 1fr)
        );

    gap: 16px;
}

.catalog-item {
    min-width: 0;

    overflow: hidden;

    background: var(--glass);

    border: 1px solid var(--glass-border);
    border-radius: var(--rounded);

    box-shadow:
        0 8px 28px rgba(0, 0, 0, .18);

    transition:
        transform var(--transition),
        background var(--transition),
        border var(--transition),
        box-shadow var(--transition);
}

.catalog-item:hover {
    transform: translateY(-4px);

    background: var(--glass-hover);

    border-color:
        rgba(165, 95, 255, .27);

    box-shadow:
        0 16px 40px rgba(0, 0, 0, .28),
        0 0 30px rgba(165, 95, 255, .05);
}

.catalog-main-link {
    display: block;
}

.catalog-preview {
    position: relative;

    display: grid;
    place-items: center;

    aspect-ratio: 16 / 10;

    overflow: hidden;

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, .045),
            rgba(255, 255, 255, .015)
        );

    border-bottom: 1px solid var(--glass-border);
}

.catalog-preview img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform 400ms cubic-bezier(.2, .8, .2, 1);
}

.catalog-item:hover .catalog-preview img {
    transform: scale(1.045);
}

.catalog-preview.placeholder {
    color: rgba(165, 95, 255, .55);

    font-size: 42px;

    background:
        radial-gradient(
            circle,
            rgba(165, 95, 255, .10),
            transparent 65%
        );
}

.catalog-content {
    display: flex;
    flex-direction: column;
    gap: 4px;

    padding: 14px 14px 10px;
}

.item-title {
    display: block;

    overflow: hidden;

    color: var(--text);

    font-size: 15px;
    font-weight: 700;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-path {
    display: block;

    overflow: hidden;

    color: var(--text-muted);

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;

    font-size: 10px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;

    padding: 0 14px 14px;
}


/* ============================================================
   TAGS
   ============================================================ */

.tag {
    display: inline-flex;
    align-items: center;

    padding: 4px 7px;

    color: var(--text-dim);

    background:
        rgba(255, 255, 255, .045);

    border: 1px solid rgba(255, 255, 255, .065);
    border-radius: 7px;

    font-size: 11px;
    line-height: 1.2;

    transition:
        color var(--transition),
        background var(--transition),
        border var(--transition);
}

.tag:hover,
.tag.active {
    color: var(--accent-light);

    background:
        rgba(165, 95, 255, .10);

    border-color:
        rgba(165, 95, 255, .25);
}

.tag-large {
    padding: 8px 11px;

    border-radius: 10px;

    font-size: 13px;
}

.tag-badge {
    margin-left: 4px;

    color: var(--text-muted);

    font-size: 10px;
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}


/* ============================================================
   TAG SECTION
   ============================================================ */

.tag-section {
    margin-top: 58px;
    padding-top: 32px;

    border-top:
        1px solid var(--glass-border);
}


/* ============================================================
   FOLDERS
   ============================================================ */

.folder-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(260px, 1fr)
        );

    gap: 12px;
}

.folder-card {
    display: flex;
    align-items: center;

    gap: 13px;

    min-width: 0;

    padding: 14px;

    background: var(--glass);

    border: 1px solid var(--glass-border);
    border-radius: var(--rounded-small);

    transition:
        transform var(--transition),
        background var(--transition),
        border var(--transition);
}

.folder-card:hover {
    transform: translateY(-2px);

    background: var(--glass-hover);

    border-color:
        rgba(165, 95, 255, .27);
}

.folder-icon {
    display: grid;
    place-items: center;

    flex: 0 0 48px;

    width: 48px;
    height: 48px;

    overflow: hidden;

    color: var(--accent-light);

    background:
        rgba(165, 95, 255, .09);

    border-radius: 12px;

    font-size: 23px;
}

.folder-icon img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.folder-info {
    display: flex;
    flex-direction: column;

    min-width: 0;
}

.folder-title {
    overflow: hidden;

    color: var(--text);

    font-size: 14px;
    font-weight: 700;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-path {
    overflow: hidden;

    color: var(--text-muted);

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;

    font-size: 10px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-arrow {
    margin-left: auto;

    color: var(--text-muted);

    transition:
        color var(--transition),
        transform var(--transition);
}

.folder-card:hover .folder-arrow {
    color: var(--accent-light);

    transform: translateX(3px);
}


/* ============================================================
   BREADCRUMBS
   ============================================================ */

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;

    margin-bottom: 26px;

    color: var(--text-muted);

    font-size: 12px;
}

.breadcrumb a {
    color: var(--text-dim);

    transition:
        color var(--transition);
}

.breadcrumb a:hover {
    color: var(--accent-light);
}

.breadcrumb .current {
    color: var(--text);
}

.separator {
    color:
        rgba(255, 255, 255, .20);
}


/* ============================================================
   SEARCH PAGE
   ============================================================ */

.search-page h1,
.tags-page h1,
.tag-page h1,
.catalog-page h1 {
    margin: 0;

    font-size:
        clamp(28px, 4vw, 38px);

    line-height: 1.1;

    letter-spacing: -.03em;
}

.search-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin: 25px 0 18px;

    color: var(--text-dim);

    font-size: 13px;
}

.search-summary span {
    color: var(--text-muted);
}

.search-summary strong {
    color: var(--text);
}


/* ============================================================
   TAG PAGE
   ============================================================ */

.tag-page-label {
    margin-bottom: 5px;

    color: var(--accent-light);

    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
}

.tags-page,
.tag-page,
.catalog-page {
    margin-bottom: 40px;
}


/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 230px;

    padding: 35px;

    color: var(--text-dim);
    text-align: center;

    background: var(--glass);

    border: 1px dashed var(--glass-border);
    border-radius: var(--rounded);
}

.empty-message h2 {
    margin: 7px 0 4px;

    color: var(--text);

    font-size: 19px;
}

.empty-message p {
    margin: 0 0 18px;

    color: var(--text-muted);

    font-size: 13px;
}

.empty-icon {
    color: var(--accent-light);

    font-size: 34px;

    opacity: .7;
}


/* ============================================================
   404
   ============================================================ */

.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height:
        calc(100vh - 180px);

    padding: 40px;

    text-align: center;
}

.error-code {
    margin-bottom: 5px;

    color: var(--accent);

    font-size:
        clamp(100px, 20vw, 190px);

    font-weight: 900;

    line-height: .85;

    letter-spacing: -.08em;

    text-shadow:
        0 0 60px rgba(165, 95, 255, .25);
}

.error-page h1 {
    margin: 28px 0 8px;

    font-size: 25px;
}

.error-page p {
    max-width: 600px;

    margin: 0 0 25px;

    color: var(--text-dim);

    font-size: 14px;
}

.error-page code {
    padding: 3px 7px;

    color: var(--accent-light);

    background:
        rgba(165, 95, 255, .08);

    border: 1px solid
        rgba(165, 95, 255, .15);

    border-radius: 6px;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;

    font-size: 12px;

    word-break: break-word;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    gap: 9px;
}


/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background:
        rgba(255, 255, 255, .10);

    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background:
        rgba(165, 95, 255, .35);
}


/* ============================================================
   SELECTION
   ============================================================ */

::selection {
    color: white;

    background:
        rgba(165, 95, 255, .40);
}


/* ============================================================
   FOCUS
   ============================================================ */

:focus-visible {
    outline:
        2px solid rgba(165, 95, 255, .75);

    outline-offset: 3px;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 760px) {

    .container {
        width: min(
            calc(100% - 24px),
            var(--container)
        );

        padding-top: 12px;
    }

    .site-header {
        top: 8px;

        flex-direction: column;
        align-items: stretch;

        gap: 12px;

        margin-bottom: 25px;

        padding: 12px 14px;

        border-radius: 14px;
    }

    .site-brand {
        justify-content: center;
    }

    .site-nav {
        justify-content: center;
        flex-wrap: wrap;

        gap: 4px;
    }

    .nav-link {
        padding: 7px 8px;

        font-size: 12px;
    }

    .brand-name {
        font-size: 13px;
    }

    .brand-mark {
        width: 31px;
        height: 31px;
    }

    .hero {
        padding:
            30px
            24px;

        border-radius: 19px;
    }

    .hero h1 {
        font-size: 31px;
    }

    .hero p {
        font-size: 14px;
    }

    .search-row {
        flex-direction: column;
    }

    .search-row input {
        width: 100%;
    }

    .search-row .button {
        width: 100%;
    }

    .catalog-heading,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .catalog-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        gap: 10px;
    }

    .catalog-item {
        border-radius: 14px;
    }

    .catalog-content {
        padding: 11px 11px 8px;
    }

    .item-tags {
        padding:
            0
            11px
            11px;
    }

    .item-title {
        font-size: 13px;
    }

    .item-path {
        font-size: 9px;
    }

    .tag {
        font-size: 10px;
    }

    .folder-grid {
        grid-template-columns: 1fr;
    }

    .view-switch {
        width: 100%;
    }

    .view-switch-link {
        flex: 1;

        text-align: center;
    }

    .search-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .error-page {
        min-height:
            calc(100vh - 130px);

        padding: 20px 5px;
    }

    .error-page h1 {
        font-size: 21px;
    }
}

@media (max-width: 430px) {

    .catalog-grid {
        grid-template-columns: 1fr;
    }

    .catalog-preview {
        aspect-ratio: 16 / 9;
    }

    .quick-actions {
        margin-bottom: 32px;
    }

    .hero {
        margin-bottom: 15px;
    }
}


/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ============================================================
   ASSET PAGE
   ============================================================ */

.page-header {
    margin-bottom: 18px;
}

.page-header h1 {
    margin: 0 0 14px;

    font-size:
        clamp(30px, 4vw, 42px);

    line-height: 1.1;

    letter-spacing: -.035em;
}

.tags {
    display: flex;
    flex-wrap: wrap;

    gap: 6px;
}


/* ============================================================
   ASSET GALLERY
   ============================================================ */

.gallery {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(280px, 1fr)
        );

    gap: 14px;

    margin-top: 22px;
}

.gallery-item {
    position: relative;

    display: block;

    overflow: hidden;

    background:
        rgba(255, 255, 255, .035);

    border:
        1px solid var(--glass-border);

    border-radius: var(--rounded);

    box-shadow:
        0 10px 30px rgba(0, 0, 0, .22);

    transition:
        transform var(--transition),
        border var(--transition),
        box-shadow var(--transition),
        background var(--transition);
}

.gallery-item:hover {
    transform: translateY(-3px);

    background:
        rgba(255, 255, 255, .055);

    border-color:
        rgba(165, 95, 255, .28);

    box-shadow:
        0 18px 45px rgba(0, 0, 0, .32),
        0 0 30px rgba(165, 95, 255, .06);
}

.gallery-item img {
    display: block;

    width: 100%;
    height: auto;

    max-width: 100%;

    object-fit: contain;

    transition:
        transform 450ms cubic-bezier(.2, .8, .2, 1);
}

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


/* ============================================================
   ASSET DESCRIPTION
   ============================================================ */

.description {
    margin-top: 30px;
    padding: 24px;

    background: var(--glass);

    border:
        1px solid var(--glass-border);

    border-radius: var(--rounded);

    box-shadow:
        0 10px 30px rgba(0, 0, 0, .16);
}

.description > :first-child {
    margin-top: 0;
}

.description > :last-child {
    margin-bottom: 0;
}

.description h2 {
    margin:
        26px
        0
        10px;

    font-size: 20px;

    line-height: 1.25;

    letter-spacing: -.02em;
}

.description h3 {
    margin:
        22px
        0
        8px;

    font-size: 17px;
}

.description p {
    margin: 0 0 14px;

    color: var(--text-dim);

    font-size: 14px;
}

.description ul,
.description ol {
    margin:
        10px
        0
        16px;

    padding-left: 22px;

    color: var(--text-dim);

    font-size: 14px;
}

.description li {
    margin-bottom: 5px;
}

.description a {
    color: var(--accent-light);

    text-decoration:
        underline;

    text-decoration-color:
        rgba(193, 140, 255, .35);

    text-underline-offset: 3px;
}

.description a:hover {
    text-decoration-color:
        var(--accent-light);
}


/* ============================================================
   ASSET ACTION LINKS
   ============================================================ */

.links {
    display: flex;
    flex-wrap: wrap;

    gap: 9px;

    margin-top: 22px;
}

.links .button {
    min-height: 44px;
}


/* ============================================================
   ASSET PAGE MOBILE
   ============================================================ */

@media (max-width: 760px) {

    .page-header h1 {
        font-size: 30px;
    }

    .gallery {
        grid-template-columns: 1fr;

        gap: 10px;

        margin-top: 18px;
    }

    .gallery-item {
        border-radius: 14px;
    }

    .description {
        margin-top: 18px;
        padding: 18px;
    }

    .links {
        flex-direction: column;
    }

    .links .button {
        width: 100%;
    }
}

/* ============================================================
   LIGHTBOX
   ============================================================ */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, .92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 300ms ease,
        visibility 300ms ease;
}

.lightbox:not([hidden]) {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: center;

    max-width: 90vw;
    max-height: 85vh;

    margin: 0;

    background: transparent;
}

.lightbox-content img {
    display: block;

    max-width: 100%;
    max-height: 80vh;

    object-fit: contain;

    border-radius: 12px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, .6);
}

.lightbox-content figcaption {
    margin-top: 14px;

    color: rgba(255, 255, 255, .6);

    font-size: 13px;
    font-weight: 500;

    text-align: center;

    user-select: none;
}

/* ============================================================
   LIGHTBOX BUTTONS
   ============================================================ */

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: fixed;

    display: grid;
    place-items: center;

    width: 48px;
    height: 48px;

    color: rgba(255, 255, 255, .7);

    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 50%;

    font-size: 28px;
    line-height: 1;

    transition:
        background 200ms,
        transform 200ms,
        color 200ms;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    color: white;

    background: rgba(255, 255, 255, .16);

    transform: scale(1.05);
}

.lightbox-close {
    top: 24px;
    right: 24px;

    font-size: 32px;
}

.lightbox-prev {
    left: 24px;
    top: 50%;

    transform: translateY(-50%);

    font-size: 32px;
}

.lightbox-next {
    right: 24px;
    top: 50%;

    transform: translateY(-50%);

    font-size: 32px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    transform: translateY(-50%) scale(1.05);
}

/* ============================================================
   LIGHTBOX BODY STATE
   ============================================================ */

body.lightbox-open {
    overflow: hidden;
}

/* ============================================================
   LIGHTBOX RESPONSIVE
   ============================================================ */

@media (max-width: 760px) {
    .lightbox {
        padding: 10px;
    }

    .lightbox-content {
        max-width: 100vw;
        max-height: 90vh;
    }

    .lightbox-content img {
        max-height: 70vh;
        border-radius: 8px;
    }

    .lightbox-close {
        top: 12px;
        right: 12px;

        width: 40px;
        height: 40px;

        font-size: 26px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;

        font-size: 26px;
    }

    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }
}

@media (max-width: 430px) {
    .lightbox-content img {
        max-height: 60vh;
    }

    .lightbox-close {
        top: 8px;
        right: 8px;

        width: 36px;
        height: 36px;

        font-size: 22px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 36px;
        height: 36px;

        font-size: 22px;
    }
}

/* ============================================================
   UX/UI EXTENSIONS
   Дополнительные стили для нового index.php
   ============================================================ */


/* ------------------------------------------------------------
   SEARCH
   ------------------------------------------------------------ */

.search-box {
    margin: 28px 0 34px;
    padding: 18px;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,.045),
            rgba(255,255,255,.018)
        );
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.search-label {
    display: block;
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.search-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.search-row input {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 15px;

    border: 1px solid var(--glass-border);
    border-radius: 11px;

    outline: none;

    background: rgba(0,0,0,.22);
    color: var(--text);

    font: inherit;
    font-size: 14px;

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.search-row input::placeholder {
    color: var(--text-dim);
    opacity: .75;
}

.search-row input:hover {
    background: rgba(255,255,255,.025);
}

.search-row input:focus {
    border-color: var(--accent);
    background: rgba(0,0,0,.28);

    box-shadow:
        0 0 0 3px var(--accent-glow),
        0 0 30px rgba(165,95,255,.08);
}

.search-row .button {
    flex: 0 0 auto;
    min-width: 92px;
}


/* Search results information */

.search-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    margin: 22px 0;

    font-size: 14px;
    color: var(--text-dim);
}

.search-summary strong {
    color: var(--text);
    font-weight: 600;
}

.search-summary > span {
    flex: 0 0 auto;

    padding: 5px 10px;

    border: 1px solid var(--glass-border);
    border-radius: 999px;

    background: rgba(255,255,255,.025);

    font-size: 12px;
    white-space: nowrap;
}


/* ------------------------------------------------------------
   QUICK ACTIONS
   ------------------------------------------------------------ */

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 0 0 34px;
}

.quick-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    min-height: 38px;
    padding: 0 14px;

    border: 1px solid var(--glass-border);
    border-radius: 10px;

    background: rgba(255,255,255,.025);
    color: var(--text-dim);

    text-decoration: none;
    font-size: 13px;
    font-weight: 600;

    transition:
        transform .18s ease,
        border-color .18s ease,
        background .18s ease,
        color .18s ease,
        box-shadow .18s ease;
}

.quick-action:hover {
    transform: translateY(-1px);

    color: var(--text);
    border-color: rgba(165,95,255,.38);

    background: rgba(165,95,255,.08);

    box-shadow:
        0 8px 24px rgba(0,0,0,.18);
}

.quick-action.active {
    color: var(--text);

    border-color: rgba(165,95,255,.5);

    background:
        linear-gradient(
            135deg,
            rgba(165,95,255,.16),
            rgba(165,95,255,.06)
        );

    box-shadow:
        0 0 0 1px rgba(165,95,255,.08),
        0 8px 26px rgba(165,95,255,.08);
}

.quick-action > span:first-child {
    font-size: 15px;
    color: var(--accent);
}


/* ------------------------------------------------------------
   CATALOG HEADING
   ------------------------------------------------------------ */

.catalog-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;

    margin: 0 0 18px;
}

.catalog-heading h2 {
    margin: 0;
}

.catalog-count {
    margin: 5px 0 0;
    color: var(--text-dim);
    font-size: 13px;
}


/* ------------------------------------------------------------
   VIEW SWITCH
   ------------------------------------------------------------ */

.view-switch {
    display: inline-flex;
    align-items: center;
    gap: 3px;

    padding: 4px;

    border: 1px solid var(--glass-border);
    border-radius: 11px;

    background: rgba(255,255,255,.025);

    flex: 0 0 auto;
}

.view-switch-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 32px;
    padding: 0 12px;

    border-radius: 8px;

    color: var(--text-dim);
    text-decoration: none;

    font-size: 12px;
    font-weight: 600;

    transition:
        background .18s ease,
        color .18s ease,
        box-shadow .18s ease;
}

.view-switch-link:hover {
    color: var(--text);
    background: rgba(255,255,255,.045);
}

.view-switch-link.active {
    color: var(--text);

    background:
        linear-gradient(
            135deg,
            rgba(165,95,255,.18),
            rgba(165,95,255,.08)
        );

    box-shadow:
        0 2px 10px rgba(0,0,0,.18);
}


/* ------------------------------------------------------------
   FOLDER GRID
   ------------------------------------------------------------ */

.folder-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(260px, 1fr)
        );

    gap: 12px;

    margin-top: 4px;
}

.folder-card {
    position: relative;

    display: flex;
    align-items: center;
    gap: 14px;

    min-height: 82px;
    padding: 14px 16px;

    overflow: hidden;

    border: 1px solid var(--glass-border);
    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,.035),
            rgba(255,255,255,.015)
        );

    color: var(--text);
    text-decoration: none;

    transition:
        transform .2s ease,
        border-color .2s ease,
        background .2s ease,
        box-shadow .2s ease;
}

.folder-card::before {
    content: "";

    position: absolute;
    inset: 0;

    background:
        radial-gradient(
            circle at 0 50%,
            rgba(165,95,255,.13),
            transparent 55%
        );

    opacity: 0;

    transition: opacity .2s ease;
}

.folder-card:hover {
    transform: translateY(-2px);

    border-color: rgba(165,95,255,.4);

    background:
        linear-gradient(
            135deg,
            rgba(165,95,255,.075),
            rgba(255,255,255,.02)
        );

    box-shadow:
        0 12px 35px rgba(0,0,0,.25),
        0 0 25px rgba(165,95,255,.05);
}

.folder-card:hover::before {
    opacity: 1;
}

.folder-icon {
    position: relative;
    z-index: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    flex: 0 0 48px;

    border-radius: 12px;

    border: 1px solid var(--glass-border);

    background: rgba(255,255,255,.035);

    font-size: 23px;

    overflow: hidden;
}

.folder-icon img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.folder-info {
    position: relative;
    z-index: 1;

    display: flex;
    flex-direction: column;

    min-width: 0;
    flex: 1;
}

.folder-title {
    overflow: hidden;

    color: var(--text);

    font-size: 14px;
    font-weight: 650;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-path {
    margin-top: 4px;

    overflow: hidden;

    color: var(--text-dim);

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;

    font-size: 11px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-arrow {
    position: relative;
    z-index: 1;

    flex: 0 0 auto;

    color: var(--text-dim);

    font-size: 16px;

    transition:
        transform .2s ease,
        color .2s ease;
}

.folder-card:hover .folder-arrow {
    color: var(--accent);
    transform: translateX(3px);
}


/* ------------------------------------------------------------
   TAG SECTION
   ------------------------------------------------------------ */

.tag-section {
    margin-top: 52px;
    padding-top: 30px;

    border-top: 1px solid rgba(255,255,255,.06);
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 18px;
}

.section-heading h1,
.section-heading h2 {
    margin: 0;
}

.section-heading p {
    margin: 5px 0 0;

    color: var(--text-dim);
    font-size: 13px;
}

.section-link {
    color: var(--text-dim);
    text-decoration: none;

    font-size: 12px;
    font-weight: 600;

    transition:
        color .18s ease,
        transform .18s ease;
}

.section-link:hover {
    color: var(--accent);
}


/* ------------------------------------------------------------
   TAG CLOUD
   ------------------------------------------------------------ */

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.tag-large {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    min-height: 34px;
    padding: 0 11px;

    border-radius: 9px;

    transition:
        transform .18s ease,
        border-color .18s ease,
        background .18s ease,
        color .18s ease;
}

.tag-large:hover {
    transform: translateY(-1px);

    border-color: rgba(165,95,255,.38);

    background: rgba(165,95,255,.08);
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 19px;
    height: 19px;

    padding: 0 5px;

    border-radius: 999px;

    background: rgba(255,255,255,.06);

    color: var(--text-dim);

    font-size: 10px;
    font-weight: 700;
}


/* ------------------------------------------------------------
   TAG PAGE
   ------------------------------------------------------------ */

.tag-page-label {
    margin-bottom: 5px;

    color: var(--accent);

    font-size: 10px;
    font-weight: 800;
    letter-spacing: .16em;
}

.tag-page h1 {
    margin-bottom: 4px;
}

.tag-page .section-heading p {
    color: var(--text-dim);
}


/* ------------------------------------------------------------
   TAG FILTER / ADD BUTTONS
   Для будущей разметки:
   .tag-filter
   .tag-add
   .tag-remove
   .tag.active
   ------------------------------------------------------------ */

.tag-filter {
    display: inline-flex;
    align-items: center;

    min-height: 30px;

    border: 1px solid var(--glass-border);
    border-radius: 9px;

    background: rgba(255,255,255,.025);

    overflow: hidden;

    transition:
        border-color .18s ease,
        background .18s ease,
        box-shadow .18s ease;
}
.tag-filter:hover {
    border-color: rgba(165,95,255,.35);

    background:
        linear-gradient(
            135deg,
            rgba(165,95,255,.06),
            rgba(255,255,255,.02)
        );
}
.tag-add,
.tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 18px;
    height: 18px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: rgba(255,255,255,.055);

    color: var(--text-dim);

    font-family: inherit;
    font-size: 13px;
    line-height: 1;

    cursor: pointer;

    transition:
        background .16s ease,
        color .16s ease,
        transform .16s ease;
}
.tag-filter .tag {
    display: inline-flex;
    align-items: center;

    min-height: 28px;
    padding: 0 8px;

    border: 0;
    border-radius: 0;

    background: transparent;

    color: var(--text-dim);

    text-decoration: none;

    font-size: 11px;
    line-height: 1;

    transition:
        color .16s ease,
        background .16s ease;
}
.tag-filter .tag:hover {
    color: var(--text);

    background: rgba(255,255,255,.045);
}

.tag-add:hover {
    color: #fff;
    background: var(--accent);

    transform: scale(1.08);
}

.tag-remove {
    color: var(--accent);
}

.tag-remove:hover {
    color: #fff;
    background: rgba(255,80,100,.7);

    transform: scale(1.08);
}

.tag-filter .tag-add {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 27px;
    height: 28px;

    padding: 0;

    border: 0;
    border-left: 1px solid rgba(255,255,255,.075);
    border-radius: 0;

    background: transparent;

    color: var(--text-dim);

    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;

    cursor: pointer;

    transition:
        color .16s ease,
        background .16s ease;
}

.tag-filter .tag-add:hover {
    color: #fff;

    background:
        rgba(165,95,255,.16);
}

.tag-filter .tag-add:active {
    background:
        rgba(165,95,255,.24);
}
/* Selected tag */
.tag-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 20px;
    height: 20px;

    margin-left: 5px;
    padding: 0 6px;

    border: 1px solid var(--glass-border);
    border-radius: 7px;

    background: rgba(255,255,255,.025);

    color: var(--text-dim);

    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}
.tag.active {
    color: var(--text);

    border-color: rgba(165,95,255,.55);

    background:
        linear-gradient(
            135deg,
            rgba(165,95,255,.17),
            rgba(165,95,255,.07)
        );

    box-shadow:
        0 0 0 1px rgba(165,95,255,.06);
}
.tag-filter.active {
    border-color: rgba(165,95,255,.45);

    background:
        linear-gradient(
            135deg,
            rgba(165,95,255,.12),
            rgba(165,95,255,.045)
        );

    box-shadow:
        0 0 0 1px rgba(165,95,255,.04);
}

.tag-filter.active .tag {
    color: var(--text);
}

.tag-filter.active .tag-add {
    color: var(--accent);

    border-left-color:
        rgba(165,95,255,.22);
}

.tag-filter.active .tag-add:hover {
    color: #fff;

    background:
        rgba(165,95,255,.18);
}

.tag-filter.active .tag-count {
    border-color:
        rgba(165,95,255,.22);

    background:
        rgba(165,95,255,.08);

    color: var(--text);
}

/* ------------------------------------------------------------
   MULTI-TAG SEARCH
   ------------------------------------------------------------ */

.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;

    margin-top: 12px;
}

.search-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    min-height: 29px;
    padding: 0 9px;

    border: 1px solid rgba(165,95,255,.25);
    border-radius: 8px;

    background: rgba(165,95,255,.07);

    color: var(--text);

    font-size: 12px;
}

.search-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 16px;
    height: 16px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: transparent;

    color: var(--text-dim);

    cursor: pointer;

    transition:
        background .15s ease,
        color .15s ease;
}

.search-tag-remove:hover {
    color: #fff;
    background: rgba(255,255,255,.1);
}


/* ------------------------------------------------------------
   EMPTY STATES
   ------------------------------------------------------------ */

.empty-message {
    border: 1px solid var(--glass-border);
    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,.025),
            rgba(255,255,255,.012)
        );

    text-align: center;
}

.empty-icon {
    margin-bottom: 8px;

    color: var(--accent);

    font-size: 32px;
}

.empty-message h2 {
    margin: 0 0 7px;
}

.empty-message p {
    margin: 0 0 18px;
    color: var(--text-dim);
}


/* ------------------------------------------------------------
   ERROR PAGE
   ------------------------------------------------------------ */

.error-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;

    margin-top: 24px;
}

.button-secondary {
    border-color: var(--glass-border);

    background: rgba(255,255,255,.035);

    color: var(--text-dim);
}

.button-secondary:hover {
    color: var(--text);

    border-color: rgba(255,255,255,.18);

    background: rgba(255,255,255,.06);
}


/* ------------------------------------------------------------
   ASSET CARD ENHANCEMENTS
   ------------------------------------------------------------ */

.asset-card {
    position: relative;
}

.asset-card .catalog-content {
    min-width: 0;
}

.asset-card .item-path {
    display: block;

    margin-top: 5px;

    overflow: hidden;

    color: var(--text-dim);

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;

    font-size: 10px;

    opacity: .7;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.asset-card .item-tags {
    position: relative;
    z-index: 2;
}


/* ------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------ */

@media (max-width: 700px) {

    .search-row {
        flex-direction: column;
    }

    .search-row .button {
        width: 100%;
    }

    .catalog-heading,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .view-switch {
        width: 100%;
    }

    .view-switch-link {
        flex: 1;
    }

    .search-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .folder-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        width: 100%;
    }

    .quick-action {
        flex: 1 1 calc(50% - 9px);
        justify-content: center;
    }
}

@media (max-width: 480px) {

    .search-box {
        padding: 13px;
        border-radius: 13px;
    }

    .folder-card {
        min-height: 74px;
        padding: 12px;
    }

    .folder-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .tags-cloud {
        gap: 6px;
    }

    .tag-large {
        min-height: 32px;
        padding: 0 9px;
    }

    .quick-action {
        flex: 1 1 100%;
    }
}
/* ============================================================
 * PAGINATION STYLES (Custom Glassmorphism Theme)
 * ============================================================ */

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

.page-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-link,
.page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 14px;
    font-size: 0.9rem;
    font-weight: 500;
    
    /* Твой glassmorphism фон и переменные текста */
    color: var(--text, #cad3f5);
    background-color: var(--surface0, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: var(--rounded-small, 10px);
    
    /* Эффект матового стекла */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    text-decoration: none;
    user-select: none;
    cursor: pointer;
    
    /* Добавлен transform для динамики при ховере */
    transition: 
        background-color var(--transition, 0.2s ease),
        border-color var(--transition, 0.2s ease),
        color var(--transition, 0.2s ease),
        box-shadow var(--transition, 0.2s ease),
        transform var(--transition, 0.2s ease);
}

.page-number {
    min-width: 38px;
    padding: 0 8px;
}

/* Ховер состояние с мягким подъемом и подсветкой грани */
.page-link:hover:not(.disabled),
.page-number:hover:not(.active) {
    background-color: var(--surface1, rgba(255, 255, 255, 0.07));
    border-color: rgba(154, 135, 237, 0.4);
    color: var(--text-highlight, #ffffff);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* Клик / Нажатие */
.page-link:active:not(.disabled),
.page-number:active:not(.active) {
    transform: translateY(0) scale(0.96);
}

/* Активная страница с неоновым свечением */
.page-number.active {
    background: linear-gradient(135deg, var(--accent, #9a87ed), #7440c5);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-weight: 600;
    cursor: default;
    box-shadow: 
        0 0 16px var(--accent-glow, rgba(154, 135, 237, 0.45)),
        0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Неактивное состояние */
.page-link.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.04);
    pointer-events: none;
    filter: grayscale(1);
}

/* Многоточие */
.page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 38px;
    color: var(--text-muted, rgba(255, 255, 255, 0.4));
    font-size: 0.9rem;
    user-select: none;
}