body.loading-locked {
    overflow: hidden !important;
}

body.js-loading .logo-svg,
body.js-loading .menu-container,
body.js-loading .section-label {
    opacity: 0 !important;
    animation: none !important;
    transition: none !important;
}

#pen-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background-color: var(--bg-0, #000000);
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    visibility: hidden;

    transition: opacity 0.4s ease, visibility 0.4s;
}

#pen-loader-overlay.active {
    opacity: 1;
    visibility: visible;
}

#pen-loader-overlay.immediate {
    opacity: 1 !important;
    visibility: visible !important;
    transition: none !important;
}

.loader-container {
    width: 300px;
    max-width: 80%;
    height: 60px;
    position: relative;
}

.line-track {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--text-3, #333);
    opacity: 0.3;
    transform: translateY(-50%);
    border-radius: 2px;
}

.line-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 2px;
    background-color: var(--ink, #fff);
    transform: translateY(-50%);
    border-radius: 2px;
    width: calc(var(--progress) * 1%);
    box-shadow: 0 0 10px var(--ink, #fff);
    transition: width 0.1s linear;
}

.pen-group {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translate(calc(var(--progress) * 3px - 15px), -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40px;
    pointer-events: none;
    transition: transform 0.1s linear;
}

.pen-icon {
    font-size: 24px;
    color: var(--ink, #fff);
    transform: translate(12px, -12px);
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.5));
}

.progress-text {
    margin-top: 5px;
    font-family: monospace;
    font-size: 12px;
    color: var(--text-2, #ccc);
    font-weight: bold;
}

@media (max-width: 600px) {
    .loader-container { width: 240px; }
    .pen-group {
        transform: translate(calc(var(--progress) * 2.4px - 15px), -50%);
    }
}
