/* VARIABLES & RESET */
:root {
    --bg-color: #ffffff;
    --bg-secondary: #f8fafc;
    /* Slate 50 */
    --text-color: #334155;
    /* Slate 700 */
    --text-dark: #0f172a;
    /* Slate 900 */
    --text-light: #64748b;
    /* Slate 500 */
    --accent-color: #4f46e5;
    /* Indigo 600 */
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #818cf8 100%);
    --card-bg: #ffffff;
    --navbar-bg: rgba(255, 255, 255, 0.9);
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-primary: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

/* Base Animation Classes */
.hidden-el {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.visible {
    opacity: 1;
    transform: translateY(0);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-primary);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    /* Global subtle mesh/grid pattern */
    background-image:
        radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.03) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(79, 70, 229, 0.03) 0%, transparent 20%),
        linear-gradient(#e2e8f0 1px, transparent 1px),
        linear-gradient(90deg, #e2e8f0 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    background-position: 0 0, 0 0, -1px -1px, -1px -1px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* UTILITIES */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-padding {
    padding: 100px 0;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-dark);
    position: relative;
    font-weight: 700;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 1rem;
    letter-spacing: 0.01em;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    background: white;
    border: 2px solid var(--border-color);
    color: var(--text-dark);
}

.btn-secondary:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: #fff;
    transform: translateY(-2px);
}

.btn-reddit {
    background: #ff4500;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 69, 0, 0.2);
}

.btn-reddit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 69, 0, 0.3);
}


/* NAVBAR */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--navbar-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    transition: var(--transition);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.02em;
}

.logo span {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links li a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    position: relative;
}

.nav-links li a:hover {
    color: var(--accent-color);
}

.nav-links li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
}

.nav-links li a:hover::after {
    width: 100%;
}

.btn-nav {
    padding: 10px 24px !important;
    background: var(--accent-gradient);
    color: #fff !important;
    border-radius: 50px;
    transition: var(--transition);
}

.btn-nav:hover::after {
    display: none;
}

.btn-nav:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
    color: white !important;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

/* HERO */
.hero {
    min-height: 100vh;
    padding-top: 80px;
    /* Accounts for fixed navbar */
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(to bottom, #ffffff, #f1f5f9);
}

.hero-bg-accent {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    top: -100px;
    right: -100px;
    z-index: 0;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.subtitle {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--accent-color);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.hero-btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ABOUT */
.about {
    background-color: #fff;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-img {
    position: relative;
}

.about-img img {
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.about-img::after {
    content: '';
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 150px;
    height: 150px;
    background: repeating-linear-gradient(45deg, var(--border-color), var(--border-color) 2px, transparent 2px, transparent 10px);
    z-index: -1;
    border-radius: var(--radius);
}

.about-text h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    font-weight: 700;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
    font-size: 1.05rem;
}

.reddit-highlight {
    margin-top: 1rem;
    padding: 1rem;
    background: #fff0eb;
    border-left: 4px solid #ff4500;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.reddit-highlight i {
    color: #ff4500;
    font-size: 1.5rem;
}

.reddit-highlight a {
    color: #ff4500;
    font-weight: 700;
}

.stats {
    display: flex;
    gap: 3rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.stat-item h3 {
    font-size: 2.25rem;
    color: var(--accent-color);
    font-weight: 800;
    font-family: var(--font-heading);
    margin-bottom: 0.25rem;
}

.stat-item p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 0.05em;
}

/* TECH STACK (Marquee) */
.tech-stack {
    background-color: #fff;
    position: relative;
    overflow: hidden;
    padding: 60px 0;
}

.tech-stack::before {
    content: "";
    /* Clean background for stack section */
    display: none;
}

.marquee-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.marquee-wrapper::before,
.marquee-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    width: 150px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.marquee-wrapper::before {
    left: 0;
    background: linear-gradient(to right, #fff, transparent);
}

.marquee-wrapper::after {
    right: 0;
    background: linear-gradient(to left, #fff, transparent);
}

.marquee-content {
    display: flex;
    gap: 3rem;
    width: max-content;
    animation: scroll 30s linear infinite;
}

.marquee-content:hover {
    animation-play-state: paused;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-50% - 1.5rem));
        /* Adjust based on gap */
    }
}

.tech-card {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    width: 160px;
    /* Fixed width for smooth marquee */
    flex-shrink: 0;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    cursor: default;
}

.tech-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.15);
    border-color: var(--accent-color);
}

.tech-card i {
    font-size: 3.5rem;
    display: block;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tech-card:hover i {
    transform: scale(1.1) rotate(5deg);
}

/* Specific color for Rust */
.devicon-rust-original {
    color: #333;
}

.tech-card:hover .devicon-rust-original {
    color: #dea584;
}

.tech-card p {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
    margin: 0;
}

/* EXPERIENCE SECTION */
.experience {
    background-color: var(--bg-secondary);
}

.timeline {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.timeline-item {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-left {
    flex: 1 1 200px;
}

.timeline-left h4 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.timeline-left .date {
    display: inline-block;
    padding: 4px 12px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
}

.timeline-right {
    flex: 2 1 400px;
}

.timeline-right .role {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.timeline-right ul {
    list-style: disc;
    margin-left: 1.2rem;
    margin-bottom: 1.5rem;
}

.timeline-right li {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.tech-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tech-tags span {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: #fff;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    border-radius: 4px;
    font-weight: 600;
}

/* SERVICES */
.services {
    background-color: #fff;
    /* Switched to white for better contrast with Experience if adjacent */
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--radius);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: rgba(79, 70, 229, 0.3);
    box-shadow: var(--shadow-lg);
}

.icon-box {
    width: 60px;
    height: 60px;
    background: rgba(79, 70, 229, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
    font-size: 1.5rem;
    transition: var(--transition);
}

.service-card:hover .icon-box {
    background: var(--accent-gradient);
    color: white;
}

.service-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-weight: 700;
}

.service-card p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* PROJECTS */
.projects {
    background-color: var(--bg-secondary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
    padding-bottom: 2rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

/* Featured Work Rotation Effect (Desktop only) */
@media (min-width: 1024px) {
    .project-card:nth-child(1) {
        transform: rotate(-2deg);
    }

    .project-card:nth-child(2) {
        transform: rotate(2deg) translateY(-20px);
    }

    .project-card:nth-child(3) {
        transform: rotate(-1deg);
    }

    .project-card:hover {
        transform: scale(1.05) rotate(0deg) translateY(-10px) !important;
        z-index: 10;
        box-shadow: var(--shadow-lg);
    }
}

.project-img {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-card:hover .project-img img {
    transform: scale(1.1);
}

.project-info {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: var(--bg-secondary);
    color: var(--text-light);
    border-radius: 4px;
    font-weight: 500;
}

.project-info h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    font-weight: 700;
}

.project-info p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.btn-link {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-link:hover {
    gap: 0.75rem;
}

/* CONTACT */
.contact-section {
    background-color: var(--bg-secondary);
}

.contact-container {
    background: #fff;
    border-radius: var(--radius);
    padding: 4rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.contact-container h2 {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.contact-container p {
    color: var(--text-light);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.contact-card {
    padding: 2rem;
    border-radius: var(--radius);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.contact-card:hover {
    border-color: var(--accent-color);
    background: #fff;
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--accent-color);
    box-shadow: var(--shadow-sm);
}

.contact-card span {
    font-weight: 600;
    color: var(--text-dark);
    word-break: break-all;
}

.contact-card .label {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    margin-bottom: -0.5rem;
}

/* FOOTER */
footer {
    padding: 3rem 0;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    background: #fff;
    border-top: 1px solid var(--border-color);
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 3.5rem;
    }

    .about-grid {
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .section-padding {
        padding: 70px 0;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        padding: 2rem;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        gap: 1.5rem;
    }

    .nav-links.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .hero {
        text-align: center;
        padding-top: 100px;
    }

    .hero h1 {
        font-size: 2.75rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .about-img {
        max-width: 450px;
        margin: 0 auto;
    }

    .about-img::after {
        display: none;
        /* Simplify on mobile */
    }

    .reddit-highlight {
        justify-content: center;
    }

    .stats {
        justify-content: center;
    }

    .contact-container {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 20px;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero-btns {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    .stats {
        flex-direction: column;
        gap: 1.5rem;
    }
}