@media (max-width: 767px) {
    /* Hide abstract scrollbar on mobile - it overlaps content */
    .abstract-scrollbar {
        display: none !important;
    }

    /* Navbar mobile adjustments */
    #navbar {
        padding: 0.5rem 0;
        height: 64px !important;
    }

    #navbar .max-w-\[90%\] {
        max-width: 100% !important;
        padding: 0 1rem;
    }

    /* Section scroll offsets for sticky navbar on mobile */
    #about,
    #experience,
    #skills {
        scroll-margin-top: 64px !important;
    }

    /* Mobile menu overlay styling */
    .mobile-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 1rem;
        gap: 0;
        z-index: 60;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    [data-theme="dark"] .mobile-menu {
        background: rgba(20, 20, 20, 0.97);
    }

    .mobile-menu a {
        display: block;
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    [data-theme="dark"] .mobile-menu a {
        border-bottom-color: rgba(255, 255, 255, 0.05);
    }

    /* Hero section - single column on mobile */
    #home .grid.lg\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        text-align: center;
    }

    #home .space-y-8 {
        text-align: center;
        align-items: center;
    }

    #home h1 {
        font-size: 3rem !important;
        line-height: 1.1;
    }

    #home p {
        font-size: 1.1rem !important;
        max-width: none !important;
    }

    #home .flex.flex-wrap.gap-4 {
        justify-content: center;
    }

    #home .flex.flex-wrap.gap-4 a {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }


    #home img.w-full.h-full {
        height: 100% !important;
    }

    /* General section padding on mobile */
    section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    section .max-w-\[90%\] {
        max-width: 92% !important;
        padding: 0 1rem;
    }

    /* About section cards */
    #about .p-6 {
        padding: 1rem !important;
    }

    #about h2 {
        font-size: 1.75rem !important;
    }

    /* Experience timeline - single column */
    #experience .relative.flex.flex-row {
        flex-direction: column !important;
        gap: 0 !important;
    }

    #experience .hidden.lg\:block {
        display: none !important;
    }

    #experience .flex-1 {
        flex: none !important;
        width: 100% !important;
        margin-bottom: 2rem;
    }

    #experience .bg-white.border {
        padding: 1rem !important;
    }

    #experience h4 {
        font-size: 0.95rem !important;
    }

    #experience p {
        font-size: 0.85rem !important;
    }

    /* Projects - single column */
    .project-item .lg\:flex {
        flex-direction: column !important;
        display: flex !important;
        gap: 1.5rem !important;
    }

    .project-item .lg\:w-6\/12,
    .project-item .lg\:w-8\/12,
    .project-item .lg\:w-4\/12 {
        width: 100% !important;
        order: none !important;
    }

    .project-item h3 {
        font-size: 1.75rem !important;
    }

    .project-item p {
        font-size: 0.95rem !important;
    }

    .project-item img {
        height: auto !important;
        max-height: 250px !important;
        width: 100% !important;
        object-fit: contain;
    }

    /* Skills marquee */
    #skills .logo-track {
        gap: 3rem !important;
        animation-duration: 60s !important;
    }

    #skills .logo-track img {
        height: 48px !important;
    }

    #skills .logo-track img.logo-xl {
        height: 64px !important;
    }

    #skills h2 {
        font-size: 1.75rem !important;
    }

    /* Contact section */
    #contact h2 {
        font-size: 1.75rem !important;
    }

    #contact p {
        font-size: 1rem !important;
    }

    #contact .flex.justify-center.gap-6 {
        gap: 1.5rem !important;
    }

    #contact .flex.justify-center.gap-6 a {
        font-size: 1.25rem !important;
    }

    /* Prevent horizontal overflow on mobile */
    body {
        overflow-x: hidden !important;
    }

    html {
        overflow-x: hidden !important;
    }

    /* Ensure all sections scroll properly on mobile */
    section {
        min-height: auto !important;
    }

    /* Hero height override on mobile */
    #home {
        min-height: auto !important;
        height: auto !important;
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    /* Disable parallax blur on mobile - causes blur artifacts on scroll */
    #home .absolute.top-0.left-0.w-full.h-full.-z-10 {
        display: none !important;
    }

    /* Hero image container - prevent overflow */
    #home .relative.h-\[70vh\],
    #home .relative.h-\[calc(100vh-80px)\] {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
    }

    /* Ensure nav links are clickable on mobile */
    #navbar a {
        position: relative;
        z-index: 10;
    }

    /* Hide desktop logo+name on mobile */
    #navbar > div > div:first-child {
        display: none !important;
    }

    /* Make navbar container relative for absolute positioning of mobile controls */
    #navbar .max-w-\[90%\] {
        position: relative !important;
    }

    /* Mobile header: toggle left, title centered, hamburger right */
    #theme-toggle {
        position: absolute !important;
        left: 1rem !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 10 !important;
        width: 44px !important;
        height: 24px !important;
    }
    #theme-toggle #toggle-thumb {
        top: 2px !important;
        left: 2px !important;
        width: 20px !important;
        height: 20px !important;
        transform: translateX(0) !important;
        transition: transform 0.3s ease !important;
    }

    [data-theme="dark"] #theme-toggle #toggle-thumb {
        transform: translateX(20px) !important;
    }

    /* Mobile title centered */
    .mobile-title {
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        font-size: 1rem !important;
        font-weight: 700 !important;
        color: #000 !important;
        z-index: 10 !important;
        white-space: nowrap !important;
    }

    [data-theme="dark"] .mobile-title {
        color: #fff !important;
    }

    /* Hamburger on right */
    .mobile-menu-btn {
        position: absolute !important;
        right: 1rem !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 10 !important;
        background: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 36px !important;
        height: 36px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .mobile-menu-btn i {
        color: #6b7280 !important;
        font-size: 1.1rem !important;
        transition: none !important;
    }

    /* Hide "Available for opportunities" badge on mobile */
    .hero-badge {
        display: none !important;
    }

    /* ============ MOBILE HERO: image first, then text ============ */
    #home .grid {
        display: grid !important;
        gap: 0rem !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        max-width: 100% !important;
    }
    #home .hero-image-container {
        margin-bottom: -0.5rem !important;
        order: 1 !important;
    }
    #home .hero-text {
        margin-top: 0 !important;
        order: 2 !important;
    }

    /* Hero padding so image isn't under header */
    #home {
        padding-top: 90px !important;
    }

    /* Center hero text on mobile */
    #home .hero-text {
        text-align: center !important;
    }
    #home .hero-text .flex.flex-wrap.gap-4 {
        flex-direction: column !important;
        align-items: center !important;
        gap: 1rem !important;
    }

    /* Hero buttons - stacked, full width on mobile */
    #home .hero-text .flex.flex-wrap.gap-4 > a {
        width: 100% !important;
        max-width: 280px !important;
        text-align: center !important;
        display: block !important;
    }

    /* Hero description slightly smaller on mobile */
    #home .hero-text p {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
    }

    /* Hero image container - smaller on mobile, ensure visible */
    #home .hero-image-container {
        height: 67vh !important;
        max-height: 360px !important;
        min-height: auto !important;
    }
    #home .hero-image-container > div[class*="max-h-\[70vh\]"] {
        height: 100% !important;
        max-height: 100% !important;
    }
    section > div[class*="max-w-["] {
        max-width: 100% !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    section > .max-w-\[90%\],
    #about > .max-w-\[90%\],
    #experience > .max-w-\[90%\],
    #projects > .max-w-\[90%\],
    #skills > .max-w-\[90%\],
    #contact > .max-w-\[90%\] {
        max-width: 100% !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Reduce section padding on mobile */
    section {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* ============ ABOUT SECTION MOBILE ============ */
    #about {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    #about .p-6 {
        padding: 1.25rem !important;
    }

    #about h2 {
        font-size: 1.75rem !important;
        margin-bottom: 0 !important;
    }

    #about .text-center.mb-16 {
        margin-bottom: 2rem !important;
    }

    /* About cards - remove forced equal height so they size naturally */
    #about .bg-white.rounded-2xl.border.border-gray-100 {
        height: auto !important;
        min-height: auto !important;
    }

    /* Education card - stack institute+location below program, smaller fonts */
    #about ul > li.flex.justify-between {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.25rem !important;
    }
    #about ul > li.flex.justify-between > div:first-child {
        font-size: 0.875rem !important;
    }
    #about ul > li.flex.justify-between > div:last-child {
        text-align: left !important;
        font-size: 0.65rem !important;
        color: #6b7280 !important;
        white-space: nowrap !important;
    }
    #about ul.space-y-6 {
        gap: 1rem !important;
    }

    /* Certifications grid - each subcard on its own row */
    #certs-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    #certs-grid > div {
        width: 100% !important;
        padding: 0.75rem !important;
        min-height: auto !important;
        height: auto !important;
    }
    #certs-grid > div p.text-sm.font-medium {
        font-size: 0.875rem !important;
    }
    #certs-grid > div p.text-xs {
        font-size: 0.75rem !important;
    }
    /* Bloomberg subcard - icon top-left, title beside it, tags below */
    #certs-grid > div:nth-child(5) {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }

    #certs-grid > div:nth-child(5) > .w-8.h-8 {
        flex-shrink: 0 !important;
        width: 2rem !important;
        height: 2rem !important;
    }

    #certs-grid > div:nth-child(5) > .w-8.h-8 i {
        font-size: 1rem !important;
        line-height: 1 !important;
    }

    #certs-grid > div:nth-child(5) > div:nth-of-type(2) {
        flex: 1 1 auto !important;
        flex-direction: column !important;
        gap: 0.25rem !important;
        min-width: 0 !important;
    }

    #certs-grid > div:nth-child(5) > div:nth-of-type(2) > p {
        margin: 0 !important;
        margin-bottom: 0.25rem !important;
    }

    /* Tags wrapper forced to its own full-width row below title */
    #certs-grid > div:nth-child(5) .flex.gap-2.flex-wrap {
        flex-basis: 100% !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        margin-top: 0.25rem !important;
        gap: 0.5rem !important;
    }

    #certs-grid > div:nth-child(5) .flex.gap-2.flex-wrap > span {
        margin-bottom: 0 !important;
        text-align: left !important;
        white-space: nowrap !important;
        font-size: 0.75rem !important;
    }

    /* Mobile tags - align left */
    #bloomberg-tags-mobile {
        justify-content: flex-start !important;
    }

    #bloomberg-tags-mobile > span {
        text-align: left !important;
    }

    /* Bloomberg Training - horizontal image stack on mobile */
    .bloomberg-img-stack {
        display: flex !important;
        overflow: hidden !important;
        grid-template-columns: none !important;
    }
    .bloomberg-img-stack img {
        height: 150px;
        width: auto;
        flex-shrink: 0;
        object-fit: cover;
    }
    .bloomberg-img-stack img:not(:last-child) {
        margin-right: -2.5rem;
    }
    /* Bloomberg Training - mobile-only cert stack image: drop shadow + remove white strip */
    .mobile-only-cert-img {
        filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.15)) !important;
        margin-left: -1rem !important;
        margin-right: -1rem !important;
    }
    /* Bloomberg Terminal - mobile-only term stack image: drop-shadow follows PNG alpha channel */
    .mobile-only-term-img {
        filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.15)) !important;
        margin-left: -1rem !important;
        margin-right: -1rem !important;
    }
    /* Bloomberg Training - remove container padding to kill white strip */
    .bloomberg-training-container {
        padding: 0 !important;
    }
    /* Algorithmic Analysis - mobile-only algo stack image: drop-shadow follows PNG alpha channel */
    .mobile-only-algo-img {
        filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.15)) !important;
        margin-left: -1rem !important;
        margin-right: -1rem !important;
    }
    /* Space Systems Engineering - mobile-only space stack image: drop-shadow follows PNG alpha channel */
    .mobile-only-space-img {
        filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.15)) !important;
        margin-left: -1rem !important;
        margin-right: -1rem !important;
    }
    /* Self-Hosting - mobile-only stack image: drop-shadow follows PNG alpha channel */
    .mobile-only-stack-img {
        filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.15)) !important;
        margin-left: -1rem !important;
        margin-right: -1rem !important;
    }
    /* Fix project item order on mobile - images first, then title + description */
    .project-item .lg\:flex > div:nth-of-type(1) {
        order: 1 !important;
    }
    .project-item .lg\:flex > div:nth-of-type(2) {
        order: 2 !important;
    /* Technical Skills - reduce gap between description line and marquee */
    }
    #skills .text-center.mb-16 {
        margin-bottom: 2rem !important;
    }

    /* Logo Marquee - tighter padding on mobile */
    .logo-marquee {
        padding: 0.5rem 0 !important;
        margin-top: 0 !important;
    }

    /* Logo Marquee - shrink logos on mobile */
    .logo-track img {
        height: 48px !important;
        width: auto !important;
    }

    .logo-track img.logo-xl {
        height: 64px !important;
    }

    /* Logo Marquee - three rows with staggered delays */
    .logo-track + .logo-track {
        animation-delay: 0s !important;
        margin-top: 1rem !important;
    }
    /* Skills top border - single center focus like navbar */
    .skills-top-line {
        background: linear-gradient(90deg, transparent, #0071e3, transparent) !important;
    }
    [data-theme="dark"] .skills-top-line {
        background: linear-gradient(90deg, transparent, #a855f7, transparent) !important;
        opacity: 0.6 !important;
    }

    /* View My Work - scroll offset for sticky navbar on mobile */
    #projects {
        scroll-margin-top: 80px !important;
    }

    /* Reduce footer copyright font size on mobile */
    #contact .mt-12 > p.md\:hidden {
        font-size: 14px !important;
    }
}
