/* ==================================================================
   ROYCE SOCIAL — homepage feature section.
   Markup lives inline in index.html (single consumer), between the
   funding mount and #contact. It is a teaser for /social-trading, and
   every CTA on it lands on that page rather than the client portal: the
   page interposes a risk notice (its route modal) before registration,
   and its script does not ship here.

   Ported from update/Home/royce-home-social.html. Deviations, and why:

   1. CLASS NAMES. The prototype scopes everything under the id
      #royce-home-social with .rhs-* children. Here the section is the
      class .rz-social with BEM children, in step with the other ported
      sections on this page. The two SVG gradient ids are renamed
      rzSocialFlow / rzSocialHubGlow so they read as page-scoped.

   2. FONTS. Marcellus + Inter are dropped; the section inherits the
      self-hosted 'Ping AR + LT' — neither Google font covers Arabic
      (NFR-10). Sizes and line-heights are the prototype's. The SVG
      labels inherit the same face.

   3. TOKENS. Ivory and the two golds resolve to the site's --royce-*
      custom properties (css/style.css). The teal / mint family takes the
      values css/social-trading.css already ships (--rc-midnight,
      --rc-petrol, --rc-teal, --rc-mint) rather than the prototype's
      near-duplicates, so the teaser and the page it links to match.
      Gold is confined to the eyebrow, the primary button, the hub
      outline and the hairline seams.

   4. FIXED DARK, NOT THEME-AWARE. The network artwork is drawn for a
      dark plate, so the section keeps its own background in both themes
      — the same call css/markets.css and css/funding.css made. It sits
      between two navy bands (funding, contact); the 1px gradient seams
      (::before / ::after) are what separates it from them.

   5. REVEAL USES THE SITE'S OBSERVER. The prototype ships an IIFE that
      adds .rhs-armed / .rhs-in through an IntersectionObserver.
      general.js already does exactly this for .animate-on-scroll, so the
      section opts into that and no script is added. The blanket fade
      style.css attaches to .animate-on-scroll is cancelled so only the
      choreographed children move; the prototype's .rhs-d1…d5 delays
      become a --d custom property on each .rz-social__r element.

   6. RTL. The mobile flow's physical offsets are logical here, so the
      spine and chevron sit on the reading side under dir="rtl". The SVG
      itself is not mirrored: a flow diagram reads left→right by
      convention in either direction, and its labels translate.

   7. RISK LINE. One line the prototype does not carry: the copy-trading
      risk statement /social-trading leads with, repeated here under the
      CTAs in the same words (st_hero_risk). BRD §8.2.

   CONTENT RULES CARRIED OVER FROM /social-trading
    · Three follower nodes are a diagram, not a count of anything.
    · No performance, return or ranking claims — the visual carries no
      figures, curves or percentages.
   ================================================================== */

/* #region ------- ( 1- Section shell ) ---------- */
.rz-social {
  --rz-social-midnight: #06141b;
  --rz-social-petrol: #0b2630;
  --rz-social-teal: #0f8f88;
  --rz-social-mint: #43d7c3;
  --rz-social-pad-y: clamp(66px, 6.4vw, 88px);
  --rz-social-gutter: clamp(20px, 4vw, 40px);
  --rz-social-maxw: 1240px;

  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: var(--rz-social-pad-y) 0;
  background: radial-gradient(110% 82% at 14% 34%, rgba(15, 143, 136, 0.2) 0%, rgba(15, 143, 136, 0) 60%), radial-gradient(60% 50% at 4% 96%, rgba(67, 215, 195, 0.08) 0%, rgba(67, 215, 195, 0) 62%), linear-gradient(180deg, var(--rz-social-midnight) 0%, var(--rz-social-petrol) 50%, var(--rz-social-midnight) 100%);
  color: var(--royce-ivory);
  -webkit-font-smoothing: antialiased;
}
.rz-social *,
.rz-social *::before,
.rz-social *::after {
  box-sizing: border-box;
}

.rz-social::before,
.rz-social::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  z-index: 2;
  pointer-events: none;
}
.rz-social::before {
  top: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(67, 215, 195, 0.4) 30%, rgba(214, 166, 28, 0.32) 66%, transparent 100%);
}
.rz-social::after {
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(15, 143, 136, 0.28) 46%, transparent 100%);
}

.rz-social__container {
  max-width: var(--rz-social-maxw);
  margin: 0 auto;
  padding: 0 var(--rz-social-gutter);
  position: relative;
  z-index: 1;
}

.rz-social__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: clamp(40px, 5.4vw, 80px);
  align-items: center;
}
/* #endregion */

/* #region ------- ( 2- Signature visual — copy network ) ---------- */
.rz-social__visual {
  margin: 0;
  position: relative;
}
.rz-social__net {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  /* The diagram is drawn in LTR coordinates and is not mirrored (deviation
     6). Pinning direction keeps text-anchor:start meaning "the x given"
     under dir="rtl", so a translated follower label still hangs off the
     right of its node instead of running back over it. */
  direction: ltr;
}
.rz-social__flow {
  display: none;
}

.rz-social__path {
  stroke: rgba(67, 215, 195, 0.24);
  stroke-width: 1;
  stroke-dasharray: 1 5;
}
.rz-social__lbl {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  fill: rgba(248, 248, 248, 0.52);
}
.rz-social__lbl--mid {
  text-anchor: middle;
}
.rz-social__lbl--hub {
  fill: var(--royce-gold);
  letter-spacing: 0.24em;
}
.rz-social__lbl--dim {
  fill: rgba(67, 215, 195, 0.44);
  font-size: 8.5px;
}
/* #endregion */

/* #region ------- ( 3- Copy column ) ---------- */
.rz-social__eyebrow {
  display: block;
  margin: 0 0 20px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rz-social-mint);
}
.rz-social__title {
  margin: 0 0 20px;
  font-weight: 400;
  font-size: clamp(33px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.005em;
  color: var(--royce-ivory);
}
.rz-social__title-sub {
  display: block;
  margin-top: 6px;
  color: rgba(248, 248, 248, 0.52);
}
.rz-social__lede {
  margin: 0 0 34px;
  max-width: 44ch;
  font-size: clamp(14.5px, 1.06vw, 16px);
  line-height: 1.72;
  color: rgba(248, 248, 248, 0.66);
}

.rz-social__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.rz-social__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  padding: 17px 32px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}
.rz-social__btn--primary {
  background: var(--royce-gold);
  color: var(--rz-social-midnight);
  border: 1px solid var(--royce-gold);
}
.rz-social__btn--primary:hover {
  background: var(--royce-gold-hover);
  border-color: var(--royce-gold-hover);
  color: var(--rz-social-midnight);
  box-shadow: 0 10px 34px rgba(214, 166, 28, 0.2);
}
.rz-social__btn--ghost {
  background: transparent;
  color: var(--royce-ivory);
  border: 1px solid rgba(67, 215, 195, 0.34);
  padding: 16px 26px;
  font-size: 12px;
}
.rz-social__btn--ghost:hover {
  color: var(--royce-ivory);
  border-color: var(--rz-social-mint);
  background: rgba(15, 143, 136, 0.09);
}
.rz-social__btn:focus-visible,
.rz-social__link:focus-visible {
  outline: 2px solid var(--royce-gold);
  outline-offset: 3px;
}

.rz-social__tertiary {
  margin: 0 0 22px;
}
.rz-social__link {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(248, 248, 248, 0.58);
  text-decoration: none;
  border-bottom: 1px solid rgba(67, 215, 195, 0.28);
  padding-bottom: 3px;
  transition:
    color 0.25s ease,
    border-color 0.25s ease;
}
.rz-social__link:hover {
  color: var(--rz-social-mint);
  border-color: var(--rz-social-mint);
}
/* the arrow is a glyph, so it has to be turned by hand for Arabic */
.rz-social__link-arrow {
  display: inline-block;
}
[dir='rtl'] .rz-social__link-arrow {
  transform: scaleX(-1);
}

.rz-social__risk {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: rgba(248, 248, 248, 0.38);
  max-width: 52ch;
}
.rz-social__risk strong {
  font-weight: 600;
  color: rgba(248, 248, 248, 0.58);
}
/* #endregion */

/* #region ------- ( 4- Entrance choreography ) ---------- */
/* general.js adds .animate-in to any .animate-on-scroll element. The
   blanket fade style.css attaches to that class is cancelled here so the
   section does not move as a whole — the copy rises line by line on its
   --d delays, and the network draws provider → signal → hub → outbound →
   followers. See deviation 5. */
.rz-social.animate-on-scroll {
  opacity: 1;
  transform: none;
  transition: none;
  will-change: auto;
}
.rz-social .rz-social__r {
  opacity: 0;
  transform: translateY(14px);
}
.rz-social.animate-in .rz-social__r {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.68s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.68s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: var(--d, 0s);
}

.rz-social .rz-social__field,
.rz-social .rz-social__node,
.rz-social .rz-social__micro {
  opacity: 0;
}
.rz-social .rz-social__path {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
}
.rz-social .rz-social__sig {
  opacity: 0;
}

.rz-social.animate-in .rz-social__field,
.rz-social.animate-in .rz-social__node,
.rz-social.animate-in .rz-social__micro {
  opacity: 1;
  transition: opacity 0.6s ease;
}
.rz-social.animate-in .rz-social__field {
  transition-delay: 0.05s;
}
.rz-social.animate-in .rz-social__node--provider {
  transition-delay: 0.18s;
}
.rz-social.animate-in .rz-social__node--hub {
  transition-delay: 0.66s;
}
.rz-social.animate-in .rz-social__node--f1 {
  transition-delay: 1.16s;
}
.rz-social.animate-in .rz-social__node--f2 {
  transition-delay: 1.3s;
}
.rz-social.animate-in .rz-social__node--f3 {
  transition-delay: 1.44s;
}
.rz-social.animate-in .rz-social__micro {
  transition-delay: 1.62s;
}

.rz-social.animate-in .rz-social__path {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.rz-social.animate-in .rz-social__path--in {
  transition-delay: 0.34s;
}
.rz-social.animate-in .rz-social__path--o1 {
  transition-delay: 0.86s;
}
.rz-social.animate-in .rz-social__path--o2 {
  transition-delay: 0.94s;
}
.rz-social.animate-in .rz-social__path--o3 {
  transition-delay: 1.02s;
}

/* ambient copy signal after the reveal */
.rz-social.animate-in .rz-social__sig {
  opacity: 1;
  stroke-dasharray: 26 260;
  animation: rz-social-travel 4.6s linear infinite;
}
.rz-social.animate-in .rz-social__sig--in {
  animation-delay: 0s;
}
.rz-social.animate-in .rz-social__sig--1 {
  animation-delay: 1.5s;
}
.rz-social.animate-in .rz-social__sig--2 {
  animation-delay: 1.8s;
}
.rz-social.animate-in .rz-social__sig--3 {
  animation-delay: 2.1s;
}
@keyframes rz-social-travel {
  from {
    stroke-dashoffset: 286;
  }
  to {
    stroke-dashoffset: 0;
  }
}
/* #endregion */

/* #region ------- ( 5- Responsive ) ---------- */
@media (max-width: 1199.98px) {
  .rz-social__grid {
    gap: clamp(36px, 4.6vw, 54px);
  }
  .rz-social__lbl {
    font-size: 10.5px;
  }
  .rz-social__lbl--dim {
    font-size: 9.5px;
  }
}

@media (max-width: 991.98px) {
  .rz-social {
    --rz-social-pad-y: clamp(62px, 9vw, 74px);
  }
  .rz-social__grid {
    grid-template-columns: 1fr;
    gap: 46px;
  }
  /* copy leads, network follows */
  .rz-social__copy {
    order: 1;
  }
  .rz-social__visual {
    order: 2;
  }
  .rz-social__lede {
    max-width: 58ch;
  }
}

/* Mobile — purpose-built vertical flow, not a shrunken diagram */
@media (max-width: 767.98px) {
  .rz-social {
    --rz-social-pad-y: 64px;
    --rz-social-gutter: 22px;
    background: radial-gradient(110% 44% at 18% 6%, rgba(15, 143, 136, 0.2) 0%, rgba(15, 143, 136, 0) 62%), linear-gradient(180deg, var(--rz-social-midnight) 0%, var(--rz-social-petrol) 56%, var(--rz-social-midnight) 100%);
  }
  .rz-social__grid {
    gap: 40px;
  }

  .rz-social__eyebrow {
    margin-bottom: 18px;
    font-size: 10.5px;
    letter-spacing: 0.2em;
  }
  .rz-social__title {
    font-size: 33px;
    line-height: 1.12;
    margin-bottom: 18px;
  }
  .rz-social__title-sub {
    margin-top: 4px;
  }
  .rz-social__lede {
    margin-bottom: 28px;
    font-size: 15px;
    line-height: 1.78;
    max-width: 100%;
  }

  .rz-social__actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 22px;
  }
  .rz-social__btn {
    width: 100%;
    padding: 19px 24px;
    font-size: 12.5px;
  }
  .rz-social__btn--ghost {
    padding: 18px 24px;
    font-size: 12.5px;
  }
  .rz-social__link {
    font-size: 13px;
  }
  .rz-social__risk {
    max-width: 100%;
  }

  /* swap the SVG for the flow */
  .rz-social__net {
    display: none;
  }
  .rz-social__flow {
    display: block;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .rz-social__flow-item {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      'mark name'
      'mark meta';
    align-items: center;
    column-gap: 18px;
    row-gap: 5px;
    padding: 20px;
    padding-inline-start: 18px;
    border: 1px solid rgba(67, 215, 195, 0.16);
    background: rgba(15, 143, 136, 0.05);
  }
  .rz-social__flow-mark {
    grid-area: mark;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--rz-social-teal);
    box-shadow: 0 0 0 6px rgba(15, 143, 136, 0.14);
  }
  .rz-social__flow-item--hub .rz-social__flow-mark {
    border-radius: 0;
    width: 14px;
    height: 14px;
    transform: rotate(45deg);
    background: transparent;
    border: 1px solid var(--royce-gold);
    box-shadow: 0 0 0 6px rgba(214, 166, 28, 0.1);
  }
  .rz-social__flow-item--followers .rz-social__flow-mark {
    background: var(--rz-social-mint);
  }
  .rz-social__flow-name {
    grid-area: name;
    font-size: 19px;
    line-height: 1.2;
    color: var(--royce-ivory);
  }
  .rz-social__flow-item--hub .rz-social__flow-name {
    color: var(--royce-gold);
  }
  .rz-social__flow-meta {
    grid-area: meta;
    font-size: 10.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(248, 248, 248, 0.44);
  }
  .rz-social__flow-link {
    position: relative;
    height: 52px;
    display: flex;
    align-items: center;
    padding-inline-start: 24px;
  }
  .rz-social__flow-link::before {
    content: '';
    position: absolute;
    inset-inline-start: 24px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, rgba(67, 215, 195, 0.55), rgba(67, 215, 195, 0.12));
  }
  .rz-social__flow-link::after {
    content: '';
    position: absolute;
    inset-inline-start: 21px;
    bottom: 2px;
    width: 7px;
    height: 7px;
    border-right: 1px solid rgba(67, 215, 195, 0.55);
    border-bottom: 1px solid rgba(67, 215, 195, 0.55);
    transform: rotate(45deg);
  }
  .rz-social__flow-link-label {
    padding-inline-start: 20px;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(67, 215, 195, 0.62);
  }
}

@media (max-width: 399.98px) {
  .rz-social {
    --rz-social-gutter: 18px;
  }
  .rz-social__title {
    font-size: 30px;
  }
  .rz-social__flow-name {
    font-size: 17.5px;
  }
  .rz-social__flow-item {
    padding: 18px 16px;
    column-gap: 15px;
  }
}
/* #endregion */

/* #region ------- ( 6- Reduced motion ) ---------- */
@media (prefers-reduced-motion: reduce) {
  .rz-social .rz-social__r {
    opacity: 1;
    transform: none;
  }
  .rz-social .rz-social__field,
  .rz-social .rz-social__node,
  .rz-social .rz-social__micro {
    opacity: 1;
  }
  .rz-social .rz-social__path {
    stroke-dasharray: 1 5;
    stroke-dashoffset: 0;
  }
  .rz-social .rz-social__sig {
    opacity: 0.55 !important;
    animation: none !important;
    stroke-dasharray: none !important;
  }
  .rz-social .rz-social__r,
  .rz-social .rz-social__path,
  .rz-social .rz-social__node,
  .rz-social .rz-social__field,
  .rz-social .rz-social__micro,
  .rz-social .rz-social__btn,
  .rz-social .rz-social__link {
    transition: none !important;
  }
}
/* #endregion */
