/* ==========================================================================
   Hybrid Capsule & Responsive Mobile Overlay Navigation Styles
   ========================================================================== */

/* ----------------------------------------------------
   1. Desktop Capsule Positioning & Overrides
   ---------------------------------------------------- */
/* Core Header, Capsule & Logo Layout Styles */
.header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 95%;
    z-index: 10000 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: rgba(20, 20, 20, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.1);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.header:hover {
    background: rgba(30, 30, 30, 0.85);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
}

.header_logo {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

@media (min-width: 992px) {
    .header_logo {
        margin-right: 40px;
    }
}

.header_logo img, .header_logo svg, .header_logo .svg {
    height: 32px;
    width: auto;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.header_logo:hover img, .header_logo:hover svg, .header_logo:hover .svg {
    transform: scale(1.08) rotate(-2deg);
}

.header_menu {
    display: block;
}

.header_menu_list {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 768px) {
    .header_menu_list {
        gap: 15px;
    }
}

.header_menu_item {
    position: relative;
}

.header_menu_item a {
    text-decoration: none;
    display: block;
    padding: 8px 16px;
    border-radius: 30px;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* We style the desktop links container inside .header */
.fs-nav-desktop {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

@media (min-width: 992px) {
    .fs-nav-desktop {
        display: flex !important;
    }
    .fs-menu-toggle {
        display: none !important;
    }
}

@media (max-width: 991px) {
    .fs-nav-desktop {
        display: none !important;
    }
}

/* ----------------------------------------------------
   2. Desktop Sliding Pill Background Indicator
   ---------------------------------------------------- */
.fs-nav-links {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0 4px;
}

.fs-nav-pill {
    position: absolute;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
                width 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
                height 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
                opacity 0.25s ease;
}

.is-red .fs-nav-pill {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* ----------------------------------------------------
   3. Menu Item Styling Overrides (Stripping old pill styles)
   ---------------------------------------------------- */
.header .header_menu_list {
    display: flex;
    align-items: center;
    gap: 0;
}

.header .header_menu_item {
    margin: 0;
    padding: 0;
    list-style: none;
}

.header .header_menu_item a {
    position: relative;
    display: block;
    padding: 10px 22px !important;
    font-family: 'DM Sans', 'Nunito Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none !important;
    background: none !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    z-index: 2;
    transition: color 0.3s ease, opacity 0.3s ease !important;
}

.header .header_menu_item.is-active a, 
.header .header_menu_item.current-page a {
    background: none !important;
    box-shadow: none !important;
}

/* Text Sliding Hover effect (Double span) */
.header .header_menu_item_inner {
    display: block;
    position: relative;
    overflow: hidden;
}

.header .header_menu_item_link {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    white-space: nowrap;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), color 0.3s ease;
}

.header .header_menu_item_link__deep {
    color: rgba(255, 255, 255, 0.55);
}
.is-red .header .header_menu_item_link__deep {
    color: rgba(0, 0, 0, 0.55);
}

.header .header_menu_item_link__active {
    color: #fff;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transform: translateY(100%);
}
.is-red .header .header_menu_item_link__active {
    color: #000;
}

.header .header_menu_item:hover .header_menu_item_link__deep {
    transform: translateY(-100%);
}
.header .header_menu_item:hover .header_menu_item_link__active {
    transform: translateY(0);
}

/* Dim items on hover of capsule */
.fs-nav-links:hover .fs-nav-item a {
    opacity: 0.5;
}
.fs-nav-links .fs-nav-item:hover a {
    opacity: 1 !important;
}

/* Active indicator color overrides */
.header .header_menu_item.is-active .header_menu_item_link__deep,
.header .header_menu_item.current-page .header_menu_item_link__deep {
    color: #fff !important;
    opacity: 1 !important;
}
.is-red .header .header_menu_item.is-active .header_menu_item_link__deep,
.is-red .header .header_menu_item.current-page .header_menu_item_link__deep {
    color: #000 !important;
    opacity: 1 !important;
}

.header .header_menu_item.is-active:hover .header_menu_item_link__deep,
.header .header_menu_item.current-page:hover .header_menu_item_link__deep {
    transform: translateY(0);
}
.header .header_menu_item.is-active:hover .header_menu_item_link__active,
.header .header_menu_item.current-page:hover .header_menu_item_link__active {
    transform: translateY(100%);
}

/* ----------------------------------------------------
   4. Mobile Responsive Header Layout overrides
   ---------------------------------------------------- */
@media (max-width: 991px) {
    .header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        padding: 20px 25px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        pointer-events: none !important; /* Clicks pass through transparent spaces */
    }
    
    .header .header_logo,
    .header .fs-menu-toggle {
        pointer-events: auto !important; /* Enable click events on logo and toggle */
    }
    
    .header .header_logo {
        margin: 0 !important;
    }
}

/* Mobile Toggle Hamburger button styling */
.fs-menu-toggle {
    pointer-events: auto;
    background: none;
    border: none;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 10001;
    transition: transform 0.3s ease;
}

.fs-menu-toggle:hover {
    transform: scale(1.08);
}

.fs-menu-icon, .fs-menu-icon::before, .fs-menu-icon::after {
    display: block;
    width: 32px;
    height: 2px;
    background: #fff;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), background 0.3s ease;
    position: absolute;
}

.fs-menu-icon::before {
    content: '';
    transform: translateY(-8px);
}

.fs-menu-icon::after {
    content: '';
    transform: translateY(8px);
}

.fs-menu-toggle.is-open .fs-menu-icon {
    background: transparent;
}
.fs-menu-toggle.is-open .fs-menu-icon::before {
    transform: translateY(0) rotate(45deg);
}
.fs-menu-toggle.is-open .fs-menu-icon::after {
    transform: translateY(0) rotate(-45deg);
}

/* Theme red (light mode client portal) overrides */
.is-red .fs-menu-icon, .is-red .fs-menu-icon::before, .is-red .fs-menu-icon::after {
    background: #000;
}
.is-red .fs-menu-toggle.is-open .fs-menu-icon,
.is-red .fs-menu-toggle.is-open .fs-menu-icon::before,
.is-red .fs-menu-toggle.is-open .fs-menu-icon::after {
    background: #fff;
}
.is-red .fs-menu-toggle.is-open .fs-menu-icon { background: transparent; }

/* ----------------------------------------------------
   5. Mobile / Tablet Full Screen Overlay Menu
   ---------------------------------------------------- */
.fs-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0a0a0a;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 10vw;
    clip-path: circle(0% at calc(100% - 75px) 55px);
    transition: clip-path 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    pointer-events: none;
}

.fs-nav-overlay.is-active {
    clip-path: circle(150% at calc(100% - 75px) 55px);
    pointer-events: auto;
}

.fs-nav-menu {
    margin-top: -5vh;
}

.fs-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.fs-nav-overlay .fs-nav-item {
    overflow: hidden;
    margin-bottom: 2vh;
}

.fs-nav-overlay .fs-nav-item a {
    display: inline-block;
    font-family: 'DM Sans', 'Nunito Sans', sans-serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
    text-decoration: none;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
    position: relative;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), -webkit-text-stroke 0.3s ease;
}

.fs-nav-overlay .fs-nav-item.is-active a {
    color: #eb5939;
    -webkit-text-stroke: 0px transparent;
}

.fs-nav-overlay .fs-nav-item a::before {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    color: #fff;
    -webkit-text-stroke: 0px transparent;
    width: 0%;
    overflow: hidden;
    transition: width 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    white-space: nowrap;
}

.fs-nav-overlay .fs-nav-item a:hover::before {
    width: 100%;
}
.fs-nav-overlay .fs-nav-item a:hover {
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0);
}

.fs-nav-overlay.is-active .fs-nav-item a {
    transform: translateY(0);
}

.fs-nav-overlay.is-active .fs-nav-item:nth-child(1) a { transition-delay: 0.15s; }
.fs-nav-overlay.is-active .fs-nav-item:nth-child(2) a { transition-delay: 0.22s; }
.fs-nav-overlay.is-active .fs-nav-item:nth-child(3) a { transition-delay: 0.29s; }
.fs-nav-overlay.is-active .fs-nav-item:nth-child(4) a { transition-delay: 0.36s; }
.fs-nav-overlay.is-active .fs-nav-item:nth-child(5) a { transition-delay: 0.43s; }
.fs-nav-overlay.is-active .fs-nav-item:nth-child(6) a { transition-delay: 0.50s; }

.fs-nav-footer {
    position: absolute;
    bottom: 50px;
    left: 10vw;
    right: 10vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.fs-nav-overlay.is-active .fs-nav-footer {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.6s;
}

.fs-nav-footer a {
    color: #b7ab98;
    text-decoration: none;
    font-size: 0.9rem;
    font-family: 'DM Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: color 0.3s ease;
}

.fs-nav-footer a:hover {
    color: #fff;
}

.fs-nav-socials {
    display: flex;
    gap: 30px;
}

@media (max-width: 768px) {
    .fs-nav-overlay .fs-nav-item a { font-size: 2.3rem; }
    .fs-nav-footer { flex-direction: column; gap: 20px; align-items: flex-start; bottom: 30px; }
}

/* ==========================================================================
   6. Project Switcher (Prev/Next Case Studies)
   ========================================================================== */
.project-switcher-section {
    max-width: 1200px;
    margin: 80px auto 40px;
    padding: 0 24px;
    position: relative;
    z-index: 10;
}
.switcher-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 40px 0;
    gap: 20px;
}
.switcher-btn {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    width: 45%;
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.prev-project {
    text-align: left;
    align-items: flex-start;
}
.next-project {
    text-align: right;
    align-items: flex-end;
}
.switcher-label {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 8px;
}
.switcher-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(16px, 2.5vw, 24px);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--cream);
    transition: color 0.3s ease;
}
.switcher-btn:hover {
    transform: translateY(-3px);
}
.switcher-btn:hover .switcher-title {
    color: var(--accent);
}
.switcher-divider {
    width: 1px;
    height: 60px;
    background: var(--border);
}
@media (max-width: 768px) {
    .switcher-container {
        flex-direction: column;
        align-items: stretch;
        gap: 30px;
        padding: 30px 0;
    }
    .switcher-btn {
        width: 100%;
        text-align: center;
        align-items: center;
    }
    .switcher-divider {
        width: 100%;
        height: 1px;
        background: var(--border);
    }
}

/* ==========================================================================
   7. Fixed Side Navigation Arrows (Desktop/Tablet Overlay Switcher)
   ========================================================================== */
.side-nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(20, 20, 20, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cream);
    text-decoration: none;
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.side-nav-arrow:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 4px 20px rgba(235, 89, 57, 0.4);
}
.side-nav-prev {
    left: 24px;
}
.side-nav-next {
    right: 24px;
}
.side-nav-arrow svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}
.side-nav-prev:hover svg {
    transform: translateX(-2px);
}
.side-nav-next:hover svg {
    transform: translateX(2px);
}

@media (max-width: 1100px) {
    .side-nav-arrow {
        display: none !important;
    }
}

/* ==========================================================================
   8. Custom Scrollbar (Desktop Viewports)
   ========================================================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #080809;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #eb5939; /* Vermilion branding color */
}

/* ==========================================================================
   9. Page Entrance Cinematic Animations
   ========================================================================== */
@keyframes fadeUpStudy {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.case-study-hero {
    animation: fadeUpStudy 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) forwards !important;
}
.case-study-split-layout {
    opacity: 0;
    animation: fadeUpStudy 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) 0.15s forwards !important;
}
.project-switcher-section {
    opacity: 0;
    animation: fadeUpStudy 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) 0.3s forwards !important;
}
.footer-socials a {
    transition: color 0.3s ease !important;
}
.footer-socials a:hover {
    color: #eb5939 !important;
}
