/* ============================================================
   CYBERLOG Splash Screen
   Based on: https://codepen.io/t_afif/pen/EayEKgP
   ============================================================ */

@property --splash-o {
    syntax: "<number>";
    initial-value: 1;
    inherits: true;
}

/* ===== 全屏容器：黑色遮罩 + 图片背景 ===== */
#cyberlog-splash {
    position: fixed;
    inset: 0;
    z-index: 99999;
    margin: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background:
        conic-gradient(rgb(0 0 0 / var(--splash-o)) 0 0),
        var(--splash-img) 50% / cover no-repeat;
    animation: splash-bg-reveal 3s forwards ease-out 0.8s;
    cursor: pointer;
}

@keyframes splash-bg-reveal {
    to { --splash-o: 0; }
}

/* ===== 文字遮罩层：通过文字形状裁剪图片 ===== */
#cyberlog-splash .splash-mask {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    place-content: center;
    font-family: 'Orbitron', 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 6vmax;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    /* 图片通过文字形状裁剪显示 */
    background: var(--splash-img) 50% / cover no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    color: #0000;
    -webkit-text-fill-color: #0000;
    /* 初始放大2倍，动画到极大 */
    scale: 2;
    animation: splash-text-reveal 3s forwards ease-out 0.8s;
    pointer-events: none;
    user-select: none;
}

@keyframes splash-text-reveal {
    to {
        scale: 1;
        font-size: 180vmax;
    }
}

/* ===== 跳过提示 ===== */
#cyberlog-splash .splash-skip {
    position: fixed;
    bottom: 5vh;
    right: 4vw;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 0.25em;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    pointer-events: none;
    user-select: none;
    animation: splash-skip-blink 1.2s infinite alternate ease-in-out;
    z-index: 100000;
}

@keyframes splash-skip-blink {
    from { opacity: 0.2; }
    to   { opacity: 0.7; }
}

/* ===== 扫描线叠加 ===== */
#cyberlog-splash::before {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.06) 2px,
        rgba(0, 0, 0, 0.06) 4px
    );
    pointer-events: none;
    z-index: 1;
}

/* ===== 退出（点击跳过）===== */
#cyberlog-splash.splash-exit {
    animation: splash-exit 0.5s forwards ease-in !important;
}
#cyberlog-splash.splash-exit .splash-mask {
    animation: splash-exit 0.5s forwards ease-in !important;
}

@keyframes splash-exit {
    0%   { opacity: 1; }
    50%  { opacity: 1; filter: brightness(2); }
    100% { opacity: 0; filter: brightness(0); }
}

/* ===== 完成后隐藏 ===== */
#cyberlog-splash.splash-done {
    display: none !important;
}
