/* ===== 色彩與字體 ===== */
:root {
  --bg: #121211; --bg2: #1A1A18; --bg3: #24231F; --ln: #2E2D29; --ln2: #4A4843;
  --ink: #F1EFE8; --ink2: #B5B2A8; --mut: #8F8C82;
  --ac: #C8F04A; --ac-ink: #121211;
  --lamp: #F6E3A0;
  --px-a: #E8E6DF; --px-e: #C9C6BD; --px-b: #A6A39A; --px-f: #7E7B74; --px-c: #5E5C56; --px-d: #26251F;
  --n1: #1F1E1C; --n2: #2C2B28;
  --ease: cubic-bezier(.165, .84, .44, 1);
  --ease-io: cubic-bezier(.77, 0, .175, 1);
  --sans: 'Space Grotesk', 'Noto Sans TC', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --pix: 'Doto', monospace;
  --hdr: 64px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F1EFE8; --bg2: #FAF9F5; --bg3: #E3E0D6; --ln: #D8D4C9; --ln2: #ADA99E;
  --ink: #151513; --ink2: #4D4B45; --mut: #65625A;
  --lamp: #E8B840;
  --px-a: #FFFFFF; --px-e: #DEDBD3; --px-b: #BDBAB1; --px-f: #9A978E; --px-c: #77746C; --px-d: #2A2926;
  --n1: #E6E3D9; --n2: #D9D5C9;
  color-scheme: light;
}

/* 中英切換：兩種語言都寫在 HTML 裡，只顯示目前的那一種 */
:root:not([data-lang="en"]) .en, :root[data-lang="en"] .zh { display: none !important; }

/* ===== 基本 ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--hdr) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans);
  transition: background-color .8s var(--ease-io), color .8s var(--ease-io);
}
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 3px; }
.mono { font-family: var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { left: 16px; top: 12px; width: auto; height: auto; clip: auto; z-index: 40; padding: 10px 14px; background: var(--ac); color: var(--ac-ink); }
.wrap { max-width: 1360px; margin: 0 auto; padding: 0 40px; }
.page { position: relative; z-index: 1; }

/* ===== 霧面遮罩：疊在像素底上的內容框，底下的像素只隱約透出來 ===== */
.surface { background: var(--bg); }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .surface { background: color-mix(in srgb, var(--bg) 84%, transparent); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
}

/* ===== 頁首 ===== */
.hdr {
  position: sticky; top: 0; z-index: 30; height: var(--hdr); padding: 0 40px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg); border-bottom: 1px solid var(--ln);
}
.logo { display: flex; color: var(--ink); }
.logo svg { width: 44px; height: 32px; }
.hdr-tools { display: flex; align-items: center; gap: 6px; }
/* 語言：沒有外框，只有像素字「中」「EN」；目前的語言是亮的，另一個是灰的 */
.seg { display: flex; }
.seg button {
  min-width: 40px; height: 44px; padding: 0 6px; display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--mut); cursor: pointer;
}
.seg button:hover { color: var(--ink2); }
.seg button[aria-pressed="true"] { color: var(--ink); }
.icon-btn {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: none; border: 0; color: var(--ink); cursor: pointer;
}
:root[data-theme="light"] .i-sun, :root:not([data-theme="light"]) .i-moon { display: none; }
.menu-btn[aria-expanded="true"] .i-burger, .menu-btn[aria-expanded="false"] .i-close { display: none; }

/* ===== 選單：方塊一個個掉下來，滑過會翻成另一種語言 ===== */
.menu { position: fixed; inset: var(--hdr) 0 0 0; z-index: 25; }
.menu[hidden] { display: none; }
.menu-scrim { position: absolute; inset: 0; border: 0; background: var(--bg); opacity: 0; cursor: default; transition: opacity .25s var(--ease); }
.menu.on .menu-scrim { opacity: .72; }
.menu-list { position: absolute; top: 20px; right: 40px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.mi { position: relative; display: block; height: 60px; overflow: hidden; text-decoration: none; border: 1px solid; }
.mi-1 { background: var(--ac); color: var(--ac-ink); border-color: var(--ac); }
.mi-2 { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.mi-3 { background: var(--bg3); color: var(--ink); border-color: var(--ln2); }
.mi-4 { background: var(--bg); color: var(--ink); border-color: var(--ink); }
.roll { display: flex; flex-direction: column; transition: transform .3s var(--ease); }
.roll > span {
  height: 60px; display: flex; align-items: center; justify-content: flex-end; padding: 0 24px;
  font: 700 30px/1 'Noto Sans TC', sans-serif;
}
.roll .lat { font-family: var(--pix); font-weight: 800; letter-spacing: .04em; }
.mi:hover .roll, .mi:focus-visible .roll { transform: translateY(-60px); }
.mi[aria-disabled="true"] { cursor: default; }

/* ===== 按鈕：滑過時字元 ░▒▓█ 從左掃過去填滿（.fx 由 site.js 加進去） ===== */
.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 24px;
  text-decoration: none; font-weight: 700; font-size: 16px; border: 0; cursor: pointer;
}
.btn-ac { background: var(--ac); color: var(--ac-ink); }
.btn-line { border: 1px solid var(--ln2); background: transparent; color: var(--ink); }
.btn, .mail, .copy-btn, .line-btn { position: relative; overflow: hidden; isolation: isolate; }
.fx {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  font: 400 26px/26px var(--mono); letter-spacing: 0; white-space: pre; color: var(--ac);
}
.btn > :not(.fx), .mail > :not(.fx), .copy-btn > :not(.fx), .line-btn > :not(.fx) { position: relative; z-index: 1; }
.btn-ac .fx { color: var(--ink); }
.btn-ac.lit { color: var(--bg); }
.btn-line.lit, .line-btn.lit { color: var(--ac-ink); border-color: var(--ac); }
.mail.lit .tx, .copy-btn.lit .tx { color: var(--ac-ink); }

/* ===== 首頁：首屏 ===== */
.hero {
  max-width: 1360px; margin: 0 auto; padding: 64px 40px 0;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 48px; align-items: center;
}
.hero-text { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.name {
  margin: 0; font-family: var(--pix); font-weight: 800; font-size: clamp(40px, 4.4vw, 64px);
  line-height: .92; letter-spacing: .01em; white-space: nowrap;
}
.role { margin: 0; font-size: 19px; color: var(--ink2); font-weight: 500; }
.tagline { margin: 20px 0 0; font-size: clamp(18px, 1.5vw, 22px); line-height: 1.6; font-weight: 500; max-width: 560px; }
.chip {
  display: inline-block; min-width: 3.2em; text-align: center; padding: 0 12px; margin: 0 8px;
  background: var(--ac); color: var(--ac-ink); font-weight: 800; letter-spacing: .04em;
}
.chip.en { font-family: var(--pix); }
.desk-wrap { display: flex; justify-content: flex-end; min-width: 0; }
/* 刮刮樂那一條：平常是空的，滑鼠刮過才露出字 */
.hero-scratch { grid-column: 1 / -1; height: 180px; }
.desk { --c: 6px; position: relative; width: calc(110 * var(--c)); height: calc(48 * var(--c)); }
.desk i { position: absolute; left: calc(-1 * var(--c)); top: calc(-1 * var(--c)); width: var(--c); height: var(--c); }
.desk .dl { position: absolute; inset: 0; pointer-events: none; }
.desk.intro > :not(.desk-intro) { visibility: hidden; }
.desk-intro { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
/* 點螢幕換畫面、點檯燈開關：透明的按鈕蓋在上面 */
.desk-hit { position: absolute; padding: 0; border: 0; background: none; cursor: pointer; }
.desk-hit:focus-visible { outline: 2px dashed var(--ac); outline-offset: 2px; }
/* 螢幕：同時只亮一個畫面，換的時候由上往下一段段刷出來 */
.scr { position: absolute; overflow: hidden; pointer-events: none; }
.scene { position: absolute; inset: 0; display: none; }
.scene.on { display: block; animation: scrIn .36s steps(6); }
@keyframes scrIn { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
/* CLI：一行行打出來、游標閃 */
.dl-cli-l1 { animation: type1 9s steps(8) infinite; }
.dl-cli-l2 { animation: type2 9s steps(6) infinite; }
.dl-cli-l3 { animation: type3 9s steps(4) infinite; }
.dl-cli-l4 { animation: type4 9s steps(10) infinite; }
.dl-cli-l5 { animation: type5 9s steps(8) infinite; }
.dl-cli-l6 { animation: type6 9s steps(8) infinite; }
.dl-cli-l7 { animation: type7 9s steps(6) infinite; }
.dl-cli-cursor { animation: blink 1s steps(1) infinite; }
@keyframes type1 { 0% { clip-path: inset(0 calc(100% - var(--l)) 0 0); } 6%, 90% { clip-path: inset(0 calc(100% - var(--r)) 0 0); } 91%, 100% { clip-path: inset(0 calc(100% - var(--l)) 0 0); } }
@keyframes type2 { 0%, 8% { clip-path: inset(0 calc(100% - var(--l)) 0 0); } 13%, 90% { clip-path: inset(0 calc(100% - var(--r)) 0 0); } 91%, 100% { clip-path: inset(0 calc(100% - var(--l)) 0 0); } }
@keyframes type3 { 0%, 15% { clip-path: inset(0 calc(100% - var(--l)) 0 0); } 18%, 90% { clip-path: inset(0 calc(100% - var(--r)) 0 0); } 91%, 100% { clip-path: inset(0 calc(100% - var(--l)) 0 0); } }
@keyframes type4 { 0%, 20% { clip-path: inset(0 calc(100% - var(--l)) 0 0); } 26%, 90% { clip-path: inset(0 calc(100% - var(--r)) 0 0); } 91%, 100% { clip-path: inset(0 calc(100% - var(--l)) 0 0); } }
@keyframes type5 { 0%, 30% { clip-path: inset(0 calc(100% - var(--l)) 0 0); } 36%, 90% { clip-path: inset(0 calc(100% - var(--r)) 0 0); } 91%, 100% { clip-path: inset(0 calc(100% - var(--l)) 0 0); } }
@keyframes type6 { 0%, 38% { clip-path: inset(0 calc(100% - var(--l)) 0 0); } 43%, 90% { clip-path: inset(0 calc(100% - var(--r)) 0 0); } 91%, 100% { clip-path: inset(0 calc(100% - var(--l)) 0 0); } }
@keyframes type7 { 0%, 45% { clip-path: inset(0 calc(100% - var(--l)) 0 0); } 49%, 90% { clip-path: inset(0 calc(100% - var(--r)) 0 0); } 91%, 100% { clip-path: inset(0 calc(100% - var(--l)) 0 0); } }
/* 視窗：圖表更新 */
.dl-win-bars { animation: blink 3s steps(1) infinite; }
/* 桌面：滑鼠游標走到資料夾、選起來 */
.dl-dsk-cur i { animation: cur 6s infinite; animation-timing-function: steps(3); }
.dl-dsk-sel { animation: sel 6s steps(1) infinite; }
@keyframes cur {
  0%, 22% { transform: translate(0, 0); }
  32%, 60% { transform: translate(calc(-10 * var(--c)), calc(-6 * var(--c))); }
  70%, 88% { transform: translate(calc(-3 * var(--c)), calc(4 * var(--c))); }
  100% { transform: translate(0, 0); }
}
@keyframes sel { 0%, 34% { opacity: 0; } 35%, 60% { opacity: 1; } 61%, 100% { opacity: 0; } }
/* 短影音：每 3 秒往上滑到下一支，進度條跟著跑 */
.dl-sh-feed i { animation: feed 9s infinite; animation-timing-function: steps(4); }
@keyframes feed {
  0%, 30% { transform: translateY(0); }
  33.4%, 63.4% { transform: translateY(calc(-17 * var(--c))); }
  66.7%, 96.7% { transform: translateY(calc(-34 * var(--c))); }
  100% { transform: translateY(calc(-51 * var(--c))); }
}
.dl-sh-prog { animation: prog 3s steps(9) infinite; }
@keyframes prog { from { clip-path: inset(0 calc(100% - var(--l)) 0 0); } to { clip-path: inset(0 calc(100% - var(--r)) 0 0); } }
/* 槍戰遊戲：敵人左右閃、開槍的火光 */
.dl-gm-enemy i { animation: strafe 2.4s steps(1) infinite; }
@keyframes strafe {
  0% { transform: translateX(0); } 15% { transform: translateX(var(--c)); } 30% { transform: translateX(calc(2 * var(--c))); }
  45% { transform: translateX(calc(3 * var(--c))); } 60% { transform: translateX(var(--c)); } 75% { transform: translateX(calc(-1 * var(--c))); }
  90% { transform: translateX(calc(-2 * var(--c))); }
}
.dl-gm-flash { animation: flash 1.2s steps(1) infinite; }
@keyframes flash { 0%, 10% { opacity: 1; } 11%, 100% { opacity: 0; } }
/* 檯燈：光是一點一點的網點，開的時候閃兩下才亮 */
.dl-lamp-cone { opacity: .55; }
.dl-lamp-pool { opacity: .8; }
.dl-lamp-cone, .dl-lamp-pool, .dl-lamp-bulb { animation: lampOn .5s steps(1); }
.desk.lamp-off .dl-lamp-cone, .desk.lamp-off .dl-lamp-pool, .desk.lamp-off .dl-lamp-bulb { display: none; }
@keyframes lampOn { 0% { visibility: hidden; } 20% { visibility: visible; } 40% { visibility: hidden; } 60%, 100% { visibility: visible; } }
/* 貓：呼吸、偶爾偷睜開黃綠色的眼睛、頭上飄 z */
.dl-cat-breath { animation: breath 3.6s steps(1) infinite; }
.dl-cat-eyes { animation: peek 12s steps(1) infinite; }
@keyframes breath { 0%, 49% { opacity: 0; } 50%, 100% { opacity: 1; } }
@keyframes peek { 0%, 80% { opacity: 0; } 81%, 86% { opacity: 1; } 87% { opacity: 0; } 88%, 92% { opacity: 1; } 93%, 100% { opacity: 0; } }
.zzz { position: absolute; left: calc(89 * var(--c)); top: calc(11 * var(--c)); width: calc(10 * var(--c)); height: calc(10 * var(--c)); font: 600 calc(3 * var(--c)) / 1 var(--mono); color: var(--px-b); pointer-events: none; }
.zzz span { position: absolute; left: 0; bottom: 0; opacity: 0; animation: zzz 3.6s steps(6) infinite; }
.zzz span:nth-child(2) { animation-delay: 1.2s; font-size: 1.2em; }
.zzz span:nth-child(3) { animation-delay: 2.4s; font-size: 1.5em; }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 0); } 15% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(4 * var(--c)), calc(-8 * var(--c))); } }
@keyframes blink { 50% { opacity: 0; } }

/* ===== 首頁：作品條（桌機：先由小放大，貼頂後往下捲會橫向移動） ===== */
.strip-pin { position: relative; }
.strip-sticky { position: sticky; top: var(--hdr); height: calc(100vh - var(--hdr)); display: flex; align-items: center; overflow: hidden; }
.strip { display: flex; gap: 32px; padding: 0 max(40px, 6vw); transform-origin: 0 50%; will-change: transform; }
.card {
  flex: 0 0 min(1020px, calc((100vh - 330px) * 1.778)); display: flex; flex-direction: column;
  background: var(--bg2); border: 1px solid var(--ln); text-decoration: none; color: var(--ink);
}
.card-body { padding: 28px 32px 30px; display: flex; flex-direction: column; gap: 12px; }
.card h3 { margin: 0; font-size: 28px; line-height: 1.4; font-weight: 700; transition: color .3s; }
.card:hover h3 { color: var(--ac); }
:root[data-theme="light"] .card:hover h3 { color: var(--ink); text-decoration: underline; text-decoration-color: var(--ac); text-decoration-thickness: 3px; }
.card p { margin: 0; font-size: 17px; line-height: 1.75; color: var(--ink2); max-width: 720px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12px; }
.card-foot .mono:first-child { color: var(--mut); }

/* ===== 作品畫面：用程式畫的產品介面，固定 880×495 再等比縮放 ===== */
.shot { position: relative; aspect-ratio: 880 / 495; overflow: hidden; background: var(--bg3); }
.stage { position: absolute; left: 0; top: 0; width: 880px; height: 495px; transform-origin: 0 0; transform: scale(var(--s, 1)); font-family: 'Noto Sans TC', system-ui, sans-serif; }

/* ===== 頁尾 ===== */
.foot { position: relative; overflow: hidden; padding: 160px 40px 96px; background: var(--bg); color: var(--ink); border-top: 1px solid var(--ln); }
.foot-px { position: absolute; left: 0; top: 0; pointer-events: none; }
.bg-px { position: fixed; left: 0; top: 0; z-index: 0; pointer-events: none; }
.pile-px { position: absolute; left: 0; top: 0; pointer-events: none; }
/* 切換深淺色：新畫面用遮罩一格格露出來（遮罩由 site.js 產生） */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.theme-swap body { transition: none !important; }
.foot-box {
  position: relative; max-width: 1360px; margin: 0 auto; border: 1px solid var(--ln2);
  padding: 48px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 40px;
}
.foot-lead { display: flex; flex-direction: column; gap: 28px; align-items: flex-start; }
.foot-lead p { margin: 0; font-size: 26px; line-height: 1.5; font-weight: 500; }
.mail { display: flex; align-items: stretch; min-height: 48px; border: 1px solid var(--ink); text-decoration: none; }
.mail .ic { width: 48px; display: flex; align-items: center; justify-content: center; background: var(--ac); color: var(--ac-ink); }
.mail .tx { display: flex; align-items: center; padding: 0 20px; font: 600 13px var(--mono); letter-spacing: .14em; }
.foot nav { border-left: 1px solid var(--ln); padding-left: 32px; display: flex; flex-direction: column; gap: 14px; }
.foot nav p { margin: 0 0 6px; font: 500 12px var(--mono); letter-spacing: .18em; color: var(--mut); }
.foot nav a, .foot nav span.off { text-decoration: none; font-weight: 700; font-size: 17px; }
.foot nav span.off { color: var(--mut); }
.foot nav a:hover { text-decoration: underline; text-decoration-color: var(--ac); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.foot-legal {
  grid-column: 1 / -1; border-top: 1px solid var(--ln); padding-top: 20px; display: flex; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; font: 500 12px var(--mono); letter-spacing: .14em; color: var(--mut);
}

/* ===== 關於：會掉落的方塊 ===== */
.about-page { position: relative; }
.skills { position: relative; height: 480px; overflow: hidden; }
.skills-head { position: absolute; top: 28px; left: 40px; right: 28px; display: flex; justify-content: space-between; align-items: center; gap: 16px; z-index: 2; }
.skills-head h1, .skills-head p { margin: 0; font-size: 12px; font-weight: 500; color: var(--mut); }
.door { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; display: flex; overflow: hidden; }
.door i { flex: 1; background: linear-gradient(90deg, var(--ln2) 0 8px, transparent 8px) 0 0 / 12px 6px repeat-x; transition: transform .5s steps(6); }
.door.open i:first-child { transform: translateX(-101%); }
.door.open i:last-child { transform: translateX(101%); }
.skills-list { position: absolute; left: 40px; right: 40px; bottom: 40px; margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.skills-list li { padding: 10px 16px; background: var(--bg3); border: 1px solid var(--ln2); font: 600 14px var(--mono); letter-spacing: .06em; }
.js-physics .skills-list { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* 方塊在內容後面（.page 自成一層，負的 z-index 會排在文字底下） */
.pile { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.js-physics .about-page, .js-physics .skills { pointer-events: none; }
.js-physics .about-page > :not(.skills) { pointer-events: auto; }
.js-physics .skills button { pointer-events: auto; }
.piece { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.piece {
  display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden;
  border: 1px solid; padding-left: .12em;
  font: 600 20px/1 'JetBrains Mono', 'Noto Sans TC', monospace; letter-spacing: .12em; transition: opacity .3s;
}
/* 跟全站的按鈕同一套：訊號色實心、白框、灰框 */
.piece[data-tone="a"] { background: var(--ac); border-color: var(--ac); color: var(--ac-ink); }
.piece[data-tone="i"] { background: var(--bg); border-color: var(--ink); color: var(--ink); }
.piece[data-tone="d"] { background: var(--bg2); border-color: var(--ln2); color: var(--ink2); }
/* 經過主內容時變半透明，字還看得清楚 */
.piece.ghost { opacity: .35; }
/* 化成灰的時候，方塊本身交給上面那張畫布 */
.piece.dust { background: none; border-color: transparent; color: transparent; }

.intro { max-width: 1360px; margin: 0 auto; padding: 104px 40px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; align-items: start; }
.portrait-wrap { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.portrait { position: relative; aspect-ratio: 1 / 1; background: var(--bg); border: 1px solid var(--ln2); overflow: hidden; }
.portrait img { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.portrait-px { position: absolute; left: 0; top: 0; }
.bio { display: flex; flex-direction: column; gap: 26px; max-width: 620px; }
.bio-name { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.bio-name h1 { margin: 0; font-family: var(--pix); font-weight: 800; font-size: clamp(40px, 4.4vw, 64px); line-height: .95; }
.bio-name span { font-size: 24px; font-weight: 700; color: var(--ink2); }
.bio .lead { margin: 0; font-size: 26px; line-height: 1.6; font-weight: 500; }
.bio p { margin: 0; font-size: 18px; line-height: 1.85; color: var(--ink2); }
.hw { color: var(--ink); text-decoration: underline dotted var(--ac) 2px; text-underline-offset: 5px; }
.hw-chip { font: 800 16px var(--pix), 'Noto Sans TC', monospace; background: var(--ac); color: var(--ac-ink); padding: 3px 10px; letter-spacing: .06em; }
.copy-btn { display: flex; align-items: stretch; border: 1px solid var(--ink); background: transparent; color: var(--ink); padding: 0; min-height: 50px; cursor: pointer; }
.copy-btn .ic { width: 50px; display: flex; align-items: center; justify-content: center; background: var(--ac); color: var(--ac-ink); }
.copy-btn .tx { display: flex; align-items: center; padding: 0 22px; font: 600 13px var(--mono); letter-spacing: .14em; }
.copy-btn.copied .lbl { display: none; }
.line-btn { display: flex; align-items: center; gap: 10px; border: 1px solid var(--ln2); padding: 0 22px; min-height: 50px; text-decoration: none; font: 600 13px var(--mono); letter-spacing: .14em; }

.exp { max-width: 1360px; margin: 0 auto; padding: 0 40px 520px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 48px; }
.exp > h2 { margin: 0; font-size: 30px; line-height: 1.35; font-weight: 700; position: sticky; top: 96px; align-self: start; }
.exp .label { margin: 0 0 14px; font-size: 12px; color: var(--mut); }
.exp .label.gap { margin-top: 56px; }
.row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; padding: 26px 0; border-top: 1px solid var(--ln); }
.row.end { border-bottom: 1px solid var(--ln); }
.row .mono { margin: 0; font-size: 12px; color: var(--ink2); }
.row h3 { margin: 0 0 8px; font-size: 21px; font-weight: 700; }
.row h3 span { font-weight: 400; color: var(--ink2); }
.row p { margin: 0; font-size: 16px; line-height: 1.85; color: var(--ink2); max-width: 700px; }
.row.award { padding: 20px 0; }
.row.award p:last-child { font-size: 17px; color: var(--ink); }

/* ===== 案例內頁 ===== */
.ticks { position: fixed; right: 28px; top: 50%; transform: translateY(-50%); z-index: 10; display: flex; flex-direction: column; gap: 20px; align-items: flex-end; }
.ticks a { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; padding: 4px; }
.ticks i { display: block; height: 1px; width: 10px; background: var(--ln2); transition: width .3s var(--ease), background-color .3s; }
.ticks a i:first-child { width: 18px; }
.ticks a.on i:first-child { width: 30px; background: var(--ac); }
.case-hero { max-width: 1360px; margin: 0 auto; padding: 104px 100px 72px 40px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 72px; align-items: start; }
.case-hero h1 { margin: 0; font-size: clamp(34px, 3.6vw, 52px); line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
.case-hero .sum { margin: 0; font-size: 21px; line-height: 1.8; color: var(--ink2); max-width: 640px; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--ln); border-top: 1px solid var(--ln2); }
.metrics b { display: block; font: 800 clamp(28px, 2.8vw, 44px)/1 var(--pix); white-space: nowrap; }
.metrics b em { font-style: normal; color: var(--ac); margin: 0 10px; }
.metrics .mono { margin: 12px 0 0; font-size: 11px; color: var(--mut); }
.meta { margin: 0; }
.meta div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--ln); }
.meta dt { font-size: 11px; color: var(--mut); }
.meta dd { margin: 0; font-size: 15px; }
.proto { max-width: 1312px; margin: 0 auto; padding: 0 40px 104px; }
.proto .shot { border: 1px solid var(--ln); }
.body { max-width: 780px; margin: 0 auto; padding: 0 40px; }
.body section { padding: 72px 0 24px; border-top: 1px solid var(--ln); }
.body h2 { margin: 0 0 22px; font-size: 32px; line-height: 1.35; font-weight: 700; }
.body p { margin: 0 0 22px; font-size: 18px; line-height: 1.9; color: var(--ink2); }
.body p.strong { color: var(--ink); }
.body ul { margin: 0 0 32px; padding-left: 22px; }
.body li { font-size: 18px; line-height: 1.85; color: var(--ink2); margin-bottom: 12px; padding-left: 6px; }
.body li::marker { color: var(--ac); }
.nda { display: flex; gap: 14px; border: 1px solid var(--ln2); background: var(--bg2); padding: 18px 22px; margin-bottom: 48px; }
.nda svg { flex: 0 0 auto; margin-top: 4px; color: var(--ac); }
.nda p { margin: 0; font-size: 15px; line-height: 1.8; color: var(--ink); }
.flow { margin: 0 auto 72px; max-width: 1120px; padding: 52px; background: var(--bg2); border: 1px solid var(--ln); }
.flow .mono { margin: 0 0 22px; font-size: 11px; color: var(--mut); }
.flow .mono.after { margin-top: 40px; }
.chain { display: flex; align-items: center; flex-wrap: wrap; row-gap: 12px; }
.node { border: 1px solid var(--ln2); padding: 14px 16px; font: 600 12px/1.4 var(--mono), 'Noto Sans TC', monospace; letter-spacing: .1em; text-align: center; color: var(--ink); background: var(--bg); min-width: 112px; }
.node.hit { background: var(--ac); color: var(--ac-ink); border-color: var(--ac); }
.arrow { flex: 0 0 32px; height: 1px; background: var(--ln2); position: relative; }
.arrow::after { content: ""; position: absolute; right: 0; top: -4px; border: 4px solid transparent; border-left: 6px solid var(--ln2); border-right: 0; }
.flow figcaption, .ba figcaption { margin-top: 30px; font-size: 14px; line-height: 1.75; color: var(--ink2); }
.ba { margin: 0 auto 72px; max-width: 1200px; padding: 0 40px; }
.ba-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ba-grid > div { display: flex; flex-direction: column; gap: 10px; }
.ba-grid .mono { margin: 0; font-size: 11px; color: var(--mut); }
.ph { aspect-ratio: 16 / 9; background-color: var(--bg3); background-image: repeating-linear-gradient(135deg, transparent 0 11px, var(--ln) 11px 12px); display: flex; align-items: center; justify-content: center; }
.ph span { font-size: 11px; color: var(--ink2); background: var(--bg); padding: 6px 10px; }
.next { border-top: 1px solid var(--ln); padding: 44px 40px; max-width: 1360px; margin: 0 auto; display: flex; justify-content: space-between; gap: 24px; }
.next a { display: flex; flex-direction: column; gap: 8px; text-decoration: none; min-height: 44px; }
.next a:last-child { text-align: right; }
.next .mono { font-size: 11px; color: var(--mut); }
.next b { font-size: 22px; }
.next a:hover b { text-decoration: underline; text-decoration-color: var(--ac); text-decoration-thickness: 3px; text-underline-offset: 6px; }

/* ===== 作品畫面進場：由左往右推開，前緣是破碎的字元（site.js 疊一層 canvas） ===== */
.reveal { position: relative; }
.js .reveal:not(.in)::after { content: ''; position: absolute; inset: 0; z-index: 2; background: var(--bg3); }
.rv-cv { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; pointer-events: none; }

@keyframes pxUp { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes bar { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@keyframes cur { 0%, 100% { transform: translate(0, 0); } 45%, 62% { transform: translate(370px, 200px); } }

/* ===== 平板 ===== */
@media (max-width: 1400px) {
  .desk { --c: 5px; }
}
@media (max-width: 1200px) {
  .desk { --c: 4px; }
  .case-hero { padding-right: 72px; }
}

/* ===== 手機 ===== */
@media (max-width: 899px) {
  :root { --hdr: 56px; }
  .hdr { padding: 0 6px 0 16px; }
  .logo svg { width: 36px; height: 26px; }
  .seg button[aria-pressed="true"] { display: none; }
  .wrap { padding: 0 16px; }
  .menu-list { right: 16px; left: 16px; }
  .mi { width: 100%; }
  .hero { grid-template-columns: 1fr; padding: 32px 16px 0; gap: 16px; }
  .hero-scratch { height: 100px; }
  .desk-wrap { order: -1; justify-content: center; }
  .desk { --c: 3px; }
  .name { font-size: clamp(36px, 11vw, 48px); white-space: normal; }
  .role { font-size: 16px; }
  .tagline { font-size: 18px; line-height: 1.6; }
  .chip { padding: 0 8px; margin: 0 4px; }
  .strip-sticky { position: static; height: auto; display: block; }
  .strip { flex-direction: column; gap: 24px; padding: 24px 16px 56px; }
  .card { flex: none; width: 100%; }
  .card-body { padding: 20px; }
  .card h3 { font-size: 21px; }
  .card p { font-size: 15px; }
  .foot { padding: 144px 16px 40px; }
  .foot-box { grid-template-columns: 1fr 1fr; padding: 28px 24px; }
  .foot-lead { grid-column: 1 / -1; }
  .foot-lead p { font-size: 20px; }
  .foot nav { border-left: 0; padding-left: 0; }
  .skills { height: 360px; }
  .skills-head { left: 16px; right: 4px; }
  .skills-list { left: 16px; right: 16px; bottom: 24px; }
  .intro { grid-template-columns: 1fr; padding: 56px 16px; gap: 40px; }
  .bio .lead { font-size: 21px; }
  .exp { grid-template-columns: 1fr; padding: 0 16px 300px; gap: 8px; }
  .exp > h2 { position: static; margin-bottom: 16px; }
  .row { grid-template-columns: 1fr; gap: 8px; }
  .ticks { display: none; }
  .case-hero { grid-template-columns: 1fr; padding: 56px 16px 40px; gap: 40px; }
  .case-hero .sum { font-size: 18px; }
  .metrics b { font-size: 32px; }
  .proto { padding: 0 16px 56px; }
  .body { padding: 0 16px; }
  .body section { padding-top: 48px; }
  .body h2 { font-size: 26px; }
  .body p, .body li { font-size: 16px; }
  .flow { margin: 0 16px 48px; padding: 24px 20px; }
  .chain { flex-direction: column; align-items: stretch; }
  .arrow { flex: 0 0 20px; width: 1px; height: 20px; align-self: center; }
  .arrow::after { right: -4px; top: auto; bottom: 0; border: 4px solid transparent; border-top: 6px solid var(--ln2); border-bottom: 0; }
  .ba { padding: 0 16px; }
  .ba-grid { grid-template-columns: 1fr; }
  .next { padding: 32px 16px; }
  .next b { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* 觸控裝置刮不了，那一條收起來 */
@media (hover: none) { .hero-scratch { height: 24px; } }
