/* Portal deep link — hide wrong tabs / orbit hub before App Launch panel is ready */

html.mg-portal-deeplink-boot .tab-content:not(#tab-content-portal) {
    display: none !important;
}

html.mg-portal-deeplink-boot #tab-content-portal {
    display: block !important;
}

/* Albums / song deep link — hide About before app.js switches tabs */
html.mg-albums-deeplink-boot .tab-content:not(#tab-content-albums) {
    display: none !important;
}

html.mg-albums-deeplink-boot #tab-content-albums {
    display: block !important;
}

html.mg-albums-deeplink-boot #about-sidebar {
    display: none !important;
}

html.mg-albums-deeplink-boot #albums-sidebar {
    display: flex !important;
}

html.mg-albums-deeplink-boot .app-shell {
    grid-template-columns: 300px 1fr;
}

html.mg-portal-deeplink-boot #mg-landing-portal-host:empty {
    min-height: min(70vh, 640px);
}

#mg-landing-portal.mg-landing-portal--deeplink-pending .mg-landing-orbit,
#mg-landing-portal.mg-landing-portal--deeplink-pending .mg-landing-center,
html.mg-portal-deeplink-boot #mg-landing-portal:not(.mg-landing-portal--panel-open) .mg-landing-orbit,
html.mg-portal-deeplink-boot #mg-landing-portal:not(.mg-landing-portal--panel-open) .mg-landing-center {
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
}

/* Matthew Garrison — circle hub landing portal (test variants) */

#mg-landing-portal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #050506;
    color: #f5f5f7;
    font-family: 'Inter', system-ui, sans-serif;
    --hub-orbit-radius: min(39vw, 280px);
}

#mg-landing-portal.is-active {
    display: flex;
}

/* Embedded in Portal tab */
.mg-landing-portal-host {
    position: relative;
    width: 100%;
    min-height: min(82vh, 720px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 32px;
    box-sizing: border-box;
}

#mg-landing-portal.mg-landing-portal--embedded {
    position: relative;
    inset: auto;
    z-index: 1;
    width: 100%;
    min-height: min(78vh, 680px);
    background: transparent;
    overflow: visible;
}

#mg-landing-portal.mg-landing-portal--embedded .mg-landing-inner {
    width: min(92vw, 720px);
    height: min(78vh, 680px);
}

#mg-landing-portal.mg-landing-portal--embedded[data-variant="orbit-minimal"] {
    background: transparent;
    color: inherit;
}

[data-theme="dark"] #mg-landing-portal.mg-landing-portal--embedded[data-variant="orbit-minimal"] {
    background: transparent;
}

[data-theme="light"] .mg-landing-portal-host #mg-landing-portal.mg-landing-portal--embedded[data-variant="orbit-minimal"] .mg-landing-title,
[data-theme="light"] #mg-landing-portal.mg-landing-portal--embedded[data-variant="orbit-minimal"] .mg-landing-skip {
    color: rgba(0, 0, 0, 0.45);
}

.tab-content-portal {
    padding: 0;
    overflow: hidden;
}

#mg-landing-portal .mg-landing-inner {
    position: relative;
    width: min(92vw, 720px);
    height: min(92vh, 720px);
    display: flex;
    align-items: center;
    justify-content: center;
}

#mg-landing-portal .mg-landing-center {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
}

#mg-landing-portal .mg-landing-logo-wrap {
    position: relative;
    /* Perfect circle — equal width/height, no stretch from flex parents */
    width: clamp(168px, 36vw, 252px);
    height: clamp(168px, 36vw, 252px);
    min-width: clamp(168px, 36vw, 252px);
    min-height: clamp(168px, 36vw, 252px);
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
    border: 3px solid rgba(255, 255, 255, 0.12);
    background: #111;
}

#mg-landing-portal .mg-landing-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Anchor lower so Matthew + bass in frame (portrait has bass in lower third) */
    object-position: center 46%;
    display: block;
}

#mg-landing-portal .mg-landing-title {
    position: static;
    transform: none;
    white-space: nowrap;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    pointer-events: none;
}

#mg-landing-portal .mg-landing-orbit {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

#mg-landing-portal .mg-landing-orbit-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(78vw, 560px);
    height: min(78vw, 560px);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid rgba(153, 102, 255, 0.22);
    pointer-events: none;
}

#mg-landing-portal .mg-landing-hub-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    transform: rotate(var(--hub-angle)) translateY(calc(-1 * var(--hub-orbit-radius))) rotate(calc(-1 * var(--hub-angle))) translate(-50%, -50%);
    border: none;
    border-radius: 0;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    color: inherit;
    box-shadow: none;
    font: inherit;
    transition: transform 0.2s ease, color 0.2s ease;
}

#mg-landing-portal .mg-landing-hub-btn-face {
    width: clamp(56px, 11vw, 72px);
    height: clamp(56px, 11vw, 72px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(18, 18, 22, 0.92);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

#mg-landing-portal .mg-landing-hub-btn-face i {
    font-size: 1.15rem;
    opacity: 0.95;
}

#mg-landing-portal .mg-landing-hub-btn-face .mg-landing-hub-svg {
    width: 1.15rem;
    height: 1.15rem;
    display: block;
    opacity: 0.95;
}

#mg-landing-portal .mg-landing-hub-btn-label {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.15;
    white-space: nowrap;
    opacity: 0.78;
    transition: opacity 0.2s ease, color 0.2s ease;
}

#mg-landing-portal .mg-landing-hub-btn--public .mg-landing-hub-btn-face {
    border-color: rgba(61, 214, 176, 0.75);
    box-shadow: 0 0 18px rgba(61, 214, 176, 0.22);
}
#mg-landing-portal .mg-landing-hub-btn--public .mg-landing-hub-btn-label,
#mg-landing-portal .mg-landing-hub-btn--public .mg-landing-hub-btn-face {
    color: #6eecc9;
}

#mg-landing-portal .mg-landing-hub-btn--app-only .mg-landing-hub-btn-face {
    border-color: rgba(125, 211, 252, 0.8);
    box-shadow: 0 0 18px rgba(125, 211, 252, 0.2);
}
#mg-landing-portal .mg-landing-hub-btn--app-only .mg-landing-hub-btn-label,
#mg-landing-portal .mg-landing-hub-btn--app-only .mg-landing-hub-btn-face {
    color: #7dd3fc;
}

#mg-landing-portal .mg-landing-hub-btn--hidden .mg-landing-hub-btn-face {
    border-color: rgba(245, 185, 66, 0.85);
    border-style: dashed;
    box-shadow: 0 0 18px rgba(245, 185, 66, 0.18);
}
#mg-landing-portal .mg-landing-hub-btn--hidden .mg-landing-hub-btn-label,
#mg-landing-portal .mg-landing-hub-btn--hidden .mg-landing-hub-btn-face {
    color: #f5b942;
}

#mg-landing-portal .mg-landing-hub-btn--admin .mg-landing-hub-btn-face {
    border-color: rgba(153, 102, 255, 0.75);
    box-shadow: 0 0 18px rgba(153, 102, 255, 0.22);
}
#mg-landing-portal .mg-landing-hub-btn--admin .mg-landing-hub-btn-label,
#mg-landing-portal .mg-landing-hub-btn--admin .mg-landing-hub-btn-face {
    color: #c4b5fd;
}

.mg-landing-admin-legend {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 14px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(12, 12, 16, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    pointer-events: none;
}

.mg-landing-admin-legend-item::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 5px;
    border-radius: 50%;
    vertical-align: middle;
    background: currentColor;
}

.mg-landing-admin-legend-item.is-public { color: #6eecc9; }
.mg-landing-admin-legend-item.is-app-only { color: #7dd3fc; }
.mg-landing-admin-legend-item.is-hidden { color: #f5b942; }
.mg-landing-admin-legend-item.is-admin { color: #c4b5fd; }

#mg-landing-portal .mg-landing-hub-btn:hover .mg-landing-hub-btn-face,
#mg-landing-portal .mg-landing-hub-btn:focus-visible .mg-landing-hub-btn-face {
    background: rgba(153, 102, 255, 0.28);
    border-color: rgba(153, 102, 255, 0.65);
    box-shadow: 0 12px 40px rgba(153, 102, 255, 0.25);
    outline: none;
}

#mg-landing-portal .mg-landing-hub-btn--public:hover .mg-landing-hub-btn-face,
#mg-landing-portal .mg-landing-hub-btn--public:focus-visible .mg-landing-hub-btn-face {
    background: rgba(61, 214, 176, 0.28);
    border-color: rgba(61, 214, 176, 0.9);
    box-shadow: 0 12px 40px rgba(61, 214, 176, 0.28);
}
#mg-landing-portal .mg-landing-hub-btn--app-only:hover .mg-landing-hub-btn-face,
#mg-landing-portal .mg-landing-hub-btn--app-only:focus-visible .mg-landing-hub-btn-face {
    background: rgba(125, 211, 252, 0.24);
    border-color: rgba(125, 211, 252, 0.95);
    box-shadow: 0 12px 40px rgba(125, 211, 252, 0.25);
}
#mg-landing-portal .mg-landing-hub-btn--hidden:hover .mg-landing-hub-btn-face,
#mg-landing-portal .mg-landing-hub-btn--hidden:focus-visible .mg-landing-hub-btn-face {
    background: rgba(245, 185, 66, 0.24);
    border-color: rgba(245, 185, 66, 0.95);
    box-shadow: 0 12px 40px rgba(245, 185, 66, 0.25);
}
#mg-landing-portal .mg-landing-hub-btn--admin:hover .mg-landing-hub-btn-face,
#mg-landing-portal .mg-landing-hub-btn--admin:focus-visible .mg-landing-hub-btn-face {
    background: rgba(153, 102, 255, 0.28);
    border-color: rgba(153, 102, 255, 0.9);
    box-shadow: 0 12px 40px rgba(153, 102, 255, 0.28);
}

#mg-landing-portal .mg-landing-hub-btn:hover .mg-landing-hub-btn-label,
#mg-landing-portal .mg-landing-hub-btn:focus-visible .mg-landing-hub-btn-label {
    opacity: 1;
}

#mg-landing-portal .mg-landing-hub-btn:focus-visible {
    outline: none;
}

#mg-landing-portal .mg-landing-skip {
    position: absolute;
    bottom: max(1rem, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 8px 16px;
    z-index: 3;
}

#mg-landing-portal .mg-landing-skip:hover {
    color: rgba(255, 255, 255, 0.8);
}

#mg-landing-portal .mg-landing-admin-badge {
    position: absolute;
    top: max(1rem, env(safe-area-inset-top));
    right: 1rem;
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(249, 115, 22, 0.2);
    color: #fdba74;
    border: 1px solid rgba(249, 115, 22, 0.35);
    z-index: 3;
}

/* Portal follows site theme when cycling from the toolbar */
[data-theme="light"] #mg-landing-portal {
    background: #f7f7f8;
    color: #111;
}

[data-theme="dark"] #mg-landing-portal:not([data-variant="orbit-glow"]) {
    background: #050506;
    color: #f5f5f7;
}

/* Variant: orbit-glow — stronger purple ambient */
#mg-landing-portal[data-variant="orbit-glow"] {
    background: radial-gradient(circle at 50% 40%, rgba(88, 40, 180, 0.35), #050506 62%);
}

#mg-landing-portal[data-variant="orbit-glow"] .mg-landing-logo-wrap {
    border-color: rgba(153, 102, 255, 0.45);
    box-shadow: 0 0 60px rgba(153, 102, 255, 0.35), 0 24px 80px rgba(0, 0, 0, 0.55);
}

#mg-landing-portal[data-variant="orbit-glow"] .mg-landing-orbit-ring {
    border-color: rgba(153, 102, 255, 0.45);
    box-shadow: 0 0 40px rgba(153, 102, 255, 0.12);
}

#mg-landing-portal[data-variant="orbit-glow"] .mg-landing-hub-btn:hover .mg-landing-hub-btn-face {
    box-shadow: 0 0 28px rgba(153, 102, 255, 0.45);
}

/* Variant: orbit-minimal — light, thin ring, icon-forward */
#mg-landing-portal[data-variant="orbit-minimal"] {
    background: #f7f7f8;
    color: #111;
}

#mg-landing-portal[data-variant="orbit-minimal"] .mg-landing-logo-wrap {
    border: 2px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] #mg-landing-portal .mg-landing-title,
[data-theme="light"] #mg-landing-portal[data-variant="orbit-minimal"] .mg-landing-title {
    color: rgba(0, 0, 0, 0.45);
}

[data-theme="light"] #mg-landing-portal .mg-landing-skip,
[data-theme="light"] #mg-landing-portal[data-variant="orbit-minimal"] .mg-landing-skip {
    color: rgba(0, 0, 0, 0.45);
}

[data-theme="light"] #mg-landing-portal .mg-landing-skip:hover {
    color: #111;
}

[data-theme="light"] #mg-landing-portal .mg-landing-orbit-ring {
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] #mg-landing-portal .mg-landing-hub-btn-face {
    background: #fff;
    color: #111;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] #mg-landing-portal .mg-landing-hub-btn:hover,
[data-theme="light"] #mg-landing-portal .mg-landing-hub-btn:focus-visible {
    color: #fff;
}

[data-theme="light"] #mg-landing-portal .mg-landing-hub-btn:hover .mg-landing-hub-btn-face,
[data-theme="light"] #mg-landing-portal .mg-landing-hub-btn:focus-visible .mg-landing-hub-btn-face {
    background: #111;
    color: #fff;
    border-color: #111;
}

[data-theme="dark"] #mg-landing-portal .mg-landing-title {
    color: rgba(255, 255, 255, 0.55);
}

[data-theme="dark"] #mg-landing-portal .mg-landing-orbit-ring {
    border-color: rgba(153, 102, 255, 0.22);
}

[data-theme="dark"] #mg-landing-portal .mg-landing-hub-btn-face,
[data-theme="dark"] #mg-landing-portal[data-variant="orbit-minimal"] .mg-landing-hub-btn-face {
    background: rgba(18, 18, 22, 0.92);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] #mg-landing-portal .mg-landing-hub-btn:hover .mg-landing-hub-btn-face,
[data-theme="dark"] #mg-landing-portal .mg-landing-hub-btn:focus-visible .mg-landing-hub-btn-face,
[data-theme="dark"] #mg-landing-portal[data-variant="orbit-minimal"] .mg-landing-hub-btn:hover .mg-landing-hub-btn-face,
[data-theme="dark"] #mg-landing-portal[data-variant="orbit-minimal"] .mg-landing-hub-btn:focus-visible .mg-landing-hub-btn-face {
    background: rgba(153, 102, 255, 0.28);
    border-color: rgba(153, 102, 255, 0.65);
}

[data-theme="dark"] #mg-landing-portal .mg-landing-skip,
[data-theme="dark"] #mg-landing-portal[data-variant="orbit-minimal"] .mg-landing-skip {
    color: rgba(255, 255, 255, 0.45);
}

#mg-landing-portal[data-variant="orbit-minimal"] .mg-landing-orbit-ring {
    border-color: rgba(0, 0, 0, 0.1);
}

#mg-landing-portal[data-variant="orbit-minimal"] .mg-landing-hub-btn-face {
    background: #fff;
    color: #111;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

#mg-landing-portal[data-variant="orbit-minimal"] .mg-landing-hub-btn-face i {
    font-size: 1.35rem;
}

#mg-landing-portal[data-variant="orbit-minimal"] .mg-landing-hub-btn-face .mg-landing-hub-svg {
    width: 1.35rem;
    height: 1.35rem;
}

#mg-landing-portal[data-variant="orbit-minimal"] .mg-landing-hub-btn:hover,
#mg-landing-portal[data-variant="orbit-minimal"] .mg-landing-hub-btn:focus-visible {
    color: #fff;
}

#mg-landing-portal[data-variant="orbit-minimal"] .mg-landing-hub-btn:hover .mg-landing-hub-btn-face,
#mg-landing-portal[data-variant="orbit-minimal"] .mg-landing-hub-btn:focus-visible .mg-landing-hub-btn-face {
    background: #111;
    color: #fff;
    border-color: #111;
}

#mg-landing-portal[data-variant="orbit-minimal"] .mg-landing-skip {
    color: rgba(0, 0, 0, 0.45);
}

#mg-landing-portal[data-variant="orbit-minimal"] .mg-landing-skip:hover {
    color: #111;
}

body.mg-landing-active .navbar,
body.mg-landing-active .app-shell,
body.mg-landing-active #catalog-unavailable-banner {
    visibility: hidden;
}

body.mg-landing-revealing .navbar,
body.mg-landing-revealing .app-shell,
body.mg-landing-revealing #catalog-unavailable-banner {
    visibility: visible;
    opacity: 0;
    animation: mg-landing-site-in 0.48s cubic-bezier(0.22, 1, 0.36, 1) 0.08s forwards;
}

#mg-landing-portal.is-exiting {
    pointer-events: none;
    animation: mg-landing-portal-out 0.52s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

#mg-landing-portal.is-exiting .mg-landing-inner {
    animation: mg-landing-hub-out 0.52s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

#mg-landing-portal.is-exiting .mg-landing-hub-btn:not(.is-target) {
    opacity: 0;
    transform: rotate(var(--hub-angle)) translateY(calc(-1 * var(--hub-orbit-radius))) rotate(calc(-1 * var(--hub-angle))) translate(-50%, -50%) scale(0.85);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

#mg-landing-portal.is-exiting .mg-landing-hub-btn.is-target {
    animation: mg-landing-target-pulse 0.52s ease forwards;
}

#mg-landing-portal.is-exiting .mg-landing-orbit-ring {
    animation: mg-landing-ring-out 0.52s ease forwards;
}

@keyframes mg-landing-portal-out {
    to {
        opacity: 0;
        backdrop-filter: blur(0);
    }
}

@keyframes mg-landing-hub-out {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.08);
        opacity: 0;
    }
}

@keyframes mg-landing-ring-out {
    to {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 0;
    }
}

@keyframes mg-landing-target-pulse {
    0% { transform: rotate(var(--hub-angle)) translateY(calc(-1 * var(--hub-orbit-radius))) rotate(calc(-1 * var(--hub-angle))) translate(-50%, -50%) scale(1); }
    40% { transform: rotate(var(--hub-angle)) translateY(calc(-1 * var(--hub-orbit-radius))) rotate(calc(-1 * var(--hub-angle))) translate(-50%, -50%) scale(1.12); }
    100% { transform: rotate(var(--hub-angle)) translateY(calc(-1 * var(--hub-orbit-radius))) rotate(calc(-1 * var(--hub-angle))) translate(-50%, -50%) scale(0.9); opacity: 0; }
}

@keyframes mg-landing-site-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    #mg-landing-portal.is-exiting,
    #mg-landing-portal.is-exiting .mg-landing-inner,
    #mg-landing-portal.is-exiting .mg-landing-orbit-ring,
    #mg-landing-portal.is-exiting .mg-landing-hub-btn.is-target,
    body.mg-landing-revealing .navbar,
    body.mg-landing-revealing .app-shell,
    body.mg-landing-revealing #catalog-unavailable-banner {
        animation: none;
        transition: none;
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 520px) {
    #mg-landing-portal {
        --hub-orbit-radius: min(42vw, 240px);
    }

    #mg-landing-portal .mg-landing-hub-btn-face {
        width: 52px;
        height: 52px;
    }

    #mg-landing-portal .mg-landing-hub-btn-face i {
        font-size: 1rem;
    }

    #mg-landing-portal .mg-landing-hub-btn-label {
        font-size: 0.52rem;
    }
}
