.portrait-cards-container {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 0.75rem;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem;
    box-sizing: border-box;
    font-family: "Lato", sans-serif;
}

.app-card {
    position: relative;
    display: flex;
    flex-direction: column;
    aspect-ratio: 1 / 1;
    container-type: inline-size;
    padding: 1rem;
    padding: 6%;
    background: #ffffff;
    border-radius: 1.25rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 45, 80, 0.12);
    box-sizing: border-box;
}

.app-card-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    gap: 4cqw;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.app-card-link:focus-visible {
    outline: 2px solid #009de0;
    outline-offset: 2px;
    border-radius: 0.75rem;
}

.app-card-title {
    width: 100%;
    display: flex;
    justify-content: center;
}

.app-card-title img {
    width: 60%;
    width: 80cqw;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.app-card-icon {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
}

.app-card-icon img {
    width: 55%;
    height: 55%;
    width: 65cqw;
    height: 65cqw;
    object-fit: contain;
}

.app-card-more {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #009de0;
    color: #ffffff;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    z-index: 2;
    width: 18cqw;
    height: 18cqw;
    font-size: 7cqw;
    bottom: 4cqw;
    right: 4cqw;
}

.app-card-more:hover {
    background: #007fb5;
}

.app-card-more:focus-visible {
    outline: 2px solid #12344d;
    outline-offset: 2px;
}

.app-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 1rem;
    overscroll-behavior: contain;
}

.app-modal[hidden] {
    display: none;
}

.app-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.app-modal.is-open .app-modal-backdrop {
    opacity: 1;
}

.app-modal-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(100%, 30rem);
    max-height: calc(100dvh - 2rem);
    overflow: hidden;
    border-radius: 1.25rem;
    background: #ffffff;
    box-shadow: 0 2rem 4rem rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-modal.is-open .app-modal-dialog {
    opacity: 1;
    transform: scale(1);
}

.app-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #111111;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.app-modal-close-icon {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
}

.app-modal-close:hover {
    color: #000000;
}

.app-modal-close:focus-visible {
    outline: 2px solid #009de0;
    outline-offset: 2px;
}

.app-modal-content {
    min-height: 0;
    padding: 3.25rem 1.25rem 1.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.app-modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    margin: 0 auto 0.75rem;
}

.app-modal-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.app-modal-title {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 0.75rem;
}

.app-modal-lettering {
    position: relative;
    display: block;
    width: calc(3.5rem * var(--lettering-ratio, 1));
    height: 3.5rem;
    max-width: 100%;
    overflow: hidden;
    opacity: 1;
    filter: none;
}

.app-modal-lettering img {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: auto;
    height: 100%;
    max-width: none;
    object-fit: contain;
}

.app-modal-desc {
    margin: 0;
    color: #4a5a66;
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: left;
    overflow-wrap: break-word;
}

.app-modal-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.75rem;
    margin-top: 1.25rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: #009de0;
    color: #ffffff;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

.app-modal-link:hover {
    background: #007fb5;
}

.app-modal-link:focus-visible {
    outline: 2px solid #12344d;
    outline-offset: 2px;
}

html.modal-open,
body.modal-open {
    overflow: hidden;
}

@media screen and (orientation: portrait) {
    html,
    body {
        min-height: 100dvh;
        overflow-y: auto;
    }

    body {
        width: 100%;
        margin: 0;
        justify-content: flex-start;
    }

    .container {
        display: none !important;
    }

    #circle-container {
        display: none !important;
    }

    .container_head {
        position: static;
        top: auto;
        left: auto;
        width: 100%;
        margin: 0;
        padding: 1rem 1rem 0;
        box-sizing: border-box;
        align-items: center;
        flex-direction: column;
    }

    .head_image_up,
    .head_image_down {
        width: min(70%, 18rem);
        height: auto;
    }

    .head_image_up {
        margin-top: 3vw;
    }

    .head_image_down {
        margin-top: 3vw;
        margin-bottom: 4vw;
    }

    .portrait-cards-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
        gap: 0.75rem;
        padding: 0.75rem;
        width: 100%;
        height: auto;
    }
}

@media screen and (orientation: portrait) and (min-width: 30rem) {
    .portrait-cards-container {
        grid-template-columns: repeat(2, 1fr);
    }
}
