/* ==========================================================================
   CSS Variables & Theming
   ========================================================================== */
:root {
    /* Color Palette - Light Theme (Default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent-1: #3b82f6;
    /* Blue */
    --accent-2: #8b5cf6;
    /* Purple */
    --accent-gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2));

    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

    --card-bg: #ffffff;
    --card-border: #e2e8f0;

    --nav-bg: rgba(255, 255, 255, 0.8);

    /* Spacing & Sizes */
    --max-width: 1200px;
    --nav-height: 80px;
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #0b1120;
    --bg-secondary: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-1: #60a5fa;
    --accent-2: #a78bfa;

    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

    --card-bg: #1e293b;
    --card-border: #334155;

    --nav-bg: rgba(11, 17, 32, 0.8);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Clash Display', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

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

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

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

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 100px 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.5rem;
    display: inline-block;
}

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

.mt-6 {
    margin-top: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.w-full {
    width: 100%;
}

/* ==========================================================================
   Glassmorphism
   ========================================================================== */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--glass-shadow);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(128, 128, 128, 0.1);
    transform: translateY(-2px);
}

/* ==========================================================================
   Scroll Progress
   ========================================================================== */
.scroll-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 1000;
}

.scroll-progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    width: 0%;
    transition: width 0.1s ease;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: transparent;
    z-index: 999;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition);
}

.navbar.scrolled {
    height: 70px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

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

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary);
    position: relative;
    padding: 8px 0;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
}

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

.theme-toggle {
    position: absolute;
    right: 24px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: rgba(128, 128, 128, 0.1);
}

[data-theme="dark"] .dark-icon {
    display: none;
}

[data-theme="light"] .light-icon {
    display: none;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--nav-height);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: rgba(59, 130, 246, 0.3);
}

.blob-2 {
    bottom: 10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: rgba(139, 92, 246, 0.3);
    animation-delay: -10s;
}

.hero-content {
    text-align: center;
    max-width: 800px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-1);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 24px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.hero-title {
    font-size: 4rem;
    letter-spacing: -1px;
    margin-bottom: 24px;
}

.hero-tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* ==========================================================================
   About Section
   ========================================================================== */
.about {
    background-color: var(--bg-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-image-wrapper {
    position: relative;
    border-radius: 24px;
}

.about-image-glow {
    display: none;
}

.about-image {
    position: relative;
    z-index: 1;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--glass-border);
    max-height: 450px;
    width: 100%;
    object-fit: cover;
}

.bioText {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.skills-title {
    font-size: 1.25rem;
    margin-bottom: 20px;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-badge {
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ==========================================================================
   Projects Section
   ========================================================================== */
.projects-grid {
    display: flex;
    gap: 32px;
    overflow-x: auto;
    padding: 24px 5vw 48px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
}

.projects-grid::-webkit-scrollbar {
    display: none;
}

.projects-grid:active {
    cursor: grabbing;
}

.project-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    padding: 0;
    flex: 0 0 340px;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.project-image-container {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.project-image {
    width: 130%;
    margin-left: -15%;
    height: 100%;
    object-fit: cover;
    will-change: transform;
}

.app-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(128, 128, 128, 0.05);
}

.app-icon {
    width: 100%;
    margin-left: 0;
    object-fit: contain;
    padding: 24px;
}

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

.project-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.project-desc {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.95rem;
    flex-grow: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.project-tech span {
    font-size: 0.8rem;
    color: var(--text-primary);
    background: rgba(128, 128, 128, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.project-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--card-border);
    padding-top: 16px;
}

.btn-text {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-text i {
    transition: transform 0.3s ease;
}

.btn-text:hover i {
    transform: translateX(4px);
    color: var(--accent-1);
}

.btn-icon {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.btn-icon:hover {
    color: var(--text-primary);
}

/* ==========================================================================
   Experience Section
   ========================================================================== */
.experience {
    background-color: var(--bg-secondary);
}

.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--card-border);
}

.timeline-item {
    position: relative;
    padding-left: 70px;
    margin-bottom: 40px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 17px;
    top: 24px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-gradient);
    border: 4px solid var(--bg-secondary);
    box-shadow: 0 0 0 2px var(--accent-1);
}

.timeline-content {
    padding: 24px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.timeline-role {
    font-size: 1.25rem;
}

.timeline-date {
    font-size: 0.9rem;
    color: var(--accent-1);
    font-weight: 600;
    background: rgba(59, 130, 246, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
}

.timeline-company {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 16px;
}

.timeline-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ==========================================================================
   Contact Section
   ========================================================================== */


.contact-desc {
    color: var(--text-secondary);
    margin-bottom: 24px;
    margin-top: 16px;
}

.contact-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 500;
}

.contact-link:hover {
    color: var(--accent-1);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
    transform: translateY(-3px);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    padding: 30px 0;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--card-border);
}

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

.copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.back-to-top {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.back-to-top:hover {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -50px) rotate(10deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(-5deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

.parallax {
    will-change: transform;
}

.fade-in {
    opacity: 0;
    transition: opacity 0.8s ease;
    will-change: opacity;
}

.fade-in.appear {
    opacity: 1;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: opacity, transform;
}

.fade-in-up.appear {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-left.appear {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-right.appear {
    opacity: 1;
    transform: translateX(0);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 992px) {

    .about-grid,
    .contact-card {
        grid-template-columns: 1fr;
    }

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

    .timeline::before {
        left: 0;
    }

    .timeline-dot {
        left: -7px;
    }

    .timeline-item {
        padding-left: 30px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* Mobile menu to be added separately if needed, hiding for basic design */
    }

    .hero-title {
        font-size: 2.5rem;
    }

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

    .section {
        padding: 60px 0;
    }

    .contact-card {
        padding: 24px;
    }
}