:root {
    --font-heading: 'Outfit', system-ui, -apple-system, sans-serif;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --bg-dark: #020617;
    --bg-card: rgba(15, 23, 42, 0.6);
    --accent: #818cf8;
    /* Indigo */
    --accent-glow: rgba(129, 140, 248, 0.4);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --nav-height: 80px;
    --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    --glass-border: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Premium Background Mesh */
.mesh-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 40%);
}

.mesh-gradient::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(129, 140, 248, 0.02) 0%, transparent 50%);
    animation: pulse 10s infinite alternate;
}

@keyframes pulse {
    0% {
        transform: scale(1) translate(-10%, -10%);
    }

    100% {
        transform: scale(1.2) translate(10%, 10%);
    }
}

/* Custom Cursor */
.cursor {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background-color: var(--accent-glow);
    border: 1px solid var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: width 0.3s, height 0.3s, background-color 0.3s;
}

@media (hover: hover) and (pointer: fine) {
    body.mouse-active {
        cursor: none;
    }

    body.mouse-active .cursor {
        display: block;
    }

    body.hovering-link .cursor {
        width: 40px;
        height: 40px;
        background-color: var(--accent-glow);
        backdrop-filter: blur(4px);
    }
}

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

section {
    padding: 100px 0;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    line-height: 1.1;
}

.accent {
    color: var(--accent);
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    letter-spacing: 1px;
}

/* Navbar */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 1000;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
    display: flex;
    align-items: center;
}

nav.scrolled {
    height: 70px;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    width: 100%;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -1px;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 5px 0;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.hero h1 {
    font-size: clamp(40px, 8vw, 80px);
    margin: 20px 0;
    background: linear-gradient(to right, #fff, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero h2 {
    font-size: clamp(30px, 6vw, 60px);
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.hero p {
    max-width: 600px;
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 50px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border: 1px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: var(--transition);
    background: transparent;
    font-family: var(--font-heading);
}

.btn:hover {
    background: rgba(129, 140, 248, 0.1);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-3px);
}

/* Section Title */
.section-title {
    display: flex;
    align-items: center;
    font-size: clamp(26px, 5vw, 32px);
    margin-bottom: 40px;
    width: 100%;
}

.section-title::after {
    content: "";
    display: block;
    position: relative;
    width: 300px;
    height: 1px;
    margin-left: 20px;
    background-color: var(--glass-border);
}

/* Cards & Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 50px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 2.25rem 1.75rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5);
}

.card h3 {
    font-size: 1.5rem;
    margin-top: 10px;
}

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

.card ul {
    list-style: none;
    margin-top: 0.5rem;
}

.card li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.card li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* Featured Projects */
.featured-projects-container {
    display: flex;
    flex-direction: column;
    gap: 120px;
    margin-top: 80px;
}

.featured-project.project-details-trigger {
    cursor: pointer;
    pointer-events: auto;
}

.featured-project {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: center;
    position: relative;
    isolation: isolate;
}

.project-content {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.featured-project.left .project-content {
    grid-column: 1 / -1;
    text-align: center;
}

.project-title {
    font-size: clamp(32px, 6vw, 42px);
    margin-bottom: 25px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text-primary);
}

.project-description {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-secondary);
    padding: 2.5rem;
    border-radius: 20px;
    font-size: 1.1rem;
    box-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.5),
        inset 0 1px 1px rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    max-width: 600px;
    position: relative;
    overflow: hidden;
}

.featured-project.left .project-description {
    margin-left: auto;
    margin-right: auto;
}

.project-description:hover {
    border-color: rgba(129, 140, 248, 0.5);
    transform: translateY(-5px);
    background: rgba(15, 23, 42, 0.6);
}

.project-description::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.1), transparent);
    opacity: 0;
    transition: var(--transition);
}

.project-description:hover::before {
    opacity: 1;
}

.featured-project.left .project-tech-badges {
    justify-content: center;
}

.project-tech-badges {
    display: flex;
    flex-wrap: wrap;
    margin: 30px 0 10px;
    gap: 12px;
    justify-content: center;
}

.tech-badge {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(129, 140, 248, 0.03);
    border: 1px solid rgba(129, 140, 248, 0.2);
    padding: 6px 14px;
    border-radius: 100px;
    letter-spacing: 0.5px;
    transition: var(--transition);
    backdrop-filter: blur(5px);
}

.tech-badge:hover {
    background: rgba(129, 140, 248, 0.1);
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    transform: translateY(-2px);
}

.project-image-container {
    grid-column: 6 / -1;
    grid-row: 1 / -1;
    position: relative;
    z-index: 1;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.featured-project.left .project-image-container {
    grid-column: 1 / 8;
}

.project-image {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background-color: #0f172a;
    transition: var(--transition);
    height: 400px;
    width: 100%;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    filter: grayscale(20%) contrast(110%);
}

.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.2), transparent);
    mix-blend-mode: overlay;
    opacity: 0.5;
    transition: var(--transition);
    z-index: 1;
}

.project-image:hover .image-overlay {
    opacity: 0.2;
}

.project-image:hover img {
    transform: scale(1.05) translateZ(20px);
    filter: grayscale(0%) contrast(100%);
}

.project-image:hover {
    box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.8);
    border-color: rgba(129, 140, 248, 0.4);
    transform: translateY(-5px) rotateX(2deg) rotateY(-2deg);
}

.featured-project.left .project-image:hover {
    transform: translateY(-5px) rotateX(2deg) rotateY(2deg);
}

/* Skills Section */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 50px;
}

.skill-category {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    backdrop-filter: blur(8px);
}

.skill-category:hover {
    border-color: var(--accent);
    background: rgba(129, 140, 248, 0.05);
    transform: translateY(-5px);
}

.skill-category h3 {
    margin-bottom: 25px;
    font-size: 1.4rem;
    color: var(--accent);
}

.skill-list {
    list-style: none;
}

.skill-list li {
    padding: 12px 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    font-weight: 500;
}

.skill-list li::before {
    content: "✦";
    color: var(--accent);
    margin-right: 12px;
    font-size: 0.8rem;
}

/* Hamburger & Mobile Menu */
.menu-toggle {
    display: none;
}

@media (max-width: 1080px) {
    .project-content {
        grid-column: 1 / 9;
    }

    .featured-project.left .project-content {
        grid-column: 5 / -1;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    .menu-toggle {
        display: block;
        z-index: 1001;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        height: 100vh;
        background: rgba(2, 6, 23, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: var(--transition);
    }

    .nav-links.active {
        right: 0;
    }

    .featured-project {
        display: block;
        margin-bottom: 70px;
    }

    .project-image {
        margin-top: 20px;
        height: 300px;
        max-width: 100%;
        margin-left: 0;
    }

    .project-description {
        background: var(--bg-card);
        padding: 20px;
    }
}

/* Modal Section */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(2, 6, 23, 0.4);
    backdrop-filter: blur(8px);
    transition: var(--transition);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 24px;
    position: relative;
    padding: 60px;
    overflow-y: auto;
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.7);
    animation: modalIn 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 25px;
    right: 30px;
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

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

.modal-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
    margin-top: 40px;
}

.modal-info h3 {
    font-size: 1.2rem;
    color: var(--accent);
    margin-bottom: 20px;
    margin-top: 40px;
}

.modal-info h3:first-of-type {
    margin-top: 0;
}

.modal-info p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
}

.impact-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.impact-item {
    background: rgba(129, 140, 248, 0.05);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(129, 140, 248, 0.1);
}

.impact-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    font-family: var(--font-heading);
}

.impact-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Utility: Button Text */
.btn-text {
    background: none;
    border: none;
    color: var(--accent);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 10px 0;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

.btn-text:hover {
    padding-left: 10px;
    letter-spacing: 0.5px;
}

.project-details-trigger {
    pointer-events: auto !important;
}

/* Project Video */
.modal-video-container {
    margin: 30px 0 50px;
    width: 100%;
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: #000;
    box-shadow: 0 0 40px rgba(129, 140, 248, 0.1);
    transition: var(--transition);
}

.modal-video-container:hover {
    border-color: rgba(129, 140, 248, 0.4);
    box-shadow: 0 0 60px rgba(129, 140, 248, 0.2);
}

.video-frame {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    /* Default, will be overridden if needed */
    object-fit: cover;
}

/* For mobile app videos (9:16) */
.modal-video-container.portrait .video-frame {
    aspect-ratio: 9 / 16;
    max-width: 400px;
    margin: 0 auto;
}

/* Project Gallery */
.modal-gallery-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--glass-border);
}

.modal-gallery-section h3 {
    color: var(--accent);
    margin-bottom: 25px;
    font-size: 1.2rem;
}

.gallery-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

.gallery-grid::-webkit-scrollbar {
    height: 6px;
}

.gallery-grid::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

.gallery-item {
    flex: 0 0 auto;
    width: 280px;
    height: 500px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    cursor: zoom-in;
    transition: var(--transition);
    background: var(--bg-card);
}

.gallery-item:hover {
    transform: scale(1.02);
    border-color: var(--accent);
    box-shadow: 0 0 30px rgba(129, 140, 248, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.9);
    backdrop-filter: blur(15px);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-close:hover {
    color: var(--accent);
    transform: scale(1.1);
}



@media (max-width: 850px) {
    .modal-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .modal-content {
        padding: 40px 25px;
    }
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}