:root {
  --stripe-size: 120px;
  --stripe-color-1: #c44;
  --stripe-color-2: oklch(1 0 0);
  --stripe-duration: 2s;
}

.tunnel-canvas,
.tunnel-fallback,
.tunnel-mask {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.tunnel-canvas {
  display: none !important;
}

.tunnel-fallback {
  z-index: 0;
  overflow: clip;
  background:
    linear-gradient(rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.48)),
    repeating-linear-gradient(
      45deg,
      var(--stripe-color-2) 25%,
      var(--stripe-color-2) 50%,
      var(--stripe-color-1) 50%,
      var(--stripe-color-1) 75%
    );
  background-size: auto, var(--stripe-size) var(--stripe-size);
  animation: stripeTransform var(--stripe-duration) linear infinite;
}

.tunnel-fallback::before {
  content: "999.ROD · 半月工资 · ค่าแรง · PAYROLL";
  position: absolute;
  left: 50%;
  top: 50%;
  width: max-content;
  max-width: none;
  color: rgba(255, 255, 255, 0);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: clamp(4.6rem, 13vw, 16rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: 0;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  background: repeating-linear-gradient(
    45deg,
    var(--stripe-color-1) 25%,
    var(--stripe-color-1) 50%,
    var(--stripe-color-2) 50%,
    var(--stripe-color-2) 75%
  );
  background-size: var(--stripe-size) var(--stripe-size);
  -webkit-background-clip: text;
  background-clip: text;
  animation: stripeBackgroundPosition var(--stripe-duration) linear infinite;
}

.tunnel-mask {
  z-index: 1;
  background:
    radial-gradient(ellipse at center, rgba(27, 39, 53, 0) 0%, rgba(9, 10, 15, 0.54) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.14));
}

.effects-off .tunnel-fallback,
.effects-off .tunnel-fallback::before {
  animation: none !important;
}

@keyframes stripeTransform {
  0% {
    background-position: 0 0, 0 0;
  }

  100% {
    background-position: 0 0, calc(var(--stripe-size) * -1) 0;
  }
}

@keyframes stripeBackgroundPosition {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: calc(var(--stripe-size) * -1) 0;
  }
}

@media (max-width: 760px) {
  :root {
    --stripe-size: 86px;
  }

  .tunnel-fallback::before {
    font-size: clamp(4rem, 19vw, 8rem);
    transform: translate(-50%, -50%) rotate(-8deg);
  }

  .tunnel-mask {
    background:
      radial-gradient(ellipse at center, rgba(27, 39, 53, 0) 0%, rgba(9, 10, 15, 0.42) 100%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.18));
  }
}
