/* ============================================================
   柳皓升® Music / Howsen™ Music — Ambient layer
   1 · Siri-like monochrome wave background
   1b · Screen-edge ring (screen-recognition style rim)
   2 · Theme-adaptive cursor ring
   (No content / layout rules live here.)
   ============================================================ */

/* ---------- 1. Wave canvas ---------- */
.wave-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s var(--ease);
  will-change: opacity;
  backface-visibility: hidden;
}
.wave-canvas.ready { opacity: 1; }

/* keep page content above the wave layer */
main,
.footer { position: relative; z-index: 1; }

/* ---------- 1b. Edge ring (sits above every content layer) ---------- */
.wave-ring {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 900;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.8s var(--ease);
  will-change: opacity;
  backface-visibility: hidden;
}
.wave-ring.ready { opacity: 1; }

/* ---------- 2. Cursor ring ---------- */
@media (hover: hover) and (pointer: fine) {
  html.cursor-custom,
  html.cursor-custom body,
  html.cursor-custom * { cursor: none !important; }
  html.cursor-custom input,
  html.cursor-custom textarea { cursor: text !important; }
}

.cursor-ring,
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2147483000;
  opacity: 0;
  transition: opacity .25s var(--ease), border-color .35s var(--ease), background .35s var(--ease);
  will-change: transform;
  backface-visibility: hidden;
}

.cursor-ring {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 1px solid rgba(0, 0, 0, 0.45);
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.06);
}
.cursor-ring > i {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
html.dark .cursor-ring {
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 26px rgba(255, 255, 255, 0.10);
}

.cursor-dot {
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  background: rgba(0, 0, 0, 0.72);
}
html.dark .cursor-dot { background: rgba(255, 255, 255, 0.88); }

/* hide the ring on touch-only devices */
@media (hover: none) {
  .cursor-ring,
  .cursor-dot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .wave-canvas { transition: none; }
  .boot-veil { transition-duration: .2s; }
}

/* ------------------------------------------------------------
   Boot sheet — the site is already there, out of focus. The mark
   sits on top of it, in exactly the place the loader left it.
   ------------------------------------------------------------ */
.boot-veil {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 11000;
  display: none;
  pointer-events: none;
  opacity: 1;
  /* the sheet thaws first, then whatever is left dissolves */
  transition: opacity .4s cubic-bezier(.4, 0, .2, 1) .72s;
}
html.booting .boot-veil { display: block; }
.boot-veil.out { opacity: 0; }
/* the mark lets go first, so it never sits as a ghost on the copy */
.boot-mark {
  transition: opacity .3s ease;
  animation: boot-breath 1.5s cubic-bezier(.45,0,.4,1) .3s 1 both;
}
.boot-veil.out .boot-mark { opacity: 0; animation: none; }

@keyframes boot-breath {
  0%, 100% { opacity: 1; }
  50%      { opacity: .86; }
}

.boot-frost {
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 255, .42);
  -webkit-backdrop-filter: blur(13px) saturate(1.05);
  backdrop-filter: blur(13px) saturate(1.05);
  transition: background-color 1.05s cubic-bezier(.4, 0, .2, 1),
              -webkit-backdrop-filter 1.15s cubic-bezier(.4, 0, .2, 1),
              backdrop-filter 1.15s cubic-bezier(.4, 0, .2, 1);
}
html.dark .boot-frost { background-color: rgba(0, 0, 0, .46); }

.boot-veil.out .boot-frost {
  background-color: rgba(255, 255, 255, 0);
  -webkit-backdrop-filter: blur(0px) saturate(1);
  backdrop-filter: blur(0px) saturate(1);
}
html.dark .boot-veil.out .boot-frost { background-color: rgba(0, 0, 0, 0); }

.boot-mark {
  position: absolute;
  top: 50%;
  /* half a scrollbar wider than this box, exactly like the loader */
  left: calc(50% + (100vw - 100%) / 2);
  width: 160px;
  height: 160px;
  margin: -80px 0 0 -80px;
  user-select: none;
  -webkit-user-drag: none;
}
html.dark .boot-mark { filter: invert(1); }

@media (max-width: 520px) {
  .boot-mark {
    width: 132px;
    height: 132px;
    margin: -66px 0 0 -66px;
  }
}
