@charset "utf-8";

/*----------------------------
* レイアウト
*----------------------------*/
* {
    margin: 0;
    padding: 0;
    list-style: none;
    text-decoration: none;
}

html {
    scroll-behavior: smooth;
}

header,
footer {
    position: relative;
    width: 100%;
    height: 200px;
    text-align: center;
    background-color: black;
    color: white;
}

h1 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

aside {
    position: sticky;
    top: 0;
    float: right;
    width: 25%;
}

aside li {
    position: relative;
    text-align: center;
    height: 100;
}

aside a {
    display: inline-block;
    width: 100%;
}

.box {
    width: 75%;
    height: 800px;
}

.box:nth-child(odd) {
    background-color: pink;
}

.box:nth-child(even) {
    background-color: skyblue;
}

/*----------------------------
* スクロール連動ナビゲーション
*----------------------------*/
#indexList a.active {
    animation: scroll-relation_a 1s forwards;
}

#indexList li:has(a.active):before {
    position: absolute;
    z-index: -1;
    height: 100%;
    width: 0;
    background-color: blue;
    content: "";
    animation: scroll-relation_before 1s forwards;
}

#indexList li:has(a.active):after {
    position: absolute;
    right: 0;
    z-index: -2;
    height: 100%;
    width: 0;
    background-color: skyblue;
    content: "";
    animation: scroll-relation_after 1s forwards;
}

@keyframes scroll-relation_a {

    0% {
        color: #333;
    }

    50% {
        color: #fff;
    }

    100% {
        color: #333;
    }

}

@keyframes scroll-relation_before {

    0% {
        width: 0;
        background-color: blue;
    }

    50% {
        width: 100%;
        background-color: blue;
    }

    100% {
        width: 5%;
        background-color: blue;
    }

}

@keyframes scroll-relation_after {

    0% {
        width: 0;
        background-color: red;
    }


    50% {
        width: 0;
        background-color: red;
    }

    100% {
        width: 100%;
        background-color: red;
    }

}