/* ==========================================================
   MAISON EXOTIC — motion layer
   Origin marquee, flip links, char-lift hovers, CTA band.
   JS (motion.js) decorates; CSS owns the transitions.
   ========================================================== */

/* ---------- char-lift hover (nav, wordmarks) ----------
   JS wraps each char as:
   <span class="hch" style="--i:n"><span class="a">c</span><span class="b">c</span></span> */

[data-hover-chars] {
  display: inline-block;
}

.hch {
  position: relative;
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}

.hch .a,
.hch .b {
  display: inline-block;
  transition: transform 0.5s var(--ease-inout-c);
  transition-delay: calc(var(--i, 0) * 24ms);
}

.hch .b {
  position: absolute;
  left: 0;
  top: 100%;
  color: var(--accent);
}

[data-hover-chars]:hover .hch .a,
a:hover > [data-hover-chars] .hch .a,
.flip-parent:hover [data-hover-chars] .hch .a {
  transform: translateY(-100%);
}

[data-hover-chars]:hover .hch .b,
a:hover > [data-hover-chars] .hch .b,
.flip-parent:hover [data-hover-chars] .hch .b {
  transform: translateY(-100%);
}

/* ---------- giant conversation band (sub-pages, above footer) ---------- */

.cta-band {
  display: block;
  position: relative;
  z-index: var(--z-raise);
  background: var(--bg-deep);
  border-top: 1px solid var(--line);
  padding: clamp(4rem, 10vw, 9rem) var(--gutter);
}

.cta-band__inner {
  max-width: 1520px;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.cta-band__label {
  flex-basis: 100%;
  margin-bottom: 1.5rem;
}

.cta-band__link {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.6rem, 7vw, 6.4rem);
  line-height: 1.05;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
  gap: 2rem;
  transition: color 0.3s ease;
}

.cta-band__link .arrow {
  font-size: 0.55em;
  color: var(--accent);
  transition: transform 0.5s var(--ease-out-c);
}

.cta-band__link:hover .arrow {
  transform: translateX(0.5em);
}

.cta-band__meta {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- parallax containers ---------- */

[data-parallax] {
  overflow: hidden;
}

[data-parallax] > video,
[data-parallax] > img {
  will-change: transform;
}

/* ---------- magnetic elements ---------- */

[data-magnetic] {
  display: inline-flex;
  will-change: transform;
}

/* ---------- masked word rise ---------- */

.w-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.w-mask .w {
  display: inline-block;
  will-change: transform;
}

/* ---------- the mark as cursor ---------- */

html.mx-cursor,
html.mx-cursor body,
html.mx-cursor a,
html.mx-cursor button {
  cursor: none;
}

html.mx-cursor .field,
html.mx-cursor .field * {
  cursor: auto; /* text entry keeps the native beam */
}

/* K95 standard: a quiet ring and a smaller dot. It never performs. */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(234, 226, 212, 0.28);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10000;
  transition: width 0.22s var(--ease-out-c),
              height 0.22s var(--ease-out-c),
              border-color 0.22s ease,
              background-color 0.22s ease,
              opacity 0.18s ease;
  will-change: top, left;
}

.cursor__dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  transition: opacity 0.18s ease;
}

.cursor.is-hover {
  width: 42px;
  height: 42px;
  border-color: rgba(234, 226, 212, 0.5);
}

.cursor.is-press {
  width: 22px;
  height: 22px;
}

.cursor.is-hidden {
  opacity: 0;
}

/* on labelled targets the ring becomes a small offset chip — never over the word */
.cursor.has-label {
  width: auto;
  height: auto;
  border-color: var(--line-strong);
  background: rgba(7, 6, 4, 0.88);
  border-radius: 2rem;
  padding: 0.42rem 0.95rem;
  transform: translate(14px, 18px);
}

.cursor.has-label .cursor__dot {
  opacity: 0;
}

.cursor__label {
  display: none;
  font-family: var(--sans);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}

.cursor.has-label .cursor__label {
  display: block;
}

/* ---------- curtain (page enter / exit) ---------- */

.curtain {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  will-change: transform;
}

.curtain .mark {
  width: 54px;
  height: 54px;
  color: var(--accent);
}

.curtain .mark path {
  stroke-dasharray: 130;
  stroke-dashoffset: 130;
}

/* ---------- menu overlay preview ---------- */

.menu-overlay__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.6s ease, transform 1.2s var(--ease-out-c);
  pointer-events: none;
}

.menu-overlay__bg.is-visible {
  opacity: 0.22;
  transform: scale(1);
}

.menu-overlay a {
  position: relative;
  z-index: 1;
}

/* ---------- sound toggle ---------- */

.sound {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-left: 1.75rem;
}

/* links hidden on mobile — the toggle takes over the right-push */
@media (max-width: 900px) {
  .sound {
    margin-left: auto;
    margin-right: 0.5rem;
  }
}

.sound span {
  display: block;
  width: 2px;
  height: 5px;
  background: var(--ink-faint);
  transition: background 0.3s ease, height 0.3s ease;
}

body.sound-on .sound span {
  background: var(--accent);
  animation: eq-bounce 1.15s ease-in-out infinite;
}

body.sound-on .sound span:nth-child(1) { animation-delay: 0s; }
body.sound-on .sound span:nth-child(2) { animation-delay: 0.22s; }
body.sound-on .sound span:nth-child(3) { animation-delay: 0.44s; }

@keyframes eq-bounce {
  0%, 100% { height: 5px; }
  50% { height: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  body.sound-on .sound span {
    animation: none;
    height: 9px;
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .hch .a,
  .hch .b {
    transition: none;
  }

  .cursor,
  .curtain {
    display: none;
  }
}
