@charset "UTF-8";
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@100..900&display=swap");
@font-face {
  font-family: "LINESeedTW";
  src: url("../fonts/LINESeedTW_OTF_Th.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "LINESeedTW";
  src: url("../fonts/LINESeedTW_OTF_Rg.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "LINESeedTW";
  src: url("../fonts/LINESeedTW_OTF_Bd.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JockeyOne";
  src: url("../fonts/JockeyOne-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "GlowSansTC";
  src: url("../fonts/GlowSansTC-Condensed-Medium.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "GlowSansTC";
  src: url("../fonts/GlowSansTC-Condensed-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
body {
  width: 100%;
}

.index-card-wrapper {
  height: 100dvh;
  position: relative;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}

.index-card {
  margin-top: 5%;
  position: absolute;
  top: 0%;
  width: 100%;
  height: 100%;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  will-change: transform, opacity;
}
@media (max-width: 768px) {
  .index-card {
    overflow-x: hidden;
  }
}

.card-1 {
  background: #7CCEF2;
  z-index: 1;
  top: 0 !important;
}
.card-1 .index-card {
  background: #7CCEF2;
  background-image: url("./../src/img/index_mainpic_bg.png");
  background-repeat: no-repeat;
  background-size: 100% auto;
  background-position: bottom -12vw left 2vw;
  background-attachment: fixed;
  padding-top: 60px;
}
@media (max-width: 768px) {
  .card-1 .index-card {
    margin-top: 0;
    padding-top: 74px;
    background-size: 270% auto;
    background-position: bottom -30vw center;
  }
}

.landing-wrap {
  position: relative;
  z-index: 8;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  gap: 32px;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  padding-left: 6.25%;
  padding-right: 4.9479166667%;
}

.main-info {
  text-align: right;
}
.main-info .title {
  font-size: 2rem;
  line-height: 5rem;
  font-family: "GlowSansTC", system-ui, -apple-system, "Roboto", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-weight: bold;
}
.main-info .title span {
  font-family: "GlowSansTC", system-ui, -apple-system, "Roboto", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-weight: bold;
}
.main-info p {
  font-family: "GlowSansTC", system-ui, -apple-system, "Roboto", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 1.3333333333rem;
  line-height: 2rem;
}

.card-2 {
  z-index: 2;
  background-color: transparent;
  transition: background-color 0.45s ease;
}
.card-2 .index-card {
  background: #A4C490;
  transition: margin-top 0.45s ease;
}
.card-2.is-at-top {
  background-color: #A4C490;
}
.card-2.is-at-top .index-card {
  margin-top: 0;
}

.section-title {
  position: absolute;
  color: white;
  left: 2.6041666667%;
  bottom: calc(2dvh + 100px);
  line-height: 1.6;
  z-index: 3;
}
.section-title .en {
  font-size: clamp(2.5rem, 4.6vw, 5rem);
}
.section-title .sm {
  font-size: clamp(2rem, 2.5vw, 2.6667rem);
  font-family: "GlowSansTC", system-ui, -apple-system, "Roboto", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-weight: bold;
}

.service-grid {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  width: 100%;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  position: relative;
  z-index: 2;
  padding: 0 8.6979166667%;
  padding-top: 16vh;
  margin: 0 auto;
  gap: 5.7291666667vw;
}

/* 核心：設定特殊卡片的佔位 */
.service-card {
  width: 100%;
}
.service-card.special {
  padding-top: 10.9375vw;
}
.service-card.special .service-card-img:before {
  -webkit-transform: rotate(atan2(calc(var(--x) * -1), var(--y)));
          transform: rotate(atan2(calc(var(--x) * -1), var(--y)));
}
.service-card:last-child .service-card-img:before {
  content: unset;
}

.service-card-img {
  margin-bottom: 3.0185185185dvh;
  position: relative;
  max-width: 270px;
}
.service-card-img:before {
  content: "";
  display: block;
  border-top: 4px dotted white;
  height: 1px;
  position: absolute;
  top: 50%;
  /* 從圖示中心開始 */
  left: 50%;
  -webkit-transform-origin: left center;
          transform-origin: left center;
  -webkit-transition: 0.3s linear;
  transition: 0.3s linear;
  --y: calc(1643/1920*25vw);
  --x: calc(210/1920*100vw);
  width: 0;
  -webkit-transform: rotate(atan2(var(--x), var(--y)));
          transform: rotate(atan2(var(--x), var(--y)));
}
.service-card-img img {
  position: relative;
  z-index: 1;
  width: 100%;
}
.service-card-img.draw:before {
  width: hypot(var(--x), var(--y));
}

.service-card-title {
  font-family: "GlowSansTC", system-ui, -apple-system, "Roboto", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: clamp(1.333rem, 3vw, 1.6667rem);
  font-weight: bold;
  line-height: 5dvh;
  margin-bottom: 2.2916666667dvh;
}

.service-card-text {
  font-size: clamp(1rem, 1.2vw, 1.1111rem);
  line-height: 2;
  margin-bottom: 15px;
}
.service-card-text .service-card-line {
  display: block;
}

.service-card-link {
  color: white;
  font-family: "JockeyOne", system-ui, -apple-system, "Roboto", sans-serif;
  font-weight: 400;
  font-style: normal;
  line-height: 24px;
  font-size: 1rem;
  vertical-align: middle;
}
.service-card-link:after {
  content: "";
  vertical-align: middle;
  width: 24px;
  height: 24px;
  display: inline-block;
  background-image: url("./../src/svg/arrow_right_white.svg");
  background-size: cover;
}

.card-3 {
  z-index: 4;
  background-color: transparent;
  transition: background-color 0.45s ease;
}
.card-3 .index-card {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -webkit-transform: translateZ(0);
          transform: translateZ(0);
  will-change: transform, opacity;
  background: #C1A468;
  overflow: hidden;
  transition: margin-top 0.45s ease;
}
.card-3.is-at-top {
  background-color: #C1A468;
}
.card-3.is-at-top .index-card {
  margin-top: 0;
}
.card-3 .index-card.move-in .card-3-img {
  -webkit-animation: slideInAndStay 0.8s 0.5s ease-out forwards;
          animation: slideInAndStay 0.8s 0.5s ease-out forwards;
}
@media (max-width: 768px) {
  .card-3 .section-title {
    bottom: 80px;
    left: 24px;
  }
}

@-webkit-keyframes slideInAndStay {
  from {
    /* 這裡使用 translate 比起 top/left 效能更好，因為會啟動 GPU 加速 */
    -webkit-transform: translate(100px, -100px);
            transform: translate(100px, -100px);
    opacity: 0;
  }
  to {
    -webkit-transform: translate(0, 0);
            transform: translate(0, 0);
    opacity: 1;
  }
}

@keyframes slideInAndStay {
  from {
    /* 這裡使用 translate 比起 top/left 效能更好，因為會啟動 GPU 加速 */
    -webkit-transform: translate(100px, -100px);
            transform: translate(100px, -100px);
    opacity: 0;
  }
  to {
    -webkit-transform: translate(0, 0);
            transform: translate(0, 0);
    opacity: 1;
  }
}
.card-3-img {
  position: relative;
  text-align: right;
  overflow: hidden;
  width: 100%;
  height: 100%;
  opacity: 0;
  will-change: transform, opacity;
}
.card-3-img img {
  position: absolute;
  z-index: 5;
  top: unset;
  left: 0;
  bottom: 0;
  width: 100%;
  min-height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
}
@media (max-width: 768px) {
  .card-3-img {
    position: absolute;
    z-index: 5;
    top: -27%;
    left: -44%;
    right: 0;
    bottom: 0;
    margin: auto;
    width: 220%;
    -o-object-position: center;
       object-position: center;
  }
}

.slogan {
  font-size: clamp(2.5rem, 5vw, 5rem);
}
.slogan .bigger {
  font-size: 1.4444444444em;
}

#rotate-wrap {
  position: absolute;
  z-index: 1;
  width: 55%;
  left: 0;
  right: 0;
  aspect-ratio: 1.5;
  bottom: 7vw;
  margin: auto;
  /* 或 100dvh */
  overflow: hidden;
  display: block;
  -webkit-transition: opacity 0.5s ease;
  transition: opacity 0.5s ease;
}

/* JS 注入的 Canvas 會自動套用這些樣式 */
#rotate-wrap canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.card-4 {
  z-index: 5;
  background-color: transparent;
  transition: background-color 0.45s ease;
}
.card-4 .index-card {
  background: #C4826E;
  padding-top: 50px;
  margin-top: 40px;
  transition: margin-top 0.45s ease;
}
.card-4.is-at-top {
  background-color: #C4826E;
}
.card-4.is-at-top .index-card {
  background: #C4826E;
  margin-top: 0;
}
.card-4 .section-title {
  position: static;
  color: black;
  padding-left: 2.6041666667%;
  margin-bottom: 5.25dvh;
}

/* 容器 */
.cards-stack_list {
  position: relative;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: start;
      -ms-flex-align: start;
          align-items: flex-start;
  width: 100%;
  max-width: 1300px;
  padding: 3vh 15.625vw;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  height: 50dvh;
  margin: 0 auto;
  -webkit-transform: translateX(-10.4166666667vw);
          transform: translateX(-10.4166666667vw);
  -webkit-perspective: 1000px;
          perspective: 1000px;
}
@media (max-width: 768px) {
  .cards-stack_list {
    width: 100%;
    padding: 0 20px;
    padding-top: 37px;
    -webkit-transform: translateX(0);
            transform: translateX(0);
  }
}

/* 卡片項目基礎樣式 */
.cards-stack_item {
  width: 100%;
  position: relative;
  -webkit-transform: scale(0.9);
          transform: scale(0.9);
  -webkit-transform-origin: center top;
          transform-origin: center top;
  -webkit-transition: 0.5s;
  transition: 0.5s;
}
.cards-stack_item:nth-child(even) .recommend-card {
  background-color: #EFD6CB;
}
@media (max-width: 768px) {
  .cards-stack_item:nth-child(n+6) {
    display: none;
  }
}

/* 卡片被懸停（或手機點擊）時的凸顯狀態 */
.cards-stack_item.active {
  z-index: 12 !important;
  -webkit-transform: translate(0, 0) scale(1) !important;
          transform: translate(0, 0) scale(1) !important;
  -webkit-box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.2);
          box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.2);
}

.recommend-card {
  position: absolute;
  left: 0;
  right: 0;
  margin: auto;
  width: 25vw;
  min-width: 180px;
  /* 根據設計調整 */
  background: white;
  padding: 2.8125vw 2.0833333333vw;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  border-radius: 10px;
  /* 效能優化與動畫平滑 */
  will-change: transform, z-index;
  -webkit-transition: z-index 0.4s ease, -webkit-transform 0.4s ease, -webkit-box-shadow 0.4s ease;
  transition: z-index 0.4s ease, -webkit-transform 0.4s ease, -webkit-box-shadow 0.4s ease;
  transition: transform 0.4s ease, z-index 0.4s ease, box-shadow 0.4s ease;
  transition: transform 0.4s ease, z-index 0.4s ease, box-shadow 0.4s ease, -webkit-transform 0.4s ease, -webkit-box-shadow 0.4s ease;
}
@media (max-width: 768px) {
  .recommend-card {
    padding: 16px 20px;
  }
}
.recommend-card .text {
  line-height: 2;
  font-size: clamp(1.125rem, 1.25vw, 1.3334rem);
  margin-bottom: 1rem;
}
@media (max-width: 768px) {
  .recommend-card .text {
    margin-bottom: 14px;
  }
}
.recommend-card .user {
  font-size: clamp(1.125rem, 1.25vw, 1.3334rem);
  line-height: 2;
}

.cards-stack_item:nth-child(n+10) {
  display: none;
}

.rate-wrap {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  margin-bottom: 3.9583333333dvh;
}
.rate-wrap .star {
  width: 24px;
  height: 24px;
  background-image: url("./../src/svg/star_border_colored.svg");
  background-size: 100% auto;
  background-position: center;
}
.rate-wrap .star.fill {
  background-image: url("./../src/svg/star_colored.svg");
}

@media screen and (max-width: 992px) {
  .landing-wrap {
    padding: 0 20px;
  }
}
@media screen and (max-width: 768px) {
  .main-info {
    text-align: left;
  }
  .main-info .title {
    font-size: 2.5rem;
    line-height: 1.6;
    margin-bottom: 15px;
  }
  .main-info p {
    font-size: 1.1666666667rem;
    line-height: 2rem;
  }

  .landing-wrap {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
  }

  #rotate-wrap {
    position: absolute;
    z-index: 1;
    width: 150%;
    -webkit-transform: translateX(-50%);
            transform: translateX(-50%);
    left: 50%;
    bottom: 63px;
  }

  .card-2 {
    -webkit-box-sizing: border-box;
            box-sizing: border-box;
  }
  .card-2 .index-card {
    padding-top: 70px;
    padding-bottom: 70px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
  }
  .card-2 .section-title {
    position: static;
    text-align: center;
    margin-bottom: 8px;
  }

  .service-card-title {
    line-height: 1.875;
    margin-bottom: 0;
  }

  .service-card-text {
    line-height: 1.5;
    margin-bottom: 0;
  }
  .service-card-text .service-card-line {
    display: inline;
  }
  .service-card-text .service-card-line:not(:last-child)::after {
    content: "、";
  }

  .service-grid {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    gap: 10px;
    padding-top: 0;
    -webkit-box-flex: 1;
        -ms-flex-positive: 1;
            flex-grow: 1;
  }

  .service-card {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 12px;
    max-height: 15vh;
    height: 80%;
  }
  .service-card.special {
    padding-top: 0;
  }
  .service-card.special .service-card-img:before {
    -webkit-transform: rotate(90deg);
            transform: rotate(90deg);
  }

  .service-card-img {
    width: 31%;
    -ms-flex-negative: 0;
        flex-shrink: 0;
    margin-bottom: 0;
  }
  .service-card-img.draw:before {
    width: 100%;
    border-width: 2px;
    top: 50%;
    -webkit-transform: rotate(90deg);
            transform: rotate(90deg);
  }

  .card-4 .index-card {
    margin-top: 0;
    padding-top: 93px;
  }
  .card-4 .section-title {
    text-align: center;
    padding-left: 0;
    margin-bottom: 12px;
  }

  .cards-stack_list {
    padding-right: 180px;
  }
}