:root {
  --page-bg: #090c10;
  --shadow-deep: rgba(3, 8, 18, 0.65);
  --shadow-soft: rgba(6, 18, 34, 0.35);
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  background: var(--page-bg);
  font-family: "Avenir Next", "Futura", "Trebuchet MS", sans-serif;
  overscroll-behavior: none;
}

.landing-page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  background-image: url("background.jpeg?v=3");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.landing-page::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, transparent 24%, rgba(4, 8, 14, 0.18) 72%, rgba(4, 8, 14, 0.38) 100%);
  pointer-events: none;
}

@media (min-width: 769px) {
  .landing-page::after {
    display: none;
  }
}

.orbit-stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  isolation: isolate;
}

.touch-instructions {
  display: none;
}

.floating-link {
  --rotation: 0deg;
  --scale: 1;
  --shadow-opacity: 0.82;
  --shadow-scale: 1;
  --ground-left: 12%;
  --ground-right: 12%;
  --ground-bottom: -10%;
  --ground-height: 24%;
  --ground-blur: 27px;
  --ground-lift: 35px;
  --ground-alpha: 0.58;
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  transform: translate3d(0, 0, 0);
  transform-origin: center;
  text-decoration: none;
  will-change: transform;
  outline: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  backface-visibility: hidden;
}

.floating-link__visual {
  position: relative;
  display: block;
  width: 100%;
  transform: translate(-50%, -50%) rotate(var(--rotation)) scale(var(--scale));
  transform-origin: center;
  will-change: transform;
  backface-visibility: hidden;
}

.floating-link__visual::after {
  content: "";
  position: absolute;
  left: var(--ground-left);
  right: var(--ground-right);
  bottom: var(--ground-bottom);
  height: var(--ground-height);
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(0, 0, 0, var(--ground-alpha)), transparent 72%);
  filter: blur(var(--ground-blur));
  opacity: var(--shadow-opacity);
  transform: translateY(var(--ground-lift)) scale(var(--shadow-scale));
  z-index: -1;
  pointer-events: none;
}

.floating-link img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  transform: translateZ(0);
  filter:
    drop-shadow(0 27px 43px var(--shadow-deep))
    drop-shadow(0 13px 19px var(--shadow-soft));
  transition: filter 220ms ease;
}

.floating-link:hover .floating-link__visual,
.floating-link:focus-visible .floating-link__visual {
  transform: translate(-50%, calc(-50% - 4px)) rotate(var(--rotation)) scale(calc(var(--scale) * 1.03));
}

.floating-link:hover img,
.floating-link:focus-visible img {
  filter:
    drop-shadow(0 35px 53px rgba(3, 8, 18, 0.72))
    drop-shadow(0 16px 21px rgba(6, 18, 34, 0.42));
}

.floating-link:focus-visible {
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8);
}

.floating-link--h {
  width: clamp(9.3rem, 17.3vw, 14.6rem);
  --ground-left: 6%;
  --ground-right: 6%;
  --ground-bottom: -12%;
  --ground-height: 28%;
  --ground-blur: 32px;
  --ground-lift: 40px;
  --ground-alpha: 0.68;
}

.floating-link--v {
  width: clamp(8.5rem, 14.6vw, 11.7rem);
  --ground-left: 10%;
  --ground-right: 10%;
  --ground-bottom: -13%;
  --ground-height: 26%;
  --ground-blur: 32px;
  --ground-lift: 40px;
  --ground-alpha: 0.66;
}

.floating-link--p {
  width: clamp(11.3rem, 23.9vw, 17.3rem);
  --ground-left: 12%;
  --ground-right: 12%;
  --ground-bottom: -9%;
  --ground-height: 24%;
  --ground-blur: 27px;
  --ground-lift: 32px;
  --ground-alpha: 0.56;
}

.floating-link--k {
  width: clamp(5rem, 8.7vw, 7rem);
  --ground-left: 18%;
  --ground-right: 18%;
  --ground-bottom: -14%;
  --ground-height: 24%;
  --ground-blur: 28px;
  --ground-lift: 38px;
  --ground-alpha: 0.62;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 768px) {
  .landing-page {
    background-image:
      linear-gradient(180deg, rgba(8, 12, 17, 0.08), rgba(8, 12, 17, 0.28)),
      radial-gradient(circle at center, rgba(255, 255, 255, 0.04), transparent 58%),
      url("mobile.jpeg?v=3");
    background-position: center center;
  }

  .touch-instructions {
    position: absolute;
    left: 50%;
    top: max(1rem, env(safe-area-inset-top, 0px) + 0.5rem);
    z-index: 40;
    display: block;
    width: min(90vw, 26rem);
    margin: 0;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.96);
    font-size: 0.9rem;
    line-height: 1.35;
    text-align: center;
    text-wrap: balance;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.42);
    pointer-events: none;
    opacity: 1;
    transition:
      opacity 260ms ease,
      transform 260ms ease;
  }

  .touch-instructions.is-hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
  }

  .floating-link {
    touch-action: none;
  }

  .floating-link__visual::after {
    --ground-blur: 19px;
    --ground-lift: 24px;
  }

  .floating-link--h {
    width: clamp(8rem, 33.3vw, 11rem);
  }

  .floating-link--v {
    width: clamp(6.9rem, 26.4vw, 9.7rem);
  }

  .floating-link--p {
    width: clamp(9.3rem, 34.6vw, 12.6rem);
  }

  .floating-link--k {
    width: clamp(4.25rem, 15.6vw, 5.85rem);
  }
}

@media (min-width: 769px) {
  .floating-link img {
    filter:
      drop-shadow(0 34px 56px rgba(3, 8, 18, 0.8))
      drop-shadow(0 16px 24px rgba(6, 18, 34, 0.52));
  }

  .floating-link:hover img,
  .floating-link:focus-visible img {
    filter:
      drop-shadow(0 44px 68px rgba(3, 8, 18, 0.86))
      drop-shadow(0 20px 28px rgba(6, 18, 34, 0.58));
  }

  .floating-link--h {
    --ground-blur: 38px;
    --ground-lift: 48px;
    --ground-alpha: 0.8;
  }

  .floating-link--v {
    --ground-blur: 38px;
    --ground-lift: 48px;
    --ground-alpha: 0.78;
  }

  .floating-link--p {
    --ground-blur: 34px;
    --ground-lift: 40px;
    --ground-alpha: 0.68;
  }

  .floating-link--k {
    --ground-blur: 34px;
    --ground-lift: 44px;
    --ground-alpha: 0.76;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-link img {
    transition: none;
  }
}
