/* ==========================================================================
   オープニング（シャッター・横線1秒待機 + 2.6秒）
   ========================================================================== */

:root {
    --opening-blue: #2563eb;
    --opening-cyan: #00b4ed;
    --opening-wait: 1s;
    --opening-delay: 0.5s;
    --opening-duration: 2.6s;
}

.nakamoto-shutter {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: #ffffff;
    pointer-events: none;
}

html.opening-is-skipped .nakamoto-shutter {
    display: none !important;
    animation: none !important;
}

html.opening-is-active {
    overflow: hidden;
}

html.opening-is-active .site-opening-content {
    opacity: 0;
}

html.opening-is-active .nakamoto-shutter {
    animation: nakamoto-bye-shutter var(--opening-duration) var(--opening-delay) forwards;
}

html.opening-is-active .nakamoto-shutter::before,
html.opening-is-active .nakamoto-shutter::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    margin: auto;
}

html.opening-is-active .nakamoto-shutter::before {
    background-color: var(--opening-cyan);
    width: 0;
    height: 0;
    animation: nakamoto-shutter-open1 var(--opening-duration) var(--opening-wait) forwards;
}

html.opening-is-active .nakamoto-shutter::after {
    width: 120%;
    height: 0;
    margin-left: -10%;
    background-color: var(--opening-cyan);
    animation: nakamoto-shutter-open2 var(--opening-duration) var(--opening-delay) forwards;
}

html.opening-is-active .nakamoto-shutter__logo {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    animation: nakamoto-shutter-logo var(--opening-duration) var(--opening-delay) forwards;
}

.nakamoto-shutter__logo-image {
    display: block;
    width: min(64vw, 320px);
    height: auto;
}

html.opening-is-active .site-opening-content {
    animation: nakamoto-content-fade var(--opening-duration) var(--opening-delay) ease-out forwards;
}

@keyframes nakamoto-bye-shutter {
    70% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        visibility: hidden;
        z-index: -1;
    }
}

@keyframes nakamoto-shutter-logo {
    0%,
    55% {
        opacity: 1;
    }

    75%,
    100% {
        opacity: 0;
    }
}

@keyframes nakamoto-shutter-open1 {
    0% {
        width: 0;
        height: 1px;
    }

    50% {
        width: 100%;
        height: 1px;
    }

    90% {
        width: 100%;
        height: 100%;
    }

    100% {
        width: 100%;
        height: 100%;
    }
}

@keyframes nakamoto-shutter-open2 {
    60% {
        width: 120%;
        height: 0;
        transform: rotate(5deg);
    }

    90% {
        width: 120%;
        height: 100%;
        transform: rotate(-5deg);
    }

    100% {
        width: 120%;
        height: 100%;
        transform: rotate(-5deg);
    }
}

@keyframes nakamoto-content-fade {
    0%,
    72% {
        opacity: 0;
    }

    88% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --opening-delay: 0s;
        --opening-duration: 0.01s;
    }

    html.opening-is-active .site-opening-content {
        opacity: 1;
    }
}
