/* =========================
   GLOBAL RESET & BASICS
========================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    /* Critical for layout */
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: #111;
    background: #ffffff;
    margin: 0;

    /* Prevent horizontal overscroll dragging on the page itself */
    overscroll-behavior-x: none;
}

html {
    scroll-behavior: smooth;
}


#about,
#services,
#projects,
#experience,
#skills,
#education {
    scroll-margin-top: 100px;
    /* height of navbar + spacing */
}

/* =========================
   NAVBAR WRAPPER (POSITIONING)
========================= */
.navbar {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;

    /* Prevent dragging the whole navbar wrapper on touch */
    touch-action: none;
}

.nav-icon {
    width: 14px;
    height: 14px;
    opacity: 0.8;
    flex-shrink: 0;
}

.nav-item:hover .nav-icon {
    opacity: 1;
}

/* =========================
   1. THE GLASS FRAME (STATIC)
   Holds the shape, border, and glass effect.
   Does NOT scroll.
========================= */
.nav-frame {
    position: relative;
    border-radius: 9999px;

    /* Clips the inner scroller at the corners */
    overflow: hidden;

    /* Glass Effect */
    background: rgba(255, 255, 255, 0.50);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* =========================
   2. THE SCROLLER (MOVING)
   Holds the items and handles scrolling.
========================= */
.nav-scroller {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    /* Padding now lives inside the scroller */

    /* Allow scrolling if needed, but hide distinct scrollbars by default */
    overflow-x: auto;

    /* Smooth scrolling on iOS */
    -webkit-overflow-scrolling: touch;

    /* Enable horizontal pan interaction */
    touch-action: pan-x;

    /* Hide Scrollbar Standard */
    scrollbar-width: none;
}

/* Hide Scrollbar Chrome/Safari */
.nav-scroller::-webkit-scrollbar {
    display: none;
}

/* =========================
   NAV ITEM
========================= */
.nav-item {
    position: relative;
    z-index: 1;

    display: flex;
    align-items: center;
    gap: 8px;

    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;

    color: #444;
    text-decoration: none;

    border-radius: 9999px;
    white-space: nowrap;

    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Hover Light Sweep Effect */
.nav-item::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;

    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.6),
            transparent);

    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-item:hover {
    color: #000;
    background: rgba(0, 0, 0, 0.04);
}

.nav-item:hover::before {
    opacity: 1;
}

/* =========================
   ACTIVE NAV ITEM
========================= */
.nav-item.active {
    background: rgba(255, 106, 0, 0.12);
    color: #ff6a00;

    box-shadow:
        0 0 0 1px rgba(255, 106, 0, 0.15),
        0 0 20px rgba(255, 106, 0, 0.15);
}

.nav-item.active .nav-icon {
    filter: brightness(0) saturate(100%) invert(49%) sepia(86%) saturate(2473%) hue-rotate(10deg) brightness(101%);
}

/* =========================
   PULSING LOCATION DOT
========================= */
.dot {
    width: 6px;
    height: 6px;
    background: #ff6a00;
    border-radius: 50%;
    position: relative;
    display: block;
}

.dot::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;

    background: radial-gradient(circle,
            rgba(255, 106, 0, 0.5),
            transparent 70%);

    animation: pulse 1s infinite ease-out;
}

@keyframes pulse {
    0% {
        transform: scale(0.5);
        opacity: 0.8;
    }

    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

/* =========================
   MOBILE OPTIMIZATION
========================= */
@media (max-width: 768px) {

    #about,
    #services,
    #projects,
    #experience,
    #skills,
    #education {
        scroll-margin-top: 90px;
    }

    .navbar {
        top: 12px;
        /* Reset desktop centering to lock to width */
        left: 0;
        transform: none;

        width: 100%;
        padding: 0 16px;
    }

    .nav-frame {
        width: 100%;
    }

    .nav-scroller {
        width: 100%;
        justify-content: flex-start;
        /* Add side padding so first item isn't glued to edge */
        padding: 6px 12px;
    }

    .nav-item {
        font-size: 13px;
        padding: 8px 14px;
        flex-shrink: 0;
        /* Prevents squishing */
    }
}

/* =========================
   DARK MODE SUPPORT
========================= */
body.dark {
    background: #111;
    color: #eee;
}

/* Note: Targeting .nav-frame now, not .nav-container */
body.dark .nav-frame {
    background: rgba(20, 20, 20, 0.50);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

body.dark .nav-item {
    color: #aaa;
}

body.dark .nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

body.dark .nav-item.active {
    background: rgba(255, 140, 58, 0.15);
    color: #ff8c3a;
    box-shadow:
        0 0 0 1px rgba(255, 140, 58, 0.25),
        0 0 22px rgba(255, 140, 58, 0.15);
}