/* Coswic Labs — site.css
   設計語言全部取自 logo V3(brand/source/coswic-labs-logo-v3.svg):
   - 色:深藍 #06245C、次深藍 #173D68(標語)、漸層 #16C7E8 → #2196F3 → #246BFF(左下到右上)、白底
   - 字:Open Sans。logo 的「Coswic」是特粗再橫向拉寬 1.22 倍,「Labs」與標語是細體加寬字距;
        站上的大字(.wide)用同一個 1.22 倍,小標用同一種細體寬字距
   - 形:漸層圓點(i 上面那顆)、a 形(左圓右直)、細線
   版面兩種模式(boot.js 在第一次繪製前決定):
     預設 / html.no-3d = 靜態段落;html.is-3d = 每一幕釘住畫面,由捲動驅動 3D 場景。 */

@font-face {
  font-family: "Open Sans";
  src: url("/assets/fonts/open-sans-latin-var.woff2?v=d8e4fe0452") format("woff2");
  font-weight: 300 800;
  font-stretch: 100%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #06245c;
  --ink-soft: #173d68;
  --muted: #4d6486;
  --line: #e1e8f2;
  --blue: #2196f3;
  --link: #1d5fe0;
  --grad: linear-gradient(45deg, #16c7e8 0%, #2196f3 58%, #246bff 100%);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(20px, 5vw, 72px);
  --font: "Open Sans", "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --p: 0; /* progress of an act, 0..1 (main.js sets it on each .act) */
  --v: 0; /* scroll velocity in thousands of px per second (main.js sets it on each .act) */
  --np: 0; /* progress of the act the chapter nav is pointing at */
  --logo-w: 56vw; /* width of the wordmark on screen in the 3D layout (boot.js, then main.js) */
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
h1,
h2,
p {
  margin: 0;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
  border-radius: 6px;
}
.wrap {
  width: min(100% - 2 * var(--gutter), 1120px);
  margin-inline: auto;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 70;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.9375rem;
}
.skip:focus {
  top: 0.75rem;
}

/* logo 把「Coswic」橫向拉寬 1.22 倍;大字一律照做 */
.wide {
  display: inline-block;
  transform: scaleX(1.22);
  transform-origin: left center;
}
.kicker {
  font-size: 0.8125rem;
  font-weight: 300;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ── 3D 舞台:固定全屏,夾在「背景大字」與「前景文字」之間 ─────────────────── */
.stage {
  display: none;
}
.is-3d .stage {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── 頁首:只在最上面出現,往下滑就離開(章節導覽在右側) ───────────────── */
.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--gutter);
}
.brand {
  display: inline-flex;
}
.brand img {
  width: auto;
  height: 30px;
}
.is-3d .site-header .brand {
  visibility: hidden; /* 首屏的 logo 是 3D 的那一個 */
}
.top-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 34px);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.top-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  transition: color 0.2s;
}
.top-links a:hover {
  color: var(--ink);
}
.lang {
  padding: 0 0.95rem;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #c8d3e4;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.lang:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* ── 章節導覽:三個點;目前這一幕的點變成 logo 的 a 形 ───────────────────── */
.acts-nav {
  display: none;
}
.is-3d .acts-nav {
  position: fixed;
  right: clamp(8px, 1.6vw, 26px);
  top: 50%;
  z-index: 6;
  display: grid;
  transform: translateY(-50%);
  transition: opacity 0.4s;
}
.is-3d[data-act=""] .acts-nav,
.is-3d[data-act="hero"] .acts-nav,
.is-3d:not([data-act]) .acts-nav {
  opacity: 0;
  pointer-events: none;
}
.is-3d .acts-nav:focus-within {
  opacity: 1; /* 鍵盤走到這裡時一定要看得到 */
  pointer-events: auto;
}
.acts-nav a {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 44px;
  min-width: 44px;
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.acts-nav span {
  opacity: 0;
  transform: translateX(8px);
  transition:
    opacity 0.3s,
    transform 0.3s var(--ease);
}
.acts-nav a::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgb(6 36 92 / 0.28);
  transition:
    width 0.45s var(--ease),
    border-radius 0.45s var(--ease),
    background-color 0.3s;
}
.acts-nav a.is-on::after {
  width: calc(12px + 20px * var(--np)); /* 這一幕走多遠,它就長多長 */
  border-radius: 9px 0 0 9px; /* 左圓右直:a 形 */
  background: var(--grad);
  transition:
    border-radius 0.45s var(--ease),
    background-color 0.3s;
}
.acts-nav a.is-on span,
.acts-nav a:hover span,
.acts-nav a:focus-visible span {
  opacity: 1;
  transform: none;
}

/* ── 幕(預設:靜態版面) ───────────────────────────────────────────────── */
.act {
  position: relative;
  padding: clamp(56px, 11vh, 132px) var(--gutter);
}
.act-pin {
  display: grid;
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  width: min(100%, 1120px);
  margin-inline: auto;
}
.act-still {
  width: min(100%, 440px);
  height: auto;
  justify-self: center;
}
.still-grid {
  fill: none;
  stroke: #fff;
  stroke-opacity: 0.55;
  stroke-width: 1.5;
}
.still-ring {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
}
.still-speck {
  fill: var(--blue);
}
.still-streak {
  fill: none;
  stroke: var(--ink);
  stroke-opacity: 0.3;
  stroke-width: 1.4;
  stroke-linecap: round;
}
.act-n {
  display: flex;
  align-items: center;
  gap: 0.9em;
  font-size: clamp(0.875rem, 0.8rem + 0.4vw, 1.125rem);
  font-weight: 300;
  letter-spacing: 0.32em;
  color: var(--ink-soft);
}
.act-n::before {
  content: "";
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  background: var(--grad);
}
.act-word {
  margin-top: 0.14em;
  font-size: clamp(2.6rem, 1.1rem + 5vw, 5.75rem); /* 每一幕的主角是 3D 物件,字是第二層 */
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.03em;
}
.act-sub {
  display: block;
  margin-top: 0.7em;
  font-size: max(0.2em, 0.8125rem);
  font-weight: 400;
  letter-spacing: 0.4em;
  line-height: 1.4;
  color: var(--ink-soft);
}
.act-line {
  max-width: 23em;
  text-wrap: balance; /* 不留孤字 */
  margin-top: 1.1rem;
  font-size: clamp(1.0625rem, 0.95rem + 0.55vw, 1.375rem);
  font-weight: 300;
  line-height: 1.55;
  color: var(--ink-soft);
}
@media (min-width: 820px) {
  .act-pin {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  }
  .act-explore .act-still {
    order: 2;
  }
}

/* 首屏(靜態) */
.act-hero .act-pin {
  display: grid;
  grid-template-columns: none;
  place-content: center;
  justify-items: center;
  gap: 1.2rem;
  min-height: 78vh;
  text-align: center;
}
.hero-fallback img {
  width: min(86vw, 560px);
  height: auto;
}
.hero-tag {
  display: flex;
  align-items: center;
  gap: 1.1em;
  font-size: clamp(0.875rem, 0.7rem + 0.9vw, 1.375rem);
  font-weight: 300;
  letter-spacing: 0.32em;
  color: var(--ink-soft);
  white-space: nowrap;
}
.hero-tag span {
  margin-right: -0.32em; /* 抵掉最後一個字母後面的字距 */
}
.hero-tag i {
  flex: none;
  width: 0.42em;
  height: 0.42em;
  border-radius: 50%;
  background: var(--blue);
}
.hero-sub {
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.1875rem);
  color: var(--muted);
}
.scroll-cue {
  display: none;
}

/* ── 幕(3D 模式):釘住畫面,--p 由捲動驅動 ─────────────────────────────── */
.is-3d .act {
  height: 340vh;
  height: 340svh;
  padding: 0;
}
/* 相鄰兩幕重疊一屏:上一幕走完的那一刻,下一幕就開始(中間沒有靜止的空檔) */
.is-3d .act + .act {
  margin-top: -100vh;
  margin-top: -100svh;
}
/* 章節連結落在標題已經出現的位置(每一幕開頭那一小段標題還沒進場) */
.is-3d .act-build {
  scroll-margin-top: -53vh;
  scroll-margin-top: -53svh;
}
.is-3d .act-explore {
  scroll-margin-top: -72vh;
  scroll-margin-top: -72svh;
}
.is-3d .act-launch {
  scroll-margin-top: -44vh;
  scroll-margin-top: -44svh;
}
.is-3d .act-hero {
  height: 200vh;
  height: 200svh;
}
.is-3d .act-launch {
  height: 300vh;
  height: 300svh;
}
.is-3d .act-pin {
  position: sticky;
  top: 0;
  z-index: 2;
  display: block;
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
.is-3d .act-still {
  display: none;
}
.is-3d .act-copy {
  --in: clamp(0, calc(var(--p) * 7 - 0.35), 1);
  --out: clamp(0, calc((1 - var(--p)) * 9), 1);
  position: absolute;
  left: var(--gutter);
  bottom: clamp(44px, 10vh, 120px);
  max-width: calc(100vw - 2 * var(--gutter) - 20px);
  opacity: calc(var(--in) * var(--out));
  transform: translate3d(calc((1 - var(--in)) * -7vw), calc((1 - var(--out)) * -5vh), 0) skewX(calc(var(--v) * -1.5deg));
  will-change: transform, opacity;
}
/* 文字後面一片柔白:細字壓在磚塊或細環上也讀得清楚 */
.is-3d .act-copy::before {
  content: "";
  position: absolute;
  inset: -16% -12%;
  z-index: -1;
  background: radial-gradient(closest-side, rgb(255 255 255 / 0.84) 50%, rgb(255 255 255 / 0));
  pointer-events: none;
}
.is-3d .act-line {
  font-weight: 400;
}
.is-3d .act-explore .act-copy {
  --in: clamp(0, calc(var(--p) * 7 - 1), 1); /* 晚一點進場:等 a 形讓出畫面 */
}
.is-3d .act-explore .act-copy,
.is-3d .act-launch .act-copy {
  left: auto;
  right: calc(var(--gutter) + 20px);
  text-align: right;
  transform: translate3d(calc((1 - var(--in)) * 7vw), calc((1 - var(--out)) * -5vh), 0) skewX(calc(var(--v) * 1.5deg));
}
.is-3d .act-explore .act-n,
.is-3d .act-launch .act-n {
  justify-content: flex-end;
}
.is-3d .act-explore .wide,
.is-3d .act-launch .wide {
  transform-origin: right center;
}
.is-3d .act-explore .act-line,
.is-3d .act-launch .act-line {
  margin-left: auto;
}
/* Launch:弧線從下方往右上飛,軌道線掃過左上;文字放右下(軌道內側的空白),跟 Explore 同一個位置 */
.is-3d .act-launch .act-copy {
  --in: clamp(0, calc(var(--p) * 12 - 0.35), 1); /* 早一點站定:發射台那一格先有標題,再點火 */
}
/* 鏡頭拉遠時標題跟著退一步,把畫面讓給那道弧線 */
.is-3d .act-launch .act-word {
  transform: scale(calc(1 - clamp(0, (var(--p) - 0.26) * 3, 0.3)));
  transform-origin: right bottom;
}
@media (max-aspect-ratio: 1/1) {
  /* 窄螢幕:弧線的直段在左邊,文字欄收窄、白底不往左伸 */
  .is-3d .act-launch .act-copy {
    max-width: 62vw;
  }
  .is-3d .act-launch .act-copy::before {
    inset: -16% -12% -16% -2%;
  }
}

/* 首屏(3D):照 logo 自己的排法 —— 標語在「Coswic」正下方、左緣對齊 C、寬度等於「Coswic」。
   --logo-w 是字標在畫面上的寬度(跟 3D 場景同一條公式,js/fit.js)。
   3D 場景載入前先放向量檔的 logo 在同一個位置,載好後交棒。 */
.is-3d .act-hero .act-pin {
  --fade: clamp(0, calc(1 - var(--p) * 3.4), 1);
  min-height: 0;
}
.is-3d .hero-fallback {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--logo-w);
  transform: translate(-50%, -50%);
  transition:
    opacity 0.3s,
    visibility 0s 0.3s;
}
.is-3d .hero-fallback img {
  width: 100%;
  height: auto;
}
.is-3d.has-3d .hero-fallback {
  opacity: 0;
  visibility: hidden;
}
.is-3d .hero-tag,
.is-3d .hero-sub {
  position: absolute;
  opacity: var(--fade);
}
.is-3d .hero-tag {
  left: calc(50% - var(--logo-w) / 2);
  top: calc(50% + var(--logo-w) * 0.0803 + max(12px, var(--logo-w) * 0.026)); /* 0.0803 = 字標高的一半 ÷ 寬 */
  width: calc(var(--logo-w) * 0.592); /* 「Coswic」佔整個字標的寬度比例 */
  justify-content: space-between;
  gap: 0;
  font-size: max(11px, var(--logo-w) * 0.0335);
  letter-spacing: 0.2em;
  transform: translate3d(0, calc(var(--p) * -9vh), 0);
}
.is-3d .hero-tag span {
  margin-right: -0.2em;
}
.is-3d .hero-sub {
  left: var(--gutter);
  bottom: clamp(26px, 5vh, 46px);
  text-align: left;
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}
@media (max-width: 760px) {
  .is-3d .hero-sub {
    left: 50%;
    bottom: clamp(104px, 17vh, 150px);
    width: max-content;
    max-width: calc(100% - 2 * var(--gutter));
    text-align: center;
    transform: translateX(-50%);
  }
}
.is-3d .scroll-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(18px, 4vh, 40px);
  display: grid;
  justify-items: center;
  gap: 10px;
  min-width: 44px;
  font-size: 0.6875rem;
  font-weight: 300;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: var(--fade);
  transform: translateX(-50%);
}
.scroll-cue span {
  margin-right: -0.32em;
}
.scroll-cue i {
  width: 1px;
  height: 46px;
  background: linear-gradient(var(--ink), rgb(6 36 92 / 0));
  transform-origin: top;
  animation: cue 2s var(--ease) infinite;
}
@keyframes cue {
  0% {
    transform: scaleY(0);
  }
  55% {
    transform: scaleY(1);
  }
  100% {
    transform: scaleY(1) translateY(46px);
    opacity: 0;
  }
}

/* ── 跑馬燈:速度跟著捲動速度變 ─────────────────────────────────────────── */
.marquee {
  position: relative;
  z-index: 3;
  overflow: hidden;
  padding: clamp(18px, 2vw, 28px) 0;
  background: #fff;
  border-block: 1px solid var(--line);
}
.marquee-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
}
.mq-word {
  margin-right: 1.15em; /* 字本身被橫向拉寬,右邊要多留 */
  font-size: clamp(1.25rem, 0.9rem + 1.5vw, 2.25rem); /* 一條細細的跑馬燈,不跟前後搶戲 */
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}
.mq-dot {
  flex: none;
  width: clamp(7px, 0.7vw, 11px);
  height: clamp(7px, 0.7vw, 11px);
  margin-right: clamp(14px, 1.3vw, 22px);
  border-radius: 50%;
  background: var(--grad);
}

/* ── 產品:一張切成 a 形輪廓(左圓右直)的卡,平塗深藍,會跟著滑鼠傾斜 ─────── */
.product {
  position: relative;
  z-index: 3;
  padding: clamp(88px, 15vh, 190px) 0;
  background: #fff;
}
.product-inner {
  display: grid;
  justify-items: start;
  gap: clamp(22px, 3vw, 36px);
  perspective: 1300px;
}
.product .kicker {
  font-size: 0.9375rem;
}
.beta-note {
  max-width: 75ch;
  font-size: 0.9375rem;
  line-height: 1.7;
}
.beta-note a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.card {
  --round: clamp(56px, 12vw, 170px);
  position: relative;
  width: 100%;
  padding: clamp(30px, 5.2vw, 64px);
  padding-left: calc(var(--round) * 0.62 + 16px);
  border-radius: var(--round) 0 0 var(--round);
  background: var(--ink);
  color: #fff;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease);
}
.card.is-tilting {
  transition: transform 0.1s linear;
}
.card-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(36rem 24rem at var(--gx, 88%) var(--gy, 0%), rgb(22 199 232 / 0.42), rgb(36 107 255 / 0.16) 45%, transparent 68%);
}
.card-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  transition: transform 0.6s var(--ease);
}
/* 只有在傾斜時才把內容往前推出一層(平放時不做 3D 位移,字才不會糊) */
.card.is-tilting .card-head {
  transform: translateZ(46px);
}
.card.is-tilting .card-tagline {
  transform: translateZ(26px);
}
.card-icon {
  flex: none;
  width: clamp(48px, 6vw, 68px);
  height: clamp(48px, 6vw, 68px);
}
/* the AI-Pay wordmark stands in for icon + name; its letters take the heading colour */
.card-logo {
  display: block;
  width: auto;
  height: clamp(44px, 5.2vw, 64px);
}
.card-logo-ink {
  fill: currentColor;
}
.card-name {
  font-size: clamp(2rem, 1.3rem + 2.4vw, 3.25rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
}
.chip {
  padding: 0.22rem 0.85rem;
  border: 1px solid rgb(255 255 255 / 0.45);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
}
.card-tagline {
  position: relative;
  max-width: 30em;
  text-wrap: balance;
  margin-top: clamp(18px, 2.4vw, 30px);
  font-size: clamp(1.1875rem, 1rem + 0.9vw, 1.75rem);
  font-weight: 300;
  line-height: 1.4;
  color: #d5e4fb;
  transition: transform 0.6s var(--ease);
}
.card-link,
.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3rem;
  margin-top: 1.75rem;
  padding: 0 1.5rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}
.card-link {
  position: relative;
  background: #fff;
  color: var(--ink);
}
.arrow {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── 聯絡:深藍底,一顆有磁性的按鈕 ──────────────────────────────────────── */
.contact {
  position: relative;
  z-index: 3;
  isolation: isolate;
  overflow: clip;
  padding: clamp(96px, 18vh, 230px) 0;
  background: var(--ink);
  color: #fff;
}
.contact::before {
  content: "";
  position: absolute;
  right: -9vw;
  bottom: -30%;
  z-index: -1;
  width: min(40vw, 480px);
  aspect-ratio: 143 / 138;
  background: url("/assets/img/mark.svg?v=cc6d962acb") center / contain no-repeat;
}
.contact .kicker {
  color: #9bd7ff;
}
.contact-title {
  margin-top: 0.2em;
  font-size: min(clamp(2.2rem, 1.1rem + 4vw, 4.75rem), 11.5vw); /* 拉寬 1.22 倍後也不超出窄螢幕 */
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}
.mail {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  margin-top: clamp(28px, 4vw, 52px);
  padding: 10px 26px 10px 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: clamp(1rem, 0.92rem + 0.45vw, 1.3125rem);
  font-weight: 600;
  transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
  transition:
    transform 0.4s var(--ease),
    box-shadow 0.3s;
}
.mail:hover {
  box-shadow: 0 18px 40px -16px rgb(0 0 0 / 0.5);
}
.mail-dot {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--grad);
  /* 圓點比按鈕多走一點,有前後層次 */
  transform: translate3d(calc(var(--mx, 0px) * 0.4), calc(var(--my, 0px) * 0.4), 0);
  transition: transform 0.4s var(--ease);
}
.mail:hover .mail-dot {
  transform: translate3d(calc(var(--mx, 0px) * 0.4), calc(var(--my, 0px) * 0.4), 0) scale(1.12);
}
.mail .arrow {
  transition: transform 0.3s var(--ease);
}
.mail:hover .arrow {
  transform: translateX(4px);
}

/* ── 頁尾 ──────────────────────────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 3;
  padding: 26px 0;
  background: #fff;
  font-size: 0.875rem;
  color: var(--muted);
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 26px;
}
.site-footer .brand img {
  height: 26px;
}
.copyright {
  margin-right: auto;
}

/* ── 游標:logo 的漸層圓點 ─────────────────────────────────────────────── */
.cursor {
  display: none;
}
@media (hover: hover) and (pointer: fine) {
  .cursor {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 60;
    display: block;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
  }
  .cursor::before {
    content: "";
    position: absolute;
    left: -7px;
    top: -7px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--grad);
    transition:
      transform 0.35s var(--ease),
      opacity 0.3s;
  }
  .cursor::after {
    content: "";
    position: absolute;
    left: -17px;
    top: -17px;
    width: 34px;
    height: 34px;
    border: 1px solid var(--ink);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.4);
    transition:
      opacity 0.3s,
      transform 0.45s var(--ease);
  }
  /* 首屏的字標與 Build 的 a 形可以點:游標多一圈細環當提示 */
  .is-3d.has-3d[data-act="hero"] .cursor:not(.is-big)::after,
  .is-3d.has-3d[data-act="build"] .cursor:not(.is-big)::after {
    opacity: 0.55;
    transform: none;
  }
  .cursor.is-on {
    opacity: 1;
  }
  .cursor.is-big::before {
    opacity: 0.32;
    transform: scale(3.6);
  }
}

/* ── 404 ───────────────────────────────────────────────────────────────── */
.notfound-main {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 1rem;
  min-height: 100vh;
  min-height: 100svh;
  padding-block: 3rem;
}
.notfound-code {
  margin-top: 1.5rem;
  font-size: clamp(5rem, 18vw, 9rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}
.notfound h1 {
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.notfound p {
  color: var(--ink-soft);
}
.notfound .pill-link {
  margin-top: 0.75rem;
}
.notfound-alt {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
}
.notfound-alt a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ── 中文版微調:漢字不收字距、行距放寬 ─────────────────────────────────── */
:lang(zh-Hant) body,
body:lang(zh-Hant) {
  line-height: 1.8;
}
:lang(zh-Hant) .act-line,
:lang(zh-Hant) .card-tagline,
:lang(zh-Hant) .hero-sub {
  font-weight: 400;
  line-height: 1.75;
}
/* 中文句子只在標點處換行(不把「錢包」這種詞拆成兩行);真的放不下才硬斷 */
:lang(zh-Hant) .act-line,
:lang(zh-Hant) .card-tagline,
:lang(zh-Hant) .hero-sub {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
:lang(zh-Hant) .card-tagline {
  font-size: clamp(1rem, 0.8rem + 1vw, 1.75rem); /* 手機上整句排成一行 */
}
:lang(zh-Hant) .kicker {
  letter-spacing: 0.4em;
}
:lang(zh-Hant) .contact-title {
  letter-spacing: 0;
  line-height: 1.15;
}
:lang(zh-Hant) .contact-title .wide {
  transform: none; /* 橫向拉寬是對拉丁字母做的;漢字拉寬只會像壞掉 */
}

@media (max-width: 560px) {
  .top-links a:not(.lang) {
    display: none;
  }
  .acts-nav span {
    display: none;
  }
}
@media (max-height: 520px) {
  .is-3d .scroll-cue,
  .is-3d .hero-sub {
    display: none;
  }
  .is-3d .act-word {
    font-size: clamp(2.2rem, 15vh, 4rem);
  }
  .is-3d .act-explore .act-copy,
  .is-3d .act-launch .act-copy {
    right: calc(var(--gutter) + 110px);
  }
  .acts-nav span {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
@media print {
  .stage,
  .cursor,
  .acts-nav,
  .marquee,
  .scroll-cue {
    display: none !important;
  }
  .is-3d .act {
    height: auto;
    margin-top: 0;
    padding: 32px var(--gutter);
  }
  .is-3d .act-pin,
  .is-3d .act-copy,
  .is-3d .hero-tag,
  .is-3d .hero-sub,
  .is-3d .hero-fallback {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .is-3d .site-header .brand {
    visibility: visible;
  }
}
