/* =============================================================
   UI Components — vanilla ports of the React ui/ set.
   B&W aesthetic, no framework dependencies.
   ============================================================= */

/* -------------------------------------------------------------
   1. Weave Spinner — drop-in replacement for .loader blocks.
   Mark up as:
     <div class="weave-spinner" role="status" aria-label="Loading">
       <div class="thread t1"></div>
       <div class="thread t2"></div>
       <div class="thread t3"></div>
       <div class="thread t4"></div>
       <div class="node"></div>
     </div>
   ------------------------------------------------------------- */
.weave-spinner {
  position: relative;
  width: var(--weave-size, 72px);
  height: var(--weave-size, 72px);
  display: inline-block;
  vertical-align: middle;
  transform-style: preserve-3d;
  perspective: calc(var(--weave-size, 72px) * 7.5);
}
.weave-spinner .node {
  position: absolute; top: 50%; left: 50%;
  width: 8%; height: 8%;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 12px rgba(255, 255, 255, 0.85),
    0 0 24px rgba(255, 255, 255, 0.35);
  animation: weave-pulse 1.6s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}
.weave-spinner .thread {
  position: absolute;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.85),
    transparent
  );
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.35);
  transform-origin: center;
}
.weave-spinner .t1 {
  width: 100%; height: 1px; top: 30%; left: 0;
  animation: weave-w1 2.0s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.weave-spinner .t2 {
  width: 1px; height: 100%; top: 0; left: 70%;
  animation: weave-w2 2.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}
.weave-spinner .t3 {
  width: 100%; height: 1px; bottom: 30%; left: 0;
  animation: weave-w3 2.4s cubic-bezier(0.23, 1, 0.32, 1) infinite;
}
.weave-spinner .t4 {
  width: 1px; height: 100%; top: 0; left: 30%;
  animation: weave-w4 2.6s cubic-bezier(0.36, 0, 0.66, -0.56) infinite;
}

@keyframes weave-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.4); }
}
@keyframes weave-w1 {
  0%, 100% { transform: translateY(0) rotateX(0) rotateZ(0); opacity: 0.75; }
  50%      { transform: translateY(25%) rotateX(60deg) rotateZ(20deg); opacity: 1; }
}
@keyframes weave-w2 {
  0%, 100% { transform: translateX(0) rotateY(0) rotateZ(0); opacity: 0.75; }
  50%      { transform: translateX(-25%) rotateY(60deg) rotateZ(-20deg); opacity: 1; }
}
@keyframes weave-w3 {
  0%, 100% { transform: translateY(0) rotateX(0) rotateZ(0); opacity: 0.75; }
  50%      { transform: translateY(-25%) rotateX(-60deg) rotateZ(15deg); opacity: 1; }
}
@keyframes weave-w4 {
  0%, 100% { transform: translateX(0) rotateY(0) rotateZ(0); opacity: 0.75; }
  50%      { transform: translateX(25%) rotateY(-60deg) rotateZ(-15deg); opacity: 1; }
}

@media not all and (prefers-reduced-motion: reduce) {
  .weave-spinner .thread,
  .weave-spinner .node { animation: none !important; }
}

/* -------------------------------------------------------------
   2. Etheral Shadow — ambient backdrop.
   Mark up as:
     <div class="etheral-shadow" aria-hidden="true"></div>
   JS (ui-components.js) injects the internal .layer / .mask /
   .noise children and the shared <svg id="etheral-svg-defs">.
   ------------------------------------------------------------- */
.etheral-shadow {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.etheral-shadow > .layer {
  position: absolute;
  inset: -60px;
  filter: url(#etheral-filter) blur(4px);
}
.etheral-shadow > .layer > .mask {
  width: 100%;
  height: 100%;
  background-color: rgba(220, 220, 220, 0.22);
  -webkit-mask-image: url('https://framerusercontent.com/images/ceBGguIpUU8luwByxuQz79t7To.png');
          mask-image: url('https://framerusercontent.com/images/ceBGguIpUU8luwByxuQz79t7To.png');
  -webkit-mask-size: cover; mask-size: cover;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
}
.etheral-shadow > .noise {
  position: absolute;
  inset: 0;
  background-image: url('https://framerusercontent.com/images/g0QcWrxr87K0ufOxIUFBakwYA8.png');
  background-size: 220px;
  background-repeat: repeat;
  opacity: 0.1;
  mix-blend-mode: overlay;
}

@media not all and (prefers-reduced-motion: reduce) {
  .etheral-shadow > .layer { filter: none; }
}

/* Keep section content above the absolute backdrop */
.discord-section > .container { position: relative; z-index: 1; }
