/* =========================================================
   TSG / 兆利豐股份有限公司 — 網站樣式
   結構: Reset & Variables → Layout utilities → Header →
         Hero → CSR → Capabilities → Cases → Closing CTA →
         Footer → Responsive breakpoints
   ========================================================= */

:root {
  --yellow: #f2de64;
  --black: #000;
  --white: #fff;
  --beige: #f2f0e8;
  --beige-2: #f3f2eb;
  --card-bg: #f3f1ea;
  --grey: #d4d4d4;

  --container: 90vw;
  /* 1920 - 152*2, matches original side margins */
  --header-h: 88px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--black);
  font-family: "Inter", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: var(--black);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  /* HTML 有寫 width/height（防版面跳動），這裡讓高度依比例縮放 */
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- Layout utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(24px, 4vw, 40px);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

section {
  scroll-margin-top: var(--header-h);
  position: relative;
}

/* ---------- Shared: pills / buttons ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 99px;
  font-size: clamp(15px, 1.4vw, 20px);
  letter-spacing: 1px;
  white-space: nowrap;
  padding: 10px 22px;
}

.pill--filled {
  background: rgba(0, 0, 0, 0.36);
  border: 1px solid var(--yellow);
  color: var(--yellow);
}

.pill img {
  width: 18px;
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--black);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
}

.logo {
  display: block;
  width: clamp(120px, 12vw, 219px);
}

.logo img {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--yellow);
}

.main-nav {
  display: flex;
  padding: 0px 0px 0px 24%;
  gap: clamp(20px, 3vw, 48px);
}

.main-nav a {
  color: var(--yellow);
  font-weight: 500;
  font-size: clamp(15px, 1.3vw, 20px);
  letter-spacing: 1.5px;
  white-space: nowrap;
}

.main-nav a:hover {
  opacity: 0.75;
}

.fade-gradient {
  width: 100%;
  /* 太矮的話再順的漸層也會像一條邊；給一個最小高度 */
  height: clamp(32px, 6vh, 64px);
  /* 多段緩和漸層（ease-out）：直線漸層在頭尾會看到明顯的界線，這樣淡出比較自然 */
  background: linear-gradient(to bottom,
      rgba(0, 0, 0, 1) 0%,
      rgba(0, 0, 0, 0.738) 19%,
      rgba(0, 0, 0, 0.541) 34%,
      rgba(0, 0, 0, 0.382) 47%,
      rgba(0, 0, 0, 0.278) 56.5%,
      rgba(0, 0, 0, 0.194) 65%,
      rgba(0, 0, 0, 0.126) 73%,
      rgba(0, 0, 0, 0.075) 80.2%,
      rgba(0, 0, 0, 0.042) 86.1%,
      rgba(0, 0, 0, 0.021) 91%,
      rgba(0, 0, 0, 0.008) 95.2%,
      rgba(0, 0, 0, 0.002) 98.2%,
      rgba(0, 0, 0, 0) 100%);
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  background: #111;
  overflow: hidden;
  padding-top: clamp(48px, 8vw, 120px);
  padding-bottom: clamp(48px, 8vw, 24px);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: bottom;
}

.hero-bg-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(80px, 17.6vw, 338px);
  background: linear-gradient(to bottom,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 1) 100%);
}

.hero-bg-shadow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-bg-shadow img {
  width: 100%;
  height: 0%;
  object-fit: cover;
}

.hero-glow {
  position: absolute;
  top: -20%;
  right: -10%;
  width: clamp(180px, 22vw, 411px);
  opacity: 0.36;
  z-index: 0;
}

.hero-decoration {
  position: absolute;
  left: -6%;
  bottom: 0;
  width: clamp(120px, 15vw, 293px);
  z-index: 0;
  pointer-events: none;
}

.hero-decoration img {
  width: 100%;
}

.hero-decoration-top {
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(120px, 15vw, 200px);
  z-index: 0;
  pointer-events: none;
}

.hero-decoration-top img {
  width: 100%;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(24px, 4vw, 48px);
}

.hero-copy {
  grid-column: 1;
  grid-row: 1;
  /* 文字疊在朦朧層之上，維持清楚好讀 */
  position: relative;
  z-index: 4;
}

/* 桌機兩欄：左右撐成一樣高，標籤貼左欄底、插畫貼右欄底，兩邊底部對齊 */
@media (min-width: 1025px) {
  .hero-inner {
    align-items: stretch;
  }

  .hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .hero-pills {
    margin-top: auto;
  }

  .hero-illustration {
    justify-content: flex-end;
  }
}

/* ---------- Hero 朦朧揭露 ---------- */
.hero {
  isolation: isolate;
}

.hero-haze {
  display: none;
}

.hero.has-haze .hero-haze {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: rgba(10, 12, 20, 0.28);
  -webkit-backdrop-filter: blur(8px) saturate(0.8);
  backdrop-filter: blur(8px) saturate(0.8);
  /* 滑鼠位置 + 幾顆自己漂移的液體泡泡，各挖一個柔邊的透明洞（由 main.js 寫入 mask） */
  --hole: radial-gradient(circle var(--haze-r, 0px) at var(--haze-x, 50%) var(--haze-y, 50%),
      transparent 0%, transparent 55%, #000 100%);
  -webkit-mask-image: var(--hole);
  mask-image: var(--hole);
  /* 多層遮罩取交集：任何一個洞的位置都會變清楚 */
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

/* ---------- 全站拖曳感游標 ---------- */
.site-cursor {
  display: none;
}

html.has-cursor,
html.has-cursor * {
  cursor: none !important;
}

/* 輸入框保留原生游標，打字時才看得到插入點 */
html.has-cursor input,
html.has-cursor textarea,
html.has-cursor select {
  cursor: auto !important;
}

html.has-cursor .site-cursor {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  /* 反色混合：深色區塊顯示亮色、淺色區塊顯示深色，全站都看得到 */
  mix-blend-mode: difference;
  opacity: 0;
  transition: opacity 0.3s ease;
}

html.cursor-visible .site-cursor {
  opacity: 1;
}

.site-cursor-dot,
.site-cursor-ring {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  will-change: transform;
}

.site-cursor-dot {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: var(--yellow);
}

.site-cursor-ring {
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  transition: width 0.25s ease, height 0.25s ease, margin 0.25s ease, background-color 0.25s ease;
}

/* 移到可點的東西上：外圈放大 */
html.cursor-on-link .site-cursor-ring {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  background-color: rgba(255, 255, 255, 0.1);
}

html.cursor-pressing .site-cursor-ring {
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  background-color: rgba(255, 255, 255, 0.2);
}

.hero-illustration {
  grid-column: 2;
  grid-row: 1;
  /* 跟文字一樣疊在朦朧層之上：右邊插畫一直保持清楚 */
  position: relative;
  z-index: 4;
  flex-direction: column;
  align-items: center;
  display: flex;
  width: 100%;
  max-width: 900px;
}

.hero-illustration img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* 人物疊在盤子上方：盤子往上拉，藏到人物腳下 */
.hero-illustration-figure {
  position: relative;
  z-index: 2;
}

.hero-illustration .hero-illustration-plate {
  position: relative;
  z-index: 1;
  width: 25vw;
  margin-top: -2.5vw;
}

/* 浮動效果：人物上下飄，盤子同步縮放像影子 */
.hero-illustration-figure {
  animation: hero-float 4s ease-in-out infinite;
}

.hero-illustration .hero-illustration-plate {
  animation: hero-plate 4s ease-in-out infinite;
}

@keyframes hero-float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-30px);
  }
}

@keyframes hero-plate {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(0.92);
    opacity: 0.75;
  }
}

@media (prefers-reduced-motion: reduce) {

  .hero-illustration-figure,
  .hero-illustration .hero-illustration-plate {
    animation: none;
  }
}

.hero-title {
  color: var(--white);
  font-weight: 700;
  font-size: clamp(32px, 5.4vw, 70px);
  line-height: 1.25;
  letter-spacing: 2px;
  margin: 0 0 clamp(20px, 3vw, 32px);
  text-shadow: 0 1px 12.1px #000000;
}

/* Typed.js 打字效果：ghost 撐住最終版面，live 疊在上方逐字打出 */
.typed-wrap {
  position: relative;
}

.typed-live {
  display: none;
}

.has-typed .typed-ghost {
  opacity: 0;
}

.has-typed .typed-live {
  display: block;
  position: absolute;
  inset: 0;
  user-select: none;
}

.typed-cursor {
  color: var(--yellow);
  font-weight: 400;
}

.hero-desc {
  display: flex;
  gap: 20px;
  margin-bottom: clamp(24px, 4vw, 100px);
}

.hero-desc-bar {
  flex: 0 0 7px;
  width: 7px;
  border-radius: 4px;
  background: var(--yellow);
}

.hero-desc p {
  color: var(--white);
  font-size: clamp(16px, 1.6vw, 25px);
  line-height: 1.6;
  letter-spacing: 1px;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* =========================================================
   社好共企 (CSR)
   ========================================================= */
.csr {
  position: relative;
  overflow-x: clip;
  /* 右上角裝飾圖往外突出時，不撐出橫向捲軸 */
  background: #000000;
  padding-top: clamp(60px, 10vw, 70px);
  padding-bottom: clamp(60px, 10vw, 140px);
}

/* ---------- 社好共企跑馬燈 ---------- */
.ticker {
  position: relative;
  z-index: 2;
  overflow: hidden;
  padding: clamp(8px, 0.8vw, 12px) 0;
  background: var(--yellow);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-scroll 30s linear infinite;
}

.ticker:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

@keyframes ticker-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

.ticker-item {
  /* 兩個語言疊在同一格，寬度取較寬的那個，切換時不會擠動 */
  display: inline-grid;
  overflow: hidden;
  color: var(--black);
  font-weight: 800;
  font-size: clamp(14px, 1.4vw, 22px);
  line-height: 1.3;
  letter-spacing: 1.5px;
  white-space: nowrap;
}

.ticker-item.is-outline {
  /* 粗字體的筆畫輪廓會互相重疊，只描邊的話字裡面會多出線條（看起來像爆開）；
     改成先畫描邊、再用底色填滿蓋掉內側，只留外框 */
  color: var(--yellow);
  -webkit-text-stroke: 2px var(--black);
  paint-order: stroke fill;
}

.ticker-face {
  grid-area: 1 / 1;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.7, 0, 0.3, 1), opacity 0.6s ease;
}

/* 第二面（另一種語言）先藏在下方；只有一面的詞不受影響 */
.ticker-face:last-child:not(:only-child) {
  transform: translateY(100%);
  opacity: 0;
}

.ticker-item.is-swapped .ticker-face:first-child {
  transform: translateY(-100%);
  opacity: 0;
}

.ticker-item.is-swapped .ticker-face:last-child {
  transform: translateY(0);
  opacity: 1;
}

.ticker-sep {
  color: var(--black);
  font-size: clamp(10px, 1vw, 14px);
  margin: 0 clamp(14px, 2vw, 28px);
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track {
    animation: none;
  }
}

.csr-up-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 200px;
  background: linear-gradient(to bottom,
      rgba(0, 0, 0, 1) 0%,
      rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
  z-index: 0;
}

.csr-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(24px, 4vw, 40px) clamp(32px, 5vw, 64px);
  padding: 13vh 10vw;
}

.csr-copy {
  flex: 1 1 340px;
}

.csr-text {
  display: flex;
  flex-direction: column;
  max-width: 640px;
}

.csr-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* 照片疊在橢圓上方：橢圓往上拉，藏到照片底下 */
.csr-pic-wrap {
  z-index: 2;
}

.csr-media .csr-plate {
  position: relative;
  z-index: 1;
  width: 80%;
  margin-top: -16%;
}

.csr-media img {
  width: 100%;
  max-width: 550px;
  border-radius: 4px;
}

/* 讓裝飾圖以 csr-pic 為基準定位在右上角 */
.csr-pic-wrap {
  position: relative;
  width: 100%;
  max-width: 550px;
}

/* 照片在前、裝飾圖在後 */
.csr-pic {
  position: relative;
  z-index: 2;
}

.csr-media .csr-decoration {
  z-index: 1;
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  transform: translate(30%, -30%);
  pointer-events: none;
}

.csr-title {
  font-weight: 800;
  font-size: clamp(56px, 9vw, 120px);
  letter-spacing: 4px;
  margin: 0;
  color: #ffffff;
}

.csr-subtitle {
  font-weight: 700;
  font-size: clamp(28px, 4.5vw, 60px);
  line-height: 1.3;
  letter-spacing: 2px;
  margin: 0 0 clamp(20px, 3vw, 32px);
  color: #ffffff;
}

.csr-desc {
  display: flex;
  gap: 18px;
}

/* ---------- 社好共企插畫特效 ---------- */
.csr-pic-inner {
  position: relative;
  z-index: 2;
  will-change: transform;
}

/* 反光：用插圖本身當遮罩，只亮在有畫的地方，不會出現方框 */
.csr-glare {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%),
      rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 45%);
  mix-blend-mode: soft-light;
  -webkit-mask: url("assets/csr-pic.webp") center / 100% 100% no-repeat;
  mask: url("assets/csr-pic.webp") center / 100% 100% no-repeat;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.csr-media.is-tilting .csr-glare {
  opacity: 1;
}

/* 滑鼠移到插圖上時，光暈變亮 */
.csr-media .csr-decoration {
  transition: filter 0.6s ease;
}

.csr-media.is-tilting .csr-decoration {
  filter: brightness(1.4) saturate(1.2);
}

.csr-sparkles {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.csr-sparkles span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 10px 2px rgba(242, 222, 100, 0.6);
  opacity: 0;
  animation: csr-sparkle var(--dur) ease-in-out var(--delay) infinite;
}

@keyframes csr-sparkle {
  0% {
    transform: translateY(0) scale(0);
    opacity: 0;
  }

  20% {
    opacity: 1;
    transform: translateY(-15px) scale(1);
  }

  100% {
    transform: translateY(-90px) scale(0.3);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .csr-sparkles {
    display: none;
  }
}

/* ---------- 社好共企捲動敘事 ---------- */
.csr-line {
  display: block;
}

/* 文字從遮罩下方浮上來 */
.has-scroll-fx .csr-char-wrap,
.has-scroll-fx .csr-line {
  overflow: hidden;
  /* 留一點空間，中文字下緣不被切到 */
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.csr-char-wrap {
  display: inline-block;
}

.csr-char,
.csr-line>span {
  display: inline-block;
}

/* 螢光筆底線：預設直接畫滿；有動畫時從 0 畫到滿 */
.csr-mark {
  background: linear-gradient(var(--yellow), var(--yellow)) no-repeat left 92%;
  background-size: 100% 6%;
  padding: 0 0.05em;
  color: #fff;
}

.has-scroll-fx .csr-mark {
  background-size: 0% 6%;
}

.csr-desc-bar {
  flex: 0 0 10px;
  width: 10px;
  border-radius: 4px;
  background: var(--yellow);
}

.csr-desc p {
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.5;
  max-width: 420px;
  color: #ffffff;
}

/* =========================================================
   核心能力 (Capabilities)
   ========================================================= */
.capabilities {
  background: var(--black);
  padding-top: clamp(60px, 10vw, 140px);
  padding-bottom: clamp(60px, 10vw, 140px);
}

.capabilities-top-fade {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: clamp(120px, 18vw, 353px);
  background: linear-gradient(to bottom,
      #000000 0%,
      rgba(242, 240, 232, 0) 100%);
  pointer-events: none;
  z-index: 0;
}

/* 發光波浪：黑色部分用 screen 混合變透明，只留下光帶；上下淡出 */
.capabilities-wave {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: clamp(420px, 70vh, 760px);
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 25%, #000 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 25%, #000 70%, transparent 100%);
}

.capabilities-inner {
  position: relative;
  z-index: 1;
}

/* 標題在左上、標語在右下 */
.capabilities-title {
  display: flex;
  justify-content: center;
  padding-right: 20vw;
  gap: clamp(8px, 2vw, 24px);
  font-weight: 600;
  font-size: clamp(48px, 8vw, 120px);
  letter-spacing: 4px;
  margin: 0 0 clamp(40px, 6vw, 80px);
}

.capabilities-title .fill {
  color: var(--yellow);
}

.capabilities-title .outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--white);
}

.capabilities-lead {
  display: flex;
  padding-left: 20vw;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2vw, 32px);
  margin: 0 0 clamp(48px, 8vw, 96px) auto;
  text-align: left;
}

.capabilities-lead p {
  color: var(--white);
  font-weight: 600;
  font-size: clamp(24px, 3.5vw, 50px);
}

.capabilities-arrow {
  flex: 0 0 60px;
  width: 60px;
}

/* 「能力」空心字填色：白色由左往右填進字裡（JS 控制 background-position） */
.has-title-fx .capabilities-title .outline {
  background: linear-gradient(90deg, var(--white) 50%, transparent 50%) no-repeat;
  background-size: 200% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: clamp(48px, 8vw, 120px);
}

.card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 5vw, 80px);
}

.card--reverse {
  flex-direction: row-reverse;
}

.card-media {
  flex: 0 0 clamp(200px, 32vw, 522px);
  width: clamp(200px, 32vw, 522px);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  position: relative;
  flex: 1;
  /* 寬度卡在 550–620px；螢幕比 550 窄時不撐破版面 */
  min-width: min(550px, 100%);
  max-width: 620px;
}

.card-body::before {
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  background: var(--yellow);
  z-index: -1;
}

.card--reverse .card-body::before {
  inset: 18px 18px -18px -18px;
}

.card-body::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--card-bg);
  border: 1px solid var(--black);
  z-index: -1;
}

/* ---------- 核心能力卡片特效 ---------- */
.card-body {
  transition: translate 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card-body::before {
  transition: translate 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* 進場前黃色色塊藏在卡片正後方，進場時滑出成偏移陰影 */
.has-card-fx .card:not(.is-in) .card-body::before {
  translate: -18px -18px;
}

.has-card-fx .card--reverse:not(.is-in) .card-body::before {
  translate: 18px -18px;
}

.card-media img {
  transition: scale 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (hover: hover) and (pointer: fine) {

  /* 卡片往陰影反方向浮起，黃色陰影拉開 */
  .card.is-in:hover .card-body {
    translate: -5px -5px;
  }

  .card.is-in:hover .card-body::before {
    translate: 5px 5px;
    transition-duration: 0.35s;
  }

  .card--reverse.is-in:hover .card-body {
    translate: 5px -5px;
  }

  .card--reverse.is-in:hover .card-body::before {
    translate: -5px 5px;
  }

  .card:hover .card-media img {
    scale: 1.06;
  }
}

.card-title {
  text-align: center;
  color: var(--black);
  font-weight: 600;
  font-size: clamp(18px, 2vw, 25px);
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--black);
  padding-bottom: 3vh;
}

.card-desc {
  color: var(--black);
  font-size: clamp(15px, 1.4vw, 20px);
  line-height: 1.5;
  padding: 0vw 2vw 1.5vw 2vw;
}

/* transition band */
.transition-band {
  position: relative;
  height: clamp(160px, 20vw, 320px);
  overflow: hidden;
  background: linear-gradient(to bottom, var(--black), rgba(0, 0, 0, 0));
}

.transition-band-track {
  display: flex;
  height: 100%;
  width: max-content;
  animation: band-scroll 60s linear infinite;
}

.transition-band img {
  flex-shrink: 0;
  height: 100%;
  width: auto;
}

.transition-band img.is-mirror {
  transform: scaleX(-1);
}

@keyframes band-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .transition-band-track {
    animation: none;
  }
}

/* =========================================================
   實際案例 (Case studies)
   ========================================================= */
.case {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  min-height: clamp(360px, 40vw, 540px);
}

.case--dark {
  background: var(--black);
}

.case--light {
  background: var(--beige);
}

.case-media {
  position: relative;
  overflow: hidden;
  order: 2;
}

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

/* ---------- 實際案例：觸碰變彩色 ---------- */
@property --r {
  syntax: "<length-percentage>";
  inherits: true;
  initial-value: 0%;
}

.case-media.has-touch-color img {
  transition: scale 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* 底圖黑白 */
.case-media.has-touch-color img:not(.case-color) {
  filter: grayscale(1) contrast(1.05);
}

/* 彩色圖疊在上面，只露出以觸碰點為中心的圓 */
.case-media .case-color {
  z-index: 1;
  pointer-events: none;
  clip-path: circle(var(--r) at var(--x, 50%) var(--y, 50%));
}

.case-media.is-color img {
  scale: 1.04;
}

.case--media-left .case-media {
  order: 0;
}

.case-content {
  order: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(16px, 2vw, 24px);
  padding: clamp(32px, 5vw, 100px);
}

.case--media-left .case-content {
  order: 1;
}

/* 黃（灰）色直條 + 內文並排（原本寫在 HTML 的 style="display: flex"） */
.case-text {
  display: flex;
}

.case-bar {
  width: 5px;
  height: 100%;
  margin-right: 1vw;
  background: var(--yellow);
}

.case--light .case-bar {
  background: var(--grey);
}

.case-content h3 {
  font-weight: 600;
  font-size: clamp(24px, 2.6vw, 35px);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
}

.case--dark .case-content h3 {
  color: var(--white);
}

.case-content p {
  font-size: clamp(15px, 1.4vw, 20px);
  line-height: 1.7;
  max-width: 600px;
}

.case--dark .case-content p {
  color: var(--white);
}

.case-content .pill {
  align-self: flex-start;
}

/* =========================================================
   收尾 CTA (Closing)
   ========================================================= */
.closing {
  position: relative;
  background: var(--black);
  overflow: hidden;
  /* 拿掉 logo 後區塊變矮，給背景照片足夠的高度 */
  min-height: clamp(460px, 85vh, 900px);
  display: flex;
  align-items: center;
  padding-top: clamp(60px, 10vw, 140px);
  padding-bottom: clamp(60px, 10vw, 140px);
}

/* 背景圖放在四周留白的圓角框裡（參考 nakagawa-in.jp 頁尾） */
.closing-bg {
  position: absolute;
  inset: 16px;
  z-index: 0;
  overflow: hidden;
  border-radius: 16px;
  opacity: 0.5;
  mix-blend-mode: luminosity;
}

@media (max-width: 768px) {
  .closing-bg {
    inset: 8px;
    border-radius: 10px;
  }
}

.closing-bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}

.closing-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
      var(--black) 0%,
      rgba(244, 241, 241, 0.2) 30%,
      rgba(0, 0, 0, 0.7) 100%);
}

.closing-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.closing-title {
  color: var(--yellow);
  font-weight: 800;
  font-style: italic;
  font-size: clamp(28px, 4vw, 50px);
  letter-spacing: 3px;
  text-transform: uppercase;
  line-height: 1.4;
  margin: 0 auto;
  max-width: 900px;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--yellow);
  border-top: 1px solid var(--black);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-block: 14px;
  font-size: clamp(13px, 1.2vw, 20px);
  color: var(--black);
}

/* =========================================================
   PRIVACY PAGE（privacy.html）
   ========================================================= */
.privacy-back {
  margin-left: auto;
  color: var(--yellow);
  font-weight: 500;
  font-size: clamp(15px, 1.3vw, 18px);
  letter-spacing: 1.5px;
  white-space: nowrap;
}

.privacy-back:hover,
.privacy-home a:hover {
  opacity: 0.75;
}

.privacy {
  background: var(--beige);
  color: var(--black);
  padding-block: clamp(48px, 7vw, 100px);
}

.privacy-inner {
  max-width: 820px;
  line-height: 1.9;
  font-size: clamp(15px, 1.1vw, 17px);
}

.privacy-eyebrow {
  font-weight: 800;
  font-style: italic;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 14px;
}

.privacy-title {
  margin: 4px 0 8px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.3;
  letter-spacing: 2px;
}

.privacy-date {
  color: #555;
  font-size: 14px;
  padding-bottom: 24px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--black);
}

.privacy h2 {
  margin: 40px 0 10px;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.5;
}

.privacy ul {
  margin-top: 10px;
  padding-left: 1.4em;
  list-style: disc;
}

.privacy-home {
  margin-top: 56px;
}

.privacy-home a {
  display: inline-block;
  padding: 10px 22px;
  border: 1px solid var(--black);
  border-radius: 999px;
  font-weight: 500;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  .header-inner {
    justify-content: space-between;
  }

  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-illustration {
    grid-column: 1;
    grid-row: 2;
    justify-self: center;
    max-width: 420px;
    margin-top: 24px;
  }

  .csr-inner {
    flex-direction: column;
    text-align: center;
  }

  .csr-text {
    align-items: center;
  }

  .csr-desc {
    justify-content: center;
  }

  .csr-media img,
  .csr-pic-wrap {
    max-width: 360px;
  }

  .case {
    grid-template-columns: 1fr;
  }

  .case-media {
    order: 0 !important;
    height: 280px;
  }

  .case-content {
    order: 1 !important;
  }
}

@media (max-width: 860px) {

  .card,
  .card--reverse {
    flex-direction: column;
  }

  .card-media {
    width: min(320px, 70vw);
    flex-basis: auto;
  }

  .card-body::before {
    inset: 14px -14px -14px 14px;
  }
}

@media (max-width: 768px) {

  .hero-decoration-top {
    display: none;
  }

  .hero-pills {
    justify-content: center;
  }

  .nav-toggle {
    display: flex;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--black);
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
    display: none;
  }

  .main-nav.is-open {
    display: flex;
  }

  .hero-copy {
    text-align: center;
  }

  .hero-desc {
    justify-content: center;
  }

  /* 桌機用的 20vw 左右內距在手機上會把標題擠成一字一行 */
  .capabilities-title {
    padding-right: 0;
  }

  .capabilities-title span {
    white-space: nowrap;
  }

  .capabilities-lead {
    padding-left: 0;
  }

  /* 1vw 在手機上只剩 3–4px，內文會貼到框線 */
  .card-desc {
    padding: 0 16px 20px;
  }
}

@media (max-width: 480px) {
  .hero-pills {
    display: flex;
  }
}