/* ===========================================================================
   Mindspace - site header

   The header is sticky on every page: it is fixed to the top of the viewport
   and stays there while the page scrolls, condensing once the page has moved
   past 24px.

   Its height lives in --mind-nav-h so anchor targets can clear it. Pages that
   place content directly under the header should offset by that variable
   rather than repeating a magic number.
   ========================================================================== */

:root {
    --mind-nav-black: #0f0f0f;
    --mind-nav-ivory: #f5f2ea;
    --mind-nav-gold: #a67c52;
    --mind-nav-slate: #666868;
    --mind-nav-font: "Satoshi", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mind-nav-h: 74px;
    --mind-nav-h-scrolled: 64px;
}

/* Anchor jumps land below the fixed header instead of behind it. */
html {
    scroll-padding-top: calc(var(--mind-nav-h) + 16px);
}

.mindspace-nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 40;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(18px, 2.8vw, 46px);
    width: 100%;
    min-height: var(--mind-nav-h);
    padding: 0 clamp(16px, 4vw, 68px);
    border-bottom: 1px solid rgba(166, 124, 82, 0.12);
    color: var(--mind-nav-ivory);
    font-family: var(--mind-nav-font);
    background: linear-gradient(180deg, rgba(8, 9, 9, 0.92), rgba(8, 9, 9, 0.78));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: min-height 260ms ease, background 260ms ease, border-color 260ms ease, box-shadow 260ms ease;
}

.mindspace-nav.is-scrolled {
    min-height: var(--mind-nav-h-scrolled);
    border-bottom-color: rgba(166, 124, 82, 0.22);
    background: rgba(8, 9, 9, 0.9);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

.mindspace-nav a {
    color: inherit;
    text-decoration: none;
}

.mindspace-nav a:focus-visible,
.mindspace-nav button:focus-visible {
    outline: 2px solid rgba(166, 124, 82, 0.9);
    outline-offset: 4px;
    border-radius: 6px;
}

/* ---------- brand --------------------------------------------------------- */

.mindspace-nav__brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.mindspace-nav__monogram {
    display: block;
    flex: none;
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(180, 106, 60, 0.42));
}

.mindspace-nav__brand strong,
.mindspace-nav__brand small {
    display: block;
    text-transform: uppercase;
    white-space: nowrap;
}

.mindspace-nav__brand strong {
    font-size: 1.04rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.13em;
}

.mindspace-nav__brand small {
    margin-top: 5px;
    color: rgba(245, 242, 234, 0.66);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.2em;
}

/* ---------- primary links ------------------------------------------------- */

.mindspace-nav__links {
    display: flex;
    justify-content: center;
    gap: clamp(24px, 3.4vw, 58px);
    min-width: 0;
}

.mindspace-nav__links a {
    position: relative;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    transition: color 220ms ease;
}

.mindspace-nav__links a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -8px;
    left: 0;
    height: 1px;
    background: var(--mind-nav-gold);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 220ms ease;
}

.mindspace-nav__links a:hover,
.mindspace-nav__links a[aria-current="page"] {
    color: var(--mind-nav-gold);
}

.mindspace-nav__links a:hover::after,
.mindspace-nav__links a[aria-current="page"]::after {
    transform: scaleX(1);
}

/* ---------- actions ------------------------------------------------------- */

.mindspace-nav__actions {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    justify-self: end;
}

.mindspace-nav__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 24px;
    border: 1px solid rgba(166, 124, 82, 0.86);
    border-radius: 999px;
    background: rgba(15, 15, 15, 0.34);
    color: var(--mind-nav-ivory);
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
    transition: transform 220ms ease, background 220ms ease, border-color 220ms ease;
}

.mindspace-nav__cta svg {
    width: 18px;
    height: 18px;
    margin-left: 14px;
    color: var(--mind-nav-gold);
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    transition: transform 220ms ease;
}

.mindspace-nav__cta:hover {
    transform: translateY(-2px);
    border-color: var(--mind-nav-gold);
    background: rgba(166, 124, 82, 0.12);
}

.mindspace-nav__cta:hover svg {
    transform: translateX(4px);
}

/* ---------- hamburger ----------------------------------------------------- */

.mindspace-nav__menu {
    display: none;
    place-items: center;
    align-content: center;
    gap: 4px;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(166, 124, 82, 0.72);
    border-radius: 999px;
    background: rgba(8, 9, 9, 0.45);
    cursor: pointer;
    transition: border-color 240ms ease, background 240ms ease;
}

.mindspace-nav__menu span {
    display: block;
    width: 16px;
    height: 1px;
    background: var(--mind-nav-ivory);
    transition: transform 260ms ease, opacity 200ms ease;
}

.mindspace-nav__menu[aria-expanded="true"] {
    border-color: var(--mind-nav-gold);
    background: rgba(166, 124, 82, 0.16);
}

.mindspace-nav__menu[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

.mindspace-nav__menu[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.mindspace-nav__menu[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

@media (max-width: 1180px) {
    .mindspace-nav__links,
    .mindspace-nav__cta {
        display: none;
    }

    .mindspace-nav {
        grid-template-columns: 1fr auto;
    }

    .mindspace-nav__menu {
        display: grid;
    }
}

@media (max-width: 560px) {
    :root {
        --mind-nav-h: 64px;
        --mind-nav-h-scrolled: 58px;
    }

    .mindspace-nav__brand {
        gap: 12px;
    }

    .mindspace-nav__monogram {
        width: 34px;
        height: 34px;
    }

    .mindspace-nav__brand strong {
        font-size: 0.86rem;
    }

    .mindspace-nav__brand small {
        font-size: 0.54rem;
    }

    .mindspace-nav__menu {
        width: 42px;
        height: 42px;
    }
}

/* ---------------------------------------------------------------------------
   Mobile drawer

   Below 1180px the inline links and CTA are hidden, so the menu button opens
   this panel instead. Both stay in the DOM so they can transition; while
   closed they are `visibility: hidden`, which also keeps every control inside
   them out of the tab order and stops the scrim swallowing desktop clicks.
--------------------------------------------------------------------------- */

.mindspace-nav__scrim {
    position: fixed;
    inset: 0;
    z-index: 44;
    opacity: 0;
    visibility: hidden;
    background: rgba(5, 6, 6, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: opacity 300ms ease, visibility 300ms ease;
}

.mindspace-nav__drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: flex;
    flex-direction: column;
    gap: 26px;
    width: min(380px, 86vw);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 26px clamp(22px, 6vw, 36px) 36px;
    border-left: 1px solid rgba(166, 124, 82, 0.22);
    color: var(--mind-nav-ivory);
    font-family: var(--mind-nav-font);
    background: linear-gradient(180deg, #0b0c0c 0%, #070808 100%);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1), visibility 380ms ease;
}

body.mindspace-nav-open {
    overflow: hidden;
}

body.mindspace-nav-open .mindspace-nav__scrim {
    opacity: 1;
    visibility: visible;
}

body.mindspace-nav-open .mindspace-nav__drawer {
    transform: translateX(0);
    visibility: visible;
}

.mindspace-nav__drawer a {
    color: inherit;
    text-decoration: none;
}

.mindspace-nav__drawer a:focus-visible,
.mindspace-nav__drawer button:focus-visible {
    outline: 2px solid rgba(166, 124, 82, 0.9);
    outline-offset: 4px;
    border-radius: 6px;
}

.mindspace-nav__drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.mindspace-nav__drawer-brand {
    display: block;
    width: min(180px, 58%);
}

.mindspace-nav__drawer-brand img {
    display: block;
    width: 100%;
    height: auto;
}

.mindspace-nav__drawer-close {
    display: grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(166, 124, 82, 0.42);
    border-radius: 50%;
    background: rgba(166, 124, 82, 0.08);
    color: var(--mind-nav-ivory);
    cursor: pointer;
    transition: border-color 220ms ease, background 220ms ease, transform 220ms ease;
}

.mindspace-nav__drawer-close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.8;
}

.mindspace-nav__drawer-close:hover {
    transform: rotate(90deg);
    border-color: var(--mind-nav-gold);
    background: rgba(166, 124, 82, 0.18);
}

.mindspace-nav__drawer-links {
    display: flex;
    flex-direction: column;
}

.mindspace-nav__drawer-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(166, 124, 82, 0.14);
    font-size: 1.04rem;
    font-weight: 500;
    transition: color 220ms ease, padding-left 220ms ease;
}

.mindspace-nav__drawer-links a svg {
    width: 20px;
    height: 20px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 220ms ease, transform 220ms ease;
}

.mindspace-nav__drawer-links a:hover,
.mindspace-nav__drawer-links a:focus-visible,
.mindspace-nav__drawer-links a[aria-current="page"] {
    padding-left: 6px;
    color: var(--mind-nav-gold);
}

.mindspace-nav__drawer-links a:hover svg,
.mindspace-nav__drawer-links a:focus-visible svg,
.mindspace-nav__drawer-links a[aria-current="page"] svg {
    opacity: 1;
    transform: translateX(0);
}

.mindspace-nav__drawer-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 22px;
    border: 1px solid var(--mind-nav-gold);
    border-radius: 999px;
    color: var(--mind-nav-ivory);
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(166, 124, 82, 0.14);
    transition: background 240ms ease, transform 240ms ease;
}

.mindspace-nav__drawer-cta svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.mindspace-nav__drawer-cta:hover {
    transform: translateY(-2px);
    background: rgba(166, 124, 82, 0.26);
}

.mindspace-nav__drawer-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    padding-top: 22px;
    border-top: 1px solid rgba(166, 124, 82, 0.14);
    color: var(--mind-nav-slate);
    font-size: 0.86rem;
}

.mindspace-nav__drawer-meta a:hover {
    color: var(--mind-nav-gold);
}

@media (prefers-reduced-motion: reduce) {
    .mindspace-nav,
    .mindspace-nav__scrim,
    .mindspace-nav__drawer,
    .mindspace-nav__menu span,
    .mindspace-nav__drawer-links a,
    .mindspace-nav__drawer-links a svg {
        transition: none;
    }
}
