body{
  margin: 0;
  padding: 0;
  background-color: #F4F4F4;
  scroll-behavior: smooth;
}
body.main{
  margin: 0; 
  background: #f4f4f4; 
  font-family: Arial, sans-serif; 
  font-size: clamp(16px, 1.35vw, 26px); 
  line-height: 123%; 
  min-height: 200vh; 
  overflow-x: hidden;
}

*:focus {
  outline: none;
}

.logo{
  mix-blend-mode: difference;
  z-index: 999;
  display: block;
  position: fixed;
  top: 0;
  left: 20px;
  width: clamp(70px, 5.5vw, 100px);
  aspect-ratio: 100/41;
  background-image: url('PAB-logo.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.secondary_logo{
  text-transform: uppercase;
  position: fixed;
  left: calc(clamp(70px, 5vw, 100px) + 40px);
  top: 10px;
  font-size: clamp(16px, 1.35vw, 26px); 
}

.about_container{
  margin: 80px 20px;
  display: grid;
  grid-template-columns: 4fr 6fr;
  gap: 20px;

  .credits{
    display: grid;
    grid-template-columns: 1fr 5fr;
    gap: 60px 20px;
  }

  .right{
    text-align: right;
  }
}

footer{
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 30px;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: start;

  div{
    display: flex;
    gap: 40px;
    align-items: center;
  }

  .nav{ height: 36px; } 
  a{ text-decoration: none; }
  a.current{ color: black; }
  #wrong{ width: 100px; margin-top: 7px; }
  #greenwich{ width: 128px; }
}
#wrong_mobile{
  display: none;
}

.art_container{
  z-index: 1;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;

  .art{
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
  }
}

.art_container.short{
  bottom: 90px;
}

p{
  font-family: Arial, sans-serif;
  font-size: clamp(16px, 1.35vw, 26px); 
  line-height: 123%;
}

.all_caps{ text-transform: uppercase; }

.project_info_container{
  width: 100vw;
  min-width: 100vw;
  min-height: calc(100dvh - 120px);
  max-height: calc(100dvh - 120px);
  overflow-y: scroll;
  position: fixed;
  top: calc(100dvh - 90px);
  z-index: 9999;

  padding: 20px 20px 100px 20px;
  box-sizing: border-box;
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 50px 30px auto;
  gap: 20px;

  transition: top 0.3s ease;

  background-color: transparent;

  .invisible{
    position: fixed;
    top: 100dvh;
    display: block;
    background-color: #f4f4f4;
    transition: top 0.3s ease;
  }
}

.project_info_container:hover{
  background-color: #F4F4F4;
}

.project_info_container.open{
  top: 120px;
  background-color: #F4F4F4;
  cursor: s-resize;
}

.arrow_btn{
  grid-column: span 2;
  border: none;
  background-color: #678486;
  mask: url('arrow-icon.svg') no-repeat center center;
  -webkit-mask: url('arrow-icon.svg') no-repeat center center;
  mask-size: contain;
  -webkit-mask-size: contain;
  cursor: pointer;
}

.open > .arrow_btn{
  transform: rotate(180deg);
}

/* Archived pages */

body.archived .arrow_btn {
  visibility: hidden;
}

body.archived .link_banner {
  position: fixed;
  bottom: calc(100dvh - 120px);
  left: 0;
  right: 0;
  padding: 10px 20px;
  background-color: #00FF00;
  box-sizing: border-box;
  z-index: 998;

  a {
    display: inline-block;
    white-space: normal;
    word-wrap: break-word;
    max-width: 100%;
    font-family: Arial, sans-serif;
    font-size: clamp(32px, 3.65vw, 56px);
    text-transform: uppercase;
    text-decoration: none;
    color: black;
  }
}

@media screen and (max-width: 800px) {
  body.archived .link_banner {
    bottom: calc(100dvh - 90px);
  }
  body.archived .link_banner a {
    font-size: clamp(16px, 1.35vw, 26px);
  }
}

.black { color: #202020; }
.grey { color: #678486; }

.grid_5x2{
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, 1fr);
  position: fixed;
  grid-template-rows: repeat(2, 1fr);
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
}

/* Ensure grid videos fill cells with 16:9 ratio */
.grid_5x2 video{
  width: 100%;
  height: fit-content;
  display: block;
  object-fit: cover;
  aspect-ratio: 102 / 143;
  scroll-snap-align: center;

  .filler {
    height: 100%;
  }
}

.grid_3x3{
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr 1fr;
  
  .embodiment{
    width: 100%;
    height: calc((100vw - 20px) / 3 / 16 * 9 );
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }

  .embodiment-video-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease-in-out;
  }

  .embodiment-video-container.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .embodiment-video-mount {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .embodiment-video-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    margin: 0;
    padding: 0;
    cursor: pointer;
    z-index: 2;
  }

  #embodiment_1 { background-image: url('/polyphonic-embodiments/img/1_Device.webp'); }
  #embodiment_2 { background-image: url('/polyphonic-embodiments/img/2_Device.webp'); }
  #embodiment_3 { background-image: url('/polyphonic-embodiments/img/3_Device.webp'); }
  #embodiment_4 { background-image: url('/polyphonic-embodiments/img/4_Device.webp'); }
  #embodiment_5 { background-image: url('/polyphonic-embodiments/img/5_Device.webp'); }
  #embodiment_6 { background-image: url('/polyphonic-embodiments/img/6_Device.webp'); }
  #embodiment_7 { background-image: url('/polyphonic-embodiments/img/7_Device.webp'); }
  #embodiment_8 { background-image: url('/polyphonic-embodiments/img/8_Device.webp'); }
  #embodiment_9 { background-image: url('/polyphonic-embodiments/img/9_Device.webp'); }
}


@media screen and (min-width: 801px) {
  #embodiment_1:hover { background-image: url('/polyphonic-embodiments/img/1_Device_Still.webp'); }
  #embodiment_2:hover { background-image: url('/polyphonic-embodiments/img/2_Device_Still.webp'); }
  #embodiment_3:hover { background-image: url('/polyphonic-embodiments/img/3_Device_Still.webp'); }
  #embodiment_4:hover { background-image: url('/polyphonic-embodiments/img/4_Device_Still.webp'); }
  #embodiment_5:hover { background-image: url('/polyphonic-embodiments/img/5_Device_Still.webp'); }
  #embodiment_6:hover { background-image: url('/polyphonic-embodiments/img/6_Device_Still.webp'); }
  #embodiment_7:hover { background-image: url('/polyphonic-embodiments/img/7_Device_Still.webp'); }
  #embodiment_8:hover { background-image: url('/polyphonic-embodiments/img/8_Device_Still.webp'); }
  #embodiment_9:hover { background-image: url('/polyphonic-embodiments/img/9_Device_Still.webp'); } 
}





/* ============= DANDELIONS GALLERY ================= */
.dandelions-gallery{
  padding: 20px;
  box-sizing: border-box;
}

.dandelions-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.dandelions-caption{
  position: absolute;
  left: 0;
  bottom: 0;

  pointer-events: none;
  max-width: 100%;
  box-sizing: border-box;

  font-family: Arial, sans-serif;
  color: white;
  padding: 2px 4px;
  font-size: 12px;
  line-height: 1.3;
}

.dandelions-container {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: nowrap;
  width: 100%;
}

.dandelions-figure {
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
}

.dandelions-img-box {
  overflow: hidden;
  position: relative;
}

.dandelions-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dandelions-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: var(--tile-size, 0);
  flex-shrink: 0;
}

.dandelions-small-figure {
  width: var(--tile-size, 0);
}

.dandelions-small-img-box {
  width: var(--tile-size, 0);
  height: var(--tile-size, 0);
}

.dandelions-big-figure {
  width: var(--big-width, 0);
}

.dandelions-big-img-box {
  width: var(--big-width, 0);
  height: var(--big-width, 0);
}






/* ============= Autonomy of a Fall ============= */
.aof-stack { 
  box-sizing: border-box; 
  padding: 20px; 
  padding-bottom: 140px;

  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;

}
      
.aof-stack video { 
  width: 100%; 
  max-height: calc(100vh - 160px);
  margin: 0 0 20px 0; 
  display: block; 
  scroll-snap-align: center;
}

.play_pause{
  position: fixed;
  top: 13px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  mix-blend-mode: difference;
  z-index: 999;
  cursor: pointer;
}


.gif_form{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  background-color: white; 
  max-height: calc(100vh - 160px);
  margin: auto; 
  scroll-snap-align: center;
  aspect-ratio: 1608/1088;
  overflow: scroll;

  .form{
    height: 100%;
  }
}




.essays_placeholder{ 
  margin: 80px 20px; 
  max-width: 630px; 
}






.arrow {
  --scroll-progress: 0;
  --arrow-side-padding: 20px;
  --arrow-size-after-scroll: 95px;
  --arrow-bottom-offset: 30px;
  --arrow-aspect-factor: calc(25 / 95);
  position: fixed;
  left: 50%;
  width: calc(
    (1 - var(--scroll-progress)) * (100% - calc(var(--arrow-side-padding) * 2)) +
    var(--scroll-progress) * var(--arrow-size-after-scroll)
  );
  height: auto;
  top: calc(
    (1 - var(--scroll-progress)) * 50vh +
    var(--scroll-progress) * (
      100vh - var(--arrow-bottom-offset) -
      calc(var(--arrow-size-after-scroll) * var(--arrow-aspect-factor))
    )
  );
  transform: translate(-50%, -50%) rotate(calc(var(--scroll-progress) * 180deg));
  z-index: 0;
  pointer-events: none;
  transition: top 0.1s ease-out, width 0.1s ease-out, transform 0.1s ease-out;
}





@media screen and (max-width: 800px) {

  .logo{
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    aspect-ratio: 420/39;
    background-image: url('M-LOGO.svg');
    background-size: contain;
  }

  body.main .logo {
    display: none;
  }

  .art_container.short{
    bottom: 52px;
  }

  .project_info_container{
    display: flex;
    flex-direction: column;
    top: calc(100dvh - 52px);
    padding-top: 60px;
    min-height: calc(100dvh - 90px);
    max-height: calc(100dvh - 90px);

  }

  .project_info_container:hover{
    background-color: unset;
  }

  .arrow_btn{
    position: fixed;
    top: calc(100dvh - 42px);
    left: 0;
    width: 100%;
    min-height: 32px;
    z-index: 10000;
    pointer-events: auto;
    transition: top 0.3s ease;
  }

  .project_info_container.open{
    background-color: #f4f4f4;
    top: 90px;
  }

  .project_info_container.open .invisible{
    top: 90px;
    left: 0;
    width: 100%;
    min-height: 52px;
    z-index: 100;
  }
  .project_info_container.open .arrow_btn{
    top: 100px;
  }

  .grid_3x3{
    display: flex;
    flex-direction: column;

    .embodiment{
      width: 100%;
      height: calc(100vw / 16 * 9 );
      background-size: contain;
      background-repeat: no-repeat;
      background-position: center;
    }
  }


  .grid_5x2{
    display: flex;
    flex-direction: column;
  }



  .dandelions-gallery{
    padding: 0;
    margin-bottom: 100px;
  }

  .dandelions-container {
    display: flex;
    gap: 0;
    flex-direction: column;
    width: 100%;
  }

  .dandelions-figure {
    margin: 0;
    width: 100%;
    cursor: default;
  }

  .dandelions-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: initial;
  }

  .dandelions-caption{
    position: initial;
    display: block;
  
    pointer-events: none;
    max-width: 100%;
    box-sizing: border-box;
  
    font-family: Arial, sans-serif;
    color: #678486;
    padding: 4px 10px 6px 10px;
    font-size: 16px;
    line-height: 1.3;
  }

  .secondary_logo{
    display: none;
  }

  footer .logos{
    display: none;
  }

  footer{
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    margin: 20px;
    justify-content: left;
    background-color: #F4F4F4;
  }

  footer .nav{
    gap: 40px;
  }


  .about_container{
    display: flex;
    flex-direction: column;
    gap: 30px;

    .credits{
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .right{
      text-align: left;
    }
  }

  #wrong_mobile{
    display: block;
    width: 100px; 
    margin-top: 7px;
  }

  .arrow {
    --arrow-side-padding: 10px;
    --arrow-size-after-scroll: 95px;
    --arrow-bottom-offset: 100px;
    top: calc(
      (1 - var(--scroll-progress)) * (50vh - 100px) +
      var(--scroll-progress) * 610px
    );
  }




  .gif_form{
    display: flex;
    flex-direction: column;
    gap: 20px;
    background-color: white; 
    max-height: unset;
    aspect-ratio: unset;

    .form{
      height: auto;
    }
  }

  .play_pause{
    top: 60px;
  }

}
