/* ======================================
   PORTFOLIO SITE — DARK THEME
   ====================================== */

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #161625;
    --bg-card: rgba(30, 30, 50, 0.7);
    --bg-card-hover: rgba(40, 40, 65, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.15);
    --text-primary: #f0f0f5;
    --text-secondary: #9a9ab0;
    --text-muted: #6a6a80;
    --accent: #7c5cfc;
    --accent-hover: #9b7fff;
    --accent-glow: rgba(124, 92, 252, 0.25);
    --gradient-start: #7c5cfc;
    --gradient-end: #00c9ff;
    --danger: #ff4d6a;
    --success: #00d68f;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.4);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* ---------- RESET ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Subtle background mesh gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(124, 92, 252, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(0, 201, 255, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(124, 92, 252, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ---------- HERO SECTION ---------- */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 0 60px;
    position: relative;
}

.hero-inner {
    animation: fadeInUp 0.8s ease-out;
}

.hero-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: #fff;
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .subtitle {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: clamp(1rem, 2vw, 1.25rem);
    margin-bottom: 36px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
}

.btn-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex-shrink: 0;
}

/* ---------- SECTION ---------- */
.section {
    padding: 60px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 500px;
    margin: 0 auto;
}

.section-line {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    border-radius: 3px;
    margin: 16px auto 0;
}

/* ---------- PROJECTS GRID ---------- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
}

.project-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-lg);
}

.project-card.title-above {
    flex-direction: column-reverse;
}

.project-card .card-banner {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.project-card .card-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .card-banner img {
    transform: scale(1.06);
}

.project-card .card-title {
    padding: 20px 24px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-card);
    position: relative;
    z-index: 2;
}

.project-card .card-title::before {
    content: '';
    position: absolute;
    left: 24px;
    bottom: 16px;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    border-radius: 2px;
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .card-title::before {
    opacity: 1;
    bottom: 14px;
}

/* ---------- SOCIAL LINKS ---------- */
.social-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 24px 0;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.social-link:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.social-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}

/* ---------- PROJECT DETAIL PAGE ---------- */
.project-detail {
    padding: 40px 0 80px;
    animation: fadeInUp 0.6s ease-out;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 32px;
    transition: var(--transition);
    font-size: 0.95rem;
}

.back-link:hover {
    color: var(--accent);
}

.back-link svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.detail-banner {
    width: 100%;
    max-height: 500px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: var(--shadow-md);
}

.detail-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.detail-description {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
    max-width: 800px;
    margin-bottom: 48px;
}

.detail-description p {
    margin-bottom: 16px;
}

.detail-description img {
    border-radius: var(--radius-md);
    margin: 24px 0;
    box-shadow: var(--shadow-sm);
}

.detail-description a {
    color: var(--accent);
    text-decoration: underline;
}

.detail-description a:hover {
    color: var(--accent-hover);
}

/* Gallery */
.gallery-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.gallery-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    aspect-ratio: 16/10;
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: var(--transition);
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

/* ---------- FOOTER ---------- */
.site-footer {
    text-align: center;
    padding: 40px 24px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--glass-border);
    position: relative;
    z-index: 1;
}

/* ---------- ANIMATIONS ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out both;
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .hero {
        min-height: 70vh;
        padding: 60px 0 40px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .social-links {
        flex-direction: column;
        align-items: center;
    }

    .social-link {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}

/* ---------- NAV BAR ---------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 16px 0;
    transition: var(--transition);
    background: transparent;
}

.navbar.scrolled {
    background: rgba(15, 15, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 10px 0;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.nav-logo {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.nav-logo span {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

/* ---------- SCROLL INDICATOR ---------- */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: bounce 2s infinite;
}

.scroll-indicator svg {
    width: 24px;
    height: 24px;
    fill: var(--text-muted);
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ---------- NO PROJECTS ---------- */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    fill: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
}
