/* SparkGrid Support Conversation — self-contained component */
.sg-support-conversation {
  --sg-line: rgba(255,255,255,.145);
  --sg-card-border: rgba(255,255,255,.14);
  --sg-text: rgba(255,255,255,.96);
  --sg-muted: rgba(255,255,255,.43);
  --sg-blue: #2c9cff;

  position: relative;
  width: 100%;
  aspect-ratio: 1.18 / 1;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
  background-image: url('./support-conversation-bg.jpeg');
  background-size: cover;
  background-position: center;
  border: 0;
  border-radius: 2px;
  color: var(--sg-text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Editorial grid lines */
.sg-support-conversation::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      transparent 0,
      transparent 14.4%,
      var(--sg-line) 14.4%,
      var(--sg-line) calc(14.4% + 1px),
      transparent calc(14.4% + 1px),
      transparent 85.5%,
      var(--sg-line) 85.5%,
      var(--sg-line) calc(85.5% + 1px),
      transparent calc(85.5% + 1px)
    ),
    linear-gradient(180deg,
      transparent 0,
      transparent 83.8%,
      var(--sg-line) 83.8%,
      var(--sg-line) calc(83.8% + 1px),
      transparent calc(83.8% + 1px)
    );
}

/* Darkens the artwork without flattening it: stronger on the already-dark left,
   gentle over the bright painted area on the right. */
.sg-support-conversation::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      rgba(0,0,0,.38) 0%,
      rgba(0,0,0,.29) 27%,
      rgba(0,0,0,.18) 55%,
      rgba(0,0,0,.13) 100%
    ),
    rgba(0,0,0,.05);
}

.sg-support-conversation__inner {
  position: relative;
  z-index: 2;
  height: 100%;
  padding: clamp(62px, 8vw, 126px) clamp(38px, 6vw, 96px) clamp(64px, 7vw, 112px);
}

.sg-support-conversation__message {
  position: absolute;
}

.sg-support-conversation__message--customer {
  top: 14%;
  left: 18%;
  width: min(43%, 470px);
}

.sg-support-conversation__message--expert {
  top: 40%;
  left: 29%;
  width: min(59%, 660px);
}

.sg-support-conversation__label {
  margin: 0 0 12px 22px;
  color: var(--sg-muted);
  font-size: clamp(20px, 2.15vw, 32px);
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: 1.1;
}

.sg-support-conversation__message--expert .sg-support-conversation__label {
  margin-left: auto;
  margin-right: 28px;
  width: max-content;
}

/* HYROS-inspired message surface:
   very dark core that opens into a softer graphite edge instead of a flat grey panel. */
.sg-support-conversation__bubble {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 150% at 100% 18%, rgba(86,88,91,.22) 0%, rgba(48,49,52,.11) 34%, rgba(10,11,12,0) 67%),
    linear-gradient(112deg,
      rgba(8,9,10,.95) 0%,
      rgba(13,14,15,.93) 34%,
      rgba(25,26,28,.88) 70%,
      rgba(43,44,47,.79) 100%
    );
  border: 1px solid var(--sg-card-border);
  border-radius: clamp(22px, 2.6vw, 34px);
  padding: clamp(24px, 3vw, 38px) clamp(28px, 3.5vw, 44px);
  box-shadow:
    0 26px 74px rgba(0,0,0,.31),
    inset 0 1px 0 rgba(255,255,255,.045),
    inset -28px 0 54px rgba(255,255,255,.018);
  -webkit-backdrop-filter: blur(15px) saturate(100%);
  backdrop-filter: blur(15px) saturate(100%);
}

/* Very soft edge haze — it should feel embedded in the image, not glowing. */
.sg-support-conversation__bubble::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(102deg, rgba(0,0,0,.12), transparent 46%, rgba(255,255,255,.025));
  box-shadow: inset 0 0 42px rgba(0,0,0,.10);
}

.sg-support-conversation__message--customer .sg-support-conversation__bubble {
  border-color: rgba(255,255,255,.135);
}

.sg-support-conversation__message--expert .sg-support-conversation__bubble {
  border-color: rgba(44,156,255,.97);
  box-shadow:
    0 0 0 1px rgba(44,156,255,.055),
    0 28px 78px rgba(0,0,0,.32),
    inset 0 1px 0 rgba(255,255,255,.045),
    inset -28px 0 54px rgba(255,255,255,.018);
}

.sg-support-conversation__bubble p {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: clamp(24px, 2.8vw, 38px);
  font-weight: 420;
  line-height: 1.38;
  letter-spacing: -.035em;
  text-wrap: pretty;
}

/* Optional entrance motion. Remove the .sg-support-conversation--animate class for a static block. */
.sg-support-conversation--animate .sg-support-conversation__message {
  opacity: 0;
  transform: translateY(14px);
  animation: sgSupportMessageIn .72s cubic-bezier(.2,.72,.2,1) forwards;
}

.sg-support-conversation--animate .sg-support-conversation__message--customer {
  animation-delay: .12s;
}

.sg-support-conversation--animate .sg-support-conversation__message--expert {
  animation-delay: .8s;
}

/* The site starts the approved sequence when this section enters the viewport. */
.sg-support-conversation--animate .sg-support-conversation__message {
  animation-play-state: paused;
}

.sg-support-conversation--animate.is-visible .sg-support-conversation__message {
  animation-play-state: running;
}

@keyframes sgSupportMessageIn {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .sg-support-conversation--animate .sg-support-conversation__message {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

@media (max-width: 760px) {
  .sg-support-conversation {
    aspect-ratio: auto;
    min-height: 660px;
    background-position: 58% center;
  }

  .sg-support-conversation::before {
    background:
      linear-gradient(90deg,
        transparent 0,
        transparent 7%,
        var(--sg-line) 7%,
        var(--sg-line) calc(7% + 1px),
        transparent calc(7% + 1px),
        transparent 93%,
        var(--sg-line) 93%,
        var(--sg-line) calc(93% + 1px),
        transparent calc(93% + 1px)
      ),
      linear-gradient(180deg,
        transparent 0,
        transparent 90%,
        var(--sg-line) 90%,
        var(--sg-line) calc(90% + 1px),
        transparent calc(90% + 1px)
      );
  }

  .sg-support-conversation::after {
    background:
      linear-gradient(90deg, rgba(0,0,0,.34) 0%, rgba(0,0,0,.20) 55%, rgba(0,0,0,.14) 100%),
      rgba(0,0,0,.05);
  }

  .sg-support-conversation__message--customer {
    top: 11%;
    left: 11%;
    width: 72%;
  }

  .sg-support-conversation__message--expert {
    top: 42%;
    left: 16%;
    width: 78%;
  }

  .sg-support-conversation__label {
    margin-left: 12px;
    margin-bottom: 9px;
    font-size: 19px;
  }

  .sg-support-conversation__message--expert .sg-support-conversation__label {
    margin-right: 14px;
  }

  .sg-support-conversation__bubble {
    padding: 22px 23px;
    border-radius: 24px;
  }

  .sg-support-conversation__bubble p {
    font-size: clamp(21px, 5.7vw, 27px);
    line-height: 1.38;
  }
}
