/* ============================================================
   Waifu Gallery — SylStudio Theme (Premium)
   ============================================================ */

/* ─── Variables ─── */
:root {
    --bg-gradient: radial-gradient(circle at top left, #FFE4ED 0%, #FFF5F8 40%, #FFF8FA 100%);
    --bg-card: #FFFFFF;
    --bg-hover: #FFF7FA;
    --text-primary: #1F1F2E;
    --text-secondary: #8b7a86;
    --text-muted: #D4A0B5;
    --accent: #EC4899;
    --accent-light: #F472B6;
    --accent-dark: #DB2777;
    --accent-gradient: linear-gradient(135deg, #F472B6 0%, #EC4899 50%, #DB2777 100%);
    --border-color: rgba(236, 72, 153, 0.10);
    --border-hover: rgba(236, 72, 153, 0.25);
    --shadow: 0 8px 28px -8px rgba(236, 72, 153, 0.12);
    --shadow-hover: 0 14px 40px -10px rgba(236, 72, 153, 0.20);
    --radius-card: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --sidebar-width: 260px;
    --header-height: 68px;
    --transition: 0.30s cubic-bezier(0.4, 0, 0.2, 1);
    --bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Reset & Base ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
::selection { background: rgba(236, 72, 153, 0.20); color: #1F1326; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh; min-height: 100dvh;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}
a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-dark); }

/* ─── Decorative Background Blobs ─── */
.bg-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    pointer-events: none;
    z-index: -1;
    animation: blobFloat 20s ease-in-out infinite;
}
.blob-1 {
    width: 500px; height: 500px;
    background: #F472B6;
    top: -120px; right: -100px;
    animation-delay: 0s;
}
.blob-2 {
    width: 400px; height: 400px;
    background: #818cf8;
    bottom: -80px; left: -120px;
    animation-delay: -7s;
    opacity: 0.20;
}
.blob-3 {
    width: 300px; height: 300px;
    background: #F5B945;
    bottom: 30%; right: -60px;
    animation-delay: -14s;
    opacity: 0.15;
}
@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(40px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(30px, 40px) scale(1.02); }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(236, 72, 153, 0.20); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(236, 72, 153, 0.35); }

/* ===== Header / Navbar ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    transition: var(--transition);
}
.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    position: relative;
}
.logo-icon {
    font-size: 28px;
    display: inline-block;
    animation: logoWave 3s ease-in-out infinite;
}
@keyframes logoWave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(8deg); }
    75% { transform: rotate(-4deg); }
}
.logo-text {
    font-family: 'Sora', sans-serif;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

/* ─── Search ─── */
.search-box {
    position: relative;
    width: 220px;
    transition: var(--transition);
}
.search-box:focus-within { width: 260px; }
.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition);
}
.search-box:focus-within .search-icon { color: var(--accent); }
.search-box input {
    width: 100%;
    padding: 9px 14px 9px 40px;
    background: #FFF7FA;
    border: 1.5px solid transparent;
    border-radius: 999px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    transition: var(--transition);
    outline: none;
}
.search-box input:focus {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.10);
}
.search-box input::placeholder { color: var(--text-muted); font-weight: 500; }

/* Badge */
.badge-all {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--accent);
    background: rgba(236, 72, 153, 0.08);
    border: 1px solid rgba(236, 72, 153, 0.16);
    padding: 6px 14px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: var(--transition);
}
.badge-all:hover { background: rgba(236, 72, 153, 0.14); }

/* ─── Mobile Menu ─── */
.mobile-menu-btn {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
}
.mobile-menu-btn:hover { background: #FFF7FA; border-color: var(--border-hover); }

.mobile-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 12px 40px rgba(236, 72, 153, 0.08);
    padding: 16px 20px 20px;
    z-index: 99;
    max-height: calc(100vh - var(--header-height) - 8px);
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
    transition: visibility 0.3s, opacity 0.3s, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}
.mobile-menu.open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.mobile-search-box input {
    width: 100%;
    padding: 11px 18px;
    background: #FFF7FA;
    border: 1.5px solid transparent;
    border-radius: 999px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    outline: none;
    margin-bottom: 14px;
    transition: var(--transition);
}
.mobile-search-box input:focus {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.10);
}
.mobile-tags {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.mobile-tags .tag-item {
    font-size: 12px;
    padding: 10px 14px;
    justify-content: center;
    text-align: center;
    border-radius: 999px !important;
}

/* ===== Layout ===== */
.main-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: calc(var(--header-height) + 28px) 24px 40px;
    gap: 28px;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    padding: 20px;
    position: sticky;
    top: calc(var(--header-height) + 28px);
    height: fit-content;
    max-height: calc(100vh - var(--header-height) - 56px);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.sidebar-section { margin-bottom: 24px; }
.sidebar-section:last-child { margin-bottom: 0; }

.sidebar-title {
    font-family: 'Sora', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1.5px solid var(--border-color);
}

.tag-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tag-loading {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    padding: 12px 8px;
    text-align: center;
}

.tag-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all 0.20s ease;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid transparent;
    position: relative;
}
.tag-item:hover {
    background: #FFF7FA;
    color: var(--text-primary);
    border-color: var(--border-color);
    transform: translateX(3px);
}
.tag-item.active {
    background: rgba(236, 72, 153, 0.08);
    color: var(--accent);
    border-color: rgba(236, 72, 153, 0.20);
    transform: translateX(3px);
}
.tag-item .tag-count {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    background: #FFF0F5;
    padding: 2px 8px;
    border-radius: 999px;
    min-width: 28px;
    text-align: center;
    transition: var(--transition);
}
.tag-item.active .tag-count {
    background: rgba(236, 72, 153, 0.15);
    color: var(--accent);
}

.tag-group-header {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 14px 12px 6px;
    margin-top: 6px;
}
.sfw-header { color: #10b981; }
.nsfw-header { color: #ef4444; }

.tag-nsfw { border-left: 2px solid rgba(239, 68, 68, 0.20); }
.tag-nsfw:hover { border-left-color: rgba(239, 68, 68, 0.50); }

.sidebar-info {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 2;
}
.sidebar-info p { display: flex; align-items: center; gap: 5px; }

.count-value {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
    transition: all 0.3s;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    min-width: 0;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.gallery-info h2 {
    font-family: 'Sora', sans-serif;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.15;
}
.gallery-info p {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 3px;
}

.gallery-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.control-select {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23D4A0B5' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.control-select:hover { border-color: var(--border-hover); background: #fff; }
.control-select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.10); }
.control-select option { background: var(--bg-card); color: var(--text-primary); }

/* ===== Loading State ===== */
.loading-state,
.error-state,
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}
.loading-state.show, .error-state.show, .empty-state.show { display: flex; }

.loading-pulse {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--accent);
    animation: pulseRing 1.5s ease-out infinite;
}
@keyframes pulseRing {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}
.loading-pulse::after {
    content: '🌸';
    font-size: 26px;
    animation: pulseBounce 1.5s ease-in-out infinite;
}
@keyframes pulseBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
.loading-state p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(236, 72, 153, 0.12);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.loading-spinner.small { margin-bottom: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Error / Empty ===== */
.error-icon, .empty-icon { font-size: 52px; margin-bottom: 16px; }
.error-state h3, .empty-state h3 {
    font-family: 'Sora', sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}
.error-state p, .empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

.retry-btn {
    padding: 11px 28px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 999px;
    color: white;
    font-size: 14px;
    font-weight: 800;
    font-family: inherit;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: 0 8px 24px -6px rgba(236, 72, 153, 0.40);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.retry-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 32px -8px rgba(236, 72, 153, 0.50); }
.retry-btn:active { transform: scale(0.97); }

/* ===== Gallery Grid ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-card);
    aspect-ratio: 3/4;
    transition: all 0.40s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px -4px rgba(236, 72, 153, 0.06);
    opacity: 0;
    transform: translateY(24px) scale(0.97);
    animation: cardEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.gallery-item:nth-child(1) { animation-delay: 0.02s; }
.gallery-item:nth-child(2) { animation-delay: 0.05s; }
.gallery-item:nth-child(3) { animation-delay: 0.08s; }
.gallery-item:nth-child(4) { animation-delay: 0.11s; }
.gallery-item:nth-child(5) { animation-delay: 0.14s; }
.gallery-item:nth-child(6) { animation-delay: 0.17s; }
.gallery-item:nth-child(7) { animation-delay: 0.20s; }
.gallery-item:nth-child(8) { animation-delay: 0.23s; }
.gallery-item:nth-child(9) { animation-delay: 0.26s; }
.gallery-item:nth-child(10) { animation-delay: 0.29s; }

@keyframes cardEnter {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}
.gallery-item:hover img { transform: scale(1.08); }

/* Image fade-in on load */
.gallery-item img {
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.gallery-item img.loaded { opacity: 1; }

.gallery-item .item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 50px 16px 16px;
    background: linear-gradient(transparent 20%, rgba(255, 255, 255, 0.92) 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
    transform: translateZ(0);
}
.gallery-item:hover .item-overlay { opacity: 1; }

.item-overlay .item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.item-overlay .item-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    background: var(--bg-card);
    border-radius: 999px;
    color: var(--accent);
    box-shadow: 0 2px 10px rgba(236, 72, 153, 0.08);
    backdrop-filter: blur(4px);
}

.gallery-item .item-dominant {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

.item-nsfw-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 9px;
    font-weight: 800;
    padding: 4px 10px;
    background: #ef4444;
    border-radius: 999px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    pointer-events: none;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.30);
}

/* ===== Load More ===== */
.load-more {
    display: flex;
    justify-content: center;
    padding: 8px 0 24px;
}
.load-more-btn {
    display: none;
    padding: 13px 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 16px -4px rgba(236, 72, 153, 0.06);
}
.load-more-btn:hover {
    background: #FFF7FA;
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}
.load-more-btn:active { transform: scale(0.97); }
.load-more-btn.show { display: inline-flex; align-items: center; gap: 8px; }

.load-more-spinner {
    display: none;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}
.load-more-spinner.show { display: flex; }

/* ===== Lightbox ===== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 248, 250, 0.92);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 40px;
    animation: lbFadeIn 0.25s ease;
}
.lightbox.open { display: flex; }
@keyframes lbFadeIn { from { opacity: 0; } to { opacity: 1; } }

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    z-index: 10;
    box-shadow: 0 4px 16px rgba(236, 72, 153, 0.08);
}
.lightbox-close:hover { background: #FFF7FA; border-color: var(--border-hover); transform: rotate(90deg); }

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 26px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.10);
    opacity: 0;
    transform: translateY(-50%) scale(0.9);
}
.lightbox.open .lightbox-nav { opacity: 1; transform: translateY(-50%) scale(1); }
.lightbox-nav:hover { background: #FFF7FA; border-color: var(--border-hover); }
.lightbox-prev { left: 20px; transition-delay: 0.05s; }
.lightbox-next { right: 20px; transition-delay: 0.05s; }

.lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 5px 14px;
    border-radius: 999px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.06);
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}
.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius-md);
    object-fit: contain;
    box-shadow: 0 32px 80px -16px rgba(236, 72, 153, 0.15);
    animation: lbImgIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes lbImgIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.lightbox-details {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 600px;
}
.lightbox-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}
.lightbox-tags .tag-chip {
    padding: 5px 14px;
    background: rgba(236, 72, 153, 0.08);
    border: 1px solid rgba(236, 72, 153, 0.16);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    transition: var(--transition);
}
.lightbox-tags .tag-chip:hover { background: rgba(236, 72, 153, 0.14); }
.lightbox-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    align-items: center;
}
.lightbox-meta a {
    color: var(--accent);
    font-weight: 700;
}
.lightbox-meta a:hover { color: var(--accent-dark); }

/* Lightbox artist (from JS) */
.lightbox-artist {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== PIN Modal (NSFW Access) ===== */
.pin-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: lbFadeIn 0.2s ease;
}
.pin-modal.open { display: flex; }
.pin-overlay {
    position: absolute;
    inset: 0;
    background: rgba(31, 15, 25, 0.50);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.pin-card {
    position: relative;
    background: var(--bg-card);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 32px 64px -16px rgba(236, 72, 153, 0.20);
    padding: 32px 28px 24px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    animation: pinIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes pinIn {
    from { opacity: 0; transform: scale(0.90) translateY(16px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.pin-icon { font-size: 44px; margin-bottom: 12px; }
.pin-title {
    font-family: 'Sora', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.pin-desc {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.pin-input {
    width: 100%;
    padding: 12px 16px;
    background: #FFF7FA;
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    font-family: 'Sora', sans-serif;
    text-align: center;
    letter-spacing: 0.3em;
    outline: none;
    transition: var(--transition);
}
.pin-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.10);
}
.pin-input::placeholder { letter-spacing: 0.1em; color: var(--text-muted); font-size: 16px; }
.pin-error {
    display: none;
    font-size: 12px;
    font-weight: 700;
    color: #ef4444;
    margin-top: 10px;
}
.pin-error.show { display: block; }
.pin-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}
.pin-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}
.pin-cancel {
    background: #FFF7FA;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.pin-cancel:hover { background: #FFF0F5; }
.pin-submit {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 8px 20px -6px rgba(236, 72, 153, 0.35);
}
.pin-submit:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -8px rgba(236, 72, 153, 0.45); }
.pin-submit:active { transform: scale(0.97); }

/* ===== Scroll to Top ===== */
.scroll-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 50;
    box-shadow: 0 8px 24px -6px rgba(236, 72, 153, 0.10);
}
.scroll-top:hover { background: var(--accent-gradient); border-color: transparent; color: #fff; transform: translateY(-4px); box-shadow: 0 12px 32px -8px rgba(236, 72, 153, 0.30); }
.scroll-top.show { display: flex; }

/* ===== Landing Page ===== */
.landing-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh; min-height: 100dvh;
}

/* Simple header */
.landing-header {
    width: 100%;
    padding: 20px 24px;
    display: flex;
    justify-content: center;
}
.landing-header .logo { text-decoration: none; }

/* Hero */
.landing-hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 24px 60px;
    width: 100%;
}
.landing-content {
    text-align: center;
    max-width: 540px;
    position: relative;
}

/* Floating emojis */
.landing-floating { position: absolute; inset: -60px -80px; pointer-events: none; z-index: -1; }
.float-item {
    position: absolute;
    font-size: 28px;
    opacity: 0.3;
    animation: floatAnim 8s ease-in-out infinite;
}
.f1 { top: 0; left: 10%; animation-delay: 0s; font-size: 32px; }
.f2 { top: 15%; right: 0; animation-delay: -2s; font-size: 24px; }
.f3 { bottom: 0; left: 5%; animation-delay: -4s; font-size: 36px; }
.f4 { bottom: 20%; right: 10%; animation-delay: -6s; font-size: 22px; }
.f5 { top: 40%; left: 0; animation-delay: -3s; font-size: 20px; }
@keyframes floatAnim {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-14px) rotate(4deg); }
    66% { transform: translateY(8px) rotate(-3deg); }
}

/* Badge */
.landing-badge {
    display: inline-flex;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: rgba(236, 72, 153, 0.08);
    border: 1px solid rgba(236, 72, 153, 0.16);
    padding: 6px 18px;
    border-radius: 999px;
    margin-bottom: 20px;
    animation: fadeUp 0.6s 0.1s both cubic-bezier(0.16, 1, 0.3, 1);
}

/* Title */
.landing-title {
    font-family: 'Sora', sans-serif;
    font-size: 52px;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.08;
    color: var(--text-primary);
    margin-bottom: 16px;
    animation: fadeUp 0.6s 0.2s both cubic-bezier(0.16, 1, 0.3, 1);
}
.landing-title span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Description */
.landing-desc {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 420px;
    margin: 0 auto 28px;
    animation: fadeUp 0.6s 0.3s both cubic-bezier(0.16, 1, 0.3, 1);
}

/* Stats */
.landing-stats {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 10px 24px;
    margin-bottom: 28px;
    animation: fadeUp 0.6s 0.4s both cubic-bezier(0.16, 1, 0.3, 1);
}
.landing-stat {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.landing-stat + .landing-stat {
    padding-left: 20px;
    border-left: 1px solid var(--border-color);
}
.landing-stat-num {
    font-family: 'Sora', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}
.landing-stat-label {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* CTA */
.landing-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 36px;
    background: var(--accent-gradient);
    color: #fff;
    font-family: 'Sora', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 12px 32px -8px rgba(236, 72, 153, 0.40);
    transition: var(--transition);
    animation: fadeUp 0.6s 0.5s both cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}
.landing-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 48px -12px rgba(236, 72, 153, 0.50);
    color: #fff;
}
.landing-cta:active { transform: scale(0.97); }
.landing-cta svg { transition: transform 0.3s; }
.landing-cta:hover svg { transform: translateX(4px); }

/* Hint */
.landing-hint {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 14px;
    animation: fadeUp 0.6s 0.55s both cubic-bezier(0.16, 1, 0.3, 1);
}
.landing-hint kbd {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    font-family: inherit;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    margin: 0 2px;
}

/* Popular tags */
.landing-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 32px;
    animation: fadeUp 0.6s 0.6s both cubic-bezier(0.16, 1, 0.3, 1);
}
.landing-tag {
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    text-decoration: none;
    transition: var(--transition);
}
.landing-tag:hover {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.25);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}

/* Landing responsive */
@media (max-width: 640px) {
    .landing-title { font-size: 38px; }
    .landing-desc { font-size: 14px; }
    .landing-stats { padding: 8px 18px; gap: 14px; }
    .landing-stat-num { font-size: 16px; }
    .landing-cta { padding: 14px 28px; font-size: 15px; }
    .landing-floating { inset: -40px -40px; }
    .float-item { font-size: 22px; }
    .f1 { font-size: 26px; }
    .f3 { font-size: 28px; }
}

@media (max-width: 420px) {
    .landing-title { font-size: 30px; }
    .landing-hero { padding: 10px 16px 40px; }
    .landing-tags { gap: 6px; }
    .landing-tag { font-size: 11px; padding: 6px 12px; }
}

/* ===== Entrance Animations ===== */
.fade-up { opacity: 0; transform: translateY(20px); animation: fu 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes fu { to { opacity: 1; transform: none; } }
.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.14s; }
.d3 { animation-delay: 0.23s; }
.d4 { animation-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    .fade-up { animation: none; opacity: 1; transform: none; }
    .gallery-item { animation: none; opacity: 1; transform: none; }
    .lightbox { animation: none; }
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
    .sidebar { width: 220px; }
    .search-box { width: 180px; }
    .search-box:focus-within { width: 200px; }
    .main-layout { gap: 20px; }
}

@media (max-width: 820px) {
    .sidebar { display: none; }
    .mobile-menu-btn { display: block; }

    .header-inner { padding: 0 16px; }
    .header-actions .search-box { display: none; }
    .badge-all { display: none; }

    .main-layout { padding-left: 16px; padding-right: 16px; gap: 0; }
    .gallery-header { flex-direction: column; }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }
    .main-content { padding: 0; }

    .lightbox { padding: 16px; }
    .lightbox-nav { width: 40px; height: 40px; font-size: 22px; }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
    .lightbox-counter { bottom: 16px; }

    .scroll-top { bottom: 20px; right: 20px; width: 42px; height: 42px; }
}

@media (max-width: 500px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .gallery-info h2 { font-size: 22px; }
}
