@font-face {
    font-family: "Georgia";
    src: url("fonts/Georgia.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Georgia";
    src: url("fonts/Georgia Italic.ttf") format("truetype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Georgia";
    src: url("fonts/Georgia Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Georgia";
    src: url("fonts/Georgia Bold Italic.ttf") format("truetype");
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "PublicSans";
    src: url("fonts/PublicSans-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: bold;
    font-display: swap;
}

@font-face {
    font-family: "PublicSans";
    src: url("fonts/PublicSans-Medium.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

* {
    text-wrap: balance;
}

html,
body {
    overscroll-behavior: none;
}

:root {
    font-size: 22px;
    --work-area-start: 40.5rem;
    --work-frame-width-ratio: 0.8;
    --mobile-page-pad: 1rem;
    --mobile-stripe-height: 33vh;
}

body {
    display: flex;
    gap: 1.6rem;
    margin: 2rem;
    color: #000;
    background: #fff;
    font: 1rem/1 "Georgia";
}

body > :not(.work-panel):not(.work-close):not(script) {
    transition: filter 300ms linear;
}

body.has-work-blur > :not(.work-panel):not(.work-close):not(script) {
    filter: blur(2px) brightness(1.2);
}

h1,
h2,
p,
ul {
    margin: 0;
    line-height: 1.2;
}

h1,
h2 {
    font-family: "PublicSans";
    font-size: 1rem;
    font-weight: normal;
}

a {
    color: inherit;
}

ul {
    padding: 0;
    list-style: inside "⧆  ";
}

#stripe {
    position: fixed;
    width: 16rem;
    height: calc(100vh - 4rem);
    object-fit: cover;
    mask-image: linear-gradient(to bottom, white, white, white, transparent);
}

#main {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-left: 17.5rem;
}

#header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 18rem;

    > :nth-child(1) {
        font-size: 1.5rem;
    }
}

#title {
    font-family: "PublicSans";
    font-weight: bold;
}

#philosophy,
#expectations {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#expectations {
    max-width: 20rem;
}

.work-panel {
    position: fixed;
    display: flex;
    top: 50vh;
    left: calc(
        var(--work-area-start) + ((100vw - var(--work-area-start) - 2rem) / 2)
    );
    width: min(18rem, calc((100vh - 4rem) * var(--work-frame-width-ratio)));
    aspect-ratio: 1508 / 1917;
    transform: translate(-50%, -50%);
    overflow: hidden;
    overscroll-behavior: none;
    background: url("images/frame.webp") center / 100% 100% no-repeat;
    filter: blur(18px) opacity(0);
    transition:
        top 900ms cubic-bezier(0.16, 1, 0.3, 1),
        left 900ms cubic-bezier(0.16, 1, 0.3, 1),
        width 900ms cubic-bezier(0.16, 1, 0.3, 1),
        filter 300ms linear;
    will-change: filter;
    z-index: 2;
}

.work-panel,
.work-panel * {
    box-sizing: border-box;
}

.work-panel.is-visible {
    animation: pop-in-focus 600ms cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.work-panel.is-hidden {
    animation: pop-out-blur 600ms cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.work-panel.is-expanded {
    top: 50vh;
    left: 50vw;
    width: min(80vw, calc(80vh * var(--work-frame-width-ratio)));
    animation: none;
    filter: blur(0) opacity(1);
    z-index: 20;
}

.work-panel.is-expanded.is-hidden {
    animation: pop-out-blur 600ms cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.work-list {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    transform: translateZ(0) scale(var(--work-frame-width-ratio)) scaleX(96%);
    transform-origin: center;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 0;
    outline: 0;
    background: #fff;
    box-shadow: 0 0 0 1px #fff;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    -webkit-tap-highlight-color: transparent;
}

.work-list:focus,
.work-list:focus-visible {
    outline: 0;
}

.work-track {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.work-track.is-marqueeing {
    will-change: transform;
}

.work-card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.55rem 0.55rem 0.8rem;
    background: #fff;
}

.work-card img {
    width: 100%;
    aspect-ratio: 5 / 4;
    object-position: top;
    object-fit: cover;
    background: #eee;
    border: 1px solid #000;
}

.work-card:nth-child(2) img {
    object-position: 50% 35%;
}

.work-card:nth-child(3) img {
    object-position: 50% 70%;
}

.work-card p {
    font-size: 0.8rem;
}

.work-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 30;
    padding: 0;
    border: 0;
    color: #000;
    background: transparent;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
    opacity: 0;
    transition: opacity 200ms linear;
    background: white;
    padding: 8px;
}

.work-close.is-visible {
    opacity: 1;
}

@media (max-aspect-ratio: 5/4) and (max-width: 1000px) {
    :root {
        font-size: 18px;
    }

    body {
        display: block;
        margin: var(--mobile-page-pad);
    }

    #stripe {
        top: var(--mobile-page-pad);
        left: var(--mobile-page-pad);
        width: calc(100vw - 2rem);
        height: calc(var(--mobile-stripe-height) - var(--mobile-page-pad));
        max-height: none;
        z-index: 1;
    }

    #main {
        gap: 2rem;
        margin-top: calc(var(--mobile-stripe-height) + 1rem);
        margin-left: 0;
        padding-bottom: 2rem;
    }

    #header,
    #expectations {
        max-width: none;
    }

    #header {
        gap: 0.9rem;

        > :nth-child(1) {
            font-size: 1.32rem;
        }
    }

    .work-panel {
        top: calc(16.5vh + 0.5rem);
        left: 50vw;
        width: min(
            12rem,
            calc(100vw - 3rem),
            calc(
                (
                        var(--mobile-stripe-height) - var(--mobile-page-pad) -
                            0.75rem
                    ) *
                    var(--work-frame-width-ratio)
            )
        );
    }

    .work-panel.is-expanded {
        top: 50vh;
        left: 50vw;
        width: min(95vw, calc(88vh * var(--work-frame-width-ratio)));
    }

    .work-card {
        gap: 0.45rem;
        padding: 0.45rem 0.45rem 0.7rem;
    }

    .work-list h2,
    .work-card p {
        font-size: calc(1rem / var(--work-frame-width-ratio));
    }

    .work-close {
        top: auto;
        right: auto;
        bottom: 0.75rem;
        left: 50%;
        transform: translateX(-50%);
        border: 1px solid black;
    }
}

@keyframes pop-in-focus {
    0% {
        filter: blur(18px) opacity(0);
    }

    100% {
        filter: blur(0) opacity(1);
    }
}

@keyframes pop-out-blur {
    0% {
        filter: blur(0) opacity(1);
    }

    100% {
        filter: blur(14px) opacity(0);
    }
}
