html {
    font-size: 16px;
    container-type: scroll-state;
    container-name: head-container;
    scroll-behavior: smooth;
}

body {
    cursor: default;
    overscroll-behavior: contain;
}

.site-nav {
    z-index: 100;
    height: 100lvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    transition:
        top 0.3s ease,
        transform 0.3s ease,
        padding 0.3s ease,
        background 0.3s ease,
        box-shadow 0.3s ease;
}

.site-nav ul {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
    transition: gap 0.3s ease, flex-direction 0.3s ease;
}

.site-nav ul li {
    font: 400 1rem "Roboto Mono", monospace;
    letter-spacing: 2px;
    transition: font-size 0.3s ease;
}

.site-nav a {
    display: inline-block;
    text-decoration: none;
    color: black;
    translate: 0 0;
    transition: 0.2s translate, 0.2s color;
}

.site-nav a:hover {
    translate: 0 -2px;
    color: #EA2264;
}

.site-nav.scrolled {
    top: 0;
    left: 0;
    right: 0;
    transform: translateY(0);
    z-index: 100;
    padding: 1rem 2rem;
    background: rgb(255 255 255 / 0.95);
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 12px rgb(0 0 0 / 0.08);
}

.site-nav.scrolled ul {
    flex-direction: row;
    gap: 2rem;
}

.site-nav.scrolled ul li {
    font-size: 0.8rem;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: auto;
    min-height: 100lvh;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1em;
    margin: 0;
    z-index: 101;
    pointer-events: none;
}

header h1 {
    font: 1000 4rem "Roboto Mono", monospace;
    letter-spacing: 4px;
    transform-origin: center;
    translate: 0 0;
    transition: 0.4s translate, 0.4s font-size;
    pointer-events: auto;
}

header h1.scrolled {
    translate: 40vw 0;
    font-size: 1rem;
}

.home,
.about,
.projects,
.portfolio,
.writing,
.services {
    scroll-margin-top: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100lvh;
    width: 100%;
}

.aboutBox,
.servicesBox {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    width: min(80%, 100ch);
    padding: 2rem;
    border-radius: 1.2rem;
    background: rgb(234 34 100 / 0.2);
    box-shadow: 0 10px 10px rgb(0 0 0 / 0.1);
    outline: 3px solid rgb(234 34 100 / 0.2);
}

.servicesBox {
    background: rgb(13 17 100 / 0.2);
    outline: 3px solid rgb(13 17 100 / 0.2);
    padding-inline: 3rem;
}

.aboutBox span,
.servicesBox p {
    text-wrap: pretty;
    text-justify: none;
    font: 300 1.2rem 'Inter', sans-serif;
    line-height: 1.5;
    width: 100%;
    letter-spacing: .5px;
    position: relative;
}

.inlineLink {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: rgb(13 17 100);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: .5rem;
    text-decoration-thickness: .1em;
    transition:
        0.2s text-underline-offset,
        0.2s text-decoration-thickness;
}

.aboutBox a,
.altInfo a {
    color: rgb(13 17 100);
    text-underline-offset: .5rem;
    text-decoration-thickness: .1em;
    transition:
        0.2s text-underline-offset,
        0.2s text-decoration-thickness;
}

.aboutBox a:hover,
.altInfo a:hover,
.inlineLink:hover {
    text-underline-offset: .6rem;
}

.aboutBox b {
    font-weight: 500;
}

.servicesBox p::before {
    font-family: "Material Symbols Outlined";
    content: "\f88b";
    position: absolute;
    left: -2rem;
    color: rgb(13 17 100 / 0.7);
}

.services {
    gap: 1.5rem;
    padding: 1.5rem;
}

.servicesBox {
    margin-top: 5rem;
}

.services h2 {
    display: inline;
    position: relative;
    font: 300 2rem "Merriweather", serif;
    width: min(fit-content, 45ch);
    text-wrap: balance;
}

.services h2::after {
    content: "";
    z-index: -1;
    position: absolute;
    height: 0.6rem;
    width: 100%;
    left: 0;
    bottom: 0.1rem;
    background: rgb(247 141 96 / 0.3);
    transform: scaleX(0);
    transform-origin: left;
    animation: slideRight both ease-in-out;
    animation-timeline: view();
    animation-range: entry 25% cover 35%;
}

.highlightText {
    font: 500 2.2rem 'Inter', sans-serif;
    letter-spacing: -1px;
    color: rgb(13 17 100 / 0.7);
}

footer {
    font: 400 1rem "Roboto Mono", monospace;
    height: 3rem;
    width: 100%;
}

footer ul {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
}

footer ul li {
    padding-inline: 2rem;
}

footer ul li span {
    scale: 1.2;
    padding: 0;
    margin: 0;
}

.fixedCTA,
.backToTop {
    appearance: none;
    -webkit-appearance: none;
    font: 700 1rem 'Inter', sans-serif;
    letter-spacing: -1px;
    z-index: 1;
    position: fixed;
    bottom: 4rem;
    right: 2rem;
    padding: 0.75rem;
    opacity: 0;
    pointer-events: none;
    background: white;
    border: none;
    border-radius: 1.2rem;
    outline: 0.2em solid rgb(13 17 100 / 0.8);
    outline-offset: 0;
    cursor: pointer;
    transition: 0.4s opacity 1s, 0.2s outline-width, 0.2s outline-offset;
}

.fixedCTA {
    /* right: 6rem; */
    background: rgb(255 255 255 / 0.3);
    backdrop-filter: blur(8px);
    transition: 0.2s background ease, 0.2s color ease;
}

.backToTop {
    bottom: 8rem;
    outline: none;
    scale: 2;
    color: #000;
    background: none;
    padding: 0;
}

.backToTop:hover {
    scale: 2.2;
}

.fixedCTA:hover,
.submitBtn:hover {
    outline-width: 0;
    outline-offset: 0;
    background: rgb(13 17 100 / 0.8);
    color: white;
}

.fixedCTA.scrolled,
.backToTop.scrolled {
    opacity: 1;
    pointer-events: auto;
}

#my-dialog {
    border-radius: 1.2rem;
    box-shadow: 0 10px 10px rgb(0 0 0 / 0.1);
    border: none;
    background: rgb(255 255 255 / 0.4);
    width: 30lvw;
    max-width: 100%;
    height: 75lvh;
    overflow-y: auto;
    margin: 0;
    font: 300 1rem 'Inter', sans-serif;
    transform-origin: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    overscroll-behavior: contain;
}

#my-dialog::backdrop {
    background: rgb(0 0 0 / 0.3);
    backdrop-filter: blur(8px);
}

#my-dialog h3 {
    font: 600 1.5rem "Roboto Mono", monospace;
    margin-bottom: 3rem;
    align-self: center;
    text-wrap: wrap;
    color: rgb(13 17 100);
}

.dialog-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding: 2rem;
}

#my-dialog form {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%;
}

#my-dialog form label {
    font: 600 0.9rem 'Inter', sans-serif;
    margin-bottom: 0.5em;
    margin-left: 0.75rem;
}

#my-dialog form input,
#my-dialog form textarea {
    margin-bottom: 1.5rem;
    border: none;
    border-bottom: 2px solid rgb(13 17 100 / 0.7);
    background: #eee;
    padding: 0.75rem;
    letter-spacing: 0.5px;
    border-radius: 0.2em;
}

#my-dialog form input:focus,
#my-dialog form textarea:focus {
    background: white;
    outline: 2px solid rgb(13 17 100 / 0.7);
}

#my-dialog form textarea {
    resize: none;
    field-sizing: content;
}

#my-dialog p {
    text-align: left;
    margin-top: 2rem;
}

#my-dialog form label:has(+ input:required)::after {
    content: " *" / "Required";
}

.submitBtn {
    appearance: none;
    -webkit-appearance: none;
    width: fit-content;
    align-self: center;
    font: 700 1rem 'Inter', sans-serif;
    letter-spacing: -1px;
    padding: 0.75rem;
    margin-top: 1rem;
    background: white;
    border: none;
    border-radius: 1.2rem;
    outline: 0.2em solid rgb(13 17 100 / 0.4);
    outline-offset: 0;
    cursor: pointer;
    transition:
        0.4s opacity 1s,
        0.2s outline-width ease,
        0.2s outline-offset ease,
        0.2s background ease,
        0.2s color ease;
}

/* .submitBtn:hover {
    outline-width: 0.3em;
    outline-offset: 0.1em;
} */

.altInfo {
    letter-spacing: .5px;
    align-self: center;
}

.close-dialog-btn {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: none;
    position: absolute;
    top: 1em;
    right: 1em;
    cursor: pointer;
}

.close-dialog-btn span {
    font-size: 2rem;
    font-variation-settings: 'wght' 1000;
    transition: 0.2s font-variation-settings ease;
}

.close-dialog-btn span:hover {
    font-variation-settings: 'wght' 400;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideRight {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

@supports (animation-timeline: scroll()) {
    @container head-container scroll-state(scrollable: top) {
        header h1 {
            translate: 40vw 0;
            font-size: 1rem;
        }

        .fixedCTA,
        .backToTop {
            opacity: 1;
            pointer-events: auto;
        }

        .site-nav {
            position: fixed;
            left: 0;
            right: 0;
            height: auto;
            padding: 1rem 2rem;
            background: rgb(255 255 255 / 0.95);
            backdrop-filter: blur(8px);
            box-shadow: 0 1px 12px rgb(0 0 0 / 0.08);
            transform: translateY(0);
            top: 0;
        }

        .site-nav ul {
            flex-direction: row;
            gap: 2rem;
            height: auto;
        }

        .site-nav ul li {
            font-size: 0.8rem;
        }

        @media only screen and (max-width: 600px) {
            .site-nav {
                padding: 1rem;
                justify-content: flex-start;
            }
            .site-nav ul {
                gap: 1rem;
                padding-left: .5rem;
            }
            header h1 {
                padding-right: 1.5rem;
            }
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .services h2 {
            animation: none;
            opacity: 1;
        }

        .services h2::after {
            animation: none;
            width: 100%;
            transform: scaleX(1);
        }

        .services h2:nth-of-type(5) {
            animation: none;
            font-weight: 800;
        }
    }

    @media only screen and (max-width:768px) {
        .services {
            gap: 2rem;
            padding-block: 3rem;
        }

        .services h2 {
            text-align: center;
        }

        .services h2::after {
            height: 0;
            animation: none;
        }

        .aboutBox,
        .servicesBox {
            width: 100lvw;
            border-radius: 0;
        }

        .callToAction {
            font-size: 1.2rem;
        }

        #my-dialog {
            width: 90%;
        }

        .altInfo {
            font-size: 0.8rem;
        }
    }

    .material-symbols-outlined {
        font-size: 16px;
        font-variation-settings:
            'FILL' 0,
            'wght' 200,
            'GRAD' 0,
            'opsz' 24
    }