@supports (font-size: clamp(1rem, 1vi, 1rem)) {
    :root {
        --font-size-base: clamp(1rem, 0.13vi + 0.97rem, 1.13rem);
        --font-size-h6: clamp(1.13rem, 0.23vi + 1.07rem, 1.35rem);
        --font-size-h5: clamp(1.27rem, 0.37vi + 1.18rem, 1.62rem);
        --font-size-h4: clamp(1.42rem, 0.54vi + 1.3rem, 1.94rem);
        --font-size-h3: clamp(1.6rem, 0.76vi + 1.42rem, 2.33rem);
        --font-size-h2: clamp(1.8rem, 1.04vi + 1.56rem, 2.8rem);
        --font-size-h1: clamp(2.03rem, 1.38vi + 1.7rem, 3.36rem);
    }
}


@supports not (font-size: clamp(1rem, 1vi, 1rem)) {
    :root {
        --font-size-base: 1rem;
        --font-size-h6: 1.13rem;
        --font-size-h5: 1.27rem;
        --font-size-h4: 1.42rem;
        --font-size-h3: 1.6rem;
        --font-size-h2: 1.8rem;
        --font-size-h1: 2.03rem;
    }

    @media screen and (min-width: 1920px) {
        :root {
            --font-size-base: 1.13rem;
            --font-size-h6: 1.35rem;
            --font-size-h5: 1.62rem;
            --font-size-h4: 1.94rem;
            --font-size-h3: 2.33rem;
            --font-size-h2: 2.8rem;
            --font-size-h1: 3.36rem;
        }
    }
}


::-moz-selection {
    background: #1b1b1b;
    text-shadow: none;
    color: #f9f9f9
}

::selection {
    background: #1b1b1b;
    text-shadow: none;
    color: #f9f9f9
}

:root {
    --line-height: calc(10px + 2ex);
    --heading-line-height: calc(8px + 2ex);
    --section-space: 2em;
    --primary: #f0f0f0;
    --accent: #eeeeee;
    --border-color: #dfdfdf;
    --link-color: #0e4e8d;
}

:is(h1, h2, h3, h4, h5, h6) {
    color: var(--heading-color);
    line-height: var(--heading-line-height);
    text-wrap: pretty;
    font-family: "IBM Plex Sans", sans-serif;
}

h1 {
    font-size: var(--font-size-h1);
}

h2 {
    font-size: var(--font-size-h2);
}

h3 {
    font-size: var(--font-size-h5);
}

h4 {
    font-size: var(--font-size-h4);
}

h5 {
    font-size: var(--font-size-h5);
}

body {
    font-size: var(--font-size-base);
    font-family: "IBM Plex Sans", sans-serif;
    color: var(--text-color);
    line-height: var(--line-height);
    font-weight: 400;
    text-wrap: pretty;
}

#content {
    margin: 0 auto;
    max-width: 51.2rem;
    width: 93.75%;
}

h2 {
    margin-top: var(--section-space);
}

#content a {
    border: none;
    text-decoration: none;
    background-position: 100% 100%, 0 100%, 0 100%;
    background-repeat: no-repeat;
    background-size: 100% 2px, 0 2px, 0 2px;
    background-image: linear-gradient(var(--link-color), var(--link-color)), linear-gradient(transparent, transparent), linear-gradient(var(--link-color), var(--link-color));
    color: var(--link-color);
    animation-duration: .8s;
    animation-timing-function: ease-in-out;
}

#content a:hover {
    animation-name: animated-text-link;
    animation-duration: .8s;
    animation-timing-function: ease-in-out;
}

ul {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .5em;
    flex-wrap: nowrap;
}

ul li::marker {
    color: #d8d0d0;
}

/* Accordions */

summary {
    position: relative;
}

summary::marker {
    content: none;
}

summary::before,
summary::after {
    content: '';
}

summary::before,
summary::after {
    width: .75em;
    height: 0;
    border-bottom: 2px solid;
    position: absolute;
    top: calc(50% - 1px);
    right: 0;
    transform: translateY(-50%);
}

summary::after {
    transform: rotate(90deg);
    transform-origin: 50% 50%;
}

[open] summary::after {
    transform: rotate(0deg);
}


/* styles ported over from the second example */
@layer step2styles {
    details {
        border: 1px solid;
        padding: 0 1rem;
        background: white;
        border-radius: .3em;
    }

    details+details {
        border-top: none;
    }

    details[open] {
        padding-bottom: 1em;
    }

    summary {
        padding: 1rem 2em 1rem 0;
        font-size: 1.25rem;
        font-weight: bold;
        cursor: pointer;
    }
}

.date {
    display: flex;
    font-size: var(--font-size-base);
    font-weight: 400;
    opacity: .6;
}

.job-position {
    padding: clamp(1rem, 2vw, 3rem);
    border-radius: .3em;
    border-color: var(--border-color);
    background-color: var(--primary);
    border: solid .05em var(--border-color);
    margin-block: var(--section-space);
}

.job-position h3 {
    margin-top: 0;
}

/* Eduation */

.education-item {
    padding-block: 1em;
}

.education-item:first-of-type {
    padding-top: 0;
}

.education-item:not(:last-of-type) {
    border-bottom: solid .05em;
}

/* Skills */

.skills-boxes {
    margin-block: var(--section-space);
}

.skills-boxes ul {
    display: flex;
    list-style: none;
    flex-direction: row;
    flex-wrap: wrap;
}

.skills-boxes ul li {
    background-color: var(--accent);
    border-radius: 2em;
    padding: .5em 1em;
    width: fit-content;
    font-size: calc(var(--font-size-base)/1.2);
    border: solid .1em var(--border-color);
    ;
}

.shader {
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, .8));

}

.portfolio {
    display: flex;
    flex-direction: column;
    align-content: center;
    justify-content: center;
    align-items: center;
    padding: calc(var(--section-space) * 1.5)var(--section-space);
    background-color: var(--accent);
    border-radius: .5em;
    border: solid .1em var(--border-color);
    gap: 1em;
    margin-top: calc(var(--section-space)* 2);
    text-align: center;
}

.portfolio :is(p, h3) {
    margin: 0;
}

.recent-writing {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.recent-writing__writing-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .5em;
    flex-wrap: nowrap;
    max-width: 50ch;
    padding-inline-start: 0;
    list-style: none;
}

.recent-writing__writing-list__item:not(:last-of-type) {
    border-bottom: solid .05em;
    padding-bottom: var(--section-space);
}

.recent-writing__writing-list__item h3 {
    font-size: var(--font-size-h6);
}

.recent-writing__writing-list__item p {
    color: grey;
}

footer {
    display: flex;
    flex-direction: column;
    place-content: center;
    align-items: center;
}

footer ul {
    display: flex;
    flex-direction: row;
    gap: 1em;
    list-style: none;
    padding-inline: 0;
}

.footnote {
    font-size: calc(var(--font-size-base)/1.2);
}


@keyframes animated-text-link {
    0% {
        background-size: 100% 2px, 0 2px, 0 2px
    }

    50% {
        background-size: 0 2px, 100% 2px, 0 2px
    }

    to {
        background-size: 0 2px, 0 2px, 100% 2px
    }
}

/* Projects Grid Styles */
.projects-grid {
    margin-top: calc(var(--section-space) * 2);
}

.projects-grid h3 {
    margin-bottom: var(--section-space);
    text-align: center;
}

.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.project-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 0.5em;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 250px;
    position: relative;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.project-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.project-image video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    background-color: #f0f0f0;
}

/* Fallback for when video doesn't load */
.project-image:not(:has(video)) {
    background-color: #f0f0f0;
}

.project-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 1rem;
    font-weight: 600;
    font-size: var(--font-size-h6);
    z-index: 2;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-content {
    padding: 1.5rem;
    text-align: center;
    max-width: 90%;
}

.project-content h4 {
    color: white;
    margin-bottom: 0.75rem;
    font-size: var(--font-size-h5);
    font-weight: 600;
}

.project-content p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
    line-height: 1.5;
    font-size: calc(var(--font-size-base) * 0.9);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.tag {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 0.5rem;
    font-size: calc(var(--font-size-base) * 0.55);
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .projects-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .project-card {
        height: 200px;
    }
    
    .project-content {
        padding: 1rem;
    }
    
    .project-content h4 {
        font-size: var(--font-size-h6);
    }
    
    .project-content p {
        font-size: calc(var(--font-size-base) * 0.85);
    }
}

/* Print styles for projects */
@media print {
    .projects-grid {
        page-break-inside: avoid;
    }
    
    .project-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
        height: auto;
        margin-bottom: 1cm;
    }
    
    .project-overlay {
        position: static;
        opacity: 1;
        background: white;
        color: black;
    }
    
    .project-title {
        position: static;
        background: none;
        color: black;
        padding: 0.5cm 0;
        border-bottom: 1px solid #000;
    }
    
    .project-content h4 {
        color: black;
        margin-bottom: 0.25cm;
    }
    
    .project-content p {
        color: black;
        margin-bottom: 0.5cm;
    }
    
    .tag {
        background: #f0f0f0;
        color: black;
        border: 1px solid #000;
    }
}
