@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;600;700;800&display=swap');

:root {
    --bg-main: #070a12;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-sidebar: rgba(11, 15, 25, 0.75);
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --accent-glow: #38bdf8;
    --accent-purple: #818cf8;
    --border-glass: rgba(255, 255, 255, 0.08);
}

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

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.08), transparent 25vw),
        radial-gradient(circle at 85% 30%, rgba(129, 140, 248, 0.08), transparent 25vw);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

h1, h2, h3, h4, .font-heading {
    font-family: 'Outfit', sans-serif;
    color: #fff;
}

/* App Layout */
.app-container {
    display: flex;
    width: 100vw;
    min-height: 100vh;
}

/* Glassmorphic Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border-glass);
    padding: 3rem 2rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.brand {
    text-decoration: none;
    display: block;
}

.brand-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    background: linear-gradient(135deg, #ffffff 40%, var(--accent-glow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: opacity 0.3s ease;
}

.brand:hover .brand-title {
    opacity: 0.85;
}

.brand-subtitle {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Nav Menu */
.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 3rem 0 auto 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 60%;
    background: var(--accent-glow);
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
}

.nav-link.active {
    color: var(--accent-glow);
    font-weight: 600;
    box-shadow: inset 0 0 20px rgba(56, 189, 248, 0.05);
    border: 1px solid rgba(56, 189, 248, 0.15);
}

.nav-link.active::before {
    transform: translateY(-50%) scaleY(1);
}

/* Sidebar Footer */
.sidebar-footer {
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.6;
}

/* Main Content Area */
.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 4rem 5vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Hero Section */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-avatar-wrapper {
    position: relative;
    margin-bottom: 2.5rem;
}

.hero-avatar-wrapper::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-glow), var(--accent-purple));
    z-index: -1;
    opacity: 0.6;
    filter: blur(12px);
}

.hero-avatar {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.8;
    max-width: 600px;
}

/* Section Headings */
.section-header {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.section-desc {
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-size: 1.05rem;
}

/* Portfolio Category Filters */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    padding: 0.6rem 1.4rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(12px);
}

.filter-btn:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.filter-btn.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-glow);
    box-shadow: 0 0 20px rgba(1, 158, 189, 0.4);
}

/* Secondary Seasonal Filter Bar */
.subfilter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: -1.5rem;
    margin-bottom: 2.5rem;
    padding: 0.8rem 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    animation: fadeInSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.subfilter-bar.hidden {
    display: none !important;
}

.subfilter-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.subfilter-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.subfilter-btn.active {
    background: rgba(1, 158, 189, 0.2);
    color: #fff;
    border-color: rgba(1, 158, 189, 0.5);
}

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.gallery-card.hidden {
    display: none !important;
}

/* Masonry / Grid Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.gallery-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    group: relative;
}

.gallery-card:hover {
    transform: translateY(-8px);
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(56, 189, 248, 0.15);
}

.gallery-img-wrapper {
    width: 100%;
    height: 320px;
    overflow: hidden;
    position: relative;
}

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

.gallery-card:hover .gallery-img {
    transform: scale(1.06);
}

.gallery-info {
    padding: 1.5rem;
}

.gallery-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
}

.gallery-tag {
    font-size: 0.85rem;
    color: var(--accent-glow);
    margin-top: 0.25rem;
}

/* Content Cards (About / Springtide) */
.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 3rem;
    max-width: 800px;
    line-height: 1.8;
    color: var(--text-muted);
    font-size: 1.1rem;
    backdrop-filter: blur(12px);
}

.content-card p {
    margin-bottom: 1.5rem;
}

.content-card p:last-child {
    margin-bottom: 0;
}

/* Links List */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 600px;
}

.external-link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    text-decoration: none;
    color: #fff;
    font-weight: 500;
    transition: all 0.3s ease;
}

.external-link-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-glow);
    transform: translateX(6px);
}

/* Fullscreen Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(7, 10, 18, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    border: none;
    background: transparent;
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-img {
    max-width: 92vw;
    max-height: calc(92vh - 3.8rem);
    display: block;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.7);
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10000;
}

.lightbox-nav:hover {
    background: var(--accent-color);
    border-color: var(--accent-glow);
    box-shadow: 0 0 20px rgba(1, 158, 189, 0.5);
    transform: translateY(-50%) scale(1.08);
}

.lightbox-prev {
    left: 2.5rem;
}

.lightbox-next {
    right: 2.5rem;
}

.lightbox-caption {
    width: 100%;
    padding: 0.85rem 1rem;
    text-align: center;
    color: #f8fafc;
    background: transparent;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

/* Responsive Mobile & Tablet Design System */
@media (max-width: 900px) {
    body {
        flex-direction: column;
    }
    
    .app-container {
        flex-direction: column;
    }
    
    /* Sleek Sticky Top App Header */
    .sidebar {
        width: 100vw;
        height: auto;
        position: sticky;
        top: 0;
        left: 0;
        padding: 0.85rem 1.5rem;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(7, 10, 18, 0.88);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        z-index: 500;
    }

    .sidebar > div:first-child {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 1rem;
    }
    
    .brand-title {
        font-size: 1.35rem;
    }
    
    .brand-subtitle {
        display: none;
    }

    .nav-menu {
        flex-direction: row;
        margin: 0;
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.85rem;
        font-size: 0.82rem;
        border-radius: 8px;
    }

    .nav-link:hover, .nav-link.active {
        transform: none;
    }

    .nav-link::before {
        display: none;
    }

    .sidebar-footer {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 2.5rem 4vw;
    }

    /* Swipeable Horizontal Filter Pills */
    .filter-bar, .subfilter-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.6rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin-bottom: 2rem;
    }

    .filter-bar::-webkit-scrollbar, .subfilter-bar::-webkit-scrollbar {
        display: none;
    }

    .filter-btn, .subfilter-btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .hero-title {
        font-size: 2.75rem;
    }

    .gallery-grid {
        gap: 1.5rem;
    }

    /* Remove Lightbox navigation arrow buttons on mobile & tablet view so they never obstruct artwork */
    .lightbox-prev, .lightbox-next {
        display: none !important;
    }
}

@media (max-width: 600px) {
    .sidebar {
        padding: 0.75rem 1rem;
    }

    .sidebar > div:first-child {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .nav-menu {
        width: 100%;
        justify-content: space-between;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        padding-top: 0.6rem;
    }

    .nav-link {
        flex: 1;
        justify-content: center;
        padding: 0.4rem 0.25rem;
        font-size: 0.75rem;
        letter-spacing: 0.02em;
    }

    .main-content {
        padding: 2rem 1rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .gallery-img-wrapper {
        height: 280px;
    }

    .section-title {
        font-size: 2rem;
    }

    .hero-title {
        font-size: 2.1rem;
    }

    .hero-avatar {
        width: 130px;
        height: 130px;
    }

    .content-card {
        padding: 1.5rem 1.25rem;
        font-size: 1rem;
        border-radius: 18px;
    }

    .external-link-card {
        padding: 1.2rem 1.25rem;
        font-size: 0.95rem;
    }

    /* Lightbox Mobile Touch Controls */
    .lightbox-close {
        top: 0.85rem;
        right: 0.85rem;
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }

    .lightbox-content {
        max-width: 98vw;
        max-height: 94vh;
    }

    .lightbox-img {
        max-width: 98vw;
        max-height: calc(94vh - 3.5rem);
    }
}
