*,
*::after,
*::before {
  box-sizing: border-box;
}

:root {
  font-size: 14px;
  --color-text: hsl(300deg 33% 99%);
  --color-bg: hsl(120deg 3% 8%);
  --color-link: hsl(215deg 53% 35%);
  --color-link-hover: hsl(300deg 33% 99%);
  --title-gr-1: hsl(240deg 33% 99%);
  --title-gr-2: hsl(263deg 38% 53%);
  --color-desc: #999;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  color: var(--color-text);
  background-color: var(--color-bg);
  font-family:
    "vinila",
    -apple-system,
    BlinkMacSystemFont,
    Segoe UI,
    Helvetica,
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-transform: uppercase;
}

.demo-2 {
  --title-gr-2: hsl(177deg 68% 51%);
}

.demo-3 {
  --title-gr-2: hsl(334deg 54% 44%);
}

/* Background Blobs */
.bg-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0.15;
  animation: float 20s ease-in-out infinite;
}

.blob-1 {
  width: 600px;
  height: 600px;
  top: -200px;
  left: -100px;
  background: var(--title-gr-2);
  animation-delay: 0s;
  animation-duration: 25s;
}

.blob-2 {
  width: 500px;
  height: 500px;
  bottom: -150px;
  right: -100px;
  background: var(--color-link);
  animation-delay: 3s;
  animation-duration: 30s;
}

.blob-3 {
  width: 700px;
  height: 700px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--title-gr-1);
  opacity: 0.08;
  animation-delay: 6s;
  animation-duration: 35s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(50px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-30px, 30px) scale(0.9);
  }
}

.demo-2 .blob-1,
.demo-3 .blob-1 {
  animation-duration: 28s;
}

.demo-2 .blob-2,
.demo-3 .blob-2 {
  animation-duration: 32s;
}

/* Page Loader */
.js .loading::before,
.js .loading::after {
  content: "";
  position: fixed;
  z-index: 1000;
}

.js .loading::before {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-bg);
}

.js .loading::after {
  top: 50%;
  left: 50%;
  width: 300px;
  height: 2px;
  margin: -1px 0 0 -150px;
  background: var(--color-link);
  box-shadow:
    0 0 10px var(--color-link),
    0 0 20px var(--title-gr-2);
  animation: cyberLoaderAnim 1.5s cubic-bezier(0.86, 0, 0.07, 1) infinite;
}

@keyframes cyberLoaderAnim {
  0% {
    transform: scaleX(0);
    transform-origin: left;
  }
  49.9% {
    transform: scaleX(1);
    transform-origin: left;
  }
  50% {
    transform: scaleX(1);
    transform-origin: right;
  }
  100% {
    transform: scaleX(0);
    transform-origin: right;
  }
}

a {
  text-decoration: none;
  color: var(--color-link);
  outline: none;
  cursor: pointer;
}

a:hover {
  color: var(--color-link-hover);
  outline: none;
}

/* Better focus styles from https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible */
a:focus {
  /* Provide a fallback style for browsers
	 that don't support :focus-visible */
  outline: none;
  background: lightgrey;
}

a:focus:not(:focus-visible) {
  /* Remove the focus indicator on mouse-focus for browsers
	 that do support :focus-visible */
  background: transparent;
}

a:focus-visible {
  /* Draw a very noticeable focus style for
	 keyboard-focus on browsers that do support
	 :focus-visible */
  outline: 2px solid red;
  background: transparent;
}

.unbutton {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
}

.unbutton:focus {
  outline: none;
}

main {
  position: relative;
  display: grid;
  grid-template-areas: "main";
  width: 100%;
  height: 100vh;
}

.oh {
  position: relative;
  overflow: hidden;
}

.oh__inner {
  will-change: transform;
  display: inline-block;
}

.frame {
  grid-area: main;
  z-index: 1000;
  position: relative;
  width: 100%;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 100%;
  grid-template-areas: "title" "prev" "sponsor" "demos";
  grid-gap: 0.5rem;
  justify-items: start;
  align-self: end;
  justify-self: start;
  pointer-events: none;
  align-items: center;
}

body #cdawrap {
  justify-self: start;
}

.frame a {
  pointer-events: auto;
}

.frame__title {
  grid-area: title;
  display: flex;
}

.frame__title-main {
  font-size: inherit;
  margin: 0;
  font-weight: inherit;
}

.frame__title-back {
  position: relative;
  display: flex;
  align-items: flex-end;
  margin-bottom: 0.15rem;
}

.frame__title-back span {
  display: none;
}

.frame__title-back svg {
  fill: currentColor;
}

.frame__prev {
  grid-area: prev;
}

.frame__demos {
  grid-area: demos;
  display: flex;
  gap: 1rem;
}

.intro-grid-wrap {
  grid-area: main;
  height: 100vh;
}

.intro-grid {
  grid-area: main;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: 100%;
  gap: 2vw;
  padding: 2vw 2vw 4rem;
}

.intro-grid--labels {
  padding-top: 0.75rem;
  grid-template-rows: auto;
  align-self: start;
  padding-bottom: 0;
  display: none;
}

.intro-grid--images {
  padding-top: 3rem;
  height: 100vh;
}

.intro-grid--slider {
  --slider-item-height: 60vh;
  --slider-item-gap: 7vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: calc(
    var(--slider-item-height) + var(--slider-item-gap)
  ); /* item height plus gap  */
  gap: 7vh;
  padding: 0;
  align-self: center;
}

.intro-grid--images.intro-grid--thumbs {
  padding-top: 1.85rem;
  padding-bottom: 0;
  grid-template-columns: repeat(20, 1fr);
  grid-template-rows: auto 5vh 1fr 10vh;
  column-gap: 1.5vw;
}

.intro-grid--thumbs .intro-grid__img {
  grid-area: auto;
  aspect-ratio: 0.75;
  cursor: not-allowed;
}

.intro-grid--thumbs .intro-grid__img--current {
  grid-area: 3 / 1 / 4 / -1;
  justify-self: center;
  pointer-events: none;
}

.intro-grid--slider .intro-grid__label {
  position: absolute;
}

.intro-grid__img {
  background-size: cover;
  background-position: 50% 20%;
  cursor: pointer;
  will-change: transform, filter;
  transform: translateZ(0.1px);
}

.intro-grid--slider .intro-grid__img {
  height: var(--slider-item-height);
  aspect-ratio: 0.75;
  flex: none;
}

.intro-grid--scatter {
  width: 200%;
  height: 200vh;
  padding: 0;
}

.intro-grid--scatter .intro-grid__img {
  max-width: 20vw;
  max-height: 50vh;
}

.intro-grid--scatter .intro-grid__img--current {
  width: 30vw;
  height: 70vh;
  max-width: none;
  max-height: none;
}

.intro-title {
  grid-area: main;
  align-self: center;
  justify-self: center;
  text-align: center;
  cursor: default;
  pointer-events: none;
}

.intro-title__main,
.slider-title__main {
  margin: 0;
  font-size: clamp(1rem, 7vw, 10rem);
  font-family: organetto-variable, sans-serif;
  font-variation-settings:
    "wdth" 100,
    "wght" 400;
}

.intro-title__main > span,
.slider-title__main > span {
  background-image: linear-gradient(
    45deg,
    var(--title-gr-1),
    var(--title-gr-2)
  );
  background-size: 100%;
  background-repeat: repeat;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  -moz-background-clip: text;
  -moz-text-fill-color: transparent;
}

.intro-title__sub {
  font-family: microgramma-extended, sans-serif;
  font-weight: 500;
  font-style: normal;
  font-size: clamp(1rem, 4vw, 2rem);
  display: block;
}

.slider-title {
  opacity: 0;
  pointer-events: none;
  grid-area: main;
  align-self: center;
  justify-self: center;
  position: relative;
}

.slider-title__main {
  font-size: clamp(1rem, 6vw, 9rem);
}

.slider-title__desc {
  left: 10vw;
  position: absolute;
  margin: 0;
  color: var(--color-desc);
  max-width: 200px;
}

.controls {
  position: absolute;
  padding: 2rem;
  top: 0;
  right: 0;
  display: flex;
  text-transform: uppercase;
  color: var(--color-link);
  gap: 1rem;
  pointer-events: none;
  z-index: 100;
}

.controls--open {
  pointer-events: auto;
}

.controls button {
  text-transform: uppercase;
  color: var(--color-link);
  transition: all 0.3s ease;
}

.close {
  border: 1.5px solid var(--color-link);
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  opacity: 0;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.2),
    0 0 20px rgba(108, 196, 154, 0.1);
  transition: all 0.3s ease;
}

.close:hover {
  background: rgba(108, 196, 154, 0.15);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(108, 196, 154, 0.3);
  transform: scale(1.05);
  border-color: rgba(108, 196, 154, 0.8);
}

.close:active {
  transform: scale(0.95);
}

.nav {
  padding: 0 1.5rem;
  border: 1.5px solid var(--color-link);
  align-items: center;
  gap: 1rem;
  border-radius: 2rem;
  opacity: 0;
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.2),
    0 0 20px rgba(108, 196, 154, 0.1);
  transition: all 0.3s ease;
}

.nav:hover {
  background: rgba(108, 196, 154, 0.08);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(108, 196, 154, 0.2);
  border-color: rgba(108, 196, 154, 0.8);
}

.nav__item {
  cursor: pointer;
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
}
.nav__item:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}
.nav__item:not([disabled]):hover {
  color: var(--color-link-hover);
  transform: scale(1.05);
}

.nav__index {
  color: var(--color-link);
  font-weight: 600;
  letter-spacing: 0.05em;
}

@media screen and (min-width: 53em) {
  .frame {
    position: fixed;
    height: 100vh;
    grid-template-columns: auto auto auto 1fr;
    grid-template-rows: auto auto;
    grid-template-areas: "... ... ... ..." "title prev sponsor demos";
    align-content: space-between;
    justify-items: start;
    grid-gap: 2rem;
    padding: 0.75rem;
  }
  .frame__demos {
    justify-self: end;
  }
  .intro-grid {
    grid-template-columns: repeat(10, 1fr);
  }
  .intro-grid--labels {
    display: grid;
  }
  .intro-grid--images {
    grid-template-rows: 1fr 1fr 1fr 1fr;
  }
  .intro-grid__img {
    background-position: 50% 50%;
  }
  .pos-1 {
    grid-area: 1 / 1;
  }
  .pos-2 {
    grid-area: 1 / 2;
  }
  .pos-3 {
    grid-area: 1 / 4;
  }
  .pos-4 {
    grid-area: 1 / 5;
  }
  .pos-5 {
    grid-area: 1 / 6;
  }
  .pos-6 {
    grid-area: 1 / 7;
  }
  .pos-7 {
    grid-area: 1 / 9;
  }
  .pos-8 {
    grid-area: 1 / 10;
  }
  .pos-9 {
    grid-area: 1 / 7;
  }
  .pos-10 {
    grid-area: 4 / 9;
  }
  .pos-11 {
    grid-area: 1 / 1;
  }
  .pos-12 {
    grid-area: 2 / 2;
  }
  .pos-13 {
    grid-area: 3 / 1;
  }
  .pos-14 {
    grid-area: 3 / 4;
  }
  .pos-15 {
    grid-area: 4 / 4;
  }
  .pos-16 {
    grid-area: 1 / 5;
  }
  .pos-17 {
    grid-area: 2 / 5;
  }
  .pos-18 {
    grid-area: 4 / 5;
  }
  .pos-19 {
    grid-area: 3 / 6;
  }
  .pos-20 {
    grid-area: 2 / 9;
  }
  .pos-21 {
    grid-area: 2 / 10;
  }
  .pos-22 {
    grid-area: 3 / 10;
  }
  .nav {
    display: flex;
  }
}

@media screen and (max-width: 53em) {
  .controls {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
  }
  .nav {
    padding: 0 1rem;
    gap: 0.5rem;
    font-size: 0.85rem;
  }
  .nav__item {
    padding: 0.6rem 0.75rem;
  }
}
