/* ==========================================================================
   i-Quad shared site navigation (all pages)
   Markup is generated by _tools/update_nav.py; behaviour lives in assets/js/site-nav.js.
   Self-contained: no Bootstrap / Tailwind / Font Awesome dependency.
   ========================================================================== */

/* Anchored sections land below the navbar instead of under it */
html:has(.sn) {
    scroll-padding-top: 84px;
}

.sn {
    --sn-bg: rgba(15, 23, 42, 0.86);
    --sn-panel: rgba(15, 23, 42, 0.98);
    --sn-border: rgba(255, 255, 255, 0.1);
    --sn-text: #94a3b8;
    --sn-strong: #f8fafc;
    --sn-dim: #64748b;
    --sn-primary: #0491C6;
    --sn-secondary: #84AB2C;
    --sn-link: #8AD7EF;
    --sn-grad: linear-gradient(135deg, #0491C6, #84AB2C);

    position: sticky;
    top: 0;
    z-index: 1030;
    width: 100%;
    background: var(--sn-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--sn-border);
    font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

/* Home page: the navbar floats over the hero */
.sn.sn--fixed {
    position: fixed;
    left: 0;
    right: 0;
}

.sn.sn--scrolled {
    background: rgba(15, 23, 42, 0.94);
    box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.7);
}

.sn *,
.sn *::before,
.sn *::after {
    box-sizing: border-box;
}

.sn ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sn a {
    text-decoration: none;
}

.sn a:focus-visible,
.sn button:focus-visible {
    outline: 2px solid var(--sn-primary);
    outline-offset: 3px;
    border-radius: 8px;
}

.sn-bar {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 16px;
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.sn-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: auto;
}

.sn-brand img {
    height: 46px;
    width: auto;
    display: block;
}

/* ---------- Top-level items ---------- */
.sn-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sn-list {
    display: flex;
    align-items: center;
    gap: 2px;
}

.sn-item {
    position: relative;
}

.sn-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border: 0;
    background: none;
    color: var(--sn-text);
    font-family: inherit;
    font-weight: 500;
    font-size: 0.98rem;
    line-height: 1.2;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.sn-link::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--sn-primary), var(--sn-secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.sn-link:hover,
.sn-item.is-active > .sn-link,
.sn-item.is-open > .sn-link {
    color: var(--sn-strong);
}

.sn-link:hover::after,
.sn-item.is-active > .sn-link::after {
    transform: scaleX(1);
}

.sn-caret {
    width: 10px;
    height: 10px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.sn-item.is-open > .sn-link .sn-caret {
    transform: rotate(180deg);
}

.sn-badge {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--sn-grad);
    color: #fff;
}

.sn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 14px;
    padding: 9px 22px;
    border-radius: 999px;
    background: var(--sn-grad);
    color: #fff !important;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    white-space: nowrap;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.sn-cta:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* ---------- Dropdown panels ---------- */
.sn-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 290px;
    padding: 10px;
    background: var(--sn-panel);
    border: 1px solid var(--sn-border);
    border-radius: 18px;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.75);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}

/* Invisible bridge so the pointer can travel from the item to the panel */
.sn-panel::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -12px;
    height: 12px;
}

.sn-panel--end {
    left: auto;
    right: 0;
}

.sn-item.is-open > .sn-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.sn-panel-grid {
    display: grid;
    gap: 4px 14px;
}

.sn-panel--wide {
    width: min(680px, calc(100vw - 32px));
}

.sn-panel--wide .sn-panel-grid {
    grid-template-columns: 1fr 1.4fr;
}

.sn-group-title {
    display: block;
    padding: 8px 12px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--sn-dim);
}

.sn-cols-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 4px;
}

.sn-plink {
    display: block;
    padding: 9px 12px;
    border-radius: 12px;
    color: var(--sn-text);
    transition: background 0.15s ease, color 0.15s ease;
}

.sn-plink:hover,
.sn-plink:focus-visible {
    background: rgba(4, 145, 198, 0.14);
    color: var(--sn-strong);
}

.sn-plink[aria-current="page"] {
    background: rgba(4, 145, 198, 0.1);
}

.sn-ptitle {
    display: block;
    font-weight: 600;
    font-size: 0.93rem;
    color: #e2e8f0;
    line-height: 1.3;
}

.sn-pdesc {
    display: block;
    margin-top: 2px;
    font-size: 0.8rem;
    color: var(--sn-dim);
    line-height: 1.35;
}

.sn-plink--compact {
    padding: 7px 12px;
    font-size: 0.88rem;
}

.sn-plink--all {
    margin-top: 6px;
    border-top: 1px solid var(--sn-border);
    border-radius: 0 0 12px 12px;
    color: var(--sn-link);
    font-weight: 600;
    font-size: 0.88rem;
}

/* ---------- Mobile call button + hamburger ---------- */
.sn-call,
.sn-toggle {
    display: none;
}

.sn-call {
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    border-radius: 999px;
    border: 1px solid rgba(37, 211, 102, 0.35);
    background: rgba(37, 211, 102, 0.1);
    color: #e2e8f0 !important;
    font-size: 0.85rem;
    font-weight: 600;
}

.sn-call-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #25D366;
    display: grid;
    place-items: center;
    position: relative;
}

.sn-call-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #25D366;
    animation: sn-pulse 2s ease-out infinite;
}

.sn-call-icon svg {
    width: 14px;
    height: 14px;
    fill: #fff;
    animation: sn-ring 2.4s ease-in-out infinite;
}

@keyframes sn-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.7); opacity: 0; }
}

@keyframes sn-ring {
    0%, 30%, 100% { transform: rotate(0); }
    5%, 15%, 25% { transform: rotate(-16deg); }
    10%, 20% { transform: rotate(16deg); }
}

.sn-toggle {
    width: 44px;
    height: 44px;
    border: 1px solid var(--sn-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
}

.sn-toggle span {
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: #f8fafc;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.sn.is-menu-open .sn-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sn.is-menu-open .sn-toggle span:nth-child(2) { opacity: 0; }
.sn.is-menu-open .sn-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Small laptops: tighten spacing ---------- */
@media (min-width: 992px) and (max-width: 1199px) {
    .sn-link {
        padding: 10px 8px;
        font-size: 0.92rem;
    }

    .sn-link::after {
        left: 8px;
        right: 8px;
    }

    .sn-cta {
        margin-left: 8px;
        padding: 8px 16px;
    }

    .sn-brand img {
        height: 40px;
    }
}

/* ---------- Tablet & mobile ---------- */
@media (max-width: 991px) {
    .sn-bar {
        min-height: 68px;
    }

    .sn-brand img {
        height: 38px;
    }

    .sn-call,
    .sn-toggle {
        display: inline-flex;
    }

    .sn-menu {
        position: absolute;
        top: calc(100% + 8px);
        left: 12px;
        right: 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 10px;
        max-height: calc(100vh - 92px);
        overflow-y: auto;
        overscroll-behavior: contain;
        background: var(--sn-panel);
        border: 1px solid var(--sn-border);
        border-radius: 20px;
        box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
        display: none;
    }

    .sn.is-menu-open .sn-menu {
        display: flex;
    }

    .sn-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .sn-item + .sn-item {
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }

    .sn-link {
        width: 100%;
        justify-content: space-between;
        padding: 14px 10px;
        font-size: 1rem;
    }

    .sn-link::after {
        display: none;
    }

    .sn-item.is-active > .sn-link {
        color: var(--sn-link);
    }

    .sn-panel,
    .sn-panel--wide {
        position: static;
        width: auto;
        min-width: 0;
        padding: 0 0 10px;
        margin: 0;
        border: 0;
        box-shadow: none;
        background: transparent;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: none;
        display: none;
    }

    .sn-panel::before {
        display: none;
    }

    .sn-item.is-open > .sn-panel {
        display: block;
    }

    .sn-panel--wide .sn-panel-grid {
        grid-template-columns: 1fr;
    }

    .sn-pdesc {
        display: none;
    }

    .sn-cta {
        margin: 12px 0 4px;
        padding: 12px;
    }
}

@media (max-width: 420px) {
    .sn-cols-2 {
        grid-template-columns: 1fr;
    }

    .sn-call {
        padding: 4px;
    }

    .sn-call-text {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sn,
    .sn *,
    .sn *::before,
    .sn *::after {
        animation: none !important;
        transition: none !important;
    }
}
