@import url('variables.css');

/* ============================================
   SERVICES SECTION - Layout
   ============================================ */
.services {
  position: relative;
  background-color: var(--surface-secondary);
  width: 100%;
  overflow: hidden;
  padding-top: 80px;
  padding-bottom: 100px;
  padding-left: 28px;
  padding-right: 28px;
  border-bottom: 1px solid var(--border-primary);
}



.services__title {
  font-family: var(--sec-fontfamily);
  font-size: clamp(48px, 8vw, 112px);
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 2px;
  margin-bottom: 20px;
}

/* Main content area - image + accordion side by side */
.services__body {
  display: flex;
  flex-direction: column;
}

/* ============================================
   IMAGE PANEL - Left side with crossfade
   ============================================ */
.services__image-panel {
  display: none;
  position: relative;
  width: 60%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface-secondary);
  margin: 0 auto;
  margin-bottom: var(--spacing-400);
}

.services__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.services__cta-text .hover-reveal-text {
  font-size: 16px;
}

.services__image--active {
  opacity: 1;
}

/* ============================================
   ACCORDION - Base styles
   ============================================ */
.services__accordion {
  width: 100%;
  padding: 0 var(--spacing-300);
}

.services__item {
  border-bottom: 1px solid var(--border-dark);
}

.services__item:first-child {
  border-top: 1px solid var(--border-dark);
}

.services__item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-400) 0;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--main-fontfamily);
  font-size: 28px;
  font-weight: 500;
  color: var(--text-primary);
  transition: color 0.3s ease, background-color 0.3s ease;
}

.services__item-title {
  font-family: var(--main-fontfamily);
  font-size: 22px;
  font-weight: 500;
  color: inherit;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 56px;
}

.services__item-icon {
  font-size: 24px;
  font-weight: 300;
  color: var(--text-primary);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  line-height: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 32px;
}

/* Slide text animation */
.svc-slide-text {
  flex-shrink: 0;
  font-size: 22px;
  height: 56px;
  line-height: 28px;
  display: flex;
  align-items: center;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.services__item-icon .svc-slide-text {
  height: 32px;
  line-height: 32px;
  font-size: 24px;
  display: block;
}

.svc-slide-text--accent {
  color: var(--text-accent2);
}

.services__item-header:hover .svc-slide-text {
  transform: translateY(-100%);
}

/* ============================================
   ACCORDION - Open / expanded states
   ============================================ */
.services__item-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.services__item-body-inner {
  padding: 0 0 var(--spacing-500) 0;
}

.services__item--active .services__item-icon .svc-slide-text {
  transform: rotate(45deg);
}

.services__item--active .services__item-header {
  color: var(--text-primary);
}

.services__item-description {
  font-family: var(--main-fontfamily);
  font-size: 16px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 380px;
  margin: 0 0 var(--spacing-400) 0;
}

/* ============================================
   CTA BUTTON - Inside accordion
   ============================================ */
.services__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--main-fontfamily);
  font-size: 16px;
  font-weight: 500;
  color: var(--text-inverted);
  text-decoration: none;
  background: var(--surface-accent2);
  border: none;
  border-bottom: none;
  padding: 14px 32px;
  position: relative;
  overflow: hidden;
  transition: color 0.3s ease;
}

.services__cta-text {
  position: relative;
  z-index: 2;
  display: inline-flex;
  flex-direction: column;
  overflow: hidden;
  height: 1.2em;
  line-height: 1.2;
  color: inherit;
}

.services__cta-text .hover-reveal-text {
  display: block;
  flex-shrink: 0;
  height: 1.2em;
  line-height: 1.2;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.services__cta .cta-card-reveal {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: translateY(100%);
  z-index: 1;
  pointer-events: none;
}

.services__cta .cta-card-reveal--brand {
  background: var(--surface-brand);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.services__cta .cta-card-reveal--accent {
  background: var(--surface-accent, #FFD705);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

.services__cta:hover .cta-card-reveal--brand {
  transform: translateY(0);
}

.services__cta:hover .cta-card-reveal--accent {
  transform: translateY(0);
}

.services__cta:not(:hover) .cta-card-reveal--accent {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.services__cta:not(:hover) .cta-card-reveal--brand {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.08s;
}

.services__cta:hover .cta-card-reveal--brand {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.services__cta:hover .cta-card-reveal--accent {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

.services__cta:hover .services__cta-text .hover-reveal-text {
  transform: translateY(-100%);
}

@keyframes svcCtaTextColorSweep {
  0%   { color: var(--text-inverted); }
  35%  { color: var(--text-primary); }
  65%  { color: var(--text-primary); }
  100% { color: var(--text-primary); }
}

.services__cta:hover .services__cta-text {
  color: var(--text-primary);
  animation: svcCtaTextColorSweep 0.5s ease forwards;
}

/* ============================================
   RESPONSIVE - Small mobile (max-width: 400px)
   ============================================ */
@media (max-width: 400px) {
  .services__item-title {
    font-size: 16px;
    height: 40px;
  }

  .services__item-title .svc-slide-text {
    font-size: 16px;
    height: 40px;
    line-height: 40px;
    display: block;
    white-space: nowrap;
  }

  .services__item-header {
    font-size: 20px;
  }

  .services__item-icon {
    height: 24px;
  }

  .services__item-icon .svc-slide-text {
    height: 24px;
    line-height: 24px;
    font-size: 20px;
  }
}

/* ============================================
   RESPONSIVE - Desktop (min-width: 1024px)
   ============================================ */
@media (min-width: 1024px) {
  .services {
    padding-left: var(--spacing-400);
  }

  .services__header {
    padding: 0;
  }

  .services__body {
    flex-direction: row;
  }

  .services__image-panel {
    display: block;
    flex: 0 0 45%;
    aspect-ratio: auto;
    min-height: 600px;
    width: 100%;
    margin: 0;
    margin-bottom: 0;
  }

  .services__accordion {
    flex: 0 0 55%;
    padding: 0 var(--spacing-700);
  }

  .services__item-header {
    padding: var(--spacing-500) 0;
    font-size: 20px;
  }

  .services__item-title {
    font-size: 26px;
    height: 34px;
  }

  .services__item-icon {
    height: 28px;
  }

  .services__item-title .svc-slide-text {
    height: 34px;
    line-height: 34px;
    font-size: 26px;
    display: block;
  }

  .services__item-icon .svc-slide-text {
    height: 28px;
    line-height: 28px;
    font-size: 28px;
  }

  .services__item-description {
    font-size: 18px;
  }

  .services__cta {
    display: inline-block;
    background: none;
    color: var(--text-primary);
    padding: 0;
    padding-bottom: 2px;
    border-bottom: 1px solid var(--border-dark);
    font-size: 20px;
    overflow: visible;
    position: static;
    transition: color 0.3s ease, border-color 0.3s ease;
  }

  .services__cta:hover {
    color: var(--text-accent2);
    border-color: var(--text-accent2);
  }

  .services__cta .cta-card-reveal {
    display: none;
  }

  .services__cta-text {
    display: inline;
    height: auto;
    overflow: visible;
    color: inherit;
  }

  .services__cta-text .hover-reveal-text {
    display: inline;
    height: auto;
    transition: none;
  }

  .services__cta-text .hover-reveal-text:last-child {
    display: none;
  }

  .services__cta:hover .services__cta-text .hover-reveal-text {
    transform: none;
  }

  .services__cta:hover .services__cta-text {
    color: inherit;
    animation: none;
  }
}
