/*
 * Portfolio page only — static portfolio.html + WP portfolio template.
 * Scope every rule under body.portfolio-page (or .featured / .all-projects inside it).
 * Do NOT edit landing-page logos here: those live in landing.css under .il-landing section.portfolio
 * (.portfolio-cell). Never add bare .portfolio-cell / section.portfolio rules in this file.
 */
@font-face {
  font-family: "PP Monument Extended Black";
  src: url("fonts/PPMonumentExtended-Black.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

body.portfolio-page {
  --brand-blue: #3f75f5;
  --neutral-950: #0a0a0a;
  --neutral-800: #1f2937;
  --neutral-600: #4b5563;
  --neutral-400: #9ca3af;
  --neutral-200: #e5e7eb;
  --neutral-100: #f3f4f6;
  --neutral-50: #f9fafb;
  --white: #ffffff;
  --font-heading: "PP Monument Extended Black", var(--font-body), system-ui, sans-serif;
  --font-body: 'Roboto', sans-serif;
  --radius-full: 999px;
  --radius-xl: 24px;
  --radius-md: 8px;
  /* Featured + All Projects logo 方塊小圓角 */
  --logo-tile-radius: 6px;
}

body.portfolio-page,
body.portfolio-page *,
body.portfolio-page *::before,
body.portfolio-page *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.portfolio-page {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--neutral-950);
  -webkit-font-smoothing: antialiased;
  padding-top: 78px;
}

body.portfolio-page a { text-decoration: none; }
body.portfolio-page img { max-width: 100%; height: auto; }

body.portfolio-page .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
}

/* Logo sections: Featured + All Projects */
body.portfolio-page .section-title {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--neutral-950);
}

/* Navbar */
body.portfolio-page .navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 0;
  pointer-events: none;
  transition: padding 0.45s cubic-bezier(0.16,1,0.3,1), transform 0.4s cubic-bezier(0.16,1,0.3,1);
}
body.portfolio-page .navbar.is-scrolled { padding: 10px 28px; }
body.portfolio-page .navbar.is-hidden { transform: translateY(-100%); pointer-events: none; }
body.portfolio-page .navbar .container {
  pointer-events: auto;
  position: relative;
  height: 78px;
  max-width: 1200px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: var(--white);
  border: 1px solid transparent;
  transition: max-width 0.45s, height 0.45s, border-radius 0.45s, padding 0.45s,
    background 0.35s, box-shadow 0.35s, border-color 0.35s;
}
body.portfolio-page .navbar.is-scrolled .container {
  height: 56px;
  max-width: 1200px;
  padding: 0 12px 0 16px;
  border-radius: var(--radius-full);
  background: transparent;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.45);
  box-shadow:
    0 6px 28px rgba(0,0,0,0.07),
    0 1px 3px rgba(0,0,0,0.04),
    inset 0 1px 0 rgba(255,255,255,0.75);
}
body.portfolio-page .navbar .btn-nav {
  font-size: 15px;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  background: var(--neutral-950);
  color: var(--white);
  transition: background 0.2s, transform 0.15s, padding 0.35s, font-size 0.35s;
  white-space: nowrap;
}
body.portfolio-page .navbar.is-scrolled .btn-nav { padding: 9px 20px; font-size: 14px; }
body.portfolio-page .navbar .btn-nav:hover {
  background: var(--neutral-800);
  transform: translateY(-1px);
}
body.portfolio-page .navbar .logo { display: flex; align-items: center; color: var(--neutral-950); height: 100%; }
body.portfolio-page .navbar .logo-svg { height: 56px; width: auto; display: block; flex-shrink: 0; transition: height 0.4s; }
body.portfolio-page .navbar .logo-wordmark { display: block; }
body.portfolio-page .navbar .logo-mark { display: none; }
body.portfolio-page .navbar.is-scrolled .logo-wordmark { display: none; }
body.portfolio-page .navbar.is-scrolled .logo-mark { display: block; }
body.portfolio-page .navbar.is-scrolled .logo-svg { height: 40px; }
body.portfolio-page .nav-tabs {
  display: flex; align-items: center; gap: 4px; list-style: none;
  position: absolute; left: 50%; transform: translateX(-50%);
}
body.portfolio-page .nav-tab {
  font-size: 14px; font-weight: 500; color: var(--neutral-950);
  text-transform: uppercase; letter-spacing: 0.5px;
  text-decoration: none;
  padding: 6px 14px; border-radius: var(--radius-full);
  transition: color 0.25s, text-decoration-color 0.2s;
}
body.portfolio-page .nav-tab:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
body.portfolio-page .nav-tab.is-active {
  color: var(--brand-blue);
  font-weight: 700;
}
body.portfolio-page .nav-tab:focus-visible {
  font-weight: 700;
  outline: 2px solid var(--brand-blue);
  outline-offset: 3px;
}
body.portfolio-page .navbar.is-scrolled .nav-tab { font-size: 13px; padding: 5px 12px; }

/* Mobile: hamburger opens nav tabs */
body.portfolio-page .nav-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--neutral-950);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
body.portfolio-page .nav-menu-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
body.portfolio-page .nav-menu-toggle[aria-expanded="true"] .nav-menu-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
body.portfolio-page .nav-menu-toggle[aria-expanded="true"] .nav-menu-toggle-bar:nth-child(2) {
  opacity: 0;
}
body.portfolio-page .nav-menu-toggle[aria-expanded="true"] .nav-menu-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
body.portfolio-page .nav-backdrop {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  background: rgba(0, 0, 0, 0.35);
  border: none;
  padding: 0;
  margin: 0;
}
body.portfolio-page .navbar.is-scrolled .nav-backdrop { top: 48px; }
body.portfolio-page.nav-open .nav-backdrop { display: block; }

/* Featured — white background；上下留白與 .container 左右 gutter 同值，桌機比例才平均 */
body.portfolio-page .featured {
  background: var(--white);
  padding: 48px 0;
}
body.portfolio-page .featured .section-title {
  color: var(--neutral-950);
}
body.portfolio-page .featured .container { display: flex; flex-direction: column; gap: 32px; }
body.portfolio-page .featured-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 4px; /* row: 上下格間距；column: 4px */
}
/* Featured：與 All Projects 一致，使用矩形中央裁切 */
body.portfolio-page .featured-cell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  height: auto;
  max-width: 190px;
  justify-self: center;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: var(--logo-tile-radius);
  overflow: hidden;
  cursor: pointer;
  transition: filter 0.25s ease;
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}
/* Featured + All Projects：logo 方塊統一 hover（亮度略降） */
body.portfolio-page .featured-cell:hover,
body.portfolio-page .project-logo-wrap:hover {
  filter: brightness(0.94);
}
/* CARV — Featured + All Projects：品牌紫底 #8A5AFF（與 Featured 一致） */
body.portfolio-page .featured-cell:has(img:is([src*="Carv.png"], [src*="carv.svg"])),
body.portfolio-page .project-logo-wrap:has(img:is([src*="Carv.png"], [src*="carv.svg"])) {
  background-color: #8a5aff !important;
  background-image: none !important;
}
body.portfolio-page .featured-cell img:is([src*="Carv.png"], [src*="carv.svg"]),
body.portfolio-page .project-logo-wrap img:is([src*="Carv.png"], [src*="carv.svg"]) {
  width: 100%;
  height: 100%;
  padding: 5% 14%;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
}
/* Truflation — All Projects：透明底 */
body.portfolio-page .project-logo-wrap:has(img:is([src*="Truflation.png"], [src*="truflation.svg"])) {
  background-color: transparent !important;
  background-image: none !important;
}
body.portfolio-page .project-logo-wrap img:is([src*="Truflation.png"], [src*="truflation.svg"]) {
  width: 100%;
  height: 100%;
  padding: 0;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
}
/* Truflation — Featured：品牌藍底；logo 略縮（左右留白） */
body.portfolio-page .featured-cell:has(img:is([src*="Truflation.png"], [src*="truflation.svg"])) {
  background-color: #3e88ff !important;
  background-image: none !important;
}
body.portfolio-page .featured-cell img:is([src*="Truflation.png"], [src*="truflation.svg"]) {
  width: 160px;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  padding: 0;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
}
/* Impossible Cloud Network — Featured + All Projects：品牌綠底 #1F3222（與 Featured 一致） */
body.portfolio-page .featured-cell:has(img:is([src*="icn.svg"], [src*="icn.png"], [src*="logos/icn"])),
body.portfolio-page .project-logo-wrap:has(img:is([src*="icn.svg"], [src*="icn.png"], [src*="logos/icn"])) {
  background-color: transparent !important;
  background-image: none !important;
}
body.portfolio-page .featured-cell img:is([src*="icn.svg"], [src*="icn.png"], [src*="logos/icn"]),
body.portfolio-page .project-logo-wrap img:is([src*="icn.svg"], [src*="icn.png"], [src*="logos/icn"]) {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  padding: 0 !important;
  object-fit: cover !important;
  object-position: 50% 50% !important;
}
/* Aethir：logos/aethir.svg + 品牌深底 */
body.portfolio-page .featured-cell:has(img:is([src*="Aethir.png"], [src*="logos/aethir.svg"])),
body.portfolio-page .project-logo-wrap:has(img:is([src*="Aethir.png"], [src*="logos/aethir.svg"])) {
  background-color: #1f2925 !important;
  background-image: none !important;
}
body.portfolio-page .featured-cell img:is([src*="Aethir.png"], [src*="logos/aethir.svg"]),
body.portfolio-page .project-logo-wrap img:is([src*="Aethir.png"], [src*="logos/aethir.svg"]) {
  width: 100%;
  height: 100%;
  padding: 5% 14%;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
}
/* XAI：圖檔自帶視覺，不重疊品牌紅底；logo 撐滿格內可用空間 */
body.portfolio-page .featured-cell:has(img:is([src*="XAI.png"], [src*="xai.svg"], [src*="logos/xai"])),
body.portfolio-page .project-logo-wrap:has(img:is([src*="XAI.png"], [src*="xai.svg"], [src*="logos/xai"])) {
  background-color: transparent !important;
  background-image: none !important;
}
body.portfolio-page .featured-cell img:is([src*="XAI.png"], [src*="xai.svg"], [src*="logos/xai"]),
body.portfolio-page .project-logo-wrap img:is([src*="XAI.png"], [src*="xai.svg"], [src*="logos/xai"]) {
  width: 100%;
  height: 100%;
  padding: 0;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
}
/* Dexguru — Featured + All Projects：品牌深灰底 #202020（與 Featured 一致） */
body.portfolio-page .featured-cell:has(img:is([src*="Dexguru.png"], [src*="dexguru.svg"], [src*="logos/dexguru"])),
body.portfolio-page .project-logo-wrap:has(img:is([src*="Dexguru.png"], [src*="dexguru.svg"], [src*="logos/dexguru"])) {
  background-color: #202020 !important;
  background-image: none !important;
}
body.portfolio-page .featured-cell img:is([src*="Dexguru.png"], [src*="dexguru.svg"], [src*="logos/dexguru"]) {
  width: 160px;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  padding: 0;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
}
/* Jambo — All Projects：透明底 */
body.portfolio-page .project-logo-wrap:has(img:is([src*="Jambo.png"], [src*="jambo.svg"], [src*="logos/jambo"])) {
  background-color: transparent !important;
  background-image: none !important;
}
body.portfolio-page .project-logo-wrap img:is([src*="Jambo.png"], [src*="jambo.svg"], [src*="logos/jambo"]) {
  width: 100%;
  height: 100%;
  padding: 0;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
}
/* Jambo — Featured：深灰底 #202020；logo 寬 160px */
body.portfolio-page .featured-cell:has(img:is([src*="Jambo.png"], [src*="jambo.svg"], [src*="logos/jambo"])) {
  background-color: #202020 !important;
  background-image: none !important;
}
body.portfolio-page .featured-cell img:is([src*="Jambo.png"], [src*="jambo.svg"], [src*="logos/jambo"]) {
  width: 160px;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  padding: 0;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
}
/* Gnosis — Featured：neutral-50；logo 寬 160px */
body.portfolio-page .featured-cell:has(img:is([src*="logos/gnosis.svg"], [src*="/gnosis.svg"])) {
  background-color: var(--neutral-50) !important;
  background-image: none !important;
}
body.portfolio-page .featured-cell img:is([src*="logos/gnosis.svg"], [src*="/gnosis.svg"]) {
  width: 160px;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  padding: 0;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
}
/* Hemi：淺底 neutral-50（與 landing 一致；取色腳本見 portfolio-page.js） */
body.portfolio-page .featured-cell:has(img:is([src*="Hemi.png"], [src*="logos/hemi.svg"])),
body.portfolio-page .project-logo-wrap:has(img:is([src*="Hemi.png"], [src*="logos/hemi.svg"])) {
  background-color: var(--neutral-50) !important;
  background-image: none !important;
}
body.portfolio-page .featured-cell img:is([src*="Hemi.png"], [src*="logos/hemi.svg"]),
body.portfolio-page .project-logo-wrap img:is([src*="Hemi.png"], [src*="logos/hemi.svg"]) {
  width: 100%;
  height: 100%;
  padding: 5% 14%;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
}
/* Ronin：頂部淡藍漸層（底端透明，透出區塊底色）；字標偏寬，內距略大於預設 wordmark */
body.portfolio-page .featured-cell:has(img:is([src*="Ronin.png"], [src*="logos/ronin.svg"])),
body.portfolio-page .project-logo-wrap:has(img:is([src*="Ronin.png"], [src*="logos/ronin.svg"])) {
  background-image: linear-gradient(
    180deg,
    rgba(18, 70, 255, 0.14) 0%,
    rgba(18, 70, 255, 0) 100%
  ) !important;
  background-color: transparent !important;
}
body.portfolio-page .featured-cell img:is([src*="Ronin.png"], [src*="logos/ronin.svg"]),
body.portfolio-page .project-logo-wrap img:is([src*="Ronin.png"], [src*="logos/ronin.svg"]) {
  width: 100%;
  height: 100%;
  padding: 8% 18%;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
}
/* Featured：Merit Circle — Beam.png / logos/beam.svg */
body.portfolio-page .featured-cell img:is([src*="Beam.png"], [src*="logos/beam.svg"]) {
  width: 100%;
  height: 100%;
  padding: 5% 14%;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
}
body.portfolio-page .featured-cell img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100% !important;
  height: auto !important;
  min-height: 100%;
  max-width: none;
  transform: translate(-50%, -50%);
  display: block;
}

/* Featured SVG wordmarks: reduce zoom and keep centered */
body.portfolio-page .featured-cell img:is([src*="truflation.svg"], [src*="dexguru.svg"], [src*="jambo.svg"]) {
  width: 78% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 78% !important;
  object-fit: contain !important;
  object-position: 50% 50% !important;
}

/* 淺底白字 wordmark → 黑色（Featured 與 All Projects 皆為淺底） */
body.portfolio-page .featured img[src*="gnosis.svg"]:not([src*="landing-dark"]),
body.portfolio-page .all-projects img[src*="gnosis.svg"],
body.portfolio-page .all-projects img[src*="solv.svg"],
body.portfolio-page .all-projects img[src*="sophon.svg"],
body.portfolio-page .all-projects img[src*="soon.svg"] {
  filter: brightness(0);
}

/* All projects — 白 → neutral-50；前 20px 純白，之後漸入 #f9fafb */
body.portfolio-page .all-projects {
  background: linear-gradient(
    180deg,
    #ffffff 0,
    #ffffff 20px,
    var(--neutral-50) 100%
  );
  padding: 56px 0 120px;
}
body.portfolio-page .all-projects .container { display: flex; flex-direction: column; gap: 32px; }
body.portfolio-page .projects-toolbar { display: flex; flex-direction: column; gap: 20px; }
body.portfolio-page .projects-toolbar-top {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
body.portfolio-page .search-box { position: relative; max-width: 400px; width: 100%; }
body.portfolio-page .search-box input {
  width: 100%; height: 48px; padding: 0 16px 0 44px;
  border: 1px solid var(--neutral-200); border-radius: var(--radius-full);
  font-family: var(--font-body); font-size: 15px; color: var(--neutral-950);
  background: var(--white); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
body.portfolio-page .search-box input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(63,117,245,0.12);
}
body.portfolio-page .search-box input::placeholder { color: var(--neutral-400); }
body.portfolio-page .search-box .search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: var(--neutral-400); pointer-events: none;
}
body.portfolio-page .project-count { font-size: 14px; color: var(--neutral-400); white-space: nowrap; }
body.portfolio-page .tag-filters { display: flex; flex-wrap: wrap; gap: 8px; }
body.portfolio-page .tag-btn {
  display: inline-flex; align-items: center; height: 36px; padding: 0 18px;
  border-radius: var(--radius-full); border: 1px solid var(--neutral-200);
  background: var(--white); font-size: 13px; font-weight: 600; color: var(--neutral-600);
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
body.portfolio-page .tag-btn:hover { border-color: var(--neutral-400); color: var(--neutral-950); }
body.portfolio-page .tag-btn.is-active {
  background: var(--neutral-950); border-color: var(--neutral-950); color: var(--white);
}
/* #projectsGrid 提高優先級，避免佈景主題 / Divi 蓋掉 */
body.portfolio-page .projects-grid,
body.portfolio-page #projectsGrid.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
body.portfolio-page .project-card,
body.portfolio-page #projectsGrid .project-card {
  border-radius: 0 !important;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  text-align: left;
  cursor: default;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}
body.portfolio-page .project-card.is-linked-project,
body.portfolio-page #projectsGrid .project-card.is-linked-project {
  cursor: pointer;
}
body.portfolio-page .project-card.is-linked-project:focus-visible,
body.portfolio-page #projectsGrid .project-card.is-linked-project:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}
/* All Projects：hover 僅作用在 logo 方塊，不含 tag 區；與名稱、tag 齊左（勿置中） */
body.portfolio-page .project-logo-wrap {
  cursor: pointer;
  position: relative;
  width: min(190px, 100%);
  aspect-ratio: 16 / 10;
  height: auto;
  align-self: flex-start;
  margin-inline: 0;
  min-height: 0;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--logo-tile-radius);
  overflow: hidden;
  transition: filter 0.25s ease, background-color 0.25s ease, background 0.25s ease;
}
body.portfolio-page .project-logo-wrap img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100% !important;
  height: auto !important;
  min-height: 100%;
  max-width: none;
  transform: translate(-50%, -50%);
  display: block;
}
/* Dexguru — All Projects：與 Featured 區 dexguru.svg 相同縮放（78%，避免滿版裁切） */
body.portfolio-page .project-logo-wrap img:is([src*="Dexguru.png"], [src*="dexguru.svg"], [src*="logos/dexguru"]) {
  width: 78% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 78% !important;
  object-fit: contain !important;
  object-position: 50% 50% !important;
}
body.portfolio-page .project-name {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--neutral-950);
  width: 100%;
  overflow-wrap: break-word;
}
body.portfolio-page .project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
  width: 100%;
}
body.portfolio-page .project-tag {
  display: inline-flex; align-items: center; height: 26px; padding: 0 12px;
  border-radius: var(--radius-full);
  background: var(--white);
  border: 1px solid var(--neutral-200);
  font-size: 11px; font-weight: 600; color: var(--neutral-600); letter-spacing: 0.3px;
}
body.portfolio-page .project-card[hidden] { display: none !important; }
body.portfolio-page .projects-empty {
  display: none; flex-direction: column; align-items: center; gap: 12px;
  padding: 80px 0; text-align: center;
}
body.portfolio-page .projects-empty.is-visible { display: flex; }
body.portfolio-page .projects-empty-icon { width: 48px; height: 48px; color: var(--neutral-200); }
body.portfolio-page .projects-empty-title {
  font-family: var(--font-heading); font-size: 20px; text-transform: uppercase; color: var(--neutral-950);
}
body.portfolio-page .projects-empty-desc { font-size: 15px; color: var(--neutral-400); }

/* Footer */
body.portfolio-page .site-footer {
  background: var(--white); padding: 80px 0 0; border-top: 1px solid var(--neutral-200);
}
body.portfolio-page .footer-top {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 60px;
}
body.portfolio-page .footer-brand { display: flex; flex-direction: column; gap: 20px; }
body.portfolio-page .footer-logo-svg { height: 50px; width: auto; display: block; align-self: flex-start; }
body.portfolio-page .footer-tagline {
  font-size: 14px; line-height: 1.6; color: var(--neutral-600); max-width: 280px;
}
body.portfolio-page .footer-col-title {
  font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--neutral-400); margin-bottom: 18px;
}
body.portfolio-page .footer-links { list-style: none; display: flex; flex-direction: column; gap: 12px; }
body.portfolio-page .footer-links a {
  font-size: 15px; color: var(--neutral-600); transition: color 0.2s;
}
body.portfolio-page .footer-links a:hover { color: var(--brand-blue); }
body.portfolio-page .footer-stack-group:not(:last-child) {
  margin-bottom: 24px;
}
body.portfolio-page .footer-bottom {
  border-top: 1px solid var(--neutral-200); padding: 24px 0;
  display: flex; justify-content: space-between; align-items: center;
}
body.portfolio-page .footer-copy { font-size: 13px; color: var(--neutral-400); }
body.portfolio-page .footer-legal { display: flex; gap: 28px; }
body.portfolio-page .footer-legal a {
  font-size: 13px; color: var(--neutral-400); transition: color 0.2s;
}
body.portfolio-page .footer-legal a:hover { color: var(--brand-blue); }

@media (max-width: 1024px) {
  body.portfolio-page .container { padding: 0 28px; }
  body.portfolio-page .featured { padding: 28px 0; }
  body.portfolio-page .featured-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 4px;
  }
  body.portfolio-page .projects-grid,
  body.portfolio-page #projectsGrid.projects-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  body.portfolio-page .container { padding: 0 18px; }
  body.portfolio-page { padding-top: 64px; }
  body.portfolio-page.nav-open {
    overflow: hidden;
    touch-action: none;
  }
  body.portfolio-page .navbar .container { height: 64px; padding: 0 18px; }
  body.portfolio-page .navbar .logo-wordmark { display: none; }
  body.portfolio-page .navbar .logo-mark { display: block; }
  body.portfolio-page .navbar .logo-svg { height: 44px; }
  body.portfolio-page .nav-menu-toggle {
    display: inline-flex;
    margin-left: 8px;
    margin-right: 0;
  }
  body.portfolio-page .nav-tabs {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    transform: none;
    margin: 0;
    width: 100%;
    max-width: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 16px;
    background: var(--white);
    border-bottom: 1px solid var(--neutral-200);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: none;
  }
  body.portfolio-page.nav-open .nav-tabs {
    display: flex;
  }
  body.portfolio-page .nav-tabs li { width: 100%; }
  body.portfolio-page .nav-tabs .nav-tab {
    display: block;
    padding: 14px 18px;
    border-radius: 0;
    text-align: left;
  }
  body.portfolio-page .navbar.is-scrolled { padding: 8px 10px; }
  body.portfolio-page .navbar.is-scrolled .container {
    height: 48px; padding: 0 6px 0 12px; max-width: 100%;
  }
  body.portfolio-page .navbar.is-scrolled .nav-tabs { top: 48px; }
  body.portfolio-page .navbar.is-scrolled .logo-svg { height: 34px; }
  body.portfolio-page .navbar .btn-nav {
    font-size: 14px;
    padding: 9px 18px;
    margin-left: auto;
  }
  body.portfolio-page .featured { padding: 24px 0; }
  body.portfolio-page .featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 4px; }
  /* 與 All Projects .project-logo-wrap 同寬高：min(190px, 100%)、正方形 */
  body.portfolio-page .featured-cell {
    padding: 0;
    width: min(190px, 100%);
    max-width: 190px;
    max-height: 190px;
  }
  body.portfolio-page .all-projects { padding: 48px 0 80px; }
  body.portfolio-page .projects-toolbar-top { flex-direction: column; align-items: stretch; }
  body.portfolio-page .search-box { max-width: none; }
  body.portfolio-page .project-count { text-align: center; }
  body.portfolio-page .projects-grid,
  body.portfolio-page #projectsGrid.projects-grid { grid-template-columns: repeat(2, 1fr); }
  body.portfolio-page .project-card,
  body.portfolio-page #projectsGrid .project-card { padding: 24px 16px; }
  body.portfolio-page .project-logo-wrap {
    width: min(190px, 100%);
  }
  body.portfolio-page .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
  body.portfolio-page .footer-brand { grid-column: 1 / -1; }
  body.portfolio-page .site-footer { padding: 60px 0 0; }
}
@media (max-width: 480px) {
  body.portfolio-page .container { padding: 0 14px; }
  body.portfolio-page .footer-top { grid-template-columns: 1fr; }
  body.portfolio-page .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}
