
@import url('https://fonts.googleapis.com/css2?family=DotGothic16&display=swap');

/* =========================
   ページ全体
========================= */
body {
    background-color: #363b43;
    color: #cccccc;
    margin: 0;
    font-family: 'DotGothic16', sans-serif;
}

/* =========================
   メイン画像
========================= */
.hero {
    width: 100%;
}

.hero img {
    display: block;
    width: 100%;
    max-width: 1000px;
    height: auto;
    margin: 0 auto;
}

/* =========================
   文章全体
========================= */
.intro {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 20px;
    text-align: center;
}

.text {
    display: block;
    font-size: clamp(18px, 2.5vw, 28px);
    font-weight: normal;
    line-height: 1.8;
    margin: 30px 0;
    white-space: normal;

    /* 最初に下からフェードイン */
    opacity: 0;
    transform: translateY(25px);
    animation: fadeUp 1s ease-out forwards;
}

/* 1つ目の文章 */
.text:nth-child(1) {
    animation-delay: 0.3s;
}

/* 2つ目の文章 */
.text:nth-child(2) {
    animation-delay: 0.8s;
}

/* =========================
   フェードイン
========================= */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================
   一文字ずつのアニメーション
========================= */
.letter {
    display: inline-block;
    transition: color 0.2s ease;
}

/* 文字にカーソルを重ねると左から跳ねる */
.text:hover .letter {
    animation: letterBounce 0.5s ease both;
}

/* 一文字ずつ時間差をつける */
.text:hover .letter:nth-of-type(1)  { animation-delay: 0s; }
.text:hover .letter:nth-of-type(2)  { animation-delay: 0.04s; }
.text:hover .letter:nth-of-type(3)  { animation-delay: 0.08s; }
.text:hover .letter:nth-of-type(4)  { animation-delay: 0.12s; }
.text:hover .letter:nth-of-type(5)  { animation-delay: 0.16s; }
.text:hover .letter:nth-of-type(6)  { animation-delay: 0.20s; }
.text:hover .letter:nth-of-type(7)  { animation-delay: 0.24s; }
.text:hover .letter:nth-of-type(8)  { animation-delay: 0.28s; }
.text:hover .letter:nth-of-type(9)  { animation-delay: 0.32s; }
.text:hover .letter:nth-of-type(10) { animation-delay: 0.36s; }
.text:hover .letter:nth-of-type(11) { animation-delay: 0.40s; }
.text:hover .letter:nth-of-type(12) { animation-delay: 0.44s; }
.text:hover .letter:nth-of-type(13) { animation-delay: 0.48s; }
.text:hover .letter:nth-of-type(14) { animation-delay: 0.52s; }
.text:hover .letter:nth-of-type(15) { animation-delay: 0.56s; }
.text:hover .letter:nth-of-type(16) { animation-delay: 0.60s; }
.text:hover .letter:nth-of-type(17) { animation-delay: 0.64s; }
.text:hover .letter:nth-of-type(18) { animation-delay: 0.68s; }
.text:hover .letter:nth-of-type(19) { animation-delay: 0.72s; }
.text:hover .letter:nth-of-type(20) { animation-delay: 0.76s; }
.text:hover .letter:nth-of-type(21) { animation-delay: 0.80s; }
.text:hover .letter:nth-of-type(22) { animation-delay: 0.84s; }
.text:hover .letter:nth-of-type(23) { animation-delay: 0.88s; }

/* 跳ねる動き */
@keyframes letterBounce {
    0%, 100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-15px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* =========================
   ホバー用クラス
========================= */
.hover1 {
    display: inline-block;
    transition: color 0.3s ease;
    cursor: pointer;
}

.hover1:hover {
    color: #ffffff;
}

/* =========================
   スマートフォン対応
========================= */
@media screen and (max-width: 600px) {
    .intro {
        margin: 30px auto;
        padding: 0 12px;
    }

    .text {
        font-size: 16px;
        line-height: 1.8;
        margin: 24px 0;
    }

    /* スマホでは文字が画面からはみ出さないようにする */
    .letter {
        overflow-wrap: anywhere;
    }
}

/* =========================
   動きを減らす設定への対応
========================= */
@media (prefers-reduced-motion: reduce) {
    .text {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .text:hover .letter {
        animation: none;
    }
}
