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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --gradient-1: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-2: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
    --bg-dark: #f8fafc;
    --bg-darker: #ffffff;
    --bg-card: #e2e8f0;
    /* Darker card background for visibility */
    --text-primary: #0f172a;
    /* Very dark blue/black */
    --text-secondary: #334155;
    /* Darker secondary */
    --text-muted: #475569;
    /* Darker muted */
    --border-color: #cbd5e1;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
    --modal-overlay: rgba(0, 0, 0, 0.6);
}

/* Light mode navbar override */
[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

[data-theme="light"] .navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .project-card,
[data-theme="light"] .skill-category,
[data-theme="light"] .timeline-item-content,
[data-theme="light"] .contact-item,
[data-theme="light"] .code-window,
[data-theme="light"] .admin-blog-card,
[data-theme="light"] .login-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
}

[data-theme="light"] .code-window-content {
    color: #f8fafc;
    /* Keep code light on dark bg, OR invert if desired. Usually dark terminal is preferred. */
    background: #1e293b;
    /* Force dark background for code window in light mode */
}

[data-theme="light"] .hero-subtitle {
    color: var(--text-secondary);
}

[data-theme="light"] .footer {
    background: #f1f5f9;
    border-top: 1px solid var(--border-color);
}

[data-theme="light"] .nav-menu {
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] .nav-mobile-toggle span {
    background: var(--text-primary);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-darker);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    animation: fadeIn 0.5s ease-in-out;
}

/* Resume Modal */
.resume-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    padding: 2rem;
}

.resume-modal.active {
    display: flex;
}

.resume-modal-container {
    width: 100%;
    max-width: 1000px;
    height: 90vh;
    background: var(--bg-dark);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.resume-modal-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.resume-modal-close {
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.resume-modal-close:hover {
    color: var(--primary-color);
}

.resume-iframe {
    width: 100%;
    height: calc(100% - 60px);
    border: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

body.fade-out {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

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

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    padding: 0.8rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
}


.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    width: 40px;
    height: 40px;
    background: var(--gradient-1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: white;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 600;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-1);
    transition: width 0.3s;
}

.nav-menu a:hover::after {
    width: 100%;
}

.nav-item-resume {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1rem;
}

.nav-item-resume>a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.nav-item-resume:hover>a {
    color: var(--primary-color);
}

.resume-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.resume-view-btn,
.resume-download-btn {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.resume-view-btn:hover,
.resume-download-btn:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}


/* Modern Theme Toggle Switch */
.theme-toggle-btn {
    background: transparent;
    border: none;
    padding: 0;
    margin-left: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1001;
    /* Above mobile menu if needed */
}


.theme-toggle-btn:hover {
    transform: scale(1.1);
}

.theme-switch {
    position: relative;
    width: 64px;
    height: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    display: flex;
    align-items: center;
    padding: 2px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-switch-thumb {
    position: absolute;
    left: 2px;
    width: 26px;
    height: 26px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s ease;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.theme-switch-icon {
    font-size: 14px;
    user-select: none;
    transition: transform 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Light mode specific switch styles */
[data-theme="light"] .theme-switch {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

[data-theme="light"] .theme-switch-thumb {
    transform: translateX(32px);
    background: #f59e0b;
    /* Sunny yellow */
}

/* Icons within thumb */
.theme-switch-thumb .sun-icon {
    display: none;
}

.theme-switch-thumb .moon-icon {
    display: block;
}

[data-theme="light"] .theme-switch-thumb .sun-icon {
    display: block;
}

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

/* Background icons */
.theme-switch::before,
.theme-switch::after {
    position: absolute;
    font-size: 12px;
    z-index: 1;
    opacity: 0.5;
}

.theme-switch::before {
    content: "☀️";
    right: 8px;
}

.theme-switch::after {
    content: "🌙";
    left: 8px;
}


.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    cursor: pointer;
    width: 32px;
    height: 32px;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.3s ease;
    z-index: 1001;
    position: relative;
}

.hamburger:hover {
    background: rgba(var(--primary-rgb), 0.1);
}

.hamburger span,
.hamburger::before,
.hamburger::after {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--text-primary);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6);
    position: absolute;
}

/* Dots positionings for Kebab state */
.hamburger::before {
    top: 6px;
}

/* Top dot */
.hamburger span {
    top: 14px;
}

/* Middle dot */
.hamburger::after {
    top: 22px;
}

/* Bottom dot */

/* Morph to X animation */
.hamburger.active::before {
    top: 14px;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    transform: rotate(45deg);
}

.hamburger.active span {
    opacity: 0;
    transform: scale(0);
}

.hamburger.active::after {
    top: 14px;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    transform: rotate(-45deg);
}


/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
    /* Increased for fixed navbar clearance */
    background: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

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

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn {
    padding: 0.875rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

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

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

.social-links a:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Code Window */
.code-window {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.window-header {
    background: var(--bg-dark);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red {
    background: #ef4444;
}

.dot.yellow {
    background: #f59e0b;
}

.dot.green {
    background: #10b981;
}

.window-title {
    margin-left: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.code-content {
    padding: 1.5rem;
    overflow-x: auto;
}

.code-content pre {
    margin: 0;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.code-content .keyword {
    color: #c792ea;
}

.code-content .function {
    color: #82aaff;
}

.code-content .string {
    color: #c3e88d;
}

.code-content .number {
    color: #f78c6c;
}

.code-content .comment {
    color: #546e7a;
    font-style: italic;
}

/* ===== Sections ===== */
section {
    padding: 5rem 0;
    position: relative;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.skill-category {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.skill-category:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.category-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon {
    font-size: 1.5rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tag {
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s;
}

.skill-tag:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* ===== Projects Section ===== */
.projects {
    background: var(--bg-dark);
}

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

.project-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.project-icon {
    font-size: 2.5rem;
}

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

.project-link {
    color: var(--text-muted);
    transition: color 0.3s;
}

.project-link:hover {
    color: var(--primary-color);
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

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

.tag {
    padding: 0.375rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
}

/* ===== Experience Section ===== */
.timeline {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
}

.timeline-marker {
    position: absolute;
    left: -2.5rem;
    top: 0.5rem;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 3px solid var(--bg-darker);
    box-shadow: 0 0 0 4px var(--border-color);
}

.timeline-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.timeline-date {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline-company {
    color: var(--text-secondary);
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.timeline-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.timeline-skills {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.timeline-skills li {
    padding: 0.375rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ===== Contact Section ===== */
.contact {
    background: var(--bg-dark);
}

.contact-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 3rem;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.contact-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.contact-item h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.contact-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.contact-item a:hover {
    color: var(--primary-color);
}

.contact-form-container {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-dark);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

.footer-tagline {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

/* ===== Responsive Design ===== */
@media (max-width: 968px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

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

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

    .about-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .navbar .container {
        padding: 0 1rem;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(15, 23, 42, 0.85);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: all 0.5s cubic-bezier(0.77, 0, 0.175, 1);
        z-index: 1000;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        padding: 4rem 2rem;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu li {
        width: 100%;
        opacity: 0;
        transform: translateX(30px);
        transition: all 0.4s ease;
    }

    .nav-menu.active li {
        opacity: 1;
        transform: translateX(0);
    }

    /* Staggered link animations */
    .nav-menu.active li:nth-child(1) {
        transition-delay: 0.1s;
    }

    .nav-menu.active li:nth-child(2) {
        transition-delay: 0.15s;
    }

    .nav-menu.active li:nth-child(3) {
        transition-delay: 0.2s;
    }

    .nav-menu.active li:nth-child(4) {
        transition-delay: 0.25s;
    }

    .nav-menu.active li:nth-child(5) {
        transition-delay: 0.3s;
    }

    .nav-menu.active li:nth-child(6) {
        transition-delay: 0.35s;
    }

    .nav-menu.active li:nth-child(7) {
        transition-delay: 0.4s;
    }

    .nav-menu.active li:nth-child(8) {
        transition-delay: 0.45s;
    }

    .nav-menu.active li:nth-child(9) {
        transition-delay: 0.5s;
    }

    .nav-menu a {
        font-size: 1.25rem;
        display: block;
        padding: 0.5rem 0;
    }

    .nav-brand {
        order: 1;
    }

    .theme-toggle-btn {
        order: 2;
        margin-left: auto;
        margin-right: 0.5rem;
        z-index: 1001;
    }

    .hamburger {
        order: 3;
        display: flex;
        margin-left: 0;
    }

    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s ease;
        z-index: 999;
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

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

    .section-title {
        font-size: 2rem;
    }

    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .timeline {
        padding-left: 1.5rem;
    }

    .timeline-marker {
        left: -1.75rem;
    }

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


@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    section {
        padding: 3rem 0;
    }

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    /* Increased for breathing room */
}

/* --- THE NARRATIVE EXPERIENCE STYLES --- */

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1200px;
}

.tech-orbit {
    position: relative;
    width: 300px;
    height: 300px;
    margin-top: 3rem;
}

.orbit-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95px;
    height: 95px;
    background: rgba(15, 23, 42, 0.4);
    /* Dark translucent base */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-weight: 800;
    font-size: 1.8rem;
    box-shadow:
        0 0 40px rgba(var(--primary-rgb), 0.25),
        inset 0 0 0 1px rgba(var(--primary-rgb), 0.3);
    z-index: 5;
    border: none;
    /* Using inset shadow for cleaner border */
}

/* Ensure visibility in light mode */
[data-theme="light"] .orbit-center {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
    box-shadow: 0 0 30px rgba(var(--primary-rgb), 0.15);
}

.orbit-path {
    position: absolute;
    border: 1px solid rgba(var(--primary-rgb), 0.05);
    /* Solid but very faint */
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    /* Let clicks pass through path to center etc */
}

.orbit-path img {
    position: absolute;
    width: 48px;
    height: 48px;
    background: var(--card-bg);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: var(--shadow-sm);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: grayscale(1) opacity(0.4) brightness(0.8);
    pointer-events: auto;
    /* Re-enable for the image itself */
}

.orbit-path:hover img {
    transform: translate(-50%, -50%) scale(1.4);
    border-color: var(--primary-color);
    filter: grayscale(0) opacity(1) brightness(1.2);
    box-shadow: 0 0 30px rgba(var(--primary-rgb), 0.5);
    z-index: 10;
}

/* Specific lighting for inverted logos */
.orbit-path:hover img.inverted {
    filter: brightness(2) drop-shadow(0 0 15px var(--primary-color));
}

/* Orbit Path Radii & Animations */
.p1 {
    width: 160px;
    height: 160px;
    animation: rotate 15s linear infinite;
}

.p2 {
    width: 260px;
    height: 260px;
    animation: rotate 22s linear reverse infinite;
}

.p3 {
    width: 340px;
    height: 340px;
    animation: rotate 30s linear infinite;
}

.p4 {
    width: 420px;
    height: 420px;
    animation: rotate 40s linear reverse infinite;
}

.p5 {
    width: 100px;
    height: 100px;
    animation: rotate 10s linear infinite;
}

.p6 {
    width: 210px;
    height: 210px;
    animation: rotate 18s linear reverse infinite;
}

.p7 {
    width: 420px;
    height: 420px;
    animation: rotate 40s linear reverse infinite;
    animation-delay: -20s;
}

/* Sharing path p4 with offset */
.p8 {
    width: 260px;
    height: 260px;
    animation: rotate 22s linear reverse infinite;
    animation-delay: -11s;
}

/* Sharing path p2 with offset */
.p9 {
    width: 100px;
    height: 100px;
    animation: rotate 10s linear infinite;
    animation-delay: -5s;
}

/* Sharing path p5 with offset */

@keyframes rotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Bento Grid */
.bento-section {
    padding: 100px 0;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(160px, auto);
    gap: 1.5rem;
    margin-top: 3rem;
}

.bento-item {
    border-radius: 28px;
    padding: 2.2rem;
    border: 1px solid var(--border-color);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--card-bg);
    position: relative;
    overflow: hidden;
}

.bento-item.wide {
    grid-column: span 2;
}

.bento-item.glass {
    background: rgba(var(--card-bg-rgb), 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.bento-item:hover {
    transform: translateY(-8px) scale(1.01);
    border-color: var(--primary-color);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
}

.bento-item.accent {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
}

.bento-item.accent h3 {
    color: white;
}

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

.stat-num {
    font-size: 3.5rem;
    font-weight: 900;
    display: block;
    color: var(--primary-color);
    line-height: 1;
}

.stat-desc {
    font-weight: 600;
    opacity: 0.8;
    margin-top: 0.5rem;
    display: block;
}

.expertise-row {
    display: flex;
    justify-content: space-around;
    margin-top: 1.5rem;
}

.expertise-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
}

.exp-icon {
    font-size: 1.8rem;
    background: rgba(var(--primary-rgb), 0.1);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
}

/* Impact Section */
.impact-section {
    padding: 80px 0;
    background: rgba(var(--primary-rgb), 0.02);
}

.impact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.impact-card {
    padding: 2.5rem;
    border-radius: 35px;
    border: 1px solid var(--border-color);
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    background: var(--card-bg);
}

.impact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.impact-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.1);
    padding: 6px 14px;
    border-radius: 100px;
}

.impact-val {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary-color);
    line-height: 1;
}

.impact-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 40px 80px rgba(var(--primary-rgb), 0.12);
    border-color: var(--primary-color);
}

/* Fix Hero UI buttons margin */
.hero-buttons .glass {
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.05);
}

/* Project Showcase */
.projects-showcase {
    padding: 100px 0;
    background: var(--bg-color);
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-top: 3rem;
}

.showcase-card {
    padding: 2.5rem;
    border-radius: 35px;
    border: 1px solid var(--border-color);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.showcase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.showcase-icon {
    font-size: 2.5rem;
}

.github-link {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 100px;
    transition: all 0.3s ease;
}

.github-link:hover {
    background: var(--primary-color);
    color: white;
}

.showcase-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.showcase-card p {
    opacity: 0.8;
    line-height: 1.6;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.showcase-tags {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.showcase-tags span {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.showcase-card:hover {
    transform: translateY(-12px);
    border-color: var(--primary-color);
    box-shadow: 0 40px 80px rgba(var(--primary-rgb), 0.15);
}

.accent-border {
    border-width: 2px;
    border-color: rgba(var(--primary-rgb), 0.4);
}

/* Contact Bento */
.contact-bento-section {
    padding: 100px 0;
    background: rgba(var(--primary-rgb), 0.01);
}

.contact-bento-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2.5rem;
    margin-top: 3rem;
}

.contact-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-tile {
    padding: 1.5rem;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.contact-tile:hover {
    transform: translateX(10px);
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.05);
}

.tile-icon {
    font-size: 1.8rem;
}

.tile-info h4 {
    font-size: 0.9rem;
    opacity: 0.6;
    margin-bottom: 2px;
}

.tile-info a {
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.tile-info a:hover {
    color: var(--primary-color);
}

.contact-form-card {
    padding: 3.5rem;
    border-radius: 35px;
    border: 1px solid var(--border-color);
}

.narrative-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.premium-btn {
    padding: 1.2rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 18px;
    box-shadow: 0 20px 40px rgba(var(--primary-rgb), 0.3);
}

/* --- COMPREHENSIVE MOBILE RESPONSIVENESS FIXES --- */

@media (max-width: 1200px) {
    .showcase-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .contact-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .contact-tile {
        flex: 1;
        min-width: 250px;
    }
}

@media (max-width: 991px) {
    .hero {
        padding-top: 140px;
        /* More space on mobile to avoid overlap */
    }

    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .impact-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .hero-visual {
        margin-top: 3rem;
    }

    .tech-orbit {
        width: 250px;
        height: 250px;
    }

    .p1 {
        width: 120px;
        height: 120px;
    }

    .p2 {
        width: 180px;
        height: 180px;
    }

    .p3 {
        width: 240px;
        height: 240px;
    }

    .orbit-path img {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 768px) {
    section {
        padding: 60px 0 !important;
    }

    .bento-grid,
    .impact-grid,
    .showcase-grid {
        grid-template-columns: 1fr !important;
    }

    .bento-item.wide {
        grid-column: auto;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

    .contact-sidebar {
        flex-direction: column;
    }

    .section-title {
        font-size: 2.2rem;
        margin-bottom: 2rem;
    }

    .stat-num {
        font-size: 2.8rem;
    }

    .impact-val {
        font-size: 2.5rem;
    }

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

    .hero-btns {
        flex-direction: column;
        width: 100%;
    }

    .hero-btns .btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
        margin-top: 2rem;
        /* Even more space for very small screens */
    }

    .tech-orbit {
        width: 200px;
        height: 200px;
    }

    .p1 {
        width: 100px;
        height: 100px;
    }

    .p2 {
        width: 150px;
        height: 150px;
    }

    .p3 {
        width: 200px;
        height: 200px;
    }

    .orbit-center {
        width: 60px;
        height: 60px;
        font-size: 1.2rem;
    }

    .orbit-path img {
        width: 28px;
        height: 28px;
        padding: 5px;
    }
}