/**
 * Section: Spheres of Application (#spheres / .spheres-section)
 * Space Chemical Design System
 * Figma spec: Background #FF5C00, 46px Cygre ExtraBold title, 6 cards (407x227px, 20px radius, gap 32px)
 */

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

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

.spheres-section__header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 40px;
}

.spheres-section__eyebrow {
  display: inline-block;
  font-family: var(--font-somic, 'NT Somic', sans-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 10px;
}

.spheres-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-white, #FFFFFF);
  margin: 0;
  max-width: 680px;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.spheres-section__lead {
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-size: 15.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.94);
  max-width: 780px;
  margin: 0;
}

/* 9-Card Grid Layout (3x3 Desktop: 7 problem clusters + 1 related solutions + 1 dark Hub/Selector CTA) */
.spheres-section__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

/* Individual Sphere Card */
.sphere-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 274px;
  height: 100%;
  background-color: var(--color-white, #FFFFFF);
  border-radius: var(--radius-card, 20px);
  padding: 22px 22px 20px;
  overflow: hidden;
  text-decoration: none;
  box-sizing: border-box;
  box-shadow: none;
  transition: box-shadow var(--sc-transition-normal, 0.25s ease);
}

.sphere-card:hover {
  transform: none;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.14);
}

/* Left Content Stack */
.sphere-card__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  height: 100%;
  max-width: 72%;
}

.sphere-card__top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sphere-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sphere-card__num {
  font-family: var(--font-somic, 'NT Somic', sans-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary, #FF5C00);
  line-height: 1.2;
}

.sphere-card__badge {
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-size: 11.5px;
  font-weight: 600;
  color: #4B5563;
  background: #F3F4F6;
  padding: 3px 8px;
  border-radius: 6px;
  line-height: 1.2;
}

.sphere-card__heading {
  font-family: var(--font-cygre, 'Cygre', sans-serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-black, #000000);
  margin: 0;
}

.sphere-card__title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

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

.sphere-card__symptom {
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-size: 12.8px;
  line-height: 1.42;
  color: #4B5563;
  margin: 0;
}

.sphere-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.sphere-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(255, 92, 0, 0.07);
  border: 1px solid rgba(255, 92, 0, 0.22);
  color: #C2410C;
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sphere-tag:hover {
  background: var(--color-primary, #FF5C00);
  border-color: var(--color-primary, #FF5C00);
  color: #FFFFFF;
}

/* "Разбор проблемы / Выбрать систему" Outline Button */
.sphere-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  min-width: 148px;
  height: 35px;
  padding: 0 14px;
  box-sizing: border-box;
  border: 1px solid var(--color-primary, #FF5C00);
  border-radius: 10px;
  background-color: transparent;
  color: var(--color-primary, #FF5C00);
  font-family: var(--font-somic, 'NT Somic', sans-serif);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--sc-transition-fast, 0.15s ease),
              color var(--sc-transition-fast, 0.15s ease),
              border-color var(--sc-transition-fast, 0.15s ease),
              box-shadow var(--sc-transition-fast, 0.15s ease);
}

.sphere-card__btn-text {
  display: inline-block;
}

.sphere-card__btn-arrow {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  flex-shrink: 0;
  transition: transform var(--sc-transition-fast, 0.15s ease);
}

.sphere-card__btn:hover {
  background-color: var(--color-primary, #FF5C00);
  color: var(--color-white, #FFFFFF);
  border-color: var(--color-primary, #FF5C00);
  box-shadow: 0 4px 12px rgba(255, 92, 0, 0.25);
}

.sphere-card__btn:hover .sphere-card__btn-arrow {
  transform: translate(1px, -1px);
}

/* Holographic 3D Graphic */
.sphere-card__graphic {
  position: absolute;
  right: -85px;
  top: -32px;
  width: 280px;
  height: 280px;
  display: block;
  pointer-events: none;
  z-index: 1;
  opacity: 0.9;
}

.sphere-card__img {
  width: 280px;
  height: 280px;
  display: block;
}

/* Bottom Action Bar below the 9-Card Grid */
.spheres-section__footer {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.spheres-section__footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  border-radius: 14px;
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.spheres-section__footer-btn--dark {
  background-color: #111418;
  color: #FFFFFF;
  border: 1px solid #111418;
}

.spheres-section__footer-btn--dark:hover {
  background-color: #000000;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.spheres-section__footer-btn--white {
  background-color: #FFFFFF;
  color: #111418;
  border: 1px solid #FFFFFF;
}

.spheres-section__footer-btn--white:hover {
  background-color: #FFF7F2;
  color: var(--color-primary, #FF5C00);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}

/* Responsive Breakpoints */
@media (max-width: 1200px) {
  .spheres-section {
    height: auto;
  }

  .spheres-section__container {
    padding: 0 40px;
  }

  .spheres-section__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 767px) {
  .spheres-section {
    height: auto;
    padding: 60px 0;
  }

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

  .spheres-section__title {
    font-size: 32px;
    line-height: 1.2;
    margin-bottom: 32px;
  }

  .spheres-section__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .sphere-card {
    width: 100%;
    height: auto;
    min-height: 180px;
    padding: 24px 20px;
    overflow: hidden;
  }

  .sphere-card__content {
    max-width: calc(100% - 130px);
  }

  .sphere-card__graphic {
    left: auto;
    right: -58px;
    top: -38.5px;
    transform: none;
    width: 283px;
    height: 283px;
  }

  .sphere-card__img {
    width: 283px;
    height: 283px;
    object-fit: contain;
  }

  .sphere-card--cta {
    width: 100%;
    min-height: 66px;
    height: auto;
  }

  .sphere-card__cta-btn {
    font-size: 20px;
  }
}
