/* =========================================================================
   StarX Studio - global chrome (navbar, mobile menu, profile dropdown).
   Extracted out of views/partials/header.ejs during the site rework.

   Palette rule: the brand accent is the logo's amber #fbb21d, used flat for
   interface state. The logo gradient (#fdca10 -> #f2873f -> #ea403a) is the
   signature and belongs to the primary action and the featured block only -
   it never appears in the chrome.
   ========================================================================= */

.site-chrome {
    font-family: 'Poppins', ui-sans-serif, system-ui, sans-serif;

    --nav-pill-radius: 9999px;
    --nav-shell-padding: 0.375rem;
    --nav-height: 72px;

    --chrome-accent: #fbb21d;
    --chrome-accent-bright: #ffe82f;
    --chrome-accent-pale: #fde3a6;
    --chrome-accent-a10: rgba(251, 178, 29, 0.1);
    --chrome-accent-a18: rgba(251, 178, 29, 0.18);
    --chrome-accent-a22: rgba(251, 178, 29, 0.22);
    --chrome-accent-a28: rgba(251, 178, 29, 0.28);
    --chrome-accent-a50: rgba(251, 178, 29, 0.5);
    --chrome-accent-a70: rgba(251, 178, 29, 0.7);
    --chrome-deep-a50: rgba(242, 135, 63, 0.5);
    --chrome-deep-a70: rgba(242, 135, 63, 0.7);

    --chrome-shell: rgba(8, 8, 12, 0.94);
    --chrome-hairline: rgba(255, 255, 255, 0.06);
    --chrome-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Scrollbar -------------------------------------------------------- */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #1f1f1f;
}

::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 6px;
    border: 2px solid #1f1f1f;
}

::-webkit-scrollbar-thumb:hover {
    background: #888;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #555 #1f1f1f;
}

/* ---- Navbar shell ------------------------------------------------------
   Two states: `--expanded` at the top of the page (full-width bar) and
   `--compact` once scrolled (a centered floating pill).
   ------------------------------------------------------------------------ */

#navbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    height: var(--nav-height);
    pointer-events: none;
    transition: background 0.75s var(--chrome-ease),
        box-shadow 0.75s var(--chrome-ease),
        border-color 0.75s var(--chrome-ease),
        backdrop-filter 0.75s ease;
}

#navbar.navbar--expanded {
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.82) 0%, rgba(10, 10, 15, 0.55) 100%);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 1px solid var(--chrome-hairline);
    box-shadow: 0 1px 0 var(--chrome-accent-a10);
}

#navbar.navbar--compact {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom-color: transparent;
    box-shadow: none;
    height: auto;
    overflow: visible;
    pointer-events: none;
}

#navbar.navbar--compact .navbar__inner {
    pointer-events: none;
    overflow: visible;
}

#navbar.navbar--solid.navbar--expanded {
    background: rgba(8, 8, 12, 0.97);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.navbar__inner {
    position: relative;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    pointer-events: auto;
}

@media (min-width: 1024px) {
    .navbar__inner { padding: 0 2rem; }
}

/* ---- Logo (collapses away in the compact state) ----------------------- */

.navbar__logo {
    position: relative;
    z-index: 1003;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    overflow: hidden;
    max-width: 180px;
    opacity: 1;
    transform: translateX(0);
    cursor: pointer;
    pointer-events: auto;
    text-decoration: none;
    transition: max-width 0.75s var(--chrome-ease) 0.12s,
        opacity 0.65s ease 0.18s,
        transform 0.75s var(--chrome-ease) 0.12s,
        margin 0.75s var(--chrome-ease) 0.12s;
}

#navbar.navbar--compact .navbar__logo {
    max-width: 0;
    opacity: 0;
    transform: translateX(-12px);
    margin-right: 0;
    pointer-events: none;
    transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease,
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        margin 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Floating nav container ------------------------------------------- */

.navbar__float {
    position: fixed;
    z-index: 1002;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    pointer-events: auto;
}

#navbar.navbar--expanded .navbar__float {
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    justify-content: flex-end;
    padding: 0 1.25rem 0 11.5rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    animation: none;
    pointer-events: auto;
    transition: top 0.8s var(--chrome-ease),
        padding 0.8s var(--chrome-ease),
        height 0.8s var(--chrome-ease),
        border-radius 0.8s var(--chrome-ease),
        background 0.8s ease,
        border-color 0.8s ease,
        box-shadow 0.8s ease,
        opacity 0.8s ease;
}

@media (min-width: 1024px) {
    #navbar.navbar--expanded .navbar__float {
        padding: 0 2rem 0 12.5rem;
    }
}

#navbar.navbar--compact .navbar__float {
    top: 0.75rem;
    left: 50%;
    right: auto;
    height: auto;
    transform: translateX(-50%);
    padding: var(--nav-shell-padding) calc(var(--nav-shell-padding) + 0.125rem) var(--nav-shell-padding) var(--nav-shell-padding);
    gap: 0.25rem;
    background: var(--chrome-shell);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid var(--chrome-accent-a18);
    border-radius: var(--nav-pill-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04);
    pointer-events: auto;
    overflow: visible;
    isolation: isolate;
    transition: none;
    animation: navbarFloatIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

#navbar.navbar--compact .navbar__actions {
    position: relative;
    z-index: 3;
    margin-left: 0.125rem;
    pointer-events: auto;
}

#navbar.navbar--compact .nav-link {
    padding: 0.45rem 0.95rem;
}

/* ---- Expand / collapse transitions ------------------------------------ */

@keyframes navbarFloatIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-28px) scale(0.94); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes navbarBarExpand {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes navbarExpandFloat {
    from { opacity: 0.88; transform: translateY(-26px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes navbarActionsIn {
    from { opacity: 0; transform: translateY(-50%) translateY(-8px); }
    to   { opacity: 1; transform: translateY(-50%) translateY(0); }
}

#navbar.navbar--revealing {
    animation: navbarBarExpand 0.8s var(--chrome-ease) both;
}

#navbar.navbar--revealing .navbar__float {
    top: 0;
    left: 0;
    right: 0;
    transform: none;
    justify-content: center;
    animation: navbarExpandFloat 0.8s var(--chrome-ease) both;
    transition: padding 0.8s var(--chrome-ease),
        height 0.8s var(--chrome-ease),
        border-radius 0.8s var(--chrome-ease),
        background 0.8s ease,
        border-color 0.8s ease,
        box-shadow 0.8s ease;
}

#navbar.navbar--revealing .navbar__nav {
    position: static;
    transform: none;
    transition: none;
}

#navbar.navbar--revealing .navbar__actions {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    animation: navbarActionsIn 0.45s ease 0.45s forwards;
}

@media (min-width: 1024px) {
    #navbar.navbar--revealing .navbar__actions { right: 2rem; }
}

/* ---- Nav lists -------------------------------------------------------- */

.navbar__nav {
    display: none;
    align-items: center;
    gap: 0.15rem;
}

@media (min-width: 768px) {
    .navbar__nav { display: flex; }
}

#navbar.navbar--expanded .navbar__nav {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.8s ease;
    pointer-events: none;
}

#navbar.navbar--expanded .navbar__nav .nav-link,
#navbar.navbar--expanded .navbar__nav button.nav-link {
    pointer-events: auto;
}

#navbar.navbar--compact .navbar__nav {
    position: static;
    transform: none;
    transition: none;
}

.navbar__actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    pointer-events: auto;
    transition: none;
}

/* ---- Nav links -------------------------------------------------------- */

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--nav-pill-radius);
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: rgb(203, 213, 225);
    border: 1px solid transparent;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--chrome-hairline);
}

.nav-link--active {
    color: var(--chrome-accent);
    background: var(--chrome-accent-a10);
    border-color: var(--chrome-accent-a28);
    box-shadow: 0 0 16px rgba(251, 178, 29, 0.12);
}

.nav-link--active .nav-link__icon {
    background: var(--chrome-accent-a22);
    color: var(--chrome-accent-bright);
}

.nav-link__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: var(--nav-pill-radius);
    background: rgba(255, 255, 255, 0.04);
    color: rgb(148, 163, 184);
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover .nav-link__icon {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-link__icon svg { width: 1rem; height: 1rem; }
.nav-link__icon i   { font-size: 0.8125rem; line-height: 1; }

/* ---- Mobile menu ------------------------------------------------------ */

#mobileMenu { top: var(--nav-height); }
body.navbar-compact #mobileMenu { top: 4.5rem; }

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.125rem;
    border-radius: var(--nav-pill-radius);
    color: rgb(226, 232, 240);
    border: 1px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.mobile-nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--chrome-hairline);
}

.mobile-nav-link--active {
    color: var(--chrome-accent);
    background: var(--chrome-accent-a10);
    border-color: var(--chrome-accent-a28);
}

.mobile-nav-link--active .nav-link__icon {
    background: var(--chrome-accent-a22);
    color: var(--chrome-accent-bright);
}

/* ---- Profile button + dropdown ----------------------------------------
   Only rendered while the accounts feature flag is on.
   ------------------------------------------------------------------------ */

.nav-profile-btn {
    padding: 2px;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--chrome-accent-a50), var(--chrome-deep-a50));
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    position: relative;
    z-index: 2;
    pointer-events: auto;
    cursor: pointer;
}

#navbar.navbar--compact .nav-profile-btn {
    z-index: 4;
}

.nav-profile-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, var(--chrome-accent-a70), var(--chrome-deep-a70));
    box-shadow: 0 0 20px var(--chrome-accent-a28);
}

.nav-profile-btn img {
    width: 42px;
    height: 42px;
    border-radius: 9999px;
    object-fit: cover;
    border: 2px solid rgb(10, 10, 15);
}

.profile-dropdown {
    position: fixed;
    z-index: 1003;
    width: 17.5rem;
    padding: 0.375rem;
    border-radius: 1.125rem;
    background: rgba(8, 8, 12, 0.96);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(251, 178, 29, 0.2);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s var(--chrome-ease);
}

.profile-dropdown.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.profile-dropdown__header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem;
    border-radius: 0.875rem;
    background: linear-gradient(135deg, rgba(251, 178, 29, 0.08), rgba(242, 135, 63, 0.04));
    border: 1px solid rgba(251, 178, 29, 0.12);
}

.profile-dropdown__avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(251, 178, 29, 0.65), rgba(242, 135, 63, 0.65));
    flex-shrink: 0;
}

.profile-dropdown__avatar img {
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    object-fit: cover;
    border: 2px solid rgb(8, 8, 12);
}

.profile-dropdown__info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.profile-dropdown__name {
    color: #fff;
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-dropdown__handle {
    color: rgb(148, 163, 184);
    font-size: 0.75rem;
}

.profile-dropdown__status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--chrome-accent);
    font-size: 0.6875rem;
    font-weight: 500;
    margin-top: 0.125rem;
}

.profile-dropdown__status-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 9999px;
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.7);
}

.profile-dropdown__body {
    padding: 0.625rem 0.375rem 0.375rem;
}

.profile-dropdown__label {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(251, 178, 29, 0.75);
    padding: 0 0.625rem 0.375rem;
}

.profile-dropdown__item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: 9999px;
    color: rgb(203, 213, 225);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.profile-dropdown__item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--chrome-hairline);
}

.profile-dropdown__item-icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(251, 178, 29, 0.12);
    color: var(--chrome-accent);
    font-size: 0.75rem;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.profile-dropdown__item:hover .profile-dropdown__item-icon {
    background: var(--chrome-accent-a22);
    color: var(--chrome-accent-bright);
}

.profile-dropdown__footer {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.375rem;
    border-top: 1px solid var(--chrome-hairline);
    margin-top: 0.125rem;
}

.profile-dropdown__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.profile-dropdown__btn:hover { transform: translateY(-1px); }

.profile-dropdown__btn--secondary {
    color: var(--chrome-accent-pale);
    background: var(--chrome-accent-a10);
    border-color: var(--chrome-accent-a22);
}

.profile-dropdown__btn--secondary:hover {
    color: #fff;
    background: var(--chrome-accent-a18);
    border-color: rgba(251, 178, 29, 0.35);
}

.profile-dropdown__btn--danger {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.22);
}

.profile-dropdown__btn--danger:hover {
    color: #fff;
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.35);
}

/* ---- Footer ------------------------------------------------------------ */

.site-footer {
    background: var(--color-starx-abyss, #0a0a0a);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.site-footer__link {
    color: rgb(154, 160, 171);
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.site-footer__link:hover {
    color: #fbb21d;
}

.site-footer__social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: rgb(154, 160, 171);
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.site-footer__social:hover {
    color: #fff;
    background: rgba(251, 178, 29, 0.14);
    border-color: rgba(251, 178, 29, 0.3);
    transform: translateY(-2px);
}

.site-footer__heading {
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {

    #navbar,
    #navbar * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
