:root {
  --bg: #000;
  --fg: #fff;
  --muted: #b3b3b3;
  --header-h: 150px;
  --header-h-small: 75px;
  --transition: 850ms ease;
  --transition-long: 2s ease 2s;
}

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

* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  scroll-behavior: smooth;
  opacity: 0;
  animation: fadeIn 2s forwards;
  font-family: "Lora", serif;
  font-optical-sizing: auto;
}

/* Header */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(16px, 4vw, 40px);
  z-index: 20;
  background: linear-gradient(to bottom, rgba(0,0,0,0.85), rgba(0,0,0,0));
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);

  @media (orientation: portrait) {
    height: var(--header-h-small);
  }
}

.logo-container {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  border-top: 11rem solid rgba(0, 0, 0, 0.65);
  border-right: 63rem solid transparent;
}

.logo img {
  width: 20rem;
  height: auto;

  @media (orientation: portrait) {
    opacity: 0;
    width: 8rem;
  }
}

.nav .nav-link {
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--fg);
  text-decoration: none;
  opacity: 0.9;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding: 6px;
  margin: 0 4px;
  transition: opacity 200ms ease, border-color 200ms ease;
}
.nav .nav-link:hover { opacity: 1; border-color: rgba(255,255,255,0.35); }

/* Stage (fixed overlay) */
#stage {
  position: fixed;
  inset: 0;
  top: 0;
  width: 100%;
  height: 100svh;
  overflow: hidden;
  z-index: 10;
  background: #000;
  opacity: 1;
  transition: opacity 700ms ease;
}

/* Videos */
.slide-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--transition);
}

/* Videos should never capture clicks/drags */
.slide-video {
  pointer-events: none;
}

#down-arrow {
  position: absolute;
  left: clamp(16px, 4vw, 40px);
  bottom: clamp(16px, 4vh, 56px);
  z-index: 3;
  cursor: pointer;
  opacity: 0;

  img {
    width: 58px;
    height: 80px;
  }

  @media (orientation: portrait) {
    img {
      width: 29px;
      height: 40px;
    }

    left: auto;
    right: 15px;
    bottom: 20px;
  }
}

/* Caption */
.caption-container {
  position: absolute;
  bottom: 0;
  right: 0;
  z-index: 0;
/*   background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0)); */
  background: linear-gradient(166deg, #FFF0 66%, rgba(0,0,0,.7) 83%, #000 90%);
  height: 33rem;
  width: 112rem;
  /*border-bottom: 14rem solid rgba(0, 0, 0, 0.65);
  border-left: 162rem solid transparent;*/
}

.caption {
  position: absolute;
  right: clamp(16px, 4vw, 40px);
  bottom: clamp(16px, 4vh, 56px);
  z-index: 3;
  pointer-events: none;
  opacity: 0;

  img {
    width: 55rem;
    height: auto;

    &.portrait {
      display: none;
    }
  }

  @media (orientation: portrait) {
    right: auto;
    left: 16px;
    bottom: 5vh;

    img.portrait {
      display: block;
      width: 365px;
      max-width: 100%;
    }

    img:not(.portrait) {
      display: none;
    }
  }
}

/* Subtle gradient for readability over video bottoms */
.bottom-gradient {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 28%;
  background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0));
  z-index: 2;
  pointer-events: none;

  @media (orientation: portrait) {
    height: 40%;
  }
}

/* Scroller: this tall box creates a scrollbar for the slideshow */
#scroller {
  position: relative;
  z-index: 0;
  width: 100%;
  /* Height set by JS: slides * 100vh */
}


.final-padding {
  display: none;
  height: 25%;

  &.active {
    display: block;
  }
}

.final-section {
  position: relative;
  z-index: 0;
  min-height: 100svh;
/*   padding: calc(var(--header-h) + 10vh) clamp(16px, 6vw, 96px) 15vh; */
  padding-top: 2vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.container-final {
  display: flex;
  justify-content: center;

  img {
    max-width: 80%;
  }

  img.portrait {
    display: none;
  }

  @media (orientation: portrait) {
    img.portrait {
      display: flex;
    }

    img:not(.portrait) {
      display: none;
    }
  }
}

.container-final-first {
  margin-bottom: 4rem;

  img {
    width: 70rem;
    height: auto;

    @media (orientation: portrait) {
      width: 65%;
    }
  }
}

.container-final-second {
  opacity: 0;

  img {
    width: 55rem;
    height: auto;

    @media (orientation: portrait) {
      width: 80%;
    }
  }
}

/* Back button */
.back-btn {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.04);
  color: var(--fg);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  margin: 0 0 24px 0;
}
.back-btn:hover { border-color: rgba(255,255,255,0.4); }

/* Focus */
:focus-visible, :focus-within { outline: 0; }

.rest {
  display: none;

  &.active {
    display: flex;
    align-items: center;
    flex-direction: column;
  }
}

.gallery {
  display: flex;
  justify-content: space-evenly;
  flex-wrap: wrap;
  width: clamp(300px, 750px, 900px);

  @media (orientation: portrait) {
    width: 80%;
  }

  .card {
    position: relative;
    width: 300px;
    height: 450px;
    margin: 1rem 0;
    box-shadow: 0px 0px 30px 5px rgba(128, 128, 128, 0.3);
    border-radius: 3px;
    cursor: pointer;
    user-select: none;

    img {
      width: 300px;
      height: 450px;
      border-radius: 3px;

      &.active {
        filter: blur(3px);
      }
    }

    .card-info {
      opacity: 0;
      display: flex;
      width: 310px;
      height: 460px;
      position: absolute;
      top: -5px;
      left: -5px;
      background: #000A;
      padding: 15px;
      font-size: 1.4rem;
      line-height: 1.9rem;
      text-align: center;
      align-items: center;
      font-weight: 500;
      transition: var(--transition);
    }
  }
}

.about {
  position: relative;
  margin-top: 13rem;
  width: clamp(600px, 900px, 1500px);

  @media (orientation: portrait) {
    margin-top: 10rem;
    width: 80%;
  }

  .qa {
    position: absolute;
    top: -7rem;
    left: -7rem;

    @media (orientation: portrait) {
      top: -4rem;
      left: -1rem;
    }

    svg {
      width: 200px;
      height: auto;

      @media (orientation: portrait) {
        width: 120px;
      }

      path {
        fill: #FFF4;
      }
    }
  }

  .question {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #CCC;

    @media (orientation: portrait) {
      font-size: 1.2rem;
    }
  }

  .answer {
    margin-bottom: 3rem;
    font-size: 1.5rem;
    font-weight: 400;
    color: #CCC;

    @media (orientation: portrait) {
      font-size: 1.2rem;
    }
  }
}

.contact {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;

  .info {
    display: flex;
    align-items: baseline;
    line-height: 0;

    .icon {
      margin: 1rem 1rem 1rem;

      svg {
        width: 40px;
        height: 40px;

         @media (orientation: portrait) {
          width: 25px;
          height: 25px;
        }
      }
    }

    a img {
      width: 220px;

      @media (orientation: portrait) {
        width: 160px;
      }
    }

    #email {
      display: flex;
      cursor: pointer;

      img {
        width: 340px;
      }

      @media (orientation: portrait) {
        flex-direction: column;

        img {
          width: 260px;
        }
      }

      .copied {
        display: flex;
        align-items: center;
        opacity: 0;
        color: #777;
        margin-left: 1rem;

        svg {
          width: 40px;
          height: 40px;

          path {
            fill: #777;
          }
        }

        @media (orientation: portrait) {
          margin-left: 0;
          margin-top: 1rem;

          svg {
            transform: rotate(90deg);
          }
        }
      }
    }
  }

  font-size: 2rem;
  font-weight: 500;
}

/* When we reach the final section, make the stage untouchable */
#stage.is-hidden {
  opacity: 0;                /* keep your fade */
  pointer-events: none;      /* STOP blocking clicks/selection */
  visibility: hidden;        /* remove from hit-testing in some UAs */
  transition: var(--transition);
}

.active {
  opacity: 1 !important;
  transition: var(--transition);
}

.active-long {
  opacity: 1 !important;
  transition: var(--transition-long);
}
