/*
 * landing/css/topbar.css
 *
 * Floating sticky pill header. Always visible at the top of the
 * viewport, centered horizontally. Contains:
 *   - brand (owl + STRIX wordmark) on the left
 *   - navigation links in the middle (desktop only)
 *   - GitHub star badge on the right (star count injected by JS)
 *
 * Glass morphism — backdrop-filter blurs whatever drifts behind
 * (blobs) so the topbar feels like "frosted glass" floating above
 * the content.
 */

.topbar {
    position: fixed;
    top: max(1rem, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.5rem 0.75rem 0.5rem 1rem;
    background: rgba(16, 16, 24, 0.55);
    border: 1px solid rgba(var(--purple-1), 0.18);
    border-radius: 999px;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    animation: topbarIn 0.6s ease-out 0.1s both;
}

@keyframes topbarIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Brand group — owl + wordmark */
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
    padding: 0 0.25rem;
}

.topbar-brand svg {
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 2px 6px rgba(var(--purple-1), 0.4));
}

.topbar-wordmark {
    font-weight: 700;
    font-size: 0.9375rem;
    letter-spacing: 0.1em;
    color: #ffffff;
}

/* Navigation links (desktop only) */
.topbar-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.topbar-nav a {
    display: inline-block;
    padding: 0.5rem 0.875rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.75);
    transition: color 150ms ease, background 150ms ease;
}

.topbar-nav a:hover {
    color: #ffffff;
    background: rgba(var(--purple-1), 0.12);
}

/* Persistent Install action — filled purple pill, always visible
   (desktop and mobile). Sits between the nav and the star badge on
   desktop; on mobile it's the only right-side anchor point for
   "just get me to install" users. */
.topbar-install {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.95rem;
    background: linear-gradient(135deg,
        rgba(var(--purple-1), 1),
        rgba(var(--purple-2), 1));
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(var(--purple-1), 0.35);
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.topbar-install:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--purple-1), 0.5);
}

.topbar-install:active { transform: translateY(0); }

/* GitHub star badge. Count is injected at runtime by github-stars.js.
   Falls back to placeholder "—" if the API call fails. */
.topbar-star {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    background: rgba(var(--purple-1), 0.18);
    border: 1px solid rgba(var(--purple-1), 0.32);
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.topbar-star:hover {
    background: rgba(var(--purple-1), 0.28);
    border-color: rgba(var(--purple-1), 0.5);
    transform: translateY(-1px);
}

.topbar-star svg {
    width: 14px;
    height: 14px;
    color: rgba(var(--purple-3), 1);
}

.topbar-star-count {
    font-variant-numeric: tabular-nums;
    min-width: 1.5ch;
    display: inline-block;
    text-align: left;
}

/* Mobile — strip the centered navigation links and tighten spacing.
   Brand and star badge remain visible. */
@media (max-width: 767px) {
    .topbar {
        gap: 0.625rem;
        padding: 0.4rem 0.6rem 0.4rem 0.75rem;
        top: max(0.75rem, env(safe-area-inset-top));
    }
    .topbar-nav { display: none; }
    .topbar-wordmark { font-size: 0.875rem; }
    .topbar-brand svg { width: 22px; height: 22px; }
    .topbar-install {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
}
