/* --- GLOBAL & ENTRY MASK --- */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden !important;
}

.hk-page-mask {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: #000;
    z-index: 9999999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
    pointer-events: auto;
}

.hk-page-mask.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#page-container {
    filter: blur(10px);
    transition: filter 0.8s ease-out;
}

body:not(.scroll-lock) #page-container {
    filter: blur(0px);
}

/* --- THE TRIGGER BUTTON --- */
#corner-trigger-wrapper {
    position: fixed;
    bottom: 22vh;
    right: 25vw;
    z-index: 9999;
    transition: opacity 0.2s ease-in;
    pointer-events: none;
    opacity: 0; /* Base state */
}

#corner-trigger-wrapper.visible {
    opacity: 1 !important;
    pointer-events: auto;
}

#corner-trigger img {
    width: clamp(30px, 5vw, 60px);
    height: auto;
    display: block;
    opacity: .6;
    background: transparent !important;
}

#corner-trigger:hover { transform: scale(0.7); }

#corner-trigger:hover img {
    animation: vibrate 0.2s linear infinite;
    filter: brightness(1.4);
}

@keyframes vibrate {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}

/* --- 3. EXIT SEQUENCES --- */
#glitch-bg-target.glitching {
    filter: url(#noise) !important;
    transition: none !important;
}

#white-flash-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: #1160E4;
    z-index: 9999999;
    opacity: 0;
    display: none;
    pointer-events: none;
}

#white-flash-overlay.active {
    display: block;
    pointer-events: all;
    animation: quickWhite 0.4s forwards;
}

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