/* ========================================
   Design System - Dark Mode Premium
   Portfolio Bento Grid
   ======================================== */

/* CSS Variables */
:root {
    /* Colors */
    --zinc-950: #09090b;
    --zinc-900: #18181b;
    --zinc-800: #27272a;
    --zinc-700: #3f3f46;
    --zinc-600: #52525b;
    --zinc-500: #71717a;
    --zinc-400: #a1a1aa;
    --zinc-300: #d4d4d8;
    --zinc-200: #e4e4e7;
    --zinc-100: #f4f4f5;
    --zinc-50: #fafafa;

    /* Accent Colors */
    --accent-primary: #8b5cf6;
    --accent-secondary: #06b6d4;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));

    /* Card Styles */
    --card-bg: rgba(24, 24, 27, 0.5);
    --card-border: rgba(255, 255, 255, 0.1);
    --card-glow: rgba(139, 92, 246, 0.15);

    /* Spacing */
    --gap: 1rem;
    --radius: 1.5rem;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--zinc-950);
    color: var(--zinc-100);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Noise & Gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at top, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Noise texture overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem;
    background: var(--accent-gradient);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
    transition: all var(--transition-normal);
}

.nav:hover {
    box-shadow: 0 8px 40px rgba(139, 92, 246, 0.5);
    border-bottom-color: rgba(255, 255, 255, 0.4);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-normal);
    border: 1px solid transparent;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.nav-link svg {
    width: 18px;
    height: 18px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 1rem 2rem;
}

/* Sections */
.section {
    padding-top: 2rem;
    padding-bottom: 3rem;
    scroll-margin-top: 5rem;
}

.section:first-child {
    padding-top: 0;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.section-header h2 svg {
    width: 24px;
    height: 24px;
    color: var(--accent-primary);
}

.section-header p {
    color: var(--zinc-500);
    font-size: 0.875rem;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--gap);
}

@media (min-width: 640px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Bento Items */
.bento-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.bento-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    opacity: 0;
    transition: opacity var(--transition-normal);
    background: radial-gradient(
        800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        var(--card-glow),
        transparent 40%
    );
    pointer-events: none;
}

.bento-item:hover {
    transform: scale(1.02);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 40px var(--card-glow);
}

.bento-item:hover::before {
    opacity: 1;
}

/* Profile Section Grid - 2+1+1 layout */
#profile .bento-grid {
    grid-template-columns: 1fr;
}

#profile .bento-grid .profile-card {
    grid-column: span 1;
}

@media (min-width: 640px) {
    #profile .bento-grid {
        grid-template-columns: repeat(4, 1fr);
        align-items: stretch;
    }

    #profile .bento-grid .profile-card {
        grid-column: span 2;
    }

    #profile .bento-grid .bento-item {
        height: 100%;
        display: flex;
        flex-direction: column;
    }
}

/* Card Title */
.card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--zinc-300);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-title svg {
    width: 16px;
    height: 16px;
    color: var(--accent-primary);
}

/* Profile Card */
.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
}

.profile-name {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-title {
    color: var(--zinc-400);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.profile-bio {
    color: var(--zinc-300);
    font-size: 0.9rem;
    max-width: 400px;
    margin-bottom: 1rem;
}

.profile-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--zinc-500);
    font-size: 0.875rem;
}

.profile-location svg {
    width: 16px;
    height: 16px;
}

/* Stats Card */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 1rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--zinc-100);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--zinc-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Social Links */
.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 1rem;
    color: var(--zinc-300);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all var(--transition-normal);
    border: 1px solid transparent;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--card-border);
    transform: translateX(4px);
}

.social-link svg {
    width: 18px;
    height: 18px;
    color: var(--accent-primary);
}

/* Skills */
.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    padding: 0.5rem 1rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 9999px;
    font-size: 0.8rem;
    color: var(--zinc-200);
    transition: all var(--transition-normal);
}

.skill-tag:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--accent-primary);
}

/* Contact Card */
.contact-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--accent-gradient);
    border-radius: 1rem;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-normal);
}

.contact-link:hover {
    transform: scale(1.02);
    box-shadow: 0 0 30px var(--card-glow);
}

.contact-link svg {
    width: 18px;
    height: 18px;
}

/* Creations Grid */
.creations-grid .bento-item {
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
}

.creation-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all var(--transition-normal);
}

.creations-grid .bento-item:hover .creation-thumb {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.creation-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal);
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}

.creations-grid .bento-item:hover .creation-overlay {
    opacity: 1;
}

.creation-title {
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Animations Grid */
.animations-grid {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .animations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .animations-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.animations-grid .bento-item {
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 16/9;
}

.animation-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all var(--transition-normal);
}

.animations-grid .bento-item:hover .animation-video {
    transform: scale(1.02);
}

.animation-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.animations-grid .bento-item:hover .animation-overlay {
    background: rgba(0, 0, 0, 0.1);
}

.animation-play-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.animation-play-icon svg {
    width: 28px;
    height: 28px;
    color: white;
    margin-left: 4px;
}

.animations-grid .bento-item:hover .animation-play-icon {
    transform: scale(1.1);
    background: rgba(139, 92, 246, 0.5);
}

.animation-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.animations-grid .bento-item:hover .animation-title {
    opacity: 1;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 0.5rem;
    animation: lightboxFadeIn var(--transition-normal) ease;
}

.lightbox-caption {
    margin-top: 1rem;
    color: var(--zinc-300);
    font-size: 0.9rem;
    text-align: center;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

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

.lightbox-share,
.video-share {
    position: absolute;
    top: 1rem;
    right: 5rem;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.lightbox-share:hover,
.video-share:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: var(--accent-primary);
}

.lightbox-share svg,
.video-share svg {
    width: 20px;
    height: 20px;
}

/* Share Toast Notification */
.share-toast {
    position: absolute;
    bottom: 4rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--accent-gradient);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    pointer-events: none;
}

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

.lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

.lightbox-nav:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: var(--accent-primary);
}

.lightbox-nav svg,
.lightbox-close svg {
    width: 24px;
    height: 24px;
}

.lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--zinc-400);
    font-size: 0.875rem;
}

/* Video Fullscreen */
.video-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.video-fullscreen.active {
    opacity: 1;
    visibility: visible;
}

.video-fullscreen video {
    max-width: 95vw;
    max-height: 90vh;
    border-radius: 0.5rem;
}

.video-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.video-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.video-close svg {
    width: 24px;
    height: 24px;
}

/* Video Navigation */
.video-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.video-prev {
    left: 1rem;
}

.video-next {
    right: 1rem;
}

.video-nav:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: var(--accent-primary);
}

.video-nav svg {
    width: 24px;
    height: 24px;
}

.video-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--zinc-400);
    font-size: 0.875rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .nav-link span {
        display: none;
    }

    .nav-link {
        padding: 0.75rem;
    }

    .container {
        padding: 5rem 0.75rem 2rem;
    }

    .profile-name {
        font-size: 1.5rem;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
}

/* Focus States */
.nav-link:focus-visible,
.social-link:focus-visible,
.contact-link:focus-visible,
.lightbox-close:focus-visible,
.lightbox-nav:focus-visible,
.video-close:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: rgba(139, 92, 246, 0.3);
    color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--zinc-950);
}

::-webkit-scrollbar-thumb {
    background: var(--zinc-700);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--zinc-600);
}
