/* ==========================================================================
   Sonex Branding — Home page
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero — cross-fading background slideshow behind centred copy
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 10px 10px;
  overflow: hidden;
}

.hero__slides {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  opacity: 0;
  transform: translateX(100%);
  transition: transform 1s var(--ease-slide), opacity 1s var(--ease-slide);
}

.hero__slide.is-active {
  opacity: 1;
  transform: translateX(0);
  z-index: 1;
}

/* The outgoing slide exits to the left, matching the "slide_left" transition */
.hero__slide.is-leaving {
  opacity: 1;
  transform: translateX(-100%);
  z-index: 1;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-color: var(--c-overlay);
  opacity: 0.8;
}

.hero__inner {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
}

.hero__title {
  margin: 0 70px 20px;
  text-align: center;
  font-family: var(--f-display);
  font-size: var(--fs-hero);
  font-weight: var(--fw-bold);
  line-height: 1em;
  color: var(--c-white);
}

.hero__text {
  margin: 0 0 20px;
  padding: 0 20px;
  text-align: center;
  font-family: var(--f-body);
  font-size: var(--fs-small);
  font-weight: var(--fw-regular);
  line-height: 23px;
  color: var(--c-white);
}

.hero__actions {
  display: flex;
  justify-content: center;
  gap: 35px;
}

/* --------------------------------------------------------------------------
   Services — three numbered cards
   -------------------------------------------------------------------------- */

.services {
  background-color: var(--c-black);
  padding-top: 30px;
}

.services__eyebrow {
  margin: 0 0 20px;
  text-align: center;
}

.services__title {
  text-align: center;
  margin-bottom: 20px;
}

.services__grid {
  display: flex;
  gap: 30px;
  padding: 10px 10px 30px;
  margin-inline: -10px;
}

.service-card {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  padding: 40px;
  background-color: var(--c-surface);
  border-radius: var(--r-card);
}

/* Card 02 has no corner radius on the live site. Remove this override to
   round all three consistently. */
.service-card--square {
  border-radius: 0;
}

.service-card__num {
  position: absolute;
  top: 30px;
  right: 0;
  padding: 4px 25px 8px;
  font-family: var(--f-display);
  font-size: var(--fs-num);
  font-weight: var(--fw-bold);
  line-height: 50px;
  color: var(--c-white);
}

.service-card__icon {
  width: 17%;
  margin: 0 0 15px;
}

.service-card__icon img {
  width: 100%;
  height: 38px;
}

.service-card--tall .service-card__icon {
  width: 16%;
}

.service-card--tall .service-card__icon img {
  height: 48px;
}

.service-card--gap .service-card__icon {
  width: 14%;
  margin-bottom: 17px;
}

.service-card__title {
  margin: 0 0 16px;
  font-family: var(--f-display);
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  color: var(--c-white);
  transition: color var(--t-fast);
}

.service-card:hover .service-card__title {
  color: var(--c-green-light);
}

.service-card--gap:hover .service-card__title {
  color: var(--c-green-light-alt);
}

.service-card__text {
  margin: 0;
  font-family: var(--f-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  line-height: 23px;
  color: var(--c-muted);
  text-shadow: var(--sh-text);
}

/* --------------------------------------------------------------------------
   About — image beside copy, feature list and a progress bar
   -------------------------------------------------------------------------- */

.about {
  background-color: var(--c-black);
  padding: 100px 0 10px;
}

.about__row {
  display: flex;
  gap: 20px;
  align-items: center;
}

.about__media,
.about__body {
  flex: 1 1 50%;
  min-width: 0;
  padding: 10px;
}

.about__eyebrow {
  text-align: left;
  margin-bottom: 0;
}

.about__title {
  margin: 0 0 40px;
  font-family: var(--f-display);
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  color: var(--c-heading);
}

.about__text {
  padding-right: 150px;
  margin: 0 0 20px;
  font-family: var(--f-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  line-height: 24px;
  color: var(--c-muted);
}

.check-list {
  margin-bottom: 45px;
}

.check-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-list li:not(:last-child) {
  padding-block-end: 5px;
}

.check-list li:not(:first-child) {
  margin-block-start: 5px;
}

.check-list svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  fill: var(--c-green);
}

.check-list span {
  font-family: var(--f-body);
  font-size: 18px;
  font-weight: var(--fw-bold);
  color: var(--c-white);
}

.progress {
  margin-bottom: 25px;
}

.progress__label {
  font-family: var(--f-body);
  font-size: var(--fs-small);
  font-weight: var(--fw-regular);
  line-height: 25px;
  text-transform: uppercase;
  color: var(--c-white);
}

.progress__bar {
  position: relative;
  height: 6px;
  margin-top: 10px;
  border-radius: var(--r-card);
  background-color: var(--c-track);
}

.progress__fill {
  position: relative;
  height: 100%;
  width: 0;
  border-radius: var(--r-card);
  background-color: var(--c-green);
  transition: width 2.5s var(--ease-slide);
}

/* The figure rides the end of the filled track, sitting just above the bar */
.progress__value {
  position: absolute;
  right: 0;
  bottom: 100%;
  margin-bottom: 7px;
  font-family: var(--f-display);
  font-size: 25px;
  font-weight: var(--fw-bold);
  line-height: 20px;
  color: var(--c-white);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Portfolio — centred carousel with a clip-path reveal on the active slide
   -------------------------------------------------------------------------- */

.portfolio-head {
  background-color: var(--c-black);
  padding: 50px 15px 15px;
  text-align: center;
}

.portfolio-head .eyebrow {
  margin-bottom: 20px;
}

.portfolio-head .section-title {
  margin-bottom: 20px;
}

.carousel {
  position: relative;
  background-color: var(--c-black);
  margin-bottom: clamp(2.5rem, 6vw, 3.755rem);
  overflow: hidden;
}

.carousel__track {
  display: flex;
  gap: 40px;
  transition: transform 0.9s var(--ease-slide);
  will-change: transform;
}

.carousel__slide {
  position: relative;
  flex: 0 0 calc((100% - 80px) / 3);
  height: clamp(25rem, 40vw, 31.25rem);
  clip-path: inset(10% 0 10% 0);
  overflow: hidden;
  transition: clip-path 0.4s var(--ease-slide), transform 0.4s var(--ease-slide);
}

.carousel__slide.is-active {
  clip-path: inset(0 0 0 0);
}

.carousel__media {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel__media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  background-image: var(--g-slide-fade);
  transition: opacity 0.5s var(--ease-slide);
}

.carousel__slide.is-active .carousel__media::before {
  opacity: 1;
  transition-delay: 0.6s;
}

.carousel__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel__caption {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  padding: 50px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s var(--ease-slide);
}

.carousel__slide.is-active .carousel__caption {
  opacity: 1;
  transition-delay: 0.5s;
}

.carousel__title {
  margin: 0;
  font-size: 34px;
  line-height: 89px;
  font-weight: var(--fw-bold);
  text-transform: capitalize;
  color: #eff1ff;
  transform: translateX(50px);
  transition: transform 0.3s var(--ease-slide);
}

.carousel__slide.is-active .carousel__title {
  transform: translateX(0);
  transition-delay: 0.5s;
}

.carousel__title a:hover {
  color: var(--c-green-dark);
}

.carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 30px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #495157;
  transition: color var(--t-fast), transform var(--t-fast);
}

.carousel__nav svg {
  width: 30px;
  height: 30px;
  transition: transform var(--t-fast);
}

.carousel__nav--prev { left: 20px; }
.carousel__nav--next { right: 20px; }

.carousel__nav:hover { color: var(--c-white); }
.carousel__nav--prev:hover svg { transform: scale(1.2) translateX(-5px); }
.carousel__nav--next:hover svg { transform: scale(1.2) translateX(5px); }

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding-top: 24px;
}

.carousel__dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.1);
  transition: background-color var(--t-fast);
}

.carousel__dots button[aria-current="true"] {
  background: #495157;
}

/* --------------------------------------------------------------------------
   Counters — outlined numerals
   -------------------------------------------------------------------------- */

.counters {
  background-color: var(--c-black);
  padding: 30px 0 60px;
}

.counters__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.counters__row > .counter:not(:last-child) {
  margin-bottom: 20px;
}

.counter {
  display: flex;
  flex-direction: column-reverse;
  justify-content: center;
}

.counter__title {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-body);
  font-size: 20px;
  font-weight: var(--fw-regular);
  line-height: 2.5;
  color: var(--c-white);
}

.counter__number {
  display: flex;
  justify-content: center;
  text-align: center;
  font-family: var(--f-display);
  font-size: var(--fs-counter);
  font-weight: var(--fw-bold);
  line-height: 79px;
  color: transparent;
  -webkit-text-stroke: 2px var(--c-white);
}

/* --------------------------------------------------------------------------
   Closing parallax band
   -------------------------------------------------------------------------- */

.parallax-band {
  position: relative;
  padding: 40px 10px 140px;
  background-image: url("../img/bg-1img-2.jpg");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

.parallax-band::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.49;
  background-image: url("../img/unnamed.png");
  background-position: center center;
  background-size: cover;
}

@media (min-width: 1025px) {
  .parallax-band::before {
    background-attachment: fixed;
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .services__grid {
    flex-wrap: wrap;
  }

  .service-card {
    flex: 1 1 calc(50% - 15px);
  }

  .about__row {
    flex-direction: column;
  }

  .about__media,
  .about__body {
    flex: 1 1 100%;
    width: 100%;
  }

  .about__text {
    padding-right: 0;
  }

  .about__title {
    margin-bottom: 10px;
  }

  .carousel__slide {
    flex: 0 0 calc((100% - 40px) / 2);
  }

  .counters__row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
  }

  .counters__row > * {
    flex: 1 1 40%;
    text-align: center;
  }
}

@media (max-width: 767px) {
  .hero__title {
    margin-inline: 0;
  }

  .hero__actions {
    flex-wrap: wrap;
    gap: 16px;
  }

  .about {
    padding-top: 70px;
  }

  .service-card {
    flex: 1 1 100%;
  }

  .carousel {
    padding-inline: 20px;
  }

  .carousel__track {
    gap: 0;
  }

  .carousel__slide {
    flex: 0 0 100%;
  }

  .carousel__caption {
    padding: 20px;
  }

  .carousel__title {
    line-height: 1.3;
  }

  .check-list li:not(:last-child) {
    padding-block-end: 11px;
  }

  .check-list li:not(:first-child) {
    margin-block-start: 11px;
  }

  .counter {
    display: flex;
    align-items: center;
    gap: 28px;
    justify-content: center;
  }
}
