/* Custom Portfolio Grid Inspired by Attached Reference Layout */
.section-portfolio-custom-grid {
  background-color: #FFFFFF;
  padding: 40px 0 120px;
  font-family: 'Inter', sans-serif;
}

.portfolio-grid-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 30px;
}

.portfolio-custom-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* Card Common Base */
.custom-card-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 340px;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  text-decoration: none;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,0.06));
}

.custom-card-wrapper:hover {
  transform: translateY(-8px);
}

.card-label {
  font-family: 'JetBrains Mono', monospace, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #333;
  display: block;
}

.card-body {
  flex: 1;
  background-color: #F2F2F2;
  padding: 16px 28px 32px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
}

.card-title {
  font-family: 'Inter Tight', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #111;
  margin-bottom: 12px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.card-desc {
  font-size: 13.5px;
  color: #555;
  line-height: 1.55;
  margin: 0;
}

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

.card-bullets li {
  position: relative;
  padding-left: 16px;
  font-size: 13.5px;
  color: #555;
  margin-bottom: 6px;
  line-height: 1.4;
  font-weight: 500;
}

.card-bullets li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #111;
  font-weight: bold;
}

/* Dots */
.card-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: #111;
  border-radius: 50%;
  z-index: 5;
}

/* --- Card Type A (Cutout Top Right) --- */
.card-type-a .card-top-row {
  width: 100%;
  height: 60px;
}
.card-type-a .card-tab {
  width: 55%;
  height: 100%;
  background-color: #F2F2F2;
  border-top-left-radius: 24px;
  border-top-right-radius: 16px;
  padding: 20px 28px 0;
  position: relative;
  z-index: 2;
  margin-bottom: -1px;
}
.card-type-a .card-tab::after {
  content: '';
  position: absolute;
  right: -24px;
  bottom: 0;
  width: 24px;
  height: 24px;
  background: radial-gradient(circle at top right, transparent 24px, #F2F2F2 24px);
}
.card-type-a .card-body {
  border-top-right-radius: 24px;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
}
.card-type-a .card-dot {
  top: 16px;
  right: 18%;
}

/* --- Card Type B (Notch Top Middle) --- */
.card-type-b .card-tabs-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  height: 60px;
  margin-bottom: -1px;
}
.card-type-b .card-tab-left {
  width: 35%;
  height: 100%;
  background-color: #F2F2F2;
  border-top-left-radius: 24px;
  border-top-right-radius: 16px;
  padding: 20px 28px 0;
  position: relative;
  z-index: 2;
}
.card-type-b .card-tab-left::after {
  content: '';
  position: absolute;
  right: -24px;
  bottom: 0;
  width: 24px;
  height: 24px;
  background: radial-gradient(circle at top right, transparent 24px, #F2F2F2 24px);
}
.card-type-b .card-tab-right {
  width: 35%;
  height: 100%;
  background-color: #F2F2F2;
  border-top-right-radius: 24px;
  border-top-left-radius: 16px;
  position: relative;
  z-index: 2;
}
.card-type-b .card-tab-right::before {
  content: '';
  position: absolute;
  left: -24px;
  bottom: 0;
  width: 24px;
  height: 24px;
  background: radial-gradient(circle at top left, transparent 24px, #F2F2F2 24px);
}
.card-type-b .card-body {
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
}

/* --- Card Type C (Wide Card Span 2, Cutout Bottom Right) --- */
.card-type-c {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
}
.card-type-c .card-upper-body {
  width: 100%;
  flex: 1;
  background-color: #F2F2F2;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border-bottom-right-radius: 24px;
  padding: 24px 32px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 2;
  min-height: 250px;
}
.card-type-c .card-lower-body {
  width: 78%;
  height: 60px;
  background-color: #F2F2F2;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 16px;
  position: relative;
  margin-top: -1px;
}
.card-type-c .card-lower-body::after {
  content: '';
  position: absolute;
  right: -24px;
  top: 0;
  width: 24px;
  height: 24px;
  background: radial-gradient(circle at bottom right, transparent 24px, #F2F2F2 24px);
}

/* --- Card Type D (Notch Top Right) --- */
.card-type-d .card-tabs-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  height: 60px;
  margin-bottom: -1px;
}
.card-type-d .card-tab-left {
  width: 60%;
  height: 100%;
  background-color: #F2F2F2;
  border-top-left-radius: 24px;
  border-top-right-radius: 16px;
  padding: 20px 28px 0;
  position: relative;
  z-index: 2;
}
.card-type-d .card-tab-left::after {
  content: '';
  position: absolute;
  right: -24px;
  bottom: 0;
  width: 24px;
  height: 24px;
  background: radial-gradient(circle at top right, transparent 24px, #F2F2F2 24px);
}
.card-type-d .card-tab-right {
  width: 18%;
  height: 100%;
  background-color: #F2F2F2;
  border-top-right-radius: 24px;
  border-top-left-radius: 16px;
  position: relative;
  z-index: 2;
}
.card-type-d .card-tab-right::before {
  content: '';
  position: absolute;
  left: -24px;
  bottom: 0;
  width: 24px;
  height: 24px;
  background: radial-gradient(circle at top left, transparent 24px, #F2F2F2 24px);
}
.card-type-d .card-body {
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
}

/* --- CTA Card (Orange Chamfered) --- */
.custom-cta-card {
  background-color: #FF4326;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: white;
  transition: all 0.3s ease;
  clip-path: polygon(
    20px 0, 
    calc(100% - 20px) 0, 
    100% 20px, 
    100% calc(100% - 20px), 
    calc(100% - 20px) 100%, 
    20px 100%, 
    0 calc(100% - 20px), 
    0 20px
  );
  height: 100%;
  min-height: 340px;
}

.custom-cta-card:hover {
  transform: scale(1.03);
  background-color: #E03115;
}

.cta-label {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.08em;
  color: white;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .portfolio-custom-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .card-type-c {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .portfolio-custom-grid {
    grid-template-columns: 1fr;
  }
  .card-type-c {
    grid-column: span 1;
  }
  .card-type-c .card-lower-body {
    width: 70%;
  }
}
