/* ════════════════════════════════════════════════════════
   Our Works  –  Bento-style masonry image grid
   ════════════════════════════════════════════════════════ */

/* ── Section wrapper ─────────────────────────── */
#our-works-section {
  position: relative;
  background: #f8faff;
  overflow: hidden;
}

/* Faint top gradient border */
#our-works-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    #1e43f6,
    #5fcdf8,
    #1e43f6,
    transparent
  );
  opacity: 0.5;
}

/* ── Section badge ───────────────────────────── */
.works-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1e43f6;
  background: rgba(30, 67, 246, 0.07);
  border: 1px solid rgba(30, 67, 246, 0.18);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  margin-bottom: 1rem;
}

.works-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1e43f6;
  box-shadow: 0 0 6px rgba(30, 67, 246, 0.6);
  flex-shrink: 0;
}

/* ── Section heading ─────────────────────────── */
.works-headline {
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  font-weight: 900;
  line-height: 1.15;
  color: #0c0f1a;
  letter-spacing: -0.025em;
}

.works-headline .works-hl {
  background: linear-gradient(90deg, #5fcdf8, #1e43f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.works-subline {
  font-size: 1rem;
  color: #64748b;
  max-width: 460px;
  line-height: 1.7;
  margin-top: 0.6rem;
}

/* ── Bento Grid container ────────────────────── */
.works-bento {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 200px;
  gap: 10px;
}

/* ── Individual grid item ────────────────────── */
.works-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  background: #e2e8f0;
}

/* Hero items — span 2 cols × 2 rows */
.works-item.hero-h {
  grid-column: span 2;
  grid-row: span 2;
}

/* Wide items — span 2 cols × 1 row */
.works-item.wide {
  grid-column: span 2;
}

/* Tall items — span 1 col × 2 rows */
.works-item.tall {
  grid-row: span 2;
}

/* Image fills the cell */
.works-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Hover — zoom image */
.works-item:hover img {
  transform: scale(1.08);
}

/* Hover overlay */
.works-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(30, 67, 246, 0.8) 0%,
    rgba(5, 13, 31, 0.72) 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.works-item:hover .works-overlay {
  opacity: 1;
}

/* Overlay icon */
.works-overlay-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.7);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(6px);
}

.works-item:hover .works-overlay-icon {
  transform: scale(1);
}

.works-overlay-icon svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

/* Glow border on hover */
.works-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  border: 2px solid rgba(95, 205, 248, 0);
  transition: border-color 0.4s ease;
  pointer-events: none;
  z-index: 3;
}

.works-item:hover::after {
  border-color: rgba(95, 205, 248, 0.5);
}

/* ── Item number badge (top-left) ────────────── */
.works-num {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
  z-index: 2;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.works-item:hover .works-num {
  opacity: 1;
  transform: translateY(0);
}

/* ── Count tag at header ─────────────────────── */
.works-count-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 0.3rem 1rem;
  margin-top: 1rem;
}

/* ── CTA button ──────────────────────────────── */
.works-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2.2rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  background: linear-gradient(45deg, #5fcdf8 -34%, #1e43f6 66%);
  box-shadow:
    0 8px 32px rgba(30, 67, 246, 0.35),
    0 2px 8px rgba(95, 205, 248, 0.2);
  cursor: pointer;
  border: none;
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.works-cta-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow:
    0 16px 48px rgba(30, 67, 246, 0.5),
    0 4px 16px rgba(95, 205, 248, 0.35);
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 1024px) {
  .works-bento {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 180px;
  }
}

@media (max-width: 768px) {
  .works-bento {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 150px;
    gap: 6px;
  }

  /* Reset hero spans on mobile so nothing bleeds */
  .works-item.hero-h {
    grid-column: span 2;
    grid-row: span 2;
  }

  .works-item.wide {
    grid-column: span 2;
  }
}

@media (max-width: 480px) {
  .works-bento {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 130px;
  }

  .works-item.hero-h {
    grid-column: span 2;
    grid-row: span 1;
  }

  .works-item.wide {
    grid-column: span 2;
  }

  .works-item.tall {
    grid-row: span 1;
  }
}
