/* ==========================================================================
   Home 4 Services - Sticky Stacking Cards Styles
   Inspired by: https://qran.hmehdi.com/index-2.html (Home 4 Services Section)
   ========================================================================== */

:root {
  --h4-bg: #09090b;
  --h4-surface: #121214;
  --h4-card-bg: linear-gradient(160deg, #1d1d21, #111113 65%);
  --h4-card-border: rgba(255, 255, 255, 0.12);
  --h4-card-border-hover: rgba(255, 255, 255, 0.25);
  --h4-text-main: #f4f4f5;
  --h4-text-muted: #a1a1aa;
  --h4-accent: #3b82f6;
  --h4-accent-glow: rgba(59, 130, 246, 0.25);
  --h4-radius-card: 32px;
  --h4-radius-pill: 999px;
  --h4-font-heading: 'Syne', sans-serif;
  --h4-font-body: 'Plus Jakarta Sans', sans-serif;
}

/* Services Container Section */
.h4-services {
  position: relative;
  background-color: var(--h4-bg);
  color: var(--h4-text-main);
  padding: 140px 0 100px;
  overflow: visible;
  min-height: calc(100vh - 160px);
}

.h4-services .container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Head Area (Split Layout) */
.h4-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 72px;
}

@media (min-width: 992px) {
  .h4-head--split {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: flex-end;
    gap: 64px;
  }
}

.h4-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--h4-accent);
  margin-bottom: 16px;
}

.h4-kicker::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--h4-accent);
  box-shadow: 0 0 10px var(--h4-accent);
}

.h4-head__title {
  font-family: var(--h4-font-heading);
  font-size: clamp(34px, 4.5vw, 62px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: #ffffff;
  margin: 0;
}

.h4-head__title em {
  font-style: normal;
  background: linear-gradient(135deg, #ffffff 30%, #a1a1aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.h4-head__lead {
  font-size: 17px;
  line-height: 1.65;
  color: var(--h4-text-muted);
  margin-bottom: 28px;
}

.h4-head__side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Section Action Button */
.h4-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background: #ffffff;
  color: #000000;
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--h4-radius-pill);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
}

.h4-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.h4-btn:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.25);
}

.h4-btn:hover svg {
  transform: translateX(4px);
}

/* Services Stacking List */
.h4-stack {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 992px) {
  .h4-stack {
    gap: 0;
    margin-bottom: 40px;
  }

  .h4-stack__item {
    position: sticky;
    top: calc(90px + var(--i, 0) * 26px);
    margin-bottom: 30px;
    transition: transform 0.2s ease;
  }
}

/* Service Card (.h4-svc) */
.h4-svc {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--h4-card-bg);
  border: 1px solid var(--h4-card-border);
  border-radius: var(--h4-radius-card);
  overflow: hidden;
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.h4-svc:hover {
  border-color: var(--h4-card-border-hover);
  box-shadow: 0 -20px 70px -15px rgba(0, 0, 0, 0.95), 0 0 30px rgba(255, 255, 255, 0.03);
}

@media (min-width: 992px) {
  .h4-svc {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr);
    min-height: 480px;
  }
}

/* Card Body Content */
.h4-svc__body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 36px 32px;
}

@media (min-width: 768px) {
  .h4-svc__body {
    padding: 52px 48px;
  }
}

/* Card Top: Number + Category Badge */
.h4-svc__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 24px;
}

.h4-svc__no {
  font-family: var(--h4-font-heading);
  font-size: clamp(56px, 6vw, 96px);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 0.9;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.4);
  transition: -webkit-text-stroke-color 0.3s ease;
}

.h4-svc:hover .h4-svc__no {
  -webkit-text-stroke-color: rgba(255, 255, 255, 0.85);
}

.h4-svc__cat {
  padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--h4-radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
  color: #d4d4d8;
  background: rgba(255, 255, 255, 0.04);
}

/* Card Title & Text */
.h4-svc__title {
  font-family: var(--h4-font-heading);
  font-size: clamp(26px, 2.8vw, 42px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: #ffffff;
  margin: 16px 0 16px 0;
}

.h4-svc__text {
  font-size: 16px;
  line-height: 1.65;
  color: var(--h4-text-muted);
  margin-bottom: 24px;
}

/* Tags List */
.h4-svc__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 32px 0;
  padding: 0;
  list-style: none;
}

.h4-svc__tags li {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--h4-radius-pill);
  font-size: 12px;
  font-weight: 500;
  color: #e4e4e7;
  transition: all 0.2s ease;
}

.h4-svc__tags li:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Card Link */
.h4-svc__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  transition: color 0.2s ease;
  margin-top: auto;
}

.h4-svc__link svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.h4-svc__link:hover {
  color: var(--h4-accent);
}

.h4-svc__link:hover svg {
  transform: translateX(6px);
}

/* Card Media / Image */
.h4-svc__media {
  position: relative;
  margin: 0;
  width: 100%;
  height: 280px;
  overflow: hidden;
}

@media (min-width: 992px) {
  .h4-svc__media {
    height: 100%;
    min-height: 480px;
  }
}

.h4-svc__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease;
  filter: brightness(0.9) contrast(1.05);
}

.h4-svc:hover .h4-svc__media img {
  transform: scale(1.06);
  filter: brightness(1) contrast(1.1);
}

/* Gradient overlay on media edge */
.h4-svc__media::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(17, 17, 19, 0.8) 0%, transparent 40%);
}

@media (min-width: 992px) {
  .h4-svc__media::after {
    background: linear-gradient(to right, rgba(17, 17, 19, 0.6) 0%, transparent 40%),
                linear-gradient(to top, rgba(17, 17, 19, 0.4) 0%, transparent 30%);
  }
}
