/* =========================================
   CSS Reset & Variables
========================================= */
:root {
    /* Colors */
    --bg-color: #0f172a;
    /* Dark slate */
    --surface-color: #1e293b;
    --surface-hover: #334155;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;

    --accent-primary: #38bdf8;
    /* Light blue */
    --accent-secondary: #818cf8;
    /* Indigo */
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));

    /* Typography */
    --font-main: 'Inter', sans-serif;

    /* Spacing & Layout */
    --nav-height: 80px;
    --container-width: 1100px;
    --border-radius: 12px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* =========================================
   Typography & Utilities
========================================= */
h1,
h2,
h3,
h4 {
    color: var(--text-primary);
    line-height: 1.2;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.section-title.text-center {
    display: block;
    text-align: center;
}

.section-title.text-center::after {
    left: 50%;
    transform: translateX(-50%);
}

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

.mt-xl {
    margin-top: 4rem;
}

/* =========================================
   Layout & Sections
========================================= */
.section {
    padding: 100px 20px;
}

.section-container {
    max-width: var(--container-width);
    margin: 0 auto;
}

/* =========================================
   Navigation
========================================= */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: rgba(15, 23, 42, 0.85);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-normal);
}

.nav-content {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
}

.logo-mark {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    box-shadow: 0 12px 30px rgba(56, 189, 248, 0.18);
}

.logo-text {
    font-size: 1.5rem;
    letter-spacing: -1px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: var(--transition-fast);
}

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

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.8rem;
    cursor: pointer;
}

/* =========================================
   Hero Section
========================================= */
.hero-section {
    min-height: 100vh;
    height: auto;
    display: flex;
    align-items: center;
    position: relative;
    padding: 120px 20px 60px;
}

.hero-content {
    max-width: var(--container-width);
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.hero-text {
    flex: 1;
}

.greeting {
    color: var(--accent-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.name {
    font-size: clamp(3rem, 5vw, 5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.title {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.highlight {
    color: var(--accent-primary);
    margin: 0 0.5rem;
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: 2.5rem;
    font-style: italic;
}

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

.btn {
    padding: 0.8rem 1.8rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

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

.image-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    padding: 10px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(129, 140, 248, 0.2));
    animation: float 6s ease-in-out infinite;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    z-index: 2;
    position: relative;
    border: 4px solid var(--surface-color);
}

.glow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent-gradient);
    filter: blur(40px);
    opacity: 0.3;
    z-index: 1;
}

.scroll-down {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    color: var(--text-secondary);
    animation: bounce 2s infinite;
}

/* =========================================
   About Section
========================================= */
#about {
    position: relative;
    overflow: hidden;
}

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

.about-container {
    position: relative;
    z-index: 1;
}

.about-content {
    background: var(--surface-color);
    padding: 3rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

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

.skill-category {
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.category-header i {
    font-size: 2rem;
    color: var(--accent-primary);
}

.category-header h3 {
    font-size: 1.5rem;
}

.skill-list li {
    margin-bottom: 1.5rem;
}

.skill-list li:last-child {
    margin-bottom: 0;
}

.skill-name {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.skill-bar {
    display: block;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.skill-bar .fill {
    display: block;
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    width: 0;
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active .skill-bar .fill {
    width: var(--w, 0%);
}

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

.project-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.project-image {
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    min-height: 180px;
    background: rgba(255, 255, 255, 0.03);
    position: relative;
}

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

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

.project-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.project-icon {
    font-size: 2.5rem;
    color: var(--accent-primary);
}

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

.project-desc {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    flex-grow: 1;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-primary);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* =========================================
   Education & Achievements
========================================= */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.year {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.achievement-list {
    list-style: none;
}

.achievement-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.achievement-list i {
    color: var(--accent-primary);
    font-size: 1.4rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.achievement-list strong {
    color: var(--text-primary);
}

.languages-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.lang-tag {
    padding: 0.6rem 1.5rem;
    background: var(--surface-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    font-weight: 500;
}

/* =========================================
   Contact Section
========================================= */
.contact-subtitle {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 3rem;
    font-size: 1.1rem;
}

.contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.contact-card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-normal);
}

a.contact-card:hover {
    transform: translateY(-5px);
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, 0.1);
}

.contact-icon-wrapper {
    width: 60px;
    height: 60px;
    background: rgba(56, 189, 248, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--accent-primary);
    font-size: 1.8rem;
}

.contact-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.contact-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    word-break: break-word;
}

/* =========================================
   Footer
========================================= */
footer {
    padding: 2rem 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* =========================================
   Animations
========================================= */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

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

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

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) translateX(-50%);
    }

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

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

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease forwards;
}

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

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

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

/* =========================================
   Responsive Design
========================================= */
@media (max-width: 992px) {
    .split-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        padding-top: 2rem;
        gap: 2.5rem;
    }

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

    .tagline {
        margin: 0 auto 2.5rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background: var(--bg-color);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3rem;
        transition: 0.4s ease-in-out;
    }

    .nav-links.nav-active {
        left: 0;
    }

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

    .mobile-menu-btn {
        display: block;
    }

    .section {
        padding: 60px 20px;
    }
}

@media (max-width: 480px) {
    .name {
        font-size: 2.5rem;
    }

    .cta-buttons {
        flex-direction: column;
    }

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

@media (max-width: 380px) {
    .image-wrapper {
        width: 200px;
        height: 200px;
    }
    .name {
        font-size: 2.2rem;
    }
    .nav-links a {
        font-size: 1.2rem;
    }
}

/* =========================================
   New Enhancements: Particles, Theme, Form
========================================= */

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Particles JS Background */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
}

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

.hero-content {
    position: relative;
    z-index: 1;
}

/* Typed Text Cursor Animation */
.cursor {
    display: inline-block;
    width: 3px;
    background-color: var(--accent-primary);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Project Links Hover Effect */
.btn-link:hover {
    color: var(--accent-secondary) !important;
}

/* Contact Form & Split Layout */
.contact-split {
    display: flex;
    gap: 4rem;
    margin-top: 3rem;
}

.contact-column {
    flex: 1;
}

.contact-form-container {
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.submit-btn {
    width: 100%;
    justify-content: center;
}

@media (max-width: 768px) {
    .contact-split {
        flex-direction: column;
        gap: 2rem;
    }
}

/* =========================================
   Phase 2 Enhancements
========================================= */

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}
.loader-logo {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-primary);
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

/* Vertical Timeline for Education */
.timeline {
    position: relative;
    padding-left: 30px;
    border-left: 2px solid rgba(56, 189, 248, 0.2);
    margin-top: 1.5rem;
}
.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.timeline-item.in-view {
    opacity: 1;
    transform: translateX(0);
}
.timeline-dot {
    position: absolute;
    left: -43px;
    top: 5px;
    width: 24px;
    height: 24px;
    background: var(--bg-color);
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 0.85rem;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
    z-index: 2;
}
.timeline-date {
    font-size: 0.85rem;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.timeline-content {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: border-color 0.3s ease;
}
.timeline-content:hover {
    border-color: rgba(56, 189, 248, 0.3);
}
.timeline-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}
.timeline-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Scroll Progress Bar */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: var(--accent-primary);
    z-index: 99999;
    transition: width 0.1s;
}

/* Project Filters */
.project-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}
.filter-btn {
    background: var(--surface-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    color: var(--text-primary);
    font-weight: 500;
    transition: var(--transition-fast);
}
.filter-btn:hover, .filter-btn.active {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}
.project-card.hide-project {
    display: none;
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--accent-primary);
    color: #fff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition-normal);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}
#back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Toast Notification */
#toast-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: var(--surface-color);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    border-left: 4px solid var(--accent-primary);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInLeft 0.3s forwards;
    transition: opacity 0.3s;
}
@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* =========================================
   Phase 4 Enhancements
========================================= */

/* Animated Gradient Text */
.gradient-text {
    background: linear-gradient(90deg, var(--accent-primary), #818cf8, var(--accent-primary));
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: gradient-flow 3s linear infinite;
}
@keyframes gradient-flow {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* Magnetic Buttons */
.magnetic {
    transition: transform 0.3s cubic-bezier(0.1, 0.5, 0.1, 1);
}
.btn, .filter-btn {
    display: inline-block; /* Ensure transforms work properly */
}

/* Spinner Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}
.animate-spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* Interactive Enhancements */