/* Loading Screen Styles */
@import url("https://fonts.cdnfonts.com/css/longsile");
@import url("https://fonts.cdnfonts.com/css/thegoodmonolith");
@import url("https://fonts.cdnfonts.com/css/pp-neue-montreal");

:root {
  --loading-text: #ffcc00;
  --loading-bg: #000000;
  --loading-highlight-bg: #ffcc00;
  --type-line-opacity: 0.05;
}

.loading-screen-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--loading-bg);
  z-index: 10000;
  overflow: hidden;
  font-family: "Longsile", sans-serif;
}

.background-frame {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-image: url("https://assets.codepen.io/7558/web03.webp");
  background-size: 100% 100%;
  background-position: center;
  z-index: 0;
  pointer-events: none;
}

.bottom-gradient {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40vh;
  background: linear-gradient(to top,
      rgba(0, 0, 0, 1) 0%,
      rgba(0, 0, 0, 0) 100%);
  z-index: 1;
  pointer-events: none;
}

.background-image {
  position: fixed;
  width: calc(100%);
  height: calc(100vh);
  background-size: cover;
  background-position: center;
  opacity: 0;
  z-index: 1;
  mix-blend-mode: multiply;
  transition: opacity 0.8s ease-in-out;
}

.background-image.default {
  background-image: url("https://assets.codepen.io/7558/wave-bg-001.webp");
  opacity: 1;
}

.background-image.focus {
  background-image: url("https://assets.codepen.io/7558/wave-bg-002.webp");
}

.background-image.presence {
  background-image: url("https://assets.codepen.io/7558/wave-bg-003.webp");
}

.background-image.feel {
  background-image: url("https://assets.codepen.io/7558/wave-bg-004.webp");
}

.text-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.text-item {
  position: absolute;
  color: var(--loading-text);
  font-size: 0.8rem;
  text-transform: uppercase;
  opacity: 0.8;
  white-space: nowrap;
  font-family: "TheGoodMonolith", monospace;
  z-index: 0;
}

.text-item::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -4px;
  width: 0;
  height: calc(100% + 4px);
  background-color: var(--loading-highlight-bg);
  z-index: 1;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.text-item.highlight::after {
  width: calc(100% + 8px);
}

.text-item.highlight-reverse::after {
  width: 0;
  right: -4px;
  left: auto;
}

.main-content {
  position: relative;
  z-index: 10;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.expand-rectangle {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background-color: #ffffff;
  z-index: 99;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.sliced-container {
  position: relative;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  transform: translateZ(0);
}

.loading-screen-wrapper .text-row {
  position: relative;
  width: 100%;
  height: 140px;
  margin: 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  z-index: 100;
  cursor: default;
}

.loading-screen-wrapper .text-content,
.loading-screen-wrapper .char,
.loading-screen-wrapper .char-inner {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transform: translateZ(0);
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.loading-screen-wrapper .text-content {
  position: relative;
  font-size: 10rem;
  font-weight: normal;
  text-transform: uppercase;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  color: var(--loading-text);
  letter-spacing: 0px;
  transition: letter-spacing 0.5s ease;
  visibility: hidden;
  transform: translate3d(0, 0, 0);
}

.loading-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.loading-bar {
  width: 100%;
  height: 4px;
  background-color: rgba(255, 204, 0, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.loading-progress {
  height: 100%;
  width: 0%;
  background-color: var(--loading-text);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--loading-text);
}

.loading-text {
  color: var(--loading-text);
  font-size: 0.9rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: "TheGoodMonolith", monospace;
  opacity: 0.8;
}

.loading-percentage {
  color: var(--loading-text);
  font-size: 1.2rem;
  font-weight: bold;
  font-family: "PP Neue Montreal", sans-serif;
  opacity: 0.9;
}

.interactive-area {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  cursor: pointer;
}

.loading-screen-wrapper .char {
  display: inline-block;
  position: relative;
  overflow: hidden;
  max-width: 80px;
  transition: max-width 0.64s cubic-bezier(0.86, 0, 0.07, 1);
  margin-right: 0px;
}

.loading-screen-wrapper .text-row.active .char::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 80%;
  background-color: rgba(255, 204, 0, 0.2);
  transform: none;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
  animation-delay: calc(var(--char-index, 0) * 0.05s);
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.loading-screen-wrapper .char.narrow-char {
  max-width: 40px;
}

.loading-screen-wrapper .char:last-child::after {
  display: none;
}

.loading-screen-wrapper .char-inner {
  position: relative;
  display: inline-block;
  width: 100%;
  height: 100%;
  will-change: transform;
  transform: translate3d(-20px, 0, 0);
}

.type {
  position: fixed;
  height: 100vmax;
  width: 100vmax;
  text-transform: uppercase;
  display: none;
  justify-content: center;
  align-content: center;
  text-align: center;
  top: 50%;
  left: 50%;
  margin-top: -50vmax;
  margin-left: -50vmax;
  will-change: transform;
  z-index: 5;
  transform-style: preserve-3d;
  pointer-events: none;
}

.type-line {
  white-space: nowrap;
  font-size: clamp(7rem, 18.75vh, 15rem);
  line-height: 0.75;
  font-weight: bold;
  font-family: "PP Neue Montreal", sans-serif;
  color: #ffffff;
  opacity: var(--type-line-opacity);
  user-select: none;
  will-change: transform, opacity;
  position: relative;
}

.type-line.odd {
  z-index: 50;
}

.type-line.even {
  z-index: 150;
}

#kinetic-type {
  z-index: 200 !important;
  display: grid !important;
  visibility: visible !important;
  opacity: 1;
  pointer-events: none;
}

/* Mobile Optimization */
@media screen and (max-width: 992px) {
  .loading-screen-wrapper .text-content {
    font-size: 7rem;
  }

  .loading-screen-wrapper .text-row {
    height: 110px;
  }

  .type-line {
    font-size: clamp(5rem, 12vh, 10rem);
  }
}

@media screen and (max-width: 768px) {
  .loading-screen-wrapper .text-content {
    font-size: 5rem;
  }

  .loading-screen-wrapper .text-row {
    height: 80px;
    margin: 8px 0;
  }

  .type-line {
    font-size: clamp(3.5rem, 8vh, 7rem);
  }

  .text-item {
    font-size: 0.7rem;
  }
}

@media screen and (max-width: 480px) {
  .loading-screen-wrapper .text-content {
    font-size: 3.5rem;
  }

  .loading-screen-wrapper .text-row {
    height: 60px;
    margin: 6px 0;
  }

  .type-line {
    font-size: clamp(2.5rem, 6vh, 5rem);
  }

  .text-item {
    font-size: 0.6rem;
  }
}