body {
    margin: 0;
    overflow-x: hidden;
    animation-name: hide-scroll;
    animation-duration: 3.25s;
    animation-timing-function: linear;
    animation-delay: 0s;
    animation-iteration-count: 1;
    animation-direction: normal;
    animation-fill-mode: backwards;
}

.grid {
    min-height: calc(100vh - 2em - 10px - 5vmin);
    width: 100vw;
    top: 0;
    display: grid;
    grid-template:
        "nav" 0fr
        "footer" 0fr;
    place-items: center;
    margin: 0;
    font-family: Hind, sans-serif;
    align-content: space-evenly;
    margin-top: calc(2em + 10px + 5vmin);
    position: absolute;
    animation-name: hide-scroll;
    animation-duration: 3.25s;
    animation-timing-function: linear;
    animation-delay: 0s;
    animation-iteration-count: 1;
    animation-direction: normal;
    animation-fill-mode: backwards;
}

header {
    background-color: white;
    padding-top: calc(50vh - 1em - 10px);
    top: 0;
    font-family: Hind, sans-serif;
    position: absolute;
    text-align: center;
    height: 2em;
    width: 100vw;
    animation-name: fadein, riseup;
    animation-duration: 1.5s, 1.5s;
    animation-timing-function: linear, ease;
    animation-delay: 0s, 2.25s;
    animation-iteration-count: 1, 1;
    animation-direction: normal, normal;
    animation-fill-mode: forwards, forwards;
    opacity: 0;
}

nav {
    grid-area: nav;
    display: flex;
    justify-content: center;
    align-items: center;
    width: calc(100vw - 60px);
    gap: 30px;
}

@media (orientation: landscape) {
    nav {
        flex-direction: row;
    }
    .project, .project img {
        width: min(calc(30vmax - 2px), calc(50vmin - 2px)); 
        height: min(calc(30vmax - 2px), calc(50vmin - 2px));
    }
    @keyframes lift-off {
        0% {
            box-shadow: 0px 0px 0px 0 white;
            /* width: min(calc(30vmax - 2px), calc(50vmin - 2px));
            height: min(calc(30vmax - 2px), calc(50vmin - 2px)); */
        }
        100% {
            box-shadow: 5px 5px 10px 0 lightgray;
            /* width: min(30vmax, 50vmin);
            height: min(30vmax, 50vmin); */
        }
    }
}

@media (orientation: portrait) {
    nav {
        flex-direction: column;
    }
    .project, .project img {
        width: min(calc(50vmax - 2px), calc(75vmin - 2px)); 
        height: min(calc(50vmax - 2px), calc(75vmin - 2px));
    }
    @keyframes lift-off {
        0% {
            box-shadow: 0px 0px 0px 0 white;
            /* width: min(calc(50vmax - 2px), calc(75vmin - 2px));
            height: min(calc(50vmax - 2px), calc(75vmin - 2px)); */
        }
        100% {
            box-shadow: 5px 5px 10px 0 lightgray;
            /* width: min(50vmax, 75vmin);
            height: min(50vmax, 75vmin); */
        }
    }
}

footer {
    grid-area: footer;
    font-weight: 300;
    animation-name: fadein;
    animation-duration: 1s;
    animation-timing-function: linear;
    animation-delay: 3.25s;
    animation-iteration-count: 1;
    animation-direction: normal;
    animation-fill-mode: forwards;
    opacity: 0;
    text-align: center;
}

h1 {
    font-weight: 300;
    margin-block: 0;
    font-size: 2em;
}

sup {
    font-size: 0.62em;
    font-weight: 500;
    vertical-align: super;
}

.project, .project img {
    overflow: hidden;
    aspect-ratio: 1/1;
    opacity: 0;
    animation-name: fadein, lift-off;
    animation-duration: 1.5s, 2s;
    animation-timing-function: ease-in, ease;
    animation-iteration-count: 1;
    animation-direction: normal;
    animation-fill-mode: forwards;
    cursor: pointer;
}

.project img {
    opacity: 1;
}

html, body {
    width: 100vw;
    height: 100%;
    color: #313131;
}

@keyframes fadein {
    0%  { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes riseup {
    0% { padding-top: calc(50vh - 1em - 10px); }
    100% { padding-top: 10px; }
}

@keyframes hide-scroll {
    from, to { overflow: hidden; height: 100vh; margin-top: 0; }
}

.project:nth-of-type(1), .project img:nth-of-type(1) {
    animation-delay: 3.25s, 5s;
}

.project:nth-of-type(2), .project img:nth-of-type(2) {
    animation-delay: 3.5s, 5s;
}

.project:nth-of-type(3), .project img:nth-of-type(3) {
    animation-delay: 4s, 5s;
}

.project:hover {
    border: 1px solid lightgray;
    /* box-sizing: border-box; */
    margin: -1px;
}

p, article strong, article ol {
    max-width: 60ch;
    padding: 5vmin 10vmin;
    margin-block-start: 0;
    margin-block-end: 0;
    margin: auto;
}
article ol {
    padding-left: 30vmin;
}
article strong {
    padding: 0;
}
article ol, article strong {
    color: #555555;
}

article {
    opacity: 0;
    position: relative;
    background: white;
    display: none;
    /* margin-top: 4em; */
    font-family: Hind, sans-serif;
    transition: opacity 1s ease-in-out;;
    margin: 4em 1em 0 1em;
    overflow: auto;
}

section {
    display: block;
    height: auto;
    margin: 2em auto;
    overflow: auto;
}
#project-details label {
    font-size: .75em;
    font-weight: 600;
}
#project-details > div {
    position: relative;
    float: left;
}
#project-details > div:not(:last-child){
    margin-right: 2%;
}
#project-details p {
    font-size: .75em;
    font-weight: 300;
    margin: 0;
}
#project-details {
    width: calc(min(60ch, 100%));
}
#background {
    width: 45%;
    min-width: 12em;
}
#role {
    width: 20%;
    min-width: 6em;
}
#team {
    width: 30%;
    min-width: 10em;
}
h2 {
    margin: 0;
    display: block;
    opacity: 1;
    font-size: 2em;
    color: darkgray;
    font-weight: 300;
    width:30ch;
    margin: auto;
}
article p {
    font-size: 1em;
    font-weight: 300;
    padding: 0;
}
article img {
    max-width: calc(min(60ch, 100%));
    width: 100%;
    /* max-height: 90vh; */
    display: block;
    margin: 1em auto 0px;
}

@media only screen and (min-width: 1224px) {
    article section {
        width: 73.5vw;
    }
    strong {
        font-size: 1.25em;
        font-weight: bold;
        display: inline;
        line-height: normal;
    }
}

article strong {
    font-size: 1.25em;
    font-weight: 500;
}

.close {
    position: absolute;
    top: 0;
    right: 40px;
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow: 5px 5px 10px 0px lightgray;
    width: 40px;
    height: 40px;
    cursor: pointer;
    box-sizing: border-box
}
.close:hover, .close.closebottom:hover {
    border: 1px solid lightgray;
}
  
.close.closebottom {
    position: relative;
    top: unset;
    right: unset;
    margin: 1em auto 2em;
    border-radius: 0.5em;
    width: 7em;
    height: 2.5em;
    border: 1px solid black;
    font-size: 1em;
    display: block;
}

@keyframes reset-shadow {
    0% {
      box-shadow: 5px 5px 5px 0px #E9E9E9;
    }
    to {
      box-shadow: 0px 0px 0px 0 white;
    }
  }

  article * {
    opacity: 0;
    /* transform: translateY(20px); */
    transition: opacity 1s ease/* , transform 1s ease */;
  }

  .fade-in-visible {
    opacity: 1;
    /* transform: translateY(0); */
  }