/* 首頁 hero「每家長自己的樣子」（Frank 2026-10-01 選定的方向 A）。
   動態只做一件事：證明產品的差異（每家俱樂部長得不一樣）。
   顏色逐字取自 services/clubPage/templates.ts 三套版型：
     雜誌敘事（竹光）  background #FBF8F3  accent #B0543A
     夜場節奏（大安）  background #101110  accent #d5ff70
     球場能量（板橋）  background #F2EFE7  accent #16281F／照片上 #9FE870
   只動 opacity／transform；切換＝疊著的圖層換 opacity，不動 background-color。 */

.ha {
  position: relative;
  overflow: hidden;
  padding: 56px 0 0;
  isolation: isolate;
}
.ha-tints { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.ha-tint { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s var(--ease); }
.ha-tint.is-on { opacity: 1; }
.ha-tint.t0 { background: radial-gradient(70% 80% at 82% 30%, rgba(176, 84, 58, .12), transparent 70%); }
.ha-tint.t1 { background: radial-gradient(70% 80% at 82% 30%, rgba(213, 255, 112, .22), transparent 70%), linear-gradient(rgba(16, 17, 16, .05), rgba(16, 17, 16, .05)); }
.ha-tint.t2 { background: radial-gradient(70% 80% at 82% 30%, rgba(159, 232, 112, .20), transparent 70%); }

.ha-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 6%;
  align-items: center;
}
.ha-copy h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(46px, 5.1vw, 70px);
  line-height: 1.24;
  margin: 26px 0 25px;
}
.ha-copy h1 span { display: block; white-space: nowrap; }
.ha-copy h1 span:first-child { font-size: 1.12em; }
.ha-lead { font-size: 17px; line-height: 1.95; max-width: 460px; color: var(--muted); }
.ha-actions { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; margin-top: 34px; }
.ha-cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 50px;
  padding: 11px 24px;
  border-radius: var(--pill);
  background: var(--ink);
  color: var(--cream);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
}
.ha-cta:hover { background: #444850; }

/* 舞台 ---------------------------------------------------------- */
.ha-stage {
  position: relative;
  margin: 0;
  height: 620px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.ha-panels, .ha-orbs { position: absolute; inset: 0; }
.ha-panel { position: absolute; inset: 0; opacity: 0; transition: opacity .9s var(--ease); }
.ha-panel.is-on { opacity: 1; }
.ha-panel.p0 { background: #FBF8F3; box-shadow: inset 0 0 0 1px #E2DCD1; }
.ha-panel.p1 { background: #101110; }
.ha-panel.p2 { background: #F2EFE7; box-shadow: inset 0 0 0 1px #D9D4C7; }
.ha-orb {
  position: absolute;
  width: 78%;
  aspect-ratio: 1;
  right: -24%;
  top: -18%;
  border-radius: 50%;
  opacity: 0;
  transform: scale(.9);
  transition: opacity .9s var(--ease), transform 1.4s var(--ease);
}
.ha-orb.is-on { opacity: 1; transform: none; }
.ha-orb.o0 { background: #B0543A; }
.ha-orb.o1 { background: #d5ff70; }
.ha-orb.o2 { background: #16281F; }

.ha-soon {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 3;
  margin: 0;
  padding: 5px 12px;
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--ink);
  font: 400 11px/1.6 var(--mono);
  letter-spacing: .06em;
  box-shadow: 0 6px 16px -10px rgba(0, 0, 0, .5);
}

.ha-phone {
  position: absolute;
  top: 64px;
  left: 50%;
  width: min(58%, 292px);
  aspect-ratio: 603 / 1311;
  margin-left: calc(min(58%, 292px) / -2);
  padding: 8px;
  border-radius: 42px;
  background: #1b1d22;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55);
  z-index: 2;
}
.ha-screen { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 34px; background: #101110; }
.ha-shot { position: absolute; inset: 0; opacity: 0; transition: opacity .9s var(--ease); }
.ha-shot.is-on { opacity: 1; }
.ha-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }

.ha-caption {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .55);
}
.ha-names { display: grid; }
/* 文字不交叉淡入淡出：兩個名字長度不同，同時半透明會疊成「竹光羽球俱樂部樂部」。
   ⇒ 舊的先淡出（.25s），新的等它走完才淡入 —— 任何一刻畫面上最多只有一個名字。 */
.ha-name { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 2px; opacity: 0; transition: opacity .25s linear; }
.ha-name.is-on { opacity: 1; transition: opacity .4s var(--ease) .25s; }
.ha-name strong { font-size: 16px; }
.ha-name small { font: 400 12px/1.6 var(--mono); color: var(--muted); letter-spacing: .04em; }
.ha-dots { display: flex; gap: 6px; flex: none; }
.ha-dot {
  position: relative;
  width: 34px;
  height: 44px; /* 點擊範圍夠大；看得到的只有中間那條 */
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.ha-dot::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 4px;
  margin-top: -2px;
  border-radius: 2px;
  background: var(--line);
}
.ha-dot-bar {
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 4px;
  margin-top: -2px;
  border-radius: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
}
.ha-dot[aria-pressed="true"] .ha-dot-bar { transform: scaleX(1); }
.ha-dot:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

/* 接到下一段 -------------------------------------------------------- */
.ha-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin-top: 48px;
  padding: 26px 0 28px;
  border-top: 1px solid var(--line);
}
.ha-bottom p { margin: 0; font-size: 18px; }
/* 底部只剩示範資料的註腳（「同一個 App，每家長自己的樣子。」是 04 的標題，不在這裡重複；main 2026-10-01） */
.ha-bottom .ha-fine { max-width: 60ch; font-size: 12px; line-height: 1.7; color: var(--muted); }
.ha-next { padding-top: var(--section); }

@media (max-width: 900px) {
  .a-menu { display: none !important; }
  .ha { padding-top: 32px; }
  .ha-grid { grid-template-columns: 1fr; gap: 36px; }
  .ha-copy h1 { font-size: clamp(40px, 11vw, 56px); }
  .ha-stage { height: 560px; }
  .ha-phone { width: min(62%, 270px); margin-left: calc(min(62%, 270px) / -2); top: 60px; }
  .ha-bottom { flex-direction: column; align-items: flex-start; }
  .ha-bottom .ha-fine { text-align: left; }
  /* 手機：名稱與切換條上下排，名稱不被擠到斷行 */
  .ha-caption { flex-direction: column; align-items: stretch; gap: 4px; padding: 12px 16px 6px; }
  .ha-name strong, .ha-name small { white-space: nowrap; }
  .ha-dots { justify-content: flex-start; }
}

/* 動態 ------------------------------------------------------------- */
@keyframes ha-rise { from { opacity: 0; transform: translate3d(0, 18px, 0); } to { opacity: 1; transform: none; } }
@keyframes ha-phone-in { from { opacity: 0; transform: translate3d(0, 60px, 0); } to { opacity: 1; transform: none; } }
@keyframes ha-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (prefers-reduced-motion: no-preference) {
  .ha-copy > .eyebrow { animation: ha-rise .7s var(--ease) .05s both; }
  .ha-copy h1 > span { animation: ha-rise .8s var(--ease) both; }
  .ha-copy h1 > span:nth-child(1) { animation-delay: .12s; }
  .ha-copy h1 > span:nth-child(2) { animation-delay: .24s; }
  .ha-lead { animation: ha-rise .7s var(--ease) .38s both; }
  .ha-actions { animation: ha-rise .7s var(--ease) .48s both; }
  .ha-stage { animation: ha-rise .8s var(--ease) .2s both; }
  .ha-screen { animation: ha-phone-in 1.1s var(--ease) .45s both; }
  /* 目前這家的進度條：跑完 ⇒ hero.js 換下一家（animationend） */
  .ha.is-playing .ha-dot[aria-pressed="true"] .ha-dot-bar { animation: ha-bar var(--ha-ms, 4200ms) linear forwards; }
  .ha.is-paused .ha-dot[aria-pressed="true"] .ha-dot-bar { animation-play-state: paused; }
  .ha-shot img { transition: transform 1.6s var(--ease); transform: scale(1.04); }
  .ha-shot.is-on img { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* View Transitions（hero.js）：舞台與色調由瀏覽器 morph；頁面其他部分不跟著交叉淡化。
   名字不交叉：舊的先淡出、新的等它走完才淡入（同一個「疊字」問題，換個機制也要守住）。
   轉場期間關掉我們自己的 CSS transition，避免在新畫面上再淡一次。 */
.ha-stage { view-transition-name: ha-stage; }
.ha-names { view-transition-name: ha-name; }
.ha-tints { view-transition-name: ha-tint; }
.ha-vt .ha-tint, .ha-vt .ha-panel, .ha-vt .ha-orb, .ha-vt .ha-shot, .ha-vt .ha-shot img, .ha-vt .ha-name { transition: none !important; }
::view-transition { pointer-events: none; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(ha-stage), ::view-transition-group(ha-tint) { animation-duration: .9s; }
::view-transition-old(ha-name) { animation: ha-vt-out .25s linear both; }
::view-transition-new(ha-name) { animation: ha-vt-in .4s var(--ease) .25s both; }
@keyframes ha-vt-out { to { opacity: 0; } }
@keyframes ha-vt-in { from { opacity: 0; } }
