.portfolio-filter-meta { display: flex; align-items: center; gap: 16px; }

.portfolio-tally { font-size: .65rem; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.22); font-family: var(--font-sans); white-space: nowrap; }

.portfolio-tally strong { color: var(--gold); font-weight: 600; }

.portfolio-filters { display: flex; gap: 2px; flex-wrap: wrap; background: var(--off-black); border: 1px solid var(--border); border-radius: 3px; padding: 3px; }

.filter-btn { padding: 7px 17px; font-size: .66rem; letter-spacing: .15em; text-transform: uppercase; font-weight: 500; border-radius: 2px; border: none; background: transparent; color: var(--muted); transition: background .22s ease, color .22s ease, box-shadow .22s ease; font-family: var(--font-sans); cursor: pointer; touch-action: manipulation; line-height: 1.2; white-space: nowrap; }

.filter-btn.active { background: var(--gold); color: var(--black); box-shadow: 0 2px 12px rgba(201,169,110,.28); }

.filter-btn:not(.active):hover { background: rgba(201,169,110,.1); color: var(--off-white); }

/* .large class removed — all portfolio items uniform size */

.portfolio-item:hover .portfolio-badge { opacity: 0; }

.filter-btn.active[data-count]::after { opacity: .78; }

.portfolio-item:hover::before { right: 0; }

.portfolio-item:hover .portfolio-overlay { opacity: 1; }

.portfolio-overlay-tag::before { content: ''; width: 18px; height: 1px; background: var(--gold); display: inline-block; flex-shrink: 0; }

.portfolio-item:hover .portfolio-item-index { opacity: 1; transform: translateY(0); }

.portfolio-item:hover .portfolio-item-icon { opacity: 1; transform: scale(1) rotate(0deg); }

.portfolio-cta-bar::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(to bottom, transparent, var(--gold) 50%, transparent); }

.portfolio-cta-bar::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, rgba(201,169,110,.055) 0%, transparent 55%); pointer-events: none; }

.portfolio-cta-bar-text { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 300; color: var(--off-white); font-style: italic; line-height: 1.45; }

.portfolio-cta-bar-text em { color: var(--gold); font-style: italic; }

.portfolio-cta-bar-right { display: flex; align-items: center; gap: 20px; }

.portfolio-cta-bar-num { font-family: var(--font-serif); font-size: 1.8rem; font-weight: 300; color: rgba(201,169,110,.18); line-height: 1; }

.portfolio-cta-bar-link { display: inline-flex; align-items: center; gap: 9px; font-size: .70rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--gold); border-bottom: 1px solid rgba(201,169,110,.35); padding-bottom: 2px; transition: color .3s, border-color .3s; white-space: nowrap; }

.portfolio-cta-bar-link svg { transition: transform .3s var(--ease-out); }

.portfolio-cta-bar-link:hover { color: var(--gold-light); border-color: var(--gold-light); }

.portfolio-cta-bar-link:hover svg { transform: translateX(4px); }

.portfolio-item:hover .portfolio-view-icon { opacity: 1; transform: scale(1) rotate(0deg); }

.portfolio-item-num { position: absolute; bottom: 28px; right: 26px; font-family: var(--font-serif); font-size: .72rem; color: rgba(201,169,110,0.28); font-style: italic; font-weight: 300; opacity: 0; transition: opacity .4s var(--ease-out); pointer-events: none; }

.portfolio-item:hover .portfolio-item-num { opacity: 1; }

.lightbox.open { opacity: 1; pointer-events: all; }

.lb-counter { font-family: var(--font-sans); font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.38); }

.lb-top-actions { display: flex; gap: 8px; pointer-events: none; }

.lightbox.open .lb-top-actions { pointer-events: all; }

.lb-action-btn { width: 40px; height: 40px; border-radius: 50%; background: rgba(8,8,8,.75); border: 1px solid rgba(201,169,110,.22); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.85); cursor: pointer; transition: background .22s, border-color .22s, color .22s, transform .2s ease; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); pointer-events: all; }

.lb-action-btn:hover { background: var(--gold); border-color: var(--gold); color: var(--black); }

.lb-close-x:hover { background: rgba(255,255,255,.16); border-color: transparent; color: #fff; }

.lb-arrow:hover { background: var(--gold); border-color: var(--gold); color: var(--black); transform: translateY(-50%) scale(1.06); }

.lb-arrow:disabled { opacity: .14; cursor: default; pointer-events: none; }

.lb-arrow-prev { left: 20px; }

.lb-arrow-next { right: 20px; }

.lb-info { flex: 1; }

.lb-tag { font-size: .56rem; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); margin-bottom: 5px; }

.lb-title { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 300; color: var(--off-white); }

.lightbox.open .lb-dots { pointer-events: all; }

.lb-dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.18); border: none; cursor: pointer; padding: 0; transition: background .22s, transform .22s; flex-shrink: 0; }

.lb-dot.lb-dot-active { background: var(--gold); transform: scale(1.6); }

.lb-dot:hover:not(.lb-dot-active) { background: rgba(255,255,255,.45); }


.portfolio-frame {
  position: relative;
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
}

.portfolio-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(201,169,110,0.22), rgba(255,255,255,0.04), rgba(201,169,110,0.14));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.portfolio-grid {
  perspective: 1200px;
}

.portfolio-item {
  transform-style: preserve-3d;
  transition: transform 420ms var(--ease-out), box-shadow 420ms ease, opacity 320ms ease, filter 320ms ease;
}

.portfolio-item:hover {
  box-shadow: var(--shadow-gold);
  z-index: 3;
}

.portfolio-item img {
  transition: transform 700ms var(--ease-out), filter 400ms ease;
  filter: saturate(0.94) contrast(1.02);
}

.portfolio-item:hover img {
  filter: saturate(1.04) contrast(1.06);
}

.portfolio-overlay {
  backdrop-filter: blur(8px);
}

.portfolio-item-icon,
.portfolio-item-index,
.portfolio-badge {
  backdrop-filter: blur(12px);
}

.filter-btn {
  position: relative;
  overflow: hidden;
}

.filter-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(201,169,110,0.16) 40%, transparent 75%);
  transform: translateX(-120%);
  transition: transform 650ms var(--ease-out);
}

.filter-btn:hover::before,
.filter-btn.active::before {
  transform: translateX(115%);
}

.lightbox.open #lbImg {
  animation: lbImageIn 380ms var(--ease-out);
}

@keyframes lbImageIn {
  from { transform: scale(0.97); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-item,
  .portfolio-item img,
  .filter-btn::before,
  .lightbox.open #lbImg {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}


.portfolio-filter-row {
  position: sticky;
  top: 88px;
  z-index: 8;
  padding: 16px 18px;
  margin-bottom: 28px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  background: rgba(12,12,12,0.72);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-premium-soft);
}

.portfolio-frame {
  position: relative;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: var(--shadow-premium);
}

.portfolio-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(223,192,138,0.22), rgba(255,255,255,0.04), rgba(223,192,138,0.14));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

.portfolio-grid {
  gap: 1px;
  background: rgba(255,255,255,0.06);
  perspective: 1200px;
}

.portfolio-item {
  position: relative;
  background: #0c0c0c;
  transform-style: preserve-3d;
  transition: transform 420ms var(--ease-out), box-shadow 420ms ease, filter 260ms ease, opacity 240ms ease;
}

/* .large class removed — uniform sizing for all items */

.portfolio-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.18), transparent 35%);
  opacity: 0;
  transition: opacity 260ms ease;
  pointer-events: none;
}

.portfolio-item:hover::after,
.portfolio-item:focus-visible::after {
  opacity: 0.55;
}

.portfolio-item:hover {
  z-index: 4;
  box-shadow: 0 28px 80px rgba(0,0,0,0.34), 0 12px 36px rgba(201,169,110,0.12);
}

.portfolio-item img {
  filter: saturate(0.95) contrast(1.04);
  transition: transform 800ms var(--ease-out), filter 380ms ease;
}

.portfolio-item:hover img,
.portfolio-item:focus-visible img {
  transform: scale(1.07);
  filter: saturate(1.08) contrast(1.08);
}

.portfolio-overlay {
  backdrop-filter: blur(10px);
}

.portfolio-badge,
.portfolio-item-index,
.portfolio-item-icon,
.lb-dot {
  backdrop-filter: blur(12px);
}

.portfolio-badge {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(8,8,8,0.5);
}

.filter-btn {
  position: relative;
  overflow: hidden;
}

.filter-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(201,169,110,0.16) 40%, transparent 78%);
  transform: translateX(-125%);
  transition: transform 680ms var(--ease-out);
}

.filter-btn:hover::before,
.filter-btn.active::before {
  transform: translateX(120%);
}

.filter-btn.active {
  box-shadow: inset 0 0 0 1px rgba(223,192,138,0.35), 0 10px 26px rgba(201,169,110,0.12);
}

.portfolio-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(223,192,138,0.7), 0 22px 64px rgba(0,0,0,0.3);
}

.lb-dots {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.lb-dot {
  width: 64px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background-color: rgba(255,255,255,0.06);
  background-size: cover;
  background-position: center;
  opacity: 0.62;
  transition: transform 220ms ease, opacity 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.lb-dot:hover,
.lb-dot-active {
  opacity: 1;
  transform: translateY(-2px);
  border-color: rgba(223,192,138,0.7);
  box-shadow: 0 10px 24px rgba(0,0,0,0.24);
}

.lightbox.open #lbImg {
  animation: lbImageIn 360ms var(--ease-out);
}

@keyframes lbImageIn {
  from { opacity: 0; transform: scale(0.975); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 900px) {
  .portfolio-filter-row {
    top: 74px;
    border-radius: 18px;
  }

  /* .large rule removed */

  .lb-dot {
    width: 52px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-item,
  .portfolio-item img,
  .filter-btn::before,
  .lightbox.open #lbImg,
  .lb-dot {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}


.portfolio-header {
  margin-bottom: 34px;
}

.portfolio-header .display {
  max-width: 10ch;
}

.portfolio-filter-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 28px;
  align-items: center;
}

.portfolio-helper-note {
  color: rgba(255,255,255,0.52);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portfolio-progress {
  grid-column: 1 / -1;
  height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.portfolio-progress-bar {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(1);
  background: linear-gradient(90deg, rgba(223,192,138,0.2), rgba(223,192,138,0.95), rgba(255,255,255,0.55));
  transition: transform 420ms var(--ease-out);
}

.portfolio-frame {
  background: linear-gradient(180deg, rgba(15,15,15,0.96), rgba(10,10,10,0.98));
}

.portfolio-grid {
  grid-auto-rows: clamp(220px, 24vw, 340px);
}

.portfolio-item {
  isolation: isolate;
}

.portfolio-item::before {
  height: 2px;
  opacity: 0.85;
}

.portfolio-item::after {
  background:
    radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.14), transparent 32%),
    linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.08) 100%);
}

.portfolio-item:hover,
.portfolio-item:focus-visible {
  box-shadow: 0 30px 90px rgba(0,0,0,0.36), 0 10px 24px rgba(223,192,138,0.08);
}

.portfolio-item img {
  will-change: transform, filter;
}

.portfolio-overlay {
  padding-bottom: 24px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(6,6,6,0.12) 18%, rgba(6,6,6,0.82) 100%);
}

.portfolio-overlay-tag {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
}

.portfolio-overlay-title {
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  line-height: 1.08;
  max-width: 15ch;
}

.portfolio-item-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(10,10,10,0.38);
}

.portfolio-item-icon svg {
  transform: translateX(0);
  transition: transform 220ms ease;
}

.portfolio-item:hover .portfolio-item-icon svg,
.portfolio-item:focus-visible .portfolio-item-icon svg {
  transform: translateX(2px);
}

.portfolio-item-index {
  min-width: 42px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(10,10,10,0.4);
}

.portfolio-badge {
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.portfolio-cta-bar {
  margin-top: 18px;
  border-radius: 0 0 30px 30px;
}

.lightbox {
  backdrop-filter: blur(18px);
}

.lb-stage {
  padding-top: 84px;
}

#lbImg {
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}

.lb-top-bar,
.lb-bottom-bar {
  padding-left: clamp(18px, 3vw, 34px);
  padding-right: clamp(18px, 3vw, 34px);
}

.lb-bottom-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
}

.lb-info {
  display: grid;
  gap: 8px;
}

.lb-title {
  font-size: clamp(1.05rem, 2vw, 1.5rem);
  max-width: 18ch;
}

.lb-tag {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.lb-hint {
  color: rgba(255,255,255,0.46);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lb-dots {
  justify-content: flex-end;
}

.lb-dot {
  width: 72px;
  height: 50px;
}

.lb-arrow,
.lb-action-btn,
.lb-close-x {
  border-color: rgba(255,255,255,0.12);
  background: rgba(8,8,8,0.42);
}

.lb-arrow:hover,
.lb-action-btn:hover,
.lb-close-x:hover {
  border-color: rgba(223,192,138,0.7);
  transform: translateY(-2px);
}

@media (max-width: 1024px) {
  .portfolio-header .display {
    max-width: none;
  }

  .lb-bottom-bar {
    grid-template-columns: 1fr;
  }

  .lb-dots {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .portfolio-filter-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .portfolio-helper-note {
    font-size: 0.72rem;
    line-height: 1.5;
  }

  .portfolio-grid {
    grid-auto-rows: minmax(240px, auto);
  }

  /* .large rule removed */

  .portfolio-overlay-title {
    max-width: none;
  }

  .lb-stage {
    padding-top: 74px;
  }

  .lb-hint {
    display: none;
  }
}


/* ═══════════════════════════════════════════════════════════════════
   LIGHTBOX FIX — defensive rules
   ═══════════════════════════════════════════════════════════════════
   Issue: lightbox was opening but all content (image, bars, arrows,
   buttons) was invisible — only the dark backdrop showed.
   
   Root cause: multiple cascading rules and animations in portfolio.css
   and utilities.css could leave elements with opacity:0 or transform
   scale(0.97) stuck if the animation didn't complete cleanly on a
   particular browser/device, or if .lb-switching class lingered.
   
   Fix: when .lightbox has .open class, force every child element to
   be visible with explicit opacity:1 and normal transform. This runs
   after all other animation keyframes and guarantees the final state.
   ═══════════════════════════════════════════════════════════════════ */

.lightbox.open #lbImg,
.lightbox.open .lb-top-bar,
.lightbox.open .lb-bottom-bar,
.lightbox.open .lb-arrow,
.lightbox.open .lb-stage,
.lightbox.open .lb-counter,
.lightbox.open .lb-top-actions,
.lightbox.open .lb-info,
.lightbox.open .lb-tag,
.lightbox.open .lb-title,
.lightbox.open .lb-hint,
.lightbox.open .lb-dots,
.lightbox.open .lb-dot {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Remove any lingering transform that could hide the image */
.lightbox.open #lbImg:not(.lb-switching) {
  transform: scale(1) !important;
}

/* Ensure image has a minimum size even while loading */
.lightbox.open #lbImg {
  min-width: 200px;
  min-height: 200px;
  display: block !important;
}

/* Lightbox must be full-viewport and visible when open */
.lightbox.open {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: all !important;
  visibility: visible !important;
}

/* All child elements must be above the dark backdrop */
.lightbox.open > * {
  z-index: 1;
}
/* Stage (image) sits below chrome */
.lightbox.open .lb-stage {
  z-index: 2;
}
/* Chrome (arrows, top/bottom bars) sits above stage so buttons are clickable */
.lightbox.open .lb-arrow,
.lightbox.open .lb-top-bar,
.lightbox.open .lb-bottom-bar {
  z-index: 11;
}


/* ═══════════════════════════════════════════════════════════════════
   ROUND 2 — PORTFOLIO FILTER BUTTONS + CTA BAR REDESIGN
   ═══════════════════════════════════════════════════════════════════
   Filter buttons: architectural index tabs with serif drawing-sheet
   numbers, count indicators, and dimension-line underline sweep hover.
   CTA bar: refined with animated vertical gold line, tabular-nums,
   and arrow drift on hover.
   ═══════════════════════════════════════════════════════════════════ */


/* ── 1. FILTER CONTAINER — cleaner capsule ────────────────────────
   Override the old border-radius:3px boxy container with a proper
   pill-shaped capsule that feels premium. */
@media (min-width: 601px) {
  .portfolio-filters {
    gap: 4px !important;
    padding: 4px !important;
    border-radius: 999px !important;
    background: rgba(8,8,8,0.55) !important;
    border: 1px solid rgba(201,169,110,0.12) !important;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.04),
      0 8px 24px rgba(0,0,0,0.18) !important;
  }

  /* ── 2. FILTER BUTTON — architectural index tab ──────────────── */
  .filter-btn {
    padding: 9px 18px 9px 34px !important;   /* left room for ::before number */
    font-size: 0.65rem !important;
    letter-spacing: 0.14em !important;
    font-weight: 500 !important;
    border-radius: 999px !important;
    color: rgba(255,255,255,0.55) !important;
    background: transparent !important;
    transition:
      color 220ms var(--ease-out),
      background 260ms var(--ease-out),
      box-shadow 260ms var(--ease-out),
      transform 180ms var(--ease-out) !important;
    position: relative;
  }

  /* ── 3. SERIF DRAWING-SHEET NUMBER (::before) ──────────────────
     Displays "01" / "02" / ... from data-num attribute in serif
     italic — like an architectural drawing sheet index marker. */
  .filter-btn::before {
    content: attr(data-num);
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-serif);
    font-size: 0.68rem;
    font-style: italic;
    font-weight: 300;
    letter-spacing: 0;
    color: rgba(201,169,110,0.5);
    transition: color 220ms ease, transform 260ms ease;
    background: none !important;  /* override shimmer-sweep inherited rule */
    inset: auto !important;
  }
  /* Some filter buttons don't have data-num — hide the pseudo for them */
  .filter-btn:not([data-num])::before {
    content: none;
  }

  /* ── 4. COUNT SUFFIX (::after) — small parenthesized count ─────
     Only shows when data-count attribute is present.
     Repositioned from the old ::after rule. */
  .filter-btn[data-count]::after {
    content: ' (' attr(data-count) ')';
    font-size: 0.55rem;
    opacity: 0.42;
    color: inherit;
    font-family: var(--font-sans);
    letter-spacing: 0.05em;
    margin-left: 4px;
    transition: opacity 220ms ease;
  }
  .filter-btn[data-count]:not(.active):hover::after {
    opacity: 0.7;
  }
  .filter-btn.active[data-count]::after {
    opacity: 0.78;
  }

  /* ── 5. HOVER STATE — gold dimension-line sweeps under text ───
     Replace the old full-background tint with a clean underline
     that sweeps in from the left — feels like a measurement mark. */
  .filter-btn:not(.active):hover {
    color: rgba(255,255,255,0.95) !important;
    background: transparent !important;
  }
  .filter-btn:not(.active):hover::before {
    color: rgba(201,169,110,0.92);
  }

  /* ── 6. ACTIVE STATE — gold fill, inverted number ─────────────
     Full gold pill, black text, serif number becomes dark italic
     on gold — strong contrast, architectural elegance. */
  .filter-btn.active {
    background: linear-gradient(180deg, var(--gold-light, #dfc08a), var(--gold)) !important;
    color: var(--black) !important;
    box-shadow:
      0 2px 8px rgba(201,169,110,0.35),
      0 10px 24px rgba(201,169,110,0.18),
      inset 0 1px 0 rgba(255,255,255,0.35) !important;
  }
  .filter-btn.active::before {
    color: rgba(12,12,12,0.55);
  }

  /* ── 7. FOCUS RING — accessibility ────────────────────────────── */
  .filter-btn:focus-visible {
    outline: 2px solid rgba(201,169,110,0.7);
    outline-offset: 3px;
  }

  /* ── 8. RTL — flip number position to right side ─────────────── */
  [dir="rtl"] .filter-btn {
    padding: 9px 34px 9px 18px !important;
  }
  [dir="rtl"] .filter-btn::before {
    left: auto;
    right: 13px;
  }
}


/* ── 9. PORTFOLIO CTA BAR — REFINED ─────────────────────────────
   Remove the boxy border, add subtle gradient bg, animate the
   existing gold vertical line, improve typography on the number,
   and smooth the arrow drift on hover. */
.portfolio-cta-bar {
  border: 0 !important;                                  /* remove hairline */
  background: linear-gradient(135deg,
    rgba(20,20,20,0.98) 0%,
    rgba(12,12,12,0.98) 45%,
    rgba(18,16,12,0.98) 100%) !important;
  box-shadow:
    0 1px 0 rgba(201,169,110,0.06) inset,
    0 18px 48px rgba(0,0,0,0.28) !important;
}

/* Animated vertical gold line — slow pulse every 4s */
.portfolio-cta-bar::before {
  animation: ctaBarPulse 4s ease-in-out infinite;
  width: 3px;
}
@keyframes ctaBarPulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

/* RTL — vertical gold line moves to right edge, and keep animating */
[dir="rtl"] .portfolio-cta-bar::before {
  left: auto !important;
  right: 0 !important;
}

/* Big "500+" number — serif italic, tabular numerals, slightly
   bigger, more subtle but visually sharper */
.portfolio-cta-bar-num {
  font-size: 2rem !important;
  font-style: italic;
  color: rgba(201,169,110,0.28) !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  transition: color 420ms ease;
}
.portfolio-cta-bar:hover .portfolio-cta-bar-num {
  color: rgba(201,169,110,0.55) !important;
}

/* CTA link arrow — smoother drift on hover */
.portfolio-cta-bar-link svg {
  transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}
.portfolio-cta-bar-link:hover svg {
  transform: translateX(5px) !important;
}

/* Reduced motion — disable the pulse animation */
@media (prefers-reduced-motion: reduce) {
  .portfolio-cta-bar::before {
    animation: none !important;
    opacity: 0.7 !important;
  }
}


/* ═══════════════════════════════════════════════════════════════════
   ROUND 6 — PORTFOLIO "DATUM SHIFT" HOVER
   ═══════════════════════════════════════════════════════════════════
   When the architect focuses on a detail on a drawing, the image
   subtly shifts under the eye. We simulate this with a mouse-tracked
   scale+translate that follows the cursor (desktop only — mobile
   doesn't have hover state).

   The CSS uses two custom properties (--mx, --my) that portfolio.js
   will update on mousemove inside each portfolio-item. 0 = cursor
   at center, values range -0.5 to +0.5.
   ═══════════════════════════════════════════════════════════════════ */


@media (hover: hover) and (pointer: fine) {
  /* Only desktop with a real mouse — don't run on touch devices */
  .portfolio-item img {
    transform:
      scale(calc(1 + (abs(var(--mx, 0)) + abs(var(--my, 0))) * 0.015))
      translate(calc(var(--mx, 0) * 8px), calc(var(--my, 0) * 8px));
    transition: transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
  }
}


/* Reduced motion — kill the image shift */
@media (prefers-reduced-motion: reduce) {
  .portfolio-item img {
    transform: none !important;
    transition: none !important;
  }
}
