/* =========================================================
   UTP Workspace Mark v1.1
   Shared identity component for Mission Control and headers.
   ========================================================= */

.utp-workspace-mark {
    position: relative;
    display: block;
    padding: 0;
    margin: 0;

    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;

    background:
        radial-gradient(
            circle at 50% 42%,
            rgba(255, 255, 255, 0.075),
            transparent 58%
        ),
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.085),
            rgba(255, 255, 255, 0.018)
        ),
        rgba(7, 15, 29, 0.66);

    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);

    box-shadow:
        0 28px 80px rgba(0, 0, 0, 0.40),
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(255, 255, 255, 0.035),
        0 0 0 1px rgba(245, 121, 59, 0.055);

    overflow: hidden;
    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;

    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        background 0.22s ease,
        box-shadow 0.22s ease;
}

.utp-workspace-mark:hover,
.utp-workspace-mark:focus-visible,
.utp-workspace-mark[aria-expanded="true"] {
    border-color: rgba(245, 121, 59, 0.64);

    background:
        linear-gradient(
            145deg,
            rgba(245, 121, 59, 0.13),
            rgba(255, 255, 255, 0.035)
        ),
        rgba(7, 15, 29, 0.70);

    box-shadow:
        0 34px 90px rgba(0, 0, 0, 0.44),
        0 0 42px rgba(245, 121, 59, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.utp-workspace-mark:focus-visible {
    outline: 2px solid rgba(245, 121, 59, 0.92);
    outline-offset: 5px;
}

.utp-workspace-mark__grid {
    display: grid;
    width: 100%;
    height: 100%;

    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
}

.utp-workspace-mark__cell {
    position: relative;

    background:
        radial-gradient(
            circle at center,
            rgba(255, 255, 255, 0.07),
            rgba(255, 255, 255, 0.01) 60%,
            transparent 80%
        ),
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.055),
            rgba(255, 255, 255, 0.012)
        );

    transform: translate3d(0, 0, 0);
    transform-origin: center;
    will-change: transform, background, box-shadow, filter;

    transition:
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        background 0.28s ease,
        box-shadow 0.28s ease,
        filter 0.28s ease;
}

.utp-workspace-mark__cell:nth-child(1),
.utp-workspace-mark__cell:nth-child(2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

.utp-workspace-mark__cell:nth-child(1),
.utp-workspace-mark__cell:nth-child(3) {
    border-right: 1px solid rgba(255, 255, 255, 0.075);
}

.utp-workspace-mark__cell:nth-child(2),
.utp-workspace-mark__cell:nth-child(3) {
    background:
        radial-gradient(
            circle at center,
            rgba(245, 121, 59, 0.13),
            rgba(245, 121, 59, 0.03) 56%,
            transparent 76%
        ),
        linear-gradient(
            145deg,
            rgba(245, 121, 59, 0.06),
            rgba(255, 255, 255, 0.008)
        );
}

.utp-workspace-mark:hover
.utp-workspace-mark__cell:nth-child(2),
.utp-workspace-mark:hover
.utp-workspace-mark__cell:nth-child(3),
.utp-workspace-mark:focus-visible
.utp-workspace-mark__cell:nth-child(2),
.utp-workspace-mark:focus-visible
.utp-workspace-mark__cell:nth-child(3),
.utp-workspace-mark[aria-expanded="true"]
.utp-workspace-mark__cell:nth-child(2),
.utp-workspace-mark[aria-expanded="true"]
.utp-workspace-mark__cell:nth-child(3) {
    background:
        radial-gradient(
            circle at center,
            rgba(245, 121, 59, 0.26),
            rgba(245, 121, 59, 0.08) 58%,
            transparent 80%
        ),
        linear-gradient(
            145deg,
            rgba(245, 121, 59, 0.13),
            rgba(255, 255, 255, 0.018)
        );

    box-shadow:
        inset 0 0 44px rgba(245, 121, 59, 0.08);
}


/* =========================================================
   Hero Variant
   Mission Control presentation of the shared Workspace Mark.
   ========================================================= */

.utp-workspace-mark--hero {
    width: min(44vw, 560px);
    height: auto;
    min-width: 0;
    min-height: 0;
    flex: none;

    aspect-ratio: 1.42 / 1;
    border-radius: 38px;

    background:
        radial-gradient(
            circle at 50% 42%,
            rgba(255, 255, 255, 0.075),
            transparent 58%
        ),
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.085),
            rgba(255, 255, 255, 0.018)
        ),
        rgba(7, 15, 29, 0.58);

    box-shadow:
        0 38px 110px rgba(0, 0, 0, 0.46),
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(255, 255, 255, 0.035),
        0 0 0 1px rgba(245, 121, 59, 0.055);
}

.utp-workspace-mark--hero:hover,
.utp-workspace-mark--hero:focus-visible,
.utp-workspace-mark--hero[aria-expanded="true"] {
    transform: none;

    border-color: rgba(245, 121, 59, 0.58);

    background:
        linear-gradient(
            145deg,
            rgba(245, 121, 59, 0.12),
            rgba(255, 255, 255, 0.035)
        ),
        rgba(7, 15, 29, 0.56);

    box-shadow:
        0 38px 100px rgba(0, 0, 0, 0.44),
        0 0 42px rgba(245, 121, 59, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.utp-workspace-mark--hero:active {
    transform: none;
}

@media (max-width: 900px) {
    .utp-workspace-mark--hero {
        width: min(72vw, 440px);
        border-radius: 28px;
    }
}

@media (max-width: 560px) {
    .utp-workspace-mark--hero {
        width: min(86vw, 360px);
        border-radius: 24px;
    }
}


/* ---------------------------------------------------------
   Portal motion
   The four panels react as one launcher without changing
   the locked Portal Mark geometry.
   --------------------------------------------------------- */

.utp-workspace-mark--hero {
    isolation: isolate;
}

.utp-workspace-mark--hero .utp-workspace-mark__grid {
    position: relative;
    z-index: 1;
}

@media (prefers-reduced-motion: no-preference) {
    .utp-workspace-mark--hero:not([aria-expanded="true"]) {
        animation: utpPortalIdle 5.8s ease-in-out infinite;
    }
}

@keyframes utpPortalIdle {
    0%,
    100% {
        box-shadow:
            0 38px 110px rgba(0, 0, 0, 0.46),
            inset 0 1px 0 rgba(255, 255, 255, 0.18),
            inset 0 -1px 0 rgba(255, 255, 255, 0.035),
            0 0 0 1px rgba(245, 121, 59, 0.055);
    }

    50% {
        box-shadow:
            0 42px 118px rgba(0, 0, 0, 0.49),
            0 0 34px rgba(245, 121, 59, 0.075),
            inset 0 1px 0 rgba(255, 255, 255, 0.19),
            inset 0 -1px 0 rgba(255, 255, 255, 0.04),
            0 0 0 1px rgba(245, 121, 59, 0.075);
    }
}

.utp-workspace-mark--hero:hover
.utp-workspace-mark__cell:nth-child(1),
.utp-workspace-mark--hero:focus-visible
.utp-workspace-mark__cell:nth-child(1) {
    transform: translate3d(-2px, -2px, 0);
}

.utp-workspace-mark--hero:hover
.utp-workspace-mark__cell:nth-child(2),
.utp-workspace-mark--hero:focus-visible
.utp-workspace-mark__cell:nth-child(2) {
    transform: translate3d(2px, -2px, 0);
}

.utp-workspace-mark--hero:hover
.utp-workspace-mark__cell:nth-child(3),
.utp-workspace-mark--hero:focus-visible
.utp-workspace-mark__cell:nth-child(3) {
    transform: translate3d(-2px, 2px, 0);
}

.utp-workspace-mark--hero:hover
.utp-workspace-mark__cell:nth-child(4),
.utp-workspace-mark--hero:focus-visible
.utp-workspace-mark__cell:nth-child(4) {
    transform: translate3d(2px, 2px, 0);
}

.utp-workspace-mark--hero[aria-expanded="true"]
.utp-workspace-mark__cell:nth-child(1) {
    transform: translate3d(-7px, -7px, 0) scale(0.992);
}

.utp-workspace-mark--hero[aria-expanded="true"]
.utp-workspace-mark__cell:nth-child(2) {
    transform: translate3d(7px, -7px, 0) scale(0.992);
}

.utp-workspace-mark--hero[aria-expanded="true"]
.utp-workspace-mark__cell:nth-child(3) {
    transform: translate3d(-7px, 7px, 0) scale(0.992);
}

.utp-workspace-mark--hero[aria-expanded="true"]
.utp-workspace-mark__cell:nth-child(4) {
    transform: translate3d(7px, 7px, 0) scale(0.992);
}

.utp-workspace-mark--hero.is-unlocking
.utp-workspace-mark__cell {
    filter: brightness(1.08);
}

.utp-workspace-mark--hero.is-unlocking::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    transform: translate(-50%, -50%);
    background: rgba(245, 121, 59, 0.88);
    box-shadow:
        0 0 18px rgba(245, 121, 59, 0.78),
        0 0 42px rgba(245, 121, 59, 0.34);
    opacity: 0;
    animation: utpPortalCore 0.34s ease-out both;
    pointer-events: none;
    z-index: 2;
}

@keyframes utpPortalCore {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.35);
    }

    45% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2.4);
    }
}

/* =========================================================
   Launcher Variant
   Small, brighter workspace switcher.
   ========================================================= */

.utp-workspace-mark--launcher {
    width: 15px;
    height: 15px;
    min-width: 15px;
    min-height: 15px;
    flex: 0 0 15px;

    border-radius: 6px;

    border-color: rgba(255, 255, 255, 0.38);

    background:
        radial-gradient(
            circle at 50% 42%,
            rgba(255, 255, 255, 0.16),
            transparent 62%
        ),
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.16),
            rgba(255, 255, 255, 0.045)
        ),
        rgba(20, 32, 49, 0.72);

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.26),
        0 0 18px rgba(255, 255, 255, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);

    transition:
        transform 0.24s ease,
        border-color 0.24s ease,
        background 0.24s ease,
        box-shadow 0.24s ease;
}

.utp-workspace-mark--launcher:hover,
.utp-workspace-mark--launcher:focus-visible,
.utp-workspace-mark--launcher[aria-expanded="true"] {
    transform: translateY(-1px);

    border-color: rgba(245, 121, 59, 0.72);

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.20),
            rgba(245, 121, 59, 0.08)
        ),
        rgba(20, 32, 49, 0.82);

    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.30),
        0 0 24px rgba(245, 121, 59, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.utp-workspace-mark--launcher:active {
    transform: translateY(0);
}
.utp-workspace-mark--launcher .utp-workspace-mark__cell {
    transition:
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        background 0.24s ease,
        box-shadow 0.24s ease;
}

.utp-workspace-mark--launcher:hover
.utp-workspace-mark__cell:nth-child(1),
.utp-workspace-mark--launcher:focus-visible
.utp-workspace-mark__cell:nth-child(1) {
    transform: translate(-1px, -1px);
}

.utp-workspace-mark--launcher:hover
.utp-workspace-mark__cell:nth-child(2),
.utp-workspace-mark--launcher:focus-visible
.utp-workspace-mark__cell:nth-child(2) {
    transform: translate(1px, -1px);
}

.utp-workspace-mark--launcher:hover
.utp-workspace-mark__cell:nth-child(3),
.utp-workspace-mark--launcher:focus-visible
.utp-workspace-mark__cell:nth-child(3) {
    transform: translate(-1px, 1px);
}

.utp-workspace-mark--launcher:hover
.utp-workspace-mark__cell:nth-child(4),
.utp-workspace-mark--launcher:focus-visible
.utp-workspace-mark__cell:nth-child(4) {
    transform: translate(1px, 1px);
}

.utp-workspace-mark--launcher[aria-expanded="true"]
.utp-workspace-mark__cell:nth-child(1) {
    transform: translate(-2px, -2px);
}

.utp-workspace-mark--launcher[aria-expanded="true"]
.utp-workspace-mark__cell:nth-child(2) {
    transform: translate(2px, -2px);
}

.utp-workspace-mark--launcher[aria-expanded="true"]
.utp-workspace-mark__cell:nth-child(3) {
    transform: translate(-2px, 2px);
}

.utp-workspace-mark--launcher[aria-expanded="true"]
.utp-workspace-mark__cell:nth-child(4) {
    transform: translate(2px, 2px);
}


/* =========================================================
   Reduced Motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .utp-workspace-mark,
    .utp-workspace-mark__cell {
        animation: none;
        transition: none;
    }

    .utp-workspace-mark--hero.is-unlocking::after {
        display: none;
    }
}

/* Header launcher size */
.utp-window-header .utp-workspace-mark.utp-workspace-mark--launcher {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    flex: 0 0 32px !important;
    border-radius: 7px;
}
