* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', 'Noto Sans JP', Helvetica, Arial, sans-serif;
}

:root,
[data-theme="minimal"] {
    --color-bg: #f7f7f8;
    --color-bg-page: #eceef0;
    --color-surface: #ffffff;
    --color-surface-alt: #E6EAEF;
    --color-surface-alternating: #f5f7fa;
    --color-text: #1f2933;
    --color-text-muted: #5c6b7a;
    --color-accent: #2b3a55;
    --color-accent-hover: #3d5075;
    --color-border: #d8dce0;
    --color-shadow: rgba(31, 41, 51, 0.15);
}

html {
    scroll-behavior: smooth;
    font-size: 1.1rem;
    color: var(--color-text);
}

body {
    background-color: var(--color-bg-page);
}

.intro,
.experience,
footer {
    background-color: var(--color-bg);
}

/* .lang-switcher,
.languages,
.my-projects {
    background-color: var(--color-bg);
} */

ul {
    list-style-type: none;
}

li {
    margin: 1rem 0;
}

a {
    text-decoration: none;
    color: var(--color-accent);
}

/* Display flex and center */
header,
nav,
footer,
.footer-left,
.projects-link,
.intro,
.project,
.anchor-img,
.details,
.lang-left,
header .card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.icons {
    display: flex;
}

header img {
    width: clamp(150px, 50%, 250px);
    aspect-ratio: 1;
    object-fit: cover;
}

html[lang="en"] .name-ja {
    display: none;
}

header {
    padding: 24px 24px;
    gap: 24px;
    flex-direction: row;
    justify-content: flex-start;
    background-color: var(--color-accent);
    color: var(--color-surface-alt);
}

h1 {
    font-size: 1.6rem;
}

nav {
    flex-direction: row;
    height: 10vh;
    gap: 2%;
}

.card,
.introduction {
    border-radius: 8px;
    padding: 8px;
    color: var(--color-text);
}

.introduction {
    margin: 24px;
    padding: 8px;
    max-width: 75%;
}

.languages {
    display: grid;
    grid-template-columns: 1fr 2fr;
    padding: 1rem;
}

.attribute {
    font-size: small;
    color: var(--color-text-muted);
    text-align: center;
}

.lang-right {
    display: grid;
    /* grid-template-columns: repeat(auto-fit, minmax(75px, 1fr)); */
    grid-template-columns: repeat(3, 1fr);
    justify-items: center;
    gap: 8px;
}

.lang-left {
    min-width: 120px;
}

.lang-right svg {
    width: clamp(50px, 4rem, 100px);
    height: auto;
}

@media (min-width: 800px) {
    .lang-right {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        justify-items: center;
        gap: 8px;
    }
    
}

.my-projects,
.experience{
    padding: 2rem 0;
}

.clients {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 80vw;
    margin: 0 auto;
}

.client-card {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    justify-items: center;
    background-color: var(--color-bg-page);
}

.client-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-items: center;
    gap: 8px;
}

.client-card a {
    max-width: 100%;
}

.client-card img {
    width: 100%;
    object-fit: contain;
    margin: auto 0;
    /* background-color: red; */
}

/* .brushup {
    margin: auto 0;
} */


.projects-title {
    padding: 12px;
    max-width: 80vw;
    margin: 0 auto;
}

.project-list {
    display: grid;
    grid-template-columns: 1fr;

    gap: 1rem;
    /* padding: 1rem; */
    max-width: 80vw;
    margin: 0 auto;
}

.project,
.client-card {
    background-color: var(--color-surface);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 4px 6px var(--color-shadow);
    gap: 8px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    text-align: center;
}

@media (min-width: 700px) {

    .client-card {
        grid-template-columns: 1fr 1fr;
    }

    .project-list {
        grid-template-columns: 1fr 1fr;
    }
 
    .odinbook {
        grid-area:  1 / 1 / 2 / 3;
        display: grid;
        grid-template-columns: 1fr 1fr;
        justify-items: center;
    }

    .battleships {
        grid-area: 2 / 1 / 3 / 3;
        display: grid;
        grid-template-columns: 1fr 1fr;
        justify-items: center;
    }

    .toDoList {
        grid-area: 3 / 1 / 4 / 3;
        display: grid;
        grid-template-columns: 1fr 1fr;
        justify-items: center;
    }

    .chess,
    .homepage,
    .tictactoe,
    .flightBooker {
        justify-content: flex-start;
    }
}

.project img {
    width: 100%;
    max-width: clamp(200px, 100%, 250px);
    object-fit: cover;
    margin-left: 6px;
    margin: 0 auto;
}

.project h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tooltip-bubble {
    position: absolute;
    top: 50%;
    background-color: var(--color-accent);
    border-radius: 8px;
    color: var(--color-bg);
    padding: 8px 12px;
    font-size: 0.85rem;
    text-align: center;
    box-shadow: 0 2px 8px var(--color-shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
    transition-delay: 0.5s;
    max-width: 80%;
    z-index: 1;
}

.project:has(.tooltip-link:hover, .tooltip-link:focus) .tooltip-bubble {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.project:hover,
.project:focus {
    box-shadow: 0 12px 24px var(--color-shadow);
}

.project-image-hover {
    /* width: min(100%, 250px); */
    justify-self: center;
    align-self: center;
}

.project-image-link {
    display: block;
    width: 100%;
    position: relative;
    line-height: 0;
    transition: transform 0.3s ease;
}

.project-image-link img {
    display: block;
    /* width: 80%; */
    padding: 0.5rem;
    max-width: none;
    /* transition: transform 0.25s ease; */
}

.project-image-hover:hover .project-image-link,
.project-image-hover:focus-within .project-image-link {
    transform: translateY(-6px);
}

.image-border {
    position: absolute;
    display: block;
    background-color: var(--color-accent);
    pointer-events: none;
}

.border-top {
    top: -6px;
    left: 0;

    width: 100%;
    height: 3px;

    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease-in;
    transition-delay: 0.3s;
}

.border-left {
    top: -6px;
    left: 0;

    width: 3px;
    height: calc(100% + 12px);

    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s ease-in;
    transition-delay: 0.3s;
}

.border-right {
    top: -6px;
    right: 0;

    width: 3px;
    height: calc(100% + 12px);

    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s ease-in;
    transition-delay: 0s;
}

.border-bottom {
    bottom: -6px;
    left: 0;

    width: 100%;
    height: 3px;

    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease-in;
    transition-delay: 0s;
}

.project-image-hover:hover .border-top,
.project-image-hover:focus-within .border-top {
    transform: scaleX(1);
    transition-delay: 0s;
}

.project-image-hover:hover .border-left,
.project-image-hover:focus-within .border-left {
    transform: scaleY(1);
    transition-delay: 0s;
}

.project-image-hover:hover .border-right,
.project-image-hover:focus-within .border-right {
    transform: scaleY(1);
    transition-delay: 0.3s;
}

.project-image-hover:hover .border-bottom,
.project-image-hover:focus-within .border-bottom {
    transform: scaleX(1);
    transition-delay: 0.3s;
}


footer {
    height: 30vh;
    color: var(--color-text);
}

.footer-left {
    gap: 8px;
    padding: 2rem;
}

.lang-switcher {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px 0;
    position: sticky;
}

.lang-switcher button {
    border: 1px solid var(--color-border);
    background-color: var(--color-surface-alt);
    color: var(--color-text);
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.lang-switcher button:hover {
    background-color: var(--color-accent-hover);
    color: var(--color-bg);
}

.lang-switcher button:active {
    transform: scale(0.95);
}

.lang-switcher .active {
    border: 2px solid var(--color-accent);
    background-color: var(--color-accent);
    color: var(--color-surface);
    border-color: var(--color-accent);
} 


.link-text {
    display: inline-block;
    text-decoration: none;
    padding: 4px 4px 4px 4px;
    margin: 0 4px 0 4px;
    border-radius: 8px;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    background-color: transparent;
    z-index: 0;
}

.odin {
    vertical-align: -0.5em;
}

.devicon {
        vertical-align: -0.6em;
}

    .animation-link {
        display: inline-block;
        text-decoration: none;
        padding: 8px;
        border-radius: 50px;
        border: 2px solid var(--color-accent);
        transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        position: relative;
        overflow: hidden;
        background-color: transparent;
        z-index: 0;
    }
    
    .animation-link::before,
    .link-text::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: var(--color-accent);
        z-index: -1;
        transform: scaleX(0);
        transform-origin: right;
        transition: transform 0.5s cubic-bezier(0.86, 0, 0.07, 1);
    }
    .icon-link::before {
        fill: var(--color-bg);
    }
    
    .animation-link:hover,
    .animation-link:focus,
    .link-text:focus,
    .link-text:hover {
        color: var(--color-bg);
        border-color: transparent;
        transform: translateY(-3px);
        box-shadow: 0 10px 20px rgba(14, 165, 233, 0.3);
    }
    .icon-link:hover, 
    .icon-link:focus-visible {
        fill: var(--color-bg);
    }
    
    .animation-link:hover::before,
    .animation-link:focus:before,
    .link-text:hover::before,
    .link-text:focus::before {
        transform: scaleX(1);
        transform-origin: left;
    }


.icon-link {
    margin-top: 6px;
}

svg {
    display: block;
    width: 2rem;
    height: auto;
    border-radius: 8px;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    background-color: transparent;
}

.email {
    padding: 4px;
}

.center-text {
    display: flex;
    align-items: center;
    gap: 8px;
}