/* =========================================================
   MOTION — Cursor, Curtain, Shared Animation Classes
   ========================================================= */

/* ── Custom cursor ───────────────────────────────────────── */

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
}

.cursor__dot {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--color-text);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width var(--dur-fast) var(--ease-out),
              height var(--dur-fast) var(--ease-out);
}

.cursor__ring {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--color-text);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width var(--dur-base) var(--ease-out),
              height var(--dur-base) var(--ease-out),
              opacity var(--dur-base) var(--ease-out);
  opacity: 0.5;
}

.cursor--hover .cursor__dot {
  width: 6px;
  height: 6px;
  opacity: 0.4;
}

.cursor--hover .cursor__ring {
  width: 64px;
  height: 64px;
  opacity: 0.8;
}

/* Skew is applied via JS transform inline styles */

/* ── Panel hover label ───────────────────────────────────── */

.cursor-label {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10000;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  border: 0.5px solid transparent;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.28) 0%,
      rgba(255, 255, 255, 0.08) 50%,
      rgba(255, 255, 255, 0.18) 100%
    ) padding-box,
    linear-gradient(
      160deg,
      rgba(255, 255, 255, 0.32) 0%,
      rgba(255, 255, 255, 0.1) 35%,
      rgba(255, 255, 255, 0) 65%,
      rgba(255, 255, 255, 0.06) 100%
    ) border-box;
  backdrop-filter: blur(24px) saturate(180%) contrast(115%);
  -webkit-backdrop-filter: blur(24px) saturate(180%) contrast(115%);
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.55),
    0 20px 48px -10px rgba(0, 0, 0, 0.28),
    0 32px 80px -16px rgba(0, 0, 0, 0.2);
  mix-blend-mode: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 500;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.cursor-label.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.cursor-label--dark {
  color: #1a1a1a;
}

.cursor-label--light {
  color: #fff;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.18) 0%,
      rgba(255, 255, 255, 0.06) 50%,
      rgba(255, 255, 255, 0.12) 100%
    ) padding-box,
    linear-gradient(
      160deg,
      rgba(255, 255, 255, 0.22) 0%,
      rgba(255, 255, 255, 0.06) 35%,
      rgba(255, 255, 255, 0) 65%,
      rgba(255, 255, 255, 0.04) 100%
    ) border-box;
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.35),
    0 12px 32px -8px rgba(0, 0, 0, 0.2),
    0 20px 48px -12px rgba(0, 0, 0, 0.08);
}


/* ── Page transition curtain ─────────────────────────────── */

.curtain {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 9000;
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

.curtain.is-active {
  pointer-events: all;
}

/* ── Shared reveal states ────────────────────────────────── */

.fade-up {
  opacity: 0;
  transform: translateY(20px);
  will-change: opacity, transform;
}

.fade-up.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Line grow ───────────────────────────────────────────── */

.line-grow {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--color-border);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

.line-grow.is-revealed {
  transform: scaleX(1);
}

/* ── Data-enter (unified scroll entrance) ───────────────── */

[data-enter]:not([data-enter="media"]):not([data-enter="curtain"]) {
  opacity: 0;
  transform: translateY(64px);
  will-change: opacity, transform;
}

[data-enter]:not([data-enter="media"]):not([data-enter="curtain"]).is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Curtain reveal — top-down clip-path wipe for images */
[data-enter="curtain"] {
  clip-path: inset(0 0 100% 0);
  will-change: clip-path;
}

[data-enter="curtain"].is-revealed {
  clip-path: inset(0 0 0% 0);
}

/* Scale-down reveal — GSAP owns the transform via fromTo, CSS just sets will-change */
[data-enter="scale"] {
  will-change: transform;
}

/* Dividers: opacity only, no vertical travel */
.divider[data-enter] {
  transform: none;
}

.divider[data-enter].is-revealed {
  transform: none;
}

/* ── Nav color toggle ────────────────────────────────────── */

body.nav-light .nav {
  color: var(--color-bg);
}

body.nav-light .nav__logo,
body.nav-light .nav__link {
  color: var(--color-bg);
}
