/* Navigation — floating pill navbar */
body > nav {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 3rem);
    max-width: 1100px;
    z-index: 1000;
    background: rgba(var(--bg-rgb), 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 9999px;
    padding: 0.6rem 1.5rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(var(--primary-rgb), 0.04);
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

body > nav.scrolled {
    background: rgba(var(--bg-rgb), 0.92);
    border-color: var(--border-soft);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(var(--primary-rgb), 0.06);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-container > a {
    display: flex;
    align-items: center;
    line-height: 0;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-links li {
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.45rem 0.9rem;
    border-radius: 9999px;
    transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
    color: var(--text);
    background: rgba(var(--primary-rgb), 0.08);
}

.nav-cta {
    background: var(--primary) !important;
    color: white !important;
    padding: 0.45rem 1.15rem !important;
    border-radius: 9999px !important;
    font-weight: 600 !important;
    transition: background 0.2s, box-shadow 0.2s !important;
}

.nav-cta:hover {
    background: var(--primary-dark) !important;
    box-shadow: 0 2px 12px rgba(var(--primary-rgb), 0.35);
}

.nav-cta-form,
.nav-cta-form-input {
    background: var(--primary);
    color: white;
    padding: 0.45rem 1.15rem;
    border-radius: 9999px;
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    display: inline-block;
}

.nav-cta-form:hover,
.nav-cta-form-input:hover {
    background: var(--primary-dark);
    box-shadow: 0 2px 12px rgba(var(--primary-rgb), 0.35);
}

.btn-form-wrapper {
    display: inline;
}

.btn-form-wrapper button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    font-family: inherit;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.4);
    transition: all 0.2s;
}

.btn-form-wrapper button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.55);
}

/* Footer */
body > footer {
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
    padding: 4rem 1.5rem 2rem;
    position: relative;
    text-align: left;
    border-top: 0;
}

body > footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-soft), transparent);
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
}

.footer-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 3rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
}

.footer-brand {
    flex: 1 1 260px;
    max-width: 260px;
}

.footer-logo-link {
    display: inline-block;
    line-height: 0;
    margin-bottom: 0.75rem;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0 0 1.25rem;
}

.footer-social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid var(--border);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.footer-social-link:hover {
    color: var(--text-bright);
    border-color: var(--border-soft);
    background: rgba(var(--primary-rgb), 0.06);
}

.footer-nav {
    display: flex;
    flex: 1 1 420px;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 3rem;
    min-width: 0;
}

.footer-nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-nav-heading {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin: 0 0 0.35rem;
}

.footer-nav-link {
    color: var(--text-subtle);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.15s;
}

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

.footer-bottom {
    display: flex;
    justify-content: center;
    padding: 1.5rem 0 0;
}

.footer-copyright {
    color: var(--text-subtle);
    font-size: 0.75rem;
    margin: 0;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.mobile-menu-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-soft);
}

.mobile-menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.15s ease;
    transform-origin: center;
}

.mobile-menu-btn span + span {
    margin-top: 5px;
}

/* Hamburger → X */
.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@keyframes menuSlideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes menuSlideUp {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-6px); }
}

@media (max-width: 768px) {
    body > nav {
        width: calc(100% - 2rem);
        padding: 0.55rem 1rem;
        border-radius: 9999px;
    }

    .mobile-menu-btn {
        display: inline-flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 0;
        right: 0;
        background: rgba(var(--bg-rgb), 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 0.5rem 0.75rem 0.75rem;
        gap: 0;
        border: 1px solid var(--border);
        border-radius: 16px;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    }

    .nav-links.active {
        display: flex;
        animation: menuSlideDown 0.18s ease;
    }

    .nav-links.closing {
        display: flex;
        animation: menuSlideUp 0.15s ease forwards;
    }

    @keyframes fadeInRow {
        from { opacity: 0; transform: translateX(-10px); }
        to   { opacity: 1; transform: translateX(0); }
    }

    .nav-links li {
        display: flex;
        align-items: stretch;
        width: 100%;
    }

    .nav-links li + li {
        border-top: 1px solid var(--border-soft);
    }

    .nav-links.active li {
        animation: fadeInRow 0.2s ease both;
    }
    .nav-links.active li:nth-child(1) { animation-delay: 0.06s; }
    .nav-links.active li:nth-child(2) { animation-delay: 0.10s; }
    .nav-links.active li:nth-child(3) { animation-delay: 0.14s; }
    .nav-links.active li:nth-child(4) { animation-delay: 0.18s; }
    .nav-links.active li:nth-child(5) { animation-delay: 0.22s; }

    .nav-links a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 0.9rem 0.75rem;
        font-size: 0.975rem;
        font-weight: 500;
        color: var(--text-muted);
        border-radius: 10px;
        transition: color 0.15s, background 0.15s;
    }

    .nav-links a::after {
        content: '\2192';
        font-size: 0.85rem;
        color: var(--text-subtle);
        flex-shrink: 0;
        transition: transform 0.15s ease, color 0.15s;
    }

    .nav-links a:hover {
        color: var(--text-bright);
        background: rgba(var(--primary-rgb), 0.06);
    }

    .nav-links a:hover::after {
        transform: translateX(4px);
        color: var(--primary);
    }

    .nav-cta-item .nav-cta::after {
        display: none;
    }

    /* CTA row in mobile */
    .nav-cta-item {
        border-top: 1px solid var(--border-soft) !important;
        padding: 0.875rem 0 0.25rem;
    }

    .nav-cta-item form {
        width: 100%;
    }

    .nav-cta-item .nav-cta {
        display: block;
        width: 100%;
        text-align: center;
        padding: 0.8rem 1.25rem !important;
        border-radius: 10px !important;
    }

    .nav-cta-item .nav-cta-form {
        display: block;
        width: 100%;
        text-align: center;
        padding: 0.8rem 1.25rem;
        border-radius: 10px;
        font-size: 1rem;
    }
}

@media (max-width: 640px) {
    body > footer {
        padding: 3rem 1.25rem 1.5rem;
    }

    .footer-card {
        flex-direction: column;
        gap: 2rem;
        padding-bottom: 2rem;
    }

    .footer-brand {
        flex: none;
        max-width: none;
    }

    .footer-nav {
        flex: none;
        width: 100%;
        gap: 1.75rem;
        justify-content: flex-start;
    }

    .footer-bottom {
        padding: 1rem 0 0;
    }
}
