/* =========================================================
   PROJECTS PAGE STYLES
   Prefixes: .portfolio-, .port-
========================================================= */

/* 1. HIGH-END CINEMATIC HERO */
#portfolio-premium-hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  padding: 120px 5vw 6rem 5vw;
  background-color: var(--bg-dark);
  overflow: hidden;
}

/* Deep Cinematic Background */
.portfolio-hero-bg-image {
  position: absolute;
  inset: 0;
  /* Uses a different background image for variety */
  background: url("https://picsum.photos/id/1032/1920/1080") center/cover
    no-repeat;
  filter: grayscale(100%) brightness(0.3);
  z-index: 0;
}

.portfolio-hero-dark-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(4, 12, 28, 0.95) 0%,
    rgba(8, 40, 99, 0.7) 100%
  );
  backdrop-filter: blur(4px);
  z-index: 1;
}

/* Massive Abstract Typography */
.portfolio-bg-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22vw;
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.08);
  z-index: 2;
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: -5px;
}

/* Ambient Brand Glows */
.portfolio-hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 2;
  opacity: 0.5;
}
.portfolio-hero-orb.orb-red {
  width: 500px;
  height: 500px;
  background: var(--brand-red);
  bottom: -150px;
  left: -100px;
}
.portfolio-hero-orb.orb-blue {
  width: 600px;
  height: 600px;
  background: var(--brand-blue);
  top: -200px;
  right: -100px;
}

/* Animated Architectural Lines */
.portfolio-structural-lines {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.p-line {
  position: absolute;
  background: rgba(255, 255, 255, 0.05);
}
.line-h1 {
  width: 100%;
  height: 1px;
  top: 60%;
  left: 0;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}
.line-v1 {
  width: 1px;
  height: 100%;
  top: 0;
  left: 15%;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Layout & Content */
.portfolio-hero-wrapper {
  position: relative;
  z-index: 4;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.portfolio-hero-text-block {
  max-width: 800px;
  border-left: 4px solid var(--brand-red);
  padding-left: 2.5rem;
  background: linear-gradient(90deg, rgba(4, 12, 28, 0.6) 0%, transparent 100%);
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.portfolio-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0.4rem 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 3px;
  border-radius: 4px;
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
}

.portfolio-pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--brand-red);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--brand-red);
  animation: portPulse 2s infinite;
}

@keyframes portPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(254, 28, 32, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(254, 28, 32, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(254, 28, 32, 0);
  }
}

.portfolio-hero-title {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 1.5rem;
  color: var(--text-main);
  text-transform: uppercase;
}

.portfolio-text-glow {
  color: transparent;
  -webkit-text-stroke: 2px var(--brand-red);
  text-shadow: 0 0 30px rgba(254, 28, 32, 0.3);
}

.portfolio-hero-subtitle {
  font-size: 1.15rem;
  color: #cbd5e1;
  font-weight: 300;
  line-height: 1.7;
  max-width: 600px;
}

/* Seamless blend into the next section */
.portfolio-hero-bottom-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 150px;
  background: linear-gradient(to bottom, transparent, var(--bg-dark));
  z-index: 4;
  pointer-events: none;
}

/* =========================================================
   2. HIGH-END FILTERABLE GALLERY
========================================================= */
#portfolio-gallery-section {
  background: var(--bg-dark);
  padding: 4rem 2rem 8rem 2rem;
}

.portfolio-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Filter Controls */
.portfolio-filter-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 4rem;
}

.port-filter-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.port-filter-btn:hover {
  background: rgba(254, 28, 32, 0.1);
  border-color: rgba(254, 28, 32, 0.3);
  color: #fff;
}

.port-filter-btn.active {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #fff;
  box-shadow: 0 0 20px rgba(254, 28, 32, 0.4);
}

/* Gallery Grid */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

/* Project Cards */
.port-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4/3; /* Enforces a cinematic shape */
  background: #000;
  cursor: pointer;
  transition:
    transform 0.4s ease,
    opacity 0.4s ease;
  border: 1px solid rgba(8, 40, 99, 0.5);
}

.port-card.hide {
  display: none; /* Used by JS filter */
}

.port-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.8s cubic-bezier(0.25, 1, 0.5, 1),
    filter 0.6s ease;
  filter: grayscale(40%) brightness(0.8);
}

.port-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(4, 12, 28, 0.95) 0%,
    rgba(4, 12, 28, 0.4) 50%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.port-card-content {
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.port-category {
  font-size: 0.75rem;
  color: var(--brand-red);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 800;
  margin-bottom: 0.5rem;
  display: block;
}

.port-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.5rem;
}

.port-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-red);
  color: #fff;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(254, 28, 32, 0.4);
}

/* Hover Effects */
@media (min-width: 769px) {
  .port-card:hover {
    border-color: var(--brand-red);
    box-shadow: 0 15px 35px rgba(254, 28, 32, 0.15);
  }
  .port-card:hover .port-card-img {
    transform: scale(1.08);
    filter: grayscale(0%) brightness(1);
  }
  .port-card:hover .port-card-overlay {
    opacity: 1;
  }
  .port-card:hover .port-card-content {
    transform: translateY(0);
  }
  .port-link-btn:hover {
    background: #fff;
    color: var(--brand-red);
    transform: scale(1.1);
  }
}

/* Responsive Fixes */
@media (max-width: 768px) {
  #portfolio-premium-hero {
    min-height: 60vh;
    padding: 140px 1.5rem 4rem 1.5rem;
  }
  .portfolio-hero-text-block {
    padding-left: 1.5rem;
    border-left-width: 3px;
    background: transparent;
  }
  .portfolio-bg-watermark {
    font-size: 26vw;
  }
  .portfolio-hero-title {
    font-size: 2.5rem;
  }
  .portfolio-hero-subtitle {
    font-size: 1rem;
  }

  .portfolio-filter-controls {
    gap: 0.5rem;
  }
  .port-filter-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
  }

  /* Force visibility on mobile since no hover exists */
  .port-card-img {
    filter: grayscale(0%) brightness(0.8);
  }
  .port-card-overlay {
    opacity: 1;
  }
  .port-card-content {
    transform: translateY(0);
  }
  .port-card {
    border-color: rgba(254, 28, 32, 0.3);
  }
}
