/* 
    Typefaces
*/

@font-face {
    font-family: ABC Diatype;
    font-weight: 600;
    font-style: regular;
    src: url("../fonts/ABCDiatype-Bold.otf") format("opentype");
}

@font-face {
    font-family: ABC Diatype;
    font-weight: 600;
    font-style: italic;
    src: url("../fonts/ABCDiatype-BoldItalic.otf") format("opentype");
}

@font-face {
    font-family: ABC Diatype Mono;
    font-weight: 500;
    font-style: regular;
    src: url("../fonts/ABCDiatypeMono-Medium.otf") format("opentype");
}

@font-face {
    font-family: ABC Diatype Mono;
    font-weight: 500;
    font-style: italic;
    src: url("../fonts/ABCDiatypeMono-MediumItalic.otf") format("opentype");
}

/* 
    Variables
*/

:root {
    --tabletSize: 48rem;
    --laptopSize: 64rem;
    --desktopLargeSize: 120rem;
}

/* 
    Elements 
*/

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    image-rendering: optimizeQuality;
    scroll-behavior: smooth;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    font-family: "ABC Diatype", Helvetica, -apple-system, BlinkMacSystemFont, arial, sans-serif;
    font-size: 14px;
    line-height: 1.325em;
    letter-spacing: -0.005em;
    font-weight: 600;
}

h1, h2, h3, h4, h5, h6, p {
    margin: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-size: 14px;
}

a {
    color: inherit;
    transition: 250ms;
    text-underline-offset: 0.15em;
}

a.no-style {
    text-decoration: none;
}

.kt a:hover,
.kt a:focus-visible {
    opacity: 0.6;
}

button.expand-target::after,
a.expand-target::after {
    content: " ";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

button {
    border: 0;
    background-color: transparent;
    cursor: pointer;
}

::selection {
    background-color: rgba(0, 0, 0, 0.15);
    color: rgba(0, 0, 0, 1);
}

h2 {
    margin: 2em 0 1.75em;
    padding: 0 3rem;
    text-wrap: balance;
    font-family: "ABC Diatype Mono", monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 15px;
    font-weight: 400;
    text-align: center;
}

menu.no-style,
ul.no-style {
    list-style: none;
    padding: 0;
    margin: 0;
}

ul {
    padding-inline-start: 1.5rem;
    margin-block-start: 0.5em;
    margin-block-end: 2em;
}

.hidden {
    opacity: 0;
    visibility: hidden;
    height: 0;
    width: 0;
    overflow: hidden;
}

img {
    max-width: 100%;
    max-height: calc(100vh - 4rem);
    object-fit: contain;
    height: auto;
}

video {
    max-width: 100%;
    max-height: calc(100vh - 4rem);
    object-fit: contain;
    height: auto;
    isolation: isolate;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* 
    Typography
*/

.text-micro {
    font-size: 12px;
    line-height: 1.2em;
    letter-spacing: 0.01em;
}

.text-medium {
    font-size: 14px;
    line-height: 1.25em;
    letter-spacing: -0.02em;
}

.text-mono {
    font-family: "ABC Diatype Mono", monospace;
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

.text-uppercase {
    text-transform: uppercase;
}

.text-center {
    text-align: center;
}

/* Tablet (>768px) */
@media screen and (min-width: 48rem) {
    .text-micro {
        font-size: 11px;
        line-height: 1.2em;
        letter-spacing: 0.01em;
    }
    .text-medium {
        font-size: 18px;
    }
}


/* 
    Page
*/

.page {

}

.page-text.disabled {
    display: none;
    scroll-behavior: auto;
}

.page-text-footer {
    margin-top: 4rem;
}

/* Tablet (>768px) */
@media screen and (min-width: 48rem) {
    .page-text-footer {
        margin-top: 6rem;
    }
}

/* Project (Side Preview) */
.page-project-header {
    position: relative;
    text-align: center;
    margin: 1rem 0 3rem;
}

.page-project:last-of-type .page-project-header {
    margin: 3rem 0 1rem;
}

.page-project-header-figure {
    overflow: hidden;
    margin: 0;
}

.page-project-header-figure-img {
    scale: 1.125;
}


.page-project-header-title a {
    text-decoration: none;
    font-style: italic
}

.page-projects {
    display: none;
}

/* Tablet (512px < 768px)  */
@media screen and (min-width: 32rem) and (max-width: 768px) {
    .page {
        padding: 0 12.5vw;
    }
}

/* Tablet (>768px)  */
@media screen and (min-width: 48rem) {
    .page {
        display: grid;
        grid-template-columns: 4fr 6fr;
        gap: 0.5rem;
    }

    .page-text {
        position: relative;
        z-index: 1;
    }

    .page-text.disabled {
        align-self: flex-start;
        display: block;
        opacity: 0.2;
        filter: blur(2px);
        transition: 450ms ease;
        overflow: hidden;
        position: sticky;
        top: 0.5rem;
        max-height: calc(100vh - 1rem);
    }

    .page-text.disabled:hover {
        opacity: 0.6;
        filter: blur(0);
    }

    .page-text-goback {
        position: fixed;
        top: 0;
        left: 0;
        width: 33vw;
        bottom: 0;
        opacity: 0;
        z-index: 1;
    }

    .page-projects {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: auto;
        /* align-items: center; */
        height: fit-content;
        opacity: 0;
        transition: 450ms;
        position: sticky;
        top: 50%;
        translate: 0 -50%;
        pointer-events: none;
    }

    .page-projects.active {
        opacity: 1;
        pointer-events: all;
    }

    .page-projects-item {
        position: relative;
        transition: 450ms;
        padding-bottom: 1rem;
    }

    .page-projects-item-text {
        padding: 0 2rem;
        margin-top: -1em;
        text-wrap: balance;
        z-index: 1;
    }

    .page-projects-item-video {
        z-index: -1;
        margin-bottom: 0.5rem;
    }

    .page-projects-item-image {
        z-index: -1;
        margin-bottom: 0.5rem;
    }

    .page-projects:hover .page-projects-item {
        opacity: 0.4;
        filter: blur(2px);
    }

    .page-projects-item:hover {
        opacity: 1 !important;
        filter: blur(0) !important;
    }

    /* Project */
    .page-project {
        padding-left: 3rem;
    }

    .page-project.fixed {
        display: none;
        position: fixed;
        top: 0.5rem;
        left: calc(40vw + 0.5rem);
        right: 0.5rem;
        bottom: 0;
        transition: 450ms;
        z-index: -1;
    }

    .page-project:last-of-type .page-project-header {
        margin: 1rem 0 1rem;
    }

    .block-text.in-view + .page-project.fixed {
        display: flex;
        justify-content: center;
        align-items: center;
        opacity: 0;
        pointer-events: none;
    }

    .page-project.active,
    .block-text.active + .page-project.fixed {
        display: flex;
        justify-content: center;
        align-items: center;
        opacity: 1;
        pointer-events: all;
        z-index: 2;
    }

    .page-project-content {
        margin: 3rem 0;
        padding: 0 2rem;
    }
}

/* Laptop (>1280px)  */
@media screen and (min-width: 80rem) {
    .page {
        grid-template-columns: 450px 1fr;
    }

    .page-project.fixed {
        left: calc(450px + 0.5rem);
    }

    .page-project-content {
        margin: 3rem 0;
        padding: 0 7.5vw;
    }

    .page-projects {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop large (>1920px)  */
@media screen and (min-width: 120rem) {
    .page {
        display: grid;
        grid-template-columns: 450px 1fr;
    }

    .page-project {
        padding: 0 3rem;
    }

    .page-project.fixed {
        left: calc(450px - 1rem);
        padding: 6rem;
    }

    .page-project-header-video {
        max-height: calc(100vh - 10rem);
        max-width: 1280px;
    }

    .page-project-content {
        margin: 3rem 0;
        padding: 0 10vw;
    }
    .page-project-content {
        margin: 3rem 0;
        padding: 0 10vw;
    }

    .page-projects {
        padding: 3rem;
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Loading */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: white;
    z-index: 100;
    padding: 0.5rem;
    opacity: 1;
    transition: 450ms;
    pointer-events: none;
}

.loading-text {
    display: flex;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}


/* 
    Blocks
*/

.block-text p:not(:last-child) {
    margin-bottom: 1em;
}

.block-text:not(:last-child) {
    margin-bottom: 1em;
}

.block-text {
    transition: 450ms;
    scroll-margin-block-start: calc(50vh - var(--blockHeight, 0));
    z-index: 1;
}
        
.block-heading {
    scroll-margin-block-start: 33.33vh;
}

/* Tablet (>768px)  */
@media screen and (min-width: 48rem) {
    .block-text {
        /* opacity: 0.5; */
        transition: 300ms;
    }
    
    .block-text.scrolled {
        opacity: 1;
    }

    .block-text.related-project.active {
        z-index: 10;
        translate: 1em;
    }

    .block-text.related-project.active::before {
        content: " ";
        position: absolute;
        top: 0.25em;
        left: -0.75rem;
        bottom: 0.25em;
        width: 2px;
        background-color: black;
        opacity: 0.2;
    }

    .block-text.related-project.active::after {
        content: "→";
        position: absolute;
        top: 50%;
        right: -2rem;
        transform: translateY(-50%);
        opacity: 0.3;
        z-index: 10;
    }
}

.block-image {
    margin: 3rem 0;
}


/* 
    Reading Marker  
*/

.reading-marker {
    position: fixed;
    left: 0.125rem;
    top: 33vh;
    opacity: 0.3;
    background-color: black;
    width: 4px;
    height: 4px;
    /* border-radius: 1px; */
}

/* 
    Kirby Text 
*/

.kt p:not(:last-child) {
    margin-bottom: 1em;
}

/* 
    Animations 
*/

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Barba Elements */
.barba-container.transitioning {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}