/* ===== MOBILE MENU ===== */
.menu-toggle { position: fixed; top: 22px; right: 24px; width: 32px; height: 32px; cursor: pointer; z-index: 60; background: none; border: none; padding: 0; touch-action: manipulation; }
.menu-toggle:focus-visible { outline: 2px solid #10b981; outline-offset: 4px; border-radius: 4px; }
.menu-toggle span {
    position: absolute; left: 4px; height: 2px; background: #fff; border-radius: 2px;
    transition: top 0.5s cubic-bezier(0.77, 0, 0.175, 1), width 0.5s cubic-bezier(0.77, 0, 0.175, 1), transform 0.5s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.5s cubic-bezier(0.77, 0, 0.175, 1), background 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}
.menu-toggle span:nth-child(1) { top: 9px; width: 24px; }
.menu-toggle span:nth-child(2) { top: 15px; width: 16px; }
.menu-toggle span:nth-child(3) { top: 21px; width: 20px; }

.menu-toggle.active span:nth-child(1) { top: 15px; width: 24px; transform: rotate(45deg); background: #10b981; }
.menu-toggle.active span:nth-child(2) { width: 0; opacity: 0; transform: translateX(10px); }
.menu-toggle.active span:nth-child(3) { top: 15px; width: 24px; transform: rotate(-45deg); background: #10b981; }

.mobile-menu {
    position: fixed; inset: 0; z-index: 55; background: #000;
    clip-path: circle(0% at calc(100% - 44px) 32px);
    transition: clip-path 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.mobile-menu.open {
    clip-path: circle(150% at calc(100% - 44px) 32px);
    pointer-events: all;
}
@media (prefers-reduced-motion: reduce) {
    .mobile-menu { transition: none; }
    .mobile-menu nav a { transition: color 0.3s ease !important; transform: none !important; opacity: 1 !important; }
    .mobile-menu.open nav a { transition-delay: 0s !important; }
    .menu-toggle span { transition: none; }
    .mobile-menu .menu-footer { transition: none; }
}
.mobile-menu nav a {
    display: block; font-family: 'Outfit', sans-serif; font-weight: 800;
    font-size: clamp(2.5rem, 10vw, 5rem); line-height: 1.2;
    color: #fff; text-decoration: none;
    opacity: 0; transform: translateY(60px) rotate(3deg);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
    letter-spacing: -0.02em;
}
.mobile-menu.open nav a {
    opacity: 1; transform: translateY(0) rotate(0deg);
}
.mobile-menu.open nav a:nth-child(1) { transition-delay: 0.25s; }
.mobile-menu.open nav a:nth-child(2) { transition-delay: 0.32s; }
.mobile-menu.open nav a:nth-child(3) { transition-delay: 0.39s; }
.mobile-menu.open nav a:nth-child(4) { transition-delay: 0.46s; }
.mobile-menu.open nav a:nth-child(5) { transition-delay: 0.53s; }
.mobile-menu.open nav a:nth-child(6) { transition-delay: 0.60s; }
.mobile-menu nav a:hover, .mobile-menu nav a:active { color: rgba(255,255,255,0.5); }
.mobile-menu nav a:focus-visible { outline: 2px solid #fff; outline-offset: 4px; border-radius: 4px; }

.mobile-menu .menu-footer {
    position: absolute; bottom: 40px; left: 0; right: 0; z-index: 1;
    text-align: center; opacity: 0; transform: translateY(20px);
    transition: opacity 0.5s ease 0.6s, transform 0.5s ease 0.6s;
}
.mobile-menu.open .menu-footer { opacity: 1; transform: translateY(0); }


/* ===== MAGNETIC ===== */
.magnetic-btn { transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); }


/* ===== NAV LINKS ===== */
.nav-link { position: relative; }
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #10b981;
    transition: width 0.3s ease;
}
.nav-link:hover::after { width: 100%; }


/* active section */
.nav-link[aria-current="page"] { color: #fff; }
.nav-link[aria-current="page"]::after { width: 100%; }
.mobile-menu nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: #10b981; text-decoration-thickness: 4px; text-underline-offset: 8px; }
.magnetic-btn[aria-current="page"] { background: #fff; color: #000; }

/* page-independent text colour for the nav */
nav[aria-label="Main navigation"], .mobile-menu, .menu-toggle { color: #fff; }

/* ===== HEADER: fixed geometry, identical on every page ===== */
html { scrollbar-gutter: stable; }
nav[aria-label="Main navigation"] {
    position: sticky; top: 0; z-index: 50; box-sizing: border-box;
    height: 76px; line-height: 20px; background: #000;
}
nav[aria-label="Main navigation"] > div { box-sizing: border-box; height: 100%; padding-top: 0; padding-bottom: 0; }
nav[aria-label="Main navigation"] > div > a:first-child { width: 116px; height: 20px; line-height: 20px; white-space: nowrap; }
nav[aria-label="Main navigation"] .nav-link { line-height: 20px; white-space: nowrap; }
nav[aria-label="Main navigation"] .magnetic-btn { box-sizing: border-box; width: 104px; height: 42px; line-height: 20px; justify-content: center; white-space: nowrap; }
.site-logo-m { height: 32px; white-space: nowrap; }
@media (min-width: 768px) { nav[aria-label="Main navigation"] { height: 88px; } }

/* cross-document view transition keeps the header still between pages */
@media (prefers-reduced-motion: no-preference) {
    @view-transition { navigation: auto; }
    nav[aria-label="Main navigation"] { view-transition-name: site-header; }
    .site-logo-m { view-transition-name: site-logo-m; }
    .menu-toggle { view-transition-name: site-toggle; }
    ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .15s; }
}
