/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*\
   HackYa_17 — Perspective Slide Panel
   Based on Codrops "Perspective Page Transitions"
   Reconstructed from archived HTML + JS behaviour
\*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/* ── Outer perspective wrapper ───────────────────── */
#perspective {
    perspective: 1500px;
    perspective-origin: 100% 50%;
    width: 100%;
    min-height: 100%;
}

/* ── Inner container that gets tilted ────────────── */
#perspective .container {
    position: relative;
    z-index: 1;
    transform-origin: 100% 50%;
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.17, 0.04, 0.03, 0.94),
                opacity 0.4s cubic-bezier(0.17, 0.04, 0.03, 0.94),
                filter 0.4s cubic-bezier(0.17, 0.04, 0.03, 0.94);
}

/* ── Active state: content tilts left + dims + blurs ─ */
#perspective.animate .container {
    transform: translateX(-290px) rotateY(-15deg);
    opacity: 0.45;
    filter: blur(2px);
    cursor: pointer;
}

/* ── Active state: locks scroll during open ──────── */
#perspective.modalview {
    overflow: hidden;
}

body.panel-open {
    overflow-y: hidden;
}

body.panel-open #showMenu {
    right: 22rem;
    transform: scaleX(-1);
}

/* ── Sticky inner content on desktop ─────────────── */
@media (min-width: 1200px) {
    .top-nav-hidden .panel-inner {
        position: sticky;
        top: 0;
    }
}

/* ── The slide-in side panel — RIGHT SIDE ────────── */
.top-nav-hidden,
.top-nav-hidden.scroll-down,
.top-nav-hidden.scroll-up,
.top-nav-hidden.scroll-up.hide,
.top-nav-hidden.tilt.scroll-up,
.top-nav-hidden.hide {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: 30% !important;
    height: 100% !important;
    transform: translateX(100%) !important;
    opacity: 1 !important;
    visibility: visible !important;
    animation: none !important;
    z-index: 11 !important;
    overflow-y: auto !important;
    transition: transform 0.4s cubic-bezier(0.17, 0.04, 0.03, 0.94) !important;
}

.top-nav-hidden.animate {
    transform: translateX(0) !important;
}

.top-nav-hidden .panel-comment-excerpt,
.top-nav-hidden .panel-comment-post {
    display: block;
    padding: 0;
    box-sizing: border-box;
}

.top-nav-hidden .panel-comments {
    display: flex;
    flex-direction: column;
}


ul.panel-comments {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 36em;
}

ul.panel-comments::-webkit-scrollbar {
    width: 10px;
}

ul.panel-comments::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

ul.panel-comments::-webkit-scrollbar-thumb {
    background: #b39ddb;
    border-radius: 10px;
}

ul.panel-comments::-webkit-scrollbar-thumb:hover {
    background: #b39ddb;
}

/* ── panel-comments padding-top by viewport width ── */
@media (min-width: 1200px) and (max-width: 1300px) {
    ul.panel-comments {
        padding-top: 36em;
    }
}

@media (min-width: 1200px) and (max-width: 1300px) {
    ul.panel-comments {
        padding-top: 36em;
    }
}


@media (min-width: 1301px) {
    ul.panel-comments {
        padding-top: 33em;
    }
}

@media (min-width: 1402px) {
    ul.panel-comments {
        padding-top: 29em;
    }
}

@media (min-width: 1487px) {
    ul.panel-comments {
        padding-top: 26em;
    }
}

/* ── showMenu toggle button — RIGHT EDGE ─────────── */
#showMenu {
    right: 0;
    position: fixed;
    top: 40%;
    cursor: pointer;
    font-size: 4vw;
    z-index: 204;
    color: dodgerblue;
    text-decoration: none;
    transition: color 0.2s, opacity 0.4s,
                right 0.4s cubic-bezier(0.17, 0.04, 0.03, 0.94),
                transform 0.4s cubic-bezier(0.17, 0.04, 0.03, 0.94);
}

#showMenu:hover {
    color: #8b5cf6;
}

.chevron_tab {
    display: inline-block;
    letter-spacing: -0.05em;
    line-height: 1;
    filter: drop-shadow(0px 0px 10px rgba(255, 255, 255, 1));
}

/* showMenu2: close button inside panel */
#showMenu2 {
    display: block;
    position: absolute;
    top: 1em;
    left: 1em;
    right: auto;
    color: rgba(0,0,0,0.4);
    font-size: 0.9em;
    cursor: pointer;
    text-decoration: none;
    z-index: 10;
    transition: color 0.2s;
}

#showMenu2:hover {
    color: #1a73e8;
}

/* ── Desktop: sidebar always visible ─────────────── */
@media (min-width: 1200px) {
    #showMenu { display: none; }

    .top-nav-hidden {box-shadow: -5px 10px 30px rgb(157 0 255 / 20%);}

    .top-nav-hidden,
    .top-nav-hidden.scroll-down,
    .top-nav-hidden.scroll-up,
    .top-nav-hidden.scroll-up.hide,
    .top-nav-hidden.tilt.scroll-up,
    .top-nav-hidden.hide {
        position: absolute !important;
        height: auto !important;
        transform: translateX(0) !important;
        margin-top: 10.5rem !important; /* very important don't fucking remove it */
        transition: margin-top 0.4s cubic-bezier(0.17, 0.04, 0.03, 0.94) !important;
    }

    body.login-open .top-nav-hidden {
        margin-top: calc(10.5rem + 15.5em) !important;
    }
}
