html {
    scroll-behavior: smooth;
}

.glass-panel {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(100, 116, 139, 0.2);
}

.tech-pattern {
    background-image: radial-gradient(circle at 2px 2px, rgba(173, 198, 255, 0.05) 1px, transparent 0);
    background-size: 40px 40px;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.glass-card { 
    background: rgba(15, 23, 42, 0.7); 
    backdrop-filter: blur(12px); 
    border: 1px solid rgba(100, 116, 139, 0.2); 
    transition: all 0.3s ease; 
} 
 
.glass-card:hover { 
    border-color: rgba(59, 130, 246, 0.4); 
    box-shadow: 0px 0px 20px rgba(59, 130, 246, 0.1); 
} 
 
.tech-chip { 
    background: rgba(100, 116, 139, 0.1); 
    border: 1px solid rgba(100, 116, 139, 0.2); 
} 

.text-glow {
    text-shadow: 0 0 15px rgba(173, 198, 255, 0.3);
}

/* =============================================
   MOBILE MENU DRAWER
   Glassmorphic slide-in panel from the right
   ============================================= */

/* Hamburger / close icon button */
.mobile-menu-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.mobile-menu-icon-btn:hover {
    background: rgba(173, 198, 255, 0.08);
}

/* Drawer panel */
.mobile-menu-drawer {
    background: rgba(13, 17, 23, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(100, 116, 139, 0.2);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-drawer.is-open {
    transform: translateX(0);
}

/* Individual nav links in the drawer */
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 14px;
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Geist', sans-serif;
    font-weight: 500;
    color: #c2c6d6;   /* on-surface-variant */
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    min-height: 44px;
}

.mobile-nav-link:hover {
    background: rgba(173, 198, 255, 0.08);
    color: #adc6ff;   /* primary */
}

.mobile-nav-link--active {
    background: rgba(173, 198, 255, 0.12);
    color: #adc6ff;   /* primary */
}

.mobile-nav-link .material-symbols-outlined {
    font-size: 20px;
    flex-shrink: 0;
}

/* Contact button at the bottom of the drawer */
.mobile-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 12px 20px;
    border-radius: 12px;
    background: #adc6ff;   /* primary */
    color: #002e6a;        /* on-primary */
    font-size: 15px;
    font-family: 'Geist', sans-serif;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.mobile-contact-btn:hover  { opacity: 0.9; }
.mobile-contact-btn:active { transform: scale(0.97); }

.mobile-contact-btn .material-symbols-outlined {
    font-size: 20px;
    flex-shrink: 0;
}

/* Overlay — prevent scroll when drawer is open */
body.menu-open {
    overflow: hidden;
}

/* =============================================
   MOBILE OPTIMIZATIONS — max-width: 768px
   Only adds new rules; does not override desktop
   ============================================= */
@media (max-width: 768px) {

    /* --- Global Safety --- */
    *, *::before, *::after {
        box-sizing: border-box;
    }

    body {
        overflow-x: hidden;
        width: 100%;
    }

    img, video, canvas, svg {
        max-width: 100%;
        height: auto;
    }

    /* --- Typography Scale --- */
    /* Headings */
    h1 { font-size: 26px !important; line-height: 1.2 !important; }
    h2 { font-size: 22px !important; line-height: 1.25 !important; }
    h3 { font-size: 18px !important; line-height: 1.3 !important; }

    /* Body text floor */
    p, li, span:not(.material-symbols-outlined), a:not(nav a) {
        font-size: max(14px, 0.875rem);
    }

    /* --- Navigation --- */
    #navbar > div {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* Logo — keep large enough to tap */
    #navbar a:first-child {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* "Contact Me" button — full tap target */
    #navbar a[href^="mailto"] {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 14px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 13px !important;
    }

    /* --- Hero Section (index.html) --- */
    #hero {
        min-height: auto !important;
        padding-top: 24px !important;
        padding-bottom: 40px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    #hero > div {
        display: flex !important;
        flex-direction: column !important;
        gap: 28px !important;
    }

    /* Portrait below the text on mobile */
    #hero > div > div:last-child {
        order: -1;
        max-width: 260px;
        margin: 0 auto;
    }

    #hero img {
        max-height: 280px;
        object-fit: cover;
    }

    /* Hero CTA buttons */
    #hero a[href="#projects"],
    #hero a[href^="mailto"] {
        min-height: 44px;
        padding: 12px 20px !important;
        font-size: 15px !important;
        justify-content: center;
        text-align: center;
        width: 100%;
    }

    #hero .flex.flex-wrap {
        flex-direction: column !important;
    }

    /* --- About / Education Preview (index.html) --- */
    #about > div > div {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }

    #about .glass-panel {
        width: 100% !important;
    }

    /* --- Projects Bento (index.html) --- */
    #projects .grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }

    /* Left-align "02. PORTFOLIO" & "Featured Innovations" on mobile */
    #projects > div > div.flex {
        align-items: flex-start !important;
    }

    #projects > div > div.flex > div {
        text-align: left !important;
    }

    #projects [class*="col-span"] {
        width: 100% !important;
    }

    /* --- CTA Section (index.html) --- */
    #hero ~ section .glass-panel,
    main > section:last-of-type .glass-panel {
        padding: 28px 20px !important;
        border-radius: 20px !important;
    }

    main > section:last-of-type .flex-col.sm\:flex-row {
        flex-direction: column !important;
        gap: 12px !important;
    }

    main > section:last-of-type a {
        min-height: 44px;
        justify-content: center;
        text-align: center;
        width: 100%;
        display: flex !important;
        align-items: center;
    }

    /* --- About Page (about.html) --- */
    /* Main content grid — stack left and right columns */
    main > div.grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 32px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* Portrait image column — show above text */
    main > div > div[class*="lg:col-span-5"] {
        position: static !important;
        order: -1 !important;
        width: 100% !important;
    }

    /* Portrait image itself */
    main > div > div[class*="lg:col-span-5"] img {
        max-height: 340px;
        object-fit: cover;
        aspect-ratio: 4/5;
    }

    /* Experience badge — reposition so it doesn't overflow */
    main > div > div[class*="lg:col-span-5"] .absolute.-bottom-8 {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        margin-top: 12px !important;
        display: flex !important;
        width: fit-content !important;
    }

    /* Geometric accent border — hide on mobile to prevent overflow */
    main > div > div[class*="lg:col-span-5"] .absolute.-top-6 {
        display: none !important;
    }

    /* Left content column */
    main > div > div[class*="lg:col-span-7"] {
        width: 100% !important;
    }

    /* Education & Contact cards grid — already single column via Tailwind, reinforce */
    .grid.grid-cols-1.md\:grid-cols-2 {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }

    /* Social icon tap targets */
    a.p-2.border {
        min-width: 44px !important;
        min-height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* "Explore My Skills" button */
    a[href="skills.html"] {
        min-height: 44px;
        width: 100%;
        justify-content: center;
    }

    /* --- Projects Page (projects.html) --- */
    main.pt-\[64px\] {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* Bento grid → single column */
    .grid.grid-cols-1.lg\:grid-cols-12 {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }

    /* All col-span children full width */
    .lg\:col-span-8,
    .lg\:col-span-4,
    .lg\:col-span-6 {
        width: 100% !important;
    }

    /* Project card image — cap height on mobile */
    article .relative.aspect-video,
    article .relative.h-64 {
        height: 200px !important;
        aspect-ratio: unset !important;
    }

    /* Project links — ensure tap targets */
    article a[href] {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* "Let's Build Together" button */
    article a[href^="mailto"] {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    /* --- Skills Page (skills.html) --- */
    /* Header */
    header.mb-section-padding {
        text-align: center !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* Tech Stack canvas — reduce height on mobile */
    #tech-icons-wrapper {
        height: 260px !important;
    }

    /* Tech chip icons — slightly smaller on mobile */
    .tech-chip > div {
        width: 44px !important;
        height: 44px !important;
    }

    /* Education card — stack horizontal layout to vertical */
    .glass-card .flex.flex-col.md\:flex-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    /* Year badge — left-align on mobile */
    .glass-card .flex.flex-col.items-end {
        align-items: flex-start !important;
    }

    /* Future Focus section — ensure single column */
    section.grid.grid-cols-1.md\:grid-cols-2 {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }

    /* Future Focus image — cap height */
    section .glass-card.rounded-2xl.overflow-hidden.aspect-video {
        aspect-ratio: 16/9 !important;
        max-height: 220px !important;
    }

    /* --- Footer --- */
    footer > div {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 12px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    footer div.flex.gap-stack-lg a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* --- Glass cards — full width & comfortable padding --- */
    .glass-card,
    .glass-panel {
        width: 100% !important;
        padding: 18px !important;
    }

    /* --- Spacing helpers --- */
    .py-section-padding {
        padding-top: 36px !important;
        padding-bottom: 36px !important;
    }

    .px-gutter {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}