/* ==========================================================================
   NEXORA — Own Your Platform Section
   Section-scoped styles. Shares tokens/type-scale/animation language with
   the rest of the site — no new visual system introduced here.
   ========================================================================== */

.ownership {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* --------------------------------------------------------------------------
   Background — a third distinct rhythm: warmer/greener undertone than the
   hero (cyan/violet) and capabilities (cyan/violet dots), signalling this
   is a different beat while staying within the same dark palette.
   -------------------------------------------------------------------------- */
.ownership__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.ownership__bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.ownership__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.13;
}

.ownership__glow--green {
  width: 480px;
  height: 480px;
  top: 10%;
  left: -140px;
  background: #0c4a6e;
}

.ownership__glow--cyan {
  width: 420px;
  height: 420px;
  bottom: -120px;
  right: -100px;
  background: var(--accent-primary);
}

/* --------------------------------------------------------------------------
   Heading block
   -------------------------------------------------------------------------- */
.ownership__head {
  max-width: 620px;
  margin-inline: auto;
  text-align: center;
  margin-bottom: clamp(56px, 8vw, 96px);
}

.ownership__head .text-eyebrow {
  justify-content: center;
  width: fit-content;
  margin-inline: auto;
  margin-bottom: var(--space-4);
}

.ownership__heading {
  font-size: var(--text-h2);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: var(--space-4);
}

.ownership__lead {
  font-size: var(--text-body-lg);
  color: var(--text-secondary);
  line-height: var(--lh-normal);
}

/* --------------------------------------------------------------------------
   Editorial layout — benefits flank the central workspace visual
   -------------------------------------------------------------------------- */
.ownership__layout {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.25fr) minmax(0, 0.82fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
}

.ownership__column {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vw, 32px);
}

.ownership__column--right {
  align-items: flex-end;
}

/* --------------------------------------------------------------------------
   Benefit modules — buttons, not decorative cards; keyboard + tap driven
   -------------------------------------------------------------------------- */
.benefit {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  max-width: 260px;
  color: inherit;
}

.ownership__column--right .benefit {
  flex-direction: row-reverse;
  text-align: right;
}

.benefit__icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  transition: transform 0.4s var(--ease-premium), border-color 0.4s var(--ease-premium), color 0.4s var(--ease-premium), background 0.4s var(--ease-premium);
}

.benefit__title {
  font-size: var(--text-card-title);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: 4px;
  transition: color 0.3s ease;
}

.benefit__desc {
  font-size: var(--text-body);
  color: var(--text-secondary);
  line-height: var(--lh-normal);
}

.benefit__connector {
  display: none;
}

@media (min-width: 1024px) {
  .benefit__connector {
    display: block;
    position: absolute;
    top: 19px;
    width: 28px;
    height: 1px;
    background: linear-gradient(90deg, var(--border-color-strong), transparent);
    transition: background 0.4s var(--ease-premium), opacity 0.4s var(--ease-premium);
    opacity: 0.6;
  }

  .ownership__column--left .benefit {
    position: relative;
    padding-right: 36px;
  }

  .ownership__column--left .benefit__connector {
    right: 0;
  }

  .ownership__column--right .benefit {
    position: relative;
    padding-left: 36px;
  }

  .ownership__column--right .benefit__connector {
    left: 0;
    background: linear-gradient(270deg, var(--border-color-strong), transparent);
  }
}

.benefit:hover .benefit__icon,
.benefit:focus-visible .benefit__icon,
.benefit.is-active .benefit__icon {
  border-color: var(--border-accent);
  color: var(--accent-primary-strong);
  background: var(--accent-gradient-soft);
  transform: translateY(-2px);
}

.benefit:hover .benefit__title,
.benefit:focus-visible .benefit__title,
.benefit.is-active .benefit__title {
  color: var(--accent-primary-strong);
}

.benefit:hover .benefit__connector,
.benefit:focus-visible .benefit__connector,
.benefit.is-active .benefit__connector {
  opacity: 1;
  background: linear-gradient(90deg, var(--accent-primary), transparent);
}

.ownership__column--right .benefit:hover .benefit__connector,
.ownership__column--right .benefit:focus-visible .benefit__connector,
.ownership__column--right .benefit.is-active .benefit__connector {
  background: linear-gradient(270deg, var(--accent-primary), transparent);
}

/* --------------------------------------------------------------------------
   Workspace — the central ownership visual
   -------------------------------------------------------------------------- */
.ownership__stage {
  position: relative;
  padding: 20px;
}

.ownership__stage-glow {
  position: absolute;
  inset: 8% 6%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.16), rgba(12, 74, 110, 0.12) 50%, transparent 74%);
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
}

.workspace {
  position: relative;
  z-index: 1;
  background: rgba(12, 16, 23, 0.74);
  border: 1px solid var(--border-color-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: transform 0.4s var(--ease-premium);
  will-change: transform;
}

.workspace__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-color);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
}

.workspace__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  color: var(--success);
}

.workspace__status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: ownership-pulse 2.4s ease-in-out infinite;
}

.workspace__layers {
  display: flex;
  flex-direction: column;
}

.workspace__layer {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.4s var(--ease-premium), background 0.4s var(--ease-premium), box-shadow 0.4s var(--ease-premium), opacity 0.4s var(--ease-premium);
}

.workspace__layer-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  transition: background 0.4s var(--ease-premium), color 0.4s var(--ease-premium);
}

.workspace__layer-label {
  display: block;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.workspace__layer-value {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
}

.workspace__layer-value .ok {
  color: var(--success);
}

.workspace__connector {
  position: relative;
  width: 1px;
  height: 18px;
  margin-left: calc(var(--space-4) + 17px);
  background: var(--border-color-strong);
  overflow: visible;
}

.workspace__connector::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 10px 2px rgba(34, 211, 238, 0.75);
  transform: translateX(-50%);
  animation: ownership-flow 3.6s ease-in-out infinite;
}

.workspace__connector:nth-of-type(4)::after { animation-delay: 0.9s; }
.workspace__connector:nth-of-type(6)::after { animation-delay: 1.8s; }

@keyframes ownership-flow {
  0% { top: -3px; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { top: 21px; opacity: 0; }
}

@keyframes ownership-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.8); }
}

/* Highlighted layer state, driven by benefit hover/focus/tap */
.workspace.has-active .workspace__layer {
  opacity: 0.55;
}

.workspace__layer.is-active {
  opacity: 1 !important;
  border-color: var(--border-accent);
  background: var(--accent-gradient-soft);
  box-shadow: 0 0 26px -10px rgba(34, 211, 238, 0.5);
}

.workspace__layer.is-active .workspace__layer-icon {
  background: var(--accent-gradient);
  color: #05121a;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .ownership__layout {
    grid-template-columns: 1fr;
  }

  .ownership__stage {
    order: -1;
    max-width: 520px;
    margin-inline: auto;
  }

  .ownership__column,
  .ownership__column--right {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    gap: var(--space-5);
    max-width: 640px;
    margin-inline: auto;
  }

  .benefit,
  .ownership__column--right .benefit {
    flex-direction: column;
    text-align: center;
    align-items: center;
    max-width: 220px;
  }
}

@media (max-width: 639px) {
  .ownership__column,
  .ownership__column--right {
    gap: var(--space-6);
  }

  .benefit {
    max-width: 160px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workspace__status .dot,
  .workspace__connector::after {
    animation: none !important;
    opacity: 0.3;
  }

  .workspace {
    transform: none !important;
  }
}
