/* Landing navbar styles.
 *
 * Extracted from the inline <style> block in pages/index.html so any page
 * that renders the landing navbar (via the session-aware /api/layout/navbar
 * endpoint) can pick them up via <link>. Previously these styles travelled
 * only with pages/index.html, so pages like /login and /register that also
 * load the landing navbar had unstyled buttons and a broken top bar.
 *
 * This file is additive: pages/landing.css still owns the shared landing
 * color variables and base selectors. Load order on any page: fonts →
 * variables → base → landing.css → landing-nav.css. The button styles use
 * !important to override the minified base rules in landing.css. */

.landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 1rem 1.5rem;
    padding-bottom: 20px;
    background: linear-gradient(180deg,
        rgba(140, 180, 220, 0.08) 0%,
        rgba(60, 100, 150, 0.04) 30%,
        transparent 55%,
        rgba(0, 0, 0, 0.06) 75%,
        rgba(0, 0, 0, 0.12) 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(140, 180, 220, 0.1);
    border-bottom: 1px solid rgba(2, 10, 25, 0.2);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(160, 200, 240, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}
@media (min-width: 640px) {
    .landing-nav {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
    }
}

.landing-nav-inner {
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
    max-width: 80rem;
    gap: 0.5rem;
}
@media (min-width: 640px) {
    .landing-nav-inner { gap: 1rem; }
}

/* Applied by layout.js on pages that receive the fixed landing nav via
   injection and have no clearance of their own (legal pages, blog) —
   same offsets the auth pages hardcode on their body. */
body.memdex-landing-nav-clearance {
    padding-top: 5rem;
}

@media (max-width: 640px) {
    body.memdex-landing-nav-clearance {
        padding-top: 4rem;
    }
}

.landing-nav-menu-container {
    position: relative;
    order: 1;
    flex-shrink: 0;
}

.landing-nav-brand {
    order: 2;
    flex-shrink: 0;
    cursor: pointer;
    transform: translateX(4px);
    text-decoration: none;
}
@media (min-width: 640px) {
    .landing-nav-brand { transform: translateY(0) translateX(4px); }
}

.landing-nav-brand-text {
    font-size: 1rem;
    filter:
        drop-shadow(0 0 10px rgba(74, 158, 255, 0.3))
        drop-shadow(0 0 20px rgba(74, 158, 255, 0.15));
}
@media (min-width: 640px) {
    .landing-nav-brand-text { font-size: 1.25rem; }
}

.landing-nav-ticker-slab {
    position: relative;
    display: none;
    order: 3;
    flex: 1;
    max-width: 60%;
    margin-left: auto;
    margin-right: auto;
    border-radius: 9999px;
    overflow: hidden;
    background: rgba(10, 20, 35, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(74, 158, 255, 0.12);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
@media (min-width: 640px) {
    .landing-nav-ticker-slab { display: block; margin-top: -2px; }
}
.landing-nav-ticker-inner { padding-left: 2rem; padding-right: 2rem; overflow: hidden; }

/* ═══ Pill buttons (Login / Apply) ═══ */
.landing-nav-btn {
    position: relative;
    order: 4;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #1a3a6a 0%, #0e2748 40%, #081c38 100%) !important;
    color: #fff !important;
    text-decoration: none;
    font-family: inherit;
    font-size: 11.5px !important;
    font-weight: 600;
    letter-spacing: 0.04em !important;
    line-height: 1.2 !important;
    padding: 6px 16px !important;
    border: 1px solid rgba(184, 197, 208, 0.4) !important;
    border-top-color: rgba(200, 215, 230, 0.5) !important;
    border-bottom-color: rgba(100, 120, 140, 0.25) !important;
    border-radius: 50px;
    transition: all 0.3s ease;
    white-space: nowrap;
    cursor: pointer;
    overflow: hidden;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.5),
        0 0 14px rgba(74, 158, 255, 0.12),
        0 0 4px rgba(184, 197, 208, 0.08),
        inset 0 1px 1px rgba(255, 255, 255, 0.15),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    text-transform: none !important;
}
.landing-nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0, rgba(255, 255, 255, 0.5) 50%, transparent 100%);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}
.landing-nav-btn::after { content: none; }
.landing-nav-btn:hover {
    color: #fff !important;
    background: linear-gradient(180deg, #224a7e 0%, #14325a 40%, #0c2444 100%) !important;
    border-color: rgba(184, 197, 208, 0.6) !important;
    border-top-color: rgba(200, 215, 230, 0.7) !important;
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.5),
        0 0 16px rgba(74, 158, 255, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.2),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3) !important;
}
.landing-nav-btn:hover::before { opacity: 1; }
.landing-nav-btn:hover::after { left: 100%; }
.landing-nav-btn:active { transform: scale(0.95) !important; transition: transform 0.1s ease !important; }
.landing-nav-btn-login { margin-left: auto; }
.landing-nav-btn-apply { order: 5; }
.landing-nav-btn-apply.logged-in { margin-left: auto; transform: translateY(-2px); }
@media (max-width: 639px) {
    .landing-nav-btn-apply.logged-in { transform: translateY(1px); }
}
@media (min-width: 640px) {
    .landing-nav-btn { padding: 7px 22px !important; font-size: 13px !important; }
}

/* ═══ Grid-icon menu toggle ═══ */
.landing-grid-icon-btn {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(184, 197, 208, 0.2);
    background: transparent;
    overflow: hidden;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow:
        0 0 8px rgba(74, 158, 255, 0.15),
        0 0 18px rgba(74, 158, 255, 0.08),
        0 0 32px rgba(90, 200, 232, 0.04);
}
@media (min-width: 640px) {
    .landing-grid-icon-btn { width: 56px; height: 56px; transform: translateY(0); }
}
.landing-grid-icon-btn img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.landing-grid-icon-btn .landing-grid-icon-default { opacity: 1; }
.landing-grid-icon-btn .landing-grid-icon-hover { opacity: 0; }

/* ═══ Grid-icon dropdown menu ═══
 * Extracted from css/pages/landing.css so any page that renders the
 * landing navbar gets a working menu — pages like the legal docs load
 * only this component stylesheet, not all of landing.css. Fallback
 * values cover pages that don't define the --landing-* tokens. */
@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.landing-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 200px;
    background: var(--landing-bg-deep, #020e1f);
    border: 1px solid rgba(184, 197, 208, 0.15);
    border-radius: 4px;
    padding: 8px 0;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: menuFadeIn 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 100;
}

.landing-menu-dropdown::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0, var(--landing-silver, #E0E8F0) 50%, transparent 100%);
}

.landing-menu-item {
    display: block;
    padding: 10px 20px;
    color: var(--landing-silver, #E0E8F0);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    position: relative;
    transition: color 0.3s ease, background 0.3s ease, padding-left 0.3s ease;
}

.landing-menu-item:hover {
    color: var(--landing-fg, #ffffff);
    background: rgba(184, 197, 208, 0.05);
    padding-left: 24px;
    text-shadow: 0 0 8px rgba(224, 232, 240, 0.2);
}

.landing-menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 50%;
    background: var(--landing-silver, #E0E8F0);
    transition: width 0.3s ease;
}

.landing-menu-item:hover::before {
    width: 2px;
}

.landing-menu-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0, rgba(184, 197, 208, 0.2) 50%, transparent 100%);
    margin: 8px 0;
}

@media (max-width: 639px) {
    .landing-menu-dropdown {
        position: fixed;
        top: 78px;
        right: 0;
        left: 0;
        min-width: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}

/* ═══ Mobile: vertical-center nav items ═══ */
@media (max-width: 639px) {
    .landing-nav-login { transform: translateY(2px); }
    .landing-nav-brand { transform: translateY(4px) translateX(4px) !important; }
    .landing-grid-icon-btn { transform: translateY(4px) !important; }
}

/* ═══ MEMDEX brand text — electric shimmer on hover ═══
 * Extracted from css/effects.css so any page that renders the landing
 * navbar picks up the hover animation automatically — without having to
 * load all of effects.css just for this one selector. The .navbar-* half
 * of the original rule (dashboard navbar) stays in effects.css since it
 * only applies on authenticated pages that already load it. */
@keyframes memdexElectric {
    0%   { background-position: 100% center; filter: drop-shadow(0 0 8px rgba(74,158,255,.25)) drop-shadow(0 0 18px rgba(180,210,240,.1)); }
    50%  { filter: drop-shadow(0 0 16px rgba(100,170,255,.5)) drop-shadow(0 0 32px rgba(180,210,240,.2)); }
    100% { background-position: 0% center; filter: drop-shadow(0 0 8px rgba(74,158,255,.25)) drop-shadow(0 0 18px rgba(180,210,240,.1)); }
}
.landing-nav-brand-text { transition: letter-spacing .4s ease, filter .4s ease; }
.landing-nav-brand:hover .landing-nav-brand-text {
    background: linear-gradient(90deg,
        #C0D0E0 0%, #4A9EFF 20%, #B8CCE0 40%, #6EB4FF 60%, #D0DCE8 80%, #4A9EFF 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: memdexElectric 4.5s ease-in-out infinite alternate;
    letter-spacing: .22em;
}
@media (prefers-reduced-motion: reduce) {
    .landing-nav-brand:hover .landing-nav-brand-text { animation: none !important; }
}

/* ============================================
   THEME/ANIMATIONS TOGGLES: removed from the
   landing nav (Anthony 2026-07-13). Appearance
   controls live only in the dashboard account
   dropdown; the Login pill's own margin-left:
   auto (base rule above) leads the right
   cluster again.
   ============================================ */

/* ============================================
   LIGHT THEME (W1)
   The landing nav's translucent gradient and
   white brand text are designed for dark art
   pages; on theme-enabled light pages (auth,
   onboarding) the bar goes clean white.
   ============================================ */
html.theme-light .landing-nav {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: none;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: none;
}

html.theme-light .nav-edge-glow {
    display: none;
}

html.theme-light .landing-nav-brand-text {
    color: #0f172a;
    filter: none;
}

/* Light theme, nav pills: Sign up stays the bar's one dark accent — navy
   retuned for a white ground (ink border and flat gray shadow instead of
   the silver edge and glow that only work on navy). Login drops to a
   quiet light pill so the pair reads primary/secondary. !important is
   needed to outrank the base .landing-nav-btn declarations. */
html.theme-light .landing-nav-btn-apply {
    background: linear-gradient(180deg, #1e4a7e 0%, #16365e 55%, #102a4c 100%) !important;
    color: #ffffff !important;
    text-shadow: none;
    border: 1px solid rgba(8, 28, 56, 0.55) !important;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.18),
        0 3px 10px rgba(15, 23, 42, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
}

html.theme-light .landing-nav-btn-apply:hover {
    background: linear-gradient(180deg, #26568e 0%, #1c416e 55%, #16355c 100%) !important;
    border-color: rgba(8, 28, 56, 0.70) !important;
    box-shadow:
        0 2px 4px rgba(15, 23, 42, 0.20),
        0 5px 14px rgba(15, 23, 42, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
}

html.theme-light .landing-nav-btn-login {
    background: #ffffff !important;
    color: #0e2748 !important;
    text-shadow: none;
    border: 1px solid rgba(15, 23, 42, 0.22) !important;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.06),
        0 2px 8px rgba(15, 23, 42, 0.06) !important;
}

/* Top-sheen line is a dark-pill highlight; hide it on the light pill. */
html.theme-light .landing-nav-btn-login::before {
    background: none;
    opacity: 0;
}

html.theme-light .landing-nav-btn-login:hover {
    background: #f1f5f9 !important;
    color: #081c38 !important;
    border-color: rgba(15, 23, 42, 0.38) !important;
    box-shadow:
        0 1px 3px rgba(15, 23, 42, 0.08),
        0 3px 10px rgba(15, 23, 42, 0.08) !important;
}

/* Dropdown menu panel: dark glass flips to a white card. */
html.theme-light .landing-menu-dropdown {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.10);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

html.theme-light .landing-menu-item {
    color: #334155;
}

html.theme-light .landing-menu-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

html.theme-light .landing-menu-divider {
    background: rgba(15, 23, 42, 0.08);
}
