/* === HEADER + NAV === */
:root {
    /* Header-specific tokens reuse base tokens where possible */
    --header-height: 56px;
    --font-heading: var(--font-heading);
    --shadow-header: 0 4px 20px rgba(0, 0, 0, 0.05);
}

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 1.25rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: var(--header-height);
    background-color: var(--color-bg-white);
    box-shadow: var(--shadow-header);
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/* Reduced header when scrolled */
header.scrolled {
    height: calc(var(--header-height) - 16px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    background-color: var(--color-bg-white);
}

/* LOGO & TITLE */
.logo-container {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: rotate(10deg);
}

.header_text {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 800;
    color: var(--color-primary);
    text-transform: uppercase;
    text-align: left;
    margin: 0 0 0 1rem;
    letter-spacing: -0.02em;
    line-height: 1.4;
    display: flex;
    align-items: center;
}

/* HAMBURGER BUTTON */
.hamburger {
    display: none;
    /* Hidden by default on desktop if we had a desktop menu, but we rely on the slide-out for now? */
    /* The original design had a slide out menu even on desktop? 
       Checking original: "nav { ... right: 0; width: 130px; ... visibility: hidden; }"
       Yes, it seems it was always a hamburger menu. I will keep that pattern but modernize it.
    */
    font-size: 24px;
    background: none;
    color: var(--color-primary);
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1002;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hamburger:hover {
    color: var(--color-accent);
}

/* NAVIGATION STYLES */
nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 250px;
    height: 100vh;
    background-color: var(--color-bg-white);
    padding: 5rem 1.5rem 1.5rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    box-sizing: border-box;
}

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

nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
}

nav ul li {
    width: 100%;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.4s ease;
}

nav.nav-open ul li {
    opacity: 1;
    transform: translateX(0);
}

/* Stagger animation for menu items */
nav.nav-open ul li:nth-child(1) {
    transition-delay: 0.1s;
}

nav.nav-open ul li:nth-child(2) {
    transition-delay: 0.15s;
}

nav.nav-open ul li:nth-child(3) {
    transition-delay: 0.2s;
}

nav.nav-open ul li:nth-child(4) {
    transition-delay: 0.25s;
}

nav.nav-open ul li:nth-child(5) {
    transition-delay: 0.3s;
}

nav.nav-open ul li:nth-child(6) {
    transition-delay: 0.35s;
}

nav.nav-open ul li:nth-child(7) {
    transition-delay: 0.4s;
}

nav.nav-open ul li:nth-child(8) {
    transition-delay: 0.45s;
}

nav.nav-open ul li:nth-child(9) {
    transition-delay: 0.5s;
}

nav ul li a {
    color: var(--color-text-nav);
    font-family: var(--font-heading);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

nav ul li a:hover {
    color: black;
    font-weight: 800;
    text-decoration: none;
    background-color: #f5f6fa;
    transform: translateX(5px);
}

/* Overlay for menu */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

body.menu-open .nav-overlay {
    opacity: 1;
    visibility: visible;
}

/* Prevent background scrolling when menu is open */
body.menu-open {
    overflow: hidden;
}

/* === RESPONSIVE === */
@media screen and (max-width: 768px) {
    header {
        height: 60px;
        padding: 0 1rem;
    }

    .header_text {
        font-size: 1rem;
    }

    .logo {
        width: 36px;
        height: 36px;
    }

    nav {
        width: 100vw;
        /* Full width on mobile */
    }

    .back-button-container {
        text-align: center;
        padding: 1.5rem 1rem 0;
    }
}

/* Show hamburger on smaller screens up to 1024px */
@media screen and (max-width: 1024px) {
    .hamburger {
        display: flex;
    }
}

/* Back Button */
.back-button-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem 0;
}

.back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 140px;
    padding: 0.75rem 1.5rem;
    background-color: var(--color-bg-white);
    color: var(--color-primary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.back-button:hover {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.back-button svg {
    transition: transform 0.2s ease;
}

.back-button:hover svg {
    transform: translateX(-4px);
}