:root {
    /* Core Colors (Dark Mode Default) */
    --bg-color: #050511;
    --text-color: #e2e8f0;
    --text-muted: #94a3b8;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --accent-color: #6366f1;

    /* Component Colors */
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.05);
    --glass-bg: rgba(5, 5, 17, 0.6);

    /* Typography */
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* Light Mode Overrides */
[data-theme="light"] {
    --bg-color: #f0f9ff;
    --text-color: #1e293b;
    --text-muted: #475569;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;

    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(0, 0, 0, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.8);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

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

/* Navbar Premium */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: all 0.4s ease;
    /* Entrance Animation */
    animation: slideDown 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform: translateY(-100%);
    opacity: 0;
}

@keyframes slideDown {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Smart Glassmorphism (Added via JS) */
.navbar.navbar-scrolled {
    padding: 1rem 5%;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
}

.logo {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 2.5rem;
    /* MAXIMIZED */
    letter-spacing: -2px;
    position: relative;
    z-index: 10;
    text-decoration: none;
    color: #ffffff;
    -webkit-text-stroke: 2px #ffffff;
    /* MAXIMIZED BOLD */
    cursor: pointer;
}

[data-theme="light"] .logo {
    color: #475569;
    -webkit-text-stroke: 2px #475569;
}

.navbar ul {
    display: flex;
    list-style: none;
    gap: 3rem;
    align-items: center;
}

.navbar a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 400;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    opacity: 0.8;
    transition: all 0.3s ease;
    display: inline-block;
    /* Required for transform */
}

/* Magnetic Hover & Underline Effect */
.navbar a:not(.btn-cta)::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 1px;
    background: white;
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.navbar a:not(.btn-cta):hover {
    opacity: 1;
}

.navbar a:not(.btn-cta):hover::after {
    width: 100%;
    left: 0;
}

/* Theme Toggle Button */
.theme-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-color);
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

/* CTA Button Premium */
/* CTA Button Premium */
.btn-cta {
    border: 1px solid var(--card-border);
    /* REPLACED hardcoded rgba */
    color: var(--text-color);
    /* Added explicit color */
    padding: 0.6rem 1.8rem;
    border-radius: 50px;
    opacity: 1 !important;
    background: var(--card-bg);
    /* REPLACED hardcoded rgba */
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.btn-cta:hover {
    background: var(--primary-color);
    /* Changed from white to primary */
    color: white !important;
    /* Always white on hover */
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
    /* Matches primary */
    border-color: var(--primary-color);
}

[data-theme="light"] .btn-cta {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

[data-theme="light"] .btn-cta:hover {
    background: var(--primary-color);
    color: white !important;
}

/* Magnetic Element Class */
.magnetic {
    display: inline-block;
    will-change: transform;
    /* Transition handled in JS or set minimal here */
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding-top: 60px;
    overflow: hidden;
}

#particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}


/* Profile Image */
.profile-container {
    width: 150px;
    height: 150px;
    margin-bottom: 2rem;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 50px rgba(59, 130, 246, 0.3);
    animation: float 6s ease-in-out infinite;
}

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

@keyframes float {
    0% {
        transform: translateY(0px);
    }

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

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

.greeting {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.glitch-text {
    font-family: var(--font-display);
    font-size: 6vw;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    letter-spacing: -2px;
}

.subtitle {
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 2rem;
}

.tags-hero {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    font-family: var(--font-display);
    color: var(--text-muted);
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 3rem;
}

.dot {
    color: var(--primary-color);
}

.cta-group {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.btn {
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 1rem 2rem;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.6);
}

.btn-text {
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-text:hover {
    gap: 15px;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    height: 100px;
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.line {
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    animation: drop 2s infinite;
}

@keyframes drop {
    0% {
        transform: translateY(-100%);
    }

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

/* Sections General */
.section {
    padding: 10rem 5%;
}

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

.small-container {
    max-width: 800px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--text-muted);
    margin-bottom: 4rem;
    display: block;
}

/* Editorial Text (About) */
.editorial-text p {
    font-size: 2rem;
    line-height: 1.4;
    font-weight: 300;
    margin-bottom: 2rem;
}

.editorial-text strong {
    font-weight: 600;
    color: var(--text-color);
}

.highlight {
    background: linear-gradient(120deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0) 100%);
    padding: 0 5px;
    color: var(--primary-color);
}

/* Clean Timeline (Experience) */
.clean-timeline {
    position: relative;
    padding-left: 50px;
    border-left: 1px solid var(--card-border);
    /* Faint background guide */
}

/* Progressive Line (Draws on scroll) */
.clean-timeline::after {
    content: '';
    position: absolute;
    left: -1px;
    top: 0;
    width: 3px;
    height: 0%;
    /* Starts at 0 */
    background: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color);
    transition: height 1.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.clean-timeline.active::after {
    height: 100%;
    /* Draws to full height */
}

.timeline-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    /* Reduced from 5rem */
    gap: 1.5rem;
    /* Reduced from 2rem */
}

/* Typewriter Cursor */
.typewriter-cursor {
    display: inline-block;
    width: 2px;
    background-color: var(--primary-color);
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.date-col {
    flex: 0 0 150px;
    display: flex;
    flex-direction: column;
}

.year {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
}

.duration {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 300;
}

.content-col {
    flex: 1;
}

.content-col h3 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

.content-col h4 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.place {
    color: var(--text-muted);
}

.description {
    font-size: 1.1rem;
    color: #94a3b8;
    max-width: 600px;
    font-weight: 300;
}

/* Minimal Grid (Formation) */
.minimal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 4rem;
}

.grid-item {
    border-top: 1px solid var(--card-border);
    padding-top: 2rem;
    transition: border-color 0.3s;
}

.grid-item:hover {
    border-color: var(--primary-color);
}

.huge-year {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.15);
    /* Keep dark mode default */
    display: block;
    margin-bottom: -1rem;
    transform: translateY(-10px);
}

[data-theme="light"] .huge-year {
    color: rgba(0, 0, 0, 0.1);
    /* Explicit dark text for light mode */
}

.grid-item h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.grid-item h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.grid-item p {
    color: var(--text-muted);
}

/* Contact Full Screen */
.full-height-center {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-center {
    text-align: center;
}

.pre-title {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.huge-title {
    font-family: var(--font-display);
    font-size: 5vw;
    font-weight: 900;
    margin-bottom: 4rem;
    background: linear-gradient(to right, white, var(--text-muted));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .huge-title {
    background: linear-gradient(to right, var(--text-color), var(--text-muted));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.social-link {
    font-size: 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s;
}

.social-link:hover {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
}

/* Footer */
footer {
    padding: 3rem 5%;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #334155;
    font-size: 0.9rem;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 2000;
}

.bar {
    height: 3px;
    width: 100%;
    background-color: white;
    border-radius: 10px;
    transition: all 0.3s ease;
}

[data-theme="light"] .bar {
    background-color: var(--text-color);
}

/* Mobile Menu Active State (Hamburger Animation) */
.menu-toggle.is-active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.is-active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.is-active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Responsive Navbar */
@media (max-width: 900px) {
    .navbar {
        padding: 1.5rem 2rem;
    }

    .menu-toggle {
        display: flex;
        /* Show burger on mobile */
    }

    .nav-list {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(5, 5, 17, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        transform: translateY(-100%);
        transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
        z-index: 1500;
    }

    .nav-list.mobile-active {
        transform: translateY(0);
    }

    .nav-list li a {
        font-size: 1.5rem;
    }

    /* Disable heavy hover effects on mobile */
    .company-card:hover {
        transform: none !important;
    }

    .company-card:hover .company-logo {
        transform: none !important;
        /* Keep color reveal but remove 3D pop */
    }

    /* Adjust grids for mobile */
    .skills-cards-grid,
    .companies-grid {
        gap: 1.5rem;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .glitch-text {
        font-size: 12vw;
    }
}

/* Utility: Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Companies Section Overhauled */
.companies-grid {
    display: flex;
    /* Flex is better for centering variable width logos */
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.5rem;
    align-items: center;
    margin-top: 2rem;
}

.company-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    /* 3D Transform Defaults */
    transform-style: preserve-3d;
    transform: perspective(1000px);

    /* Variable width due to logos, but min dimensions to feel "card-like" */
    min-width: 280px;
    min-height: 180px;
}

.company-logo {
    max-height: 120px;
    /* Increased size as requested */
    max-width: 220px;
    object-fit: contain;
    filter: grayscale(100%) brightness(0.7);
    opacity: 0.6;
    transition: all 0.5s ease;
    /* Eliminate default transforms as container handles tilt */
    transform: translateZ(20px);
    /* Slightly elevated content */
}

/* Hover Effects handled by Tilt JS mostly, but specific logo color reveal */
.company-card:hover .company-logo {
    filter: grayscale(0%) brightness(1);
    opacity: 1;
    transform: translateZ(50px) scale(1.1);
    /* Pop out effect */
}

.company-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

/* Skills Section Advanced UI/UX */
.skills-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 900px) {
    .skills-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

.relative-section {
    position: relative;
    overflow: hidden;
}

/* Mesh Gradient Background */
.mesh-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Dark aesthetic with subtle moving gradient */
    background: radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    opacity: 0.4;
    z-index: -1;
    filter: blur(80px);
    /* Creates the "mesh" integration */
}

/* 3D Tilt Card Base */
.skill-card {
    background: var(--card-bg);
    /* Darker, more premium base */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    /* 3D Transform Defaults */
    transform-style: preserve-3d;
    transform: perspective(1000px);
    transition: transform 0.1s ease-out;
    /* Smooth follow for JS */
}

/* Cursor Glow Border Effect */
.glow-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(59, 130, 246, 0.15), transparent 40%);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.4s;
}

.skill-card:hover .glow-border {
    opacity: 1;
}

.card-content {
    position: relative;
    z-index: 2;
    /* Ensures content is above the glow */
}

.skill-card::before {
    display: none;
}

.skill-card:hover {
    transform: translateY(-10px);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(59, 130, 246, 0.2);
}

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

/* Floating Icon Animation */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

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

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

.card-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    height: 60px;
    width: 60px;
    line-height: 60px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.1);
    margin-left: auto;
    margin-right: auto;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Bouncy */
}

/* Idle Floating Effect */
.card-icon.floating {
    animation: float 6s ease-in-out infinite;
}

.skill-card:hover .card-icon {
    transform: scale(1.15) rotate(10deg);
    background: var(--primary-color);
    color: white;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.6);
}

.skill-card h3 {
    font-size: 1.4rem;
    /* Slightly smaller */
    font-weight: 700;
    margin-bottom: 1rem;
    /* Reduced from 2rem */
    color: var(--text-color);
}

/* Skill Pills (Premium List Items) */
.skill-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* Reduced from 0.8rem */
}

.skill-pill {
    background: var(--card-bg);
    padding: 0.6rem 0.8rem;
    /* Reduced from 0.8rem 1rem */
    border-radius: 12px;
    font-size: 0.95rem;
    /* Slightly smaller */
    color: var(--text-muted);
    border: 1px solid transparent;
    transition: all 0.3s ease;
    cursor: default;

    /* Staggered Reveal Defaults */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
}

/* Stagger Animation Loop */
.skill-list li:nth-child(1) {
    animation-delay: 0.1s;
}

.skill-list li:nth-child(2) {
    animation-delay: 0.2s;
}

.skill-list li:nth-child(3) {
    animation-delay: 0.3s;
}

.skill-list li:nth-child(4) {
    animation-delay: 0.4s;
}

.skill-list li:nth-child(5) {
    animation-delay: 0.5s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.skill-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: white;
    transform: scale(1.02) translateX(5px);
    /* Tactile feedback */
}