/* =========================================================
   MARK — Japan Fixer
   版面依參考網站：淺灰底、藍色字、襯線大標、三欄作品格
   間距與字級：黃金比例（1 : 1.618）級距
   ========================================================= */

:root {
  --bg: #e8e6e1;      /* 基本底色：略帶暖調、比原本暗一階的灰 */
  --warm: #dbd7ce;    /* About 區：更暖、更暗一階的米灰 */
  --blue: #2c55d5;    /* 標題與 Service 色帶 */
  --ink: #1e2b57;     /* 長段內文：深藍黑，比亮藍好讀 */
  --on-blue: #f4f2ee; /* 藍底上的文字 */
  --gray: #555555;
  --dark: #333333;
  --red: #b91f22;   /* 錯誤訊息：在灰底上也清楚（5:1） */

  --serif: "Playfair Display", "Noto Serif TC", serif;
  --sans: "Montserrat", "Noto Sans TC", sans-serif;

  /* 黃金比例級距：每一級 ≈ 前一級 × 1.618 */
  --s1: 8px;
  --s2: 13px;
  --s3: 21px;
  --s4: 34px;
  --s5: 55px;
  --s6: 89px;
  --s7: 144px;
  --s8: 233px;

  /* 字級同樣依黃金比例：13 → 21 → 34 → 55 → 89 */
  --t-cap: 13px;
  --t-body: 16px;
  --t-lead: 21px;
  --t-h3: 34px;
  --t-h2: 89px;
  --t-h1: 144px;

  --ease: cubic-bezier(.22, .61, .36, 1);   /* 所有動態共用的緩動：起步快、收尾柔 */
  --side: var(--s5);   /* 頁面左右留白 */
  --gap: var(--s5);    /* 欄距 */
}
html[data-lang="ja"] {
  --serif: "Playfair Display", "Noto Serif JP", serif;
  --sans: "Montserrat", "Noto Sans JP", sans-serif;
}
/* 只顯示目前語言的文字 */
html[data-lang="zh"] [data-l]:not([data-l="zh"]),
html[data-lang="ja"] [data-l]:not([data-l="ja"]),
html[data-lang="en"] [data-l]:not([data-l="en"]) { display: none !important; }
html[data-lang="en"] .p-desc, html[data-lang="en"] .p-role, html[data-lang="en"] .item p, html[data-lang="en"] .essay p { hyphens: manual; text-wrap: pretty; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: var(--s6); scroll-behavior: smooth; scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
* { -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--bg); color: var(--blue);
  font-family: var(--sans); font-weight: 300; font-size: var(--t-body); line-height: 2;
  letter-spacing: .03em;
  -webkit-font-smoothing: antialiased; line-break: strict; overflow-x: hidden;
}
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
.p-title, .hero-sub, .sec-sub, .award-name, .item h3, .essay h3 { text-wrap: balance; }   /* 標題不留孤字 */
ul, ol { list-style: none; }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* ---------- header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: var(--s7);
  transition: height .35s var(--ease), transform .4s var(--ease), background-color .35s, box-shadow .35s;
}
.site-header.scrolled { height: var(--s6); background: var(--bg); box-shadow: 0 1px 0 rgba(30, 43, 87, .08); }
.site-header.hide { transform: translateY(-100%); }
body { padding-top: var(--s7); }
.header-in {
  height: 100%; margin: 0 auto; padding: 0 var(--side);
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  display: grid; place-items: center; width: 45px; height: 45px; flex: none;
  background: #000; color: var(--bg);
  font-family: var(--serif); font-weight: 700; font-size: 20px; line-height: 1; letter-spacing: 0;
}
.nav { display: flex; align-items: center; gap: var(--s2); }
.nav a { padding: var(--s2); font-weight: 400; font-size: 16px; line-height: 1.4; letter-spacing: .02em; white-space: nowrap; transition: opacity .2s; }
.nav a:hover { opacity: .6; }
/* 語言切換：中文／日本語／EN，目前的語言是藍色加底線 */
.lang-switch { display: flex; align-items: center; margin-left: var(--s2); }
.lang-switch a {
  display: inline-flex; align-items: center; min-height: 44px; padding: var(--s2) var(--s1);
  font-weight: 400; font-size: 13px; line-height: 1.4; letter-spacing: .06em; white-space: nowrap;
  color: var(--gray); transition: color .2s;
}
.lang-switch a[aria-current="page"] { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; cursor: default; }
@media (hover: hover) { .lang-switch a:hover { color: var(--blue); } }
.lang-switch--m { display: none; }
.menu-btn { display: none; position: relative; z-index: 60; padding: var(--s2) 0; font-weight: 400; font-size: 15px; letter-spacing: .08em; }
.logo { position: relative; z-index: 60; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: var(--s6) var(--side) var(--s7); }
.hero h1 { font-family: var(--serif); font-weight: 900; font-size: var(--t-h1); line-height: 1; letter-spacing: 0; }
.hero-tag { display: block; margin-top: var(--s3); font-family: var(--sans, inherit); font-weight: 400; font-size: var(--t-cap, 13px); line-height: 1.6; letter-spacing: .2em; text-transform: uppercase; }
.hero-sub { margin-top: var(--s5); font-family: var(--serif); font-weight: 700; font-size: var(--t-lead); line-height: 2; letter-spacing: .06em; }

/* ---------- work ---------- */
.work { padding: 0 var(--side); }

/* ---------- 作品分類（Work 標題下方） ---------- */
.work-head { padding-bottom: var(--s6); }
.keep { word-break: keep-all; }   /* 只在標好的位置換行，不把一個詞拆兩半 */
.filter {
  margin-top: var(--s5);
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-block: var(--s1);            /* 焦點框不被裁掉 */
}
.filter::-webkit-scrollbar { display: none; }
.filter-in { display: flex; gap: var(--s4); width: max-content; margin-inline: auto; }  /* 放得下就置中，放不下就靠左可滑 */
.filter-btn {
  position: relative; flex: none; min-height: 44px;
  padding: var(--s2) var(--s1);
  font-family: var(--sans); font-weight: 400; font-size: 15px; line-height: 1.4;
  letter-spacing: .12em; white-space: nowrap;
  color: var(--gray);
  transition: color .3s var(--ease), opacity .2s;
}
.filter-btn::after {
  content: ""; position: absolute; left: var(--s1); right: calc(var(--s1) + .12em);
  bottom: 6px; height: 2px; background: var(--blue);
  transform: scaleX(0); transition: transform .45s var(--ease);
}
.filter-btn::before {   /* 沒選中的分類也有一條淡淡的底線：一看就知道每一個都能點 */
  content: ""; position: absolute; left: var(--s1); right: calc(var(--s1) + .12em);
  bottom: 6px; height: 1px; background: currentColor; opacity: .28;
  transition: opacity .3s var(--ease);
}
@media (hover: hover) { .filter-btn:hover::before { opacity: .6; } }
.filter-btn[aria-pressed="false"]:active::before { opacity: .6; }   /* 手機點下去時底線變深 */
.filter-btn[aria-pressed="true"]::before { opacity: 0; }
.filter-btn[aria-pressed="true"] { color: var(--blue); cursor: default; }
.filter-btn[aria-pressed="true"]::after { transform: scaleX(1); }
@media (hover: hover) { .filter-btn:hover { color: var(--blue); } }
.filter-btn[aria-pressed="false"]:active { opacity: .6; }

.work-list {
  display: flex; flex-direction: column; gap: var(--s8);
  overflow-anchor: none;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.work-list.is-out { opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); }
.work-list.is-pre { opacity: 0; transform: translateY(var(--s2)); transition: none; }

.p-head {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap);
  align-items: start; margin-bottom: var(--s5);
}
.p-title { font-family: var(--serif); font-weight: 700; font-size: var(--t-h3); line-height: 1.3; letter-spacing: .02em; }
.p-cap { margin-top: var(--s3); font-weight: 400; font-size: 12px; line-height: 1.618; letter-spacing: .12em; }
.p-desc, .p-role { font-weight: 400; font-size: 15px; line-height: 2.1; padding-top: var(--s1); color: var(--ink); }
.p-role-label { color: var(--blue); font-weight: 400; font-size: 12px; line-height: 1.618; letter-spacing: .16em; margin-bottom: var(--s2); }
.p-video { color: var(--blue); display: block; width: fit-content; margin-top: calc(var(--s3) - 10px); padding: 10px 0; font-weight: 400; text-decoration: underline; text-underline-offset: 6px; line-height: 1.618; }
.p-video:hover { opacity: .6; }

/* 三欄、每格同尺寸，長寬比為黃金比例 1.618 : 1 */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.cell { display: block; aspect-ratio: 1.618 / 1; overflow: hidden; background: var(--warm); cursor: zoom-in; }
.cell img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: var(--x, 50%) var(--y, 50%);
  transition: opacity .6s var(--ease), scale .9s var(--ease);
}
.js .cell img { opacity: 0; }
.js .cell img.loaded { opacity: 1; }
/* 作品進入畫面時，照片在框內輕輕「落定」；電腦版依閱讀順序錯開 */
@keyframes settle { from { scale: 1.04; } }
.js .project.in .cell img.loaded { animation: settle 1.2s var(--ease) calc(var(--i, 0) * 55ms) backwards; }
@media (min-width: 641px) {
  .cell:nth-child(2) img { --i: 1; } .cell:nth-child(3) img { --i: 2; } .cell:nth-child(4) img { --i: 3; }
  .cell:nth-child(5) img { --i: 4; } .cell:nth-child(6) img { --i: 5; }
}
@media (hover: hover) {
  .cell:hover img { scale: 1.04; }
}
/* 影片劇照：放大並對齊上緣，把畫面下方的字幕裁掉 */
.cell img.still { transform: scale(var(--z, 1.3)); transform-origin: var(--x, 50%) 0%; }

/* ---------- awards ---------- */
.p-award { margin-top: var(--s2); font-weight: 400; font-size: 12px; line-height: 1.618; letter-spacing: .1em; }
.p-award a { display: inline-block; padding: var(--s1) 0; text-decoration: underline; text-underline-offset: 4px; }
.p-award a:hover { opacity: .6; }
.awards { padding: var(--s8) var(--side) 0; }
.award-list { margin-top: var(--s7); border-top: 1px solid rgba(30, 43, 87, .2); }
.award {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap);
  align-items: start; padding: var(--s5) 0; border-bottom: 1px solid rgba(30, 43, 87, .2);
}
.award-name { font-family: var(--serif); font-weight: 700; font-size: 24px; line-height: 1.5; letter-spacing: .02em; }
.award-result b { display: block; font-weight: 400; font-size: var(--t-cap); letter-spacing: .16em; text-transform: uppercase; line-height: 1.618; margin: var(--s1) 0 var(--s2); }
.award-result p, .award-work p { color: var(--ink); font-weight: 400; font-size: 15px; line-height: 2.1; }
.award-work { padding-top: var(--s1); }

/* ---------- section 共用 ---------- */
.block { margin-top: var(--s8); padding: var(--s7) var(--side); }
/* 區塊底色交替：淺灰（作品）→ 藍（Service）→ 米灰（About）→ 淺灰（Contact） */
#service { background: var(--blue); color: var(--on-blue); }
#service :focus-visible { outline-color: var(--on-blue); }
#about { margin-top: 0; background: var(--warm); }
.sec-title { text-align: center; font-family: var(--serif); font-weight: 900; font-size: var(--t-h2); line-height: 1.05; letter-spacing: 0; }
.sec-sub { text-align: center; margin-top: var(--s4); font-family: var(--serif); font-weight: 700; font-size: 18px; line-height: 2; letter-spacing: .06em; }

/* ---------- service ---------- */
.text-grid { margin-top: var(--s7); row-gap: var(--s6); }
.item h3 { font-family: var(--serif); font-weight: 700; font-size: 24px; line-height: 1.5; letter-spacing: .04em; }
.item p { margin-top: var(--s3); font-weight: 400; font-size: 15px; line-height: 2.1; max-width: 26em; }

/* ---------- about：左 38.2% ／ 右 61.8% ---------- */
.about-grid {
  max-width: 1120px; margin: var(--s7) auto 0;
  display: grid; grid-template-columns: minmax(0, 0.382fr) minmax(0, 0.618fr); gap: var(--s6);
  align-items: start;
}
.about-side { position: static; }
@media (min-width: 1001px) and (min-height: 900px) {
  .about-side { position: sticky; top: var(--s6); }
}
.portrait { margin: 0 0 var(--s4); width: var(--s8); max-width: 100%; aspect-ratio: 4 / 5; background: #1b2443; overflow: hidden; }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .6s var(--ease); }
.js .portrait img { opacity: 0; }
.js .portrait img.loaded { opacity: 1; }
.about-name { font-family: var(--serif); font-weight: 900; font-size: var(--t-h3); line-height: 1.2; }
.about-role { margin-top: var(--s1); font-size: var(--t-cap); letter-spacing: .12em; }
.facts { margin-top: var(--s5); }
.facts > div { display: flex; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid rgba(30, 43, 87, .2); font-weight: 400; font-size: 14px; line-height: 1.8; color: var(--ink); }
.facts > div:last-child { border-bottom: 1px solid rgba(30, 43, 87, .2); }
.facts dt { width: 4.5em; flex: none; color: var(--blue); }

.essay h3 { font-family: var(--serif); font-weight: 700; font-size: var(--s4); line-height: 1.618; letter-spacing: .04em; margin-bottom: var(--s5); }
.essay p { color: var(--ink); font-weight: 400; font-size: var(--t-body); line-height: 2.2; max-width: 34em; }
.essay p + p { margin-top: var(--s4); }
.essay .quote { color: var(--blue); font-family: var(--serif); font-weight: 700; font-size: 18px; }
.rules { margin: var(--s5) 0; max-width: 34em; }
.rules li { display: flex; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid rgba(30, 43, 87, .2); color: var(--ink); font-weight: 400; line-height: 2; }
.rules li:last-child { border-bottom: 1px solid rgba(30, 43, 87, .2); }
.rules b { color: var(--blue); font-family: var(--serif); font-weight: 700; flex: none; }
.essay .ps { margin-top: var(--s5); font-size: 14px; }

/* 米灰底上的藍色小字加深一階，維持易讀的對比 */
#about .about-role, #about .facts dt, #about .essay .quote, #about .rules b { color: #2448c4; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- contact ---------- */
.contact { padding: var(--s7) var(--side) 0; color: var(--gray); }
.info {
  max-width: 1120px; margin: 0 auto var(--s7);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap;
  font-size: 16px;
}
.info a { display: inline-block; padding: var(--s2) 0; }
.info a:hover { opacity: .6; }
.social { display: flex; align-items: center; gap: var(--s1); }
.social a, .social span { display: grid; place-items: center; width: 44px; height: 48px; color: #000; }
.social svg { width: 20px; height: 20px; }
.social a:hover { opacity: .6; }
.social span { opacity: .3; }

.form { max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; color: var(--dark); }
.form label { font-family: var(--serif); font-weight: 700; font-size: 15px; line-height: 1.618; margin-bottom: var(--s2); }
.form label b { color: var(--red); font-weight: 700; }
.form input, .form textarea {
  width: 100%; font-family: var(--serif); font-weight: 400; font-size: 16px; color: var(--dark); letter-spacing: .02em;
  background: #fff; border: 1px solid rgba(30, 43, 87, .22); border-radius: 4px; padding: var(--s2); margin-bottom: var(--s4);
}
.form input { height: 55px; }
.form textarea { height: 178px; line-height: 1.8; resize: vertical; }
.form input::placeholder, .form textarea::placeholder { color: #767676; }
.form input, .form textarea { transition: border-color .2s var(--ease); }
.form input:focus, .form textarea:focus { border-color: var(--ink); }
.form label { transition: color .2s var(--ease); }
.form label:has(+ input:focus), .form label:has(+ textarea:focus) { color: var(--blue); }
.form .invalid, .form .invalid:focus { border-color: var(--red); }
.form-error { font-weight: 400; font-size: 14px; color: var(--red); margin-bottom: var(--s3); transition: opacity .3s var(--ease), translate .3s var(--ease); }
@starting-style { .form-error { opacity: 0; translate: 0 var(--s1); } }
.form-error[hidden] { display: none; }
[hidden] { display: none !important; }   /* 篩選時隱藏的作品，不會被其他 display 規則蓋過 */
.send-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin-top: var(--s3); }
.send {
  display: flex; align-items: center; justify-content: center; min-height: 55px; padding: var(--s2);
  border: 1px solid var(--dark); border-radius: 4px; color: var(--dark); text-align: center;
  font-family: var(--serif); font-weight: 700; font-size: 16px; line-height: 1.4; transition: opacity .2s, background .2s;
}
.send:hover { background: rgba(51, 51, 51, .06); }
.send-primary { background: var(--dark); color: #fff; }
.send-primary:hover { background: var(--dark); opacity: .85; }
.send:active { opacity: .7; }
.form-hint { margin-top: var(--s3); font-weight: 400; font-size: 14px; line-height: 1.9; color: var(--gray); }
.form-alt { margin-top: var(--s2); font-weight: 400; font-size: 14px; line-height: 2; color: var(--gray); }
.form-alt b { font-weight: 400; color: var(--dark); user-select: all; }
.form-alt a { color: var(--dark); border-bottom: 1px solid currentColor; }
.form-alt a:hover { opacity: .6; }
.copy-mail {
  margin: 0 2px; padding: 6px var(--s2); min-height: 34px; border: 1px solid rgba(51, 51, 51, .35); border-radius: 999px;
  font-size: 12px; line-height: 1.6; color: var(--dark);
}
.copy-mail:hover { border-color: var(--dark); }
.copy-mail.copied { background: var(--dark); color: #fff; border-color: var(--dark); }
.copy-mail.copied span { display: none; }
.copy-mail { transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease); }
.copy-mail.copied::after { content: "✓"; animation: fade-in .2s var(--ease); }
@keyframes fade-in { from { opacity: 0; } }

/* ---------- footer ---------- */
.site-footer { padding: var(--s7) var(--side); text-align: center; font-size: 14px; color: var(--gray); }

@supports not (aspect-ratio: 1 / 1) {
  .cell { height: 0; padding-top: 61.8%; position: relative; }
  .cell img { position: absolute; inset: 0; }
}
.grid-count { display: none; }

/* ---------- 手機版聯絡按鈕（只在手機顯示） ---------- */
.fab { display: none; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(0, 0, 0, .92); padding: var(--s6) var(--s7);
  opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility .35s;
  overscroll-behavior: contain; touch-action: pinch-zoom;
}
.lightbox.open { opacity: 1; visibility: visible; transition: opacity .35s var(--ease), visibility 0s; }   /* 打開時立刻可聚焦 */
.lightbox { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.lightbox img { width: 100%; height: 100%; object-fit: contain; }
.lb-video { display: none; }
.lightbox.is-video .lb-video {
  display: block; place-self: center;
  width: min(100%, calc((100vh - 2 * var(--s6)) * 16 / 9)); aspect-ratio: 16 / 9; background: #000;
}
.lb-video iframe { display: block; width: 100%; height: 100%; border: 0; }
@media (max-height: 500px) {   /* 手機橫向 */
  .lightbox { padding: var(--s4) var(--s6); }
  .lb-count { bottom: var(--s1); }
}
.lightbox img:not([src]) { display: none; }
.lb-close { position: absolute; top: var(--s2); right: var(--s3); z-index: 2; width: 44px; height: 44px; color: #fff; font-size: 34px; line-height: 1; }
.lightbox img {
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
  transition: opacity .25s var(--ease), transform .4s var(--ease);
  will-change: transform, opacity;
}
.lightbox img.is-loading { opacity: 0; }
.lightbox img.dragging { transition: none; }
.lightbox:not(.open) img { transform: scale(.97); }
.lb-nav {
  display: none; position: absolute; top: 50%; z-index: 2; transform: translateY(-50%);
  width: var(--s6); height: var(--s7); place-items: center;
  color: #fff; font-family: var(--serif); font-size: var(--s5); line-height: 1; opacity: .7; transition: opacity .2s;
}
.lb-nav:hover, .lb-nav:focus-visible { opacity: 1; }
.lb-prev { left: 0; }
.lb-next { right: 0; }
.lightbox.is-gallery .lb-nav { display: grid; }
.lb-count {
  position: absolute; left: 0; right: 0; bottom: var(--s4); text-align: center;
  color: rgba(255, 255, 255, .75); font-size: 13px; letter-spacing: .2em; font-variant-numeric: tabular-nums;
}
.lightbox:not(.is-gallery) .lb-count { display: none; }

/* ---------- reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(var(--s3)); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
/* 區塊標題：從一條看不見的線下方升起（遮罩與位移同速，線保持不動） */
.js .sec-title.reveal {
  opacity: 1; transform: translateY(100%); clip-path: inset(-.2em -.1em 100% -.1em);
  transition: transform .9s var(--ease), clip-path .9s var(--ease);
}
.js .sec-title.reveal.in { transform: none; clip-path: inset(-.2em -.1em -.2em -.1em); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .sec-title.reveal { opacity: 1; transform: none; clip-path: none; transition: none; }
  .js .cell img { animation: none !important; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- responsive：每縮一段，間距各降一級 ---------- */
@media (max-width: 1000px) {
  .work-list { gap: var(--s7); }
  .work-head { padding-bottom: var(--s5); }
  .filter { margin-top: var(--s4); }
  .filter-in { gap: var(--s3); }
  :root { --side: var(--s4); --gap: var(--s4); --t-h1: 89px; --t-h2: 55px; --t-h3: 30px; }
  .hero { padding: var(--s6) var(--side) var(--s7); }
  .p-head { grid-template-columns: 1fr; gap: var(--s3); margin-bottom: var(--s4); }
  .p-desc, .p-role { max-width: 34em; }
  .text-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: var(--s6); }
  .block { margin-top: var(--s7); padding-block: var(--s6); }
  .awards { padding-top: var(--s7); }
  .award-list { margin-top: var(--s6); }
  .award { grid-template-columns: 1fr; gap: var(--s2); padding: var(--s4) 0; }
  .contact { padding-top: var(--s6); }
  .about-grid { grid-template-columns: 1fr; gap: var(--s5); margin-top: var(--s6); max-width: 34em; }
  .info { margin-bottom: var(--s6); }
}
/* ---------- 手機版：間距全部走黃金比例級距 13 · 21 · 34 · 55 · 89 · 144 ---------- */
@media (max-width: 640px) {
  :root { --side: var(--s4); --gap: var(--s3); --t-h1: 89px; --t-h2: 55px; --t-h3: 30px; --t-lead: 17px; }

  /* 頁首：Logo ＋ Menu，選單展開成全螢幕 */
  .site-header { height: var(--s6); }
  .site-header.scrolled { height: var(--s5); }
  body { padding-top: var(--s6); }
  .logo { width: 40px; height: 40px; }
  .menu-btn { display: block; min-height: 44px; }
  .header-in { gap: var(--s2); }
  .lang-switch--m { display: flex; margin-left: auto; }
  .lang-switch--m a { padding: var(--s2) 6px; font-size: 12px; letter-spacing: .04em; }
  .nav .lang-switch { display: none; }
  .nav {
    position: fixed; inset: 0; z-index: 55;
    flex-direction: column; align-items: flex-start; justify-content: center; gap: var(--s3);
    padding: var(--s6) var(--side); background: var(--bg);
    opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s;
  }
  .menu-open .nav { opacity: 1; visibility: visible; transition: opacity .3s ease, visibility 0s; }
  .nav a { opacity: 0; transform: translateY(var(--s2)); transition: opacity .5s var(--ease), transform .5s var(--ease); }
  .menu-open .nav a { opacity: 1; transform: none; }
  .menu-open .nav > :nth-child(2) { transition-delay: .04s; }
  .menu-open .nav > :nth-child(3) { transition-delay: .08s; }
  .menu-open .nav > :nth-child(4) { transition-delay: .12s; }
  .menu-open .nav > :nth-child(5) { transition-delay: .16s; }
  .menu-open .nav > :nth-child(6) { transition-delay: .2s; }
  .nav a { font-family: var(--serif); font-weight: 700; font-size: var(--s4); line-height: 1.3; padding: var(--s1) 0; }

  /* 首頁 */
  .hero { padding: var(--s6) var(--side) var(--s7); }
  .hero-sub { margin-top: var(--s4); }
  .hero-sub br { display: none; }

  /* 作品：標題區每段相隔 34，照片前留 55，案子之間 144 */
  .p-head { gap: var(--s4); margin-bottom: var(--s5); }
  .p-cap { margin-top: var(--s2); font-size: 13px; }
  .p-role-label, .p-award { font-size: 13px; }

  /* 手機：分類一排可左右滑，兩側有內容時淡出提示 */
  .filter { margin-inline: calc(-1 * var(--side)); }
  .filter-in { gap: var(--s1); padding-inline: calc(var(--side) - var(--s1)); }
  .filter-btn { font-size: 14px; letter-spacing: .08em; }
  .filter-btn::after, .filter-btn::before { right: calc(var(--s1) + .08em); }
  .filter.fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - var(--s4)), transparent); mask-image: linear-gradient(to right, #000 calc(100% - var(--s4)), transparent); }
  .filter.fade-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - var(--s4)), transparent); mask-image: linear-gradient(to left, #000 calc(100% - var(--s4)), transparent); }
  .filter.fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--s4), #000 calc(100% - var(--s4)), transparent); mask-image: linear-gradient(to right, transparent, #000 var(--s4), #000 calc(100% - var(--s4)), transparent); }

  /* 手機：照片放在說明之後、負責工作之前，先看到畫面 */
  .project { display: flex; flex-direction: column; }
  .project .p-head { display: contents; }
  .project .p-head > div:first-child { order: 0; }
  .project .p-desc { order: 1; margin-top: var(--s4); }
  .project .grid { order: 2; margin-top: var(--s5); }
  .project .grid-count { order: 3; display: block; margin-top: var(--s2); text-align: right; font-size: 13px; letter-spacing: .2em; font-variant-numeric: tabular-nums; }
  .project .p-role { order: 4; margin-top: var(--s5); }

  /* 作品照片：一張一張橫向滑動，露出下一張的一角 */
  .project .grid {
    display: flex; gap: var(--s2);
    overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    margin-inline: calc(-1 * var(--side)); padding-inline: var(--side); scroll-padding-inline: var(--side);
    scrollbar-width: none;
  }
  .project .grid::-webkit-scrollbar { display: none; }
  .project .grid { overscroll-behavior-x: contain; }
  .project .cell { flex: 0 0 calc(100% - var(--s4)); scroll-snap-align: start; scroll-snap-stop: always; }  /* 下一張露出 55px */

  /* 各區塊 */
  .awards { padding-top: var(--s7); }
  .award-list { margin-top: var(--s6); }
  .award { gap: var(--s3); padding: var(--s5) 0; }
  .block { margin-top: var(--s7); padding-block: var(--s7); }
  .text-grid { grid-template-columns: 1fr; margin-top: var(--s6); row-gap: var(--s6); }
  .item p { margin-top: var(--s2); }
  .about-grid { gap: var(--s6); }
  .facts { margin-top: var(--s5); }
  .essay h3 { font-size: 26px; line-height: 1.5; margin-bottom: var(--s5); text-wrap: balance; }
  .essay h3 br { display: none; }

  /* 聯絡 */
  .contact { padding-top: var(--s6); }
  .info { flex-direction: column; gap: 0; margin-bottom: var(--s5); }
  .form label { margin-bottom: var(--s2); }
  .form input, .form textarea { margin-bottom: var(--s4); }
  .send-row { grid-template-columns: 1fr; gap: var(--s2); margin-top: var(--s2); }
  .site-footer { padding: var(--s6) var(--side); }

  /* 右下角圓形聯絡按鈕：55px，貼在右側留白裡；跟著畫面，但只在需要時出現 */
  .fab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    position: fixed; z-index: 40;
    right: calc(var(--s2) + env(safe-area-inset-right, 0px));
    bottom: calc(var(--s3) + env(safe-area-inset-bottom, 0px));
    width: var(--s5); height: var(--s5); border-radius: 50%;
    background: var(--blue); color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 var(--s1) var(--s3) rgba(30, 43, 87, .28);   /* 白色細框：在藍色區塊上也看得清楚 */
    opacity: 0; visibility: hidden; transform: translateY(var(--s3)) scale(.85); pointer-events: none;
    transition: opacity .4s var(--ease), transform .4s var(--ease), visibility .4s;
  }
  .fab.show { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition: opacity .4s var(--ease), transform .4s var(--ease), visibility 0s; }
  .fab.show:active { transform: scale(.92); }
  .fab svg { width: 21px; height: 21px; }
  .fab-text { font-size: 11px; line-height: 1; letter-spacing: .08em; }
  .lb-open .fab { visibility: hidden; }
  .menu-open .fab { opacity: 0; visibility: hidden; pointer-events: none; }
  .lightbox { padding: var(--s6) 0; }
  .lb-nav { width: var(--s5); height: var(--s6); font-size: var(--s4); }
}
@media (max-width: 360px) {
  :root { --side: var(--s3); }
}

/* ---------- FAQ ---------- */
#faq { margin-top: 0; }
.faq-list { max-width: 820px; margin: var(--s6) auto 0; }
.faq-item { padding: var(--s4) 0; border-top: 1px solid rgba(30, 43, 87, .2); }
.faq-item:last-child { border-bottom: 1px solid rgba(30, 43, 87, .2); }
.faq-item h3 { font-family: var(--serif); font-weight: 700; font-size: 19px; line-height: 1.6; letter-spacing: .04em; color: var(--blue); text-wrap: balance; }
.faq-item p { margin-top: var(--s2); color: var(--ink); font-weight: 400; font-size: 15px; line-height: 2.1; }
html[data-lang="en"] .faq-item p { hyphens: manual; text-wrap: pretty; }
