:root {
  --page-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* SLIDING TAB */

.utility-tabs {
  position: relative;
  isolation: isolate;

  display: grid;
  grid-template-columns: repeat(2, auto);

  border-right: 1px solid #050505;
}

.utility-tabs::before {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;

  width: 50%;

  content: "";

  background: #142b8f;

  transform: translateX(0);

  transition:
    transform 420ms var(--page-ease);
}

.utility-tabs.support-selected::before {
  transform: translateX(100%);
}

.utility-tabs .utility-tab {
  position: relative;

  min-width: 150px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0 22px;

  background: transparent;
  color: #050505;

  border: 0;
  border-right: 1px solid #050505;

  font-size: 11px;

  transition:
    color 300ms ease;
}

.utility-tabs .utility-tab:last-child {
  border-right: 0;
}

.utility-tabs.home-selected
.utility-tab:first-child,
.utility-tabs.support-selected
.utility-tab:last-child {
  color: #ffffff;
}

/* FULL-PAGE SLIDE */

.page-transition {
  position: fixed;
  inset: 0;
  z-index: 99999;

  pointer-events: none;

  background: #050505;
  color: #ffffff;

  transform: translateX(100%);

  will-change: transform;
}

.page-transition-content {
  width: 100%;
  height: 100%;

  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  padding:
    clamp(25px, 5vw, 70px);

  opacity: 0;

  transition:
    opacity 250ms ease;
}

.page-transition-logo {
  font-family:
    "Arial Black",
    Impact,
    sans-serif;

  font-size: clamp(65px, 13vw, 210px);
  letter-spacing: -0.1em;
  line-height: 0.72;
}

.page-transition-name {
  padding-bottom: 10px;

  font-size: 10px;
  letter-spacing: 0.06em;
}

/* LEAVING THE CURRENT PAGE */

body.page-leaving
.page-transition {
  pointer-events: all;

  animation:
    pageSlideIn 650ms
    var(--page-ease)
    forwards;
}

body.page-leaving
.page-transition-content {
  opacity: 1;

  transition-delay: 180ms;
}

/* ENTERING THE NEXT PAGE */

body.page-entering
.page-transition {
  transform: translateX(0);

  animation:
    pageSlideOut 750ms
    var(--page-ease)
    100ms forwards;
}

body.page-entering
.page-transition-content {
  opacity: 1;

  animation:
    transitionTextOut 350ms
    ease
    160ms forwards;
}

@keyframes pageSlideIn {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes pageSlideOut {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

@keyframes transitionTextOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@media (max-width: 650px) {
  .utility-tabs .utility-tab {
    min-width: 115px;
    padding: 0 13px;

    font-size: 9px;
  }

  .page-transition-content {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 25px;
  }

  .page-transition-logo {
    font-size: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-transition {
    display: none;
  }

  .utility-tabs::before {
    transition: none;
  }
}