/* ═══════════════════════════════
   WORKS & PORTFOLIO STYLES
═══════════════════════════════ */

:root {
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-blur: 16px;
}

/* HERO REFINEMENT */
.works-hero {
  padding: 30px 0 70px;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.works-hero h1 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 1.1;
  margin-bottom: 25px;
  color: #fff;
}

.works-hero h1 em {
  font-style: italic;
  color: var(--red);
  text-shadow: 0 0 40px rgba(190, 30, 45, 0.4);
}

.works-hero p {
  max-width: 700px;
  margin: 0 auto 45px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.hero-nav-btns {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

/* CATEGORY SECTIONS */
.category-section {
  padding: 90px 0;
}

.category-head {
  margin-bottom: 50px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.category-head h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: 2.5rem;
}

.category-head span {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--red);
  font-weight: 700;
}

/* PORTFOLIO GRID */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.project-card {
  position: relative;
  background: var(--card-bg);
  backdrop-filter: blur(var(--card-blur));
  -webkit-backdrop-filter: blur(var(--card-blur));
  border: 1px solid var(--card-border);
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  flex-direction: column;
  margin-top: 25px; /* Added space for the floating pill */
}

.project-card:hover {
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(190, 30, 45, 0.4);
}

.client-logo-overlay {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 5;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.4s ease;
  pointer-events: none;
}

.project-card:hover .client-logo-overlay {
  background: rgba(190, 30, 45, 0.2);
  border-color: rgba(190, 30, 45, 0.4);
}

.project-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(190, 30, 45, 0.4);
}

.project-img-wrap {
  width: 100%;
  overflow: hidden;
  position: relative;
  border-radius: 19px 19px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.02); /* Very subtle backdrop for contained images */
}

#performance .project-img-wrap {
  aspect-ratio: 5 / 6; /* Slightly shorter tall portrait */
}

#performance .project-img-wrap img {
  object-fit: cover;
}

.project-img-wrap img, .project-img-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.6s ease;
  image-rendering: -webkit-optimize-contrast;
}

.project-card:hover .project-img-wrap img, .project-card:hover .project-img-wrap video {
  transform: scale(1.08);
}

.project-info {
  padding: 25px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-info h3 {
  font-family: "Outfit", sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-color, #fff);
  margin-bottom: 8px;
}

.project-info p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* QUICK INFO TOGGLE */
.quick-info-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  padding: 8px 16px;
  border-radius: 99px;
  color: var(--text-color, #fff);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: fit-content;
}

.quick-info-toggle:hover {
  background: rgba(190, 30, 45, 0.15);
  border-color: var(--red);
  transform: translateX(5px);
}

.quick-info-toggle .plus-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--red);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  color: #fff !important;
}

.secondary-cta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-color, #fff);
  opacity: 0.85;
  transition: all 0.3s ease;
  cursor: pointer;
  padding: 7px 14px;
  border-radius: 99px;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
  background: var(--card-bg, rgba(255, 255, 255, 0.05));
  white-space: nowrap;
}

[data-theme="light"] .secondary-cta {
  border-color: rgba(0, 0, 0, 0.12) !important;
  background: rgba(0, 0, 0, 0.04) !important;
}

.secondary-cta:hover {
  opacity: 1;
  border-color: var(--red);
  background: rgba(190, 30, 45, 0.1);
  transform: translateX(5px);
}

/* CARD OVERLAY */
.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 35px;
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
  z-index: 10;
}

.project-card.overlay-active .project-overlay {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.overlay-content h4 {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.8rem;
  color: #fff;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--red);
  display: inline-block;
}

.overlay-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.overlay-list li {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.overlay-list span.label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--red);
  font-weight: 800;
}

.overlay-list span.value {
  font-size: 1rem;
  color: #eee;
  font-weight: 500;
}

.close-overlay {
  position: absolute;
  top: 25px;
  right: 25px;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.3s;
}

.close-overlay:hover {
  opacity: 1;
  color: var(--red);
}
/* CASE STUDY BADGE - Floating pill style */
.case-study-badge {
  position: absolute;
  top: -15px; /* Shifted above the card */
  left: 20px;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  box-shadow: 0 4px 15px rgba(190, 30, 45, 0.4);
  z-index: 15; /* Above everything */
  animation: badgeFloat 3s ease-in-out infinite;
}

@keyframes badgeFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* CASE STUDY PAGE SPECIFIC */
.cs-results-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 60px 0;
  padding: 40px;
  background: rgba(190, 30, 45, 0.05);
  border: 1px solid rgba(190, 30, 45, 0.15);
  border-radius: 20px;
}

.cs-stat-item {
  text-align: center;
}

.cs-stat-num {
  display: block;
  font-family: "Outfit", sans-serif;
  font-size: 3rem;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
  margin-bottom: 10px;
  font-variant-numeric: lining-nums;
}

.cs-stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.cs-content-block {
  margin-bottom: 80px;
}

.cs-content-block h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: 2.5rem;
  margin-bottom: 25px;
  color: #fff;
}

.cs-content-block p {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.8;
  max-width: 800px;
}

.next-cs-footer {
  padding: 100px 0;
  border-top: 1px solid var(--card-border);
  text-align: center;
}

.next-cs-link {
  display: inline-block;
  font-family: "Cormorant Garamond", serif;
  font-size: 3.5rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  transition: color 0.3s;
}

.next-cs-link:hover {
  color: var(--red);
}

/* RESPONSIVE */
@media (max-width: 991px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .category-section { padding: 50px 0; }
  .category-head { margin-bottom: 30px; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
  .works-hero { padding: 40px 0 50px; }
  .works-hero p { margin-bottom: 30px; }
  
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .cs-results-bar {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 30px 20px;
  }
  .works-hero h1 {
    font-size: 3rem;
  }
  .next-cs-link {
    font-size: 2.5rem;
  }

  /* Prevent logo/badge overlap */
  .case-study-badge { left: 15px; top: -12px; font-size: 0.6rem; }
  .client-logo-overlay { top: 10px; right: 10px; padding: 4px 10px; }
}

@media (max-width: 480px) {
  .works-hero h1 { font-size: 2.2rem; }
  .category-head h2 { font-size: 1.8rem; }
  .project-info { padding: 20px; }
}
