.header-text-box {
    position: relative;
    width: 0;
    opacity: 0;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
    background: linear-gradient(#5f3a60b5, #005f81);
    border: 2px solid #00BCD4;
    border-left: 10px solid #00BCD4;
    border-radius: 1px;
    box-shadow: 0 0 10px rgba(255, 0, 210, 0.5); /* 既存のグロー影 */
    transition: box-shadow 0.5s ease-out; /* 影の変化に0.5秒かける */
    color: #fff;
    font-family: "Zen Old Mincho", sans-serif;
    text-align: center;
    letter-spacing: 0.1em;
    white-space: nowrap;
    margin: auto;
}
.header-text-box::after {
    content: '';
    position: absolute;
    width: 46px;
    height: 46px;
    rotate: 45deg;
    border-right: solid 2px #00BCD4;
    bottom: 2px;
    right: 2px;
}
.header-text-box h1 {
    text-align: left;
    margin: 0;
    font-size: 2.5em; 
    padding: 10px 30px; /* テキストに直接パディングを持たせる */
}

/* --- チカチカ（グリッチ）アニメーション --- */
@keyframes glitchEffect {
    0%, 100% { opacity: 0; box-shadow: none; border-color: transparent; }
    10%, 30%, 50%, 70%, 90% { opacity: 1; box-shadow: 0 0 10px #00bbd4a6; border-color: #00BCD4; }
    20%, 40%, 60%, 80% { opacity: 0.2; box-shadow: none; border-color: transparent; }
}

/* --- ボックスが左から右に伸びるアニメーション --- */
@keyframes expandWidth {
    from {
        width: 0;
    }
    to {
        width: 90%; /* 最終的な幅を指定 (PROJECT: PORTFOLIOが入る幅) */
        opacity: 1;
    }
}

/* タイピングエフェクト用のカーソル */
.header-title-text { /* IDからCLASSに変更 */
    position: relative;
    display: inline-block;
    /* color: transparent; */
    color: #fff;
}

.header-title-text.typing { /* IDからCLASSに変更 */
    color: #fff; /* タイピング中はテキストを表示 */
}

.header-title-text::after { /* IDからCLASSに変更 */
    content: '|'; 
    position: absolute;
    right: -0.5em; 
    top: 0;
    color: #00BCD4; 
    font-weight: bold;
    opacity: var(--caret-opacity, 0); 
    animation: var(--caret-animation, none); 
}

@keyframes blinkCaret {
    from, to { opacity: 0; }
    50% { opacity: 1; }
}
