:root {
    --background-color: #f0f0f0;
    --bg-pattern-color: #e0e0e0;
    --card-background-color: #ffffff;

    --experience-text-color: #000000;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #2B2B2B;
        --bg-pattern-color: #353535;
        --card-background-color: #3A3A3A;

        --experience-text-color: #FFFFFF;
    }
}

.scene {
    min-height: 100dvh;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 2rem, var(--bg-pattern-color) 2rem, var(--bg-pattern-color) 4rem);
    background-color: var(--background-color);
    display: flex;
    gap: clamp(0rem, 1.5vw + 1rem, 3rem);
    padding-top: clamp(var(--nav-height) - 4rem, 20vh, var(--nav-height))
}

.scene > div {
    flex: 1;
    margin: 1rem;
}

.scene > div h1 {
    color: var(--text-color);
    margin-bottom: 2rem;
}

/* Experience */

.experiences-flex {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.experience {
    padding: 1rem;
    display: flex;
    gap: 1rem;
    color: var(--experience-text-color);
    box-shadow: var(--very-dark-shading) 0 0 0.25rem 0.25rem;
}

.experience img {
    width: clamp(4rem, 7.5vw + 1rem, 10rem);
    aspect-ratio: 1/1;
    object-fit: contain;
    object-position: top;
    filter: shadow(0 3px 15px var(--experience-text-color));
}

.experience section {
    width: 100%;
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

.company {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.company .name {
    text-transform: uppercase;
    font-size: clamp(1.25rem, 1.5vw + 0.5rem, 2rem);
}

.company .role-name, .company .date {
    font-size: clamp(1rem, 0.75vw + 0.5rem, 1.5rem);
    font-weight: 400;
}

.experience ul {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    font-weight: 250;
}

.experience li {
    font-size: clamp(0.75rem, 0.75vw + 0.25rem, 1.3rem);
    list-style: none;
}


/* Projects */


.projects-grid {
    display: grid;
    justify-content: center;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    width: 100%;
    gap: 2rem;
    height: max-content;
}

.project-card {
    position: relative;
    background: var(--card-background-color);
    height: 20rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.5rem;
    user-select: none;
    cursor: pointer;
    box-shadow: var(--very-dark-shading) 0 0 0.25rem 0.25rem;
    overflow: visible;
}

.project-type-tag {
    position: absolute;
    background: var(--bg-pattern-color);
    color: var(--text-color);
    font-size: clamp(1rem, 1.25vw + 0.25rem, 1.25rem);
    padding: 0.25rem 0.5rem 0.25rem 0.5rem;
    text-transform: uppercase;
    top: -0.5rem;
    left: -0.5rem;
    z-index: 1;
    box-shadow: var(--dark-shading) 0.1rem 0.1rem 0 0;
}

.project-card:active {
    box-shadow: inset 0 0 0.25rem 0.25rem var(--very-dark-shading);
    filter: invert(15%);
}

.project-card img {
    background: var(--bg-pattern-color);
    height: 75%;
    object-fit: cover;
}

.project-card h2 {
    font-size: clamp(1.5rem, 1.25vw + 0.25rem, 2rem);
    text-transform: uppercase;
    line-height: 2rem;
    color: var(--text-color);
}

/* Project Dialog */

#project-dialog:is([open]) {
    background: var(--background-color);
    width: 30rem;
    height: 45rem;
    inset: 0;
    margin: auto;
    display: flex;
    flex-direction: column;
    box-shadow: var(--light-shading) -0.5rem 0.5rem 0 0;
    border: none;
}

body:has(#project-dialog[open]) {
    overflow: hidden;
}

#project-dialog img {
    display: block;
    width: 100%;
    height: clamp(5rem , 55vh, 20rem);
    object-fit: cover;
    background: var(--bg-pattern-color);
}

#project-dialog section {
    display: flex;
    position: relative;
    flex-direction: column;
    margin-top: 0.5rem;
    padding: 0 1rem 0 1rem;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

#project-dialog h2 {
    color: var(--text-color);
    line-height: 2.25rem;
    font-size: clamp(1.5rem, 4vw + 0.25rem, 2.15rem);
    text-transform: uppercase;
}

#project-dialog h2::after {
    content: '';
    display: block;
    width: 12%;
    height: 0.25rem;
    background: var(--text-color);
    margin-top: 0.25rem;
}

#project-dialog p {
    color: var(--text-secondary-color);
    font-size: clamp(1rem, 1.25vw + 0.5rem, 1.15rem);
    line-height: 1.5;
}

#project-dialog .close-button {
    position: fixed;
    aspect-ratio: 1/1;
    padding: 0.25rem;
    font-size: 2.75rem;
    line-height: 0;
    user-select: none;
    cursor: pointer;
    color: var(--text-color);
    background: var(--card-background-color);
    z-index: 1;
    overflow: hidden;
    box-shadow: var(--very-dark-shading) 0 0 0.1rem 0.1rem;
}

#project-dialog .project-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

#project-dialog .project-skills span {
    color: var(--text-color);
    background: var(--bg-pattern-color);
    font-size: clamp(1rem, 1.25vw + 0.5rem, 1.5rem);
    padding: 0 1rem 0 1rem;
    line-height: 2rem;
    text-transform: uppercase;
    user-select: none;
}

#project-dialog .project-footer {
    margin-top: auto;
    padding-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    font-size: clamp(1.15rem, 1.25vw + 0.25rem, 1.5rem);
}

#project-dialog .project-footer a {
    padding: 0.5rem 1rem 0.5rem 1rem;
    text-transform: uppercase;
}

#project-dialog .project-footer .project-year {
    color: var(--text-secondary-color);
}

#project-dialog .close-button:active {
    box-shadow: inset 0 0 0.25rem 0.25rem var(--very-dark-shading);
    filter: invert(15%);
}

#project-dialog .disabled {
    background: var(--medium-shading);
    color: var(--text-secondary-color);
    pointer-events: none;
    cursor: default;

}

::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

@media (max-width: 480px) {
    .projects-grid {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: 0;
    }

    .experience {
        flex-direction: column;
        padding: 0.5rem;
    }

    .project-card {
        background: var(--card-background-color);
        height: 20rem;
        width: 100%;
        display: flex;
        flex-direction: column;
        padding: 0.5rem;
    }
}

@media (max-width: 900px) {
    .scene {
        flex-direction: column;
    }
}