/* Works page base */
.works-page {
  overflow-x: clip;
}

.works-page main > .wrap,
.works-page .works-hero > .wrap,
.works-page .footer,
.works-page .works-metrics,
.works-page .case-studies,
.works-page .trusted,
.works-page .works-testimonials,
.works-page .cta {
  width: calc(100% - 64px);
  max-width: 1536px;
  margin-inline: auto;
}

/* Hero section */
.works-hero {
  position: relative;
  height: 40vh;
  min-height: 495px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background-color: #fff;
  background-image: radial-gradient(
    circle,
    rgba(194, 205, 200, 0.72) 1px,
    transparent 1.25px
  );
  background-size: 18px 18px;
  background-position: 0 0;
  display: flex;
  align-items: stretch;
}
.works-hero .wrap {
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(35px, 5vw, 90px);
  padding: 150px 0 0;
  margin-top: 0;
}
.works-hero-copy {
  position: relative;
  z-index: 1;
}
.works-hero-copy h1,
.works-hero-copy > p,
.works-hero-copy .hero-actions {
  max-width: 760px;
}
.works-hero h1 {
  font-size: clamp(54px, 5.3vw, 78px);
  line-height: 1.05;
  margin: 0 0 20px;
}
.works-hero p {
  margin: 0 0 22px;
  max-width: 700px;
}
.hero-actions {
  display: flex;
  gap: 12px;
}
/* Folder-style collection cards */
.works-collection {
  position: absolute;
  right: 0;
  bottom: -68px;
  width: 61%;
  margin-top: 0;
  overflow: visible;
}
.collection-cards {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 0;
  min-height: 302px;
  padding: 54px 4px 14px;
}
.works-collection::after {
  position: absolute;
  right: 6%;
  bottom: 10px;
  left: 6%;
  height: 120px;
  z-index: 0;
  content: "";
  background: radial-gradient(ellipse, rgba(255, 201, 40, .38), rgba(255, 201, 40, 0) 68%);
  filter: blur(18px);
  pointer-events: none;
}
.collection-card {
  --card-color: #ffc928;
  --card-glow: rgba(255, 201, 40, .24);
  position: relative;
  min-height: 228px;
  padding: 18px 14px 0;
  overflow: visible;
  border-radius: 0 12px 12px 12px;
  color: #24251e;
  box-shadow: 0 8px 14px rgba(28, 42, 36, .1), 0 0 15px var(--card-glow);
  transform: translateY(26px) rotate(-4deg);
  transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease, filter .35s ease;
}
.collection-card::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 0;
  width: 48%;
  height: 24px;
  border-radius: 11px 16px 0 0;
  background: inherit;
}
.collection-card:nth-child(1) { z-index: 1; transform: translate(20px, 24px) rotate(-8deg); }
.collection-card:nth-child(2) { z-index: 2; margin-left: -8px; transform: translate(8px, 54px) rotate(4deg); }
.collection-card:nth-child(3) { z-index: 3; margin-left: -8px; transform: translate(-5px, -22px) rotate(-5deg); }
.collection-card:nth-child(4) { z-index: 4; margin-left: -8px; transform: translate(-12px, 36px) rotate(7deg); }
.works-collection:hover .collection-card { margin-left: 0; transform: translateY(100px) rotate(0deg); }
.works-collection:hover .collection-card:hover { z-index: 10; transform: translateY(-52px) rotate(0deg) scale(1.025); box-shadow: 0 12px 20px rgba(28,42,36,.13), 0 0 25px var(--card-glow); filter: saturate(1.06); }
.collection-card--convogents { --card-color: #178671; --card-glow: rgba(23, 134, 113, .52); background: linear-gradient(145deg, #1d9a84 0%, #178671 52%, #0f6958 100%); color: #fff; }
.collection-card--periodic { --card-color: #1aa3d8; --card-glow: rgba(26, 163, 216, .52); background: linear-gradient(145deg, #43b9e4 0%, #1aa3d8 52%, #1179a8 100%); color: #fff; }
.collection-card--pharmasave { --card-color: #d11242; --card-glow: rgba(209, 18, 66, .52); background: linear-gradient(145deg, #ea3b68 0%, #d11242 52%, #9f0e32 100%); color: #fff; }
.collection-card--detailing { --card-color: #eb3323; --card-glow: rgba(235, 51, 35, .52); background: linear-gradient(145deg, #f05a4d 0%, #eb3323 52%, #a91e15 100%); color: #fff; }
.collection-card-copy { position: relative; z-index: 1; }
.collection-card-type { display: block; margin-bottom: 9px; color: rgba(255, 255, 255, .72); font: 600 9px var(--font-subheading);}
.collection-card h2 { font-size: 20px; font-weight: 700; }
.collection-card p { margin: 9px 0 0; color: inherit; font-family: var(--font-heading); font-size: 12px; line-height: 1.42; opacity: .76; }
.collection-card-art { position: absolute; right: 7px; bottom: 7px; left: 7px; height: 104px; border-radius: 8px; opacity: .92; overflow: hidden; background-position: center; background-size: cover; box-shadow: inset 0 0 0 1px rgba(76, 55, 10, .1); }
.collection-card-art--convogents { background-image: url('../assets/projects/convogents-1.png'); }
.collection-card-art--periodic { background-image: url('../assets/projects/periodic-1.png'); }
.collection-card-art--pharmasave { background-image: url('../assets/projects/pharmasave-1.png'); }
.collection-card-art--detailing { background-image: url('../assets/projects/detailing-mobeel-1.png'); }
/* Metrics section */
.works-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 58px 0;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.works-metrics div {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.works-metrics strong {
  color: var(--green);
  font-size: 52px;
  font-weight: 500;
}
.works-metrics span {
  color: var(--muted);
  font-size: 12px;
}
/* Case studies section */
.case-studies {
  padding: 80px 35px 45px;
}
.case-studies > header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  margin-bottom: 30px;
}
.case-studies > header h2 {
  font-size: 40px;
  margin-top: 14px;
}
.case-studies > header p {
  font-size: 15px;
  min-width: 330px;
}
.works-grid {
  margin-top: 0;
}
.works-grid article {
  min-height: 430px;
}
.works-grid .project-type {
  display: block;
  color: var(--green);
  font-size: 11px;
  margin-top: 12px;
}
.works-grid h3 {
  margin-top: 4px;
  font-size: 30px;
  line-height: 1.08;
}
.works-grid p {
  font-size: 16px;
  line-height: 1.6;
}
.works-grid a {
  position: absolute;
  right: 15px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--green);
  font-size: 14px;
}
.works-grid a span {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-weight: 400;
}
.works-grid .project-image {
  display: grid;
  place-items: center;
  padding: 12px 18px 0;
  background: #fff;
  background-image: radial-gradient(circle, rgba(204,216,210,.55) 1px, transparent 1px);
  background-size: 18px 18px;
}
.works-grid .project-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 14px 22px rgba(41,61,52,.08));
}
.works-grid .alt {
  filter: saturate(0.92);
}
/* Trusted clients section */
.trusted {
  text-align: center;
  padding: 55px 0 85px;
}
.trusted small {
  font-size: 10px;
  color: #949b98;
}
.trusted .logo-row {
  margin-top: 35px;
}
/* CTA section */
.works-page .cta {
  margin-top: 0;
}
/* Testimonials section */
.works-testimonials {
  padding-top: 85px;
}
.works-testimonials .section-head h2 {
  margin-top: 14px;
}

/* Responsive layout */
@media (max-width: 800px) {
  .works-hero .wrap {
    display: block;
    height: auto;
    min-height: 0;
    padding-top: 115px;
    padding-bottom: 18px;
    margin-top: 60px;
  }
  .works-page main > .wrap,
  .works-page .works-hero > .wrap,
  .works-page .footer,
  .works-page .works-metrics,
  .works-page .case-studies,
  .works-page .trusted,
  .works-page .works-testimonials,
  .works-page .cta {
    width: calc(100% - 28px);
  }

  .works-hero {
    min-height: 0;
    height: auto;
    overflow: visible;
    padding-bottom: 18px;
  }
  .works-hero h1 {
    font-size: 48px;
  }
  .works-metrics strong {
    font-size: 40px;
  }
  .case-studies {
    padding-inline: 0;
  }
  .case-studies > header {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .case-studies > header p {
    min-width: 0;
  }
  .works-grid article {
    min-height: 350px;
  }
  .trusted {
    padding-bottom: 65px;
  }
  .works-collection {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    margin-top: 62px;
  }
  .collection-cards {
    display: block;
    height: 340px;
    min-height: 0;
    padding: 24px 0 0;
  }
  .collection-card,
  .collection-card:nth-child(4) {
    position: absolute;
    top: 24px;
    right: auto;
    left: 50%;
    width: 88%;
    margin-left: 0;
    transform: none;
  }
  .collection-card:nth-child(1) { z-index: 1; transform: translateX(-50%); }
  .collection-card:nth-child(2) { z-index: 2; transform: translateX(-50%); }
  .collection-card:nth-child(3) { z-index: 3; transform: translateX(-50%); }
  .collection-card:nth-child(4) { z-index: 4; transform: translateX(-50%); }
  .collection-card,
  .collection-card:nth-child(1),
  .collection-card:nth-child(2),
  .collection-card:nth-child(3),
  .collection-card:nth-child(4) {
    transform: translateX(-50%);
    transition: transform .32s cubic-bezier(.22, 1, .36, 1), opacity .22s ease;
  }
  .works-collection:hover .collection-card,
  .works-collection:hover .collection-card:hover { margin-left: 0; transform: translateX(-50%); filter: none; }
  .collection-card.is-moving,
  .works-collection:hover .collection-card.is-moving { z-index: 12; transform: translateX(-50%) translateY(34px) scale(.985); opacity: .35; }
}
@media (max-width: 520px) {
  .works-hero h1 {
    font-size: 39px;
  }
  .works-hero p br {
    display: none;
  }
  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }
  .works-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
  .works-metrics strong {
    font-size: 35px;
  }
  .case-studies > header h2 {
    font-size: 31px;
  }
  .works-grid article {
    min-height: 330px;
  }
  .trusted .logo-row {
    grid-template-columns: 1fr 1fr;
  }
  .collection-cards {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-inline: 12px;
  }
  .collection-card,
  .collection-card:nth-child(4) {
    min-height: 235px;
    width: 100%;
  }
  .collection-card:nth-child(even) { margin-left: 0; }
  .collection-card-art { height: 100px; }
}

/* Keep the primary desktop hero height consistent across About, Services and Works. */
@media (min-width: 801px) {
  .works-hero {
    height: 560px;
    min-height: 0;
    max-height: none;
  }
  .works-hero .wrap {
    height: 100%;
    min-height: 0;
    padding-bottom: 0;
  }
}
