/* Header */
/* ═════════════════════════════════════════════════════════
   1. MAIN HEADER (Redesigned)
   ═════════════════════════════════════════════════════════ */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background-color: transparent;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), height 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
    height: 90px;
    /* Fixed height for stability */
    display: flex;
    align-items: center;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.main-header.scrolled {
    background-color: var(--nav-bg);
    height: 70px;
    /* Compress on scroll */
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--nav-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.nav-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* Logo Styling */
.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    z-index: 10002;
    /* Ensure logo is always clickable/visible */
}

.logo img {
    height: 45px;
    width: auto;
    transition: height 0.4s ease;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    letter-spacing: 2px;
    color: var(--text-main);
    white-space: nowrap;
}

.main-header.scrolled .logo img {
    height: 35px;
}

.main-footer .logo-text {
    color: var(--raw-white);
}

/* ── Logo hover: the emblem turns slightly towards the light like a metal
   medallion, and one band of gold light sweeps across it and on into the
   wordmark. The light is clipped to the emblem itself via a CSS mask. ── */
.logo-mark {
    position: relative;
    display: inline-flex;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-shine {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(100deg,
            transparent 41%,
            rgba(255, 238, 196, 0.85) 49%, rgba(200, 162, 74, 0.55) 52%,
            transparent 59%);
    background-size: 300% 100%;
    background-position: 100% 0;
    -webkit-mask: url("/assets/navbar-logo.webp") center / contain no-repeat;
    mask: url("/assets/navbar-logo.webp") center / contain no-repeat;
    transition: background-position 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Without mask support the glint would show as a rectangle, so skip it */
@supports not ((-webkit-mask-size: contain) or (mask-size: contain)) {
    .logo-shine {
        display: none;
    }
}

.logo:hover .logo-mark {
    transform: perspective(240px) rotateY(-16deg) scale(1.04);
}

.logo:focus-visible .logo-mark {
    transform: perspective(240px) rotateY(-16deg) scale(1.04);
}

.logo:hover .logo-shine {
    background-position: 0% 0;
}

.logo:focus-visible .logo-shine {
    background-position: 0% 0;
}

/* Gold glint across the wordmark. The gradient is built from the text's own
   colour (currentColor), so it works on the dark hero, the light header and
   the footer alike; only the fill is made transparent. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .logo-text {
        background-image: linear-gradient(100deg,
                currentColor 0%, currentColor 40%,
                #f1d89a 48%, var(--raw-gold) 52%,
                currentColor 60%, currentColor 100%);
        background-size: 300% 100%;
        background-position: 100% 0;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        transition: background-position 1s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .logo:hover .logo-text {
        background-position: 0% 0;
        transition-delay: 0.18s;
    }

    .logo:focus-visible .logo-text {
        background-position: 0% 0;
        transition-delay: 0.18s;
    }
}

@media (prefers-reduced-motion: reduce) {

    .logo-mark,
    .logo-shine,
    .logo-text {
        transition: none;
    }

    .logo:hover .logo-mark {
        transform: none;
    }

    .logo:focus-visible .logo-mark {
        transform: none;
    }
}

/* Nav Right Section */
.nav-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* Desktop Navigation */
.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    font-size: 0.9rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    position: relative;
    color: var(--text-main);
    font-weight: 500;
    padding: 5px 0;
    transition: color 0.3s ease;
    text-decoration: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-primary);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    color: var(--accent-primary);
}

.nav-link:hover::after {
    width: 100%;
}

/* Header CTA button */
.nav-link.nav-cta {
    padding: 0.6rem 1.4rem;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-link.nav-cta::after {
    display: none;
}

.nav-link.nav-cta:hover {
    background-color: var(--accent-primary);
    color: var(--raw-black);
}

/* Toggle Theme and Mobile Button placeholders */
.theme-toggle {
    display: none;
    /* Hidden for now per design */
}

/* Footer */
.main-footer {
    background: linear-gradient(135deg, #1a2619 0%, var(--raw-green) 100%);
    padding: var(--spacing-xl) 0 var(--spacing-md);
    border-top: 1px solid var(--accent-primary);
    color: var(--raw-white);
    position: relative;
    overflow: hidden;
}

.main-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--raw-green), var(--accent-primary), var(--raw-green));
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    margin-top: 1.5rem;
    max-width: 300px;
    line-height: 1.8;
}

.footer-column h4 {
    margin-bottom: var(--spacing-md);
    color: var(--accent-primary);
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--accent-primary);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Social Links in Footer */
.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social-link {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.footer-social-link:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-3px);
}

@media (max-width: 968px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Mobile Menu Styles */
/* ═════════════════════════════════════════════════════════
   MOBILE MENU (Redesigned)
   ═════════════════════════════════════════════════════════ */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.8rem;
    /* Larger touch target */
    cursor: pointer;
    z-index: 10005;
    /* Above everything including the menu overlay */
    padding: 0.5rem;
    transition: transform 0.3s ease, color 0.3s ease;
}

.mobile-menu-btn:hover {
    color: var(--accent-primary);
}

/* Both icons are in the markup; show the one that matches the state */
.mobile-menu-btn .menu-close,
.mobile-menu-btn.active .menu-open {
    display: none;
}

.mobile-menu-btn.active .menu-close {
    display: inline-block;
}

.mobile-menu-btn.active {
    color: var(--accent-primary);
    transform: rotate(90deg);
}

@media (max-width: 968px) {

    /* 1. Header Adjustments for Mobile */
    .main-header {
        height: 70px;
        padding: 0;
    }

    .main-header.scrolled {
        height: 60px;
    }

    /* 2. Logo Adjustments */
    .logo img {
        height: 35px;
        /* Smaller logo */
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .main-header.scrolled .logo img {
        height: 30px;
    }

    /* 3. Mobile Button Visibility */
    .mobile-menu-btn {
        display: block;
        margin-left: auto;
        /* Push to right */
    }

    /* 4. Fullscreen Menu Overlay */
    .nav-links {
        position: fixed;
        inset: 0;
        /* Top, Right, Bottom, Left: 0 */
        width: 100%;
        height: 100dvh;
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        /* Quartic ease */
        z-index: 10004;
        /* Below button (10005) but above header (9999) */
        -webkit-backdrop-filter: blur(15px);
        backdrop-filter: blur(15px);
        padding-top: 60px;
        /* Space for potentially visible header elements */
    }

    .nav-links.active {
        transform: translateX(0);
    }

    /* 5. Mobile Link Styles */
    .nav-link {
        font-size: 1.8rem;
        /* Big readable text */
        color: var(--raw-black);
        font-weight: 600;
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.4s ease, transform 0.4s ease;
    }

    /* Stagger animation for links when menu opens */
    .nav-links.active .nav-link {
        opacity: 1;
        transform: translateY(0);
    }

    /* Manual stagger delays handled in CSS or JS, here simple transition */
    .nav-links.active li:nth-child(1) .nav-link {
        transition-delay: 0.1s;
    }

    .nav-links.active li:nth-child(2) .nav-link {
        transition-delay: 0.2s;
    }

    .nav-links.active li:nth-child(3) .nav-link {
        transition-delay: 0.3s;
    }

    .nav-links.active li:nth-child(4) .nav-link {
        transition-delay: 0.4s;
    }

    /* Hide standard nav-right gap since we use overlay */
    /* Hide standard nav-right gap since we use overlay */
    .nav-right {
        gap: 0;
    }

    /* ═════════════════════════════════════════════════════════
       RESPONSIVE TYPOGRAPHY
       ═════════════════════════════════════════════════════════ */
    .hero-title {
        font-size: clamp(2.5rem, 5vw, 3.5rem);
        line-height: 1.1;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    h2,
    .section-title {
        font-size: clamp(2rem, 4vw, 2.5rem);
    }

    p {
        font-size: 1rem;
        line-height: 1.6;
    }

    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    section {
        padding: 4rem 0 !important;
    }

    .btn {
        width: 100%;
        max-width: 320px;
        display: block;
        margin: 1rem auto;
        text-align: center;
    }
}
