@font-face {
    font-family: "Sneaky Times";
    src: url("assets/fonts/Sneaky-Times.woff2") format("woff2"),
         url("assets/fonts/Sneaky-Times.woff") format("woff");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 20px;
}

body {
    min-height: 100dvh;
    font-family: "Sneaky Times", serif;
    font-size: 0.625rem;
    line-height: 1;
    color: #000;
    background: #fff;
    overflow-x: hidden;
}

body.is-about-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    inset: 0;
}

.page {
    transform: translateY(calc(-1 * var(--page-shift, 100dvh)));
}

html.is-ready .page {
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

body.is-about-open .page {
    transform: translateY(0);
}

.about-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 1.25rem;
    padding-bottom: var(--about-nav-gap, 5rem);
}

.about-panel__content {
    max-width: 42rem;
    text-align: center;
    line-height: 1.35;
}

.about-panel__content p + p {
    margin-top: 1em;
}

.about-panel__content a {
    color: #999;
    transition: color 0.15s ease;
}

.about-panel__content a:hover {
    color: #000;
}

a {
    color: inherit;
    text-decoration: none;
}

.top-nav {
    position: relative;
    padding-top: 1.25rem;
    width: 100%;
    text-align: center;
    line-height: 1.1;
}

.top-nav,
.hero {
    opacity: var(--intro-opacity, 1);
}

.top-nav__about,
.top-nav__links,
.top-nav__links a {
    font-family: inherit;
    font-size: inherit;
    color: #999;
    transition: color 0.15s ease;
}

.top-nav__about {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.top-nav__about:hover,
.top-nav__links a:hover {
    color: #000;
}

body.is-about-open .top-nav__about,
body.is-about-open .top-nav__links,
body.is-about-open .top-nav__links a {
    color: #999;
}

body.is-about-open .top-nav__about:hover,
body.is-about-open .top-nav__links a:hover {
    color: #000;
}

.top-nav__links {
    margin-top: 0.05em;
}

.hero {
    min-height: calc(90dvh - 2.5rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.25rem;
}

.hero__name,
.hero__tagline {
    font-size: inherit;
    font-weight: normal;
}

.hero__tagline {
    margin-top: 0.15em;
}

.projects {
    padding: 0 10px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-carousel__external-link,
    .project-carousel__info-btn {
        opacity: 1;
        pointer-events: auto;
    }
}

.project-carousel {
    position: relative;
    cursor: none;
}

.project-carousel.info-is-open {
    cursor: auto;
}

.project-carousel__viewport {
    position: relative;
    aspect-ratio: 4 / 5;
    border-radius: 3px;
    overflow: hidden;
    user-select: none;
}

.project-carousel__viewport img,
.project-carousel__viewport video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.project-carousel__viewport img.is-active,
.project-carousel__viewport video.is-active {
    opacity: 1;
}

.project-carousel__viewport video.is-cover-fill {
    width: 104%;
    height: 104%;
    left: 50%;
    top: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
}

.project-carousel__viewport video.is-cover-fill--letterbox {
    width: 103%;
    height: 105%;
}

.project-carousel__viewport video.is-rotate-90 {
    inset: auto;
    left: 50%;
    top: 50%;
    /* 4:5 viewport: after 90° rotate this box maps 1:1 to the block */
    width: 125%;
    height: 80%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%) rotate(90deg);
    object-fit: contain;
}

.project-carousel__viewport video.is-cover-fill-left {
    inset: auto;
    left: 0;
    top: 50%;
    width: auto;
    height: 100%;
    max-width: none;
    transform: translateY(-50%) scale(1.15);
    transform-origin: left center;
    object-fit: cover;
    object-position: left center;
}

.project-carousel__counter {
    position: fixed;
    z-index: 100;
    display: grid;
    grid-template-columns: auto auto auto;
    grid-template-rows: auto auto;
    column-gap: 0.4em;
    row-gap: 0.2em;
    justify-items: center;
    font-family: "Sneaky Times", serif;
    font-size: 0.625rem;
    line-height: 1;
    color: #fff;
    mix-blend-mode: difference;
    pointer-events: none;
    opacity: 0;
}

.project-carousel__counter.is-visible {
    opacity: 1;
}

.project-carousel__counter-label {
    grid-row: 1;
}

.project-carousel__counter.is-left .project-carousel__counter-label {
    grid-column: 1;
}

.project-carousel__counter.is-right .project-carousel__counter-label {
    grid-column: 3;
}

.project-carousel__counter-nav {
    display: contents;
}

.project-carousel__counter-arrow--prev {
    grid-row: 2;
    grid-column: 1;
}

.project-carousel__counter-line {
    grid-row: 2;
    grid-column: 2;
}

.project-carousel__counter-arrow--next {
    grid-row: 2;
    grid-column: 3;
}

.project-carousel__external-link {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    width: 1.1rem;
    height: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(153, 153, 153, 0.55);
    border-radius: 3px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    cursor: pointer;
}

.project-carousel.is-on-external-link {
    cursor: pointer;
}

.project-carousel__external-link svg {
    width: 0.45rem;
    height: 0.45rem;
}

.project-carousel--has-link:hover .project-carousel__external-link,
.project-carousel--has-link:focus-within .project-carousel__external-link {
    opacity: 1;
    pointer-events: auto;
}

.project-carousel--has-link.project-carousel--has-info .project-carousel__external-link {
    right: calc(6px + 1.1rem + 4px);
}

.project-carousel__info-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 4;
    width: 1.1rem;
    height: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(153, 153, 153, 0.55);
    border: none;
    border-radius: 3px;
    font-family: inherit;
    font-size: 0.55rem;
    font-style: italic;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    cursor: pointer;
}

.project-carousel--has-info:hover .project-carousel__info-btn {
    opacity: 1;
    pointer-events: auto;
}

.project-carousel__info-panel {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.9);
    text-align: center;
    font-family: inherit;
    font-size: inherit;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-carousel.info-is-open .project-carousel__info-panel {
    opacity: 1;
    pointer-events: auto;
}

.project-carousel.info-is-open .project-carousel__info-btn {
    opacity: 1;
    pointer-events: auto;
}

.project-info__text {
    max-width: 85%;
    margin: 0;
    font-size: inherit;
    font-weight: normal;
    line-height: 1.35;
    text-align: center;
    opacity: 0;
    transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.12s;
}

.project-carousel.info-is-open .project-info__text {
    opacity: 1;
}

.site-footer {
    margin-top: 2rem;
    padding: 0 10px 3rem;
    text-align: center;
    color: #999;
}
