html, body {
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

body {
    font-family: 'Aspekta', sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
}

/* Hide content + footer until JS says go */
main, footer {
    visibility: hidden;
}

/* Fade target */
main {
    opacity: 0;
    transition: opacity 250ms ease;
}

/* When JS enables the transition system */
main.fade-in {
    visibility: visible;
    opacity: 1;
}

main.fade-out {
    visibility: visible;
    opacity: 0;
}

/* Footer becomes visible only when JS adds this */
footer.footer-ready {
    visibility: visible;
}


header {
    background-color: var(--color-background);
    justify-content: space-between;
    align-items: center;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
}

header.fixed {
    background-color: var(--color-background);
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    will-change: transform;
    transition: transform .4s cubic-bezier(.46,.03,.52,.96);
    transform: translateY(-100%);
}

/* Show header with enhanced shadow when scrolling up */
header.fixed.header--visible {
    transform: translateY(0);
}

#header-inner {
    max-width: var(--max-width);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    margin: 0 var(--margin-width) 0 var(--margin-width);
}

#logo {
    /*margin-left: var(--margin-width);*/
    width: 85px;
    height: 25px;
}

#theme-switcher, #theme-switcher-mobile {
    width: 16px;
    height: 20px;
    cursor: pointer;
    margin: 1px 12px 0 0;
}

nav#desktop {
    display: var(--show-for-desktop);
    /*margin-right: var(--margin-width);*/
}

nav#desktop ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 19px;
}
#logo a {
    font-size: var(--font-size-medium);
    /*letter-spacing: 0.5px;*/
    text-decoration: none;
    color: var(--color-text);
    font-weight: 500;
}

nav#desktop ul a {
    font-size: var(--font-size-medium);
    /*letter-spacing: 0.5px;*/
    text-decoration: none;
    color: var(--color-text);
    font-weight: 400;
}

nav#desktop ul a:hover, nav#mobile-nav ul a:hover {
    color: var(--color-nav-hover);
}

nav#desktop ul a.active, nav#mobile-nav ul a.active {
    text-decoration: underline;
    text-underline-offset: 5px;
    text-decoration-thickness: 1px;
}

nav#mobile {
    display: var(--show-for-mobile);
    margin-right: -9px;
}

.theme-switcher-circle {
    stroke: var(--color-text);
}

.theme-switcher-elip {
    fill: var(--color-text);
}

#mobile-nav-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-nav-background);
    margin-top: var(--header-height);
    z-index: 999;
    transition: opacity 0.3s ease-in-out;
}

#mobile-nav-overlay ul {
    list-style: none;
    margin-top: 94px;
    padding-left: var(--margin-width);
}

#mobile-nav-overlay ul li {
    margin-bottom: 22px;
}

#mobile-nav-overlay nav a {
    text-decoration: none;
    font-size: var(--font-size-large);
    color: var(--color-text);
    font-weight: 300;
}

#mobile-nav-overlay nav a:hover {
    text-decoration: none;
}

.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.active-header {
    transition: background-color .5s;
    background-color: var(--color-nav-background);
}

.body-lock {
    overflow: hidden;
}

.footer-active {
    border-top: 1px solid var(--color-text);
    z-index: 999;
}

.hamburger {
    width: 40px;
    height: 40px;
    cursor: pointer;
    user-select: none;
}

.bar {
    fill: none;
    stroke: var(--color-text);
    stroke-width: 2;
    stroke-linecap: square;
    transition: transform 0.25s ease;
    transform-origin: center;
}

.bar1, .bar2 {
    transform-box: fill-box;
}

.active .bar1 {
    transform: rotate(45deg) translate(3px, 3px);
}

.active .bar2 {
    transform: rotate(-45deg) translate(4px, -4px);
}

#project-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 1.875;
    max-width: var(--max-width);
    /*max-height: calc(100vh - var(--header-height));*/
    margin: 0 auto;
}

#project-hero img {
    width: 100%;
    aspect-ratio: 1.875;
}

#hero {
    position: relative;
    width: 100%;
    aspect-ratio: var(--slide-aspect-ratio);
    max-width: var(--max-width);
    /*max-height: calc(100vh - var(--header-height));*/
    margin: 0 auto;
}

main {
    box-sizing: border-box;
    padding-bottom: 70px;
    position: relative;
    min-height: 100vh;
    background-color: var(--color-background);
    z-index: 500;
    width: 100%;
    overflow-x: hidden;
    margin: 0 auto var(--footer-height) auto;
}

main.zero-bottom-padding {
    padding-bottom: 0 !important;
}

main ul {
    list-style: none;
    padding-left: 0;
}

main ul li {
    margin-bottom: 7px;
}

main .contact-tag-line {
    margin-top: 74px;
}

#wrapper {
    border-top: 1px solid var(--color-hr);
    max-width: var(--max-width);
    margin: var(--wrapper-top-margin) var(--margin-width) 0 var(--margin-width);
}

#home-wrapper {
    font-size: var(--font-size-xl);
    max-width: var(--max-width);
    margin: var(--home-text-margin) var(--margin-width) var(--home-text-margin) var(--margin-width);
}

#home-wrapper p {
    font-size: var(--font-size-home);
    margin: 0;
    width: var(--home-text-width);
    max-width: var(--home-text-width);
    line-height: var(--home-text-line-height);
}

section.profile-contact {
    display: flex;
    justify-content: space-between;
    flex-direction: var(--stack-for-mobile);
    border-bottom: 1px solid var(--color-hr);
    padding-bottom: var(--profile-contact-bottom-pad);
}

section.profile-contact:last-of-type {
    border-bottom: none;
}

section.profile-contact .left {
    flex: var(--column-width-one-third);
}

section.profile-contact .right {
    flex: var(--column-width-two-third);
}

section.profile-contact .right p:last-of-type {
    margin-bottom: 17px;
}

section.profile-contact-sub {
    display: flex;
    justify-content: flex-start;
    flex-direction: var(--stack-for-mobile);
    border-bottom: var(--desktop-only-border) var(--color-hr);
}

section.profile-contact-sub:last-of-type {
    border-bottom: none;
}

section.profile-contact-sub .left-sub {
    flex: var(--column-width-half);
}

section.profile-contact-sub .right-sub {
    flex: var(--column-width-half);
}

section.profile-contact .right a  { line-height: 32px; }

.left-sub ul, .right-sub ul {
    margin: var(--sub-list-margin);
}

.last-section {
    margin-bottom: var(--last-section-margin);
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--footer-height);
    z-index: 1;
    background-color: var(--color-footer-background);
}

footer.project-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--footer-height);
    z-index: 1;
    background-color: black;
    color: var(--color-white) !important;
}

footer.project-footer div a {
    color: var(--color-white) !important;
}

#footer-inner {
    max-width: var(--max-width);
    height: var(--footer-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 var(--margin-width) 0 var(--margin-width);
}

footer div {
    font-size: var(--font-size-small);
    font-weight: 200;
}

footer div:first-of-type {
    /*margin-left: var(--margin-width);*/
}

footer div:last-of-type {
    /*margin-right: var(--margin-width);*/
}

footer a {
    text-decoration: none;
    color: var(--color-text);
}

footer a:hover {
    text-decoration: none;
    color: var(--color-nav-hover);
}

footer span {
    display: inline-block;
    margin: 0 7px 0 10px;
}

#carousel {
    position: relative;
    z-index: 1;
    top: 0;
    left: 0;
    width: 100%;
    aspect-ratio: var(--slide-aspect-ratio);
    max-width: var(--max-width);
    /*max-height: calc(100vh - var(--header-height));*/
    background-color: var(--color-background);
    line-height: 0;
    cursor: pointer;
    overscroll-behavior-x: contain;
}

#carousel-slides {
    position: absolute;
    z-index: -1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: var(--max-width);
    /*max-height: calc(100vh - var(--header-height));*/
    overflow: hidden;
}

.slide {
    background-size: cover;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: var(--max-width);
    /*max-height: calc(100vh - var(--header-height));*/
    overflow: hidden;
    background-position: top center;
    opacity: 0;
    z-index: 0;
    transition: opacity 1s ease;

        user-drag: none;
        -webkit-user-drag: none;
        pointer-events: none;
    overscroll-behavior-x: contain;
}

.current-slide {
    z-index: 5;
    opacity: 1;
}

.animation {
    animation-name: fadeInOpacity;
    animation-iteration-count: 1;
    animation-timing-function: ease-in;
    animation-duration: .500s;
    animation-play-state: running;
}

/*
.prev-slide  {
    z-index: 4;
	opacity: 0;
	animation-name: fadeInOpacity;
	animation-iteration-count: 1;
	animation-timing-function: ease-in;
	animation-duration: 0.5s;
}
*/


@keyframes fadeInOpacity {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes fadeOutOpacity {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}


#carousel-controls {
    display: flex;
    z-index: 10;
    justify-content: space-between;
    top: 0px;
    left: 0px;
    width: 100%;
    aspect-ratio: var(--slide-aspect-ratio);
    max-width: var(--max-width);
    /*max-height: calc(100vh - var(--header-height));*/
}

#carousel-title {
    box-sizing: border-box;
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: var(--carousel-title-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--carousel-spacing);
}

.carousel-title-left {
    width: 85%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carousel-title-right {
    width: 15%;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#carousel-title span {
    font-size: var(--font-size-small);
    color: white;
}

#carousel-controls,
#carousel-title {
    pointer-events: none;
}

#left-arrow, #right-arrow {
    display: flex;
    align-content: center;
    align-self: center;
    align-items: center;
    width: 160px;
    height: 100%;
    /*max-height: calc(100vh - var(--header-height));*/
}

#left-arrow-target, #right-arrow-target {
    pointer-events: auto;
}

@media (hover: none) {
    #left-arrow img, #right-arrow svg {
        display: none;
    }
}

#right-arrow {
    justify-content: flex-end;
}

#left-arrow {
    justify-content: flex-start;
}

#left-arrow svg, #right-arrow svg {
    cursor: pointer;
    margin-right: var(--carousel-spacing);
    display: var(--show-for-desktop);
}

#left-arrow svg {
    margin-left: var(--carousel-spacing);
}

@media (hover: none) {
    .carousel-arrow-container svg {
        visibility: visible;
    }
}

.grid-2-col {
    display: grid;
    grid-template-columns: repeat(var(--grid-2-col), 1fr);
    gap: var(--grid-y-gap) var(--grid-x-gap);
    margin-top: var(--grid-2-col-top-margin) ;
}

.grid-3-col {
    display: grid;
    grid-template-columns: repeat(var(--grid-3-col), 1fr);
    gap: var(--grid-y-gap-work) var(--grid-x-gap);
    margin-top: var(--grid-y-gap);
}

.grid-4-col {
    display: grid;
    grid-template-columns: repeat(var(--grid-4-col), 1fr);
    gap: var(--grid-y-gap) var(--grid-x-gap);
    margin-top: var(--grid-y-gap);
}


.tile {
   position: relative;
   /* aspect-ratio: 1.223;*/
}

.tile-image-wrapper {
    position: relative;
    aspect-ratio: var(--tile-aspect-ratio);
    background-color: var(--color-tile-background);
}

.tile-image-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0);
    transition: background-color 0.3s ease;
    mix-blend-mode: multiply;
    pointer-events: none;
}

.tile-link:hover .tile-image-wrapper::after {
    background-color: rgba(0, 0, 0, 0.4);
}

.tile-image-wrapper.vimeo {
    aspect-ratio: var(--tile-aspect-ratio) !important;
    background-color: black;
}

/*.tile .tile {
    width: 100%;
    !* aspect-ratio: 5 / 4;  0.8 of the width *!
    overflow: hidden;
    position: relative;
}*/

.tile img {
    width: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: var(--tile-aspect-ratio);
}

.tile span {
    /*position: absolute;
    bottom: 0;*/
    display: block;
    font-size: var(--font-size-tile);
    font-weight: 500;
    margin-top: 12px;
    line-height: 24px;
}

.tile span.project-list-tag {
    display: inline-block;
    color: var(--color-nav-hover);
    font-size: var(--font-size-small);
    font-weight: 200;
    margin: 4px 0 0 0;
}

#project-wrapper {
    max-width: var(--max-width);
    margin: var(--project-wrapper-margin) var(--margin-width) var(--project-wrapper-margin) var(--margin-width);
}

.project-grid-1-col {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--grid-y-gap) var(--grid-x-gap);
    margin-bottom: var(--grid-y-gap-projcts);
}

.project-grid-2-col {
    display: grid;
    grid-template-columns: repeat(var(--grid-2-col), 1fr);
    gap: var(--grid-y-gap-projcts) var(--grid-x-gap);
    margin-bottom: var(--grid-y-gap-projcts);
}

.project-grid-2-col-next-projects {
    display: grid;
    grid-template-columns: repeat(var(--grid-2-col), 1fr);
    gap: var(--grid-y-gap-projcts-next-projects) var(--grid-x-gap);
    margin-bottom: var(--grid-y-gap-projcts);
}

.project-image-wrapper, .project-image-wrapper img {
    width: 100%;
    height: auto;
    /* Don't think this is needed: aspect-ratio: var(--tile-aspect-ratio); */
}

.project-image-wrapper.vimeo {
    background-color: black;
    position: relative;
    aspect-ratio: 1.64 !important;
}

.project-image-wrapper.vimeo-2-col {
    background-color: black;
    position: relative;
}

@media (max-width: 799px) {
    .project-image-wrapper.vimeo, .project-image-wrapper.vimeo-2-col {
        aspect-ratio: 1.64 !important;
    }
}

.project-image-wrapper span {
    color: var(--color-white);
    font-size: var(--font-size-small);
    display: inline-block;
    margin: var(--next-projects-span-margin);
}

.hide-for-medium-down {
    display: var(--hide-for-medium-down);
}

.introduction {
    margin-bottom: var(--project-into-text);
}

h1.project-title {
    margin: var(--project-h1-margin);
}

.info-point.links:first-of-type {
    margin-top: var(--info-point-links-margin);
    width: 100%;
}

span.project-tag {
    color: var(--color-nav-hover);
    font-weight: 500;
}

.project-introduction {
    margin: var(--project-intro-margin);
}

.project-introduction p {
    font-size: var(--font-size-project-medium);
    line-height: var(--project-intro-line-height);
}

.project-content-text {
    aspect-ratio: auto;
}

.project-content-text p {
    font-size: var(--font-size-project-large);
    line-height: 30px;
}

.project-content-text p:first-of-type {
    margin-top: var(--project-content-text-margin);
}

.project-content-text p:last-of-type {
    margin-bottom: var(--project-content-text-margin);
}

.project-info-section p, .project-info-section span {
    font-size: var(--font-size-project-large);
}

#project-info-wrapper {
    margin: var(--project-info-wrapper-margins);
    border-top: 1px solid var(--color-hr);
}

.project-information {
    display: flex;
    flex-direction: var(--project-infomation-flex-direction);
    justify-content: space-between;
    gap: 0 20px;
    padding-bottom: var(--project-information-section-padding);
    border-bottom: 1px solid var(--color-hr);
}

.project-information:last-of-type {
    border: none;
}

.project-information .left {
  font-size: var(--font-size-small);
  flex: 1;
}

.project-information .right {
    flex: 1;
    max-width: var(--project-infomation-max-width);
}

.project-information .left h2, .project-information .right h2 {
    font-weight: 500;
    color: var(--color-text);
    font-size: var(--font-size-small);
    margin: var(--project-infomation-h2-margin);
    line-height: 23px;
}

.project-information .left h3, .project-information .right h3 {
  font-weight: 300;
  color: var(--color-nav-hover);
  font-size: var(--font-size-small);
  margin: 21px 0 0 0;
}

.project-information .left p, .project-information .right p {
    font-weight: 200;
    color: var(--color-text);
    font-size: var(--font-size-small);
    line-height: 23px;
}

.project-information .left span, .project-information .right span {
    font-weight: 200;
    color: var(--color-text);
    font-size: var(--font-size-small);
    line-height: 23px;
}

.project-information .left a, .project-information .right a {
    font-weight: 200;
    color: var(--color-text);
    font-size: var(--font-size-small);
    line-height: 23px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: 100%;
}

.project-information .left a:hover, .project-information .right a:hover {
    text-decoration: none;
    color: var(--color-nav-hover);
}

.project-information .left ul, .project-information .right ul {
    margin: 1px 0 0 0;
}

.project-information .left li, .project-information .right li {
    font-weight: 200;
    color: var(--color-text);
    font-size: var(--font-size-small);
    margin-bottom: -4px;
}

.project-sub-columns {
    display: flex;
    flex-direction: var(--project-infomation-flex-direction);
    justify-content: space-between;
    gap: 0 20px;
    margin-top: var(--project-sub-col-margin);
}

.project-sub-columns .left, .project-sub-columns .right {
    flex: 1;
}

#project-next-wrapper {
    box-sizing: border-box;
    width: 100%;
    display: flow-root; /* Fix to stop title margin extending over top of parent */
    background-color: var(--color-mid-dark-gray);
}

#project-next-wrapper-inner {
    box-sizing: border-box;
    max-width: 1600px;
    margin: auto;
    display: flow-root; /* Fix to stop title margin extending over top of parent */
    padding: var(--project-next-inner-padding);
}

h2.next-project-title {
    font-weight: 500;
    color: var(--color-white);
    font-size: var(--font-size-small);
    margin: 28px 0 56px 0;
}
