/* =========================================================
   Shape Shift Energies — Header & Navigation Menu
========================================================= */

.skip-link {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2000;
    padding: 0.65rem 1rem;
    background: #121816;
    color: #fff;
    text-decoration: none;
    border-radius: 0.25rem;
    transform: translateY(-150%);
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
    outline: 2px solid var(--shapeshift-accent, #fe5b2c);
    outline-offset: 2px;
}

:root {
    --shapeshift-accent: #fe5b2c;
    --shapeshift-menu-bg: #121816;
    --shapeshift-menu-text: #ffffff;
    --shapeshift-header-height: 100px;
    --shapeshift-menu-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --shapeshift-menu-duration: 0.65s;
}

/* -------------------------
   Site header (closed)
------------------------- */

.shapeshift-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    height: var(--shapeshift-header-height);
    background: transparent;
    transition: background-color 0.35s var(--shapeshift-menu-ease),
        box-shadow 0.35s var(--shapeshift-menu-ease);
}

.shapeshift-header.is-scrolled {
    background: rgba(8, 10, 9, 0.88);
    backdrop-filter: blur(12px);
}

.shapeshift-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--shapeshift-header-height);
    padding-inline: clamp(1.25rem, 4vw, 3.75rem);
}

.shapeshift-header__brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 0;
}

.shapeshift-header__logo {
    display: block;
    width: auto;
    height: clamp(2rem, 4vw, 2.65rem);
    max-width: min(168px, 42vw);
}

.shapeshift-header__logo--dark {
    display: none;
}

.shapeshift-header.is-scrolled .shapeshift-header__logo--light {
    display: block;
}

.shapeshift-menu-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.35rem 0;
    border: 0;
    background: transparent;
    color: var(--shapeshift-menu-text);
    cursor: pointer;
    transition: opacity 0.25s ease;
}

.shapeshift-menu-toggle:hover,
.shapeshift-menu-toggle:focus-visible {
    opacity: 0.82;
}

.shapeshift-menu-toggle:focus-visible {
    outline: 2px solid var(--shapeshift-accent);
    outline-offset: 4px;
}

.shapeshift-menu-toggle__label {
    font-family: var(--font-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1;
    text-transform: none;
}

.shapeshift-menu-toggle__icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    width: 1.125rem;
}

.shapeshift-menu-toggle__line {
    display: block;
    width: 100%;
    height: 1px;
    background: currentColor;
    transition: transform 0.35s var(--shapeshift-menu-ease), opacity 0.25s ease;
}

.shapeshift-menu-toggle[aria-expanded="true"] .shapeshift-menu-toggle__line:first-child {
    transform: translateY(0.4rem) rotate(45deg);
}

.shapeshift-menu-toggle[aria-expanded="true"] .shapeshift-menu-toggle__line:last-child {
    transform: translateY(-0.4rem) rotate(-45deg);
}

body.shapeshift-menu-open {
    overflow: hidden;
}

body.shapeshift-menu-open .shapeshift-header {
    z-index: 1105;
}

/* -------------------------
   Full-screen menu overlay
------------------------- */

.shapeshift-menu {
    position: fixed;
    inset: 0;
    z-index: 1200;
    visibility: hidden;
    pointer-events: none;
}

.shapeshift-menu.is-open {
    visibility: visible;
    pointer-events: auto;
}

.shapeshift-menu__layout {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    overflow: hidden;
}

/* Left visual panel (desktop split-screen) */

.shapeshift-menu-visual {
    display: none;
    flex: 0 0 50%;
    max-width: 50%;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-8%);
    background-color: #0a0c0b;
    background-size: cover;
    background-position: center center;
    transition: opacity var(--shapeshift-menu-duration) var(--shapeshift-menu-ease),
        transform var(--shapeshift-menu-duration) var(--shapeshift-menu-ease);
}

.shapeshift-menu.is-open .shapeshift-menu-visual {
    opacity: 1;
    transform: translateX(0);
}

/* Right navigation panel */

.shapeshift-menu-panel {
    flex: 1 1 auto;
    width: 100%;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #181412;
    color: var(--shapeshift-menu-text);
    transform: translateX(100%);
    opacity: 0;
    transition: transform var(--shapeshift-menu-duration) var(--shapeshift-menu-ease),
        opacity 0.45s ease;
}

.shapeshift-menu.is-open .shapeshift-menu-panel {
    transform: translateX(0);
    opacity: 1;
}

.shapeshift-menu-panel__header {
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
    padding: clamp(1.5rem, 3vw, 2.75rem) clamp(1.25rem, 4vw, 3rem) 0;
}

.shapeshift-menu-panel__close {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: opacity 0.25s ease;
}

.shapeshift-menu-panel__close:hover,
.shapeshift-menu-panel__close:focus-visible {
    opacity: 0.8;
}

.shapeshift-menu-panel__close:focus-visible {
    outline: 2px solid var(--shapeshift-accent);
    outline-offset: 4px;
}

.shapeshift-menu-panel__close-label {
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1;
}

.shapeshift-menu-panel__close-icon::before {
    content: "\00d7";
    display: block;
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 300;
    line-height: 0.85;
}

.shapeshift-menu-panel__scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: clamp(1.5rem, 4vh, 3rem) clamp(1.5rem, 5vw, 3.75rem) clamp(2rem, 5vh, 3.5rem);
}

/* Primary navigation */

.shapeshift-menu-nav__list {
    display: flex;
    flex-direction: column;
    gap: clamp(0.85rem, 2.2vh, 1.35rem);
}

.shapeshift-menu-nav__link,
.shapeshift-submenu__trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    padding: 0.15rem 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-family: var(--font-primary);
    font-size: clamp(1.65rem, 4.5vw, 2.75rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.25s ease, opacity 0.25s ease;
}

.shapeshift-menu-nav__link:hover,
.shapeshift-menu-nav__link:focus-visible,
.shapeshift-submenu__trigger:hover,
.shapeshift-submenu__trigger:focus-visible {
    color: rgba(255, 255, 255, 0.88);
}

.shapeshift-menu-nav__link:focus-visible,
.shapeshift-submenu__trigger:focus-visible,
.shapeshift-submenu__link:focus-visible,
.shapeshift-menu-cta:focus-visible {
    outline: 2px solid var(--shapeshift-accent);
    outline-offset: 4px;
}

.shapeshift-menu-nav__indicator {
    display: none;
    flex-shrink: 0;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--shapeshift-accent);
}

.shapeshift-menu-nav__item.is-active > .shapeshift-menu-nav__link .shapeshift-menu-nav__indicator,
.shapeshift-submenu.is-active > .shapeshift-submenu__trigger .shapeshift-menu-nav__indicator {
    display: block;
}

.shapeshift-submenu__trigger {
    justify-content: flex-start;
}

.shapeshift-submenu__chevron {
    flex-shrink: 0;
    width: 0.55rem;
    height: 0.55rem;
    margin-left: auto;
    margin-right: 0.25rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.4s var(--shapeshift-menu-ease);
}

.shapeshift-submenu.is-open .shapeshift-submenu__chevron {
    transform: rotate(-135deg) translateY(2px);
}

/* Expandable submenu */

.shapeshift-submenu__panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.45s var(--shapeshift-menu-ease);
}

.shapeshift-submenu.is-open .shapeshift-submenu__panel {
    grid-template-rows: 1fr;
}

.shapeshift-submenu__list {
    overflow: hidden;
    padding-left: clamp(1.35rem, 3vw, 2rem);
}

.shapeshift-submenu__item {
    padding-top: clamp(0.55rem, 1.5vh, 0.85rem);
}

.shapeshift-submenu__link {
    display: inline-block;
    color: rgba(255, 255, 255, 0.72);
    font-family: var(--font-primary);
    font-size: clamp(1rem, 2.4vw, 1.35rem);
    font-weight: 400;
    line-height: 1.35;
    text-decoration: none;
    transition: color 0.25s ease;
}

.shapeshift-submenu__link:hover,
.shapeshift-submenu__item.is-active .shapeshift-submenu__link {
    color: var(--shapeshift-menu-text);
}

/* Contact CTA */

.shapeshift-menu-panel__cta {
    margin-top: clamp(2rem, 6vh, 3.5rem);
}

.shapeshift-menu-cta {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: min(100%, 15.5rem);
    padding: 0.35rem 0.35rem 0.35rem 1.35rem;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    color: var(--shapeshift-menu-text);
    font-family: var(--font-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    transition: border-color 0.25s ease, background-color 0.25s ease;
}

.shapeshift-menu-cta:hover {
    border-color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.04);
}

.shapeshift-menu-cta__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 50%;
    background: var(--shapeshift-accent);
    color: #fff;
    font-size: 0.875rem;
}

/* -------------------------
   Desktop split-screen
------------------------- */

@media (min-width: 768px) {
    .shapeshift-menu-visual {
        background-image: url("../images/hero/hero-desktop.png");
    }
}

@media (min-width: 1200px) {
    .shapeshift-menu-visual {
        display: block;
    }

    .shapeshift-menu-panel {
        flex: 0 0 50%;
        max-width: 50%;
        border-top-left-radius: 1.25rem;
        border-bottom-left-radius: 1.25rem;
    }

    .shapeshift-menu-panel__scroll {
        padding-top: clamp(2rem, 8vh, 4.5rem);
    }
}

/* -------------------------
   Tablet
------------------------- */

@media (min-width: 768px) and (max-width: 1199px) {
    .shapeshift-menu-visual {
        display: block;
        flex-basis: 38%;
        max-width: 38%;
    }

    .shapeshift-menu-panel {
        flex-basis: 62%;
        max-width: 62%;
        border-top-left-radius: 1rem;
        border-bottom-left-radius: 1rem;
    }
}

/* -------------------------
   Mobile
------------------------- */

@media (max-width: 767px) {
    :root {
        --shapeshift-header-height: 80px;
    }

    .shapeshift-menu-visual {
        display: none !important;
    }

    .shapeshift-menu-panel {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
    }

    .shapeshift-menu-nav__link,
    .shapeshift-submenu__trigger {
        font-size: clamp(1.55rem, 7vw, 2.15rem);
    }
}

@media (max-width: 480px) {
    .shapeshift-header__inner {
        padding-inline: 1rem;
    }

    .shapeshift-menu-panel__scroll {
        padding-inline: 1.25rem;
    }
}

/* -------------------------
   Reduced motion
------------------------- */

@media (prefers-reduced-motion: reduce) {
    .shapeshift-menu-panel,
    .shapeshift-menu-visual,
    .shapeshift-submenu__panel,
    .shapeshift-submenu__chevron,
    .shapeshift-menu-toggle__line,
    .shapeshift-header {
        transition: none !important;
    }
}

/* Hide legacy navbar styles when shapeshift header is active */

.shapeshift-header + .hero-video,
.shapeshift-header ~ .hero-video {
    margin-top: 0;
}
