/* Preserve the original desktop layout; adapt only below its comfortable width. */
@media (max-width: 1000px) {
    div#header_title_area {
        width: auto;
        margin: 0 24px;
    }

    #gallery_container,
    #bio_area {
        box-sizing: border-box;
        width: calc(100% - 48px);
        height: auto;
    }

    #gallery {
        box-sizing: border-box;
        width: 100%;
        scroll-snap-type: x proximity;
    }

    #gallery a {
        scroll-snap-align: center;
    }

    #portfolio_description_area {
        width: 100%;
        height: auto;
    }

    .portfolio_description {
        position: relative;
        width: 100%;
        min-height: 0;
        display: flow-root;
    }

    .portfolio_description > img {
        box-sizing: border-box;
        width: 62%;
        height: auto;
    }

    div.inner_description {
        width: 34%;
        overflow-wrap: anywhere;
    }

    ul.description_feature_list {
        box-sizing: border-box;
    }

    #bio_area_left {
        width: 31%;
    }

    #big_photo_me {
        max-width: 100%;
        height: auto;
    }

    #bio_area_right {
        box-sizing: border-box;
        width: 66%;
        padding: 20px 0;
    }

    #bio_title {
        font-size: 30px;
        line-height: 1.15;
    }

    ul#bio_icons {
        margin-left: 0;
    }

    ul#bio_icons li {
        height: auto;
        min-height: 44px;
    }

    ul#bio_icons li a {
        box-sizing: border-box;
        min-height: 44px;
        padding-top: 6px;
        padding-bottom: 6px;
        line-height: 22px;
        background-position: left 5px;
        overflow-wrap: anywhere;
    }

    #diary_missing {
        box-sizing: border-box;
        width: calc(100% - 48px);
        max-width: 754px;
        padding: 24px;
    }

    #diary_missing img {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 600px) {
    div#header_title_area {
        margin: 0 20px;
        padding-top: 24px;
    }

    div#header h1 {
        max-width: 100%;
        background-size: contain;
        background-position: left center;
    }

    div#header h2 {
        margin-left: 4px;
        font-size: 14px;
        line-height: 20px;
    }

    #gallery_container,
    #bio_area {
        width: calc(100% - 32px);
        margin: 28px auto 36px;
        padding: 14px;
    }

    #gallery_banner,
    #about_me_angle_banner {
        width: 120px;
        height: 120px;
        background-size: contain;
        top: -10px;
        left: -10px;
    }

    #gallery a {
        margin: 24px 18px 24px 0;
        padding: 8px;
        font-size: 12px;
    }

    #gallery a:first-child {
        margin-left: 18px;
    }

    #gallery a img {
        width: 168px;
        height: 84px;
    }

    #gallery a span.darken_gallery_button {
        width: 100%;
        height: 100%;
    }

    .portfolio_description > img {
        display: block;
        width: 100%;
    }

    div.inner_description {
        float: none;
        width: auto;
        margin-top: 20px;
        font-size: 15px;
        line-height: 23px;
    }

    div.inner_description a.portfolio_link {
        margin-right: 0;
        margin-bottom: 16px;
        padding-bottom: 16px;
    }

    ul.description_feature_list {
        margin-bottom: 4px;
    }

    #bio_area_left,
    #bio_area_right {
        float: none;
        width: 100%;
    }

    #big_photo_me {
        display: block;
        margin: 0 auto 16px;
    }

    ul#bio_icons {
        max-width: 300px;
        margin: 0 auto;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 12px;
    }

    ul#bio_icons li:first-child {
        grid-column: 1 / -1;
    }

    #bio_area_right {
        padding: 24px 0 0;
        font-size: 16px;
        line-height: 25px;
    }

    #bio_title {
        font-size: 28px;
        margin-bottom: 20px;
    }

    .design_icons {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    .design_icons li {
        margin: 0;
    }

    #footer {
        box-sizing: border-box;
        width: calc(100% - 32px);
        max-width: 489px;
        background-size: 100% 55px;
        font-size: 13px;
    }

    #diary_missing img {
        float: none;
        display: block;
        margin: 0 auto 20px;
    }
}

@media (hover: none) and (max-width: 1000px) {
    body.desktop #gallery a:hover img {
        opacity: 1;
    }

    #big_photo_me:hover,
    ul#bio_icons li:hover {
        transform: none;
    }
}
