/* ============================================
        HEADER
============================================ */

.header {
    width: 100%;
    position: fixed;
    top: 25px;
    z-index: 1000;
    display: flex;
    justify-content: center;
    transition: top .4s ease;
}

.header.scrolled {
    top: 8px;
}

.header-container {
    width: 90%;
    max-width: 1400px;
    height: 85px;
    padding: 0 35px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 35px;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    transition: background .4s ease, border-color .4s ease, box-shadow .4s ease, height .4s ease, padding .4s ease;
}

body.dark .header-container {
    background: var(--header-bg);
    border: 1px solid var(--accent-border);
    box-shadow: 0 20px 50px var(--shadow);
}

body.light .header-container {
    background: var(--header-bg);
    border: 1px solid var(--accent-border);
    box-shadow: 0 20px 50px var(--shadow);
}

.header.scrolled .header-container {
    height: 70px;
    padding: 0 28px;
}

/* ============================================
                LOGO
============================================ */

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    width: 150px;
    height: auto;
    transition: width .4s ease;
}

.header.scrolled .logo img {
    width: 130px;
}

.logo-gold { display: block !important; }
.logo-blue { display: none !important; }

body.light .logo-gold { display: none !important; }
body.light .logo-blue { display: block !important; }

/* ============================================
                NAV
============================================ */

.nav {
    display: flex;
    align-items: center;
    gap: 34px;
}

.nav a {
    position: relative;
    text-decoration: none;
    font-size: 15.5px;
    font-weight: 600;
    padding: 8px 2px;
    transition: color .3s ease;
}

body.dark .nav a { color: #eee; }
body.light .nav a { color: #333; }

.nav a::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%) scaleX(0);
    width: 100%;
    height: 2.5px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent-2), var(--accent));
    transition: transform .35s ease;
    transform-origin: center;
}

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

.nav a:hover::after,
.nav a.active::after {
    transform: translateX(50%) scaleX(1);
}

/* ============================================
                NAV DROPDOWN
============================================ */

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-item .caret {
    width: 12px;
    height: 12px;
    margin-right: 4px;
    color: var(--text-muted);
    transition: transform .3s ease, color .3s ease;
}

.nav-item:hover .caret,
.nav-item.active .caret {
    color: var(--accent);
    transform: rotate(180deg);
}

.dropdown {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    min-width: 230px;
    padding: 10px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--accent-border);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 25px 60px var(--shadow-strong);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition: opacity .35s ease, transform .35s ease, visibility .35s ease;
    z-index: 1100;
}

.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown a {
    display: block;
    padding: 12px 18px !important;
    margin: 2px 0;
    border-radius: 14px;
    font-size: 14.5px !important;
    font-weight: 600;
    white-space: nowrap;
}

.dropdown a::after {
    display: none;
}

.dropdown a:hover {
    color: var(--accent) !important;
    background: var(--accent-soft);
    padding-right: 24px !important;
}

/* ============================================
                ACTIONS
============================================ */

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.theme-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-chip);
    border: 1px solid var(--accent-border);
    color: var(--accent);
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.theme-btn svg {
    width: 20px;
    height: 20px;
}

.theme-btn .icon-sun { display: none; }
body.light .theme-btn .icon-moon { display: none; }
body.light .theme-btn .icon-sun { display: block; }

.theme-btn:hover {
    transform: translateY(-4px) rotate(15deg);
    box-shadow: 0 10px 25px var(--accent-glow);
}

.project-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 15.5px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-2), var(--accent) 55%, var(--accent-3));
    color: var(--bg);
    box-shadow: 0 8px 25px var(--accent-glow);
    transition: transform .3s ease, box-shadow .3s ease;
}

.project-btn .btn-arrow {
    width: 16px;
    height: 16px;
}

.project-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px var(--accent-glow-strong);
}

/* ============================================
                HAMBURGER
============================================ */

.hamburger {
    display: none;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--bg-chip);
    border: 1px solid var(--accent-border);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: transform .3s ease;
}

.hamburger span {
    width: 20px;
    height: 2.2px;
    border-radius: 3px;
    background: var(--accent);
    transition: transform .35s ease, opacity .35s ease, width .35s ease;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7.2px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7.2px) rotate(-45deg);
}

/* ============================================
                MOBILE MENU
============================================ */

.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 950;
    pointer-events: none;
}

.mobile-menu-bg {
    position: absolute;
    inset: 0;
    background: var(--bg);
    opacity: 0;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: opacity .45s ease;
}

.mobile-nav {
    position: absolute;
    top: 110px;
    right: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    transform: translateY(-30px);
    opacity: 0;
    transition: transform .45s ease, opacity .45s ease;
}

.mobile-menu.open {
    pointer-events: auto;
}

.mobile-menu.open .mobile-menu-bg {
    opacity: 1;
}

.mobile-menu.open .mobile-nav {
    transform: translateY(0);
    opacity: 1;
}

.mobile-link {
    width: min(400px, 90%);
    text-align: center;
    text-decoration: none;
    font-size: 20px;
    font-weight: 800;
    padding: 15px 0;
    border-radius: 20px;
    color: var(--text);
    border: 1px solid transparent;
    transition: all .3s ease;
}

.mobile-link:hover,
.mobile-link.active {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: var(--accent-border);
}

.mobile-sub {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: min(400px, 90%);
}

.mobile-sub-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--accent);
    padding: 8px 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-sub-title::before,
.mobile-sub-title::after {
    content: "";
    width: 26px;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, var(--accent));
}

.mobile-sub-title::after {
    background: linear-gradient(90deg, var(--accent), transparent);
}

.mobile-sub a {
    text-align: center;
    text-decoration: none;
    font-size: 15.5px;
    font-weight: 600;
    padding: 9px 26px;
    border-radius: 14px;
    color: var(--text-muted);
    border: 1px solid transparent;
    transition: all .3s ease;
}

.mobile-sub a:hover {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: var(--accent-border);
}

.mobile-cta {
    width: min(400px, 90%);
    text-align: center;
    text-decoration: none;
    font-size: 18px;
    font-weight: 800;
    padding: 16px 0;
    margin-top: 14px;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--accent-2), var(--accent) 55%, var(--accent-3));
    color: var(--bg);
    box-shadow: 0 12px 35px var(--accent-glow);
}

/* ============================================
                RESPONSIVE
============================================ */

@media (max-width: 1100px) {
    .nav {
        gap: 24px;
    }

    .nav a {
        font-size: 14.5px;
    }
}

@media (max-width: 900px) {
    .header-container {
        width: 95%;
        padding: 0 20px;
    }

    .nav {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .logo img {
        width: 120px;
    }

    .project-btn {
        padding: 11px 18px;
        font-size: 14px;
    }

    .project-btn .btn-arrow {
        display: none;
    }
}

@media (max-width: 480px) {
    .header {
        top: 12px;
    }

    .header-container {
        height: 72px;
        border-radius: 26px;
    }

    .logo img {
        width: 105px;
    }

    .theme-btn {
        width: 40px;
        height: 40px;
    }

    .hamburger {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
}

@media (max-width: 420px) {
    .header-container {
        padding: 0 14px;
        gap: 8px;
    }

    .logo img {
        width: 92px;
    }

    .header-actions {
        gap: 8px;
    }

    .project-btn {
        display: none;
    }

    .mobile-nav {
        top: 100px;
        padding: 16px;
    }

    .mobile-link {
        font-size: 17px;
        padding: 12px 0;
        border-radius: 16px;
    }

    .mobile-sub a {
        font-size: 14.5px;
        padding: 8px 20px;
    }

    .mobile-cta {
        font-size: 16px;
        padding: 14px 0;
    }
}
