/* ==========================================================================
   LP03 · UNIT 7 · REAL SUPPORT FROM PEOPLE WHO UNDERSTAND — live conversation
   --------------------------------------------------------------------------
   Deep-teal section. A circular portrait of a Fatorly team member (call
   rings + headset badge) with a chat thread resting on its lower edge:
   the copy's two topics — "Guidance with setup" and "A technical
   question" — each answered by the team after typing dots. A language chip
   (Aa · ع) stands for "the languages your business uses".
   Copy sits at inline-end. sup.js plays the thread once on view; without
   motion the whole thread is shown, answered.
   ========================================================================== */

.sup {
  background: linear-gradient(150deg, var(--c-deep-teal) 0%, #022657 55%, var(--c-navy) 100%);
  color: var(--c-on-dark-body);
}

.sup__decor {
  background:
    radial-gradient(ellipse 45% 55% at 25% 50%, rgba(0, 169, 182, 0.2), transparent 70%),
    radial-gradient(ellipse 35% 40% at 100% 0%, rgba(255, 255, 255, 0.05), transparent 70%);
}

[dir="rtl"] .sup__decor {
  scale: -1 1;
}

.sup__grid {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: center;
}

@media (min-width: 48rem) {
  .sup__grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: clamp(2rem, 5vw, 5rem);
  }

  .sup__copy {
    order: 2;                    /* copy at inline-end, scene at inline-start */
  }
}

/* ---------------------------------------------------------------------------
   Copy
   --------------------------------------------------------------------------- */
.sup__copy {
  display: grid;
  gap: var(--space-lg);
  justify-items: center;
  text-align: center;
}

.sup__copy h2 {
  max-inline-size: 18ch;
  color: var(--c-on-dark);
}

.sup__copy .t-body {
  max-inline-size: 32rem;
}

@media (min-width: 48rem) {
  .sup__copy {
    justify-items: start;
    text-align: start;
  }
}

/* ---------------------------------------------------------------------------
   Scene (fixed aspect box; children placed in %)
   --------------------------------------------------------------------------- */
.sup__scene {
  position: relative;
  inline-size: min(100%, 32rem);
  aspect-ratio: 1 / 1.05;
  margin-inline: auto;
  direction: ltr;                /* the composition reads left → right */
}

/* Portrait + call rings */
.sup__portrait {
  position: absolute;
  inset-block-start: 2%;
  inset-inline-start: 2%;
  inline-size: 64%;
  aspect-ratio: 1;
}

.sup__portrait img {
  position: relative;
  z-index: 1;
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5);
}

.sup__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(0, 169, 182, 0.55);
  animation: sup-ring 3.2s var(--ease-out) infinite;
}

.sup__ring:nth-child(2) {
  animation-delay: 1.6s;
}

@keyframes sup-ring {
  from { transform: scale(1); opacity: 0.8; }
  to   { transform: scale(1.3); opacity: 0; }
}

/* Headset badge on the portrait edge */
.sup__headset {
  position: absolute;
  z-index: 2;
  inset-block-end: 4%;
  inset-inline-end: 4%;
  display: grid;
  place-items: center;
  inline-size: 3.25rem;
  block-size: 3.25rem;
  border-radius: 50%;
  background-color: var(--c-teal);
  color: var(--c-navy);
  box-shadow: 0 0 0 6px rgba(0, 169, 182, 0.25), var(--shadow-md);
}

.sup__headset svg {
  inline-size: 1.5rem;
  block-size: 1.5rem;
}

/* Language chip */
.sup__lang {
  position: absolute;
  inset-block-start: 6%;
  inset-inline-end: 2%;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding-block: 0.45rem;
  padding-inline: 0.6rem 0.875rem;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: var(--c-white);
  font-weight: 700;
}

.sup__lang svg {
  inline-size: 1.25rem;
  block-size: 1.25rem;
  color: var(--c-teal);
}

.sup__lang i {
  font-style: normal;
  opacity: 0.45;
}

/* ---- Chat thread ----------------------------------------------------------- */
.sup__thread {
  position: absolute;
  z-index: 3;
  inset-block-end: 0;
  inset-inline-end: 0;
  inline-size: 64%;
  display: grid;
  gap: 0.5rem;
}

.sup__msg {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-inline-size: 100%;
  padding-block: 0.6rem;
  padding-inline: 0.75rem 0.9rem;
  border-radius: 16px;
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.3;
}

.sup__msg svg {
  flex: none;
  inline-size: 1.125rem;
  block-size: 1.125rem;
}

/* visitor question (white, inline-end aligned) */
.sup__msg--q {
  justify-self: end;
  border-end-end-radius: 4px;
  background-color: var(--c-white);
  color: var(--c-ink);
  box-shadow: var(--shadow-md);
}

.sup__msg--q svg {
  color: var(--c-teal);
}

/* team answer (teal, inline-start aligned) */
.sup__msg--a {
  justify-self: start;
  inline-size: 72%;
  border-end-start-radius: 4px;
  background-color: var(--c-teal);
  color: var(--c-navy);
  box-shadow: 0 12px 30px -12px rgba(0, 169, 182, 0.6);
}

.sup__lines {
  display: grid;
  gap: 0.3rem;
  flex: 1;
}

.sup__lines i {
  display: block;
  block-size: 0.35rem;
  border-radius: var(--r-pill);
  background-color: rgba(2, 17, 58, 0.45);
}

.sup__lines i:last-child {
  inline-size: 60%;
}

/* typing dots (shown while the team "types"; sup.js toggles .is-typing) */
.sup__dots {
  display: none;
  gap: 0.25rem;
  padding-block: 0.2rem;
}

.sup__dots i {
  inline-size: 0.4rem;
  block-size: 0.4rem;
  border-radius: 50%;
  background-color: var(--c-navy);
  animation: sup-dot 1s ease-in-out infinite;
}

.sup__dots i:nth-child(2) { animation-delay: 0.15s; }
.sup__dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes sup-dot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30%           { opacity: 1; transform: translateY(-3px); }
}

.sup__msg--a.is-typing {
  inline-size: auto;
}

.sup__msg--a.is-typing .sup__dots {
  display: flex;
}

.sup__msg--a.is-typing .sup__lines,
.sup__msg--a.is-typing > svg {
  display: none;
}

@media (max-width: 29.99rem) {
  .sup__thread {
    inline-size: 74%;
  }

  .sup__msg {
    font-size: var(--fs-caption);
    padding-block: 0.5rem;
  }

  .sup__headset {
    inline-size: 2.5rem;
    block-size: 2.5rem;
  }

  .sup__headset svg {
    inline-size: 1.125rem;
    block-size: 1.125rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sup__ring,
  .sup__dots i {
    animation: none;
  }
}

/* Ring wrapper (faded in by sup.js; the rings themselves loop in CSS) */
.sup__rings {
  position: absolute;
  inset: 0;
}

/* ---------------------------------------------------------------------------
   Section CTA (→ hero form)
   --------------------------------------------------------------------------- */
@media (min-width: 48rem) {
  .sup__cta {
    justify-content: flex-start;    /* follows the start-aligned copy */
  }
}
