/* CSS Variables & Reset */
:root {
    /* Color Palette - Dark Theme (Default) */
    --primary-color: #6C63FF;
    /* Soft Purple */
    --secondary-color: #03dac6;
    /* Teal Accent */
    --bg-color: #0a0a0a;
    /* Darker background for more contrast */
    --surface-color: #1E1E1E;
    --text-color: #E0E0E0;
    --text-muted: #B0B0B0;
    /* Slightly lighter for better readability */
    --glass-bg: rgba(30, 30, 30, 0.7);
    /* More opaque for better readability */
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);

    /* Font Families */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="light"] {
    /* Color Palette - Light Theme */
    --primary-color: #6C63FF;
    --secondary-color: #018786;
    --bg-color: #F8F9FA;
    --surface-color: #FFFFFF;
    --text-color: #2D3436;
    --text-muted: #636E72;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.04);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

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

/* Soft Gradient Background */
body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(108, 99, 255, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(3, 218, 198, 0.08), transparent 25%);
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.7;
    /* Improved line height */
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    letter-spacing: -0.01em;
    /* Modern tight spacing */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1100px;
    /* Slightly narrower for better reading experience */
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Glassmorphism Classes */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    /* Add transition for hover effects */
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.8rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.03em;
}

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

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

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 0.5rem 0;
    opacity: 0.8;
}

.nav-link:hover {
    opacity: 1;
}

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

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--primary-color);
    opacity: 1;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0.8;
}

#theme-toggle:hover {
    color: var(--primary-color);
    transform: rotate(15deg);
    opacity: 1;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    cursor: pointer;
    width: 30px;
    height: 20px;
    position: relative;
    z-index: 1001;
}

.hamburger span {
    display: block;
    position: absolute;
    height: 2px;
    /* Thinner lines */
    width: 100%;
    background: var(--text-color);
    border-radius: 9px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

.hamburger span:nth-child(1) {
    top: 0px;
}

.hamburger span:nth-child(2) {
    top: 9px;
}

.hamburger span:nth-child(3) {
    top: 18px;
}

.hamburger.open span:nth-child(1) {
    top: 9px;
    transform: rotate(135deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
    left: -60px;
}

.hamburger.open span:nth-child(3) {
    top: 9px;
    transform: rotate(-135deg);
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: 100%;
    width: 100%;
    height: 100vh;
    background: var(--bg-color);
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: 0.4s ease-in-out;
}

.mobile-menu.active {
    left: 0;
}

.mobile-link {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Hero Section */
.hero {
    min-height: 90vh;
    /* Reduced height to pull content up */
    display: flex;
    align-items: center;
    /* Center vertically */
    justify-content: center;
    padding-top: 40px;
    /* Reduced offset */
    padding-bottom: 40px;
    position: relative;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    /* More space between text and image */
}

.hero-content {
    flex: 1;
}

/* Badge */
.badge-container {
    margin-bottom: 1rem;
}

.learning-badge {
    background: rgba(108, 99, 255, 0.1);
    color: var(--primary-color);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(108, 99, 255, 0.2);
    display: inline-block;
}

.greeting {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.name {
    font-size: 3.5rem;
    /* Slightly smaller for cleaner look */
    margin-bottom: 0.2rem;
    line-height: 1.1;
    background: linear-gradient(to right, var(--text-color), var(--primary-color));
    -webkit-background-clip: text;
    background-clip: text;
    /* Note: Text gradient color fallback handled by text-color if needed, but webkit-text-fill-color usually needed for effect */
}

.role {
    font-size: 1.4rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 1.5rem;
    min-height: 1.6em;
}

.bio {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    max-width: 550px;
    line-height: 1.8;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.btn {
    padding: 0.7rem 1.8rem;
    border-radius: 8px;
    /* Less rounded for professional feel */
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    font-family: var(--font-body);
    /* Use body font for UI elements */
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #564fcc);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(108, 99, 255, 0.6);
    /* Soft glow */
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    /* Slight fill */
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    font-size: 1.3rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
    text-shadow: 0 0 10px rgba(108, 99, 255, 0.5);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.img-wrapper {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--glass-border);
    /* Thinner border */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    /* Softer shadow */
    position: relative;
    background: var(--surface-color);
}

/* Sections General */
.section {
    padding: 4rem 0;
    /* Reduced top/bottom padding */
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    /* Fixed width underline */
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* About Section */
.about-card {
    padding: 3rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--glass-bg), rgba(30, 30, 30, 0.4));
}

.about-content p {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.8;
}

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

.skill-card {
    padding: 2rem 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    background: rgba(108, 99, 255, 0.05);
    /* Subtle highlight */
}

.skill-icon {
    font-size: 2.5rem;
    /* Slightly smaller icons */
    margin-bottom: 1rem;
}

.skill-card h3 {
    font-size: 1rem;
    color: var(--text-color);
    font-weight: 500;
}

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

.project-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
    height: 100%;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    border-color: rgba(108, 99, 255, 0.3);
}

.project-content h3 {
    margin-bottom: 0.8rem;
    font-size: 1.4rem;
}

.project-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
    font-size: 0.95rem;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.project-tags span {
    font-size: 0.75rem;
    background: rgba(108, 99, 255, 0.08);
    /* More subtle background */
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    /* Square edges */
    font-weight: 500;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 6px;
    background: var(--primary-color);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-color);
}

.btn-outline:hover {
    border-color: var(--text-color);
    background: transparent;
}

/* Contact Section */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    overflow: hidden;
    border-radius: 16px;
}

.contact-info {
    padding: 3rem;
    background: linear-gradient(135deg, var(--primary-color), #564fcc);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-item i {
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.15);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    /* Consistent radius */
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-item h4 {
    font-size: 0.8rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}

.contact-item a,
.contact-item p {
    font-size: 1rem;
    font-weight: 500;
}

.contact-socials {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.contact-socials a {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.contact-socials a:hover {
    background: white;
    color: var(--primary-color);
    border-color: white;
}

.contact-form {
    padding: 3rem;
}

.form-group {
    position: relative;
    margin-bottom: 2rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 0;
    border: none;
    border-bottom: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    font-family: var(--font-body);
}

.form-group label {
    position: absolute;
    top: 0.8rem;
    left: 0;
    color: var(--text-muted);
    transition: var(--transition);
    pointer-events: none;
    font-size: 0.95rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group input:not(:placeholder-shown),
.form-group textarea:not(:placeholder-shown) {
    border-bottom-color: var(--primary-color);
}

.form-group input:focus~label,
.form-group textarea:focus~label,
.form-group input:not(:placeholder-shown)~label,
.form-group textarea:not(:placeholder-shown)~label {
    top: -1.2rem;
    font-size: 0.8rem;
    color: var(--primary-color);
}

/* Footer */
.footer {
    padding: 1.5rem 0;
    background: var(--bg-color);
    text-align: center;
    border-top: 1px solid var(--glass-border);
    font-size: 0.9rem;
    color: var(--text-muted);
}


.footer-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#back-to-top {
    position: absolute;
    right: 0;
    background: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

#back-to-top:hover {
    transform: translateY(-5px);
}

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

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

/* Responsive Design */
@media (max-width: 992px) {
    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
    }

    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .bio {
        margin: 0 auto 2rem;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    .nav-links,
    .nav-controls #theme-toggle {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .nav-controls {
        gap: 0;
    }

    .mobile-menu #theme-toggle {
        display: block;
    }

    .name {
        font-size: 2.5rem;
    }

    .img-wrapper {
        width: 250px;
        height: 250px;
    }

    .about-card,
    .contact-info,
    .contact-form {
        padding: 2rem;
    }
}