.typewriter {
  width: fit-content;
  text-align: center;
  background-color: #1a1a1a;
  margin: 2rem auto;
}

.typewriter h1 {
  overflow: hidden;
  white-space: nowrap;
  margin: 0 auto;
  letter-spacing: 0.15em;
  animation: typing 3.5s steps(40, end) forwards;
  position: relative;
  /* ต้องมีสำหรับ caret */
  border-right: none;
  /* เอา border ออก */
  /* font-size: 2.3rem; */
  margin-top: 30px;
}

.typewriter h1::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background-image: linear-gradient(
    to bottom,
    #ffc502,
    #88d04a,
    #028dfe,
    #425cf8,
    #8336cd,
    #fc7c0b,
    #f93f14
  );
  animation: blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

@keyframes blink-caret {
  0%,
  100% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }
}

.group-hand {
  transform-style: preserve-3d;
  position: relative;
  pointer-events: none;
  z-index: 1;
  max-width: 50%;
  height: 100%;
  /* padding-top: 2rem; */
}

.hand-wyn {
  width: auto;
}

.hand-wyn img {
  width: 100%;
  height: auto;
  object-fit: cover;
  place-self: center;
  backface-visibility: hidden;
}

.text-circle,
.text-circle span {
  transform-style: preserve-3d;
  position: absolute;
}

.text-circle {
  background-color: #fff;
  animation: animateText 17s linear infinite;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.text-circle span {
  top: 0;
  left: 0;
  font-weight: 700;
  background: transparent;
  color: #ffffff;
  font-size: 5.5vw;
  transform-origin: center;
  transform: rotateY(calc(var(--i) * 18deg)) translateZ(23vw);
  /*360° / 40 = 9°*/
  /* transform: rotateY(calc(var(--i) * calc(360deg / 20))) translateZ(23vw); */
  text-transform: uppercase;
  /* font-style: italic; */
}

@keyframes animateText {
  0% {
    transform: perspective(1000px) rotateY(1turn) rotateX(-10deg);
  }

  100% {
    transform: perspective(1000px) rotateY(0deg) rotateX(-10deg);
  }
}

.box-wyn-pic {
  width: 185px;
  height: 270px;
  display: flex;
  place-self: center;
}

.image-box {
  width: 100%;
  height: 100%;
  place-self: center;
}

.website,
.creative,
.event,
.influencer,
.media,
.research,
.brand,
.interactive,
.social {
  /* max-width: 100%; */
  position: absolute;
  /* object-fit: contain; */
}

.media {
  transform: rotate(-10deg) scale(1.22);
}

.influencer {
  transform: translateX(10%) scale(1.5);
}

.creative {
  transform: rotate(-10deg) scale(1.15);
}

.event {
  width: 95%;
  transform: translateY(-1%);
}

.social {
  width: 100%;
  transform: translateX(10%) scale(1.3);
}

.website {
  transform: translateX(2%) scale(1.25) rotate(-9deg);
}

/* การ์ดใหม่: width/translate เป็น % ให้ย่อขยายตามกรอบดำทุกจอ (เหมือนการ์ดเก่า) */
.research,
.brand,
.interactive {
  max-width: none;
  height: auto;
}

.research {
  width: 124%;
  transform: translateX(-3.5%);
}

.brand {
  width: 97%;
  transform: translateY(-16.5%);
}

.interactive {
  width: 130%;
  transform: translateY(-5.5%);
}

.img-fluid-2 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}

.img-fluid-2 {
  opacity: 0;
  z-index: -1;
}

/* .frame-map {
  width: 100%;
  height: 100%;
  background-image: linear-gradient(to right,
      #ffc502,
      #88d04a,
      #028dfe,
      #425cf8,
      #8336cd,
      #fc7c0b,
      #f93f14);
  display: grid;
} */
/* .map-container img {
  width: 98%;
  height: 98%;
  place-self: center;
} */

.modal-img {
  width: 100% !important;
  height: auto !important;
}

.box-client {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.container-logo {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 30px;
  justify-content: center !important;
  align-items: center !important;
  width: fit-content !important;
  margin: 0 auto !important;
}

.container-logo div {
  width: 188px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.our-gap {
  gap: 70px;
}

.swiper-container-logo {
  width: 100%;
}

.swiper-container-logo .container-logo.swiper-slide {
  opacity: 0 !important;
  outline: none;
  border: none;
}

.container-logo.swiper-slide.swiper-slide-active {
  opacity: 1 !important;
}

.controlBtn,
.workControlBtn {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  justify-content: center;
  padding: 50px 0;
  align-items: center;
  gap: 10px;
}

.controlBtn div {
  width: 120px;
  display: flex;
  justify-content: end;
}

.workControlBtn div {
  width: 70px;
  display: flex;
  justify-content: end;
}

.controlBtn div:nth-child(1) {
  width: 60px;
}

.controlBtn div:nth-child(2) {
  width: 130px;
}

.workControlBtn div:nth-child(1) {
  width: 50px;
}

.workControlBtn div:nth-child(2) {
  width: 120px;
}

.controlBtn img,
.workControlBtn img {
  max-width: 100%;
  cursor: pointer;
  height: 100%;
}

.div-text-spans a {
  text-decoration: none;
  color: #1a1a1a;
}

.div-text-spans a:hover {
  text-decoration: underline;
}

.mobile-view-service {
  display: none;
}

/* .blog-image-header {
  width: 650px;
  border-radius: 3rem;
} */
.address-logo {
  width: 25%;
}

/* พื้นหลัง Popup */
.popup-wrapper {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* เมื่อให้แสดง */
.popup-wrapper.active {
  opacity: 1;
  pointer-events: auto;
}

/* กล่องภาพ */
.popup-box {
  position: relative;
  max-width: 700px;
  width: 90%;
}

.popup-img {
  width: 100%;
  border-radius: 10px;
}

/* ปุ่มปิด */
.popup-close {
  position: absolute;
  top: 1%;
  right: 2%;
  background: none;
  border: none;
  font-size: 42px;
  line-height: 1;
  color: rgb(0, 0, 0);
  cursor: pointer;
  padding: 0;
  transition: 0.2s ease;
}

@media (max-width: 1024px) {
  .swiper-wrapper {
    transition-timing-function: linear !important;
  }
}

@media (max-width: 425px) {
  .group-hand {
    max-width: 70%;
    height: 100%;
    /* padding-top: 2rem; */
  }

  .hand-wyn {
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

/* hover รูปเต็มกรอบ: ขยายตาม .image-box เท่าการ์ดอื่น ไม่ให้รูปยืด และมุมมนตรงกับ .box-black */
#interactive-experiences .img-fluid-2 {
  object-fit: cover;
  border-radius: 25px;
}
