:root {
    --bg-color: #0f172a;
    /* Slate 900 */
    --text-color: #f8fafc;
    /* Slate 50 */
    --primary-color: #38bdf8;
    /* Sky 400 */
    --secondary-color: #0ea5e9;
    /* Sky 500 */
    --accent-color: #7dd3fc;
    /* Sky 300 */
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(56, 189, 248, 0.2);
    --font-main: 'Outfit', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

/* Cursor Glow Effect */
.cursor-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.15), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    mix-blend-mode: screen;
}

#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 100px 0;
}

.gradient-text {
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 300% 300%;
    animation: gradientFlow 8s ease infinite;
}

.accent {
    color: var(--secondary-color);
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    color: white;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    /* margin-left removed, handled by gap */
}

.btn-secondary:hover {
    background: var(--secondary-color);
    color: var(--bg-color);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--secondary-color);
}

.nav-links a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding-top: 80px;
    background: linear-gradient(to bottom, rgba(10, 10, 10, 0.7) 0%, rgba(10, 10, 10, 0.7) 60%, var(--bg-color) 100%), url('images/profile.jpg');
    background-size: cover;
    background-position: center top;
    background-attachment: scroll;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to bottom, transparent, var(--bg-color));
    pointer-events: none;
    z-index: 1;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #aeaeae;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Animations */
@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInAnim 1s ease forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

@keyframes fadeInAnim {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s ease-out;
}

.fade-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Section Titles */
.section-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

/* Skills Grid */
/* Skills Ticker - JS-driven infinite scroll */
.skills-ticker {
    overflow: hidden;
    width: 100%;
    position: relative;
    padding: 2rem 0;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.skills-ticker.is-dragging {
    cursor: grabbing;
}

.skills-track {
    display: flex;
    gap: 4rem;
    white-space: nowrap;
    will-change: transform;
}

.skill-item {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    pointer-events: none;
    flex-shrink: 0;
}

/* Experience Section */
.experience-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.experience-card {
    padding: 2rem;
    border-left: 4px solid var(--secondary-color);
    transition: transform 0.3s ease;
}

.experience-card:hover {
    transform: translateY(-5px);
    background: rgba(15, 23, 42, 0.8);
    /* Slightly darker on hover */
}

.experience-card .date {
    display: inline-block;
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.experience-card .job-title {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.experience-card .company {
    font-size: 1.1rem;
    color: #aeaeae;
    margin-bottom: 1rem;
    font-weight: 400;
}

.experience-card .job-description {
    margin-bottom: 1rem;
    color: #d1d5db;
}

/* Education Section */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.education-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    border-left: 4px solid var(--secondary-color);
    transition: transform 0.3s ease;
}

.education-card:hover {
    transform: translateY(-5px);
    background: rgba(15, 23, 42, 0.8);
}

.education-logo {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SVG logos: render in white (B&W) for dark background */
.education-logo svg {
    width: 100%;
    height: 100%;
    filter: grayscale(100%) brightness(0) invert(1);
    opacity: 0.85;
    transition: var(--transition);
}

.education-card:hover .education-logo svg {
    opacity: 1;
    filter: grayscale(100%) brightness(0) invert(1) drop-shadow(0 0 8px rgba(56, 189, 248, 0.4));
}

/* Fallback for img logos */
.education-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: grayscale(100%) brightness(0) invert(1);
    opacity: 0.85;
    transition: var(--transition);
}

.education-card:hover .education-logo img {
    opacity: 1;
    filter: grayscale(100%) brightness(0) invert(1) drop-shadow(0 0 8px rgba(56, 189, 248, 0.4));
}

.education-info {
    flex: 1;
}

.education-info .degree {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.education-info .field-of-study {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.education-info .field-subtitle {
    font-size: 0.95rem;
    color: var(--accent-color);
    margin-bottom: 0.75rem;
    font-weight: 400;
}

.education-info .university {
    font-size: 1.05rem;
    margin-bottom: 0.15rem;
    color: #d1d5db;
    font-weight: 500;
}

.education-info .university-full {
    font-size: 0.9rem;
    color: #aeaeae;
    font-weight: 400;
}

/* Projects Grid */
/* Carousel Styles */
.carousel-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 80px;
    /* Increased padding to add space between buttons and projects */
}

.carousel-track-container {
    overflow: hidden;
    width: 100%;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s ease-in-out;
    gap: 2rem;
}

.carousel-track .project-card {
    min-width: 85%;
    /* Show most of one card on mobile to hint at next item */
    flex: 0 0 85%;
}

/* Tablet & Desktop: Show more cards if desired, or stick to 1 for focus */
@media (min-width: 769px) {
    .carousel-track .project-card {
        min-width: calc(50% - 1rem);
        /* 2 cards */
        flex: 0 0 calc(50% - 1rem);
    }
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--primary-color);
    font-size: 1.5rem;
    /* Slightly smaller font for better centering relative to container */
    cursor: pointer;
    width: 50px;
    /* Slightly larger button */
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--transition);
    line-height: 1;
    /* Fix vertical centering */
    padding-bottom: 2px;
    /* Micro-adjustment for visual center */
}

.carousel-btn:hover {
    background: var(--primary-color);
    color: var(--bg-color);
}

.carousel-btn.prev {
    left: 0;
}

.carousel-btn.next {
    right: 0;
}

.project-card {
    overflow: hidden;
    padding: 0;
    /* Override default glass-card padding for image */
}

.project-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.project-card:hover .project-img {
    transform: scale(1.1);
}

.project-info {
    padding: 1.5rem;
}

.project-links {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}

.project-links a {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

/* Contact Form */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    max-width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    font-family: var(--font-main);
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--glass-border);
    color: #888;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    color: var(--text-color);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.social-icon svg {
    width: 40px;
    height: 40px;
}

.social-icon:hover {
    color: var(--bg-color);
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(56, 189, 248, 0.4);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .nav-links {
        display: none;
    }

    /* Add JS for mobile menu later */
    .hamburger {
        display: block;
    }

    .hamburger .bar {
        display: block;
        width: 25px;
        height: 3px;
        margin: 5px auto;
        background: white;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .cta-buttons .btn {
        width: 100%;
        text-align: center;
    }

    .skills-track {
        animation-duration: 15s;
    }

    .education-card {
        flex-direction: column;
        text-align: center;
    }
}

.nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Hide carousel buttons on mobile and add masking */
@media (max-width: 768px) {
    .carousel-btn {
        display: none;
    }

    .carousel-container {
        padding: 0;
        /* Remove side padding reserved for buttons */
    }

    .carousel-track-container {
        /* Add a gradient mask to fade the edges from left to right on mobile */
        /* Bring the transparent point inward so the 15% visible next slide actually fades */
        -webkit-mask-image: linear-gradient(to right,
                black 0%,
                black 94%,
                transparent 99%);
        mask-image: linear-gradient(to right,
                black 0%,
                black 94%,
                transparent 99%);
    }
}