/*=== Services overview (services-overview.php) ======

1.hero ---------------(copy + capability ring + summary card)
2.nav ----------------(sticky capability bar)
3.capabilities -------(intro, insight flow, photo, services)
4.responsive & reduced motion

Tokens come from rejola-ai.css. Each capability sets --cap.

==================================================*/

.so-page {
  overflow-x: clip;
}

/*---------- 1. hero ----------*/

.so-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 72px 0 80px;
  color: #fff;
  background: var(--rj-ink);
}

.so-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* the active capability's photo, set far back behind the ink */
.so-hero__photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  filter: grayscale(0.4) saturate(0.8);
  transform: scale(1.06);
  transition: opacity 1.4s var(--rj-ease), transform 7s linear;
}

.so-hero__photo.is-active {
  opacity: 0.22;
  transform: scale(1);
}

.so-hero__shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(700px 480px at 78% 45%, rgba(53, 52, 255, 0.4), transparent 70%),
    linear-gradient(90deg, rgba(6, 7, 26, 0.96) 0%, rgba(6, 7, 26, 0.82) 45%, rgba(6, 7, 26, 0.7) 100%),
    linear-gradient(0deg, var(--rj-ink) 0%, transparent 30%);
}

.so-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.so-hero .eyebrow {
  margin-bottom: 22px;
  color: var(--rj-indigo-300);
}

.so-hero h1.title {
  margin: 0 0 24px;
  font-size: clamp(42px, 4.8vw, 72px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
  color: #fff;
}

.so-hero__lead {
  max-width: 520px;
  margin: 0 0 24px;
  font-size: 19px !important;
  line-height: 1.55 !important;
  color: rgba(226, 228, 255, 0.78) !important;
}

.so-hero__status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.so-hero__status span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 13px;
  color: rgba(234, 235, 255, 0.86);
  border: 1px solid rgba(185, 184, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.so-hero__status span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
}

.so-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.so-hero__actions .rts-btn {
  width: auto;
}

.so-hero .rts-btn.btn-border {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(220, 220, 255, 0.3);
}

.so-hero .rts-btn.btn-border:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Capability ring */
.so-system {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.so-orbit {
  --a: 0deg;
  position: relative;
  width: min(400px, 100%);
  aspect-ratio: 1;
}

.so-orbit__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.so-orbit__ring circle {
  fill: none;
  stroke: rgba(185, 184, 255, 0.22);
  stroke-width: 1;
}

.so-orbit__ring .so-orbit__inner {
  stroke-dasharray: 2 6;
  stroke: rgba(185, 184, 255, 0.18);
}

/* a signal travelling round the ring */
.so-orbit__ring .so-orbit__pulse {
  stroke: var(--rj-indigo-300);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 8 92;
  filter: drop-shadow(0 0 6px rgba(143, 142, 255, 0.9));
  transform-origin: 200px 200px;
  animation: soPulse 9s linear infinite;
}

@keyframes soPulse {
  to { stroke-dashoffset: -100; }
}

/* spoke from the core to the active node */
.so-orbit__spoke {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 40%;
  margin-left: -1px;
  transform-origin: top center;
  transform: rotate(calc(var(--a) + 180deg));
  background: linear-gradient(180deg, rgba(143, 142, 255, 0), rgba(143, 142, 255, 0.7));
  transition: transform 0.9s var(--rj-ease);
}

.so-orbit__core {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 48%;
  aspect-ratio: 1;
  padding: 18px;
  text-align: center;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 50% 35%, rgba(83, 82, 255, 0.55), rgba(18, 19, 52, 0.95) 70%);
  border: 1px solid rgba(185, 184, 255, 0.35);
  box-shadow: 0 0 80px rgba(53, 52, 255, 0.45), inset 0 0 40px rgba(143, 142, 255, 0.15);
}

.so-orbit__live {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s, transform 0.6s var(--rj-ease);
}

.so-orbit__live.is-active {
  opacity: 1;
  transform: none;
}

.so-orbit__live strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-medium);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.so-orbit__live small {
  display: block;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(226, 228, 255, 0.65);
}

.so-orbit__label {
  position: absolute;
  bottom: 16%;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--rj-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--rj-indigo-300);
}

/* six nodes round the ring, starting at twelve o'clock */
.so-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto !important;
  padding: 8px 14px;
  font-size: 14px;
  color: rgba(234, 235, 255, 0.85);
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid rgba(185, 184, 255, 0.26);
  border-radius: 999px;
  background: rgba(14, 15, 40, 0.92);
  transform: translate(-50%, -50%);
  transition: color 0.3s, background-color 0.3s, border-color 0.3s, box-shadow 0.4s;
}

.so-node em {
  font-family: var(--rj-mono);
  font-style: normal;
  font-size: 10px;
  color: var(--cap);
}

.so-node:nth-child(1) { --x: 50%; --y: 10%; }
.so-node:nth-child(2) { --x: 84.6%; --y: 30%; }
.so-node:nth-child(3) { --x: 84.6%; --y: 70%; }
.so-node:nth-child(4) { --x: 50%; --y: 90%; }
.so-node:nth-child(5) { --x: 15.4%; --y: 70%; }
.so-node:nth-child(6) { --x: 15.4%; --y: 30%; }

.so-node:hover,
.so-node:focus-visible {
  color: #fff;
  border-color: rgba(185, 184, 255, 0.6);
}

.so-node.is-active {
  color: #fff;
  border-color: var(--cap);
  background: color-mix(in srgb, var(--cap) 28%, #0e0f28);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--cap) 20%, transparent), 0 0 30px color-mix(in srgb, var(--cap) 55%, transparent);
}

.so-node.is-active em {
  color: #fff;
}

/* Summary card for the active capability */
.so-slides {
  display: grid;
  width: min(520px, 100%);
}

.so-slide {
  grid-area: 1 / 1;
  padding: 22px 24px;
  border-radius: var(--rj-radius);
  border: 1px solid rgba(185, 184, 255, 0.18);
  border-top: 2px solid var(--cap);
  background: rgba(14, 15, 40, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.5s, transform 0.6s var(--rj-ease), visibility 0.5s;
}

.so-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.so-slide__kicker {
  margin-bottom: 8px;
  font-family: var(--rj-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rj-indigo-300);
}

.so-slide h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #fff;
}

.so-slide p {
  margin: 0 0 14px;
  font-size: 14px !important;
  line-height: 1.55 !important;
  color: rgba(226, 228, 255, 0.72) !important;
}

.so-slide__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.so-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.so-tags span {
  padding: 4px 9px;
  font-size: 11px;
  border-radius: 999px;
  color: rgba(234, 235, 255, 0.8);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(185, 184, 255, 0.2);
}

.so-slide__foot a {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
}

.so-slide__foot a:hover {
  color: var(--rj-indigo-300);
}

/*---------- 2. nav ----------*/

.so-nav {
  position: sticky;
  top: 72px;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rj-line);
}

.so-nav__list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.so-nav__list a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 8px;
  font-size: 15px;
  color: var(--rj-text);
  transition: color 0.25s;
}

.so-nav__list a em {
  font-family: var(--rj-mono);
  font-style: normal;
  font-size: 11px;
  color: var(--cap);
}

.so-nav__list a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  background: var(--cap);
  transform: scaleX(0);
  transition: transform 0.4s var(--rj-ease);
}

.so-nav__list a:hover,
.so-nav__list a.is-active {
  color: var(--rj-indigo);
}

.so-nav__list a.is-active::after,
.so-nav__list a:hover::after {
  transform: scaleX(1);
}

/*---------- 3. capabilities ----------*/

.so-cap {
  padding: 80px 0;
  scroll-margin-top: 130px;
  background: #fff;
}

.so-cap:nth-of-type(even) {
  background: var(--rj-paper);
}

.so-cap__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

.so-cap--reverse .so-cap__copy {
  order: 2;
}

.so-cap__num {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--rj-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--rj-muted);
}

.so-cap__num::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cap);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--cap) 18%, transparent);
}

.so-cap h2 {
  margin: 0 0 16px;
  font-size: clamp(40px, 4.4vw, 64px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--rj-text);
}

.so-cap__intro {
  margin: 0 0 28px;
  font-size: 18px !important;
  line-height: 1.65 !important;
  color: var(--rj-muted) !important;
}

/* Rejola Intelligence: the insight and its four-step flow */
.so-insight {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-radius: var(--rj-radius);
  border: 1px solid var(--rj-line);
  background: #fff;
  box-shadow: 0 24px 60px -40px rgba(12, 13, 42, 0.35);
}

.so-cap:nth-of-type(odd) .so-insight {
  background: var(--rj-paper);
}

.so-insight::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--cap);
}

.so-insight__label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--rj-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rj-indigo);
}

.so-insight__label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rj-indigo);
  animation: soBlink 2.4s ease-in-out infinite;
}

@keyframes soBlink {
  50% { opacity: 0.25; }
}

.so-insight__main {
  margin: 0 0 18px;
  font-family: var(--font-medium);
  font-size: 20px !important;
  line-height: 1.35 !important;
  letter-spacing: -0.02em;
  color: var(--rj-text) !important;
}

.so-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: so-step;
}

.so-flow li {
  position: relative;
  padding-top: 22px;
  padding-right: 10px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--rj-text);
  counter-increment: so-step;
}

/* node and connector */
.so-flow li::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--cap);
  z-index: 1;
}

.so-flow li::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 10px;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cap) 0 50%, var(--rj-line) 50% 100%) 100% 0 / 200% 100%;
}

.so-flow li:last-child::after {
  display: none;
}

/* the line fills step by step once the section is in view */
.so-cap.is-live .so-flow li::after {
  animation: soFill 0.7s var(--rj-ease) calc(var(--n) * 0.35s + 0.3s) forwards;
}

.so-cap.is-live .so-flow li::before {
  animation: soNode 0.4s var(--rj-ease) calc(var(--n) * 0.35s + 0.2s) forwards;
}

@keyframes soFill {
  to { background-position: 0 0; }
}

@keyframes soNode {
  to { background: var(--cap); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cap) 20%, transparent); }
}

/* Photo with a light scan line */
.so-cap__media {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--rj-radius);
  box-shadow: 0 40px 90px -45px rgba(12, 13, 42, 0.55);
}

.so-cap__media img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 1.2s var(--rj-ease);
}

.so-cap__media:hover img {
  transform: scale(1.03);
}

.so-cap__scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--cap) 22%, transparent) 50%, transparent 52%);
  background-size: 100% 260%;
  mix-blend-mode: screen;
  animation: soScan 6s ease-in-out infinite;
}

@keyframes soScan {
  0% { background-position: 0 100%; }
  60%, 100% { background-position: 0 -60%; }
}

.so-cap__media figcaption {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 6px 10px;
  font-family: var(--rj-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  border-radius: var(--rj-radius);
  background: rgba(6, 7, 26, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* Services that belong to the capability */
.so-cap__services {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--rj-line);
}

.so-cap__services-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rj-muted);
}

.so-cap__services-head em {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-style: normal;
  font-size: 11px;
  border-radius: 999px;
  color: #fff;
  background: var(--cap);
}

.so-cap__services ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.so-cap__services li {
  margin: 0;
  padding: 0;
}

.so-cap__services a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 100%;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.35;
  color: var(--rj-text);
  border-radius: var(--rj-radius);
  border: 1px solid var(--rj-line);
  background: #fff;
  transition: border-color 0.25s, box-shadow 0.3s, transform 0.3s var(--rj-ease), color 0.25s;
}

.so-cap__services a i {
  font-style: normal;
  color: var(--cap);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s, transform 0.3s var(--rj-ease);
}

.so-cap__services a:hover {
  color: var(--rj-indigo);
  border-color: color-mix(in srgb, var(--cap) 55%, transparent);
  box-shadow: 0 18px 40px -26px rgba(12, 13, 42, 0.45);
  transform: translateY(-2px);
}

.so-cap__services a:hover i {
  opacity: 1;
  transform: none;
}

/*---------- 4. responsive & reduced motion ----------*/

@media (max-width: 1199px) {
  .so-hero__grid,
  .so-cap__grid {
    gap: 36px;
  }
}

@media (max-width: 991px) {
  .so-hero {
    padding: 56px 0 64px;
  }

  .so-hero__grid,
  .so-cap__grid {
    grid-template-columns: 1fr;
  }

  .so-cap--reverse .so-cap__copy {
    order: 0;
  }

  /* the phone header is not always pinned, so the bar scrolls with the page */
  .so-nav {
    position: relative;
    top: auto;
  }

  .so-nav__list {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .so-nav__list a {
    flex: 0 0 auto;
    padding: 14px 16px;
  }

  .so-cap {
    padding: 64px 0;
  }
}

@media (max-width: 767px) {
  .so-hero__actions .rts-btn {
    width: 100%;
    justify-content: center;
  }

  .so-orbit {
    width: min(340px, 100%);
  }

  .so-node {
    padding: 6px 10px;
    font-size: 12px;
  }

  .so-orbit__live strong {
    font-size: 14px;
  }

  .so-orbit__live small,
  .so-orbit__label {
    display: none;
  }

  .so-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 14px;
  }

  .so-flow li:nth-child(2)::after {
    display: none;
  }

  .so-cap {
    padding: 56px 0;
  }

  .so-cap__services {
    margin-top: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .so-hero__photo,
  .so-orbit__ring .so-orbit__pulse,
  .so-insight__label::before,
  .so-cap__scan {
    animation: none !important;
    transition: none !important;
  }

  .so-flow li::after {
    background-position: 0 0;
  }

  .so-flow li::before {
    background: var(--cap);
  }
}
