* {
    box-sizing: border-box;
}

html,
body {
    font-family:
        "Noto Sans JP",
        /* Google Fonts font */
        -apple-system,
        /* macOS/iOS font */
        BlinkMacSystemFont,
        /* Chrome on macOS/iOS */
        "Hiragino Kaku Gothic ProN",
        /* macOS font */
        "Hiragino Sans",
        /* macOS font */
        "Meiryo",
        /* Windows font */
        "Yu Gothic",
        /* Windows 10+ font */
        "MS PGothic",
        /* Old Windows */
        "Roboto", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    color: #222;
    line-height: 1.6;
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    margin: 0;
    padding: 0;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

body {
    scroll-snap-stop: always;
    overflow-x: hidden;
}

header {
    width: 100%;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    position: sticky;
    top: 0;
    z-index: 9999;
    box-shadow: inset 0 -1px 0 0 rgba(0, 0, 0, 0.05);
}

header .header-inner {
    max-width: 1200px;
    margin: auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

footer {
    height: 40px;
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 1px 0 0 rgba(0, 0, 0, 0.05);
    color: gray;
    text-wrap: nowrap;
    font-size: small;
    z-index: 100;
}

.container {
    max-width: 1200px;
    margin: auto;
}

.main,
.search {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: flex-start;
    transition: all 0.3s ease;
}

.title {
    box-shadow: inset 0 -1px 0 0 lightgray;
    position: sticky;
    top: 50px;
    line-height: 50px;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 10;
    display: flex;
    align-items: center;
}

.title>h1 {
    padding: 0;
    margin: 0;
    white-space: nowrap;
    font-size: clamp(.8em, 2vw, 1em);
    font-weight: normal;
}

.title a {
    text-decoration: none;
    color: #00598f;
}

.title a:hover {
    text-decoration: underline;
    text-shadow: 0 0 1px currentColor;
}

.logo {
    margin-inline-start: 10px;
}

.logo>img {
    display: block;
    height: 30px !important;
}

@media (max-width: 767px) {
    .logo>img {
        height: 35px;
        padding: 5px auto;
    }
}

.categories,
.sub-categories {
    margin: 0;
    padding: 0;
    list-style-type: none;
}

.categories {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 10px;
    padding: 10px;
}

.categories.active {
    grid-auto-rows: auto;
    align-items: start;
}

.categories>li {
    width: 100%;
    min-height: 3rem;
    text-align: center;
    text-wrap: wrap;
    display: flex;
    flex-wrap: nowrap;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: .6rem;
    background-image: repeating-linear-gradient(-45deg,
            #f5f5f5 0,
            #f5f5f5 2px,
            #F0F0F8 2px,
            #F0F0F8 4px);
    color: #5c5c5c;
    outline: 1px solid rgba(50, 100, 201, 1);

    -webkit-user-select: none;
    user-select: none;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
}

.categories>li .category-name:active {
    background-color: #f2f5f9;
}

.categories>li .category-name:hover {
    background-color: #f4f7f9;
}

.category-name {
    width: 100%;
    padding: .5rem 0;
}

.category-name .jp,
.category-name .en {
    display: block;
    margin: auto;
}

.category-name .jp {
    font-weight: bold;
    font-size: clamp(16px, 5vw, 18px);
}

.category-name .en {
    font-weight: normal;
    font-size: clamp(12px, .7vw, 15px);
}

.sub-categories .category-name .jp {
    font-size: clamp(14px, 2vw, 15px);
}

.sub-categories {
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
    width: 100%;
    background-color: #fff;
}

.sub-categories.open {
    max-height: 1000px;
}

.sub-categories li {
    border-top: 1px solid rgb(50, 100, 201);

}

.sub-categories li a {
    display: block;
    text-align: center;
    position: relative;
    text-decoration: none;
    color: #5c5c5c;
    padding-left: .5rem;
    padding-right: 1rem;
}

.sub-categories li a::after {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: .1rem;
    width: 1.5rem;
    height: 2rem;
    background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='currentColor'%20stroke-width='1'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20stroke='none'%20d='M0%200h24v24H0z'%20fill='none'/%3E%3Cpath%20d='M9%206l6%206l-6%206'/%3E%3C/svg%3E") no-repeat center right;
    background-size: contain;
    pointer-events: none;
}

.index-entry {
    width: 100%;
    text-align: center;
    margin: 0;
    padding-bottom: .5rem;
    position: relative;
    overflow: hidden;
    user-select: none;
    cursor: pointer;
    font-size: clamp(13px, 1vw, 14px);
    color: #5c5c5c;
}

.index-entry::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 80%;
    pointer-events: none;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.1),
            rgba(255, 255, 255, 0));
}

.index-entry svg {
    animation: arrow-bounce 1.4s cubic-bezier(.25, .46, .45, .94) infinite;
    transform-box: fill-box;
    transform-origin: center;
}

@keyframes arrow-bounce {
    0% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(10px);
    }

    60% {
        transform: translateY(6px);
    }

    100% {
        transform: translateY(0);
    }
}

.index {
    scroll-snap-align: start;
    height: calc(100% + 200px);
}

.search {
    min-height: 100vh;
    min-width: 100vw;
    align-items: center;
    justify-content: space-between;
    flex-direction: column;
    scroll-snap-align: start;
}

.search-area {
    margin-top: calc(100vh / 5);
    text-align: center;
}

.search-area img {
    width: 250px;
    max-width: 70vw;
    user-select: none;
}

.search-area h1 {
    margin: 0 auto;
    font-size: clamp(1.1em, 4vw, 1.5em);
    text-wrap: nowrap;
    font-weight: normal;
    user-select: none;
}

.search-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 2.5rem;
    margin-top: 2rem;
    width: calc(100vw - 20px);
    max-width: 600px;
    border-radius: 50px;
    border: solid .1rem #e0e6ea;
    background-color: #fafcfd;
    position: relative;
}

.search-bar:focus-within {
    background-color: #fff;
}

.search-bar::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2.2rem);
    height: 1px;
    background: #84878a;
    background: linear-gradient(to right,
            transparent 0,
            #84878a 1%,
            #84878a 99%,
            transparent 100%);
}

.search-bar:focus-within::after {
    height: 2px;
    /* background: #0075C2; */
    background: linear-gradient(to right,
            transparent 0,
            #0075C2 1%,
            #0075C2 99%,
            transparent 100%);
}

.search-box {
    width: 100%;
    font-size: 16px;
    margin-left: 1.5rem;
    border: none;
    outline: none;
    background-color: transparent;
}

button.search-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 3px;
    background-color: transparent;
    outline: none;
    border: none;
    min-height: calc(2.5rem - 6px);
    min-width: calc(2.5rem - 6px);
    margin: 3px;
    border-radius: 50%;
    color: #000;
}

button.search-mark:hover {
    background-color: #f6f6f6;
}

button.search-mark:active {
    background-color: #f9f9f9;
    color: #84878a;
}