/* Team Project — Figma: 디자인 스터디 / 워크팀 (63:2726), 1920 × 1080
   가로 캐러셀. 좌표는 Figma 원본값, 캔버스 스케일은 styles.css + assets/fit.js 담당. */

/* 첫 화면(뷰포트 − 헤더)에 통째로 들어가도록. 남는 위아래는 잘라낸다.
   --hero-height 는 assets/fit.js 가 계산 (캔버스의 data-fit-hero) */
.work {
  height: var(--hero-height, 1080px);
  background: #e7e7e7;
  overflow: hidden;
}

/* 콘텐츠(팀명 185 ~ 도트 943)의 중심이 564 라서, 1128 높이 무대를 세로 중앙에 둔다 */
.work__stage {
  position: absolute;
  left: 0;
  top: 50%;
  /* 세로가 모자라면 무대를 줄여서 팀명·카드·도트가 전부 보이게 한다 */
  transform: translateY(-50%) scale(var(--stage-scale, 1));
  width: 1920px;
  height: 1128px;
}

/* 145px 격자 — 세로선 x=90+145n, 가로선 y=65+145n (프레임이 -80 오프셋) */
.work__grid {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      to right,
      transparent 0 90px,
      rgba(187, 187, 187, 0.5) 90px 91px,
      transparent 91px 145px
    ),
    repeating-linear-gradient(
      to bottom,
      transparent 0 65px,
      rgba(187, 187, 187, 0.5) 65px 66px,
      transparent 66px 145px
    );
}

/* ── 팀명 (63:2795) — 50px 창 안에서 세로로 슬라이드 ────── */
.work__name {
  position: absolute;
  left: 889px;
  top: 185px;
  width: 175px;
  height: 50px;
  padding: 8px 0;
  box-sizing: border-box;
  overflow: hidden;
}

.work__name-stack {
  display: flex;
  flex-direction: column;
  gap: 55px;
  align-items: center;
  width: 175px;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.work__name-stack img {
  display: block;
  flex: 0 0 auto;
}

/* ── 카드 캐러셀 ────────────────────────────────────────── */
.work__viewport {
  position: absolute;
  left: 0;
  top: 291px;
  width: 1920px;
  height: 563px;
}

.work__track {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 100px;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.work__card {
  position: relative;
  flex: 0 0 auto;
  width: 563px;
  height: 563px;
  border-radius: 281.5px;
  overflow: hidden;
  cursor: pointer;
  transition: width 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.work__card.is-active {
  width: 1000px;
  cursor: default;
}

.work__card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 비활성 카드는 흰색 60% 로 덮인다 (Figma) */
.work__card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.6);
  transition: opacity 0.55s ease;
}

.work__card.is-active::after {
  opacity: 0;
}

/* WAFLY 로고 오버레이 — 활성/비활성 위치가 다르다 */
.work__logo {
  position: absolute;
  opacity: 0.9;
  transition: left 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    top 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.work__logo--mark {
  left: 164px;
  top: 59px;
  width: 79.5px;
  height: 79.5px;
}

.work__logo--text {
  left: 255.9px;
  top: 74.59px;
  width: 143.099px;
  height: 63.598px;
}

.is-active .work__logo--mark {
  left: 382px;
  top: 43px;
}

.is-active .work__logo--text {
  left: 473.9px;
  top: 58.6px;
}

/* ── 페이지네이션 (63:2788) ─────────────────────────────── */
.work__dots {
  position: absolute;
  left: 960.33px;
  transform: translateX(-50%);
  top: 924px;
  height: 19px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.work__dot {
  width: 18.934px;
  height: 18.934px;
  padding: 0;
  border: 0;
  border-radius: 9.5px;
  background: #2f3b48;
  opacity: 0.1;
  cursor: pointer;
  transition: width 0.55s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.55s ease;
}

.work__dot.is-active {
  width: 32px;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .work__name-stack,
  .work__track,
  .work__card,
  .work__card::after,
  .work__logo,
  .work__dot {
    transition: none;
    animation: none;
  }
}

/* DOKI 는 활성/비활성 크롭이 달라 두 장을 겹쳐 두고 전환한다 */
.work__img {
  transition: opacity 0.35s ease;
}

.work__img--wide {
  opacity: 0;
}

.is-active .work__img--wide {
  opacity: 1;
}

.is-active .work__img--square {
  opacity: 0;
}
