/* ===================================
   CSS VARIABLES - DARK MODE (DEFAULT)
   =================================== */
:root {
    --bg: #0b0f19;
    --card: #161b2a;
    --accent: #3b82f6;
    --text: #f1f5f9;
    --dim: #94a3b8;
    --border-light: rgba(255, 255, 255, 0.05);
    --border-medium: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --card-gradient-start: #161b2a;
    --card-gradient-end: #0f172a;
    --overlay-light: rgba(255, 255, 255, 0.1);
    --timeline-shadow: var(--bg);
}

/* ===================================
   LIGHT MODE VARIABLES
   =================================== */
[data-theme="light"] {
    --bg: #f8fafc;
    --card: #ffffff;
    --accent: #3b82f6;
    --text: #0f172a;
    --dim: #475569;
    --border-light: rgba(0, 0, 0, 0.05);
    --border-medium: rgba(0, 0, 0, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --card-gradient-start: #ffffff;
    --card-gradient-end: #f1f5f9;
    --overlay-light: rgba(0, 0, 0, 0.05);
    --timeline-shadow: var(--card);
}

/* ===================================
   GLOBAL RESET & BASE STYLES
   =================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

/* ===================================
   THEME TOGGLE BUTTON
   =================================== */
.theme-toggle {
    background: var(--card);
    border: 1px solid var(--border-medium);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: 20px;
    color: var(--text);
    font-size: 1.2rem;
}

.theme-toggle:hover {
    transform: rotate(15deg);
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

/* ===================================
   NAVIGATION
   =================================== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 8%;
    background: var(--bg);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    transition: padding 0.3s ease, background 0.3s ease;
}

[data-theme="light"] .navbar {
    background: rgba(248, 250, 252, 0.95);
}

.navbar.scrolled {
    padding: 15px 8%;
    box-shadow: 0 4px 20px var(--shadow-color);
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-cta {
    background: var(--accent) !important;
    padding: 10px 24px;
    border-radius: 8px;
    color: white !important;
}

.nav-cta::after {
    display: none !important;
}

.nav-cta:hover {
    background: #2563eb !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    color: white !important;
}

/* Prevent active state from changing Contact button */
.nav-cta.active {
    background: var(--accent) !important;
    color: white !important;
}

.nav-cta.active:hover {
    background: #2563eb !important;
}

/* ===================================
   HERO SECTION - NEW LAYOUT
   =================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 140px 40px 80px 40px;
}

.hero-content {
    width: 100%;
    max-width: 1200px;
}

.hero-layout {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 80px;
    align-items: center;
}

/* Hero Image Section */
.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.photo-frame-hero {
    width: 420px;
    height: 420px;
    background: var(--card);
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    border: 6px solid var(--border-medium);
    box-shadow: 0 0 60px rgba(59, 130, 246, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="light"] .photo-frame-hero {
    box-shadow: 0 0 60px rgba(59, 130, 246, 0.2);
    border: 6px solid rgba(0, 0, 0, 0.1);
}

.photo-frame-hero:hover {
    transform: scale(1.05);
    box-shadow: 0 0 80px rgba(59, 130, 246, 0.5);
}

.photo-frame-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
}

.photo-frame-hero .photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent);
    mix-blend-mode: multiply;
    opacity: 0.1;
}

/* Hero Text Section */
.hero-text {
    text-align: left;
}

.hero-greeting {
    font-size: 1.2rem;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 10px;
    display: block;
}

.hero-name {
    font-size: clamp(3rem, 6vw, 5rem);
    line-height: 1.1;
    margin: 0 0 20px 0;
    font-weight: 800;
}

.gradient-text-hero {
    background: linear-gradient(120deg, #3b82f6, #60a5fa, #34d399, #fbbf24, #f97316);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
}

.hero-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 20px;
}

.hero-description {
    color: var(--dim);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 40px;
    max-width: 650px;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
}

.stat-box {
    text-align: left;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(120deg, #3b82f6, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.stat-label {
    color: var(--dim);
    font-size: 0.95rem;
    font-weight: 500;
}

.hero-btns {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* Remove old hero styles */
.badge {
    display: none;
}

/* ===================================
   RESPONSIVE - HERO SECTION
   =================================== */
@media (max-width: 1024px) {
    .hero-layout {
        grid-template-columns: 1fr;
        gap: 50px;
        text-align: center;
    }
    
    .hero-image {
        order: 1;
    }
    
    .hero-text {
        order: 2;
        text-align: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .stat-box {
        text-align: center;
    }
    
    .hero-btns {
        justify-content: center;
    }
    
    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }
    
    .photo-frame-hero {
        width: 350px;
        height: 350px;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 120px 20px 60px 20px;
    }
    
    .hero-layout {
        gap: 40px;
    }
    
    .photo-frame-hero {
        width: 280px;
        height: 280px;
    }
    
    .hero-name {
        font-size: 2.5rem;
    }
    
    .hero-title {
        font-size: 1.4rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .hero-btns {
        flex-direction: column;
        width: 100%;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
    }
    
    .hero-stats {
        gap: 15px;
    }
}

/* ===================================
   ABOUT SECTION
   =================================== */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 60px;
    align-items: center;
}

.about-photo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.photo-frame {
    width: 100%;
    max-width: 350px;
    aspect-ratio: 1/1;
    background: var(--card);
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    border: 4px solid var(--accent);
    box-shadow: 0 0 50px rgba(59, 130, 246, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="light"] .photo-frame {
    box-shadow: 0 0 50px rgba(59, 130, 246, 0.2);
}

.photo-frame:hover {
    transform: scale(1.05);
    box-shadow: 0 0 60px rgba(59, 130, 246, 0.5);
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 30%;
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent);
    mix-blend-mode: multiply;
    opacity: 0.15;
}

.about-text p {
    margin-bottom: 20px;
    line-height: 1.8;
    font-size: 1.05rem;
}

/* ===================================
   LAYOUT STRUCTURE
   =================================== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 60px 0;
    position: relative;
}

.section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--accent),
        transparent
    );
}

.section:last-of-type::after {
    display: none;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: 800;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

/* ===================================
   CARDS & COMPONENTS
   =================================== */
.card {
    background: var(--card);
    padding: 40px;
    border-radius: 24px;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow-color);
}

.card-title {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.card p {
    line-height: 1.8;
    margin-bottom: 10px;
}

.skills-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Skill Groups */
.skill-group {
    margin-bottom: 30px;
}

.skill-group:last-child {
    margin-bottom: 0;
}

.skill-group-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text);
}

.pill {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 8px 18px;
    border-radius: 50px;
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pill:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}

.text-dim {
    color: var(--dim);
}

.bg-accent {
    background: linear-gradient(145deg, var(--card-gradient-start), var(--card-gradient-end));
}

.border-blue {
    border: 2px solid var(--accent);
}

.quote-card {
    font-style: italic;
    background: linear-gradient(145deg, var(--card-gradient-start), var(--card-gradient-end));
    position: relative;
    padding-left: 60px;
}

.quote-card::before {
    content: '"';
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 4rem;
    color: var(--accent);
    opacity: 0.3;
    font-family: Georgia, serif;
}

.quote-card p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.quote-card small {
    color: var(--accent);
    font-weight: 600;
}

.service-list {
    list-style: none;
    padding: 0;
}

.service-list li {
    margin: 20px 0;
    line-height: 1.8;
    font-size: 1.05rem;
}

/* ===================================
   BUTTONS
   =================================== */
.btn-primary {
    background: var(--accent);
    color: white;
    padding: 16px 32px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-secondary {
    color: var(--text);
    border: 2px solid var(--border-medium);
    padding: 16px 32px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--overlay-light);
    border-color: var(--accent);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.5);
    background: #2563eb;
}

/* ===================================
   EXPERIENCE TIMELINE
   =================================== */
.timeline-item {
    border-left: 3px solid var(--accent);
    padding-left: 30px;
    margin-bottom: 40px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 5px;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--timeline-shadow);
}

.timeline-item h4 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: var(--text);
}

.timeline-item p {
    line-height: 1.6;
}

/* ===================================
   PROJECTS SECTION
   =================================== */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 15px 40px var(--shadow-color);
}

.project-img-placeholder {
    height: 220px;
    background: linear-gradient(135deg, var(--card-gradient-start), var(--card-gradient-end));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--dim);
    font-size: 1.1rem;
}

.project-info {
    padding: 30px;
}

.project-info h3 {
    margin-bottom: 12px;
    font-size: 1.4rem;
}

.project-info p {
    color: var(--dim);
    line-height: 1.7;
}

/* ===================================
   CONTACT SECTION
   =================================== */
.contact-section {
    padding: 60px 0;
}

.contact-card {
    background: linear-gradient(145deg, var(--card-gradient-start), var(--card-gradient-end));
    padding: 80px 40px;
    border-radius: 40px;
    text-align: center;
    border: 2px solid var(--accent);
    box-shadow: 0 0 50px rgba(59, 130, 246, 0.2);
}

.contact-card h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.contact-card p {
    font-size: 1.1rem;
    color: var(--dim);
    max-width: 600px;
    margin: 0 auto;
}

.contact-btns {
    margin-top: 40px;
}

/* ===================================
   SCROLL REVEAL ANIMATION
   =================================== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================
   FOOTER
   =================================== */
footer {
    text-align: center;
    padding: 60px 20px;
    color: var(--dim);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-light);
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 5%;
    }

    .nav-links {
        display: none;
    }

    .hero {
        padding-top: 120px;
    }

    h1 {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .photo-frame {
        max-width: 280px;
    }

    .section {
        padding: 40px 0;
    }

    .section::after {
        width: 90%;
    }

    .quote-card {
        padding-left: 40px;
    }

    .quote-card::before {
        font-size: 3rem;
        left: 10px;
    }
}

@media (max-width: 480px) {
    .hero-btns {
        flex-direction: column;
        width: 100%;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
    }
}

/* ===================================
   ACTIVE NAV LINK
   =================================== */
.nav-links a.active {
    color: var(--accent);
}

.nav-links a.active::after {
    width: 100%;
}

/* ===================================
   BACK TO TOP BUTTON
   =================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #2563eb;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.6);
}

/* ===================================
   PRELOADER (Optional)
   =================================== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.preloader::after {
    content: '';
    width: 50px;
    height: 50px;
    border: 5px solid rgba(59, 130, 246, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===================================
   HERO STATS (HORIZONTAL)
   =================================== */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin: 60px auto 40px;
    max-width: 900px;
}

.hero-stats .stat-item {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(145deg, var(--card-gradient-start), var(--card-gradient-end));
    border-radius: 18px;
    border: 1px solid rgba(59, 130, 246, 0.45);
    box-shadow: 0 0 35px rgba(59, 130, 246, 0.25);
}

[data-theme="light"] .hero-stats .stat-item {
    box-shadow: 0 0 35px rgba(59, 130, 246, 0.1);
}

.hero-stats .stat-item h3 {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 6px;
}

.hero-stats .stat-item p {
    color: var(--dim);
    font-size: 0.95rem;
}

/* ===================================
   SECTION SUBTITLE
   =================================== */
.section-subtitle {
    text-align: center;
    color: var(--dim);
    font-size: 1.1rem;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ===================================
   PROJECT TAGS
   =================================== */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.tag {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ===================================
   CTA BOX
   =================================== */
.cta-box {
    margin-top: 30px;
    text-align: center;
    padding: 30px;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 20px;
    border: 2px dashed var(--accent);
}

.cta-box p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 600;
}

/* ===================================
   CONTACT METHODS
   =================================== */
.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.contact-item {
    text-align: center;
    padding: 25px;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 16px;
    border: 1px solid var(--border-medium);
}

.contact-item strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text);
}

.contact-item p {
    margin: 0;
}

.contact-item a {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.3s ease;
}

.contact-item a:hover {
    color: #60a5fa;
    text-decoration: underline;
}

/* ===================================
   FOOTER LINKS
   =================================== */
.footer-links {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--dim);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent);
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 768px) {
    .about-stats {
        grid-template-columns: 1fr;
    }
    
    .contact-methods {
        grid-template-columns: 1fr;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
}

/* SERVICES GRID */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.service-card {
    background: var(--card);
    padding: 30px 20px;
    border-radius: 18px;
    text-align: center;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px var(--shadow-color);
}

.service-icon {
    font-size: 32px;
    color: var(--accent);
    margin-bottom: 15px;
}

.service-card h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.service-card p {
    color: var(--dim);
    font-size: 0.9rem;
    line-height: 1.6;
}

.project-list {
    margin-top: 10px;
    padding-left: 18px;
    color: var(--dim);
    font-size: 0.95rem;
    line-height: 1.7;
}

.project-list li {
    margin-bottom: 6px;
}

.project-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid var(--border-medium);
}

/* If your project-card has border-radius, ensure the image respects it */
.project-card {
    overflow: hidden;
}

/* ===================================
   ADDITIONAL LIGHT MODE ADJUSTMENTS
   =================================== */
[data-theme="light"] .service-card {
    border: 1px solid #e2e8f0;
}

[data-theme="light"] .contact-item {
    background: rgba(59, 130, 246, 0.08);
}

[data-theme="light"] .cta-box {
    background: rgba(59, 130, 246, 0.08);
}

[data-theme="light"] .project-tags .tag {
    background: rgba(59, 130, 246, 0.2);
}

[data-theme="light"] .pill {
    background: rgba(59, 130, 246, 0.15);
}

/* ===================================
   MOBILE NAVIGATION CONTROLS
   =================================== */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1001;
}

/* Mobile Menu Button (Hamburger) */
.mobile-menu-btn {
    display: none;
    background: var(--accent);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1002;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--card);
    border: 1px solid var(--border-medium);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text);
    font-size: 1.2rem;
}

.theme-toggle i {
    font-size: 1.2rem;
}

.theme-toggle:hover {
    transform: rotate(15deg);
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===================================
   MOBILE RESPONSIVE STYLES
   =================================== */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 5%;
    }
    
    /* Show mobile menu button */
    .mobile-menu-btn {
        display: flex;
    }
    
    /* Hide navigation links by default on mobile */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: var(--bg);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        gap: 25px;
        padding: 100px 30px 40px;
        transition: right 0.3s ease;
        box-shadow: -5px 0 20px var(--shadow-color);
        z-index: 999;
        margin: 0;
    }
    
    [data-theme="light"] .nav-links {
        background: rgba(248, 250, 252, 0.98);
    }
    
    /* Show navigation links when active */
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        width: 100%;
        text-align: center;
        opacity: 0;
        transform: translateX(20px);
        transition: all 0.3s ease;
    }
    
    .nav-links.active li {
        opacity: 1;
        transform: translateX(0);
    }
    
    /* Stagger animation for menu items */
    .nav-links.active li:nth-child(1) { transition-delay: 0.05s; }
    .nav-links.active li:nth-child(2) { transition-delay: 0.1s; }
    .nav-links.active li:nth-child(3) { transition-delay: 0.15s; }
    .nav-links.active li:nth-child(4) { transition-delay: 0.2s; }
    .nav-links.active li:nth-child(5) { transition-delay: 0.25s; }
    
    .nav-links a {
        display: block;
        padding: 12px 0;
        font-size: 1.1rem;
    }
    
    .nav-links a::after {
        bottom: 5px;
    }
    
    .nav-cta {
        background: var(--accent) !important;
        padding: 12px 24px;
        margin-top: 10px;
        display: inline-block;
    }
    
    /* Hero section adjustments */
    .hero {
        padding: 100px 20px 60px 20px;
    }
    
    .hero-layout {
        gap: 40px;
    }
    
    .photo-frame-hero {
        width: 260px;
        height: 260px;
    }
    
    .hero-name {
        font-size: 2rem;
    }
    
    .hero-title {
        font-size: 1.2rem;
    }
    
    .hero-greeting {
        font-size: 1rem;
    }
    
    /* Section adjustments */
    .section {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 1.8rem;
        text-align: center;
    }
    
    /* Skills section */
    .card {
        padding: 25px;
    }
    
    .skill-group-title {
        font-size: 1rem;
    }
    
    .pill {
        padding: 6px 14px;
        font-size: 0.75rem;
    }
    
    /* Services grid */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .service-card {
        padding: 25px 20px;
    }
    
    /* Projects grid */
    .project-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .project-info {
        padding: 20px;
    }
    
    .project-info h3 {
        font-size: 1.2rem;
    }
    
    .project-list {
        font-size: 0.85rem;
        padding-left: 15px;
    }
    
    .project-list li {
        margin-bottom: 8px;
    }
    
    .project-tags {
        margin-top: 12px;
    }
    
    .tag {
        font-size: 0.7rem;
        padding: 3px 10px;
    }
    
    /* Contact section */
    .contact-card {
        padding: 40px 20px;
    }
    
    .contact-card h2 {
        font-size: 1.6rem;
    }
    
    .contact-card p {
        font-size: 0.95rem;
    }
    
    .contact-methods {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .contact-item {
        padding: 20px;
    }
    
    .contact-btns {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .contact-btns .btn-primary,
    .contact-btns .btn-secondary {
        width: 100%;
        text-align: center;
    }
    
    /* CTA Box */
    .cta-box {
        padding: 25px 20px;
        margin-top: 20px;
    }
    
    .cta-box p {
        font-size: 1rem;
    }
    
    /* Buttons */
    .btn-primary,
    .btn-secondary {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
    
    /* Footer */
    footer {
        padding: 40px 20px;
    }
    
    footer p {
        font-size: 0.8rem;
    }
    
    .footer-links {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 20px;
        justify-content: center;
    }
    
    .footer-links a {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .photo-frame-hero {
        width: 220px;
        height: 220px;
    }
    
    .hero-name {
        font-size: 1.8rem;
    }
    
    .hero-title {
        font-size: 1rem;
    }
    
    .hero-btns {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-btns .btn-primary,
    .hero-btns .btn-secondary {
        width: 100%;
        text-align: center;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .skills-wrap {
        gap: 8px;
    }
    
    .pill {
        padding: 5px 12px;
        font-size: 0.7rem;
    }
    
    .service-icon {
        font-size: 28px;
    }
    
    .service-card h4 {
        font-size: 1rem;
    }
    
    .service-card p {
        font-size: 0.85rem;
    }
    
    .project-img {
        height: 160px;
    }
    
    .nav-links {
        width: 85%;
        padding: 80px 20px 30px;
    }
    
    .nav-controls {
        gap: 10px;
    }
    
    .theme-toggle,
    .mobile-menu-btn {
        width: 36px;
        height: 36px;
    }
    
    .theme-toggle i {
        font-size: 1rem;
    }
}

/* Landscape mode adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .nav-links {
        padding: 60px 30px 20px;
        gap: 15px;
    }
    
    .nav-links a {
        padding: 8px 0;
        font-size: 1rem;
    }
    
    .hero {
        padding: 90px 20px 40px;
    }
    
    .photo-frame-hero {
        width: 180px;
        height: 180px;
    }
    
    .hero-name {
        font-size: 1.6rem;
    }
}

/* Touch device optimizations */
@media (hover: hover) {
    .pill:hover,
    .service-card:hover,
    .project-card:hover,
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: translateY(-3px);
    }
}

@media (hover: none) {
    .pill:active,
    .service-card:active,
    .project-card:active,
    .btn-primary:active,
    .btn-secondary:active {
        transform: scale(0.98);
    }
}

/* ===================================
   NAVIGATION - Desktop First
   =================================== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 8%;
    background: var(--bg);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    transition: padding 0.3s ease, background 0.3s ease;
}

[data-theme="light"] .navbar {
    background: rgba(248, 250, 252, 0.95);
}

.navbar.scrolled {
    padding: 15px 8%;
    box-shadow: 0 4px 20px var(--shadow-color);
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    z-index: 1001;
}

.logo span {
    color: var(--accent);
}

/* Desktop Navigation */
.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-links li {
    display: flex;
    align-items: center;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-cta {
    background: var(--accent) !important;
    padding: 10px 24px;
    border-radius: 8px;
    color: white !important;
}

.nav-cta::after {
    display: none !important;
}

.nav-cta:hover {
    background: #2563eb !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    color: white !important;
}

/* ===================================
   MOBILE MENU - Hidden by default, only appears on mobile
   =================================== */
.mobile-menu-btn {
    display: none;
    background: var(--accent);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    z-index: 1002;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu Panel - Hidden by default, slides in from right */
.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 350px;
    height: 100vh;
    background: var(--bg);
    backdrop-filter: blur(20px);
    z-index: 2000;
    transition: right 0.3s ease;
    box-shadow: -5px 0 30px var(--shadow-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

[data-theme="light"] .mobile-menu-panel {
    background: rgba(248, 250, 252, 0.98);
}

.mobile-menu-panel.active {
    right: 0;
}

/* Mobile Menu Header */
.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-light);
}

.mobile-menu-logo {
    font-size: 1.3rem;
    font-weight: 800;
}

.mobile-menu-logo span {
    color: var(--accent);
}

.mobile-menu-close {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mobile-menu-close:hover {
    background: var(--overlay-light);
    color: var(--accent);
}

/* Mobile Navigation Links */
.mobile-nav-links {
    list-style: none;
    padding: 30px 25px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mobile-nav-links li {
    width: 100%;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.mobile-menu-panel.active .mobile-nav-links li {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered animation for mobile menu items */
.mobile-menu-panel.active .mobile-nav-links li:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu-panel.active .mobile-nav-links li:nth-child(2) { transition-delay: 0.1s; }
.mobile-menu-panel.active .mobile-nav-links li:nth-child(3) { transition-delay: 0.15s; }
.mobile-menu-panel.active .mobile-nav-links li:nth-child(4) { transition-delay: 0.2s; }
.mobile-menu-panel.active .mobile-nav-links li:nth-child(5) { transition-delay: 0.25s; }

.mobile-nav-links a {
    color: var(--text);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    display: block;
    padding: 12px 0;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-nav-links a::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.mobile-nav-links a:hover::after {
    width: 100%;
}

.mobile-nav-links a:hover {
    color: var(--accent);
    padding-left: 10px;
}

.nav-cta-mobile {
    background: var(--accent) !important;
    padding: 12px 24px !important;
    border-radius: 8px;
    color: white !important;
    text-align: center;
    margin-top: 10px;
}

.nav-cta-mobile::after {
    display: none !important;
}

.nav-cta-mobile:hover {
    background: #2563eb !important;
    transform: translateY(-2px);
}

/* Menu Overlay - Mobile only */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===================================
   RESPONSIVE BREAKPOINTS
   =================================== */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 5%;
    }
    
    /* Hide desktop navigation on mobile */
    .nav-links {
        display: none;
    }
    
    /* Show mobile menu button on mobile */
    .mobile-menu-btn {
        display: flex;
    }
}

@media (min-width: 769px) {
    /* Hide all mobile-only elements on desktop */
    .mobile-menu-panel,
    .mobile-menu-btn,
    .menu-overlay {
        display: none !important;
    }
}

/* ===================================
   MOBILE THEME TOGGLE BUTTON
   =================================== */
.mobile-theme-toggle-item {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
}

.theme-toggle-mobile {
    background: var(--card);
    border: 1px solid var(--border-medium);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text);
    font-size: 1.4rem;
    padding: 0;
    margin: 0 auto;
}

.theme-toggle-mobile i {
    font-size: 1.4rem;
}

.theme-toggle-mobile:hover {
    transform: rotate(15deg);
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.theme-toggle-mobile:active {
    transform: scale(0.95);
}