@import url("https://fonts.googleapis.com/css2?family=Anton&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

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

/* Move CSS variables to intro section only */

/* Scope intro-grid styles to only affect the intro section */

.noscroll {
  /* Allow scrolling always */
  height: auto;
  width: 100%;
  overflow: visible;
  overflow-y: auto;
  position: static;
}

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

.intro a:hover {
  text-decoration: underline;
  color: var(--color-link-hover);
  outline: none;
}

.intro a:focus {
  outline: none;
  background: lightgrey;
}

.intro a:focus:not(:focus-visible) {
  background: transparent;
}

.intro a:focus-visible {
  outline: 2px solid red;
  background: transparent;
}

.intro .hidden {
  opacity: 0;
  pointer-events: none;
}

.intro {
  /* CSS variables scoped to intro section only */
  --color-text: #292828;
  --color-bg: #ddd;
  --color-link: #000;
  --color-link-hover: #000;
  --page-padding: 1rem;
  --angle: -15deg;
  --trans-content: -30vh;

  width: 100%;
  height: 100vh;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  margin: 0;
  color: var(--color-text);
  background-color: var(--color-bg);
  font-family: "Poppins", sans-serif;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.intro::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    url(https://github.com/misalagp/imgs/blob/main/noise.png?raw=true),
    radial-gradient(circle, #315f316e 0%, transparent 100%);
  background-size: 250px, 100%;
  pointer-events: none;
}

.intro.intro--open {
  height: 80vh;
}

.intro .grid {
  gap: 1rem;
  flex: none;
  position: relative;
  width: 200vw;
  height: 200vh;
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  grid-template-columns: 100%;
  transform: rotate(var(--angle));
  transform-origin: center center;
}

.intro .row {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(7, 1fr);
  will-change: transform, filter;
}

.intro .row__item {
  position: relative;
}

.intro .row__item-inner {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 10px;
}

.intro .row__item-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: 50% 50%;
  position: absolute;
  top: 0;
  left: 0;
}

.intro .row__item-img--large {
  width: 100vw;
  height: 100vh;
  top: 50%;
  left: 50%;
  margin: -50vh 0 0 -50vw;
  background-position: 50% 70%;
  will-change: transform, filter;
}

.intro .enter {
  color: rgba(0, 0, 0, 0.8);
  position: absolute;
  text-transform: uppercase;
  padding: 1.75rem 4rem;
  font-weight: 600;
  z-index: 10;
  font-family: "Poppins", sans-serif;
  font-size: 1.5rem;
  transition: all 0.3s;
  cursor: pointer;
}

.intro .enter::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border-radius: 3rem;
  transition: all 0.3s;
  z-index: -1;
}

.intro .enter::after {
  content: "";
  position: absolute;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  top: 2px;
  left: 2px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: calc(3rem - 2px);
  z-index: -1;
}

.intro .enter:focus::after,
.intro .enter:hover::after {
  background-color: rgba(255, 255, 255, 0.9);
}

.intro .fullview {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
}

.intro .fullview .row__item-inner {
  border-radius: 0px;
}

.intro .content {
  padding: var(--page-padding);
  position: relative;
}

.intro .content::before {
  content: "";
  position: absolute;
  border-radius: 10px 10px 0 0;
  height: calc(100% + (-1) * var(--trans-content));
  width: 100%;
  top: 0;
  left: 0;
  z-index: 0;
  background:
    url(https://github.com/misalagp/imgs/blob/main/noise.png?raw=true),
    radial-gradient(at top, #688d68 0%, #ddd 100%);
  background-size: 250px, 100%;
}

.intro .content > * {
  position: relative;
}

.intro .content__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
}

.intro .content__header h2 {
  font-size: 2rem;
  font-family: "Anton", sans-serif;
  font-style: normal;
  font-weight: 400;
  margin: 6rem 0 10vh;
  line-height: 0.9;
}

.intro .content__text {
  text-wrap: balance;
  display: flex;
  flex-direction: column;
  gap: 10vh;
  padding: 0 5vw;
}

.intro .content__text p {
  max-width: 700px;
  font-size: 1.5rem;
  line-height: 1.4;
  margin: 0;
  margin-left: auto;
}

.intro .content__text p.highlight {
  max-width: 1000px;
  font-size: 2rem;
  font-family: "Poppins", sans-serif;
  font-weight: 300;
}

.intro .content__footer {
  display: flex;
  justify-content: space-between;
  margin-top: 20vh;
  transform: translateY(calc(-1 * var(--trans-content)));
}

/* Mobile styles - Auto loop animation */
@media screen and (max-width: 768px) {
  .intro {
    height: 70vh;
  }

  .intro .grid {
    width: 300vw;
    height: 200vh;
    animation: mobileGridLoop 20s linear infinite;
  }

  .intro .row:nth-child(odd) {
    animation: mobileRowSlideLeft 15s linear infinite;
  }

  .intro .row:nth-child(even) {
    animation: mobileRowSlideRight 18s linear infinite;
  }

  .intro .enter {
    font-size: 1.2rem;
    padding: 1.5rem 3rem;
  }
}

@keyframes mobileGridLoop {
  0% {
    transform: rotate(var(--angle)) translateX(0);
  }
  100% {
    transform: rotate(var(--angle)) translateX(-10%);
  }
}

@keyframes mobileRowSlideLeft {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-20%);
  }
}

@keyframes mobileRowSlideRight {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(20%);
  }
}

@media screen and (min-width: 53em) {
  .intro {
    --page-padding: 2rem 3rem;
  }
  .intro .content__header h2 {
    font-size: clamp(2rem, 20vh, 16rem);
  }
  .intro .content__text p.highlight {
    font-size: clamp(2rem, 7vh, 4rem);
  }
}
