/* =========================================================
   心映好事 SINGINGS HOUSE — style.css
   ========================================================= */

:root {
  --paper: #EFEEE9;
  --paper-2: #E7E5DE;
  --ink: #333333;
  --ink-soft: #6E6B64;
  --ink-faint: #A9A69D;
  --line: #D2CFC6;
  --accent: #E986A2;        /* 裝飾用（網格、標籤） */
  --accent-ink: #C4677F;    /* 文字用（深一階，確保可讀性） */

  --max: 1320px;
  --gutter: 40px;

  /* 中文：Noto Sans TC ／ 英文：Archivo（中文字自動 fallback 回黑體） */
  --f-display: "Noto Sans TC", -apple-system, "Helvetica Neue", sans-serif;
  --f-latin: "Archivo", "Noto Sans TC", sans-serif;
  --f-body: "Noto Sans TC", -apple-system, "Helvetica Neue", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* 背景互動網格：固定於視窗，位於內容之下 */
#kgrid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent var(--kg-start, 0px), #000 var(--kg-end, 0px));
          mask-image: linear-gradient(to bottom, transparent var(--kg-start, 0px), #000 var(--kg-end, 0px));
}
body > *:not(#kgrid):not(.nav) { position: relative; z-index: 1; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}

img { display: block; width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 4px;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.label {
  font-family: var(--f-latin);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 400;
}

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(239, 238, 233, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-in {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 74px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.nav-logo { grid-column: 2; justify-self: center; display: flex; align-items: center; gap: 12px; }
.nav-logo img { width: auto; height: 30px; }

/* ---------- YENnext 字標 ----------
   不是圖檔，是鎖死字軸的活字：任何螢幕都銳利，而且跟內文
   共用同一支 Archivo，字標等於字級系統最上面那一階。
   要改比例改這兩組 font-variation-settings 就好。      */
.wm {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--f-latin);
  font-size: 27px;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}
.wm > span { font-size: 1em; }
.wm-a { font-variation-settings: "wght" 620, "wdth" 88; }
.wm-b { font-variation-settings: "wght" 330, "wdth" 108; }

.nav-logo.is-text { gap: 0; }
.footer-name { margin: 0; }
.footer .wm { font-size: 22px; color: var(--ink-soft); }
.nav-links { grid-column: 3; justify-self: end; display: flex; gap: 34px; }
.nav-links a {
  font-family: var(--f-latin);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color .25s;
}
.nav-links a:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero {
  padding: 40px 0 120px;
  position: relative;
}
.hero h1 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(28px, 4.2vw, 54px);
  line-height: 1.6;
  letter-spacing: 0.02em;
  max-width: 19em;
  margin: 28px 0 34px;
}
.hero p {
  max-width: 40em;
  color: var(--ink-soft);
  font-size: 16px;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 46px;
}
.hero-meta span,
.hero-meta button {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 7px 18px;
}
.hero-meta button {
  font-family: var(--f-body);
  background: transparent;
  cursor: pointer;
  transition: border-color .25s, color .25s, background .25s;
}
.hero-meta button:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* 主標重點標示：粉色螢光筆效果，載入時由左往右刷過 */
.hero h1 .hl {
  position: relative;
  font-style: normal;
  display: inline-block;
}
.hero h1 .hl i {
  position: relative;
  z-index: 1;
  font-style: normal;
}
.hero h1 .hl::before {
  content: "";
  position: absolute;
  left: -0.06em;
  right: -0.06em;
  bottom: 0.06em;
  height: 0.42em;
  background: var(--accent);
  opacity: 0.42;
  transform: scaleX(0);
  transform-origin: left center;
  animation: hl-sweep 1s cubic-bezier(.2,.7,.2,1) .55s forwards;
}
@keyframes hl-sweep { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .hero h1 .hl::before { animation: none; transform: scaleX(1); }
}

/* ---------- section frame ---------- */
.section { padding: 100px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 56px;
}
.section-head h2 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.06em;
}

/* ---------- work：篩選列與分組 ---------- */
.filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -26px 0 46px;
}
.f-btn {
  font-family: var(--f-body);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 8px 20px;
  cursor: pointer;
  transition: all .25s;
}
.f-btn:hover { border-color: var(--ink-faint); color: var(--ink); }
.f-btn.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.cat-group + .cat-group { margin-top: 72px; }
.cat-title {
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  padding-bottom: 14px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

/* ---------- 便當式類別入口 ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
a.bento-tile { text-decoration: none; color: inherit; }
.bento-tile {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  border: 0;
  padding: 0;
  overflow: hidden;
  background: var(--paper-2);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
/* hero 不設比例，改由同列的方格決定高度，才能精準對齊 */
.bento-tile.is-hero {
  grid-column: span 2;
  aspect-ratio: auto;
}
.bento-img {
  position: absolute;
  inset: 0;
  transition: opacity 1.1s ease;
}
.bento-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s ease;
}
.bento-img2 { opacity: 0; }
.bento-tile.swap .bento-img { opacity: 0; }
.bento-tile.swap .bento-img2 { opacity: 1; }
.bento-tile:hover .bento-img img { transform: scale(1.04); }

.bento-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(28,27,25,.55), rgba(28,27,25,.05) 55%);
  transition: background .4s;
}
.bento-tile:hover::after { background: linear-gradient(to top, rgba(28,27,25,.62), rgba(28,27,25,.12) 60%); }

.bento-meta {
  position: absolute;
  left: 26px;
  bottom: 24px;
  z-index: 2;
  color: #fff;
}
.bento-name {
  display: block;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.bento-tile.is-hero .bento-name { font-size: 28px; }
.bento-dots {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}
.bento-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.42);
  transition: background .4s, transform .4s;
}
.bento-dots i.is-on {
  background: #fff;
  transform: scale(1.25);
}

.card-img video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.proj-flow video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 有聲影片：完整顯示、不裁切，留深色底避免邊緣露白 */
.proj-flow video[controls] { object-fit: contain; background: #16150F; }
.b-hero video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- work grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 54px 34px;
}
.card { display: block; }
.card-img {
  position: relative;
  overflow: hidden;
  background: var(--paper-2);
  aspect-ratio: 4 / 3;
}
.card-img img {
  height: 100%;
  object-fit: cover;
  transition: transform .8s ease;
}
.card:hover .card-img img { transform: scale(1.035); }
.card-body { padding-top: 18px; }
.card-body h3 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  transition: color .25s;
}
.card:hover .card-body h3 { color: var(--accent-ink); }
.card-tags {
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}
.card.is-own .card-img::after {
  content: "自有品牌";
  position: absolute;
  top: 14px; left: 14px;
  background: var(--accent-ink);
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.14em;
  padding: 5px 12px;
}

/* ---------- other works ---------- */
.otherworks {
  margin-top: 74px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
}
.otherworks p { color: var(--ink-soft); max-width: 52em; }

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 80px;
}
/* 主理人 */
.profile {
  display: flex;
  align-items: center;
  gap: 22px;
  padding-bottom: 26px;
  margin-bottom: 4px;
}
.profile img {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--paper-2);
}
.profile-meta strong {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.profile-meta strong span {
  font-family: var(--f-latin);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}
.profile-meta p { margin-top: 6px; font-size: 13px; color: var(--ink-soft); }
.cv-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--accent-ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
  transition: border-color .3s;
}
.cv-link:hover { border-color: var(--accent-ink); }

.about-text p { margin-bottom: 26px; max-width: 34em; }
.about-text p:first-child { color: var(--ink); }
.about-text p:not(:last-child) { margin-bottom: 26px; }
.about-text p:not(:first-child) { color: var(--ink-soft); }

.orbit { position: relative; }
/* 數據列 */
.stats { margin-top: 54px; }
/* 數據列上方的歸屬說明：講清楚這些數字算的是誰 */
.stats-note {
  margin: 0 0 12px;
  font-family: var(--f-body);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 18px;
  border-top: 1px solid var(--line);
}
.stat {
  padding: 30px 0 6px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1);
}
.stat.in { opacity: 1; transform: none; }
.stat strong {
  display: block;
  font-family: var(--f-latin);
  font-weight: 500;
  font-size: clamp(40px, 5.2vw, 64px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin-bottom: 10px;
}
.stat span {
  display: block;
  position: relative;
  padding-top: 10px;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.1em;
}
.stat span::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 26px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .8s cubic-bezier(.2,.7,.2,1) .35s;
}
.stat.in span::before { transform: scaleX(1); }

/* 時間軸 */
.orbit-list { display: grid; gap: 2px; }
.orbit-item {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  cursor: default;
  transition: border-color .3s;
}
.orbit-item:hover, .orbit-item:focus-visible { border-color: var(--accent); outline: none; }
.orbit-row {
  display: grid;
  grid-template-columns: 118px 1fr auto;
  gap: 18px;
  align-items: baseline;
}
.orbit-note {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  font-size: 13px;
  color: var(--ink-soft);
  padding-left: 136px;
  transition: max-height .45s ease, opacity .35s ease, margin .45s ease;
}
.orbit-item:hover .orbit-note,
.orbit-item:focus-visible .orbit-note { max-height: 90px; opacity: 1; margin-top: 8px; }
.orbit-item strong {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.03em;
}
.orbit-item em {
  font-style: normal;
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
}
.orbit-item.is-now strong { color: var(--accent-ink); }

/* ---------- clients ---------- */
.clients {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 40px;
  align-items: center;
}
.clients span {
  font-family: var(--f-latin);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
/* 品牌跑馬燈 */
.clients-marquee { display: grid; gap: 10px; }
.mq-row {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.mq-track {
  display: flex;
  width: max-content;
  gap: 46px;
  animation: mq 64s linear infinite;
}
.mq-track.rev { animation-duration: 78s; animation-direction: reverse; }
.mq-track span {
  font-family: var(--f-latin);
  font-size: 16px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  white-space: nowrap;
  padding: 6px 0;
}
.clients-marquee:hover .mq-track { animation-play-state: paused; }
@keyframes mq { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .mq-track { animation-duration: 140s; }
}

.attribution {
  margin-top: 34px;
  font-size: 12px;
  line-height: 1.9;
  color: var(--ink-faint);
  max-width: 46em;
}

/* ---------- contact ---------- */
.contact { padding: 110px 0 120px; border-top: 1px solid var(--line); }
.contact h2 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(22px, 2.7vw, 34px);
  line-height: 1.6;
  letter-spacing: 0.02em;
  margin: 22px 0 34px;
}
.mail {
  font-family: var(--f-latin);
  font-weight: 500;
  font-size: clamp(19px, 2.6vw, 32px);
  letter-spacing: 0.02em;
  color: var(--accent-ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  transition: border-color .3s;
}
.mail:hover { border-color: var(--accent-ink); }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
}
.footer-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.footer img { width: 150px; opacity: .75; }
.footer small { font-family: var(--f-latin); font-size: 11px; letter-spacing: .12em; color: var(--ink-faint); }

/* =========================================================
   brand detail page
   ========================================================= */
.b-hero {
  margin-top: 74px;
  aspect-ratio: 21 / 9;
  background: var(--paper-2);
  overflow: hidden;
}
.b-hero img { height: 100%; object-fit: cover; }

/* 非橫式的主視覺（方形 GIF 等）：完整顯示、置中，不硬裁成 21:9 */
.b-hero.is-contain {
  aspect-ratio: auto;
  background: transparent;
  display: flex;
  justify-content: center;
  padding: 40px var(--gutter) 0;
}
.b-hero.is-contain img,
.b-hero.is-contain video {
  width: auto;
  height: auto;
  max-width: min(680px, 100%);
  max-height: 62vh;
  object-fit: contain;
}

.b-head { padding: 66px 0 76px; text-align: center; }
.b-head h1 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(26px, 3.6vw, 44px);
  letter-spacing: 0.05em;
  margin: 16px 0 10px;
}
.b-head .en {
  font-family: var(--f-latin);
  font-size: 13px;
  letter-spacing: .18em;
  color: var(--ink-faint);
}
.b-intro {
  max-width: 40em;
  margin: 34px auto 0;
  color: var(--ink-soft);
}
.b-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 32px;
}
.b-tags span {
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 6px 15px;
  border-radius: 100px;
}

.proj { padding-bottom: 96px; }
.proj-head {
  max-width: 40em;
  margin: 0 auto 44px;
  text-align: center;
}
.proj-head h2 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 21px;
  letter-spacing: .05em;
  margin: 14px 0 12px;
}
.proj-head p { color: var(--ink-soft); }
.proj-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 26px;
}
.proj-flow figure {
  flex: 1 1 100%;              /* 預設整列 */
  background: var(--paper-2);
  overflow: hidden;
  /* 預設以 4:3 呈現；載入後由 JS 依實際比例調整 */
  aspect-ratio: 4 / 3;
}
.proj-flow img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 方形或直式：置中、不放大超過原始尺寸，避免糊掉 */
.proj-flow figure.is-tall {
  aspect-ratio: auto;
  background: transparent;
  max-width: var(--nat-w, 760px);
  margin: 0 auto;
}
.proj-flow figure.is-tall img { height: auto; object-fit: contain; }

/* 指定欄數：在 data.js 的子案加上 cols: 3 即可。
   欄數越多、顯示越小，在 Retina 螢幕上越銳利。 */
.proj-flow[style*="--cols"] figure {
  flex: 0 0 auto !important;
  width: calc((100% - (var(--cols) - 1) * 26px) / var(--cols)) !important;
  max-width: none !important;
  aspect-ratio: auto !important;
  background: transparent;
  margin: 0;
}
/* 關鍵：顯示寬度不超過原圖的一半（= Retina 上 1:1），
   所以圖片永遠不會被放大，也就不會糊。圖比欄窄時置中。 */
.proj-flow[style*="--cols"] figure img,
.proj-flow[style*="--cols"] figure video {
  width: 100%;
  max-width: calc(var(--nat-w, 4000px) / 2);
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* 小尺寸素材：順著版面排下去、自然折行，不鎖死欄數。
   每張依原始寬度取得起始寬度，再撐滿剩餘空間，
   但放大不超過原尺寸兩倍，避免 GIF 或小圖糊掉。
     300px 以下 → 起始寬 300（一列約三張）
     300–600px  → 起始寬 420（一列約兩張）               */
.proj-flow figure.is-small,
.proj-flow figure.is-mini {
  flex: 0 0 auto;
  aspect-ratio: auto;
  background: transparent;
  margin: 0;
}
/* 寬度取「原尺寸兩倍」與「欄寬」的較小值：
   不會糊、不會超出欄位，落單那張也維持同樣大小 */
.proj-flow figure.is-mini {
  width: min(calc(var(--nat-w, 300px) * 2), calc(33.333% - 17.34px));
}
/* 方形／直式：兩欄。圖片本身大於欄寬時直接縮小，不會有上限問題 */
.proj-flow figure.is-small {
  width: calc(50% - 13px);
  max-width: calc(var(--nat-w, 600px) * 2);
}

.proj-flow figure.is-small img,
.proj-flow figure.is-mini img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.b-also {
  padding: 30px 0 0;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 14px;
}

.b-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 40px 0 96px;
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
.b-nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 14px 0;
  color: var(--ink-soft);
  transition: color .25s;
}
.b-nav-item.is-next { justify-content: flex-end; text-align: right; }
.b-nav-item.is-prev .b-nav-arrow { order: -1; }

/* 桌機排序：上一個（左）｜回到列表（中）｜下一個（右）
   HTML 為了手機堆疊採 prev→next→back，這裡用 order 調回來 */
.b-nav-item.is-prev { order: 1; justify-self: start; }
.b-nav-back         { order: 2; justify-self: center; text-align: center; }
.b-nav-item.is-next { order: 3; justify-self: end; }

/* 縮圖：讓讀者先看到下一件長什麼樣 */
.b-nav-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  overflow: hidden;
  background: var(--paper-2);
  border-radius: 2px;
}
.b-nav-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.b-nav-item:hover .b-nav-thumb img { transform: scale(1.08); }
.b-nav-item:hover { color: var(--accent-ink); }
.b-nav-arrow {
  flex: 0 0 auto;
  font-family: var(--f-latin);
  font-size: 15px;
  transition: transform .3s cubic-bezier(.2,.7,.2,1);
}
.b-nav-item.is-prev:hover .b-nav-arrow { transform: translateX(-4px); }
.b-nav-item.is-next:hover .b-nav-arrow { transform: translateX(4px); }
.b-nav-arrow { color: var(--ink-faint); }
.b-nav-item:hover .b-nav-arrow { color: var(--accent-ink); }
.b-nav-text { min-width: 0; }
.b-nav-label {
  display: block;
  font-family: var(--f-latin);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 3px;
}
.b-nav-name {
  display: block;
  font-size: 14px;
  letter-spacing: .04em;
  color: var(--ink);
  /* 依可用寬度自動截斷，不必設固定字數 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.b-nav-back {
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--ink-soft);
  white-space: nowrap;
  padding: 14px 0;
  transition: color .25s;
}
.b-nav-back:hover { color: var(--accent-ink); }

/* ---------- pressure headline ---------- */
.pressure-band {
  padding: 140px 0 0;
}
#pressure {
  position: relative;
  width: 100%;
  overflow: visible;
  user-select: none;
}
.pressure-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  margin: 0;
  line-height: 1;
  white-space: nowrap;
  transform-origin: center top;
  font-family: var(--f-body);
  font-weight: 100;
  color: var(--ink);
  text-transform: uppercase;
  font-variation-settings: "wght" 300, "wdth" 100, "slnt" 0;
}
.pressure-title span {
  display: inline-block;
  font-variation-settings: "wght" 200, "wdth" 70;
  will-change: font-variation-settings;
}

/* ---------- 視差：圖片比容器慢一點，產生深度 ---------- */
.card-img img,
.bento-img img,
.b-hero img,
.proj-flow img {
  will-change: transform;
}
.px-wrap { overflow: hidden; }

/* ---------- reveal ---------- */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform .9s ease; }
.rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  .stat { opacity: 1; transform: none; transition: none; }
  .stat span::before { transform: scaleX(1); transition: none; }
  .card-img img { transition: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento-tile.is-hero { grid-column: span 2; aspect-ratio: 2 / 1; }
  .about-grid { grid-template-columns: 1fr; gap: 54px; }
}
@media (max-width: 680px) {
  :root { --gutter: 22px; }
  .nav-in { grid-template-columns: 1fr; justify-items: center; height: auto; padding: 16px var(--gutter); gap: 10px; }
  .nav-logo { grid-column: 1; }
  .nav-links { grid-column: 1; justify-self: center; gap: 20px; }
  .pressure-band { padding-top: 104px; }
  .nav-links a { font-size: 11px; letter-spacing: .12em; }
  .hero { padding: 26px 0 80px; }
  .section { padding: 70px 0; }
  .grid { grid-template-columns: 1fr; gap: 42px; }
  .bento { grid-template-columns: 1fr; gap: 14px; }
  .bento-tile, .bento-tile.is-hero { grid-column: span 1; aspect-ratio: 16 / 9; }
  .bento-meta { left: 20px; bottom: 18px; }
  .bento-name, .bento-tile.is-hero .bento-name { font-size: 19px; }
  .otherworks { grid-template-columns: 1fr; gap: 12px; }
  .orbit-row { grid-template-columns: 1fr auto; }
  .orbit-note { padding-left: 0; max-height: 90px; opacity: 1; margin-top: 8px; }
  .stats-row { grid-template-columns: repeat(3, 1fr); gap: 0 10px; }
  .stats-note { font-size: 11px; letter-spacing: 0.1em; }
  .profile { gap: 16px; }
  .profile img { width: 72px; height: 72px; }
  .stat strong { font-size: 22px; }
  .orbit-row .label { grid-column: 1 / -1; }
  .b-hero { aspect-ratio: 3 / 2; }
  .b-hero.is-contain { padding: 24px var(--gutter) 0; }
  .b-hero.is-contain img { max-height: 48vh; }
  .proj-flow { gap: 18px; }
  .proj-flow figure.is-small,
  .proj-flow figure.is-mini { width: 100%; }
  /* 手機：指定欄數最多兩欄 */
  .proj-flow[style*="--cols"] figure {
    width: calc((100% - 18px) / 2) !important;
  }

  /* 上下篇導覽：手機改為堆疊的整列連結 */
  .b-nav {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0 0 72px;
    margin-top: 32px;
  }
  /* 手機排序：上一個 → 下一個 → 回到列表 */
  .b-nav-item.is-prev { order: 1; justify-self: stretch; }
  .b-nav-item.is-next { order: 2; justify-self: stretch; }
  .b-nav-back         { order: 3; justify-self: stretch; }
  .b-nav-item {
    padding: 14px 2px;
    border-bottom: 1px solid var(--line);
    min-height: 72px;
    gap: 14px;
  }
  .b-nav-item.is-next { justify-content: flex-start; text-align: left; }
  .b-nav-item.is-next .b-nav-arrow { order: 3; margin-left: auto; }
  .b-nav-item.is-next .b-nav-thumb { order: -1; }
  .b-nav-item.is-prev .b-nav-arrow { order: 3; margin-left: auto; }
  .b-nav-thumb { width: 52px; height: 52px; }
  .b-nav-back {
    padding: 22px 0 0;
    text-align: center;
  }
}
