/* ============================================================================
   Anvyr V2 — Layout: Header & Footer
   Minimal fixed header · Editorial footer · No ribbon, no scroll bar
   ============================================================================ */

/* ── Site Header ─────────────────────────────────────────────────────────── */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    transition: background var(--ease-base), backdrop-filter var(--ease-base);
}
.site-header.is-scrolled {
    background: rgba(8, 8, 10, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
[data-theme="light"] .site-header.is-scrolled {
    background: rgba(246, 245, 242, 0.92);
    box-shadow: 0 1px 0 var(--border-subtle);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    position: relative;
}

/* ── Brand / Logo ────────────────────────────────────────────────────────── */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 18px;
    text-decoration: none;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}
.brand:hover {
    color: var(--text-primary);
}
.brand img,
.brand__mark {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}
.brand img {
    border-radius: var(--radius-sm);
}

[data-theme="light"] .brand img {
    filter: invert(1);
}


/* ── Desktop Nav ─────────────────────────────────────────────────────────── */
.main-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.main-nav a,
.main-nav .nav-dropdown__trigger {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    padding: var(--space-xs) 0;
    position: relative;
    transition: color var(--ease-fast);
    letter-spacing: 0.01em;
}
.main-nav a:hover,
.main-nav .nav-dropdown__trigger:hover {
    color: var(--text-primary);
}
.main-nav a.is-active {
    color: var(--text-primary);
}
.main-nav a.is-active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--accent);
}

/* ── Nav Dropdown ────────────────────────────────────────────────────────── */
.nav-dropdown {
    position: relative;
}
.nav-dropdown__trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
}
.nav-dropdown__trigger svg {
    width: 12px;
    height: 12px;
    transition: transform var(--ease-fast);
}
.nav-dropdown:hover .nav-dropdown__trigger svg {
    transform: rotate(180deg);
}
.nav-dropdown__menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    background: var(--bg-surface);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-md);
    padding: var(--space-xs) 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-4px);
    transition: opacity var(--ease-fast), transform var(--ease-fast), visibility var(--ease-fast);
}
.nav-dropdown:hover .nav-dropdown__menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.nav-dropdown__menu a,
.nav-dropdown__menu .nav-dropdown__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-sm) var(--space-md) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border-radius: 0;
}
.nav-dropdown__menu a:hover {
    background: var(--bg-elevated);
}
.nav-dropdown__menu a.is-active {
    color: var(--text-primary);
}
.nav-dropdown__menu a.is-active::after {
    display: none;
}
.nav-dropdown__menu .nav-dropdown__item--muted {
    color: var(--text-secondary);
    cursor: default;
}
.nav-dropdown__menu .nav-dropdown__desc {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0;
}

/* ── Nav Utilities ───────────────────────────────────────────────────────── */
.nav-utils {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

/* Theme toggle */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: none;
    border: none;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: color var(--ease-fast), background var(--ease-fast);
}
.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}
.theme-toggle svg {
    width: 16px;
    height: 16px;
}
.theme-toggle .icon-moon  { display: block; }
.theme-toggle .icon-sun   { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: block; }

/* ── Hamburger Button ────────────────────────────────────────────────────── */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}
.mobile-menu-btn svg { width: 20px; height: 20px; }

/* ── Mobile Overlay Nav ──────────────────────────────────────────────────── */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ease-base);
}
.mobile-nav-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}
.mobile-nav-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(300px, 82vw);
    background: var(--bg-deep);
    padding: var(--space-xl);
    transform: translateX(100%);
    transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    overflow-y: auto;
}
.mobile-nav-overlay.is-open .mobile-nav-panel {
    transform: translateX(0);
}
[data-theme="light"] .mobile-nav-panel {
    background: var(--bg-surface);
}
.mobile-nav-close {
    align-self: flex-end;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}
.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}
.mobile-nav-links a {
    display: block;
    padding: var(--space-md) var(--space-sm);
    color: var(--text-secondary);
    font-size: 17px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: color var(--ease-fast), background var(--ease-fast);
}
.mobile-nav-links a:hover,
.mobile-nav-links a.is-active {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.mobile-nav-muted {
    display: block;
    padding: var(--space-sm) 0;
    font-size: 16px;
    color: var(--text-muted);
}
.mobile-nav-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: var(--space-xs) var(--space-sm);
}

/* Staggered entrance */
.mobile-nav-overlay.is-open .mobile-nav-links a {
    animation: mobileSlideIn 200ms ease-out both;
}
.mobile-nav-overlay.is-open .mobile-nav-links a:nth-child(1) { animation-delay: 40ms; }
.mobile-nav-overlay.is-open .mobile-nav-links a:nth-child(2) { animation-delay: 80ms; }
.mobile-nav-overlay.is-open .mobile-nav-links a:nth-child(3) { animation-delay: 120ms; }
.mobile-nav-overlay.is-open .mobile-nav-links a:nth-child(4) { animation-delay: 160ms; }
.mobile-nav-overlay.is-open .mobile-nav-links a:nth-child(5) { animation-delay: 200ms; }

@keyframes mobileSlideIn {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}


/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-2xl);
    border-top: 1px solid var(--border-subtle);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}
.footer-brand {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.footer-copy {
    font-size: 13px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}
.footer-links a {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--ease-fast);
    position: relative;
}
.footer-links a:hover {
    color: var(--text-secondary);
}
.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--text-muted);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--ease-slow);
}
.footer-links a:hover::after {
    transform: scaleX(1);
}

/* ── Light Mode Footer ───────────────────────────────────────────────────── */
[data-theme="light"] .site-footer {
    border-top-color: var(--border-subtle);
}
