/* Site header / main menu - shared by every page.
   The menu markup itself is written into each page (index, portfolio, features, contactus, 404, apps),
   so if you add or rename a menu link, update it in all 6 files. */

/* Always reserve room for the scrollbar, so the menu doesn't slide sideways
   between pages that scroll (Portfolio, Mini apps) and pages that don't (Home, Contact Us) */
html { scrollbar-gutter: stable; }

/* Fixed height (not padding-based) so the links sit in exactly the same spot on every page,
   whether or not the "PMF Websites" brand is showing */
#main-nav {
    position: fixed; top: 0; left: 0; width: 100%; display: flex;
    justify-content: space-between; align-items: center;
    height: 72px; padding: 0 60px; box-sizing: border-box; z-index: 1000;
    border-bottom: 1px solid transparent; /* pages with a solid bar color this line in, without moving anything */
}

/* Brand is hidden on Home and the links align right */
.home-only { display: block; }
body.home-page .home-only { display: none; }
body.home-page #main-nav { justify-content: flex-end; }

.brand {
    font-family: 'Poppins', sans-serif; font-size: 1.5rem; font-weight: 700;
    text-decoration: none; color: #1f2937;
    text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff;
}
.brand span { color: #4f46e5; }

.nav-links { display: flex; gap: 45px; }
.nav-links a {
    text-decoration: none; font-family: 'Poppins', sans-serif; color: #1f2937;
    font-size: 0.95rem; font-weight: 600; transition: all 0.3s ease; position: relative;
    text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff;
}
.nav-links a:hover { color: #4f46e5; }
.nav-links a::after {
    content: ''; position: absolute; bottom: -6px; left: 0; width: 0; height: 2px;
    background: #4f46e5; transition: width 0.3s ease;
}
.nav-links a:hover::after { width: 100%; }

/* Never break "PMF Websites" or a menu link onto two lines */
.brand, .nav-links a { white-space: nowrap; }

/* Tablet widths: tighten the spacing so the brand and all 4 links fit on one row (same on every page) */
@media (min-width: 769px) and (max-width: 1100px) {
    #main-nav { padding-left: 32px; padding-right: 32px; }
    .nav-links { gap: 28px; }
}
@media (min-width: 769px) and (max-width: 860px) {
    #main-nav { padding-left: 24px; padding-right: 24px; }
    .brand { font-size: 1.3rem; }
    .nav-links { gap: 20px; }
    .nav-links a { font-size: 0.9rem; }
}

.brand:focus-visible,
.nav-links a:focus-visible,
.menu-toggle:focus-visible { outline: 2px solid #4f46e5; outline-offset: 4px; border-radius: 4px; }

/* Mobile menu button (a real button, so keyboards and screen readers can use it) */
.menu-toggle {
    display: none; background: none; border: 0; margin: 0; padding: 2px 6px;
    cursor: pointer; font-size: 28px; line-height: 1; color: #1f2937;
    text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff;
}

@media (max-width: 768px) {
    /* Without JavaScript the links simply show in one compact row, so the menu always works */
    #main-nav:not(.js) { justify-content: center; padding: 0 12px; }
    #main-nav:not(.js) .brand { display: none; }
    #main-nav:not(.js) .nav-links { gap: 14px; }
    #main-nav:not(.js) .nav-links a { font-size: 0.85rem; white-space: nowrap; }

    /* With JavaScript: the ☰ button sits in the top-right corner and opens a dropdown right under it */
    #main-nav.js { padding: 0 16px; }
    #main-nav.js .menu-toggle {
        display: flex; align-items: center; justify-content: center;
        width: 44px; height: 44px; padding: 0; /* 44px = comfortable finger-sized tap target */
        font-size: 24px; color: #1f2937; text-shadow: none;
        background: rgba(255,255,255,0.85);
        border: 1px solid rgba(31,95,168,0.15); border-radius: 12px;
        box-shadow: 0 2px 10px rgba(15,23,42,0.08);
        -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
        -webkit-tap-highlight-color: transparent;
    }
    #main-nav.js.open .menu-toggle { color: #4f46e5; border-color: rgba(79,70,229,0.35); }
    #main-nav.js .nav-links {
        display: none; flex-direction: column; background: white;
        padding: 20px; position: absolute; top: 66px; right: 16px; min-width: 170px;
        box-sizing: border-box;
        border-radius: 12px; box-shadow: 0 8px 24px rgba(15,23,42,0.15);
        gap: 15px; text-align: right;
    }
    #main-nav.js.open .nav-links { display: flex; }
}

/* Visitors who asked their device to reduce motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
