:root {
    --bg-color: #050505;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary-color: #00ffa3;
    --secondary-color: #00d4ff;
    --text-color: #ffffff;
    --text-muted: #9ca3af;
    --glass-blur: 16px;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
    /* Custom cursor everywhere */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
}

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

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Custom Cursor */
.cursor,
.cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
}

.cursor {
    width: 8px;
    height: 8px;
    background: white;
}

.cursor-follower {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: transform 0.1s ease-out, width 0.3s, height 0.3s;
}

.cursor-hover {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-color: transparent;
}

/* Background Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header & Nav */
header {
    margin-bottom: 2rem;
    position: sticky;
    top: 20px;
    z-index: 100;
}

.glass-card {
    background: rgba(18, 18, 18, 0.6);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1rem 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    font-size: 1rem;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Mobile Menu */
.menu-btn {
    display: none;
    font-size: 1.5rem;
    color: white;
}

/* Button */
.btn-primary {
    background: var(--text-color);
    color: #000;
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-weight: 700;
    font-family: var(--font-heading);
    transition: var(--transition);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.3);
}

/* Bento Grid System */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: 24px;
    /* Increased gap for cleaner look */
    padding-bottom: 60px;
}

.bento-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 28px;
    padding: 30px;
    transition: var(--transition);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.bento-card:hover {
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

/* Hero Card */
.hero-card {
    grid-column: span 2;
    /* 2 of 4 columns */
    grid-row: span 2;
    /* Tall card */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
}

.hero-content {
    flex: 1;
    z-index: 1;
}

.badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(0, 255, 163, 0.1);
    color: var(--primary-color);
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 255, 163, 0.2);
    letter-spacing: 0.5px;
}

.hero-card h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-card p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 90%;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-tags span {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    transition: 0.3s;
}

.hero-tags span:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.hero-image {
    width: 180px;
    height: 180px;
    flex-shrink: 0;
}

.avatar-circle {
    width: 100%;
    height: 100%;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Social Cards */
.social-card {
    grid-column: span 1;
    text-decoration: none;
    color: var(--text-color);
    justify-content: space-between;
}

.social-card .icon-box {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: var(--transition);
    margin-bottom: 20px;
}

.instagram:hover .icon-box {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888, #8a3ab9);
    color: white;
}

.telegram:hover .icon-box {
    background: #0088cc;
    color: white;
}

.linkedin:hover .icon-box {
    background: #0077b5;
    color: white;
}

.github:hover .icon-box {
    background: #333;
    color: white;
}

.social-card h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
}

.arrow-icon {
    position: absolute;
    top: 30px;
    right: 30px;
    opacity: 0.5;
    transform: rotate(-45deg);
    transition: var(--transition);
}

.social-card:hover .arrow-icon {
    opacity: 1;
    transform: rotate(0deg) translateX(5px);
    color: var(--primary-color);
}

/* Header Sections */
.bento-header-card {
    grid-column: span 4;
    padding: 40px 0 20px 0;
}

.bento-header-card h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: white;
}

/* Stat Cards */
.stat-card {
    grid-column: span 1;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 15px;
    cursor: pointer;
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.stat-info h2 {
    font-size: 3rem;
    font-family: var(--font-heading);
    line-height: 1;
    margin-bottom: 5px;
    background: linear-gradient(to bottom, #fff, #888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sub-stat {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--primary-color);
    background: rgba(0, 255, 163, 0.08);
    padding: 4px 10px;
    border-radius: 6px;
}

.cambridge .stat-icon {
    color: #50c878;
}

.cambridge .sub-stat {
    color: #50c878;
    background: rgba(80, 200, 120, 0.1);
}

/* Tech Stack */
.tech-card {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent);
    justify-content: center;
}

.tech-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.tech-header i {
    font-size: 2rem;
    color: var(--secondary-color);
}

.tech-header h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
}

/* Github/YouTube */
.github-card {
    grid-column: span 2;
    text-decoration: none;
    color: white;
    justify-content: space-between;
}

.github-card .tech-header i {
    color: #ff0000;
}

.link-btn {
    margin-top: auto;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Gallery Grid */
.gallery-card {
    grid-column: span 1;
    padding: 0;
    border-radius: 20px;
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    display: flex;
    align-items: flex-end;
    padding: 24px;
    opacity: 0;
    transition: 0.3s;
}

.gallery-card:hover .overlay {
    opacity: 1;
}

.overlay span {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Feature Gallery Item - Spans 2 cols */
.gallery-card:nth-child(4n+1) {
    grid-column: span 2;
}

/* Footer */
footer {
    grid-column: span 4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding: 20px 30px;
}

.footer-links a {
    color: white;
    font-size: 1.4rem;
    transition: 0.3s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.modal-content {
    max-width: 900px;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.close-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    transition: 0.3s;
}

.close-btn:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}

.nav-btn:hover {
    background: var(--primary-color);
    color: black;
}

.prev-btn {
    left: 30px;
}

.next-btn {
    right: 30px;
}

#caption {
    margin-top: 20px;
    font-size: 1.2rem;
    font-family: var(--font-heading);
    color: #ccc;
}

/* Contact Modal */
.contact-box {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.contact-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
}

.contact-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: white;
    text-decoration: none;
    transition: 0.3s;
    font-weight: 500;
}

.contact-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero-card {
        grid-column: span 3;
    }

    .bento-header-card,
    footer {
        grid-column: span 3;
    }
}

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

    .hero-card {
        grid-column: span 2;
        flex-direction: column-reverse;
        text-align: center;
        padding: 40px 20px;
    }

    .hero-image {
        margin-bottom: 20px;
    }

    .hero-tags {
        justify-content: center;
    }

    .bento-header-card,
    footer {
        grid-column: span 2;
    }

    /* Mobile Menu */
    .menu-btn {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #111;
        padding: 20px;
        flex-direction: column;
        border-radius: 12px;
        border: 1px solid var(--card-border);
    }

    .nav-links.active {
        display: flex;
        background: rgba(20, 20, 20, 0.98);
        z-index: 1000;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Adjust gallery items on mobile */
    .gallery-card:nth-child(4n+1) {
        grid-column: span 2;
    }

    .stat-card,
    .social-card {
        grid-column: span 1;
    }

    .tech-card,
    .github-card {
        grid-column: span 2;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .hero-card {
        grid-column: span 1 !important;
    }

    .bento-header-card,
    footer {
        grid-column: span 1 !important;
    }

    .stat-card,
    .social-card,
    .gallery-card,
    .tech-card,
    .github-card {
        grid-column: span 1 !important;
    }

    .hero-card h1 {
        font-size: 2.2rem;
    }
}