/*
 * L4: product-home challenges section only.
 * Scoped to body.home-page .mm3d-challenges-section.
 * Card chrome and type are CSS + HTML; PNGs are visual-only.
 */

body.home-page .mm3d-challenges-section {
  --mm3d-challenges-gold: #ff9d24;
  --mm3d-challenges-gold-light: #ffb13b;
  --mm3d-challenges-blue: #1d9bff;
  --mm3d-challenges-ink: #f4f7fa;
  --mm3d-challenges-muted: rgba(232, 240, 247, 0.72);
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  background: #071321;
  color: var(--mm3d-challenges-ink);
  padding: 96px 0 56px;
  scroll-margin-top: 88px;
}

body.home-page .mm3d-challenges-section::before,
body.home-page .mm3d-challenges-section::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body.home-page .mm3d-challenges-section::before {
  background-image:
    radial-gradient(ellipse 56% 42% at 18% 8%, rgba(255, 157, 36, 0.07), transparent 62%),
    radial-gradient(ellipse 48% 50% at 86% 18%, rgba(8, 124, 255, 0.12), transparent 68%),
    radial-gradient(ellipse 40% 36% at 50% 88%, rgba(8, 86, 199, 0.1), transparent 70%);
}

body.home-page .mm3d-challenges-section::after {
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(94, 200, 255, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 200, 255, 0.09) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 78%);
}

body.home-page .mm3d-challenges-inner {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: min(1480px, calc(100% - clamp(24px, 5vw, 80px)));
  margin: 0 auto;
  padding-inline: 0;
}

body.home-page .mm3d-challenges-section h2,
body.home-page .mm3d-challenges-section h3 {
  -webkit-text-stroke: 0;
  paint-order: normal;
  letter-spacing: 0;
}

body.home-page .mm3d-challenges-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.4fr) minmax(0, 0.52fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  margin: 0 0 40px;
}

body.home-page .mm3d-challenges-title {
  position: relative;
  margin: 0;
  padding-bottom: 18px;
  color: #fff;
  font-family: "MM3D Display Serif", "Noto Serif TC", "MM3D Chinese Serif", serif;
  font-size: clamp(36px, 3.6vw, 54px);
  font-weight: 900;
  font-variation-settings: "wght" 900;
  line-height: 1.18;
}

body.home-page .mm3d-challenges-title-accent,
body.home-page .mm3d-challenges-accent {
  color: var(--mm3d-challenges-gold-light);
}

body.home-page .mm3d-challenges-title::after,
body.home-page .mm3d-solution-copy::after {
  content: "";
  position: absolute;
  left: 2px;
  bottom: 0;
  width: 58px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mm3d-challenges-gold), var(--mm3d-challenges-gold-light));
}

body.home-page .mm3d-challenges-lead {
  position: relative;
  max-width: 34em;
  margin: 0;
  padding-left: 18px;
  color: var(--mm3d-challenges-muted);
  font-size: clamp(16px, 1.15vw, 18px);
  font-weight: 400;
  line-height: 1.75;
}

body.home-page .mm3d-challenges-lead::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  bottom: 0.35em;
  width: 1px;
  background: var(--mm3d-challenges-blue);
  box-shadow: 0 0 10px rgba(29, 155, 255, 0.35);
}

body.home-page .mm3d-challenges-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

body.home-page .challenge-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 385px;
  height: 100%;
  border-radius: 12px;
  border: 1px solid rgba(31, 157, 255, 0.72);
  background: linear-gradient(145deg, rgba(4, 34, 66, 0.98), rgba(2, 22, 43, 0.98));
  box-shadow: inset 0 0 26px rgba(0, 107, 220, 0.035);
}

body.home-page .challenge-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45%;
  background-image:
    linear-gradient(rgba(31, 130, 220, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 130, 220, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  opacity: 0.35;
  z-index: 0;
}

body.home-page .challenge-card__header {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  column-gap: 16px;
  min-height: 0;
  padding: 22px 22px 18px;
}

body.home-page .challenge-card__number {
  font-size: 38px;
  line-height: 1;
  font-weight: 700;
  color: #23b7ff;
}

body.home-page .challenge-card__number::after {
  content: "";
  display: block;
  width: 30px;
  height: 3px;
  margin-top: 9px;
  border-radius: 999px;
  background: #23b7ff;
}

body.home-page .challenge-card__heading {
  min-width: 0;
}

body.home-page .challenge-card__title {
  margin: 0;
  font-size: 29px;
  line-height: 1.2;
  font-weight: 700;
  color: #f4f7fb;
}

body.home-page .challenge-card__description {
  margin: 8px 0 0;
  font-size: 17px;
  line-height: 1.55;
  font-weight: 400;
  color: rgba(235, 243, 252, 0.92);
}

body.home-page .challenge-card__visual {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  height: 240px;
  flex: 0 0 240px;
  margin-top: 0;
}

body.home-page .challenge-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
}

body.home-page .challenge-card__label,
body.home-page .challenge-card__legend-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 500;
  text-align: center;
  color: rgba(235, 242, 250, 0.88);
}

body.home-page .challenge-card__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 95px;
}

body.home-page .challenge-card__label-primary {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
}

body.home-page .challenge-card__label-secondary {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
}

body.home-page .challenge-card--surface .challenge-card__visual {
  padding: 0 4px 18px 0;
}

body.home-page .challenge-card--surface .challenge-card__art {
  position: relative;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}

body.home-page .challenge-card--surface .challenge-card__image {
  width: auto;
  height: 100%;
  max-width: none;
  transform: scale(1.17) translate(6%, -6%);
  transform-origin: 10% 94%;
}

body.home-page .challenge-card--surface .challenge-card__visual-labels {
  position: absolute;
  right: 4px;
  top: 30%;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(108px, 1fr) minmax(108px, 1fr);
  gap: 8px;
  width: 220px;
}

body.home-page .challenge-card--large-area .challenge-card__visual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  align-items: end;
  justify-content: stretch;
  padding: 0 16px 18px 8px;
  column-gap: 10px;
}

body.home-page .challenge-card--large-area .challenge-card__image {
  width: 100%;
  height: 100%;
  max-height: 214px;
  justify-self: center;
  align-self: end;
  object-position: center bottom;
}

body.home-page .challenge-card--large-area .challenge-card__info-module {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  z-index: 3;
  width: 108px;
  margin-bottom: 8px;
}

body.home-page .challenge-card--large-area .challenge-card__legend-text {
  font-size: 17px;
  line-height: 1.35;
}

body.home-page .challenge-card__icon-grid {
  display: grid;
  grid-template-columns: repeat(3, 7px);
  grid-template-rows: repeat(3, 7px);
  gap: 5px;
  width: 31px;
  height: 31px;
}

body.home-page .challenge-card__icon-grid span {
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: #6eb6ff;
}

body.home-page .challenge-card__plus {
  color: rgba(235, 242, 250, 0.82);
  font-size: 18px;
  line-height: 1;
  font-weight: 500;
}

body.home-page .challenge-card__icon-wave {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 30px;
  height: 18px;
}

body.home-page .challenge-card__icon-wave i {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: #6eb6ff;
}

body.home-page .challenge-card__icon-wave i:nth-child(1),
body.home-page .challenge-card__icon-wave i:nth-child(3) {
  width: 100%;
}

body.home-page .challenge-card__icon-wave i:nth-child(2) {
  width: 78%;
  margin-left: 11%;
}

body.home-page .challenge-card--process .challenge-card__visual {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  padding: 0 12px 23px;
}

body.home-page .challenge-card--process .challenge-card__process-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  position: relative;
  flex: 1 1 auto;
  min-height: 156px;
  padding-bottom: 0;
}

body.home-page .challenge-card--process .challenge-card__process-item {
  min-width: 0;
  height: 156px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

body.home-page .challenge-card--process .challenge-card__image {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 156px;
  object-fit: contain;
  object-position: center bottom;
  transform: scale(1.04);
  transform-origin: center bottom;
}

body.home-page .challenge-card__arrow {
  position: absolute;
  top: 44%;
  z-index: 3;
  width: 8px;
  height: 8px;
  margin: 0;
  border-right: 2px solid rgba(210, 220, 232, 0.62);
  border-top: 2px solid rgba(210, 220, 232, 0.62);
  transform: rotate(45deg);
}

body.home-page .challenge-card--process .challenge-card__arrow:nth-of-type(1) {
  left: calc(33.333% - 5px);
}

body.home-page .challenge-card--process .challenge-card__arrow:nth-of-type(2) {
  left: calc(66.666% - 5px);
}

body.home-page .challenge-card__process-labels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  margin-top: -5px;
}

body.home-page .mm3d-solution-shot {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

body.home-page .mm3d-solution-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 0;
  background: transparent;
  opacity: 1;
  mix-blend-mode: normal;
}

/*
 * Edge fade for the workflow plate only.
 * Image navy #02192E vs page #071321; left/right empty ~1.9% so X stay at 1.6%.
 * Card chrome / logo body start ~6–7% from top, so Y can be 3%.
 */
body.home-page .mm3d-solution-shot img.mm3d-solution-flow {
  --mm3d-flow-fade-x: 1.6%;
  --mm3d-flow-fade-y: 3%;
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 var(--mm3d-flow-fade-x), #000 calc(100% - var(--mm3d-flow-fade-x)), transparent),
    linear-gradient(to bottom, transparent, #000 var(--mm3d-flow-fade-y), #000 calc(100% - var(--mm3d-flow-fade-y)), transparent);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  -webkit-mask-composite: destination-in;
  mask-image:
    linear-gradient(to right, transparent, #000 var(--mm3d-flow-fade-x), #000 calc(100% - var(--mm3d-flow-fade-x)), transparent),
    linear-gradient(to bottom, transparent, #000 var(--mm3d-flow-fade-y), #000 calc(100% - var(--mm3d-flow-fade-y)), transparent);
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
  mask-composite: intersect;
}

body.home-page .mm3d-challenges-section .mm3d-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.home-page .mm3d-solution-block {
  display: grid;
  grid-template-columns: minmax(220px, 0.28fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  margin-top: 56px;
  margin-bottom: 40px;
  scroll-margin-top: 88px;
}

body.home-page .mm3d-solution-copy {
  position: relative;
  padding-bottom: 18px;
}

body.home-page .mm3d-solution-kicker {
  margin: 0 0 10px;
  color: #fff;
  font-family: "MM3D Display Serif", "Noto Serif TC", "MM3D Chinese Serif", serif;
  font-size: clamp(28px, 2.4vw, 36px);
  font-weight: 900;
  font-variation-settings: "wght" 900;
  line-height: 1.2;
}

body.home-page .mm3d-solution-lead {
  margin: 0;
  color: #f4f7fa;
  font-family: "MM3D Display Serif", "Noto Serif TC", "MM3D Chinese Serif", serif;
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 800;
  font-variation-settings: "wght" 800;
  line-height: 1.4;
  word-break: keep-all;
  overflow-wrap: normal;
}

body.home-page .mm3d-solution-lead-line {
  display: block;
}

body.home-page .mm3d-solution-desc {
  max-width: 22em;
  margin: 14px 0 0;
  color: var(--mm3d-challenges-muted);
  font-size: clamp(15px, 1.05vw, 17px);
  font-weight: 400;
  line-height: 1.55;
}

body.home-page .mm3d-challenges-section [data-mm3d-reveal] {
  opacity: 1;
  transform: none;
}

body.home-page .mm3d-challenges-section.is-animatable [data-mm3d-reveal].is-pending {
  opacity: 0;
  transform: translateY(24px);
}

body.home-page .mm3d-challenges-section.is-animatable [data-mm3d-reveal].is-inview {
  opacity: 1;
  transform: none;
  transition: opacity 620ms ease, transform 620ms ease;
}

body.home-page .mm3d-challenges-section.is-animatable .challenge-card:nth-child(2).is-inview {
  transition-delay: 100ms;
}

body.home-page .mm3d-challenges-section.is-animatable .challenge-card:nth-child(3).is-inview {
  transition-delay: 200ms;
}

@media (prefers-reduced-motion: reduce) {
  body.home-page .mm3d-challenges-section.is-animatable [data-mm3d-reveal],
  body.home-page .mm3d-challenges-section.is-animatable [data-mm3d-reveal].is-pending,
  body.home-page .mm3d-challenges-section.is-animatable [data-mm3d-reveal].is-inview {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 1199px) {
  body.home-page .mm3d-solution-block {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 1099px) {
  body.home-page .mm3d-challenges-section {
    padding: 72px 0 56px;
  }

  body.home-page .mm3d-challenges-intro,
  body.home-page .mm3d-solution-block {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  body.home-page .mm3d-challenges-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  body.home-page .mm3d-challenges-lead {
    max-width: none;
  }
}

@media (max-width: 700px) {
  body.home-page .mm3d-challenges-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.home-page .challenge-card {
    min-height: 0;
  }

  body.home-page .challenge-card__header {
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 12px;
    min-height: 0;
    padding: 18px 16px 16px;
  }

  body.home-page .challenge-card__number {
    font-size: 34px;
  }

  body.home-page .challenge-card__title {
    font-size: 26px;
  }

  body.home-page .challenge-card__description {
    font-size: 16px;
  }

  body.home-page .challenge-card__visual {
    height: 220px;
    flex-basis: 220px;
  }

  body.home-page .challenge-card--surface .challenge-card__visual-labels {
    width: min(220px, 72%);
    right: 6px;
    top: 32%;
  }

  body.home-page .challenge-card--large-area .challenge-card__visual {
    grid-template-columns: minmax(0, 1fr) 108px;
    padding-right: 16px;
  }

  body.home-page .challenge-card--process .challenge-card__process-item {
    height: 148px;
  }

  body.home-page .challenge-card--process .challenge-card__image {
    max-height: 148px;
  }
}
