/* FlowingMenu — vanilla JS port (from React Bits), skinned to the ABST
   vector-line design system. A vertical stack of links; hovering an item
   slides a marquee band of the same label + tag in from the nearest edge. */

.fm-host {
  --fm-bg: var(--dark);
  --fm-text: #ffffff;
  --fm-border: var(--dark-line);
  --fm-marquee-bg: #0058ff;
  --fm-marquee-fg: var(--dark);
  position: relative;
  overflow: hidden;
  min-height: 420px;
  border: 1.5px solid var(--line-strong);
}

.fm-wrap {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--fm-bg);
}

.fm-menu {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  padding: 0;
}

.fm-item {
  flex: 1;
  position: relative;
  overflow: hidden;
  text-align: center;
  border-top: 1px solid var(--fm-border);
}

.fm-item:first-child { border-top: none; }

.fm-item-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: grayscale(5%);
  transition: filter 0.3s ease;
}

.fm-item-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.15));
  transition: opacity 0.3s ease;
}

.fm-item:hover .fm-item-bg {
  filter: grayscale(0%);
}

.fm-item:hover .fm-item-bg::after {
  opacity: 0.75;
}

.fm-item-link {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  position: relative;
  cursor: pointer;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: clamp(1.4rem, 4vw, 2.6rem);
  color: var(--fm-text);
}

.fm-item-link:focus:not(:focus-visible) { color: inherit; }

.fm-marquee {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: #0058ff;
  transform: translate3d(0, 101%, 0);
}

.fm-marquee-inner-wrap {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.fm-marquee-inner {
  display: flex;
  align-items: center;
  position: relative;
  height: 100%;
  width: fit-content;
  will-change: transform;
}

.fm-marquee-part {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.fm-marquee-text {
  white-space: nowrap;
  text-transform: uppercase;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1;
  font-size: clamp(1.4rem, 4vw, 2.6rem);
  padding: 0 1vw;
  color: white;
}

.fm-marquee-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: clamp(140px, 16vw, 260px);
  height: clamp(64px, 9vw, 108px);
  margin: 0 1.6vw;
  flex-shrink: 0;
  border: 1.5px solid var(--fm-marquee-fg);
  background: rgba(255, 255, 255, 0.1);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--fm-marquee-fg);
}

.fm-marquee-placeholder-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}

.fm-marquee-part:nth-child(odd) .fm-marquee-placeholder { rotate: -3deg; }
.fm-marquee-part:nth-child(even) .fm-marquee-placeholder { rotate: 3deg; }

@media (max-width: 640px) {
  .fm-item-link,
  .fm-marquee-text { font-size: 1.4rem; }

  .fm-marquee-placeholder {
    width: clamp(90px, 42vw, 160px);
    height: clamp(44px, 20vw, 76px);
    margin: 0 3vw;
  }
}
