/* ===================================================================
   Top navigation
   desktop: logo | Product v  Pricing  Docs  Privacy  Contact | (language) (theme)  Log in  [Start Free ->]
   mobile : logo ........................................................ (theme) (burger)
   =================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;

    height: var(--header-height);

    background: color-mix(in srgb, var(--color-bg) 86%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px);

    border-bottom: 1px solid var(--color-border-soft);
    transition: box-shadow .25s ease, background-color .25s ease, border-color .25s ease;
}

.site-header.is-scrolled {
    box-shadow: 0 10px 28px -18px rgba(15, 23, 42, .28);
}

.nav-inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 32px;
}

/* ===== logo ===== */

.nav-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    border-radius: 6px;
}

.nav-logo img {
    height: 26px;
    width: auto;
    transition: opacity .2s ease;
}

.nav-logo:hover img {
    opacity: .85;
}

.nav-logo .logo-dark,
.nav-logo .logo-band { /* version 2 of the logo is only shown on a green hero (hero.css) */
    display: none;
}

:root[data-theme="dark"] .nav-logo .logo-light {
    display: none;
}

:root[data-theme="dark"] .nav-logo .logo-dark {
    display: block;
}

/* ===== panel: links + actions ===== */

.nav-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-link,
.nav-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    height: 40px;
    padding: 0 14px;

    border-radius: var(--radius);

    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;

    color: var(--color-text-soft);

    transition: color .18s var(--ease), background-color .18s var(--ease);
}

.nav-link:hover,
.nav-trigger:hover,
.has-menu.open > .nav-trigger {
    color: var(--color-text);
    background: var(--color-bg-soft);
}

.nav-link[aria-current="page"],
.has-menu:has(.menu-item[aria-current="page"]) > .nav-trigger {
    color: var(--color-text);
    background: var(--color-bg-soft);
}

/* "Live demo": the one highlighted item of the menu: no fill, a delicate border and a live dot (hero.css: its look on the green hero) */
.nav-demo-item {
    margin-left: 6px;
}

.nav-demo {
    gap: 10px;
    font-weight: 700;
    color: var(--color-text);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-green) 55%, transparent);
}

.nav-demo:hover {
    color: var(--color-text);
}

/* the live dot (menu and "Explore Demo" buttons): the dot beats and sends out rings like an echo sounder, one every second;
   nothing moves with reduced motion. --pulse is its colour (dark green ink on the green hero and band, hero.css / pages.css) */
.live-pulse {
    --pulse: var(--color-green-dark);
    position: relative;
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pulse);
    animation: live-beat 2s ease-in-out infinite;
}

:root[data-theme="dark"] .live-pulse {
    --pulse: var(--color-green);
}

.live-pulse::before,
.live-pulse::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid var(--pulse);
    opacity: 0;
    animation: live-sonar 2s cubic-bezier(.15, .55, .35, 1) infinite;
}

.live-pulse::after {
    animation-delay: 1s;
}

@keyframes live-sonar {
    0% { transform: scale(1); opacity: .85; }
    100% { transform: scale(3.4); opacity: 0; }
}

@keyframes live-beat {
    0%, 50%, 100% { transform: scale(1); }
    8%, 58% { transform: scale(1.3); }
    22%, 72% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .live-pulse,
    .live-pulse::before,
    .live-pulse::after {
        animation: none;
    }
}

.nav-chevron {
    width: 14px;
    height: 14px;
    opacity: .7;
    transition: transform .25s var(--ease);
}

.has-menu.open > .nav-trigger .nav-chevron {
    transform: rotate(180deg);
}

/* ===== dropdowns ===== */

.has-menu {
    position: relative;
}

.menu {
    position: absolute;
    top: calc(100% + 10px);
    left: -6px;
    z-index: 10;

    min-width: 340px;
    padding: 8px;

    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);

    opacity: 0;
    visibility: hidden;
    transform: translateY(6px) scale(.985);
    transform-origin: 18px 0;

    transition: opacity .16s var(--ease), transform .22s var(--ease), visibility 0s linear .22s;
}

/* invisible bridge so the pointer can travel from the button to the panel */
.menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -14px;
    height: 14px;
}

.has-menu.open > .menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s;
}

.menu-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;

    padding: 10px 12px;
    border-radius: 12px;

    transition: background-color .15s ease;
}

a.menu-item:hover,
.menu-item[aria-current="page"] {
    background: var(--color-bg-soft);
}

.menu-icon {
    flex: 0 0 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 10px;
    background: var(--color-green-soft);
    color: var(--color-green-dark);

    transition: background-color .2s ease, color .2s ease, transform .2s var(--ease);
}

.menu-icon svg {
    width: 20px;
    height: 20px;
}

a.menu-item:hover .menu-icon {
    background: var(--color-green);
    color: var(--color-green-ink);
    transform: scale(1.05);
}

.menu-text {
    display: block;
    min-width: 0;
}

.menu-title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text);
}

/* a menu item that is not a link yet: no hover, and a small "Soon" beside its name */
.menu-item.is-soon {
    align-items: center;
    cursor: default;
}

.menu-soon {
    margin-inline-start: 10px;
    padding: 2px 9px;

    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-bg-soft);

    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--color-text-soft);
}

.menu-desc {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--color-text-soft);
}

/* ===== right side actions ===== */

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.btn-login {
    display: inline-flex;
    align-items: center;

    height: 40px;
    padding: 0 14px;

    border-radius: var(--radius);

    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    color: var(--color-text);

    transition: background-color .18s var(--ease);
}

.btn-login:hover {
    background: var(--color-bg-soft);
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    height: 42px;
    padding: 0 18px;

    border-radius: var(--radius);

    background: var(--color-green);
    color: var(--color-green-ink); /* dark ink on bright green keeps the text readable (AA) */

    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;

    box-shadow: 0 1px 2px rgba(22, 163, 74, .35), inset 0 1px 0 rgba(255, 255, 255, .25);

    transition: background-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}

.btn-cta svg {
    width: 16px;
    height: 16px;
    transition: transform .22s var(--ease);
}

.btn-cta:hover {
    background: #2bd46a;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px -10px rgba(22, 163, 74, .75), inset 0 1px 0 rgba(255, 255, 255, .3);
}

.btn-cta:hover svg {
    transform: translateX(3px);
}

.btn-cta:active {
    transform: translateY(0);
}

/* ===== tools: theme toggle + burger ===== */

.nav-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.nav-icon-btn {
    position: relative;

    display: inline-grid;
    place-items: center;

    width: 40px;
    height: 40px;

    border-radius: var(--radius);
    color: var(--color-text-soft);

    transition: color .18s var(--ease), background-color .18s var(--ease);
}

.nav-icon-btn:hover {
    color: var(--color-text);
    background: var(--color-bg-soft);
}

.nav-icon-btn svg {
    width: 20px;
    height: 20px;
}

/* desktop: the switch sits in the actions, before "Log in"; mobile: next to the burger */
.nav-tools .theme-toggle {
    display: none;
}

.theme-toggle .icon-moon {
    display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
    display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
    display: block;
}

.nav-burger {
    display: none;
    color: var(--color-text);
}

.nav-burger span {
    position: absolute;
    left: 10px;
    right: 10px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;

    transition: transform .28s var(--ease), top .28s var(--ease), opacity .15s ease;
}

.nav-burger span:nth-child(1) { top: 14px; }
.nav-burger span:nth-child(2) { top: 19px; }
.nav-burger span:nth-child(3) { top: 24px; }

.site-header.is-open .nav-burger span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.site-header.is-open .nav-burger span:nth-child(2) { opacity: 0; }
.site-header.is-open .nav-burger span:nth-child(3) { top: 19px; transform: rotate(-45deg); }

/* ===================================================================
   Mobile
   =================================================================== */

@media (max-width: 1160px) {

    .nav-inner {
        gap: 12px;
    }

    .nav-logo {
        margin-right: auto;
    }

    .nav-burger {
        display: inline-grid;
    }

    /* on mobile the theme switch lives in the bar, next to the burger (not in the sheet) */
    .nav-actions .theme-toggle {
        display: none;
    }

    .nav-tools .theme-toggle {
        display: inline-grid;
    }

    /* the panel becomes a full-screen sheet under the header.
       Not position:fixed: the header's backdrop-filter makes the header the containing block of fixed children. */
    .nav-panel {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: calc(100vh - var(--header-height));
        height: calc(100dvh - var(--header-height));

        flex-direction: column;
        align-items: stretch;
        gap: 0;

        padding: 12px 16px 28px;
        overflow-y: auto;
        overscroll-behavior: contain;

        background: var(--color-bg);

        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);

        transition: opacity .2s ease, transform .28s var(--ease), visibility 0s linear .28s;
    }

    .site-header.is-open .nav-panel {
        opacity: 1;
        visibility: visible;
        transform: none;
        transition-delay: 0s;
    }

    .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }

    .nav-link,
    .nav-trigger {
        width: 100%;
        height: 52px;
        justify-content: space-between;

        padding: 0 12px;

        font-size: 17px;
        color: var(--color-text);
    }

    .nav-chevron {
        width: 18px;
        height: 18px;
    }

    /* "Live demo" in the sheet: a full-width green row, dot first */
    .nav-demo-item {
        margin: 8px 0 0;
    }

    .nav-demo {
        justify-content: flex-start;
        gap: 12px;
    }

    /* dropdowns turn into accordions */
    .menu {
        position: static;
        display: grid;
        grid-template-rows: 0fr;

        min-width: 0;
        padding: 0;

        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: none;

        opacity: 1;
        transform: none;
        visibility: hidden; /* collapsed links must not be reachable with Tab */

        transition: grid-template-rows .3s var(--ease), visibility 0s linear .3s;
    }

    .menu::before {
        display: none;
    }

    .menu-list {
        min-height: 0;
        overflow: hidden;
    }

    .has-menu.open > .menu {
        grid-template-rows: 1fr;
        visibility: visible;
        transition-delay: 0s;
    }

    .menu-item {
        padding: 10px 8px;
    }

    .nav-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;

        margin: 20px 0 0;
        padding-top: 20px;

        border-top: 1px solid var(--color-border-soft);
    }

    .btn-login {
        justify-content: center;
        height: 48px;
        border: 1px solid var(--color-border);
        font-size: 16px;
    }

    .btn-cta {
        height: 50px;
        font-size: 16px;
    }
}

@media (min-width: 1161px) {
    .menu-list {
        display: block;
    }
}

/* just above the mobile breakpoint the bar is tight: smaller gaps keep everything on one line */
@media (min-width: 1161px) and (max-width: 1240px) {

    .nav-inner {
        gap: 20px;
    }

    .nav-panel {
        gap: 12px;
    }

    .nav-link,
    .nav-trigger {
        padding: 0 10px;
    }

    .nav-demo-item {
        margin-left: 2px;
    }

    .btn-login {
        padding: 0 10px;
    }

    .btn-cta {
        padding: 0 14px;
    }
}
