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

:root {
    --bg-primary: #06080f;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --border-card: rgba(255, 255, 255, 0.06);
    --border-card-hover: rgba(255, 255, 255, 0.16);
    --text-primary: #f0f0f5;
    --text-secondary: rgba(240, 240, 245, 0.65);
    --text-muted: rgba(240, 240, 245, 0.35);
    --accent-glow: rgba(100, 140, 255, 0.12);
    --accent-blue: #4d7cff;
    --accent-purple: #c084fc;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

html { 
    scroll-behavior: smooth; 
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale; 
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

/* Background fireflies & floating orbs */
#fireflies { 
    position: fixed; 
    inset: 0; 
    width: 100%; 
    height: 100%; 
    z-index: 0; 
    pointer-events: none; 
}

.ambient-orb { 
    position: fixed; 
    border-radius: 50%; 
    filter: blur(140px); 
    opacity: 0.15; 
    pointer-events: none; 
    z-index: 0; 
}
.orb-1 { 
    width: 600px; 
    height: 600px; 
    background: radial-gradient(circle, hsl(220, 80%, 50%) 0%, transparent 70%); 
    top: -15%; 
    left: -10%; 
    animation: orbFloat1 25s ease-in-out infinite; 
}
.orb-2 { 
    width: 500px; 
    height: 500px; 
    background: radial-gradient(circle, hsl(280, 70%, 45%) 0%, transparent 70%); 
    bottom: 10%; 
    right: -10%; 
    animation: orbFloat2 30s ease-in-out infinite; 
}
.orb-3 { 
    width: 400px; 
    height: 400px; 
    background: radial-gradient(circle, hsl(180, 70%, 40%) 0%, transparent 70%); 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    animation: orbFloat3 20s ease-in-out infinite; 
}

@keyframes orbFloat1 { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(80px, 60px) scale(1.1); } 66% { transform: translate(-40px, 30px) scale(0.95); } }
@keyframes orbFloat2 { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(-60px, -40px) scale(1.05); } 66% { transform: translate(30px, -70px) scale(0.9); } }
@keyframes orbFloat3 { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-40%, -60%) scale(1.15); } }

/* Layout Grid and Containers */
.container { 
    position: relative; 
    z-index: 1; 
    max-width: 1400px; 
    margin: 0 auto; 
    padding: 80px 20px 40px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    min-height: 100vh; 
}

.profile {
    text-align: center;
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeSlideUp 1s 0.2s var(--ease-out-expo) forwards;
    width: 100%;
}

.profile-name {
    font-family: var(--font-display);
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.75) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-bio { 
    font-size: 1.05rem; 
    color: var(--text-secondary); 
    max-width: 650px; 
    margin: 0 auto 24px; 
    line-height: 1.6; 
}

/* Stats Dashboard Box */
.stats-dashboard {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 12px 24px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 155px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}
.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
}
.stat-value {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 4px;
    letter-spacing: 0.06em;
    font-weight: 500;
}

/* Loader Styles */
.gallery-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    color: var(--text-secondary);
    gap: 16px;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top: 3px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Photo Grid: MASONRY COLUMNS */
.photo-grid {
    width: 100%;
    column-count: 3;
    column-gap: 24px;
    margin-bottom: 60px;
    display: block; /* Override default CSS grid */
}

/* Individual Photo Cards in Masonry */
.photo-card {
    position: relative;
    background-color: #0c0e14;
    border: 1px solid var(--border-card);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0; 
    transform: translateY(40px) scale(0.95);
    display: inline-block; /* Essential for CSS Column layout flow */
    width: 100%;
    margin-bottom: 24px;
    break-inside: avoid; /* Prevents card breaking across columns */
}

.photo-card.visible { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
}

.photo-card canvas {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    filter: brightness(0.94);
    transition: filter 0.4s ease, transform 0.4s ease;
}

/* Mouse hover radial glow overlay ("The Old Effect") */
.photo-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(350px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(255, 255, 255, 0.08), transparent 40%);
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.photo-card:hover { 
    border-color: var(--border-card-hover); 
    transform: translateY(-8px) scale(1.02); 
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 60px var(--accent-glow);
}

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

.photo-card:hover canvas {
    filter: brightness(1.03);
}

.photo-overlay { 
    position: absolute; 
    inset: 0; 
    z-index: 2; 
    background: linear-gradient(to top, rgba(6, 8, 15, 0.35) 0%, transparent 40%); 
}

/* Lightbox overlay */
.lightbox {
    position: fixed; 
    inset: 0; 
    background: rgba(6, 8, 15, 0.96); 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);
    z-index: 100; 
    display: flex; 
    flex-direction: column;
    align-items: center; 
    justify-content: center; 
    opacity: 0; 
    visibility: hidden; 
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.lightbox.active { 
    opacity: 1; 
    visibility: visible; 
}

.lightbox-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 80vh;
    padding: 0 40px;
    position: relative;
}

.lightbox-content {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 80vh;
    max-width: 80vw;
    pointer-events: none; 
    transform: scale(0.92); 
    transition: transform 0.4s var(--ease-out-expo);
}
.lightbox.active .lightbox-content { 
    transform: scale(1); 
}

.lightbox-content canvas {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* Close & Nav buttons */
.lightbox-close {
    position: absolute; 
    top: 24px; 
    right: 24px; 
    width: 48px; 
    height: 48px; 
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    color: white; 
    font-size: 1.4rem;
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: all 0.3s; 
    z-index: 105;
}
.lightbox-close:hover { 
    background: rgba(255, 255, 255, 0.15); 
    transform: rotate(90deg); 
}

.nav-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 102;
}
.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.lightbox-caption {
    margin-top: 10px;
    text-align: center;
    z-index: 102;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.95rem;
}

/* Security lockdown screen styles */
.lockdown-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(4, 5, 10, 0.97);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.lockdown-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lockdown-box {
    max-width: 480px;
    padding: 40px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(239, 68, 68, 0.15);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.lockdown-icon {
    font-size: 3.5rem;
    color: #ef4444;
    filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.3));
    margin-bottom: 10px;
}

.lockdown-box h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.lockdown-box p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.lockdown-box .lockdown-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.btn-refresh {
    margin-top: 10px;
    padding: 12px 28px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--accent-blue);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}
.btn-refresh:hover {
    background: #3665ff;
    box-shadow: 0 0 20px rgba(77, 124, 255, 0.4);
    transform: translateY(-2px);
}

/* Footer styling */
.site-footer {
    width: 100%; 
    text-align: center; 
    padding: 32px 0; 
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    margin-top: auto; 
    opacity: 0; 
    animation: fadeSlideUp 0.8s 1s var(--ease-out-expo) forwards;
}
.site-footer p { 
    font-size: 0.82rem; 
    color: var(--text-muted); 
    letter-spacing: 0.02em; 
}

@keyframes fadeSlideUp { 
    0% { opacity: 0; transform: translateY(20px); } 
    100% { opacity: 1; transform: translateY(0); } 
}

/* Responsiveness adjustments for Masonry Columns */
@media (max-width: 1200px) {
    .photo-grid {
        column-count: 3;
        column-gap: 20px;
    }
}

@media (max-width: 900px) {
    .photo-grid {
        column-count: 2;
        column-gap: 16px;
    }
    .photo-card {
        margin-bottom: 16px;
    }
    .profile-name { font-size: 2.4rem; }
    .container { padding: 60px 16px 30px; }
}

@media (max-width: 768px) {
    .lightbox-navigation {
        padding: 0 15px;
        height: 70vh;
    }
    .nav-btn {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
    .lightbox-content {
        max-width: 90vw;
        max-height: 70vh;
    }
    .stats-dashboard {
        gap: 10px;
    }
    .stat-card {
        min-width: 120px;
        padding: 10px 16px;
    }
    .stat-value {
        font-size: 1.15rem;
    }
    .stat-label {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) { 
    .photo-grid { 
        column-count: 2; 
        column-gap: 10px; 
    } 
    .photo-card {
        margin-bottom: 10px;
        border-radius: 12px;
    }
    .profile-name { font-size: 2.1rem; }
    .container { padding: 40px 12px 20px; }
    .lightbox { padding: 10px; }
    .lightbox-navigation {
        padding: 0 10px;
    }
    .nav-btn {
        display: none; /* Swipe/tap nav is better on mobile */
    }
    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    .stats-dashboard {
        grid-template-columns: repeat(3, 1fr);
        display: grid;
        width: 100%;
    }
    .stat-card {
        min-width: 0;
        padding: 8px 4px;
    }
}

@media (min-width: 1600px) {
    .photo-grid {
        column-count: 4;
        column-gap: 24px;
    }
}

@media (min-width: 2500px) { 
    .photo-grid { column-count: 5; column-gap: 30px; } 
    .container { max-width: 2000px; padding: 120px 60px 60px; }
    .profile-name { font-size: 4rem; }
}
