/* ═══════════════════════════════════════════════════════════════
   WanderBeastAI — Spylt-Inspired Motion System  v2
   Horizontal region panels · Kinetic type · Magnetic CTAs ·
   Page transition overlay · Scroll progress bar
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. HORIZONTAL REGION PANELS ─────────────────────────────── */

#wcRegions {
  position: relative;
  height: calc(8 * 100vh);
  background: #020408;
}

.wcr-sticky-vp {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: #020408;
  /* Shared 3D perspective — panels rotate in this space */
  perspective: 1800px;
  perspective-origin: 50% 46%;
}

/* Floating section label — always visible across all panels */
.wcr-section-label {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
}

.wcr-section-eyebrow {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 7px 20px;
  border-radius: 100px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Track: 8 panels side by side, JS-driven translateX */
.wcr-track {
  display: flex;
  width: calc(8 * 100vw);
  height: 100%;
  will-change: transform;
  transform-style: preserve-3d;
}

/* ── Individual Panel ── */
.wcr-panel {
  position: relative;
  width: 100vw;
  height: 100%;
  flex-shrink: 0;
  overflow: hidden;
  /* JS sets perspective + rotateY + scale + translateZ every rAF */
  will-change: transform, filter;
  /* Brightness dim for non-active panels; JS transition handles depth,
     CSS transition handles the colour/filter snap when active changes */
  filter: brightness(0.62) saturate(0.72);
  transition: filter 0.72s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Active panel: full brightness */
.wcr-panel--active {
  filter: brightness(1.0) saturate(1.08);
}

/* Cinematic background — JS drives parallax + hover tilt on transform */
.wcr-bg {
  position: absolute;
  inset: -10% -5%;   /* overscan so parallax never reveals edges */
  background-size: cover;
  background-position: center;
  will-change: transform;
  /* Only transition filter here; transform is rAF-driven */
  transition: filter 0.6s ease;
  filter: brightness(0.9);
}

.wcr-panel--active .wcr-bg {
  filter: brightness(1.0);
}

/* Dark atmospheric gradient overlay */
.wcr-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to top,
      rgba(2, 4, 8, 0.92) 0%,
      var(--wcr-tint, rgba(2, 4, 8, 0.38)) 52%,
      transparent 100%
    );
  z-index: 1;
}

/* Content block: bottom-left positioned.
   GSAP animates this element for the hover float effect. */
.wcr-content {
  position: absolute;
  bottom: 72px;
  left: 72px;
  z-index: 10;
  max-width: 540px;
  will-change: transform;
  transform-style: preserve-3d;
}

/* ── Content reveals: clip-path sweep-up (Spylt style) ──────── */
/* Hidden state: clip from top 100% → nothing visible
   Active state: clip removed → full text visible
   Direction: clip region expands downward = text rises into view */

.wcr-num {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--wcr-accent, #c9a84c);
  margin-bottom: 16px;
  clip-path: inset(110% 0 -10% 0);
  transition: clip-path 0.62s cubic-bezier(0.16, 1, 0.3, 1) 0s;
}

.wcr-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(3.4rem, 6.5vw, 7rem);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0 0 20px;
  clip-path: inset(110% 0 -10% 0);
  transition: clip-path 0.78s cubic-bezier(0.16, 1, 0.3, 1) 0.07s;
}

.wcr-tagline {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.88rem, 1.3vw, 1.05rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.70);
  margin: 0 0 22px;
  clip-path: inset(110% 0 -10% 0);
  transition: clip-path 0.68s cubic-bezier(0.16, 1, 0.3, 1) 0.15s;
}

.wcr-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  clip-path: inset(110% 0 -10% 0);
  transition: clip-path 0.62s cubic-bezier(0.16, 1, 0.3, 1) 0.22s;
}

.wcr-tags span {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 5px 12px;
  border-radius: 100px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.wcr-explore {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wcr-accent, #c9a84c);
  border: 1.5px solid var(--wcr-accent, #c9a84c);
  padding: 11px 26px;
  border-radius: 100px;
  text-decoration: none;
  clip-path: inset(110% 0 -10% 0);
  transition:
    clip-path     0.62s cubic-bezier(0.16, 1, 0.3, 1) 0.29s,
    background    0.22s ease,
    color         0.22s ease;
  will-change: transform; /* shared with magnetic effect */
}

.wcr-explore:hover {
  background: var(--wcr-accent, #c9a84c);
  color: #020408;
}

/* ── Active panel: reveal all content ── */
.wcr-panel--active .wcr-num,
.wcr-panel--active .wcr-name,
.wcr-panel--active .wcr-tagline,
.wcr-panel--active .wcr-tags,
.wcr-panel--active .wcr-explore {
  clip-path: inset(-5% 0 -5% 0);
}

/* Ghost typography: large background region number */
.wcr-bg-num {
  position: absolute;
  bottom: -0.08em;
  right: -0.04em;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(22vw, 30vw, 38vw);
  font-weight: 900;
  line-height: 1;
  color: rgba(255, 255, 255, 0.028);
  z-index: 2;
  pointer-events: none;
  user-select: none;
  letter-spacing: -0.06em;
}

/* ── Progress pips (bottom center) ── */
.wcr-pips {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  z-index: 20;
}

.wcr-pip {
  width: 22px;
  height: 3px;
  background: rgba(255, 255, 255, 0.22);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  padding: 0;
  transition: background 0.35s ease, width 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wcr-pip--active {
  background: rgba(255, 255, 255, 0.85);
  width: 38px;
}

/* ── Panel counter (bottom right) ── */
.wcr-counter {
  position: absolute;
  bottom: 24px;
  right: 48px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.35);
  z-index: 20;
  user-select: none;
}

.wcr-counter-cur {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

/* ── 2. KINETIC HEADING CONTAINER ─────────────────────────────── */

.wc-kinetic-heading {
  overflow: hidden;
}

.wc-kinetic-heading .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.05em;
}

/* ── 3. MAGNETIC CTA ──────────────────────────────────────────── */

.wc-magnetic {
  position: relative;
  display: inline-flex;
}

/* ── 4. PAGE TRANSITION OVERLAY ──────────────────────────────── */

#wcPageTransition {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #020408;
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
  will-change: transform;
}

#wcPageTransition::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(to bottom, #a07828, #c9a84c 40%, #f5d48e 60%, #c9a84c);
  box-shadow: 0 0 16px rgba(201, 168, 76, 0.6);
}

/* ── 5. SCROLL PROGRESS BAR ──────────────────────────────────── */

#wcScrollProgress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, #a07828, #c9a84c 40%, #f5d48e 60%, #c9a84c);
  transform: scaleX(0);
  transform-origin: left center;
  z-index: 8999;
  pointer-events: none;
  will-change: transform;
  box-shadow: 0 0 6px rgba(201, 168, 76, 0.5);
}

/* ── Mobile: stack panels vertically ─────────────────────────── */

@media (max-width: 767px) {

  #wcRegions {
    height: auto;
  }

  .wcr-sticky-vp {
    position: relative;
    height: auto;
    overflow: visible;
    perspective: none;
  }

  .wcr-track {
    flex-direction: column;
    width: 100%;
    transform: none !important;
    transform-style: flat;
  }

  .wcr-panel {
    width: 100%;
    height: 100svh;
    transform: none !important; /* override JS 3D transforms */
    filter: brightness(1) saturate(1) !important;
  }

  .wcr-content {
    left: 24px;
    right: 24px;
    bottom: 90px;
    max-width: none;
  }

  .wcr-name {
    font-size: clamp(2.6rem, 12vw, 4.5rem);
  }

  /* Always show content on mobile — clip-path off */
  .wcr-num,
  .wcr-name,
  .wcr-tagline,
  .wcr-tags,
  .wcr-explore {
    clip-path: none !important;
    transition: none !important;
  }

  .wcr-pips,
  .wcr-counter,
  .wcr-section-label {
    display: none;
  }

  .wcr-bg-num {
    font-size: 52vw;
  }

  .wc-magnetic {
    transform: none !important;
  }

}
