:root {
    --primary-color: #3498db;
    --dark-color: #2c3e50;
    --light-color: #f4f4f4;
    --accent-color: #e74c3c;
    --text-color: #333;
    --text-light: #fff;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --section-padding: 6rem 0;
    --bg-main: #0b0f1a;
    --text-main: #ffffff;
    --nav-bg: rgba(11, 15, 26, 0.8);
}


/* Loading Screen */

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0b0f1a;
    /* Match dark mode bg */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loader-content {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-logo {
    width: 60px;
    height: 60px;
    z-index: 2;
    border-radius: 50%;
    object-fit: contain;
}

.loader-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #61abc0;
    /* Cyan */
    border-right-color: #c170f7;
    /* Purple */
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(97, 171, 192, 0.5), 0 0 15px rgba(193, 112, 247, 0.5);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

body.loaded #loading-screen {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}


/* Base Styles */

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: var(--text-color);
    scroll-behavior: smooth;
    padding-top: 0;
    background-color: var(--bg-main);
    color: var(--text-main);
}

body:not(.dark-mode) {
    background-color: #ffffff;
    color: #0b0f1a;
    --bg-main: #ffffff;
    --text-main: #0b0f1a;
    --nav-bg: rgba(255, 255, 255, 0.8);
}


/* ======================
   Professional Navigation Bar
   ====================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.24);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(231, 213, 213, 0.342);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

.dark-mode .navbar {
    background: rgba(18, 18, 18, 0.575);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.dark-mode .navbar.scrolled {
    background: rgba(18, 18, 18, 0.856);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo a:hover {
    color: var(--accent-color);
}

.nav-logo a {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    transform: translateY(7px);
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
}

.nav-logo-text {
    color: var(--primary-color);
    line-height: -1;
    display: flex;
    align-items: center;
}

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

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.3s ease;
    position: relative;
}

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

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

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

.dark-mode .nav-link {
    color: var(--text-light);
}

.dark-mode .nav-link:hover {
    color: #74c0fc;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    transition: all 0.3s ease;
    border-radius: 3px;
}


/* Hamburger → Cross animation */

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.dark-mode .nav-toggle span {
    background: var(--text-light);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.content {
    color: black;
    text-decoration: none;
}

.dark-mode .content {
    color: white;
}

a {
    text-decoration: none;
}

.a:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.15);
}


/* ======================
   Updated Hero Section
   ====================== */

.hero {
    min-height: 100vh;
    /* Changed from height: 100vh */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 100px 2rem 60px;
    /* Top padding (100px) clears the Navbar */
    background: linear-gradient(45deg, #96e9fd 0%, #ffffff 50%, #5e3877 100%);
    background-size: 400% 400%;
    animation: gradientBG 10s ease infinite;
}

.hero-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    z-index: 10;
}

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

.hero-right {
    flex: 1.2;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
}


/* ======================
   Profile Photo 
   ====================== */

.profile-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    overflow: visible;
}

.profile-frame {
    width: 100%;
    height: 100%;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    overflow: hidden;
    z-index: 2;
    border: 4px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    animation: professionalMorph 12s ease-in-out infinite alternate;
    overflow: hidden;
    animation: professionalMorph 12s ease-in-out infinite alternate;
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: professionalMorph 12s ease-in-out infinite alternate;
    overflow: hidden;
    mask-image: paint(blob);
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    box-shadow: none !important;
    border: 3px solid rgba(255, 255, 255, 0.4);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.1);
}

.profile-glow {
    position: absolute;
    width: 130%;
    height: 130%;
    background: radial-gradient(circle, rgba(97, 171, 192, 0.3) 0%, transparent 70%);
    filter: blur(30px);
    z-index: 1;
}


/* Name styling for right side */

.hero-right h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin: 0.5rem 0 1.5rem 0;
}


/* Background Glow Effect */

.profile-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, #61abc0, #c170f7);
    opacity: 0.3;
    z-index: -1;
}


/* The Animated Glow behind the photo */

.profile-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(193, 112, 247, 0.4) 0%, transparent 70%);
    filter: blur(40px);
    z-index: 1;
    animation: pulseGlow 4s ease-in-out infinite alternate;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.05);
    /* Avoid edges showing during morph */
    transition: transform 0.5s ease;
}

.profile-img:hover {
    transform: scale(1.15);
}


/* Updated Morph using border-radius but with more complex percentages */

@keyframes professionalMorph {
    0% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
}

@keyframes pulseGlow {
    from {
        transform: scale(0.8);
        opacity: 0.5;
    }
    to {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

#dynamic-text {
    color: #c170f7;
    /* Matching your gradient purple */
    font-weight: 600;
    border-right: 2px solid #c170f7;
    /* The cursor */
    padding-right: 5px;
    animation: blink 0.7s infinite;
}

.dark-mode #dynamic-text {
    color: #96e9fd;
    /* Cyan for dark mode */
    border-right-color: #96e9fd;
}

@keyframes blink {
    0%,
    100% {
        border-color: transparent;
    }
    50% {
        border-color: inherit;
    }
}


/* Ensure the tagline has a fixed height so the 
   page doesn't "jump" when words change */

.tagline {
    min-height: 1.5em;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    min-height: 1.6em;
    display: block;
    width: 100%;
    text-align: left;
}


/* Button Styling (21st.dev style) */

.hero-right h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin: 0.5rem 0;
    line-height: 1.1;
}

.hero .tagline {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 100%;
    /* Ensure it doesn't push width */
}

.hero-btns {
    display: flex;
    gap: 12px;
    justify-content: flex-start; /* Changed from center to flex-start */
    width: 100%;
    margin-top: 30px;
    padding-left: 0; /* Ensures no weird offset */
}

.grad-btn {
    position: relative;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px; /* Border thickness */
    border-radius: 8px; /* Slightly sharper for a professional look */
    /* Professional Palette: Slate to Silver */
    background: linear-gradient(90deg, #1e293b, #64748b, #1e293b);
    background-size: 200% auto;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    overflow: hidden;
}

.grad-btn span {
    display: block;
    background: #0f172a; /* Deep Slate Navy */
    color: #f8fafc;
    padding: 12px 24px;
    border-radius: 7px;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.3s ease;
}

/* The Shining Effect (Keeping it Classy) */
.grad-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -150%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(30deg);
    transition: all 0.6s ease;
}

.grad-btn:hover::before {
    left: 100%;
}

.grad-btn:hover {
    transform: translateY(-3px);
    background-position: right center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.grad-btn:hover span {
    background: transparent;
    color: #ffffff;
}

/* Light Mode Specific Styling */
body:not(.dark-mode) .grad-btn span {
    background: #b6ece7; /* Clean white inner */
    color: #1e293b;      /* Dark slate text */
}

body:not(.dark-mode) .grad-btn {
    /* Silver to Light Slate gradient border */
    background: linear-gradient(90deg, #e2e8f0, #94a3b8, #bdd4f3);
    background-size: 200% auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.445);
}

body:not(.dark-mode) .grad-btn:hover span {
    background: transparent;
    color: #000000;
}

body:not(.dark-mode) .grad-btn:hover {
    box-shadow: 0 10px 20px rgba(30, 41, 59, 0.15);
}

/* --- RESPONSIVE FIXES --- */

@media (max-width: 768px) {
    .hero-btns {
        gap: 8px;
        padding: 0 10px;
        justify-content: center;
    }

    .grad-btn span {
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    /* Logic to shorten the Resume Button Text */
    .resume-btn .btn-text::before {
        content: "⬇ "; /* Simple Arrow */
    }
    
    .resume-btn .btn-text {
        font-size: 0px; /* Hide original text */
    }

    .resume-btn .btn-text::after {
        content: "Resume"; /* New shorter text */
        font-size: 0.8rem; /* Show new text */
    }
}

/* Dark Mode Adjustment (Ensuring Pure Black/Classy look) */
.dark-mode .grad-btn span {
    background: #000000;
}


/* Bouncing Scroll Indicator */

.bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding: 2rem;
    padding-top: 70px;
    background: linear-gradient( 45deg, #96e9fd 0%, /* warm sunrise */
    #ffffff 50%, /* soft sky teal */
    #5e3877 100%/* gentle daylight yellow */
    );
    background-size: 220% 220%;
    animation: gradientBG 10s ease infinite;
    color: #000;
}

.hero::after {
    content: '';
    position: absolute;
    inset: -10%;
    pointer-events: none;
    background-image: radial-gradient(circle at 15% 20%, rgba(143, 182, 255, 0.35), transparent 55%), /* warm sun orb */
    radial-gradient(circle at 80% 15%, #2b4d4d4d, transparent 55%), /* sky teal */
    radial-gradient(circle at 60% 85%, rgba(248, 193, 255, 0.35), transparent 55%);
    /* soft glow */
    opacity: 0.65;
    animation: gradientBG 18s ease infinite;
}

.hero-particle {
    position: absolute;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    animation: float 14s infinite linear;
}

.hero-particle {
    animation: float 14s infinite linear, shimmer 6s ease-in-out infinite alternate;
}

@keyframes shimmer {
    from {
        opacity: 0.06;
    }
    to {
        opacity: 0.14;
    }
}

.hero h1 {
    font-display: swap;
    will-change: transform;
    animation: none !important;
    /* Disable animation first */
    opacity: 1 !important;
    animation-delay: 0.5s;
}


/* Re-enable animation after fonts load */

.fonts-loaded .hero h1 {
    animation: fadeInDown 1s ease !important;
}


/* To Create inline emoji/logo of img */

.emoji-size {
    height: 30px;
    width: 30px;
    vertical-align: middle;
    display: inline-block;
    border-radius: 50%;
}


/* Name Styling */

h1 {
    position: relative;
    /* Needed for absolute positioning of decor */
    display: inline-block;
    /* Ensures proper spacing */
}

.name-part {
    position: relative;
    display: inline-block;
    vertical-align: top;
}

.name-decor {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    height: 40px;
    width: auto;
    z-index: 100;
    /* force above title */
    pointer-events: none;
    /* ensure it doesn't block clicks */
}

@font-face {
    font-family: 'Poppins-fallback';
    size-adjust: 105%;
    ascent-override: 90%;
    src: local('Arial');
}

.hero h1 {
    font-family: 'Poppins', 'Poppins-fallback', sans-serif;
    opacity: 1 !important;
}

.hero .tagline {
    font-size: 2rem;
    margin-bottom: 3rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.3s both;
    font-weight: 400;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: inherit;
    /* Inherits from .hero */
}


/* Decorative Elements */

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.05) 0%, transparent 70%);
}

.hero::after {
    content: '';
    position: absolute;
    inset: -10%;
    background-image: radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.16), transparent 55%), radial-gradient(circle at 80% 10%, rgba(251, 113, 133, 0.18), transparent 55%), radial-gradient(circle at 65% 80%, rgba(94, 234, 212, 0.18), transparent 55%);
    mix-blend-mode: screen;
    opacity: 0.85;
    pointer-events: none;
    animation: sparkleShift 18s ease-in-out infinite alternate;
}


/* ======================
   Dark Mode Overrides
   ====================== */

.dark-mode .hero {
    color: #eaeaf0;
    background: linear-gradient( 135deg, #291528 0%, #010002 35%, #17181b 70%, #232024 100%);
    background-size: 200% 200%;
    animation: gradientBG 12s ease infinite;
}

.dark-mode .hero::after {
    background-image: radial-gradient(circle at 15% 20%, rgba(28, 20, 48, 0.35), transparent 55%), /* violet nebula */
    radial-gradient(circle at 80% 15%, rgba(0, 0, 0, 0.3), transparent 55%), /* cosmic blue */
    radial-gradient(circle at 60% 85%, rgba(23, 0, 26, 0.28), transparent 55%);
    /* aurora teal */
    opacity: 0.55;
    animation: gradientBG 20s ease infinite;
}

.dark-mode .hero-particle {
    background: rgba(255, 255, 255, 0.18);
    /* starlight */
}

.dark-mode .hero-particle {
    background: rgba(255, 255, 255, 0.14);
    /* faint starlight */
    animation: twinkle 6s ease-in-out infinite alternate;
}

@keyframes twinkle {
    from {
        opacity: 0.08;
    }
    to {
        opacity: 0.18;
    }
}


/* ======================
         Animations
   ====================== */

@keyframes sparkleShift {
    0% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(-2%, 1%, 0);
    }
    100% {
        transform: translate3d(2%, -1%, 0);
    }
}


/* Removed pulse keyframes */

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}


/* Animations */

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}


/* Removed duplicate pulse keyframes */

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    opacity: 0.7;
    color: black;
}

.dark-mode .scroll-indicator {
    color: whitesmoke;
}


/* ======================
   Greeting Styling
   ====================== */

.greeting {
    font-family: 'Poppins', sans-serif;
    font-style: italic;
    font-weight: 300;
    font-size: 1.8rem;
    color: rgba(0, 0, 0, 0.8);
    margin-bottom: 0.5rem;
    opacity: 0;
    transform: translateY(-20px);
    animation: fadeInDownGreeting 0.8s ease-out 0.2s forwards;
    text-align: center;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
}

.greeting::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.7;
}


/* Dark mode adjustment */

.dark-mode .greeting {
    color: rgba(255, 255, 255, 0.9);
}


/* Greeting animation - appears before name */

@keyframes fadeInDownGreeting {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ======================
   Content Sections
   ====================== */

.section {
    padding: var(--section-padding);
    min-height: 100vh;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.section.slide-in {
    opacity: 1;
    transform: translateY(0);
}


/* Staggered animations */

.section:nth-child(2) {
    transition-delay: 0.1s;
}

.section:nth-child(3) {
    transition-delay: 0.2s;
}

.section:nth-child(4) {
    transition-delay: 0.3s;
}

.section:nth-child(even) {
    background-color: var(--light-color);
}

.section h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--dark-color);
}

/* ====================
About Section Layout 
=======================*/
.about-section {
    padding: 60px 0;
}

.about-main-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    font-weight: 800;
}

.about-grid {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.about-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 25px;
    min-width: 320px; /* Ensures responsiveness on smaller screens */
}

/* Card Base Styling */
.about-card {
    flex: 1;
    padding: 35px;
    border-radius: 20px;
    border: 1px solid rgba(128, 128, 128, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.about-icon-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 18px;
}

.about-icon-header i {
    font-size: 1.6rem;
}

.about-card h3 {
    margin: 0;
    font-size: 1.3rem;
}

.about-card p {
    line-height: 1.6;
    margin: 0;
    opacity: 0.9;
}

/* Identity Header Styling */
.about-identity {
    text-align: center;
    margin-bottom: 50px;
}

.identity-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.identity-title {
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.8;
    background: linear-gradient(90deg, #3b82f6, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- DARK MODE SPECIFIC STYLING --- */
.dark-mode .about-card {
    background: #0a0a0a; /* Pure Black shade */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* Professional Glow (Blue) */
.dark-mode .prof-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
    transform: translateY(-5px);
}

.dark-mode .prof-card i { color: #3b82f6; }

/* Creative Glow (Purple) */
.dark-mode .creative-card:hover {
    border-color: #a855f7;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.2);
    transform: translateY(-5px);
}

.dark-mode .creative-card i { color: #a855f7; }

/* --- LIGHT MODE SPECIFIC STYLING --- */
body:not(.dark-mode) .about-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

body:not(.dark-mode) .prof-card i { color: #2563eb; }
body:not(.dark-mode) .creative-card i { color: #7c3aed; }

body:not(.dark-mode) .about-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(6, 4, 8, 0.534);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .about-main-title { font-size: 2rem; }
    .identity-name { font-size: 1.5rem; }
    .about-card { padding: 25px; }
}


/* =========================================
   Featured Projects Section
========================================= */

/* Section Title */

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

#projects h2 {
    font-size: 2.8rem;
    color: #1c7ed6;
    margin-bottom: 2.5rem;
    position: relative;
    display: inline-block;
}

#projects h2::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: #4dabf7;
    border-radius: 2px;
}

/* =========================================
   Featured Projects Section
========================================= */

#projects {
    position: relative;
    padding: 7rem 0;
    background: linear-gradient(
        135deg,
        #050505 0%,
        #090611 35%,
        #12071d 70%,
        #050505 100%
    );
    overflow: hidden;
}


/* Background Glow Effects */

#projects::before {
    content: "";
    position: absolute;
    top: -120px;
    left: -120px;
    width: 320px;
    height: 320px;

    background: rgba(162, 89, 255, 0.18);

    border-radius: 50%;
    filter: blur(90px);

    z-index: 0;
}

#projects::after {
    content: "";
    position: absolute;
    bottom: -160px;
    right: -120px;
    width: 360px;
    height: 360px;

    background: rgba(111, 66, 193, 0.18);

    border-radius: 50%;
    filter: blur(100px);

    z-index: 0;
}


/* Container */

#projects .container {
    position: relative;
    z-index: 2;
}


/* =========================================
   Section Heading
========================================= */

#projects h2 {
    font-size: 3rem;
    font-weight: 700;

    color: #d7b8ff;

    margin-bottom: 3.5rem;

    position: relative;
    display: inline-block;

    letter-spacing: 0.5px;
}

#projects h2::after {
    content: "";

    position: absolute;
    left: 0;
    bottom: -12px;

    width: 70px;
    height: 4px;

    border-radius: 50px;

    background: linear-gradient(
        90deg,
        #b266ff,
        #7b2cff
    );

    box-shadow: 0 0 12px rgba(178, 102, 255, 0.7);
}


/* =========================================
   Projects Grid Layout
========================================= */

#projects .projects-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 2.5rem;

    align-items: stretch;
}


/* =========================================
   Project Cards
========================================= */

#projects .project-card {
    position: relative;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    min-height: 320px;

    padding: 2rem;

    border-radius: 18px;

    background: linear-gradient(
        145deg,
        rgba(15, 15, 18, 0.96),
        rgba(8, 8, 10, 0.96)
    );

    border: 1px solid rgba(178, 102, 255, 0.18);

    box-shadow:
        0 0 0 rgba(0, 0, 0, 0),
        0 0 25px rgba(123, 44, 255, 0.08);

    text-decoration: none;
    color: inherit;

    overflow: hidden;

    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease,
        border-color 0.35s ease;
}


/* Neon Top Glow */

#projects .project-card::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 3px;

    background: linear-gradient(
        90deg,
        #7b2cff,
        #c77dff,
        #7b2cff
    );

    opacity: 0.95;
}


/* Hover Effect */

#projects .project-card:hover {
    transform: translateY(-10px);

    border-color: rgba(199, 125, 255, 0.45);

    box-shadow:
        0 0 25px rgba(123, 44, 255, 0.18),
        0 0 55px rgba(123, 44, 255, 0.14);
}


/* =========================================
   Typography
========================================= */

#projects .project-card h3 {
    font-size: 1.9rem;
    font-weight: 700;

    line-height: 1.4;

    margin-bottom: 1.5rem;

    color: #ffffff;
}

#projects .project-card p {
    font-size: 1.08rem;
    line-height: 1.9;

    color: #d5d5d5;

    margin-bottom: 2rem;
}


/* Tech Stack */

#projects .tech-stack {
    margin-top: auto;

    font-size: 0.98rem;
    font-weight: 500;

    color: #c77dff;

    letter-spacing: 0.4px;

    margin-bottom: 1.8rem;
}


/* Visit Text */

#projects .project-card h5 {
    font-size: 1rem;
    font-weight: 600;

    color: #f4f4f4;

    opacity: 0.88;

    transition: all 0.3s ease;
}

#projects .project-card:hover h5 {
    color: #d7b8ff;

    letter-spacing: 0.3px;
}


/* =========================================
   Remove Link Styling
========================================= */

.project-card:hover,
.project-card:visited,
.project-card:active {
    text-decoration: none;
    color: inherit;
}


/* =========================================
   Dark Mode
========================================= */

.dark-mode #projects {
    background: linear-gradient(
        135deg,
        #020202 0%,
        #080410 40%,
        #14041f 75%,
        #020202 100%
    );
}

/* =========================
   Skills Section
   ========================= */

#skills {
    padding: 5rem 0;
    position: relative;
}

#skills h2 {
    text-align: center;
    font-size: clamp(2rem, 4vw, 2.6rem);
    margin-bottom: 0.5rem;
}

#skills .section-subtitle {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 3.5rem;
    opacity: 0.85;
}


/* =========================
   Skills Grid Layout
   ========================= */

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


/* =========================
   Skill Cards
   ========================= */

.skill-category {
    position: relative;
    padding: 2rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.skill-category h3 {
    margin-bottom: 1.2rem;
    font-size: 1.25rem;
    text-align: center;
}


/* Card hover pop */

.skill-category:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}


/* =========================
   Skill Pills
   ========================= */

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    justify-content: center;
}

.skill-pill {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.7);
    color: #111;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}


/* Pill hover magic */

.skill-pill:hover {
    transform: translateY(-4px) scale(1.05);
    background: linear-gradient(135deg, #7c7cff, #4fd1c5);
    color: #fff;
    box-shadow: 0 12px 28px rgba(79, 209, 197, 0.45);
}


/* =========================
   Dark Mode Overrides
   ========================= */

.dark-mode #skills {
    background: transparent;
}

.dark-mode .skill-category {
    background: rgba(18, 18, 28, 0.6);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.dark-mode .skill-category:hover {
    box-shadow: 0 30px 65px rgba(0, 0, 0, 0.85), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.dark-mode .skill-pill {
    background: rgba(255, 255, 255, 0.08);
    color: #eaeaf0;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
}

.dark-mode .skill-pill:hover {
    background: linear-gradient(135deg, #8b5cf6, #22d3ee);
    color: #fff;
    box-shadow: 0 12px 30px rgba(139, 92, 246, 0.55);
}


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

#contact {
    background: linear-gradient(135deg, #f2f8ff 0%, #bad4ec 100%);
    position: relative;
    overflow: hidden;
}


/* Contact Wrapper - 50/50 split layout */

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
    align-items: start;
    position: relative;
}

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

.contact-info-section h3,
.contact-form-section h3 {
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.dark-mode .contact-info-section h3,
.dark-mode .contact-form-section h3 {
    color: var(--text-light);
    border-bottom-color: var(--accent-color);
}


/* Divider line between sections */

.contact-wrapper::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, #dee2e6, transparent);
    transform: translateX(-50%);
}

.dark-mode .contact-wrapper::before {
    background: linear-gradient(to bottom, transparent, #495057, transparent);
}

#contact::before {
    content: "";
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: var(--primary-color);
    opacity: 0.1;
    border-radius: 50%;
    filter: blur(40px);
}

#contact::after {
    content: "";
    position: absolute;
    bottom: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: var(--accent-color);
    opacity: 0.1;
    border-radius: 50%;
    filter: blur(60px);
}

#contact .container {
    position: relative;
    z-index: 2;
    max-width: 100%;
    padding-left: 20px;
    padding-right: 20px;
}

#contact h2 {
    font-size: 2.8rem;
    color: var(--dark-color);
    margin-bottom: 3rem;
    /* text-align: center; */
    position: relative;
}

#contact h2::after {
    content: "";
    position: absolute;
    bottom: -15px;
    left: 0;
    transform: none;
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}


/* Contact Form Styling */

.contact-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-sizing: border-box;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    margin: 0;
}

.contact-form:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-control {
    width: calc(100% - 2px);
    max-width: 100%;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    outline: none;
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
    width: calc(100% - 2px);
}

.submit-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    width: 100%;
    position: relative;
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.submit-btn:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(41, 128, 185, 0.3);
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    align-items: flex-start;
    padding: 0;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.contact-item span {
    white-space: nowrap;
}

.contact-item:hover {
    background: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.contact-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
}


/* Dark Mode Adjustments */

.dark-mode #contact {
    background: linear-gradient(135deg, #0a0a0a 0%, #0e0b0b 50%, #313131 100%);
    color: #f8f9fa;
    /* Sets default text color to white */
}

.dark-mode #contact h2 {
    color: #ffffff;
}

.dark-mode #contact h2::after {
    background: var(--accent-color);
}

.dark-mode .contact-form {
    background: #121313;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: #f8f9fa;
}

.dark-mode .contact-form:hover {
    box-shadow: 0 15px 40px rgba(252, 96, 96, 0.3);
}

.dark-mode .form-group label {
    color: #e9ecef;
}

.dark-mode .form-control {
    background: #141111;
    border-color: #b43c26;
    color: #f8f9fa;
}

.dark-mode .form-control::placeholder {
    color: #adb5bd;
}

.dark-mode .contact-item {
    background: rgba(49, 47, 47, 0.7);
    color: #f8f9fa;
}

.dark-mode .contact-item:hover {
    background: #791403;
}

.dark-mode .contact-icon {
    color: var(--accent-color);
}


/* Success Modal Styles */

.modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: white;
    padding: 3rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #333;
}

.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    font-weight: bold;
    animation: scaleIn 0.3s ease 0.2s both;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.modal-content h3 {
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.modal-content p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.modal-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(41, 128, 185, 0.3);
}

.dark-mode .modal-content {
    background-color: #2b3035;
}

.dark-mode .modal-content h3 {
    color: var(--text-light);
}

.dark-mode .modal-content p {
    color: #e9ecef;
}

.dark-mode .modal-close {
    color: #ccc;
}

.dark-mode .modal-close:hover {
    color: #fff;
}

.dark-mode .submit-btn {
    background: var(--accent-color);
}

.dark-mode .submit-btn:hover {
    background: #e63946;
    /* Slightly brighter red for hover */
}


/* Success Modal Styles */

.modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: white;
    padding: 3rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #333;
}

.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    font-weight: bold;
    animation: scaleIn 0.3s ease 0.2s both;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.modal-content h3 {
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.modal-content p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.modal-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(41, 128, 185, 0.3);
}

.dark-mode .modal-content {
    background-color: #2b3035;
}

.dark-mode .modal-content h3 {
    color: var(--text-light);
}

.dark-mode .modal-content p {
    color: #e9ecef;
}

.dark-mode .modal-close {
    color: #ccc;
}

.dark-mode .modal-close:hover {
    color: #fff;
}


/* Message send Pop up */

#formMessage {
    display: none;
    margin-top: 15px;
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    transition: opacity 0.3s ease-in-out;
}

#formMessage.show {
    display: block;
    opacity: 1;
}

#formMessage.success {
    background-color: #d4edda;
    color: #155724;
    border-left: 5px solid #28a745;
}

#formMessage.error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 5px solid #dc3545;
}


/* ======================
   Professional Footer
   ====================== */

footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: var(--text-light);
    padding: 3rem 0 2rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.footer-signature {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ftimg {
    display: inline-block;
    height: 50px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.ftimg:hover {
    transform: scale(1.05);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

.footer-text {
    margin: 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-links a:hover::after {
    width: 100%;
}

.dark-mode footer {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2a 100%);
}


/* ======================
   Dark Mode
   ====================== */

.dark-mode {
    --dark-color: #121212;
    --light-color: #1e1e1e;
    --text-color: #f0f0f0;
    background-color: #121212;
}

.dark-mode .section:nth-child(even) {
    background-color: #2a2a2a;
}

.dark-mode .section h2 {
    color: var(--text-light);
}


/* Sun moon toggle symbol (upgraded to professional switch) */

.mode-toggle {
    position: fixed;
    right: 30px;
    top: 85px;
    /* Below navbar */
    margin-right: 3px;
    z-index: 999;
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mode-toggle:active {
    transform: scale(0.96);
}

.mode-toggle-track {
    width: 54px;
    height: 30px;
    border-radius: 999px;
    background: radial-gradient(circle at 0% 0%, #ffffff, #e2e8f0);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08), 0 10px 25px rgba(15, 23, 42, 0.18);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
    position: relative;
    overflow: hidden;
    transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.12s ease;
}

.mode-toggle-thumb {
    position: absolute;
    inset: 3px;
    width: 24px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 0%, #ffffff, #cbd5f5);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
    transform: translateX(0);
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.theme-toggle-icon {
    font-size: 0.9rem;
    opacity: 0.7;
    z-index: 2;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.theme-toggle-icon-sun {
    opacity: 1;
    transform: translateX(2px);
}

.theme-toggle-icon-moon {
    opacity: 0.35;
    transform: translateX(-2px) scale(0.9);
}

.dark-mode .mode-toggle-track {
    background: radial-gradient(circle at 100% 0%, #020617, #0f172a);
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.22), 0 12px 32px rgba(15, 23, 42, 0.7);
}

.dark-mode .mode-toggle-thumb {
    transform: translateX(20px);
    background: radial-gradient(circle at 30% 0%, #020617, #1e293b);
    box-shadow: 0 8px 26px rgba(148, 163, 184, 0.5);
}

.dark-mode .theme-toggle-icon-sun {
    opacity: 0.25;
    transform: translateX(-2px) scale(0.85);
}

.dark-mode .theme-toggle-icon-moon {
    opacity: 1;
    transform: translateX(2px) scale(1.05);
}


/* ======================
   Enhanced Animations
   ====================== */

.animate {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    filter: blur(2px);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.animated {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(var(--rotate-x, 0)) rotateY(var(--rotate-y, 0));
    filter: blur(0);
    /* Removed float animation to prevent shaking/pulsing effect */
}

.focus-animation {
    /* Removed all animations to prevent shaking/pulsing effect */
    /* Empty ruleset kept for potential future use */
    opacity: 1;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-50px) rotateX(30deg);
        filter: blur(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
        filter: blur(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px) perspective(500px) rotateX(-20deg);
        filter: blur(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0) perspective(500px) rotateX(0);
        filter: blur(0);
    }
}


/* Removed bounce keyframes */


/* New 3D Flip Animation */

.section:nth-child(odd) .animated {
    --rotate-x: 1deg;
    --rotate-y: -1deg;
}

.section:nth-child(even) .animated {
    --rotate-x: -1deg;
    --rotate-y: 1deg;
}


/* Dynamic Animations */

@keyframes float {
    0%,
    100% {
        transform: translateY(0) scale(1) rotateX(var(--rotate-x, 0)) rotateY(var(--rotate-y, 0));
    }
    50% {
        transform: translateY(-10px) scale(1.02) rotateX(calc(var(--rotate-x, 0) * 1.5)) rotateY(calc(var(--rotate-y, 0) * 1.5));
    }
}


/* Removed pulse keyframes */


/* Parallax Background Elements */

.bg-element {
    transition: transform 0.5s ease-out;
}


/* Interactive Elements */

.interactive-element {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes flipIn {
    from {
        opacity: 0;
        transform: perspective(1000px) rotateY(90deg) scale(0.8);
    }
    to {
        opacity: 1;
        transform: perspective(1000px) rotateY(0) scale(1);
    }
}


/* New Glow Effect */

@keyframes textGlow {
    0% {
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    }
    50% {
        text-shadow: 0 0 20px rgba(52, 152, 219, 0.7);
    }
    100% {
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    }
}


/* Apply to specific elements */

.hero h1 {
    animation: fadeInDown 1s ease-out, textGlow 3s ease-in-out infinite;
}

.project-card {
    transition: all 0.5s ease, transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.15);
}

.special-element {
    animation: flipIn 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}


/* ======================
   Project Cards
   ====================== */

.project-card {
    position: relative;
    overflow: hidden;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    margin-bottom: 2rem;
}

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

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient( 500px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.18), transparent 40%);
    z-index: 3;
    opacity: 0;
    transition: opacity 0.03s linear;
    /* 🔥 much faster */
    pointer-events: none;
}

.project-card:hover::before {
    opacity: 1;
}


/* ======================
   Buttons
   ====================== */

.btn {
    display: inline-block;
    background: var(--primary-color);
    color: var(--text-light);
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
}


/* ======================
   Project Page Styles
   ====================== */

.project-hero {
    height: 70vh;
    background: linear-gradient(135deg, #f0f7ff 0%, #d0e3ff 100%);
    text-align: center;
}

.dark-mode .project-hero {
    background: linear-gradient(135deg, #0d1b2a 0%, #1b263b 100%);
}

.project-hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.project-hero .tagline {
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.project-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    font-size: 1.1rem;
    color: var(--text-color);
    opacity: 0.9;
}

.dark-mode .project-meta {
    color: var(--text-light);
}

.project-date,
.project-tags {
    display: flex;
    align-items: center;
}

.project-date::before {
    content: "📅";
    margin-right: 8px;
}

.project-tags::before {
    content: "🏷️";
    margin-right: 8px;
}

.github-btn {
    background: #24292e;
    color: white;
    padding: 0.8rem 2.5rem;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
}

.github-btn:hover {
    background: #2d3338;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(36, 41, 46, 0.3);
}

.dark-mode .github-btn {
    background: #2d3338;
}

.project-details {
    padding-top: 4rem;
}

.project-content {
    max-width: 900px;
    margin: 0 auto;
}

.project-content h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.project-content h3 {
    font-size: 1.8rem;
    margin: 3rem 0 1.5rem;
    color: var(--dark-color);
}

.dark-mode .project-content h3 {
    color: var(--text-light);
}

.project-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.project-features ul {
    list-style-type: none;
    padding-left: 0;
}

.project-features li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.project-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.tech-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.tech-item {
    background: rgba(52, 152, 219, 0.1);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.dark-mode .tech-item {
    background: rgba(52, 152, 219, 0.05);
}

.tech-item h4 {
    margin-top: 0;
    color: var(--primary-color);
}

.tech-item p {
    margin-bottom: 0;
    color: var(--text-color);
}

.dark-mode .tech-item p {
    color: #e9ecef;
}

.challenge {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(231, 76, 60, 0.05);
    border-left: 4px solid var(--accent-color);
    border-radius: 8px;
}

.dark-mode .challenge {
    background: rgba(231, 76, 60, 0.03);
}

.challenge h4 {
    color: var(--accent-color);
    margin-top: 0;
}

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

.gallery-item img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.gallery-item img:hover {
    transform: scale(1.02);
}

.gallery-item p {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

.dark-mode .gallery-item p {
    color: #aaa;
}

.project-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 4rem;
    justify-content: center;
    flex-wrap: wrap;
}

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

.secondary-btn:hover {
    background: rgba(52, 152, 219, 0.1);
}

.dark-mode .secondary-btn {
    color: #74c0fc;
    border-color: #74c0fc;
}

.dark-mode .secondary-btn:hover {
    background: rgba(116, 192, 252, 0.1);
}


/* ======================
   Resume Section Styling
   ====================== */

#cv {
    background: linear-gradient(135deg, #eef5ff 0%, #e0ebff 100%);
    position: relative;
    overflow: hidden;
}

#cv::before {
    content: "";
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: #5a7dff;
    opacity: 0.1;
    border-radius: 50%;
    filter: blur(40px);
}

#cv::after {
    content: "";
    position: absolute;
    bottom: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: #3d5afe;
    opacity: 0.1;
    border-radius: 50%;
    filter: blur(60px);
}

#cv .container {
    position: relative;
    z-index: 2;
    text-align: center;
}

#cv h2 {
    font-size: 2.8rem;
    color: #1a56db;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

#cv h2::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: #5a7dff;
    border-radius: 2px;
}

#cv p {
    font-size: 1.2rem;
    color: #4b5563;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cv-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.cv-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.view-cv {
    background: #1a56db;
    color: white;
}

.view-cv:hover {
    background: #1e4bb8;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(26, 86, 219, 0.3);
}

.download-cv {
    background: transparent;
    color: #1a56db;
    border: 2px solid #1a56db;
}

.download-cv:hover {
    background: rgba(26, 86, 219, 0.1);
    transform: translateY(-3px);
}


/* Dark Mode Adjustments */

.dark-mode #cv {
    background: linear-gradient(135deg, #191b1f 0%, #000000 100%);
}

.dark-mode #cv h2 {
    color: #93c5fd;
}

.dark-mode #cv h2::after {
    background: #5a7dff;
}

.dark-mode #cv p {
    color: #e5e7eb;
}


/* CV preview dark mode styles removed */

.dark-mode .download-cv {
    color: #93c5fd;
    border-color: #93c5fd;
}

.dark-mode .download-cv:hover {
    background: rgba(147, 197, 253, 0.1);
}


/* ======================
   Mobile Responsiveness
   ====================== */

@media (max-width: 1200px) {
    /* Base font size adjustment for better zoom control */
    html {
        font-size: 15px;
    }
    .container {
        width: 95%;
        padding: 0 15px;
    }
    .hero-layout {
        flex-direction: column;
        /* Stacks photo on top of text */
        text-align: center;
        gap: 2rem;
    }
    .hero-right {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .profile-wrapper {
        width: 240px;
        height: 240px;
    }
    .hero-btns {
        justify-content: center;
        width: 100%;
    }
    .about-item {
        gap: 2rem;
    }
    .about-text {
        padding: 1.5rem;
    }
    .about-img {
        height: 300px;
    }
}

@media (max-width: 992px) {
    html {
        font-size: 14px;
    }
    .section {
        padding: 5rem 0;
        min-height: auto;
    }
    .hero-layout {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    .hero-left,
    .hero-right {
        justify-content: center;
        align-items: center;
    }
    .hero-right h1 {
        font-size: 2.5rem;
    }
    .hero h1 {
        font-size: 3.2rem;
    }
    .hero .tagline {
        font-size: 1.6rem;
        margin-bottom: 2.5rem;
        justify-content: center;
    }
    .section h2 {
        font-size: 2.3rem;
    }
}

@media (max-width: 768px) {
    /* Base adjustments for mobile */
    html {
        font-size: 14px;
        zoom: 1;
        -moz-transform: scale(1);
        -moz-transform-origin: 0 0;
    }
    body {
        overflow-x: hidden;
        width: 100%;
    }
    .container {
        width: 100%;
        padding: 0 20px;
        box-sizing: border-box;
    }
    .nav-toggle {
        height: 26px;
        width: 26px;
        display: flex;
        cursor: pointer;
        z-index: 1001;
    }
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(120, 252, 245, 0.616);
        backdrop-filter: blur(10px) saturate(140%);
        -webkit-backdrop-filter: blur(18px) saturate(140%);
        border-top: 1px solid rgba(255, 255, 255, 0.651);
        width: 100%;
        text-align: center;
        transition: transform 0.35s ease, opacity 0.35s ease;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.452);
        padding: 2rem 0;
        gap: 0;
        z-index: 999;
        transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s linear;
    }
    .nav-menu.active {
        left: 0;
    }
    .nav-menu li {
        padding: 1rem 0;
    }
    .dark-mode .nav-menu {
        background: rgba(4, 4, 17, 0.55);
        backdrop-filter: blur(20px) saturate(160%);
        -webkit-backdrop-filter: blur(20px) saturate(160%);
        box-shadow: 0 10px 27px rgba(7, 7, 7, 0.377);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
    .mode-toggle {
        top: 80px;
        right: 20px;
        margin-right: 25px;
    }
    .tagline {
        text-align: center;
        font-size: 1.1rem;
        min-height: 2.5em;
    }
    /* Hero Section Mobile Fix */
    .hero-layout {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    .hero-btns {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: center;
        gap: 5px;
        width: 100%;
        padding: 0 5px;
    }
    .grad-btn {
        flex: 1;
        min-width: 0;
    }
    .grad-btn span {
        padding: 8px 2px;
        font-size: 0.65rem;
        text-align: center;
        display: block;
        overflow: hidden;
        white-space: nowrap;
        letter-spacing: -0.2px;
    }
    .profile-frame {
        width: 200px;
        height: 200px;
    }
    .hero {
        position: relative;
        overflow: hidden;
        background: linear-gradient(45deg, #61abc0 0%, #b1daeb 25%, #ffffff 50%, #c170f7 100%);
        background-size: 400% 400%;
        z-index: 1;
        animation: gradientBG 8s ease infinite;
        transform: translateZ(0);
        padding-top: 120px;
        /* More space for fixed nav on mobile */
        height: auto;
        min-height: 100vh;
    }
    .hero::before {
        content: "";
        position: absolute;
        inset: -20%;
        pointer-events: none;
        background: linear-gradient(45deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.35));
        background-size: 200% 200%;
        animation: gradientBG 18s linear infinite;
        will-change: transform, background-position;
        transform: translateZ(0);
        opacity: 0.55;
        z-index: -1;
    }
    .hero-layout {
        flex-direction: column;
        /* Stacks photo on top of text */
        text-align: center;
        gap: 2rem;
    }
    .hero-right {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .profile-wrapper {
        width: 240px;
        height: 240px;
    }
    .hero-btns {
        justify-content: center;
        width: 100%;
    }
    .hero h1 {
        font-size: 2.5rem;
        line-height: 1.2;
        margin-bottom: 1rem;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .name-part {
        display: block;
        margin: 0.5rem 0;
        padding-top: 0;
    }
    .name-decor {
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        margin: 0 auto 10px;
        display: block;
        height: 35px;
    }
    .hero .tagline {
        font-size: 1.2rem;
        line-height: 1.5;
        margin-bottom: 2rem;
        padding: 0 10px;
        justify-content: center;
    }
    .greeting {
        font-size: 1.4rem;
        margin-bottom: 0.3rem;
    }
    .greeting::after {
        width: 70%;
        bottom: -5px;
    }
    /* Section adjustments */
    .section {
        padding: 4rem 0;
        min-height: auto;
    }
    .section h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
        text-align: center;
    }
    /* About Section Mobile Fix */
    .about-item {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    .about-item.reverse {
        direction: ltr;
    }
    .about-text {
        padding: 1rem;
    }
    .about-text h3,
    .about-text p {
        padding-left: 0;
    }
    .about-text h3::before,
    .about-text p::before {
        display: none;
    }
    .about-img {
        height: 250px;
    }
    .about-image {
        order: -1;
    }
    .about-item.reverse .about-image {
        order: -1;
    }

    /* =========================================
    Mobile View - Projects Section
    ========================================= */
    #projects {
        padding: 5rem 0;
    }

    #projects h2 {
        font-size: 2.2rem;
        margin-bottom: 2.5rem;
    }

    #projects .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    #projects .project-card {
        min-height: auto;
        padding: 1.5rem;
        border-radius: 16px;
    }

    #projects .project-card h3 {
        font-size: 1.5rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }

    #projects .project-card p {
        font-size: 1rem;
        line-height: 1.8;
        margin-bottom: 1.5rem;
    }

    #projects .tech-stack {
        font-size: 0.92rem;
        margin-bottom: 1.2rem;
    }

    #projects .project-card h5 {
        font-size: 0.95rem;
    }

    /* Contact Section Mobile Fix */
    #contact {
        padding: 3rem 0;
    }
    #contact h2 {
        font-size: 2rem;
        text-align: center;
        margin-bottom: 2rem;
    }
    #contact h2::after {
        left: 50%;
        transform: translateX(-50%);
    }
    /* Mobile: Stack contact sections vertically */
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .contact-wrapper::before {
        display: none;
        /* Hide divider on mobile */
    }
    .contact-info-section,
    .contact-form-section {
        padding: 1.5rem;
    }
    .contact-info-section h3,
    .contact-form-section h3 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    .contact-form {
        padding: 1.5rem;
        margin: 0;
    }
    .contact-info {
        padding: 0;
        gap: 0.8rem;
    }
    .contact-item {
        width: 100%;
        padding: 0.8rem 1rem;
        box-sizing: border-box;
    }
    .contact-item span {
        white-space: normal;
        word-break: break-word;
        font-size: 0.9rem;
    }
    /* Form adjustments */
    .form-group label {
        font-size: 0.9rem;
    }
    .form-control {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    textarea.form-control {
        min-height: 120px;
    }
    .submit-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
    }
    /* Footer Mobile Fix */
    footer {
        padding: 2rem 0 1.5rem;
    }
    .footer-container {
        gap: 1.5rem;
    }
    .ftimg {
        height: 40px;
        width: auto;
    }
    .footer-links {
        gap: 1rem;
        font-size: 0.85rem;
    }
    .footer-text {
        font-size: 0.85rem;
    }
    /* Modal Mobile Styles */
    .modal-content {
        padding: 2rem 1.5rem;
        width: 95%;
    }
    .modal-icon {
        width: 60px;
        height: 60px;
        font-size: 2.5rem;
    }
    .modal-content h3 {
        font-size: 1.5rem;
    }
    .modal-content p {
        font-size: 1rem;
    }
    /* Mode Toggle Mobile */
    .mode-toggle {
        top: 80px;
        /* Below navbar on mobile */
        right: 15px;
        width: 43px;
        height: 43px;
        font-size: 1rem;
    }
    /* Animation adjustments for mobile */
    .hero h1 {
        animation: fadeInDown 0.8s ease-out;
    }
    .hero .tagline {
        animation: fadeInUp 0.8s ease 0.3s both;
    }
    /* Reduce animation intensity on mobile */
    .animated {
        animation: none !important;
    }
    .project-card:hover {
        transform: translateY(-3px);
    }
    /* Mobile Responsiveness Resume Section */
    #cv {
        padding: 3rem 0;
    }
    #cv h2 {
        font-size: 2rem;
    }
    #cv p {
        font-size: 1rem;
        padding: 0 10px;
    }
    .cv-actions {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    .cv-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
        padding: 0.8rem 1.5rem;
    }
    .cv-preview {
        padding: 1.5rem;
    }
    .cv-preview-placeholder {
        padding: 1.5rem;
    }
    .preview-icon {
        font-size: 2.5rem;
    }
}

@media (max-width: 576px) {
    /* Extra small devices */
    html {
        font-size: 13px;
    }
    .hero h1 {
        font-size: 2.2rem;
    }
    .hero .tagline {
        font-size: 1.1rem;
        padding: 0 5px;
    }
    .mode-toggle {
        top: 75px;
        right: 12px;
        transform: scale(0.95);
    }
    .section h2 {
        font-size: 1.8rem;
    }
    .greeting {
        font-size: 1.2rem;
    }
    .about-content {
        gap: 3rem;
    }
    .about-text h3 {
        font-size: 1.2rem;
    }
    .about-text p {
        font-size: 1rem;
    }
    .about-img {
        height: 200px;
    }
    #about h3,
    #about p,
    .project-card p {
        font-size: 0.95rem;
    }
    .contact-item {
        padding: 0.7rem;
    }
    .contact-item span {
        font-size: 0.85rem;
    }
    .scroll-indicator {
        font-size: 0.9rem;
        bottom: 25px;
    }
    /* Project cards stacking */
    .project-card {
        margin-bottom: 1.2rem;
    }
}

@media (max-width: 400px) {
    /* Very small devices */
    .hero h1 {
        font-size: 1.9rem;
    }
    .hero .tagline {
        font-size: 1rem;
    }
    .section h2 {
        font-size: 1.6rem;
    }
    .container {
        padding: 0 15px;
    }
    .mode-toggle {
        top: 70px;
        right: 10px;
        transform: scale(0.9);
    }
}


/* ======================
   Desktop Zoom Control
   ====================== */

@media (min-width: 769px) {
    /* Desktop-specific styles with controlled zoom */
    html {
        zoom: 1;
        -moz-transform: scale(1);
        -moz-transform-origin: 0 0;
    }
    body {
        transform-origin: 0 0;
    }
    /* Ensure content doesn't overflow on large screens */
    .container {
        max-width: 1200px;
        margin: 0 auto;
    }
    /* Hero Section Desktop */
    .hero h1 {
        font-size: 4rem;
    }
    .hero .tagline {
        font-size: 2rem;
    }
    /* Section headings */
    .section h2 {
        font-size: 3rem;
    }
    /* Prevent horizontal scrolling */
    .section,
    .hero,
    footer {
        overflow-x: hidden;
    }
    /* Project grid for desktop */
    .project-card {
        transition: all 0.3s ease;
    }
    /* Smooth animations for desktop */
    .animated {
        /* Removed float animation to prevent shaking/pulsing effect */
    }
}


/* Large desktop screens (1200px+) */

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}


/* Extra large screens (1400px+) */

@media (min-width: 1400px) {
    html {
        font-size: 17px;
    }
    .container {
        max-width: 1320px;
    }
}

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

@media (max-width: 640px) {
    .skills-grid {
        grid-template-columns: 1fr;
    }
    .skill-category {
        padding: 1.8rem 1.4rem;
    }
}


/* ======================
   Animation Optimizations for Performance
   ====================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* ======================
   Touch Device Optimizations
   ====================== */

@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects on touch devices */
    .project-card:hover {
        transform: none;
        box-shadow: 0 5px 15px rgba(33, 150, 243, 0.1);
    }
    .contact-item:hover {
        transform: none;
        background: rgba(255, 255, 255, 0.7);
    }
    .submit-btn:hover {
        transform: none;
        background: var(--primary-color);
    }
    .dark-mode .contact-item:hover {
        background: rgba(33, 37, 41, 0.7);
    }
    .dark-mode .submit-btn:hover {
        background: var(--accent-color);
    }
}


/* ======================
   High DPI Screen Support
   ====================== */

@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .hero {
        background-size: 100% 100%;
    }
    /* Sharper images for retina displays */
    .emoji-size,
    .ftimg,
    .contact-icon img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}


/* ======================
   Print Styles
   ====================== */

@media print {
    .hero {
        height: auto;
        background: white !important;
        color: black !important;
    }
    .mode-toggle,
    .scroll-indicator {
        display: none;
    }
    .section {
        page-break-inside: avoid;
        min-height: auto;
    }
    a {
        color: black;
        text-decoration: underline;
    }
    .project-card {
        border: 1px solid #ccc;
        box-shadow: none;
    }
}