:root {
  /* Typography */
  --font-hand: 'ff-providence-sans-web-pro', sans-serif;
  --font-serif: 'p22-mackinac-pro', serif;
  --font-sans: 'inter-variable', sans-serif;

  /* Font Sizes (Mobile First) */
  --font-size-4xl: clamp(3rem, 6vw + 1rem, 4rem);    /* ~48–64px */
  --font-size-3xl: clamp(2.5rem, 4.5vw + 1rem, 3rem); /* ~40–48px */
  --font-size-2xl: clamp(1.75rem, 3vw + 1rem, 2.25rem); /* ~28–36px */
  --font-size-lg: clamp(1.125rem, 1.5vw + 1rem, 1.25rem); /* ~18–20px */
  --font-size-md: clamp(1rem, 1vw + 0.5rem, 1rem);   /* Stays at 16px */
  --font-size-sm: clamp(0.875rem, 0.5vw + 0.5rem, 0.875rem); /* 14px */

  --spacer-4xl: clamp(3rem, 6vw + 1rem, 4rem);    /* ~48–64px */
  --spacer-3xl: clamp(2.5rem, 4.5vw + 1rem, 3rem); /* ~40–48px */
  --spacer-2xl: clamp(1.75rem, 3vw + 1rem, 2.25rem); /* ~28–36px */
  --spacer-lg: clamp(1.125rem, 1.5vw + 1rem, 1.25rem); /* ~18–20px */
  --spacer-md: clamp(1rem, 1vw + 0.5rem, 1rem);   /* Stays at 16px */
  --spacer-sm: clamp(0.875rem, 0.5vw + 0.5rem, 0.875rem); /* 14px */

  --overshoot: linear(0, 0.402 7.4%, 0.711 15.3%, 0.929 23.7%, 1.008 28.2%, 1.067 33%, 1.099 36.9%, 1.12 41%, 1.13 45.4%, 1.13 50.1%, 1.111 58.5%, 1.019 83.2%, 1.004 91.3%, 1); 

  /* Colour Palette */
  --green: #2FB060;
  --red: #E94426;
  --yellow: #F3C13A;
  --pink: #EB7FB1;
  --black: 35,21,32;
  --cream: #F1E4D1;
  --tan: #AC926F;

  --text-color: rgb(var(--black));
  --bg-color: var(--cream);

}

/*#noise {
  display: block;
  width: 300vw;
  height: 300vh;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  background: repeat url('/assets/images/noise.png');
  z-index: 1;
  pointer-events: none;
  position: fixed;
  image-rendering: pixelated;
  will-change: transform;
  z-index: 10;
} */ 
body {
  --text-color: rgb(var(--color-text-rgb));
  --bg-color: rgb(var(--color-rgb));  
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  color: var(--text-color);
  background-color: var(--bg-color);
  margin: 0;
  transition: 0.4s ease-out background-color, 0.4s ease-out color;
  

/*  &:has([data-barba-namespace="home"]) {
    --text-color: rgb(var(--black));
    --bg-color: var(--cream);    
  }*/
}

[data-barba="container"] + [data-barba="container"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
}

* {
  box-sizing: border-box;
  margin-block: unset;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 400;
}
h1 {
  font-size: var(--font-size-4xl);
  letter-spacing: -0.25px;
}

h2 {
  font-size: var(--font-size-3xl);
}

h3 {
  font-size: var(--font-size-2xl);
}

p {
  font-size: var(--font-size-md);
  margin: 0;
  + :is(p, ul, ol) {
    margin-top: var(--spacer-sm);
  }
}
button:not(.menu-toggle),
.button {  
  appearance: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  background: var(--yellow);
  border-radius: 32px;
  border: 1px solid rgb(var(--black));
  box-shadow: 2px 2px 0px inset #ffffff30, 2px 2px 0px rgb(var(--black));  
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.1px;
  color: black;
  padding: 14px 20px;
  cursor: pointer;
  translate: 0px 0px;
  scale: 1;
  transition: scale 0.4s var(--overshoot), box-shadow 0.4s var(--overshoot), translate 0.4s var(--overshoot);
  &:hover {
    scale: 1.3;
    translate: -3px -3px;
    box-shadow: 2px 2px 0px inset #ffffff30, 3px 3px 0px rgb(var(--black));
    transition: scale 1s var(--overshoot), box-shadow 1s var(--overshoot), translate 1s var(--overshoot);
  }  
  &:active {
    scale: 0.9;
    translate: 1px 1px;
    box-shadow: 2px 2px 0px inset #ffffff30, 0px 0px 0px rgb(var(--black));
    transition: scale 1s var(--overshoot), box-shadow 1s var(--overshoot), translate 1s var(--overshoot);;
  }
}
.font-size-4xl {
  font-size: var(--font-size-4xl);
}
.font-size-3xl {
  font-size: var(--font-size-3xl);
}
.font-size-2xl {
  font-size: var(--font-size-2xl);
}
.font-size-lg {
  font-size: var(--font-size-lg);
}
.font-size-md {
  font-size: var(--font-size-md);
}
.font-size-sm {
  font-size: var(--font-size-sm);
}
.font-size-4xl {
  font-size: var(--font-size-4xl);
}
.font-size-3xl {
  font-size: var(--font-size-3xl);
}
.font-size-2xl {
  font-size: var(--font-size-2xl);
}
.font-size-lg {
  font-size: var(--font-size-lg);
}
.font-size-md {
  font-size: var(--font-size-md);
}
.font-size-sm {
  font-size: var(--font-size-sm);
}

.mt-4xl {
  margin-top: var(--spacer-4xl);
}
.mt-3xl {
  margin-top: var(--spacer-3xl);
}
.mt-2xl {
  margin-top: var(--spacer-2xl);
}
.mt-lg {
  margin-top: var(--spacer-lg);
}
.mt-md {
  margin-top: var(--spacer-md);
}
.mt-sm {
  margin-top: var(--spacer-sm);
}
.mt-auto {
  margin-top: auto;
}

.mx-auto {
  margin-inline: auto;
}

.d-block {
  display: block;
}

.sr-text {
  border: 0;
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.has-text-align-center {
  text-align: center;
}
.has-text-uppercase {
  text-transform: uppercase;
}
.has-text-sans {
  font-family: var(--font-sans);
}
.has-text-serif {
  font-family: var(--font-serif);
}
.has-text-hand {
  font-family: var(--font-hand);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  z-index: 10;
}

.reveal-overlay {
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  background-color: rgb(var(--black));
  z-index: 1;
  pointer-events: none;
  transition: none;
  opacity: 0;
}


.logo {
  position: relative;
  width: 163px;
  height: 140px;
  overflow: hidden;
  display: block;
  margin-left: -2rem;
  & svg {
    position: absolute;
    top: 50%;
    left: 50%;
    translate: -50% -50%;    
    position: relative;
    transform-origin: 50% 50%;
    width: 284px;
    pointer-events: none;

    path {
      fill: rgb(var(--text-color));
      transform-box: fill-box;
      transform-origin: center;
      opacity: 0;
    }
  }
}


/* Menu icon */
.menu-toggle {
  transition: fill 0.3s ease, color 0.3s ease;
  position: relative;
  z-index: 2;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  appearance: none;
  border: 0;
  gap: 12px;
  color: var(--text-color);
  > span {
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.1px;
    font-weight: 500;
  }
  & .bars {
    background: none;
    border: none;  
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 38px;
    aspect-ratio: 1/1;
    background: var(--yellow);
    border-radius: 50%;
    border: 1px solid rgb(var(--black));
    box-shadow: 2px 2px 0px inset #ffffff30, 2px 2px 0px rgb(var(--black));
    & span {
      display: block;
      width: 17px;
      height: 2px;
      background-color: rgb(var(--black));
      border-radius: 2px;    
    }
  }
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9;
  clip-path: circle(0% at calc(100vw - 2.5rem) 2.5rem);
  background: black;
  display: flex;
  flex-direction: column;
}

.wrapper {
  width: 100%;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  & canvas {
    width: 100%;
    height: 100%;
    display: block;
    font-size: 28px;
    color: black;
    font-family: var(--font-sans);
    cursor: pointer;
  }
}

.page > *:not(.hero, .project-hero, .pinned, [data-marker="fadeOutHero"]),
.page > .slot-text {
  max-width: 90vw;
  width: 100%;
  margin-inline: auto;
}


/* Hero Section */
.hero {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 600px;
  margin-inline: auto;
  gap: var(--spacer-lg);
  min-height: 100vh;
  padding: 3.5rem 2rem;
  justify-content: center;
  
  .intro {
    gap: var(--spacer-lg);
    display: flex;
    flex-direction: column;
    align-items: center;    
  }  
}

.scroll-down {
  display: none;
}

@media (min-width: 750px) and (min-height: 750px) {
  .hero {
    justify-content: space-between;    
  }
  .scroll-down {
    display: block;
  }
}

.reveal-text .word {
  display: inline-block;
  white-space: nowrap;
}

.reveal-text {
  visibility: hidden;
  position: relative;
  z-index: 2;
}
.tagline {
  position: relative;
  max-width: fit-content;
}

/* Character and text */
.character {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
}

.comment, .video-placeholder {
  visibility: hidden;
}

.comment {
  font-family: var(--font-hand);
  text-align: center;
  position: absolute;
  top: 0rem;
  left: 50%;
  transform: translateX(-50%) rotate(-4deg);
  line-height: 1.4;
  width: 100%;
  max-width: 18ch;
  display: none;
}


/* Video placeholder */
.video-placeholder {
  width: 200px;
  aspect-ratio: 1/1;
  translate: 30% 0;
  position: relative;
  z-index: -1;  
  & video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 8px;
  }
}

@media (min-width: 750px) and (min-height: 750px) {
  .video-placeholder {
    width: 336px;
  }
  .comment {
    display: block;
  }
}

#previewContainer {
  position: fixed;
  top: 0;
  left: 0;
  transform: translateY(0);
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  overflow: clip;
  transition: background-color 0.4s ease-in-out;
/*  opacity: 0;
  transition: opacity 0.6s ease;
  &.visible {
    opacity: 0.4;
  }*/
  & video {
    transform-origin: 50% 0%;
  }
}

/* Project  carousel */
.carousel-wrapper {
  position: fixed;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  overflow: hidden;
  /*display: none;*/
}

.carousel {
  position: absolute;
  right: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 5;
}

.carousel-item {
  position: absolute;
  width: 20vh;
  height: 20vh;
  background: black;
  border-radius: 16px;
  pointer-events: all;
  display: flex;
  justify-content: center;
  align-items: center;
  transform-origin: center;
  color: white;
  scale: 0.9;
  opacity: 0;
  transform: translate(-50%, -50%);
  overflow: hidden;
  will-change: transform;
}

.carousel-media {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transform-origin: center center;
  will-change: transform;
  border-radius: inherit; /* optional */
}

.caption {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: space-between;
  max-width: 1280px;
  margin-inline: auto;
  padding: 2rem;
  gap: 180px;
  pointer-events: none;
  > * {
    position: relative;
    opacity: 0;
    visibility: hidden;
    width: 50%;
    text-align: center;
    transform: translateY(30px);
    color: var(--cream);
  }
}

.caption .title {
  font-family: var(--font-serif);
  font-size: var(--font-size-2xl);
}

.caption .sub {
  font-size: var(--font-size-md);
}

.nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: #1f1a1a;
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  z-index: 5;
  font-size: 18px;
  display: none !important;
}

.nav-button.left {
  right: 8vw;
  margin-top: -60px;
}

.nav-button.right {
  right: 8vw;
  margin-top: 60px;
}

.pagination-wheel {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 95px;
  height: 95px;
  pointer-events: none;
}

.dots {
  position: relative;
  width: 100%;
  height: 100%;
}

.dot {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--cream);
  border-radius: 50%;
  opacity: 0.3;
  transform: translate(-50%, -50%) scale(1);
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.active-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--cream);
  border-radius: 50%;
  box-shadow: 0 0 8px 2px var(--cream);
  opacity: 1;
  z-index: 10;
  pointer-events: none;
}


.page-counter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1rem;
  color: #888;
}


.page-counter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--cream);
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-number-wrap {
  height: 1.2em;
  overflow: hidden;
  display: inline-block;
  position: relative;
}

.page-number-list {
  display: flex;
  flex-direction: column;
  transition: transform 0.4s ease;
}

.page-number {
  height: 1.2em;
  line-height: 1.2em;
  text-align: right;
}

.project-hero {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: clip;
  object-fit: cover;
  opacity: 0;
  margin: 0;
  z-index: -1;
  &:after {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(180deg, rgb(var(--color-rgb, var(--black))), rgba(var(--color-rgb, var(--black)), 0));
  }
  & .project-hero-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.86) translateZ(0);
    will-change: transform, opacity;
    backface-visibility: hidden;    
    transform-origin: center top;
    position: absolute;
    top: 0;
    left: 0;
  }
}

:is(.spacer, .spacer-sm, .spacer-xs) {
  display: block;
  width: 100%;
}
.spacer {
  height: clamp(300px, 75vh, 700px);
}
.spacer-sm {
  height: clamp(75px, 25vh, 150px);
}
.spacer-xs {
  height: clamp(35px, 10vh, 75px);
}


.intro {
  position: relative;
  z-index: 1;
  & .project-title {
    max-width: fit-content;
    margin: 56px auto 0;
  }

  & .catchy-title {
    max-width: 750px;
    margin: 62px auto 0;
  }
}



/* ------------------------
   General fade-up text
------------------------ */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  will-change: opacity, transform;
}

/* ------------------------
   Slot Machine Text Block
------------------------ */
.slot-text {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  min-height: 100vh;
}

.slot-line {
  opacity: 0;
  transform: translateY(40px);
  margin-bottom: 2rem;
  font-size: var(--font-size-3xl);
  margin: 25vh auto;
  text-align: center;  
}

.pinned {
  position: relative;
  overflow-x: clip;
  max-width: 100%;
}

.parallax-image {
  position: absolute;
  translate: 0 0;
  will-change: transform;
  pointer-events: none;
  background: black;   
  box-shadow: 0 0 100px #00000050; 
  & img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;    
  }
  &.image-foreground {
    top: 33.33%;
    left: 11%;
    z-index: 2;
    width: 18%;
    aspect-ratio: 1/1;
  }

  &.image-midground {
    top: 0;
    left: 75%;
    z-index: 1;
    width: 15%;
    aspect-ratio: 127/162;
    & img {
      opacity: 0.8;
    }    
  }

  &.image-background {    
    top: 50%;
    left: 15%;
    z-index: 0;
    width: 33.33%;
    aspect-ratio: 259/162;
    box-shadow: none !important;
    & img {
      opacity: 0.5;
    }
  }

  &.transparent {
    background-color: transparent !important;
    box-shadow: none !important;
    aspect-ratio: unset !important;
    & img {
      object-fit: contain;
      opacity: 0.5;
    }
  }
}

[data-marker="fadeOutHero"] {
  display: block;
  position: relative;
  &:after {
    content: "";
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 140%;
    /*background: linear-gradient(0deg, var(--black) 30%, #231F2000);*/
    background: linear-gradient(0deg, rgb(var(--color-rgb, var(--black))) 30%, rgba(var(--color-rgb, var(--black)), 0));
    z-index: 1;
  }
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding: 2rem;
  margin: 0 auto;
  box-sizing: border-box;
  width: 100%;
  & .grid-item {
    position: relative;
    width: 100%;
    aspect-ratio: 4/5;
    border: 1px solid rgba(255, 255, 255, 0.25);
    overflow: clip; 

    &.wide {
      grid-column: span 2;
      aspect-ratio: 2188/1350;
    }   
    &.slider {
      background: rgb(var(--color-rgb));
      border: 0;
      grid-column: span 2;
      aspect-ratio: unset;
      position: relative;
      left: 50%;
      right: 50%;
      width: 100vw;
      margin-left: -50vw;
      margin-right: -50vw;
      padding: 0 2rem;
      overflow-x: auto;
      overflow-y: hidden;
      box-sizing: border-box;
    }

    & .slider-track {
      display: flex;
      gap: 0.5rem;
      scroll-snap-type: x mandatory;
      scroll-behavior: smooth;
      padding: 1rem 0;
    }

    & .slide-spacer {
      flex: 0 0 auto;
      width: 2rem;
      height: 1px;
    }    

    & .slide-item {
      flex: 0 0 auto;
      width: 85vw;
      height: 48vw;
      scroll-snap-align: start;
      overflow: hidden;
      position: relative;
    }

    & :is(img, video) {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }  


    & .caption {
      display: block;
      width: fit-content;
      max-width: 100%;
      position: absolute;
      top: 1rem;
      left: 1rem;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.15);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border-radius: 100px;
      padding: 14px 20px;
      &:after {
        content: "";
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: block;
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: inherit;
        box-shadow:
          0 2px 4px rgba(255, 255, 255, 0.15) inset,
          0 8px 50px rgba(0, 0, 0, 0.35);
      }        
    }
  }
}


@media (max-width: 768px) {
  .grid-container {
    grid-template-columns: 1fr;
    & .grid-item.wide {
      grid-column: span 1;
    }
  }
}


#sound {  
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 45px;
  height: 45px;
  /*overflow: clip;*/
  z-index: 2;
  background: var(--cream);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0;  
  & canvas {
    border-radius: inherit;
    width: calc(100% - 8px);
    height: calc(100% - 8px);
  }
  &:before {
    content: "Sound";
    position: absolute;
    left: -8px;
    top: 50%;
    translate: -100% -50%;
    color: var(--text-color);
    text-shadow: 1px 1px 0px rgb(var(--color-rgb));
    pointer-events: none;
  }
  &:after {
    content: "";
    display: block;
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: inherit;
    box-shadow:
      0 2px 4px rgba(255, 255, 255, 0.15) inset,
      0 8px 50px rgba(0, 0, 0, 0.35);
  }
}


.burst-wrapper {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 9999;
}

.burst-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 10px;
  background: var(--text-color);
  border-radius: 1px;
  transform-origin: 0 0;
  opacity: 0;
  animation: burst-line 0.4s ease-out forwards;
}

@keyframes burst-line {
  0% {
    transform: rotate(var(--angle)) scaleY(0);
    opacity: 1;
  }
  80% {
    transform: rotate(var(--angle)) scaleY(1.4) translateY(-25px);
    opacity: 1;
  }
  100% {
    transform: rotate(var(--angle)) scaleY(1.4) translateY(-30px);
    opacity: 0;
  }
}

[data-barba-namespace="about"] section {
  max-width: 650px;
  width: 100%;
  margin: auto;  
}


#carousel {
  position: relative;
  left: 50%;
}