/* ============================================================
   hoshinoshiroya.uk — Entry Splash (hello wordmark)
   手写动画样式移植自朋友 ForJiang 的 forjiang-hello 项目。
   底层透出全站背景轮播（bg-carousel），本层只做半透明暗化。
   ============================================================ */

#splash {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 24px 20px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.9s ease;
}

#splash.leaving {
    opacity: 0;
    pointer-events: none;
}

/* ---------- 手写 wordmark（描画动画 + 荧光光晕） ---------- */

#splash-hello-svg {
    height: clamp(96px, 22vw, 168px);
    max-width: 92vw;
    overflow: visible;
    fill: none;
    stroke: #f5f5f7;
    filter:
        drop-shadow(0 0 4px rgba(255, 255, 255, 0.85))
        drop-shadow(0 0 14px rgba(255, 255, 255, 0.5))
        drop-shadow(0 0 38px rgba(255, 255, 255, 0.32));
}

#splash-hello-svg path.drawing {
    animation:
        splash-draw-path var(--dur) var(--ease) var(--delay) both,
        splash-fade-in var(--op-dur) linear var(--op-delay) both;
}

@keyframes splash-draw-path {
    from { stroke-dashoffset: var(--len); }
    to   { stroke-dashoffset: 0; }
}

@keyframes splash-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---------- 时钟（描画完成后浮现） ---------- */

.splash-clock {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: translateY(10px);
    transition:
        opacity 0.7s ease,
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

#splash.done .splash-clock,
#splash.done .splash-enter {
    opacity: 1;
    transform: none;
}

.splash-clock-time {
    font-size: clamp(22px, 3.6vw, 34px);
    font-weight: 600;
    letter-spacing: 0.06em;
    font-variant-numeric: tabular-nums; /* 数字等宽，秒跳不抖动 */
    color: #f5f5f7;
    text-shadow:
        0 0 4px rgba(255, 255, 255, 0.85),
        0 0 14px rgba(255, 255, 255, 0.5),
        0 0 38px rgba(255, 255, 255, 0.32);
}

.splash-clock-date {
    color: rgba(245, 245, 247, 0.62);
    font-size: 12px;
    letter-spacing: 0.14em;
}

/* ---------- "点击进入"提示（完成后淡入并呼吸） ---------- */

.splash-enter {
    margin-top: 4px;
    font-size: 0.95rem;
    letter-spacing: 0.12em;
    color: rgba(245, 245, 247, 0.75);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
    opacity: 0;
    pointer-events: none;
}

/* 两段动画串联：先一次性淡入(0.15s 起,0.7s 完成,both 保持终态)，
   呼吸动画在其终点(0.85s)无缝接管 opacity */
#splash.done .splash-enter {
    animation:
        splash-enter-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both,
        splash-breathe 2.6s ease-in-out 0.85s infinite;
}

@keyframes splash-enter-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 0.75; transform: none; }
}

@keyframes splash-breathe {
    0%, 100% { opacity: 0.75; }
    50%      { opacity: 0.35; }
}

/* ---------- 署名（右下角小字） ---------- */

.splash-credit {
    position: absolute;
    right: 14px;
    bottom: max(12px, env(safe-area-inset-bottom));
    font-size: 11px;
    letter-spacing: 0.08em;
    color: rgba(245, 245, 247, 0.45);
    pointer-events: none;
}

/* ---------- 短横屏（手机横放）：压缩字号防碰撞 ---------- */
@media (max-height: 480px) {
    #splash-hello-svg {
        height: clamp(72px, 30vh, 150px);
    }
    .splash-clock-time {
        font-size: clamp(18px, 5vh, 28px);
    }
    .splash-clock-date {
        font-size: 10px;
    }
}

/* ---------- Reduced motion：直接呈现完成态 ---------- */
@media (prefers-reduced-motion: reduce) {
    #splash { transition: none; }
    #splash-hello-svg path.drawing { animation: none; }
    .splash-clock { transition: none; }
    #splash.done .splash-enter { animation: none; opacity: 1; }
}
