@font-face {
  font-family: "Montserrat";
  src: url(../fonts/Montserrat-VariableFont_wght.ttf) format("truetype-variations");
  font-weight: 100 900;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}

h3 {
  font-size: 1.2rem;
  font-weight: 300;
  letter-spacing: -0.4px;
  margin: 0 0 1em;
  line-height: 1.2;
  color: var(--color-text);
}

h4 {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.35;
  color: var(--color-charcoal);
  margin: 0 0 1em;
}

#about {
  background: var(--color-off-white);
  text-align: center;
  scroll-margin-top: var(--header-height);

  .ethos {
    --gap: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap);
    border-radius: 20px;
    overflow: hidden;
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    text-align: left;
    background: color-mix(in oklab, var(--color-charcoal-light), transparent 90%);
    padding: 0.8rem;
    border-radius: 1rem;

    > li {
      flex: var(--ethos-flex);
      padding: var(--gap);
      position: relative;
      background: #fff;
      border-radius: 0.6rem;
    }
  }
}

.product {
  min-height: 100dvh;
  display: flex;

  > div {
    position: relative;
    z-index: 2;
    text-align: left;
    flex: 1;

    > div {
      width: var(--width);
    }

    h2 {
      text-align: left;
    }

    &::before {
      content: "";
      position: absolute;
      width: 100%;
      height: 100%;
      aspect-ratio: 1;
      pointer-events: none;
      --color: color-mix(in oklab, var(--color-gradient), transparent 60%);
      /* background: radial-gradient(ellipse 30% 40% at 65% 60%, var(--color) 0%, transparent), radial-gradient(circle closest-side at 80% 50%, var(--color), transparent); */
    }

    a {
      color: var(--color-highlight);

      &.icon {
        &::before {
          filter: var(--link-icon-filter);
        }
      }
    }

    .features {
      list-style: none;
      margin: 0 0 1.5rem;
      padding: 0;
      display: grid;
      /* flex-wrap: wrap; */
      grid-auto-flow: dense;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      grid-auto-rows: auto;
      gap: 0.5rem;
      font-size: 0.8em;
      max-width: 400px;

      li {
        background: #fff;
        border-radius: 0.6rem;
        padding: 0.5rem;
        line-height: 1.35;

        &.tall {
          grid-row: span 2;
        }

        &.wide {
          grid-column: span 2;
        }
      }
    }
  }
}

#jada {
  --color-highlight: var(--color-jada-green);
  --color-gradient: var(--color-jada-green);
  --link-icon-filter: var(--gray-to-green);

  h2 {
    display: flex;
    align-items: center;

    &::before {
      content: "";
      width: 1em;
      height: 1em;
      margin: 0 0.4em 0 0;
      background: 50% / contain no-repeat url(../img/jada-logo.webp);
    }
  }
}

.product-phone-stage {
  --phone-shift: 140px;
  position: fixed;
  top: 50%;
  right: max(40px, calc((100vw - var(--content-width-max)) / 2 + 32px));
  width: min(34vw, 340px);
  height: var(--product-phone-height, 80dvh);
  transform: translate3d(var(--phone-shift), -50%, 0);
  opacity: 0;
  display: flex;
  pointer-events: none;
  visibility: hidden;
  z-index: 1;
  transition:
    opacity 0.72s,
    transform 0.72s,
    visibility 0.72s;
  perspective: 1200px;
  transform-style: preserve-3d;
  /* transform-style: flat; */

  &.is-active {
    transform: translate3d(0, -50%, 0);
    opacity: 1;
    visibility: visible;
  }

  .phone-art {
    position: relative;
    aspect-ratio: 9 / 19.5;
    transform-style: preserve-3d;
    transform: rotateX(calc(4deg + var(--tilt-x, 0deg))) rotateY(calc(-18deg + var(--tilt-y, 0deg))) rotateZ(calc(4deg + var(--tilt-z, 0deg)));
    transition: transform 0.2s linear;
    /* filter: drop-shadow(0 1rem 1rem rgba(0, 0, 0, 0.45)); */
    filter: drop-shadow(1rem 1rem 0 color-mix(in oklab, var(--color-charcoal-light), #fff 80%));
    height: 100%;
  }

  .phone-screen {
    position: absolute;
    top: 6.9%;
    left: 4.2%;
    width: 87.2%;
    height: 86.2%;
    border-radius: calc(0.035 * var(--product-phone-height));
    overflow: hidden;
    background: #000;
    z-index: 10;
    pointer-events: none;

    .phone-screen-scroll {
      height: 100%;
      overflow-y: auto;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }

    .phone-screen-scroll::-webkit-scrollbar {
      display: none;
    }
  }

  .phone-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    z-index: 2;
    user-select: none;
  }

  .slideshow {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 1;

    > div {
      position: absolute;
      inset: 0;
      opacity: 0;
      will-change: opacity;
      transition: opacity var(--slideshow-fade-duration, 720ms) ease;

      &.is-active {
        opacity: 1;
      }

      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
      }
    }
  }

  &[data-product="jada"] .slideshow.jada,
  &[data-product="snaps"] .slideshow.snaps {
    opacity: 1;
    z-index: 2;
  }
}

#snaps {
  --color-highlight: #827efc;
  --color-gradient: var(--color-highlight);
  --link-icon-filter: var(--gray-to-lilac);
  background: var(--color-off-white);

  h2 {
    display: flex;
    align-items: center;
    margin: 0;

    > span {
      opacity: 0;
    }

    &::before {
      content: "";
      width: 30%;
      height: 2.5em;
      margin: 0 0 0 -0.8em;
      background: 0% 50% / contain no-repeat url(../img/snaps-logo-black.png);
    }
  }

  div:has(a[href="https://ilovesnaps.com"]) {
    margin-bottom: 1em;
  }
}

#pipeline {
  background: var(--color-charcoal);
  color: #fff;
  padding: 120px 40px;

  > div > p {
    color: #fff;
  }

  .products {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;

    li {
      flex: 1 40%;
      background: var(--color-white);
      border: 1px solid var(--light-grey);
      border-radius: 1rem;
      padding: 1rem;
      text-align: left;
      display: flex;

      &.restaurant {
        --product-icon: url(../img/restaurant.svg);
      }

      &.section-title {
        --product-icon: url(../img/book-open.svg);
      }
    }
  }
}

#contact {
  min-height: 80dvh;

  .contact-btns {
    display: flex;
    gap: 16px;
    justify-content: center;
  }
}

.btn.black {
  display: inline-flex;
  background: var(--color-charcoal);
  box-shadow: inset 0 0 1px 2px var(--color-charcoal);
  color: var(--color-white);
}

.btn.black:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.2px;
  text-decoration: none;
  color: var(--color-charcoal-light);
  border: 1px solid var(--light-grey);
  padding: 16px 32px;
  border-radius: 980px;
  transition:
    border-color 0.2s,
    color 0.2s;
}

.btn-ghost:hover {
  border-color: #999;
  color: var(--color-charcoal);
}

footer {
  position: relative;

  &::before {
    content: "";
    position: absolute;
    border-top: 1px solid color-mix(in oklab, var(--color-charcoal-light), transparent 70%);
    width: max(30%, 200px);
    left: 50%;
    transform: translateX(-50%);
  }

  > div {
    padding: 2rem 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .footer-links {
    display: flex;
    gap: 24px;
  }

  .footer-links a {
    color: var(--color-charcoal-light);
    text-decoration: none;
    transition: color 0.2s;
  }

  .footer-links a:hover {
    color: var(--color-charcoal);
  }
}

dialog {
  margin: 0;
  padding: 0;
  border: none;
  max-width: unset;
  max-height: unset;
  width: 100%;
  height: 100%;

  > article {
    background: var(--color-bg);
    border-radius: 1rem;
    max-width: min(var(--content-width-max), calc(100dvw - 2rem));
    max-height: calc(100dvh - 2rem);
    width: 100%;
    height: 100%;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);

    > header {
      height: 1rem;
      position: relative;

      > button {
        position: absolute;
        top: 1rem;
        right: 1rem;
        width: 2rem;
        height: 2rem;
        padding: 0;
        border: 0;
        background: var(--color-bg);

        &:focus-within {
          outline: none;
        }

        &::before {
          content: "";
          position: absolute;
          background: var(--color-text);
          width: 100%;
          height: 2px;
          left: 0;
          transform: rotate(45deg);
        }

        &::after {
          content: "";
          position: absolute;
          background: var(--color-text);
          width: 100%;
          height: 2px;
          left: 0;
          transform: rotate(-45deg);
        }

        span {
          display: none;
        }
      }
    }

    > div {
      padding: 2rem;
      height: calc(100% - 1rem);
      overflow-y: auto;
    }
  }
}

#privacy-terms {
  h2,
  h3 {
    font-size: 1.3rem;
    text-align: left;
  }

  h4 {
    text-align: left;
  }
}

@media screen and (max-width: 860px) {
  #about {
    --ethos-flex: 0 100%;
    --ethos-right: 50%;
    --ethos-bottom: 0;
    --ethos-width: calc(100% - 2rem);
    --ethos-height: 1px;
    --ethos-transform: translateX(50%);
  }

  .product {
    > div {
      > div {
        --width: 100%;
      }
    }
  }

  #snaps {
    div#snaps-qr {
      display: none;
    }
  }

  .product-phone-stage {
    --product-phone-height: 50dvh;
    position: relative;
    top: auto;
    right: auto;
    height: 55svh;
    transform: none;
    opacity: 1;
    visibility: visible;
    display: flex;
    justify-content: center;
    width: min(100%, 280px);
    margin: 2rem auto 0;

    .slideshow {
      opacity: 1;
    }
  }

  #pipeline {
    .products {
      li {
        h3 {
          display: flex;

          &::before {
            content: "";
            width: 2.5em;
            height: 2.5em;
            min-width: 2.5em;
            margin-right: 1rem;
            background: 50% / contain no-repeat var(--product-icon);
          }
        }
      }
    }
  }

  footer {
    flex-direction: column;
    gap: 16px;
    text-align: center;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  body > .product-phone-stage {
    display: none;
  }
}

@media screen and (min-width: 861px) {
  #about {
    --ethos-flex: 1 30%;
    --ethos-right: 0;
    --ethos-bottom: 50%;
    --ethos-width: 1px;
    --ethos-height: calc(100% - 2rem);
    --ethos-transform: translateY(50%);
  }

  .product {
    > div {
      display: flex;
      align-items: center;

      > div:first-child {
        --width: 50%;
      }
    }

    .product-phone-stage {
      display: none;
    }
  }

  .product-phone-stage {
    --product-phone-height: 80dvh;
    max-height: 800px;

    &.is-current {
      justify-content: right;
    }
  }

  #snaps {
    a[href*="/app"] {
      display: none;
    }

    div#snaps-qr img {
      display: block;
      width: 200px;
      height: 200px;
      filter: brightness(0);
    }
  }

  #pipeline {
    .products {
      li {
        &::before {
          content: "";
          width: 4em;
          height: 4em;
          min-width: 4rem;
          margin-right: 1rem;
          background: 50% / contain no-repeat var(--product-icon);
        }
      }
    }
  }
}
