/* ==========================================================================
   AbracaDabra Software Solutions — Portfolio Module Stylesheet
   Dedicated styling for Portfolio page gallery, hero, and filter system.
   ========================================================================== */

/* ============ PORTFOLIO HERO ============ */
.ph-hero {
  position: relative;
  padding: 10rem 0 5.5rem;
  overflow: hidden;
  background: linear-gradient(175deg, #f8fafc 0%, #eef2ff 35%, #f5f3ff 65%, #faf5ff 100%);
  border-bottom: 1px solid rgba(79, 70, 229, 0.08);
}

.ph-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.ph-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}

.ph-orb-1 {
  width: 500px;
  height: 500px;
  top: -15%;
  right: 5%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.12) 0%, transparent 70%);
}

.ph-orb-2 {
  width: 400px;
  height: 400px;
  bottom: -10%;
  left: -5%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.10) 0%, transparent 70%);
}

.ph-orb-3 {
  width: 300px;
  height: 300px;
  top: 40%;
  right: 30%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.07) 0%, transparent 70%);
}

.ph-grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(79, 70, 229, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 70, 229, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 70%);
}

.ph-hero-inner,
.ph-hero-container {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
}

/* Content side */
.ph-content {
  max-width: 560px;
}

.ph-eyebrow {
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 600;
  margin-bottom: 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  background: rgba(79, 70, 229, 0.06);
  padding: .5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(79, 70, 229, 0.12);
}

.ph-headline {
  font-family: var(--f-display);
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 700;
  color: var(--text-hi);
  line-height: 1.15;
  margin-bottom: 1.4rem;
  letter-spacing: -0.02em;
}

.ph-headline-accent {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ph-desc {
  font-size: 1.05rem;
  color: var(--text-mid);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 500px;
}

.ph-cta-row,
.ph-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.4rem;
}

.ph-trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
}

.ph-trust-item {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .82rem;
  color: var(--text-mid);
  font-weight: 500;
}

.ph-trust-item svg {
  flex-shrink: 0;
}

/* Visual side */
.ph-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.ph-visual-stage {
  position: relative;
  width: 460px;
  height: 420px;
}

/* Orbit rings */
.ph-orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(79, 70, 229, 0.12);
}

.ph-orbit-1 {
  width: 320px;
  height: 320px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: ph-spin 40s linear infinite;
}

.ph-orbit-2 {
  width: 420px;
  height: 420px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: ph-spin 60s linear infinite reverse;
}

@keyframes ph-spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Floating cards base */
.ph-float-card {
  position: absolute;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  border: 1px solid rgba(79, 70, 229, 0.10);
  box-shadow:
    0 8px 32px rgba(79, 70, 229, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.ph-float-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    0 16px 48px rgba(79, 70, 229, 0.14),
    0 4px 12px rgba(0, 0, 0, 0.06);
}

.ph-card-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  background: rgba(241, 245, 249, 0.8);
  border-bottom: 1px solid rgba(79, 70, 229, 0.06);
}

.ph-card-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.ph-card-title {
  font-family: var(--f-mono);
  font-size: .62rem;
  color: var(--text-low);
  margin-left: 6px;
  letter-spacing: .04em;
}

/* Dashboard card */
.ph-card-dash {
  width: 220px;
  top: 5%;
  right: 2%;
  animation: ph-float-1 6s ease-in-out infinite;
  z-index: 3;
}

.ph-card-body-dash {
  padding: 14px 14px 16px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.ph-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 52px;
  flex: 1;
}

.ph-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: var(--grad-accent);
  opacity: 0.7;
  transition: height 0.8s var(--ease);
}

.ph-bar:nth-child(even) {
  opacity: 0.45;
  background: linear-gradient(180deg, #818cf8, #c4b5fd);
}

.ph-dash-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.ph-dash-num {
  font-family: var(--f-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: #10b981;
  line-height: 1;
}

.ph-dash-label {
  font-size: .6rem;
  color: var(--text-low);
  margin-top: 2px;
}

/* Mobile app card */
.ph-card-mobile {
  width: 140px;
  bottom: 2%;
  left: 5%;
  border-radius: 20px;
  animation: ph-float-2 7s ease-in-out infinite;
  z-index: 3;
}

.ph-mobile-screen {
  padding: 10px 12px 8px;
}

.ph-mobile-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ph-mobile-status span {
  font-family: var(--f-mono);
  font-size: .6rem;
  font-weight: 600;
  color: var(--text-hi);
}

.ph-mobile-dots {
  display: flex;
  gap: 3px;
}

.ph-mobile-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-low);
}

.ph-mobile-avatar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.ph-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #818cf8, #c084fc);
}

.ph-avatar-lines div {
  height: 5px;
  border-radius: 3px;
  background: var(--surface-3);
  margin-bottom: 4px;
}

.ph-avatar-lines div:first-child {
  width: 55px;
}

.ph-avatar-lines div:last-child {
  width: 38px;
}

.ph-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.ph-mobile-row {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-2);
}

.ph-mobile-row.short {
  width: 65%;
}

.ph-mobile-nav {
  display: flex;
  justify-content: space-around;
  padding-top: 8px;
  border-top: 1px solid var(--surface-3);
}

.ph-mobile-nav span {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: var(--surface-3);
}

.ph-mobile-nav span.active {
  background: var(--blue);
}

/* Code terminal card */
.ph-card-code {
  width: 200px;
  bottom: 18%;
  right: 10%;
  animation: ph-float-3 8s ease-in-out infinite;
  z-index: 2;
}

.ph-code-body {
  padding: 10px 12px 14px;
  font-family: var(--f-mono);
  font-size: .62rem;
  line-height: 1.8;
  color: var(--text-mid);
}

.ph-code-kw {
  color: var(--blue);
  font-weight: 600;
}

.ph-code-fn {
  color: var(--blue);
}

.ph-code-success {
  color: #10b981;
  font-weight: 600;
}

/* Float animations */
@keyframes ph-float-1 {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-12px);
  }
}

@keyframes ph-float-2 {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes ph-float-3 {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-8px);
  }
}

/* Achievement badges */
.ph-badge {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  border: 1px solid rgba(79, 70, 229, 0.10);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.08);
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-hi);
  z-index: 4;
  white-space: nowrap;
}

.ph-badge svg {
  flex-shrink: 0;
}

.ph-badge-1 {
  top: 0;
  left: 8%;
  animation: ph-float-badge 5s ease-in-out infinite;
}

.ph-badge-2 {
  top: 40%;
  right: -2%;
  animation: ph-float-badge 6s ease-in-out 1s infinite;
}

.ph-badge-3 {
  bottom: 0;
  left: 32%;
  animation: ph-float-badge 7s ease-in-out 2s infinite;
}

@keyframes ph-float-badge {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-6px);
  }
}

/* Connector nodes */
.ph-node {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  z-index: 5;
}

.ph-node::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  animation: ph-pulse 2.5s ease-in-out infinite;
}

.ph-node-1 {
  top: 25%;
  left: 35%;
  background: var(--blue);
}

.ph-node-1::after {
  background: rgba(79, 70, 229, 0.2);
}

.ph-node-2 {
  top: 55%;
  right: 25%;
  background: var(--blue);
}

.ph-node-2::after {
  background: rgba(124, 58, 237, 0.2);
  animation-delay: .6s;
}

.ph-node-3 {
  bottom: 30%;
  left: 45%;
  background: #0ea5e9;
}

.ph-node-3::after {
  background: rgba(14, 165, 233, 0.2);
  animation-delay: 1.2s;
}

.ph-node-4 {
  top: 15%;
  right: 35%;
  background: #10b981;
}

.ph-node-4::after {
  background: rgba(16, 185, 129, 0.2);
  animation-delay: 1.8s;
}

@keyframes ph-pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.6;
  }

  50% {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* ============ MINIMAL MASONRY IMAGE GALLERY GRID ============ */
.gallery-grid {
  columns: 3 300px;
  column-gap: 0.75rem;
  margin-top: 1rem;
}

.gallery-card {
  break-inside: avoid;
  margin-bottom: 0.75rem;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
  will-change: opacity, transform;
  cursor: pointer !important;
}

/* Image Lightbox Modal */
.gallery-card,
.gallery-card img {
  cursor: pointer !important;
}

.pf-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
  padding: 1.5rem;
}

.pf-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.pf-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.95);
  transition: transform 0.3s var(--ease);
}

.pf-lightbox.is-open .pf-lightbox-content {
  transform: scale(1);
}

.pf-lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  background: #ffffff;
}

.pf-lightbox-caption {
  margin-top: 1rem;
  color: #ffffff;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.pf-lightbox-cat {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  background: var(--grad-accent);
  color: #ffffff;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
}

.pf-lightbox-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.pf-lightbox-close {
  position: absolute;
  top: -45px;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: none;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.pf-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.4);
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.14);
  border-color: rgba(79, 70, 229, 0.35);
}

/* Tab Switching Smooth Animations */
.gallery-card.is-hidden {
  display: none !important;
  opacity: 0;
  transform: translateY(20px) scale(0.92);
}

.gallery-card.filtering-out {
  opacity: 0 !important;
  transform: translateY(16px) scale(0.93) !important;
  pointer-events: none;
}

.gallery-card.filtering-in {
  animation: tabCardFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tabCardFadeIn {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.92);
  }

  60% {
    opacity: 0.8;
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.gallery-card img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  transition: transform 0.5s var(--ease);
}

.gallery-card:hover img {
  transform: scale(1.03);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 25%, rgba(15, 23, 42, 0.88) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.2rem;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.gallery-card:hover .gallery-overlay {
  opacity: 1;
}

.gallery-cat {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a5b4fc;
  background: rgba(79, 70, 229, 0.35);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  width: max-content;
  margin-bottom: 0.4rem;
  border: 1px solid rgba(165, 180, 252, 0.25);
  transform: translateY(8px);
  transition: transform 0.35s var(--ease);
}

.gallery-title {
  font-family: var(--f-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  transform: translateY(8px);
  transition: transform 0.35s var(--ease);
}

.gallery-card:hover .gallery-cat,
.gallery-card:hover .gallery-title {
  transform: translateY(0);
}

.gallery-card.is-hidden {
  display: none !important;
}

/* ============ RESPONSIVE MEDIA QUERIES ============ */
@media (max-width: 1080px) {
  .ph-hero-inner {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }

  .ph-visual-stage {
    width: 380px;
    height: 360px;
  }

  .ph-card-dash {
    width: 190px;
  }

  .ph-card-mobile {
    width: 120px;
  }

  .ph-card-code {
    width: 170px;
  }
}

@media (max-width: 860px) {
  .ph-hero {
    padding: 8rem 0 4rem;
  }

  .ph-hero-inner,
  .ph-hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .ph-content {
    max-width: 100%;
  }

  .ph-desc {
    max-width: 100%;
    margin-inline: auto;
  }

  .ph-cta-row,
  .ph-actions {
    justify-content: center;
  }

  .ph-trust-strip {
    justify-content: center;
  }

  .ph-visual-stage {
    width: 340px;
    height: 320px;
    margin: 0 auto;
  }

  .ph-card-dash {
    width: 180px;
  }

  .ph-card-mobile {
    width: 110px;
  }

  .ph-card-code {
    width: 160px;
  }

  .gallery-grid {
    columns: 2 240px;
    column-gap: 0.6rem;
  }

  .gallery-card {
    margin-bottom: 0.6rem;
  }
}

@media (max-width: 560px) {
  .ph-hero {
    padding: 7rem 0 3rem;
  }

  .ph-cta-row,
  .ph-actions {
    flex-direction: column;
  }

  .ph-cta-row .btn,
  .ph-actions .btn {
    width: 100%;
  }

  .ph-trust-strip {
    flex-direction: column;
    align-items: center;
    gap: .8rem;
  }

  .ph-visual-stage {
    width: 280px;
    height: 260px;
  }

  .ph-card-dash {
    width: 155px;
  }

  .ph-card-mobile {
    width: 100px;
  }

  .ph-card-code {
    width: 140px;
    bottom: 10%;
    right: 2%;
  }

  .ph-badge {
    font-size: .6rem;
    padding: 4px 8px;
  }

  .ph-orbit-2 {
    display: none;
  }

  .gallery-grid {
    columns: 1;
    column-gap: 0;
  }
}

/* ==========================================================================
   PORTFOLIO PAGE LIGHT THEME OVERRIDES
   All sections are light theme; navbar header & footer remain dark only.
   ========================================================================== */

body.portfolio-page {
  background-color: #f8fafc !important;
  color: #334155 !important;
}

body.portfolio-page::before {
  background-image:
    linear-gradient(rgba(79, 70, 229, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 70, 229, 0.05) 1px, transparent 1px) !important;
  opacity: 0.8 !important;
}

body.portfolio-page::after {
  background: #f8fafc !important;
}

/* Header Navbar - Dark Theme Only */
body.portfolio-page .navbar {
  background: rgba(15, 23, 42, 0.96) !important;
  backdrop-filter: blur(14px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(140%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
}

body.portfolio-page .navbar .nav-link {
  color: #cbd5e1 !important;
}

body.portfolio-page .navbar .nav-link:hover,
body.portfolio-page .navbar .nav-link.active-link {
  color: #ffffff !important;
}

body.portfolio-page .navbar .brand-logo {
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.5)) !important;
}

body.portfolio-page .navbar .menu-toggle span {
  background: #ffffff !important;
}

body.portfolio-page .mobile-menu {
  background: #0f172a !important;
  color: #f8fafc !important;
}

body.portfolio-page .mobile-menu .mobile-link {
  color: #cbd5e1 !important;
}

body.portfolio-page .mobile-menu .mobile-link:hover,
body.portfolio-page .mobile-menu .mobile-link.active-link {
  color: #ffffff !important;
}

/* Sections - Light Theme */
body.portfolio-page .section {
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

body.portfolio-page .section.section-alt {
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%) !important;
  border-bottom: 1px solid #e2e8f0;
}

body.portfolio-page .section:last-of-type,
body.portfolio-page section:last-of-type {
  border-bottom: none !important;
}

body.portfolio-page .section-title,
body.portfolio-page h1,
body.portfolio-page h2,
body.portfolio-page h3,
body.portfolio-page h4 {
  color: #0f172a !important;
}

body.portfolio-page .section-sub,
body.portfolio-page p {
  color: #475569;
}

body.portfolio-page .eyebrow {
  color: #4f6bff !important;
}

body.portfolio-page .eyebrow::before {
  background: #4f6bff !important;
}

/* Hero Section - Light Theme */
body.portfolio-page .ph-hero {
  background: linear-gradient(175deg, #f8fafc 0%, #eef2ff 35%, #f5f3ff 65%, #faf5ff 100%) !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.portfolio-page .ph-headline {
  color: #0f172a !important;
}

body.portfolio-page .ph-desc {
  color: #475569 !important;
}

body.portfolio-page .ph-eyebrow {
  color: #4f6bff !important;
  background: rgba(79, 107, 255, 0.08) !important;
  border-color: rgba(79, 107, 255, 0.18) !important;
}

body.portfolio-page .ph-trust-item {
  color: #475569 !important;
}

/* Filter Bar */
body.portfolio-page .filter-bar {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

body.portfolio-page .filter-btn {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 0.55rem 1.35rem;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  transition: all 0.3s var(--ease);
  cursor: pointer;
}

body.portfolio-page .filter-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
}

body.portfolio-page .filter-btn.is-active {
  background: linear-gradient(135deg, #4f6bff, #6a80ff) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 4px 14px rgba(79, 107, 255, 0.35) !important;
}

/* Gallery Cards */
body.portfolio-page .gallery-grid {
  display: block !important;
  columns: 3 320px !important;
  column-gap: 1.25rem !important;
}

body.portfolio-page .gallery-card {
  break-inside: avoid !important;
  margin-bottom: 1.25rem !important;
  grid-column: auto !important;
  grid-row: auto !important;
  background: #ffffff !important;
  border: 4px solid #ffffff !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04) !important;
  overflow: hidden !important;
}

body.portfolio-page .gallery-card img {
  width: 100% !important;
  height: auto !important;
  display: block !important;
  object-fit: contain !important;
  filter: none !important;
  border: 1px solid rgba(241, 245, 249, 0.8) !important;
  border-radius: 8px !important;
}

body.portfolio-page .gallery-card:hover {
  box-shadow: 0 18px 40px rgba(79, 70, 229, 0.18), 0 4px 12px rgba(0, 0, 0, 0.06) !important;
  border-color: #ffffff !important;
}

body.portfolio-page .gallery-overlay {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 20%, rgba(15, 23, 42, 0.9) 100%) !important;
}

body.portfolio-page .gallery-title {
  color: #ffffff !important;
}

body.portfolio-page .gallery-cat {
  color: #ffffff !important;
  background: rgba(79, 107, 255, 0.85) !important;
  border: 1px solid rgba(122, 154, 255, 0.4) !important;
}

/* Buttons */
body.portfolio-page .btn-ghost {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04) !important;
}

body.portfolio-page .btn-ghost:hover {
  background: #f8fafc !important;
  border-color: #4f6bff !important;
  color: #4f6bff !important;
}

body.portfolio-page .btn-primary {
  background: linear-gradient(135deg, #4f6bff 0%, #6a80ff 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 24px -6px rgba(79, 107, 255, 0.4) !important;
}

body.portfolio-page .btn-primary:hover {
  box-shadow: 0 12px 28px -6px rgba(79, 107, 255, 0.6) !important;
}

/* Floating visual elements on Hero */
body.portfolio-page .ph-float-card {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(79, 70, 229, 0.15) !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08) !important;
}

body.portfolio-page .ph-card-header {
  background: #f1f5f9 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.portfolio-page .ph-card-title {
  color: #475569 !important;
}

body.portfolio-page .ph-code-body {
  color: #334155 !important;
}

body.portfolio-page .ph-mobile-status span {
  color: #0f172a !important;
}

body.portfolio-page .ph-badge {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(79, 70, 229, 0.15) !important;
  color: #0f172a !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08) !important;
}

/* Footer - Same as Home Page */
body.portfolio-page .site-footer {
  background: linear-gradient(180deg, #131126 0%, #1a1635 50%, #0c0a18 100%) !important;
  color: var(--text-mid);
  border-top: none;
}

body.portfolio-page .site-footer h5 {
  color: #f6f4fd !important;
}

body.portfolio-page .site-footer .footer-brand p,
body.portfolio-page .site-footer .footer-col a,
body.portfolio-page .site-footer .footer-contact-item span,
body.portfolio-page .site-footer .footer-contact-item a,
body.portfolio-page .site-footer .footer-bottom p,
body.portfolio-page .site-footer .footer-legal a {
  color: var(--text-mid);
}

body.portfolio-page .site-footer .footer-col a:hover,
body.portfolio-page .site-footer .footer-contact-item a:hover,
body.portfolio-page .site-footer .footer-legal a:hover {
  color: var(--blue) !important;
}

body.portfolio-page .back-to-top {
  background: rgba(15, 23, 42, 0.9) !important;
  color: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.3) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25) !important;
}

body.portfolio-page .back-to-top:hover {
  background: #4f6bff !important;
  border-color: #4f6bff !important;
  color: #ffffff !important;
}

/* CTA Section & Refined Button Styling */
.section-cta-banner {
  background: #f8fafc !important;
  padding: 5.5rem 0 8.5rem !important; /* Generous space after button */
}

.btn-cta-subtle {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.6rem !important;
  padding: 0.9rem 2.2rem !important;
  font-family: var(--f-body, sans-serif) !important;
  font-size: 1.02rem !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 50px !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06) !important;
  transition: all 0.3s var(--ease) !important;
  cursor: pointer !important;
  text-decoration: none !important;
}

.btn-cta-subtle:hover {
  background: #4f6bff !important;
  color: #ffffff !important;
  border-color: #4f6bff !important;
  box-shadow: 0 8px 22px rgba(79, 107, 255, 0.25) !important;
  transform: translateY(-2px) !important;
}

/* Gallery Case Study & Direct Image Buttons */
.gallery-actions {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  flex-wrap: wrap !important;
  margin-top: 0.6rem !important;
}

.gallery-case-link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  font-family: var(--f-body, sans-serif) !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, #4f6bff 0%, #6a80ff 100%) !important;
  padding: 0.4rem 0.9rem !important;
  border-radius: 999px !important;
  width: max-content !important;
  box-shadow: 0 4px 14px rgba(79, 107, 255, 0.35) !important;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease) !important;
  text-decoration: none !important;
  transform: translateY(8px);
}

.gallery-card:hover .gallery-case-link {
  transform: translateY(0);
}

.gallery-case-link:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.55) !important;
  color: #ffffff !important;
}

.gallery-view-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  font-family: var(--f-body, sans-serif) !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.22) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  padding: 0.4rem 0.9rem !important;
  border-radius: 999px !important;
  width: max-content !important;
  cursor: pointer !important;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease) !important;
  transform: translateY(8px);
}

.gallery-card:hover .gallery-view-btn {
  transform: translateY(0);
}

.gallery-view-btn:hover {
  background: rgba(255, 255, 255, 0.38) !important;
  transform: translateY(-2px) !important;
  color: #ffffff !important;
}