/* iGEM UniCrete - main stylesheet */


/* ── 1. CSS Variables ────────────────────────────────────────── */
:root {
    --apple-ease:    cubic-bezier(0.2, 0.8, 0.2, 1);

    /* Zen Garden Palette */
    --primary:       #3A4B3A;   /* Deep Zen Green */
    --primary-mid:   #2C3A2C;
    --primary-light: #5B705B;
    --primary-pale:  #9EAD9E;

    --secondary:     #A69B82;   /* Muted Earth/Khaki */
    --secondary-mid: #857B65;
    --secondary-pale:#C9C0A9;

    --tertiary:      #6F7D65;   /* Mossy Green */
    --tertiary-dark: #525E49;
    --tertiary-pale: #B4BFA9;

    --neutral:       #D6CBAE;   /* Warm Sand */

    /* Semantic aliases */
    --olive:         var(--tertiary);
    --olive-light:   #8C9C81;
    --olive-pale:    var(--tertiary-pale);
    --cream:         var(--neutral);
    --ink:           #243024;   /* Very dark green for readability */
    --navy:          var(--primary);
    --navy-mid:      var(--primary-mid);

    --nav-h:         50px;   /* same as global.css :root - see the note there */
}

/* ── Vignette ────────────────────────────────────────────────── */
#vignette {
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    --vg: 0;
    background: radial-gradient(
        ellipse 120% 120% at center,
        transparent 42%,
        rgba(5, 15, 30, calc(var(--vg) * 0.5)) 65%,
        rgba(5, 15, 30, var(--vg)) 100%
    );
}

/* ── Depth-of-field blur on close layers (value set via JS custom property) ── */
#layer3, #layer4 { filter: blur(var(--dof, 0px)); }


body {
    font-family: 'Quicksand', sans-serif;
    background-color: var(--navy-mid);
    /* see global.css §body - clip, NOT hidden (or sticky breaks) */
    overflow-x: clip;
    /* covers the shortest page; the hero lock does not need scroll room */
    min-height: 100vh;
    width: 100vw;
}

/* ── 3. Background Canvas ────────────────────────────────────── */
.bg-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: -1;
    will-change: transform;
    transform: translateZ(0);
}

#grain-overlay {
    position: fixed;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    opacity: 0.65;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.18 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* ── 4. Navbar (desktop) ─────────────────────────────────────── */
.navbar {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: var(--nav-h);
    z-index: 200;
    padding: 0; /* the manual padding on the nav is gone */
}

/* the container that keeps everything aligned */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
    max-width: 1440px; /* same as the page limit */
    margin: 0 auto;    /* centres the container on screen */
    padding: 0 2.5rem; /* same margin as the hero section */
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 300;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    color: inherit;
    font-family: 'Quicksand', sans-serif;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2.5rem;
}
.nav-links > li > :is(a, button) {
    text-decoration: none;
    color: inherit;
    font-weight: 300;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Quicksand', sans-serif;
    /* no opacity on the links (it lowers contrast); hover underline lives in global.css */
    transition: color 0.32s ease, text-shadow 0.32s ease;
    /* target size ≥ 24px (WCAG 2.5.8) */
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 4px;
}


/* navbar dropdown (from team.html) */


/* ── 5. Hamburger menu ───────────────────────────────────────── */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px; height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: inherit;
    z-index: 210;
}


/* ── mobile nav drawer ── */
.mobile-nav {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    /* auto height up to the viewport, then scrolls inside */
    max-height: calc(100vh - var(--nav-h));
    max-height: calc(100dvh - var(--nav-h));
    background:
        radial-gradient(130% 55% at 100% 0%, rgba(111,125,101,0.22), transparent 62%),
        linear-gradient(180deg, rgba(24,34,27,0.98) 0%, rgba(16,24,19,0.99) 100%);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    border-radius: 0 0 22px 22px;
    box-shadow: 0 24px 40px rgba(0,0,0,0.32);
    z-index: 190;
    flex-direction: column;   /* becomes display:flex in the media query below */
    --mnav-pad-x: 1.75rem;    /* group headers stretch over it (hit area) */
    padding: 1.2rem var(--mnav-pad-x) calc(1.4rem + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    /* visibility: hidden removes the closed drawer from the tab order */
    visibility: hidden;
    transition: opacity 0.32s ease, transform 0.32s ease, visibility 0s linear 0.32s;
}
.mobile-nav.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
    transition: opacity 0.32s ease, transform 0.32s ease, visibility 0s linear 0s;
}

/* open drawer: page locked + dimmed, tapping the dim closes it */
html.mnav-lock { overflow: hidden; }
@media (max-width: 900px) {
    body::after {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 180;   /* under the drawer (190) and the bar (200) */
        background: rgba(8, 12, 9, 0.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.32s ease;
    }
    body.mnav-open::after {
        opacity: 1;
        pointer-events: auto;
    }
}

/* ── accordion - groups open independently; the current page's group starts open ── */
.mnav-accordion {
    display: flex;
    flex-direction: column;
}
/* shared divider for every top-level row (groups + standalone links) */
.mnav-group,
.mnav-direct {
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.mnav-accordion > :first-child { border-top: 1px solid rgba(255,255,255,0.08); }
.mnav-accordion > :last-child { border-bottom: none; }   /* the foot-border does the separating */

/* ── top-level row, shared by group headers and direct links ── */
.mnav-group-head,
.mnav-direct {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: none;
    border-left: none;
    cursor: pointer;
    padding: 1.05rem 0.15rem;
    color: rgba(255,255,255,0.92);
    font-family: 'Quicksand', sans-serif;
    text-align: left;
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.28s var(--apple-ease);
}
.mnav-group-head { border-top: none; border-right: none; border-bottom: none; }
/* tap area runs to the drawer edges so a tap beside the chevron still counts; content stays put */
.mnav-group-head {
    width: calc(100% + 2 * var(--mnav-pad-x));
    margin: 0 calc(-1 * var(--mnav-pad-x));
    padding-left: calc(0.15rem + var(--mnav-pad-x));
    padding-right: calc(0.15rem + var(--mnav-pad-x));
}
/* no press-in on full-width rows: scaling pulls the chevron edge out from under the finger */
.mnav-group-head:active,
.mnav-direct:active { transform: none; }
/* a visible focus mark, not colour alone (SC 1.4.11) */
.mnav-group-head:hover,
.mnav-direct:hover { color: #fff; outline: none; }

.mnav-group-head:focus-visible,
.mnav-direct:focus-visible { color: #fff; }

.mnav-group-title,
.mnav-direct-title {
    font-size: 1.12rem;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.mnav-group-count {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--tertiary-pale);
    background: rgba(180,191,169,0.12);
    border-radius: 20px;
    padding: 2px 8px;
    line-height: 1.4;
}
.mnav-group-chevron {
    width: 18px;
    height: 18px;
    margin-left: auto;   /* pushes the arrow right */
    color: var(--tertiary-pale);
    transition: transform 0.32s var(--apple-ease), color 0.2s ease;
}
.mnav-group-head[aria-expanded="true"] .mnav-group-chevron {
    transform: rotate(180deg);
    color: var(--olive-pale);
}

/* ── direct link: right chevron that slides in on hover (navigation) ── */
.mnav-direct-arrow {
    width: 17px;
    height: 17px;
    margin-left: auto;
    flex-shrink: 0;
    color: var(--olive-pale);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.25s ease, transform 0.28s var(--apple-ease);
}
.mnav-direct:hover .mnav-direct-arrow,
.mnav-direct:focus-visible .mnav-direct-arrow { opacity: 0.85; transform: translateX(0); }
.mnav-direct.is-current { color: var(--olive-pale); }
.mnav-direct.is-current .mnav-direct-arrow { opacity: 1; transform: translateX(0); }

/* panel - closed by default (JS/inline style opens it) */
.mnav-group-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.36s var(--apple-ease);
}

/* ── group list (inside the panel) ── */
.mobile-nav-group {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0 0 0.5rem;
}

.mobile-nav-group li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-decoration: none;
    color: rgba(255,255,255,0.72);
    font-family: 'Quicksand', sans-serif;
    font-size: 0.98rem;
    font-weight: 400;
    letter-spacing: 0.2px;
    /* indent: the items hang under the group header for hierarchy */
    padding: 0.68rem 0.15rem 0.68rem 0.9rem;
    border-left: 2px solid rgba(255,255,255,0.08);
    transition: color 0.2s ease, border-color 0.2s ease, padding-left 0.28s var(--apple-ease);
}
.mobile-nav-group li a:hover,
.mobile-nav-group li a:focus-visible {
    color: #ffffff;
    border-left-color: var(--olive-pale);
    padding-left: 1.2rem;
    outline: none;
}

/* ── chevron: slides in on hover/focus/active ── */
.mnav-arrow {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    color: var(--olive-pale);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.25s ease, transform 0.28s var(--apple-ease);
}
.mobile-nav-group li a:hover .mnav-arrow,
.mobile-nav-group li a:focus-visible .mnav-arrow {
    opacity: 0.85;
    transform: translateX(0);
}

/* ── current page ── */
.mobile-nav-group li a[aria-current="page"] {
    color: var(--olive-pale);
    font-weight: 500;
    border-left-color: var(--olive-pale);
}
.mobile-nav-group li a[aria-current="page"] .mnav-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ── Footer socials ── */
.mobile-nav-foot {
    display: flex;
    gap: 0.55rem;
    margin-top: 1.4rem;
    padding-top: 1.4rem;
    padding-bottom: 0.2rem;
    border-top: 1px solid rgba(255,255,255,0.07);
}
.mnav-social {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.045);
    color: rgba(255,255,255,0.72);
    text-decoration: none;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s var(--apple-ease);
}
.mnav-social:hover,
.mnav-social:focus-visible {
    background: rgba(180,191,169,0.18);
    border-color: rgba(180,191,169,0.45);
    color: #ffffff;
    transform: translateY(-2px);
    outline: none;
}

/* ── 6. Hero Section ─────────────────────────────────────────── */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
}
.text-container {
    position: absolute;
    bottom: 12%;
    left: 5rem;
    max-width: 85%;
    z-index: 50;
}

/* ── 7. Hero Text & Animations ───────────────────────────────── */
.tagline {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 3.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 1s ease 0.2s, transform 1s ease 0.2s;
}
.tagline.visible { opacity: 1; transform: translateY(0); }

h1 {
    font-family: 'Quicksand', sans-serif;
    color: #fff;
    font-size: clamp(3rem, calc(7vw * var(--fs-scale, 1)), 8rem);
    font-weight: 300;
    line-height: 1.0;
    letter-spacing: -2px;
    margin: 0;
    text-shadow: 0 4px 40px rgba(0,0,0,0.25);
}

.hero-sub {
    font-family: 'Quicksand', sans-serif;
    font-style: italic;
    font-size: clamp(1rem, calc(1.6vw * var(--fs-scale, 1)), 1.5rem);
    font-weight: 300;
    color: rgba(255,255,255,0.6);
    margin-top: 1.2rem;
    letter-spacing: 0.5px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}
.hero-sub.visible { opacity: 1; transform: translateY(0); }

.char {
    display: inline-block;
    opacity: 0;
    filter: blur(12px);
    transform: translateY(30px) scale(0.9);
    transition:
        opacity   0.8s var(--apple-ease),
        filter    0.8s var(--apple-ease),
        transform 0.8s var(--apple-ease);
}
.char.visible { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
.char.hidden  { opacity: 0; filter: blur(12px); transform: translateY(-20px); transition: 0.5s ease-in; }

.word-space   { display: inline-block; width: 0.25em; }

/* ── 9. Paper background (team page) ───────────────────────────── */
.team-page-body {
    background-color: var(--cream);
    background-image: url("data:image/svg+xml,%3Csvg width='150' height='150' viewBox='0 0 150 150' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paperNoise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='150' height='150' filter='url(%23paperNoise)' opacity='0.04'/%3E%3C/svg%3E");
}

/* ── 10. Buttons ─────────────────────────────────────────────── */


/* ── 11. Decorative Elements ─────────────────────────────────── */
/* ── 12. Footer ──────────────────────────────────────────────── */


.footer-main {
    padding: 4rem 5rem;
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 3rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}




.footer-bottom {
    padding: 1.5rem 5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}


/* ── 13. Responsive - ≤ 900px (tablet) ──────────────────────── */
@media (max-width: 900px) {
    .nav-container { padding: 0 2.5rem; }
    .nav-links { display: none; }
    .hamburger { display: flex; }
    .mobile-nav { display: flex; }
    .text-container { left: 2.5rem; }
    .footer-main {
        grid-template-columns: 1fr 1fr;
        padding: 3rem 2.5rem;
        gap: 2.5rem;
    }
    .footer-bottom { padding: 1.5rem 2.5rem; }
}


/* ── 14. Responsive - ≤ 600px (mobile) ──────────────────────── */
@media (max-width: 600px) {
    .nav-container { padding: 0 1.5rem; }
    .text-container {
        left: 1.5rem;
        bottom: 10%;
        max-width: calc(100% - 3rem);
    }
    h1 { letter-spacing: -0.5px; }
    .hero-sub { margin-top: 0.8rem; }
    .footer-main {
        grid-template-columns: 1fr;
        padding: 2.5rem 1.5rem;
        gap: 2rem;
    }
    .footer-brand { grid-column: auto; }
    .footer-bottom {
        padding: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}


/* ── 15. team page ── */

/* the whole page background goes purple, so it fills the screen edge to edge with no gap. */
.team-page-body {
    background-color: #EEEDF7;
    min-height: 100vh;
    /* see global.css §body - clip, NOT hidden/auto (or sticky breaks) */
    overflow-x: clip;
}

.team-nav {
    background-color: var(--navy);
    color: var(--cream);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* invisible wrapper that aligns the content */
.team-page-wrapper {
    background-color: transparent;
    border-radius: 0;
    margin: 0 auto;
    max-width: 1440px;
    box-shadow: none;
}

/* the Team "paddle" - beige, inset (2.5rem margins), rounded. */
.team-hero-clean {
    background-color: #F8F4E6;
    /* margins: top (so the nav does not cover it), right, bottom (0), left */
    margin: 8rem 2.5rem 0 2.5rem;
    padding: 5rem 6rem 4rem 6rem;
    border-radius: 64px; /* fully round, like a capsule */
    display: flex;
    align-items: flex-end;
    box-shadow: 0 12px 35px rgba(0,0,0,0.03);
}

.team-hero-clean h1 {
    color: #314031;
    font-family: 'Quicksand', sans-serif;
    font-size: clamp(5rem, calc(12vw * var(--fs-scale, 1)), 10rem);
    font-weight: 600;
    margin: 0;
    line-height: 0.9;
    letter-spacing: -4px;
}

/* the member card grid. sits straight on the purple background. */
.team-grid-clean {
    /* lines up with the paddle margins (2.5rem left and right) */
    padding: 4rem 2.5rem 8rem 2.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 4rem;
    background-color: transparent;
}

.team-member-clean {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 40px;
    overflow: hidden;
    background-color: #ffffff;
    box-shadow: 0 12px 35px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.5s ease;
}

.team-member-clean:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 24px 50px rgba(0,0,0,0.08);
}

.member-image-bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.team-member-clean:hover .member-image-bg {
    transform: scale(1.06);
}

/* the liquid glass from the design */
.glass-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: background 0.3s ease;
    border-radius: 0;
    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
}

.team-member-clean:hover .glass-overlay {
    background: rgba(255, 255, 255, 0.25);
}

.glass-overlay h3 {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.4rem;
    color: #1A1A1A;
    margin: 0 0 4px 0;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.glass-overlay .member-role {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.95rem;
    color: #333333;
    margin: 0;
    font-weight: 500;
}

/* responsive: how far the paddle is inset on phones */
@media (max-width: 900px) {
    .team-hero-clean { margin: 7rem 2rem 0 2rem; border-radius: 48px; padding: 4rem 4rem 3rem 4rem; }
    .team-grid-clean { padding: 4rem 2rem 6rem 2rem; gap: 3rem; }
}

@media (max-width: 600px) {
    .team-hero-clean { margin: 6rem 1rem 0 1rem; border-radius: 36px; padding: 3rem 2rem 2rem 2rem; }
    .team-grid-clean { padding: 3rem 1rem 5rem 1rem; gap: 2rem; }
    .team-member-clean { border-radius: 32px; }
    .glass-overlay { padding: 20px 24px; }
    .team-hero-clean h1 { letter-spacing: -2px; }
}


/* ── 16. minimized navbar (phones) - mobile-section-nav.js ── */
.nav-minibar,
.minibar-sheet { display: none; }

@media (max-width: 900px) {

    /* the in-page sidebar is hidden; it stays in the DOM for the scroll-spy */
    .team-sidebar,
    .project-sidebar { display: none; }

    /* ── the compact bar: an overlay above the navbar ── */
    .nav-minibar {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        position: absolute;
        inset: 0;
        padding: 0 1.5rem;
        color: inherit;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-4px);
        /* visibility, not just opacity: keeps the hidden bar out of the tab order */
        visibility: hidden;
        transition: opacity 0.25s ease, transform 0.25s ease,
                    visibility 0s linear 0.25s;
    }
    body.nav-minimized .nav-minibar {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        visibility: visible;
        transition: opacity 0.25s ease, transform 0.25s ease,
                    visibility 0s linear 0s;
    }

    /* while minimized, logo + hamburger hide */
    body.nav-minimized .team-nav .logo,
    body.nav-minimized .navbar .logo,
    body.nav-minimized .hamburger {
        opacity: 0;
        pointer-events: none;
        /* visibility too: out of tab order and AT while invisible */
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0s linear 0.2s;
    }

    /* page name - tap opens the full menu; truncates with … */
    .minibar-page {
        flex: 0 1 auto;
        min-width: 0;
        max-width: 45%;
        background: none;
        border: none;
        color: inherit;
        cursor: pointer;
        font-family: 'Quicksand', sans-serif;
        font-size: 0.82rem;
        font-weight: 600;
        letter-spacing: 0.5px;
        padding: 0.3rem 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: left;
    }

    .minibar-divider {
        width: 1px;
        height: 16px;
        flex-shrink: 0;
        background: currentColor;
        opacity: 0.3;
    }

    /* section area: the scrollable strip on the left, the chevron on the right. */
    .minibar-sections {
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 0.25rem;
        overflow: hidden;
    }

    /* section strip - swipe, auto-centres the active one */
    .minibar-track {
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 1.1rem;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        touch-action: pan-x;
        -webkit-overflow-scrolling: touch;
        -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%);
                mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%);
    }
    .minibar-track.is-scrolled {
        -webkit-mask-image: linear-gradient(90deg, transparent 0, rgba(0,0,0,0.08) 26px, #000 60px, #000 calc(100% - 28px), transparent 100%);
                mask-image: linear-gradient(90deg, transparent 0, rgba(0,0,0,0.08) 26px, #000 60px, #000 calc(100% - 28px), transparent 100%);
    }
    /* no fade over an active label that is already truncated */
    .minibar-track.is-tight,
    .minibar-track.is-tight.is-scrolled {
        -webkit-mask-image: none;
                mask-image: none;
    }

    .minibar-track::-webkit-scrollbar { display: none; }

    /* end padding so the last section can scroll past the fade */
    .minibar-track::after {
        content: "";
        flex: 0 0 28px;
    }

    .minibar-chip {
        flex-shrink: 0;
        /* truncate with … instead of cutting mid-word */
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        font-family: 'Quicksand', sans-serif;
        font-size: 0.82rem;
        font-weight: 400;
        letter-spacing: 0.3px;
        white-space: nowrap;
        color: inherit;
        text-decoration: none;
        opacity: 0.4;
        transition: opacity 0.25s ease, font-weight 0.25s ease;
    }
    .minibar-chip.is-active {
        opacity: 1;
        font-weight: 600;
    }

    /* the chevron - a separate button that opens/closes the dropdown. */
    .minibar-caret-btn {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 100%;
        background: none;
        border: none;
        color: inherit;
        cursor: pointer;
        padding: 0;
    }
    .minibar-caret {
        width: 10px;
        height: 6px;
        opacity: 0.6;
        transition: transform 0.25s ease;
    }
    .minibar-caret-btn[aria-expanded="true"] .minibar-caret {
        transform: rotate(180deg);
    }

    /* ── dropdown (sheet) with every section ── */
    .minibar-sheet {
        display: block;
        position: fixed;
        top: var(--nav-h);
        left: 0; right: 0;
        z-index: 199;
        background: var(--navy);
        border-bottom: 1px solid rgba(255,255,255,0.08);
        box-shadow: 0 12px 28px rgba(0,0,0,0.28);
        padding: 0.4rem 0;
        /* the options scroll if there are many - the menu never runs off the screen. */
        max-height: calc(100vh - var(--nav-h) - 1rem);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
    }
    .minibar-sheet.open {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        visibility: visible;
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0s;
    }
    .minibar-sheet-link {
        display: block;
        color: rgba(255,255,255,0.8);
        text-decoration: none;
        font-family: 'Quicksand', sans-serif;
        font-size: 0.85rem;
        letter-spacing: 0.5px;
        padding: 0.85rem 1.5rem;
        border-left: 2px solid transparent;
        transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    }
    .minibar-sheet-link:hover { color: var(--olive-pale); }
    .minibar-sheet-link.is-active {
        color: var(--cream);
        font-weight: 600;
        border-left-color: var(--cream);
        background: rgba(255,255,255,0.05);
    }

    /* users who asked for less motion: no transitions/animations. */
    @media (prefers-reduced-motion: reduce) {
        .nav-minibar,
        .minibar-sheet,
        .minibar-chip { transition: none; }
    }
}