/**
 * Section: Services Section (#services / .services-section)
 * Space Chemical Design System
 * Figma spec: node 376:681, 1440x3583px
 * Padding: 47px 0 72px
 * 4 cards:
 *   Card 1: 1286x760px, white
 *   Card 2: 1286x760px, gray (#F3F3F3)
 *   Card 3: 1286x840px, white
 *   Card 4: 1286x840px, gray (#F3F3F3)
 */

.services-section {
  width: 100%;
  height: auto;
  min-height: auto;
  padding: 72px 0 88px;
  background-color: var(--color-white, #FFFFFF);
  box-sizing: border-box;
  overflow: hidden;
}

.services-section__container {
  max-width: var(--sc-container-max, 1440px);
  margin: 0 auto;
  padding: 0 var(--space-77, 77px);
  box-sizing: border-box;
}

.services-section__header {
  margin-bottom: 40px;
}

.services-section__title {
  font-family: var(--font-cygre, 'Cygre', sans-serif);
  font-size: clamp(30px, 3.2vw, 42px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-black, #000000);
  margin: 0;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

/* Vertical Stack of Service Cards */
.services-section__list {
  display: flex;
  flex-direction: column;
  gap: 50px;
}

/* Individual Large Service Card (Figma: 1286x760 or 1286x840, border 1px solid #909090, r: 20px) */
.service-block {
  width: 100%;
  border-radius: var(--radius-card, 20px);
  box-shadow: inset 0 0 0 1px #909090;
  border: none;
  overflow: hidden;
  height: 760px;
  position: relative;
  box-sizing: border-box;
  transition: box-shadow var(--sc-transition-normal, 0.25s ease);
}

.service-block:nth-child(3) {
  height: 890px;
}

.service-block:nth-child(4) {
  height: 840px;
}

.service-block--white {
  background-color: var(--color-white, #FFFFFF);
}

.service-block--gray {
  background-color: var(--color-gray-bg, #F3F3F3);
}

/* Card hover: elevation shadow ONLY, NO positional movement */
.service-block:hover {
  transform: none;
  box-shadow: inset 0 0 0 1px #909090, 0 12px 36px rgba(0, 0, 0, 0.08);
}

/* Vertical divider line Vector 28 (x: 644px) */
.service-block::before {
  content: '';
  position: absolute;
  left: 644px;
  top: 47px;
  width: 1px;
  height: 666px;
  background-color: #000000;
  z-index: 2;
}

.service-block:nth-child(3)::before {
  top: 64px;
  height: 762px;
}

.service-block:nth-child(4)::before {
  top: 87px;
  height: 666px;
}

/* Left Content Column (Figma: Frame 68, 594px width) */
.service-block__content {
  position: absolute;
  left: 50px;
  top: 56px;
  width: 594px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.service-block:nth-child(2) .service-block__content {
  top: 46px;
}

.service-block:nth-child(3) .service-block__content {
  top: 82px;
}

.service-block:nth-child(4) .service-block__content {
  top: 74px;
}

.service-block__info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.service-block__title {
  font-family: var(--font-cygre, 'Cygre', sans-serif);
  font-size: clamp(26px, 2.5vw, 36px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-black, #000000);
  margin: 0;
  letter-spacing: -0.01em;
}

.service-block__desc {
  font-family: var(--font-cygre, 'Cygre', sans-serif);
  font-size: clamp(14.5px, 1.15vw, 16.5px);
  font-weight: 400;
  line-height: 1.6;
  color: #374151;
  margin: 0;
  white-space: pre-line;
  max-width: 554px;
}

/* Button: Compact, Tactile B2B Action */
.service-block__action {
  width: auto;
}

.service-block:nth-child(2) .service-block__action,
.service-block:nth-child(3) .service-block__action,
.service-block:nth-child(4) .service-block__action {
  margin-top: 4px;
}

.service-block__btn {
  width: auto;
  min-width: 220px;
  max-width: 280px;
  height: 48px;
  border-radius: var(--radius-sm, 12px);
  background-color: var(--color-primary, #FF5C00);
  color: var(--color-white, #FFFFFF);
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
  text-decoration: none;
  box-sizing: border-box;
  transition: background-color var(--sc-transition-normal, 0.2s ease), box-shadow var(--sc-transition-normal, 0.2s ease);
}

.service-block__btn:hover {
  background-color: var(--color-primary-hover, #E05200);
  box-shadow: 0 4px 16px rgba(255, 92, 0, 0.35);
}

/* Right Visual Column (Figma: 642px / 659px width, exact positioning) */
.service-block__visual {
  position: absolute;
  left: 644px;
  top: 47px;
  width: 659px;
  height: 666px;
  box-sizing: border-box;
}

.service-block:nth-child(2) .service-block__visual {
  left: 644px;
  top: 0px;
  width: 642px;
  height: 760px;
}

.service-block:nth-child(3) .service-block__visual {
  left: 644px;
  top: 0px;
  width: 642px;
  height: 890px;
}

.service-block:nth-child(4) .service-block__visual {
  left: 644px;
  top: 40px;
  width: 642px;
  height: 760px;
}

.service-block__picture {
  width: 100%;
  height: 100%;
  display: block;
}

.service-block__img {
  width: 100%;
  height: 100%;
  display: block;
}

.service-block:nth-child(2) .service-block__visual,
.service-block:nth-child(4) .service-block__visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-block:nth-child(2) .service-block__img,
.service-block:nth-child(4) .service-block__img {
  width: 440px;
  height: 657px;
  object-fit: cover;
  border-radius: 20px;
}

/* Card 2 animated visual: muted looping lab footage on tablet/desktop (>=768px),
   static PNG on mobile. Video fades to the card bg color (#F3F3F3) for a seamless loop.
   The <source> gets its src via JS when the block nears the viewport. */
.service-block__video {
  display: block;
  width: 440px;
  height: 657px;
  object-fit: cover;
  border-radius: 20px;
  background-color: #F3F3F3;
}

/* PNG is the mobile-only fallback; hidden (and never fetched) on >=768px */
.service-block__img--video {
  display: none;
}

/* ==========================================================================
   Real HTML/CSS Service Spheres Component (7 interactive clickable cards)
   ========================================================================== */
.service-spheres {
  position: absolute;
  left: 64px;
  top: 0;
  width: 556px;
  height: 890px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px 0;
  gap: 16px;
  box-sizing: border-box;
}

.service-sphere-card {
  width: 462px;
  height: 98px;
  border-radius: var(--radius-card, 20px);
  box-shadow: inset 0 0 0 1px #909090;
  background-color: var(--color-white, #FFFFFF);
  position: relative;
  padding: 14px 96px 14px 20px;
  box-sizing: border-box;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: box-shadow var(--sc-transition-normal, 0.25s ease);
}

/* Mini-card hover: accent border + soft elevation shadow, NO positional movement */
.service-sphere-card:hover {
  transform: none;
  box-shadow: inset 0 0 0 1.5px var(--color-primary, #FF5C00), 0 8px 24px rgba(0, 0, 0, 0.08);
}

.service-sphere-card:hover .service-sphere-card__title {
  color: var(--color-primary, #FF5C00);
}

.service-sphere-card__num {
  font-family: var(--font-nt-somic, 'NT Somic', sans-serif);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-primary, #FF5C00);
  margin-bottom: 4px;
}

.service-sphere-card__title {
  font-family: var(--font-cygre, 'Cygre', sans-serif);
  font-size: 18px;
  font-weight: 400;
  line-height: 21px;
  color: var(--color-black, #000000);
  margin: 0;
  max-width: 346px;
  transition: color var(--sc-transition-normal, 0.2s ease);
}

.service-sphere-card__sphere {
  position: absolute;
  right: -48px;
  top: 50%;
  transform: translateY(-50%);
  width: auto;
  height: auto;
  max-width: 118px;
  max-height: 98px;
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
  display: block;
  transition: transform var(--sc-transition-normal, 0.25s ease);
}

.service-sphere-card:hover .service-sphere-card__sphere {
  transform: translateY(-50%) scale(1.06);
}

/* Responsive Breakpoints */

/* Tablet & Smaller Laptops (768px - 1350px): Responsive 2-column layout */
@media (min-width: 768px) and (max-width: 1350px) {
  .services-section {
    height: auto;
    padding: 50px 0;
  }

  .services-section__container {
    padding: 0 clamp(28px, 4vw, 56px);
  }

  .service-block {
    height: auto;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 32px;
    align-items: center;
    padding: 36px 40px;
    border-radius: 24px;
  }

  /* Card 1 has a detailed 4-callout infographic — give the visual column priority */
  .service-block:nth-child(1) {
    grid-template-columns: 0.92fr 1.08fr;
    gap: 36px;
  }

  .service-block::before {
    display: none;
  }

  .service-block:nth-child(3) {
    grid-template-columns: 1fr 1fr;
    height: auto;
  }

  .service-block:nth-child(4) {
    height: auto;
  }

  .service-block__content {
    position: static;
    left: auto;
    top: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
  }

  .service-block__info {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .service-block__title {
    font-size: clamp(26px, 3.2vw, 38px);
    line-height: 1.15;
  }

  .service-block__desc {
    font-size: clamp(15px, 1.8vw, 19px);
    line-height: 1.45;
    max-width: 100%;
    text-align: left;
  }

  .service-block__action {
    width: 100%;
    margin-top: 0;
  }

  .service-block:nth-child(2) .service-block__action,
  .service-block:nth-child(3) .service-block__action,
  .service-block:nth-child(4) .service-block__action {
    margin-top: 0;
  }

  .service-block__btn {
    width: 100%;
    max-width: 100%;
    height: 56px;
    font-size: 18px;
  }

  .service-block__visual,
  .service-block:nth-child(2) .service-block__visual,
  .service-block:nth-child(3) .service-block__visual,
  .service-block:nth-child(4) .service-block__visual {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    height: 100%;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .service-block:nth-child(2) .service-block__img,
  .service-block:nth-child(4) .service-block__img {
    width: 100%;
    max-width: 380px;
    height: auto;
    max-height: 520px;
    object-fit: cover;
    border-radius: 18px;
    display: block;
  }

  .service-block__video {
    width: 100%;
    max-width: 380px;
    height: auto;
    max-height: 520px;
    aspect-ratio: 440 / 657;
    border-radius: 18px;
  }

  /* The nth-child img rules above set display:block with higher specificity
     than the base .service-block__img--video { display:none } — re-hide the
     mobile-only PNG here so it doesn't render next to the video. */
  .service-block:nth-child(2) .service-block__img--video,
  .service-block:nth-child(4) .service-block__img--video {
    display: none;
  }

  .service-block:nth-child(1) .service-block__picture {
    width: 100%;
    height: auto;
    display: block;
  }

  .service-block:nth-child(1) .service-block__img {
    width: 100%;
    height: auto;
    max-height: 460px;
    object-fit: contain;
  }

  .service-spheres {
    position: static;
    left: auto;
    top: auto;
    width: 100%;
    height: auto;
    padding: 0;
    gap: 12px;
  }

  .service-sphere-card {
    width: 100%;
    height: auto;
    min-height: 76px;
    padding: 14px 104px 14px 18px;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .service-sphere-card__title {
    font-size: 14.5px;
    max-width: 100%;
    line-height: 1.25;
  }

  .service-sphere-card__sphere,
  .service-sphere-card__sphere--1,
  .service-sphere-card__sphere--2,
  .service-sphere-card__sphere--3,
  .service-sphere-card__sphere--4,
  .service-sphere-card__sphere--5 {
    left: auto;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    height: auto;
    max-height: 54px;
    max-width: 78px;
    object-fit: contain;
  }
}

/* Tablet Portrait & Compact Tablet (768px - 1080px):
   Stack Card 1 vertically so the detailed bottle infographic renders large & crisp */
@media (min-width: 768px) and (max-width: 1080px) {
  .service-block:nth-child(1) {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 28px;
    padding: 36px 36px 40px;
  }

  .service-block:nth-child(1) .service-block__content {
    display: contents;
  }

  .service-block:nth-child(1) .service-block__info {
    order: 1;
    gap: 16px;
  }

  .service-block:nth-child(1) .service-block__desc {
    max-width: 68ch;
  }

  .service-block:nth-child(1) .service-block__visual {
    order: 2;
    width: 100%;
    height: auto;
    padding: 8px 0;
  }

  .service-block:nth-child(1) .service-block__picture {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
  }

  .service-block:nth-child(1) .service-block__img {
    width: 100%;
    max-width: 600px;
    max-height: none;
    height: auto;
    margin: 0 auto;
  }

  .service-block:nth-child(1) .service-block__action {
    order: 3;
    width: 100%;
    display: flex;
    justify-content: flex-start;
  }

  .service-block:nth-child(1) .service-block__btn {
    width: 100%;
    max-width: 300px;
    height: 52px;
    font-size: 16px;
  }
}

/* Mobile Screens (< 768px): Fluid 1-column layout with cover banners */
@media (max-width: 767px) {
  .services-section {
    padding: 40px 0;
  }

  .services-section__container {
    padding: 0 20px;
  }

  .service-block {
    display: flex;
    flex-direction: column;
    padding: 24px;
    border-radius: 16px;
    gap: 24px;
    height: auto;
  }

  .service-block::before {
    display: none;
  }

  .service-block:nth-child(3),
  .service-block:nth-child(4) {
    height: auto;
  }

  .service-block__content {
    position: static;
    left: auto;
    top: auto;
    width: 100%;
    gap: 20px;
  }

  .service-block__info {
    gap: 16px;
  }

  .service-block__title {
    font-size: 26px;
    line-height: 1.2;
  }

  .service-block__desc {
    font-size: 16px;
    line-height: 1.45;
    max-width: 100%;
    text-align: left;
  }

  .service-block__action,
  .service-block__btn {
    width: 100%;
    max-width: 100%;
    height: 52px;
    font-size: 17px;
  }

  .service-block__visual,
  .service-block:nth-child(2) .service-block__visual,
  .service-block:nth-child(3) .service-block__visual,
  .service-block:nth-child(4) .service-block__visual {
    border: none;
    padding: 0;
    width: 100%;
    position: static;
    left: auto;
    top: auto;
    height: auto;
  }

  .service-block:nth-child(2) .service-block__img {
    width: 100%;
    height: 240px;
    max-height: none;
    object-fit: cover;
    border-radius: 14px;
    display: block;
  }

  .service-block:nth-child(4) .service-block__img {
    width: 100%;
    height: 320px;
    max-height: none;
    object-fit: cover;
    object-position: center 10%;
    border-radius: 14px;
    display: block;
  }

  /* Mobile: no video decoding — static PNG only */
  .service-block__video {
    display: none;
  }

  .service-block__img--video {
    display: block;
  }

  .service-block:nth-child(1) .service-block__visual {
    width: calc(100% + 28px);
    margin: 14px -14px 4px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .service-block:nth-child(1) .service-block__picture {
    width: 100%;
    display: block;
  }

  .service-block:nth-child(1) .service-block__img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    margin: 0 auto;
    display: block;
  }

  .service-spheres {
    position: static;
    left: auto;
    top: auto;
    width: 100%;
    height: auto;
    padding: 0;
    gap: 12px;
  }

  .service-sphere-card {
    width: 100%;
    height: auto;
    min-height: 72px;
    padding: 12px 88px 12px 16px;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .service-sphere-card__title {
    font-size: 14px;
    max-width: 100%;
    line-height: 1.25;
  }

  .service-sphere-card__sphere,
  .service-sphere-card__sphere--1,
  .service-sphere-card__sphere--2,
  .service-sphere-card__sphere--3,
  .service-sphere-card__sphere--4,
  .service-sphere-card__sphere--5 {
    left: auto;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    height: auto;
    max-height: 48px;
    max-width: 68px;
    object-fit: contain;
  }
}
