/*
 * javired.com — Header v3 PREMIUM
 */

.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    z-index: var(--z-sticky);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    transition: background var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}

[data-theme="dark"] .header,
:root .header {
    background: rgba(5, 5, 10, 0.82);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

[data-theme="light"] .header {
    background: rgba(255,255,255,0.88);
    border-bottom: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 1px 0 rgba(0,0,0,0.05);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

/* ─── Logo ────────────────────────────────────────────── */
.header__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: var(--fw-extrabold);
    color: var(--text-primary);
    letter-spacing: -0.04em;
}

.logo-accent {
    background: var(--gradient-cta);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ─── Desktop Nav ─────────────────────────────────────── */
.header__nav { display: none; }

@media (min-width: 1024px) { .header__nav { display: flex; } }

.nav-list {
    display: flex;
    list-style: none;
    gap: 2px;
    align-items: center;
}

.nav-link {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    transition: all var(--t-fast);
    text-decoration: none;
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

[data-theme="light"] .nav-link:hover {
    background: var(--accent-dim);
    color: var(--accent-primary);
}

.nav-link.active {
    color: var(--text-primary);
}

[data-theme="light"] .nav-link.active {
    color: var(--accent-primary);
}

/* Active underline */
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 22%;
    right: 22%;
    height: 2px;
    background: var(--gradient-cta);
    border-radius: var(--radius-full);
    box-shadow: 0 0 8px rgba(139,92,246,0.5);
}

/* ─── Actions ─────────────────────────────────────────── */
.header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.header__cta { display: none; }
@media (min-width: 1024px) { .header__cta { display: inline-flex; } }

/* ─── Theme Toggle ────────────────────────────────────── */
.theme-toggle {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--t-fast);
}

.theme-toggle:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.theme-toggle svg { width: 17px; height: 17px; }

[data-theme="dark"]  .icon-sun  { display: none; }
[data-theme="dark"]  .icon-moon { display: block; }
[data-theme="light"] .icon-sun  { display: block; }
[data-theme="light"] .icon-moon { display: none; }

/* ─── Hamburger ───────────────────────────────────────── */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 38px; height: 38px;
    gap: 5px;
    cursor: pointer;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: transparent;
    padding: 0;
    transition: border-color var(--t-fast);
}

@media (min-width: 1024px) { .hamburger { display: none; } }
.hamburger:hover { border-color: var(--border-hover); }

.hamburger__line {
    display: block;
    width: 19px; height: 1.5px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--t-base);
    transform-origin: center;
}

.hamburger.active .hamburger__line:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.active .hamburger__line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active .hamburger__line:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ─── Mobile Nav ──────────────────────────────────────── */
/* Note: this nav is inside <header> which has backdrop-filter,
   creating a new containing block for position: fixed children.
   We use explicit height to work around this. */
.mobile-nav {
    position: fixed;
    top: var(--header-height);
    right: 0;
    width: min(300px, 80vw);
    height: calc(100vh - var(--header-height));
    height: calc(100dvh - var(--header-height));
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--glass-border);
    padding: var(--space-6);
    transform: translateX(100%);
    transition: transform var(--t-slow), visibility 0s linear 0.38s;
    z-index: var(--z-overlay);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    visibility: hidden;
    box-sizing: border-box;
}

[data-theme="light"] .mobile-nav {
    background: rgba(255,255,255,0.95);
    border-color: var(--border);
}

.mobile-nav.active {
    transform: translateX(0);
    visibility: visible;
    transition: transform var(--t-slow), visibility 0s linear 0s;
}
@media (min-width: 1024px) { .mobile-nav { display: none !important; } }

.mobile-nav__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.mobile-nav__link {
    display: block;
    font-size: var(--fs-md);
    font-weight: var(--fw-medium);
    color: var(--text-secondary);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--t-fast);
}

.mobile-nav__link:hover,
.mobile-nav__link.active {
    color: var(--accent-primary);
    background: var(--accent-dim);
}

.mobile-nav__cta { margin-top: var(--space-6); }

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay);
    z-index: calc(var(--z-overlay) - 1);
    animation: fadeIn 200ms ease;
    backdrop-filter: blur(2px);
}

.nav-overlay.active { display: block; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
