:root {
  --mx: 50%;
  --my: 46%;
  --bg-top: #4c3f79;
  --bg-mid: #746a99;
  --bg-bottom: #a09abc;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg-top);
}

html {
  scroll-behavior: smooth;
}

body {
  color: white;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}

.demo-page {
  min-height: 100%;
}

.scene {
  position: relative;
  width: 100vw;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  user-select: none;
  touch-action: pan-y;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(242, 221, 255, 0.18), transparent 26%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 52%, var(--bg-bottom) 100%);
}

.scene::before {
  content: "";
  position: absolute;
  inset: -12%;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 28%, rgba(55, 38, 93, 0.14) 66%, transparent),
    linear-gradient(180deg, rgba(235, 210, 255, 0.12), transparent 32%, rgba(80, 63, 121, 0.14));
  transform: translate3d(0, 0, 0);
  opacity: 0.72;
  pointer-events: none;
}

.reveal-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  cursor: default;
  touch-action: pan-y;
}

.noise-fill {
  position: absolute;
  inset: -18%;
  z-index: 3;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: overlay;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.32) 0 0.7px, transparent 1.1px),
    radial-gradient(circle at 42% 72%, rgba(47, 34, 89, 0.34) 0 0.8px, transparent 1.2px),
    radial-gradient(circle at 78% 36%, rgba(236, 216, 255, 0.28) 0 0.6px, transparent 1px);
  background-size: 22px 22px, 27px 27px, 34px 34px;
  animation: noise-drift 12s linear infinite;
}

.glass-vignette {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(33, 23, 60, 0.24), transparent 22%, transparent 74%, rgba(41, 31, 70, 0.2)),
    linear-gradient(90deg, rgba(40, 30, 73, 0.2), transparent 22%, transparent 78%, rgba(49, 36, 82, 0.18));
}

.fx-panel {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 8;
  width: min(300px, calc(100vw - 36px));
  padding: 12px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(42, 33, 72, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 54px rgba(20, 14, 38, 0.22);
  pointer-events: auto;
  touch-action: auto;
  user-select: none;
}

.fx-toggle {
  display: none;
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 9;
  width: 52px;
  height: 52px;
  padding: 0;
  color: rgba(255, 255, 255, 0.92);
  font: inherit;
  background: rgba(26, 20, 46, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 42px rgba(20, 14, 38, 0.24);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.fx-toggle__line {
  position: absolute;
  left: 15px;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transform-origin: center;
  transition:
    opacity 140ms ease,
    transform 160ms ease;
}

.fx-toggle__line:nth-child(1) {
  transform: translateY(-7px);
}

.fx-toggle__line:nth-child(3) {
  transform: translateY(7px);
}

.fx-toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.18);
}

.fx-toggle[aria-expanded="true"] .fx-toggle__line:nth-child(1) {
  transform: rotate(45deg);
}

.fx-toggle[aria-expanded="true"] .fx-toggle__line:nth-child(2) {
  opacity: 0;
}

.fx-toggle[aria-expanded="true"] .fx-toggle__line:nth-child(3) {
  transform: rotate(-45deg);
}

.follow-jump {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 9;
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 720;
  text-decoration: none;
  background: rgba(26, 20, 46, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 42px rgba(20, 14, 38, 0.18);
  touch-action: manipulation;
}

.follow-jump:hover {
  background: rgba(255, 255, 255, 0.14);
}

.fx-panel__head,
.fx-control span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.fx-panel__head {
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 650;
}

.fx-panel__button {
  min-height: 28px;
  padding: 0 10px;
  color: rgba(255, 255, 255, 0.86);
  font: inherit;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  cursor: pointer;
}

.fx-panel__button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.fx-control {
  display: block;
  margin-top: 8px;
  font-size: 11px;
}

.fx-control output {
  min-width: 42px;
  color: rgba(255, 255, 255, 0.68);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.fx-control input {
  width: 100%;
  height: 18px;
  margin: 3px 0 0;
  accent-color: #f2dcff;
  cursor: ew-resize;
  touch-action: pan-x;
}

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

@keyframes noise-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(0.94);
  }

  50% {
    transform: translate3d(-2.5%, 1.8%, 0) scale(0.98);
  }

  100% {
    transform: translate3d(0, 0, 0) scale(0.94);
  }
}

.follow-screen {
  min-height: 100svh;
  padding:
    max(58px, env(safe-area-inset-top))
    clamp(18px, 4vw, 54px)
    max(46px, env(safe-area-inset-bottom));
  color: #f8f5ff;
  background:
    radial-gradient(circle at 16% 12%, rgba(236, 216, 255, 0.16), transparent 28%),
    radial-gradient(circle at 86% 24%, rgba(167, 242, 255, 0.12), transparent 24%),
    linear-gradient(180deg, #3f3367 0%, #2b2348 52%, #171226 100%);
}

.follow-screen__inner {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.follow-kicker {
  margin: 0 0 14px;
  color: rgba(214, 255, 240, 0.86);
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.follow-screen h2 {
  max-width: 820px;
  margin: 0;
  color: #ffffff;
  font-size: clamp(42px, 8vw, 92px);
  line-height: 0.94;
  letter-spacing: 0;
}

.follow-copy {
  max-width: 720px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(17px, 2.4vw, 23px);
  line-height: 1.45;
}

.follow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px 0 0;
}

.follow-action {
  min-height: 46px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 760;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.follow-action--primary {
  color: #211a38;
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.92);
}

.follow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: clamp(32px, 6vw, 70px) 0 0;
}

.follow-card {
  min-height: 190px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: inherit;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  backdrop-filter: blur(18px);
}

.follow-card:hover {
  background: rgba(255, 255, 255, 0.12);
}

.follow-card span {
  color: rgba(214, 255, 240, 0.76);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.follow-card strong {
  margin: 22px 0 10px;
  color: #ffffff;
  font-size: 22px;
  line-height: 1.08;
}

.follow-card small {
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
  line-height: 1.42;
}

.follow-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 0;
}

.follow-footer a {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}

@media (max-width: 720px) {
  .scene {
    background:
      radial-gradient(circle at var(--mx) var(--my), rgba(242, 221, 255, 0.14), transparent 34%),
      linear-gradient(180deg, #493b72 0%, #716895 56%, #9892b3 100%);
  }

  .fx-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    right: max(14px, env(safe-area-inset-right));
    top: max(16px, env(safe-area-inset-top));
    bottom: auto;
  }

  .follow-jump {
    left: max(14px, env(safe-area-inset-left));
    top: max(22px, env(safe-area-inset-top));
    bottom: auto;
  }

  .fx-panel {
    left: auto;
    right: max(14px, env(safe-area-inset-right));
    top: max(76px, calc(env(safe-area-inset-top) + 76px));
    bottom: auto;
    width: min(360px, calc(100vw - 28px));
    max-height: min(54svh, 420px);
    padding: 12px;
    overflow-y: auto;
    border-radius: 14px;
    opacity: 0;
    pointer-events: none;
    transform: translate3d(0, -10px, 0) scale(0.98);
    transform-origin: top right;
    transition:
      opacity 160ms ease,
      transform 180ms ease;
  }

  .fx-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
  }

  .follow-screen {
    padding:
      max(42px, env(safe-area-inset-top))
      16px
      max(34px, env(safe-area-inset-bottom));
  }

  .follow-screen h2 {
    font-size: clamp(42px, 13vw, 58px);
  }

  .follow-copy {
    font-size: 17px;
  }

  .follow-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .follow-action {
    justify-content: flex-start;
  }

  .follow-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .follow-card {
    min-height: 150px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .noise-fill {
    animation: none;
  }
}
