:root {
    color-scheme: dark;

    --gap: 14px;
    --bg: #090b10;
    --bg-soft: #11141c;
    --card: #161a24;
    --card-strong: #1c2230;
    --card-border: #2a3142;
    --card-border-strong: #3a4560;

    --text: #f3f6fb;
    --muted: #a7b0c0;
    --muted-2: #748095;
    --link: #7db7ff;
    --accent: #8bd3ff;
    --accent-strong: #58a6ff;
    --danger: #ff6b7a;

    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(90, 140, 255, 0.18), transparent 35%),
        radial-gradient(circle at bottom right, rgba(139, 211, 255, 0.12), transparent 35%),
        var(--bg);
    color: var(--text);
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    line-height: 1.6;
}

button,
input {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(9, 11, 16, 0.78);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
}

.hero-wrap {
    width: min(1600px, calc(100% - 32px));
    margin: 0 auto;
    padding: 26px 0 0;
}

.hero-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 24px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    font-size: 0.76rem;
}

h1 {
    margin: 0;
    font-size: clamp(2.4rem, 6vw, 5.4rem);
    line-height: 0.95;
    letter-spacing: -0.07em;
}

.intro {
    max-width: 700px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.15rem);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 12px;
    min-width: 280px;
}

.stat-card {
    padding: 16px 18px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent), var(--card);
    box-shadow: var(--shadow);
}

.stat-card strong {
    display: block;
    font-size: 1.7rem;
    line-height: 1;
    letter-spacing: -0.04em;
}

.stat-card span {
    display: block;
    margin-top: 6px;
    color: var(--muted-2);
    font-size: 0.86rem;
}

.tabs-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    padding-bottom: 12px;
}

.tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    flex-wrap: wrap;
}

.zoom-control {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    color: var(--muted-2);
    font-size: 0.82rem;
    padding-bottom: 2px;
}

.zoom-control input[type=range] {
    width: 110px;
    accent-color: var(--accent-strong);
    cursor: pointer;
    vertical-align: middle;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.055);
}

.tab-btn.active {
    color: var(--bg);
    background: var(--text);
    border-color: var(--text);
    font-weight: 800;
}

.page {
    width: min(1600px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 60px;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin: 10px 0 18px;
}

.section-head h2 {
    margin: 0;
    font-size: clamp(1.3rem, 2.5vw, 1.9rem);
    letter-spacing: -0.04em;
}

.section-head p,
.archive-toolbar .count {
    margin: 4px 0 0;
    color: var(--muted);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 200px;
    gap: var(--gap);
}

.glightbox {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.glightbox:hover {
    transform: translateY(-3px);
    border-color: rgba(139, 211, 255, 0.42);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
    z-index: 2;
}

.thumb-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--card-strong);
}

.thumb-container::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 48%, rgba(0, 0, 0, 0.34));
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.glightbox:hover .thumb-container::after {
    opacity: 1;
}

.thumb-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transform: scale(1.001);
    transition: transform 0.28s ease, filter 0.28s ease;
}

.glightbox:hover .thumb-container img {
    transform: scale(1.045);
    filter: saturate(1.08) contrast(1.03);
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    background: rgba(9, 11, 16, 0.68);
    color: white;
    font-size: 24px;
    pointer-events: none;
    backdrop-filter: blur(8px);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.35);
}

.gdesc-inner {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    color: #d7dce8;
}

.archive-grid .thumb-container {
    cursor: pointer;
}

.archive-grid .glightbox:hover .thumb-container img {
    transform: scale(1.025);
}

.select-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(9, 11, 16, 0.62);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    pointer-events: none;
    z-index: 3;
    backdrop-filter: blur(8px);
}

.thumb-container.selected .select-check {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    color: #fff;
    transform: scale(1.03);
}

.archive-toolbar,
.login-gate,
.empty-msg {
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent), var(--card);
    box-shadow: var(--shadow);
}

.archive-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 16px;
    margin-bottom: 18px;
}

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

.btn {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 0.95rem;
    font-weight: 750;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

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

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.btn-primary {
    background: var(--text);
    color: var(--bg);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.055);
    border-color: var(--card-border);
    color: var(--text);
}

.login-gate {
    width: min(420px, 100%);
    margin: 70px auto;
    padding: 28px;
    text-align: left;
}

.login-gate h2 {
    margin: 0 0 8px;
    letter-spacing: -0.04em;
}

.login-gate p {
    margin: 0 0 18px;
    color: var(--muted);
}

.login-gate input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--card-border-strong);
    border-radius: var(--radius-sm);
    background: #10141d;
    color: var(--text);
    outline: none;
    margin-bottom: 12px;
}

.login-gate input:focus {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 4px rgba(88, 166, 255, 0.16);
}

.login-gate .error {
    color: var(--danger);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.empty-msg {
    grid-column: 1 / -1;
    padding: 48px 24px;
    color: var(--muted);
    text-align: center;
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--text);
    color: var(--bg);
    padding: 12px 18px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 800;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 9999;
    pointer-events: none;
    box-shadow: var(--shadow);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 820px) {
    .site-header {
        position: static;
    }

    .hero-wrap,
    .page {
        width: min(100% - 20px, 1600px);
    }

    .hero-row,
    .section-head {
        grid-template-columns: 1fr;
        display: block;
    }

    .hero-stats {
        margin-top: 18px;
        min-width: 0;
    }

    .zoom-control input[type=range] {
        width: 80px;
    }

    .archive-toolbar {
        align-items: stretch;
    }

    .toolbar-actions,
    .toolbar-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-stats {
        grid-template-columns: 1fr;
    }
}
