/* APED — "05 / Markets", the NFT card slider (editor/fx/nft-slider.js).
   Same type as the landing: Integral CF 800 headings, Neue Plak Extended body,
   Druk Text Wide for the small caps. The cards are "pure metallic black" so they
   read against the red: a gunmetal gradient ring, an inner highlight, white text.
   The tracks are moved by JS (transform only); every other motion here is a CSS
   transition switched on by `.is-in` from one IntersectionObserver. */

.fx-nft {
  --fx-ease-expo: cubic-bezier(.19, 1, .22, 1);
  --card-w: 240px;
  --gap: 16px;
  position: relative;
  padding: 40px 0 120px;
  color: #fff;
  font-family: 'Neue Plak Extended', Helvetica, Arial, sans-serif;
  scroll-margin-top: 80px;
}

/* ---------------------------------------------------------------- heading */

.fx-nft__head {
  position: relative;
  text-align: center;
  margin-bottom: 56px;
}

.fx-nft__eyebrow {
  margin: 0 0 28px;
  color: rgba(255, 255, 255, .4);
  opacity: 0;
  transition: opacity .3s cubic-bezier(.165, .84, .44, 1);
}

.fx-nft__title {
  margin: 0;
  font-family: 'Integral CF', Helvetica, Arial, sans-serif;
  font-weight: 800;
  font-size: clamp(3.25rem, 10vw, 9rem);
  line-height: .9;
  letter-spacing: -.02em;
  text-transform: uppercase;
  perspective: 1500px;
}

.fx-nft__rise {
  display: inline-block;
  opacity: 0;
  transform: rotate3d(1, .15, 0, -80deg) translate3d(0, 24px, 0);
  transform-origin: 0 100%;
  transform-style: preserve-3d;
  transition:
    opacity .7s var(--fx-ease-expo) calc(var(--i, 0) * 70ms + 80ms),
    transform .7s var(--fx-ease-expo) calc(var(--i, 0) * 70ms + 80ms);
}

.fx-nft__head.is-in .fx-nft__eyebrow { opacity: 1; }
.fx-nft__head.is-in .fx-nft__rise { opacity: 1; transform: none; }

/* ------------------------------------------------------------------- rows */

.fx-nft__rows {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.fx-nft__row {
  position: relative;
  overflow: hidden;
  /* room for the hover lift, and soft edges instead of a hard cut */
  padding: 10px 0 14px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.fx-nft__track {
  display: flex;
  gap: var(--gap);
  width: max-content;
  will-change: transform;
}

/* cards arrive once: the cell slides in, staggered, and the card inside keeps
   its own transform free for the hover lift */
.fx-nft__cell {
  flex: 0 0 auto;
  width: var(--card-w);
  opacity: 0;
  transform: translate3d(48px, 0, 0);
  transition:
    opacity .8s var(--fx-ease-expo) calc(var(--i, 0) * 55ms + var(--r, 0) * 140ms + 200ms),
    transform .8s var(--fx-ease-expo) calc(var(--i, 0) * 55ms + var(--r, 0) * 140ms + 200ms);
}
.fx-nft__row--rev .fx-nft__cell { transform: translate3d(-48px, 0, 0); }
.fx-nft__row.is-in .fx-nft__cell { opacity: 1; transform: none; }

/* ------------------------------------------------------------------- card */

.fx-nft__card {
  position: relative;
  padding: 1.5px;
  border-radius: 18px;
  background: linear-gradient(145deg, #4a4a52 0%, #2a2a2e 18%, #0b0b0d 46%, #1c1c20 70%, #3a3a40 100%);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .35),
    0 10px 24px -8px rgba(0, 0, 0, .55),
    0 22px 44px -18px rgba(40, 0, 0, .6);
  transition: transform .5s var(--fx-ease-expo), box-shadow .5s var(--fx-ease-expo);
}

/* the sheen: a bright band that sweeps across the ring only (masked to it) */
.fx-nft__sheen {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 1.5px;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.fx-nft__sheen::after {
  content: '';
  position: absolute;
  top: -50%;
  left: 0;
  width: 60%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .95) 50%, transparent);
  transform: translate3d(-120%, 0, 0) rotate(20deg);
}

.fx-nft__body {
  position: relative;
  overflow: hidden;
  border-radius: 16.5px;
  background: linear-gradient(180deg, #19191c 0%, #0d0d0f 60%, #08080a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 0 0 1px rgba(255, 255, 255, .025);
}

.fx-nft__media {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #111;
}
.fx-nft__media::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 32%;
  background: linear-gradient(180deg, transparent, rgba(8, 8, 10, .7));
  pointer-events: none;
}

.fx-nft__art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--fx-ease-expo);
}

.fx-nft__chain {
  position: absolute;
  z-index: 1;
  left: 10px;
  top: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(10, 10, 12, .85), 0 2px 6px rgba(0, 0, 0, .4);
}

.fx-nft__pill {
  position: absolute;
  z-index: 1;
  right: 10px;
  top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(10, 10, 12, .82);
  color: #fff;
  font: 700 .5rem/1 'Druk Text Wide', Helvetica, Arial, sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.fx-nft__pill--live { border-color: rgba(52, 211, 120, .45); color: #b8f5cf; }
.fx-nft__pill--sale { background: #fff; border-color: #fff; color: #0b0b0d; }
.fx-nft__pill--sold { color: rgba(255, 255, 255, .55); text-decoration: line-through; text-decoration-color: #ff2a1f; }
.fx-nft__pill--unlisted { background: rgba(10, 10, 12, .6); color: rgba(255, 255, 255, .7); border-style: dashed; }

.fx-nft__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d378;
  box-shadow: 0 0 6px rgba(52, 211, 120, .9);
  animation: fx-nft-pulse 1.6s ease-in-out infinite;
}
@keyframes fx-nft-pulse {
  50% { opacity: .35; transform: scale(.7); }
}

.fx-nft__info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 14px;
}

.fx-nft__line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.fx-nft__name {
  margin: 0;
  overflow: hidden;
  font: 800 .8125rem/1.1 'Integral CF', Helvetica, Arial, sans-serif;
  letter-spacing: .01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fx-nft__chg {
  flex: none;
  font: 700 .5625rem/1 'Druk Text Wide', Helvetica, Arial, sans-serif;
  letter-spacing: .04em;
}
.fx-nft__chg.is-up { color: #34d378; }
.fx-nft__chg.is-down { color: #ff5a4f; }

.fx-nft__price {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.fx-nft__coin { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.fx-nft__amount { font-size: .875rem; font-weight: 500; letter-spacing: -.01em; }
.fx-nft__unit {
  color: rgba(255, 255, 255, .5);
  font: 700 .5rem/1 'Druk Text Wide', Helvetica, Arial, sans-serif;
  letter-spacing: .08em;
}

.fx-nft__lev {
  flex: none;
  padding: 4px 7px;
  border-radius: 6px;
  background: linear-gradient(180deg, #ff4a3d, #c8160d);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
  color: #fff;
  font: 700 .5625rem/1 'Druk Text Wide', Helvetica, Arial, sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* hover: lift, sheen sweep, image push */
@media (hover: hover) {
  .fx-nft__card:hover {
    transform: translate3d(0, -6px, 0);
    box-shadow:
      0 1px 2px rgba(0, 0, 0, .35),
      0 16px 30px -10px rgba(0, 0, 0, .65),
      0 30px 60px -20px rgba(40, 0, 0, .7);
  }
  .fx-nft__card:hover .fx-nft__sheen::after {
    transform: translate3d(260%, 0, 0) rotate(20deg);
    transition: transform .9s cubic-bezier(.4, 0, .2, 1);
  }
  .fx-nft__card:hover .fx-nft__art { transform: scale(1.04); }
}

/* ------------------------------------------------------------ small screens */

@media (max-width: 640px) {
  .fx-nft { --card-w: 160px; --gap: 12px; padding-bottom: 80px; }
  .fx-nft__head { margin-bottom: 36px; }
  .fx-nft__row + .fx-nft__row { display: none; }
  .fx-nft__card { border-radius: 14px; }
  .fx-nft__body { border-radius: 12.5px; }
  .fx-nft__info { padding: 9px 10px 10px; gap: 7px; }
  .fx-nft__name { font-size: .625rem; }
  .fx-nft__amount { font-size: .75rem; }
  .fx-nft__coin { width: 13px; height: 13px; }
  .fx-nft__chain { width: 18px; height: 18px; left: 8px; top: 8px; }
  .fx-nft__pill { height: 18px; padding: 0 7px; font-size: .4375rem; right: 8px; top: 8px; }
  .fx-nft__lev { padding: 3px 5px; font-size: .5rem; }
}

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

.fx-nft--static .fx-nft__row {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-mask-image: none;
  mask-image: none;
}
.fx-nft--static .fx-nft__track { will-change: auto; padding: 0 16px; }
.fx-nft--static .fx-nft__cell { scroll-snap-align: start; }

@media (prefers-reduced-motion: reduce) {
  .fx-nft__rise,
  .fx-nft__eyebrow,
  .fx-nft__cell,
  .fx-nft__card,
  .fx-nft__art { opacity: 1; transform: none; transition: none; }
  .fx-nft__dot { animation: none; }
  .fx-nft__sheen { display: none; }
}
