:root {
    --surface: #f7f9ff;
    --surface_container: #eceef3;
    --surface_container_high: #e6e8ee;
    --surface_container_highest: #e0e2e8;
    --surface_bright: #d8dae0;
    --on_surface: #181c20;
    --on_surface_variant: #42474e;

    --primary: #2f628c;
    --primary_container: #cee5ff;
    --inverse_primary: #9bcbfb;
    --on_primary: #ffffff;
    --on_primary_container: #001d33;

    --error: #ba1a1a;
    --error_container: #ffdad6;
    --on_error: #ffffff;
    --on_error_container: #410002;

    --outline: #72777f;
    --outline_variant: #c2c7cf;

    --shadow: #000000;
}

html.dark {
    --surface: #101418;
    --surface_container: #1c2024;
    --surface_container_high: #272a2f;
    --surface_container_highest: #323539;
    --surface_bright: #36393e;
    --on_surface: #e0e2e8;
    --on_surface_variant: #c2c7cf;

    --primary: #9bcbfb;
    --primary_container: #0e4a73;
    --inverse_primary: #2f628c;
    --on_primary: #003353;
    --on_primary_container: #cee5ff;

    --error: #ffb4ab;
    --error_container: #93000a;
    --on_error: #690005;
    --on_error_container: #ffdad6;

    --outline: #8c9198;
    --outline_variant: #42474e;

    --shadow: #000000;
}

* {
    box-sizing: border-box;

    font-family: "Inter", "Noto Sans JP", sans-serif;

    margin: 0;
    padding: 0;

    scroll-behavior: smooth;
    scrollbar-color: var(--primary) transparent;
    scrollbar-width: auto;
}

html {
    font-optical-sizing: auto;
    font-size: 16px;
    font-style: normal;
    font-weight: normal;
}

body {
    background-color: var(--surface);
}

::selection {
    background-color: var(--primary);
    color: var(--on_primary);
}

input[type="checkbox"],
input[type="radio"] {
    display: none;
}

.wip {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    background-color: var(--surface);

    text-align: center;

    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10000;

    padding: 16px;
}

#wip-toggle:checked + .wip {
    display: flex;
}

.wip-toggle-label {
    display: flex;
    align-items: center;
    justify-content: center;

    background-color: var(--error);
    border-radius: 100%;

    color: var(--on_error);

    cursor: pointer;

    position: absolute;
    top: 16px;
    left: 16px;

    height: 40px;
    aspect-ratio: 1/1;

    transition: background 200ms ease;
}

.wip-toggle-label:hover {
    background-color: var(--error_container);

    color: var(--on_error_container);
}

.wip-text {
    color: var(--on_surface);
    font-size: 2.5rem;
    font-weight: bold;
}

.wip-subtext {
    color: var(--on_surface_variant);

    margin-top: 8px;
}

.wip-button {
    display: flex;
    align-items: center;
    gap: 8px;

    background-color: var(--surface_container);
    border-radius: calc(50px / 2);

    color: var(--on_surface);
    text-decoration: none;

    margin-top: 32px;
    padding: 16px;

    height: 50px;
    width: fit-content;

    transition: background 200ms ease;
}

.wip-button:hover {
    background-color: var(--surface_bright);
}

.wip-button img {
    height: 100%;
}

.navbar {
    display: flex;
    gap: 4px;

    background-color: var(--surface_container);
    border-radius: calc((50px + (4px * 2)) / 2);
    box-shadow: 0 0 8px 0 var(--shadow);

    position: fixed;
    bottom: 16px;
    left: 50%;
    z-index: 9999;

    padding: 4px;

    transform: translateX(-50%);

    height: calc(50px + (4px * 2));
    width: fit-content;
}

.search-section-container {
    position: relative;

    height: 100%;
    width: fit-content;
}

.search-section {
    background-color: var(--surface_container_high);
    border-radius: calc(50px / 2);
    border: none;
    outline: none;

    color: var(--on_surface);
    font-size: 1rem;

    padding: 0 16px;

    height: 100%;
    width: 200px;

    transition: background 200ms ease;
}

.search-section:hover,
.search-section-container:focus-within .search-section {
    background-color: var(--surface_bright);
}

.search-section::placeholder {
    color: var(--on_surface_variant);
}

.search-section-result-container {
    display: flex;
    flex-direction: column;
    gap: 2px;

    border-radius: calc(50px / 2);

    position: absolute;
    bottom: calc(100% + 4px + 4px);
    left: 0;

    overflow: hidden;

    transform: scale(0);
    transform-origin: bottom left;

    height: fit-content;
    width: fit-content;

    transition: transform 200ms ease;
}

.search-section-container:focus-within .search-section-result-container {
    transform: scale(1);
}

.search-section-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    background-color: var(--surface_container_high);
    border-radius: 4px;

    color: var(--on_surface_variant);
    text-decoration: none;

    padding: 8px;

    height: 50px;
    width: 100%;

    transition: background 200ms ease;
}

.search-section-result:hover {
    background-color: var(--surface_bright);

    transition: background 0ms ease;
}

.search-section-result-info {
    display: flex;
    align-items: center;
    gap: 8px;

    height: 100%;
    width: fit-content;
}

.search-section-result-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    background-color: var(--primary);
    border-radius: 100%;

    color: var(--on_primary);

    height: 100%;
    aspect-ratio: 1/1;
}

.search-section-result-title {
    color: var(--on_surface);
}

.menu-toggle-label-container {
    position: relative;

    height: 100%;
    width: fit-content;
}

.menu-toggle-label {
    display: flex;
    align-items: center;
    justify-content: center;

    background-color: var(--surface_container_high);
    border-radius: 100%;

    color: var(--on_surface_variant);

    cursor: pointer;

    height: 100%;
    aspect-ratio: 1/1;

    transition:
        background 200ms ease,
        color 200ms ease;
}

.menu-toggle-label:hover {
    background-color: var(--surface_bright);
}

#menu-toggle:checked + .menu-toggle-label {
    background-color: var(--error);

    color: var(--on_error);
}

#menu-toggle:checked + .menu-toggle-label:hover {
    background-color: var(--error_container);

    color: var(--on_error_container);
}

.menu-toggle-label i {
    position: absolute;

    transform: scaleY(1);

    transition: transform 200ms ease;
}

#menu-toggle:checked + .menu-toggle-label i:first-child {
    transform: scaleY(0);
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 2px;

    position: absolute;
    right: 0;
    bottom: calc(100% + 4px + 4px);

    transform: scale(0);
    transform-origin: bottom right;

    transition: transform 200ms ease;

    height: fit-content;
    width: fit-content;
}

#menu-toggle:checked ~ .menu {
    transform: scale(1);
}

.menu-option-container {
    position: relative;

    height: fit-content;
    width: fit-content;
}

.menu-option {
    display: flex;
    align-items: center;
    gap: 16px;

    background-color: var(--surface_container_high);
    border-radius: 4px;

    cursor: pointer;

    padding: 8px;

    height: fit-content;
    width: 100%;

    transition: background 200ms ease;
}

.menu-option-container:first-child > .menu-option {
    border-top-left-radius: calc(50px / 2);
    border-top-right-radius: calc(50px / 2);
}

.menu-option-container:last-child > .menu-option {
    border-bottom-right-radius: calc(50px / 2);
    border-bottom-left-radius: calc(50px / 2);
}

.menu-option:hover,
.menu-option-selector-toggle:checked + .menu-option {
    background-color: var(--surface_bright);

    transition: background 0ms ease;
}

.menu-option-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    background-color: var(--primary);
    border-radius: 100%;

    color: var(--on_primary);

    height: 35px;
    aspect-ratio: 1/1;
}

.menu-option-info {
    height: fit-content;
    width: fit-content;
}

.menu-option-title {
    color: var(--on_surface);
    font-weight: bold;
}

.menu-option-current {
    color: var(--on_surface_variant);
    font-size: 0.9rem;
}

.menu-option-selector {
    display: flex;
    flex-direction: column;
    gap: 2px;

    position: absolute;
    right: calc(100% + 4px);
    bottom: 50%;

    transform: scale(0);
    transform-origin: bottom right;

    height: fit-content;
    width: fit-content;

    transition:
        transform 200ms ease,
        right 200ms ease,
        bottom 200ms ease;
}

.menu-option-selector-toggle:checked ~ .menu-option-selector {
    transform: scale(1);
}

.menu-option-selector-option {
    display: flex;
    align-items: center;
    justify-content: center;

    background-color: var(--primary);
    border-radius: 4px;

    color: var(--on_primary);

    cursor: pointer;

    padding: 0 16px;

    height: 50px;
    width: 100%;

    transition:
        background 200ms ease,
        border-radius 200ms ease,
        color 200ms ease;
}

.menu-option-selector-option:hover {
    background-color: var(--inverse_primary);

    color: var(--primary);
}

.menu-option-selector-option:first-of-type,
.menu-option-selector:has(.menu-option-selector-option-toggle:first-of-type:checked) .menu-option-selector-option:nth-of-type(2) {
    border-top-left-radius: calc(50px / 2);
    border-top-right-radius: calc(50px / 2);
}

.menu-option-selector-option:last-of-type,
.menu-option-selector:has(.menu-option-selector-option-toggle:last-of-type:checked) .menu-option-selector-option:nth-last-of-type(2) {
    border-bottom-left-radius: calc(50px / 2);
    border-bottom-right-radius: calc(50px / 2);
}

.menu-option-selector-option-toggle:checked + .menu-option-selector-option {
    background-color: var(--primary_container);
    border-radius: calc(50px / 2);

    color: var(--on_primary_container);
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 64px;

    padding: 16px;

    height: auto;
    width: 100%;
}

.main-section {
    display: flex;
    flex-direction: column;
    gap: 16px;

    height: fit-content;
    width: 100%;
    max-width: 800px;
}

.main-section-bar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 32px;

    border-bottom: 2px solid var(--outline_variant);

    padding-bottom: 8px;

    height: fit-content;
    width: 100%;
}

.main-section-title {
    color: var(--on_surface);
    font-size: 2rem;
    font-weight: bold;
}

.search-project-toggle {
    background-color: var(--surface_container);
    border-radius: calc(40px / 2);
    border: none;
    outline: none;

    color: var(--on_surface);
    font-size: 1rem;

    padding: 0 16px;

    height: 40px;
    width: 200px;

    transition: background 200ms ease;
}

.search-project-toggle:hover,
.main-section-bar:focus-within .search-project-toggle {
    background-color: var(--surface_bright);
}

.search-project-toggle::placeholder {
    color: var(--on_surface_variant);
}

.project-container {
    display: none;
    align-items: center;
    justify-content: center;

    background-color: rgba(0, 0, 0, 0.75);

    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10000;

    padding: 8px;
}

.project-toggle:checked + .project-container {
    display: flex;
}

.project-toggle-label {
    display: flex;
    align-items: center;
    justify-content: center;

    background-color: var(--error);
    border-radius: 100%;
    box-shadow: 0 0 8px 0 var(--shadow);

    color: var(--on_error);

    cursor: pointer;

    position: absolute;
    top: 16px;
    left: 16px;

    height: 40px;
    aspect-ratio: 1/1;

    transition:
        background 200ms ease,
        color 200ms ease;
}

.project-toggle-label:hover {
    background-color: var(--error_container);

    color: var(--on_error_container);
}

.project {
    display: flex;
    flex-direction: column;

    background-color: var(--surface_container);
    border-radius: 16px;

    position: relative;

    overflow-y: auto;

    height: fit-content;
    max-height: 100%;
    width: 100%;
    max-width: calc(800px - 200px);
}

.project-image {
    border-radius: inherit;

    width: 100%;
}

.project-content {
    display: flex;
    flex-direction: column;
    gap: 16px;

    padding: 16px;

    overflow-y: auto;

    height: fit-content;
    width: 100%;
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 4px;

    height: fit-content;
    width: fit-content;
}

.project-title {
    color: var(--on_surface);
    font-size: 1.75rem;
}

.project-tool-container {
    display: flex;
    gap: 4px;

    background-color: var(--surface_container_high);
    border-radius: calc(30px / 2);

    padding: 4px 8px;

    height: 30px;
    width: fit-content;
}

.project-tool-container img {
    height: 100%;
}

.project-description {
    color: var(--on_surface_variant);
}

.project-button-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    height: fit-content;
    width: 100%;
}

.project-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    background-color: var(--primary);
    border-radius: calc(50px / 2);

    color: var(--on_primary);
    text-decoration: none;

    padding: 16px;

    height: 50px;
    width: 100%;

    transition:
        background 200ms ease,
        color 200ms ease;
}

.project-button:hover {
    background-color: var(--inverse_primary);

    color: var(--primary);
}

.project-button img {
    height: 100%;
}

.project-toggle-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    background-color: var(--surface_container);
    border-radius: calc(16px + 8px);

    padding: 8px;

    overflow-y: auto;

    height: fit-content;
    max-height: 400px;
    width: 100%;
}

#project-toggle-container-toggle:checked + .project-toggle-container {
    background-color: transparent;

    padding: 0;

    overflow: visible;

    max-height: none;
}

.project-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    background-color: var(--surface_container_high);
    background-position: center;
    background-size: 100%;
    border-radius: 16px;

    cursor: pointer;

    position: relative;

    padding: 16px;

    width: calc((100% - (8px * (2 - 1))) / 2);
    aspect-ratio: 16/9;

    transition: background 200ms ease;
}

.project-toggle:hover {
    background-size: 110%;
}

#project-toggle-container-toggle:checked + .project-toggle-container .project-toggle {
    background-color: var(--surface_container);
}

#project-toggle-dotfiles {
    background-image: url("assets/projects-images/dotfiles.png");
}

.project-toggle::before {
    content: "";

    background: linear-gradient(to top, var(--shadow), transparent);
    border-radius: inherit;

    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
}

.project-toggle::after {
    content: "";

    background-color: var(--surface_bright);
    border-radius: inherit;
    opacity: 0;

    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;

    transition: opacity 200ms ease;
}

.project-toggle:hover::after {
    opacity: 0.5;

    transition: opacity 0ms ease;
}

.project-toggle > * {
    position: relative;
    z-index: 1;
}

.project-toggle-data {
    display: flex;
    align-items: center;
    gap: 8px;

    background-color: var(--surface_container_high);
    border-radius: calc(40px / 2);
    box-shadow: 0 0 8px 0 var(--shadow);

    color: var(--on_surface);

    margin-left: auto;
    padding: 8px;

    height: 40px;
    width: fit-content;
}

.project-toggle-data-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    background-color: var(--primary);
    border-radius: 100%;

    color: var(--on_primary);

    height: 100%;
    aspect-ratio: 1/1;
}

.project-toggle-title {
    color: #eeeeee;
    font-size: 1.5rem;
    font-weight: bold;
}

.project-toggle-container-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;

    background-color: var(--primary);
    border-radius: calc(50px / 2);

    color: var(--on_primary);

    cursor: pointer;

    position: relative;

    margin-left: auto;
    padding: 0 16px;

    height: 50px;
    width: fit-content;

    transition:
        background 200ms ease,
        border-radius 200ms ease,
        color 200ms ease;
}

.project-toggle-container-toggle-label:hover {
    background-color: var(--inverse_primary);

    color: var(--primary);
}

.project-toggle-container-toggle-label span {
    transition: opacity 200ms ease;
}

.project-toggle-container-toggle-label span:last-of-type {
    opacity: 0;

    position: absolute;
}

#project-toggle-container-toggle:checked ~ .project-toggle-container-toggle-label span:first-of-type {
    opacity: 0;

    position: absolute;
}

#project-toggle-container-toggle:checked ~ .project-toggle-container-toggle-label span:last-of-type {
    opacity: 1;

    position: static;
}

.project-toggle-container-toggle-label i {
    transition: transform 200ms ease;
}

#project-toggle-container-toggle:checked ~ .project-toggle-container-toggle-label i {
    transform: rotateX(180deg);
}

@media (max-width: calc(800px + (16px * 2))) {
    .project-toggle {
        width: 100%;
    }
}

@media (max-width: 400px) {
    .navbar {
        right: 8px;
        bottom: 8px;
        left: 8px;

        transform: translateX(0);

        width: auto;
    }

    .search-section-container {
        width: 100%;
    }

    .search-section {
        padding: 0 8px;

        width: 100%;
    }

    .search-project-toggle {
        padding: 0 8px;

        width: 100%;
    }

    .menu-option-selector {
        right: 100%;
        bottom: calc(100% + 4px);

        transform: scale(0) translateX(50%);
    }


    .menu-option-selector-toggle:checked ~ .menu-option-selector {
        transform: scale(1) translateX(50%);
    }
}
