html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
}

* {
  box-sizing: border-box;
}

body {
  background: #000;
  overflow: hidden;
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
}

.video-shell {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: #000;
  overflow: hidden;
}

.bg-video {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  object-position: center center;
  filter: brightness(0.56) contrast(1.08) saturate(0.88);
}

.bg-video.portrait-fit {
  width: 180vw;
  height: auto;
  min-height: 0;
  object-fit: contain;
}

.text-stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: end center;
  padding:
    20px
    max(20px, env(safe-area-inset-right))
    calc(clamp(40px, 10vh, 120px) + env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
  pointer-events: none;
  isolation: isolate;
}

.text-stage::before {
  content: "";
  position: absolute;
  bottom: clamp(10px, 3vh, 34px);
  left: 50%;
  width: min(58vw, 620px);
  aspect-ratio: 1 / 0.42;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0) 66%);
  filter: blur(10px);
  opacity: 0.54;
  z-index: -1;
  animation: haloBreath 6s ease-in-out infinite;
}

.floating-copy {
  position: relative;
  margin: 0;
  color: #fff;
  font-size: clamp(1.2rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: clamp(0.18em, 0.9vw, 0.34em);
  text-transform: uppercase;
  text-align: center;
  text-indent: 0.24em;
  white-space: nowrap;
  line-height: 1;
  text-shadow:
    0 0 24px rgba(255, 255, 255, 0.26),
    0 18px 42px rgba(0, 0, 0, 0.6);
  animation: floatText 5.2s ease-in-out infinite;
}

.floating-copy::before,
.floating-copy::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: #fff;
  pointer-events: none;
}

.floating-copy::before {
  color: rgba(110, 235, 255, 0.75);
  transform: translateX(2px);
  mix-blend-mode: screen;
  animation: glitchA 4.8s steps(1, end) infinite;
}

.floating-copy::after {
  color: rgba(255, 102, 193, 0.66);
  transform: translateX(-2px);
  mix-blend-mode: screen;
  animation: glitchB 4.8s steps(1, end) infinite;
}

@keyframes floatText {
  0%,
  100% {
    transform: translate3d(0, -5px, 0);
  }
  50% {
    transform: translate3d(0, 7px, 0);
  }
}

@keyframes glitchA {
  0%,
  87%,
  100% {
    clip-path: inset(0 0 0 0);
    opacity: 0.56;
  }
  88% {
    clip-path: inset(32% 0 48% 0);
    transform: translate(7px, -1px);
    opacity: 0.95;
  }
  90% {
    clip-path: inset(68% 0 12% 0);
    transform: translate(0, 1px);
    opacity: 0.7;
  }
}

@keyframes glitchB {
  0%,
  87%,
  100% {
    clip-path: inset(0 0 0 0);
    opacity: 0.46;
  }
  89% {
    clip-path: inset(12% 0 64% 0);
    transform: translate(-7px, 0);
    opacity: 0.9;
  }
  91% {
    clip-path: inset(56% 0 22% 0);
    transform: translate(0, -1px);
    opacity: 0.67;
  }
}

@keyframes haloBreath {
  0%,
  100% {
    transform: translateX(-50%) scale(0.92);
    opacity: 0.36;
  }
  50% {
    transform: translateX(-50%) scale(1.08);
    opacity: 0.58;
  }
}

@media (max-width: 700px) {
  .text-stage {
    padding-bottom: calc(clamp(24px, 6vh, 42px) + env(safe-area-inset-bottom));
  }

  .floating-copy {
    font-size: clamp(0.78rem, 5.8vw, 1.16rem);
    letter-spacing: clamp(0.12em, 0.6vw, 0.17em);
    text-indent: clamp(0.12em, 0.6vw, 0.17em);
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .text-stage {
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .floating-copy {
    font-size: clamp(0.68rem, 3.1vw, 0.94rem);
    letter-spacing: 0.11em;
    text-indent: 0.11em;
  }

  .floating-copy::before,
  .floating-copy::after {
    opacity: 0.28;
  }

  .floating-copy::before {
    transform: translateX(1px);
  }

  .floating-copy::after {
    transform: translateX(-1px);
  }
}
