:root {
    --bg-color: #050505;
    --surface-color: #0d0d0d;
    --accent-primary: #3a86ff;
    --accent-secondary: #8338ec;
    --accent-tertiary: #ff006e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --glass-bg: rgba(20, 20, 20, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --card-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    perspective: 1000px;
    /* Enable 3D space */
}

/* Global Link Reset */
a {
    text-decoration: none;
    color: inherit;
}

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

.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(58, 134, 255, 0.08) 0%, rgba(131, 56, 236, 0.03) 50%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: -1;
    transition: transform 0.1s ease-out;
}

nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: var(--font-heading);
    letter-spacing: -1px;
    color: var(--text-primary);
    text-shadow: 0 0 15px rgba(58, 134, 255, 0.5);
}

.logo span {
    color: var(--accent-primary);
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 2rem;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--accent-primary);
}

.nav-links a:hover {
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

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

.nav-resume-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white !important;
    padding: 0.6rem 1.4rem;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(58, 134, 255, 0.3);
}

.nav-resume-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(131, 56, 236, 0.4);
}

.nav-resume-btn::after {
    display: none;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 10rem 0;
    position: relative;
}

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

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #a0a0a0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* 3D Hero Section */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8rem;
    perspective: 100px;
}

.hero-content {
    flex: 1;
    max-width: 650px;
    z-index: 10;
}

.badge {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: rgba(58, 134, 255, 0.1);
    border: 1px solid rgba(58, 134, 255, 0.3);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 2rem;
    box-shadow: 0 0 20px rgba(58, 134, 255, 0.1);
}

h1 {
    font-family: var(--font-heading);
    font-size: 5rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 2rem;
    letter-spacing: -2px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientFlow 5s ease infinite;
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.hero-subtitle {
    font-size: 1.35rem;
    color: var(--text-secondary);
    margin-bottom: 3.5rem;
    max-width: 580px;
    font-weight: 400;
}

.hero-cta {
    display: flex;
    gap: 1.5rem;
}

.btn {
    padding: 1.1rem 2.4rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 1.05rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn.primary {
    background: #fff;
    color: #000;
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.15);
}

.btn.primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.4s ease;
    z-index: -1;
}

.btn.primary:hover {
    color: #fff;
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(58, 134, 255, 0.4);
}

.btn.primary:hover::before {
    width: 100%;
}

.btn.secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.btn.secondary:hover {
    border-color: var(--text-primary);
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

/* Orbital Profile Visual */
.hero-visual {
    flex: 0.8;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 400px;
}

.profile-container-orbit {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-img-box {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    z-index: 10;
    box-shadow: 0 0 50px rgba(58, 134, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.profile-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(1.1) contrast(1.1);
}

.profile-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(58, 134, 255, 0.4) 0%, transparent 70%);
    filter: blur(40px);
    z-index: 1;
    animation: pulse-glow 4s infinite alternate;
}

/* Orbits */
.orbit {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(58, 134, 255, 0.3);
    box-shadow: 0 0 10px rgba(58, 134, 255, 0.1);
    pointer-events: none;
}

.ring-1 {
    width: 340px;
    height: 340px;
    border-color: rgba(131, 56, 236, 0.4);
    border-left-color: transparent;
    border-right-color: transparent;
    animation: spin 10s infinite linear;
}

.ring-2 {
    width: 380px;
    height: 380px;
    border-color: rgba(58, 134, 255, 0.3);
    border-top-color: transparent;
    border-bottom-color: transparent;
    animation: spin-reverse 15s infinite linear;
}

.ring-3 {
    width: 420px;
    height: 420px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    animation: spin 25s infinite linear;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse-glow {
    0% {
        opacity: 0.5;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1.1);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes spin-reverse {
    0% {
        transform: rotate(360deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

/* Optimize for mobile */
@media (max-width: 768px) {
    .profile-container-orbit {
        transform: scale(0.8);
        /* Scale down slightly on mobile */
    }

    .hero-visual {
        height: 350px;
        margin-top: 2rem;
    }
}


/* 3D Tilt Cards (Shared) */
.tilt-card {
    transform-style: preserve-3d;
    transform: perspective(1000px);
    will-change: transform;
}

.card-content {
    transform: translateZ(20px);
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2.5rem;
}

.skill-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--glass-border);
    padding: 3rem;
    border-radius: 30px;
    position: relative;
    overflow: hidden;
    transition: all 0.1s ease;
    /* Handled by JS mainly */
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(58, 134, 255, 0.2), transparent 40%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.skill-card:hover::before {
    opacity: 1;
}

.skill-card i {
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
    width: 42px;
    height: 42px;
    filter: drop-shadow(0 0 10px var(--accent-primary));
}

.skill-card h3 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: #fff;
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 0 15px var(--accent-primary);
}

.timeline-item {
    padding-left: 3.5rem;
    margin-bottom: 4rem;
}

.timeline-dot {
    position: absolute;
    left: -8.5px;
    top: 5px;
    width: 20px;
    height: 20px;
    background: var(--bg-color);
    border: 4px solid var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--accent-primary);
}

.timeline-content {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 20px;
    transition: transform 0.3s ease;
}

.timeline-content:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 10px 30px -10px rgba(58, 134, 255, 0.15);
}

.timeline-content .date {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(58, 134, 255, 0.1);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--accent-primary);
    font-weight: 700;
    margin-bottom: 1rem;
}

.timeline-content h3 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.company {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-family: var(--font-heading);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 3rem;
}

.project-card {
    background: var(--surface-color);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    /* Handled by JS for tilt */
}

.project-image {
    height: 250px;
    overflow: hidden;
    position: relative;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, var(--surface-color), transparent);
}

.project-info {
    padding: 2.5rem;
    position: relative;
    z-index: 2;
    transform: translateZ(30px);
    /* 3D pop */
}

.category {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-secondary);
    margin-bottom: 0.8rem;
    display: block;
    text-shadow: 0 0 10px rgba(131, 56, 236, 0.3);
}

.project-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-family: var(--font-heading);
    line-height: 1.2;
}

/* FIXED TECH STACK LAYOUT */
.tech-stack {
    display: flex;
    gap: 0.6rem;
    list-style: none;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    /* Allow wrapping */
    flex-direction: row;
    /* Force row */
}

.tech-stack li {
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    /* Keep chips on one line internally */
}

.tech-stack li:hover {
    background: rgba(58, 134, 255, 0.2);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.btn-text {
    color: var(--text-primary);
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.btn-text:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--glass-border);
    transform: translateY(-3px);
}

/* Contact Section */
.contact-card {
    background: radial-gradient(circle at center, rgba(30, 30, 30, 0.5), rgba(0, 0, 0, 0.8));
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 6rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.contact-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(58, 134, 255, 0.1), transparent 60%);
    animation: pulse 5s infinite ease-in-out;
    pointer-events: none;
    z-index: 0;
}

.contact-card>* {
    position: relative;
    z-index: 1;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.contact-options {
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
    display: flex;
}

/* Fixed Contact Buttons */
.contact-link {
    padding: 1rem 2.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff !important;
    /* Force readable text */
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.contact-link i {
    color: var(--accent-primary);
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

.contact-link:hover {
    background: rgba(58, 134, 255, 0.15);
    border-color: var(--accent-primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(58, 134, 255, 0.3);
}

.contact-link:hover i {
    transform: scale(1.2);
    color: #fff;
}

/* Footer */
footer {
    padding: 4rem 2rem;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
    background: #000;
}

/* Responsive */
@media (max-width: 1024px) {
    h1 {
        font-size: 3.5rem;
    }

    #hero {
        flex-direction: column;
        text-align: center;
        padding-top: 6rem;
        gap: 4rem;
    }

    .hero-content {
        margin-bottom: 2rem;
    }

    .hero-subtitle {
        margin: 0 auto 3rem;
    }

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

    .hero-visual {
        width: 100%;
        height: 300px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    section {
        padding: 6rem 0;
    }

    .project-image {
        height: 200px;
    }

    .project-info h3 {
        font-size: 1.4rem;
    }

    .contact-card {
        padding: 4rem 1.5rem;
    }

    .contact-card h2 {
        font-size: 2rem;
    }

    .contact-link {
        width: 100%;
        /* Full width buttons on mobile */
        justify-content: center;
    }

    .contact-options {
        gap: 1rem;
        flex-direction: column;
    }

    /* Ensure tech stack doesn't break layout */
    .tech-stack {
        justify-content: flex-start;
    }

    /* Optimize 3D for mobile */
    .cube {
        animation: rotate 10s infinite linear;
    }

    .model-container {
        transform: scale(0.8);
    }

    .cursor-glow {
        display: none;
        /* Perf optimization */
    }
}