/* ── X-Ray Demo ─────────────────────────────────────────────────────────────
   Brand colour variables — additive only; no existing site colours overridden.
   ──────────────────────────────────────────────────────────────────────────── */
:root {
  --ona-teal:   #007480;
  --ona-orange: #D1B49C;
  --ona-purple: #590606;
}

/* ── Full-screen page wrapper ─────────────────────────────────────────────── */
.xray-page {
  display: flex;
  height: calc(100vh - 72px); /* 72px ≈ Bootstrap 4 navbar height */
  min-height: 480px;
  background: #0B0B0C;
  overflow: hidden;
}

/* ── 75 %: chart / interaction area ──────────────────────────────────────── */
.xray-wrapper {
  position: relative;
  flex: 0 0 75%;
  width: 75%;
  overflow: hidden;
  cursor: none;
  user-select: none;
  -webkit-user-select: none;
  background: #0B0B0C;
  border-right: 1px solid rgba(153, 153, 170, 0.08);
}

/* ── Inner canvas — fixed at SVG dimensions, JS applies scale + centering ─── */
.xray-inner {
  position: absolute;
  /* width, height, top, left, transform all set by JS */
  transform-origin: top left;
}

/* ── SVG layer base ───────────────────────────────────────────────────────── */
.xray-layer {
  position: absolute;
  top: 0;
  left: 0;
}

/* ── Layer 1: org chart ───────────────────────────────────────────────────── */
/*
  Fades out when the full network is revealed so the neon graph reads cleanly.
  Controlled by JS setting inline opacity; transition is CSS-driven.
*/
#xray-org-layer {
  transition: opacity 0.5s ease;
}

/* ── Layer 2A: lens-masked network + purple tint ──────────────────────────── */
/*
  Start fully hidden (opacity: 0). JS sets opacity to 1 only while the cursor
  is inside the wrapper AND isFullNetworkView is false.
  No opacity transition here — the lens should appear/disappear instantly.
  The mask-image radial-gradient (set inline by JS) restricts what's visible.
*/
#xray-net-layer {
  opacity: 0;
}

/* ── Purple X-ray tint ────────────────────────────────────────────────────── */
/*
  Shared by both the lens tint (#xray-tint) and the full-reveal tint
  (#xray-tint-full). Sets background colour and removes pointer events.
*/
.xray-tint {
  position: absolute;
  inset: 0;
  background: rgba(89, 6, 6, 0.36); /* --ona-purple at 36 % */
  pointer-events: none;
}

/* Lens tint starts hidden; opacity controlled by JS in sync with #xray-net-layer */
#xray-tint {
  opacity: 0;
}

/* ── Layer 2B: full-reveal network + tint ────────────────────────────────── */
/*
  Start fully hidden. JS sets opacity to 1 on toggle; the CSS transition
  creates the 500 ms smooth fade-in of the entire neon network.
*/
#xray-net-full,
#xray-tint-full {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

/* ── Animated lens ring ───────────────────────────────────────────────────── */
@keyframes xray-pulse-ring {
  0%   { opacity: 0.9; transform: translate(-50%, -50%) scale(1);    }
  60%  { opacity: 0.4; transform: translate(-50%, -50%) scale(1.04); }
  100% { opacity: 0.9; transform: translate(-50%, -50%) scale(1);    }
}

.xray-lens-ring {
  position: absolute;
  width: 250px;   /* 250 px diameter lens (LENS_R 125 × 2) */
  height: 250px;
  border-radius: 50%;
  pointer-events: none;
  border: 1.5px solid rgba(0, 116, 128, 0.85);
  box-shadow:
    0 0 14px rgba(0, 116, 128, 0.7),
    0 0 32px rgba(0, 116, 128, 0.3),
    inset 0 0 22px rgba(89, 6, 6, 0.18);
  animation: xray-pulse-ring 2.8s ease-in-out infinite;
  display: none; /* shown by JS when cursor enters the chart area */
}

/* ── Idle hint overlay ────────────────────────────────────────────────────── */
.xray-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.xray-hint span {
  color: #9999aa;
  font-size: 13px;
  letter-spacing: 0.06em;
  padding: 7px 18px;
  border-radius: 20px;
  border: 1px solid rgba(153, 153, 170, 0.2);
  background: rgba(11, 11, 12, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ── 25 %: sidebar ────────────────────────────────────────────────────────── */
.xray-sidebar {
  flex: 0 0 25%;
  width: 25%;
  background: #111214;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* flex-start ensures overflow-y: auto scrolls from the top */
  gap: 28px;
  padding: 40px 32px;
  overflow-y: auto;
}

/* ── Badge ────────────────────────────────────────────────────────────────── */
.xray-badge {
  display: flex;
  align-items: center;
  gap: 9px;
}

.xray-glow-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ona-teal);
  box-shadow: 0 0 8px var(--ona-teal), 0 0 16px var(--ona-teal);
}

.xray-badge-label {
  color: var(--ona-teal);
  font-size: 10px;
  letter-spacing: 0.14em;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.4;
}

/* ── Sidebar headline ─────────────────────────────────────────────────────── */
.xray-demo-title {
  color: #f0f2f5;
  font-size: clamp(16px, 1.6vw, 24px);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.02em;
  margin: 0;
}

/* ── Pitch copy blockquote ────────────────────────────────────────────────── */
.xray-quote {
  margin: 0;
  padding: 20px 24px;
  background: rgba(11, 11, 12, 0.6);
  border-radius: 8px;
  border: 1px solid rgba(0, 116, 128, 0.18);
  box-shadow: 0 0 32px rgba(0, 116, 128, 0.05);
}

.xray-quote p {
  color: #9999aa;
  font-size: clamp(12px, 1.1vw, 14px);
  line-height: 1.7;
  font-style: italic;
  font-weight: 400;
  margin: 0;
}

.xray-attribution {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.xray-rule {
  display: inline-block;
  flex-shrink: 0;
  width: 20px;
  height: 1px;
  background: rgba(0, 116, 128, 0.5);
}

.xray-attr-label {
  color: var(--ona-teal);
  font-size: 10px;
  letter-spacing: 0.12em;
  font-weight: 600;
  text-transform: uppercase;
  font-style: normal;
}

/* ── Sidebar narrative copy ───────────────────────────────────────────────── */
/*
  .xray-sidebar-copy wraps the Reality of Work text and the insight list.
  Internal elements use their own vertical rhythm; the parent gap: 28px on
  .xray-sidebar handles the spacing above (from h1) and below (to button).
*/

.xray-sidebar-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Section heading — "The Reality of Work" */
.xray-sb-heading {
  color: #f0f2f5;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0;
}

/* Body paragraph */
.xray-sb-body {
  color: #9999aa;
  font-size: 12.5px;
  line-height: 1.75;
  margin: 0;
}

/* Sub-heading — "What the X-Ray Reveals" */
.xray-sb-subheading {
  color: var(--ona-teal);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 6px 0 0;  /* extra top breathing room before the list */
}

/* Insight list — no default list chrome */
.xray-sb-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

/* Each list item — indented to give the bullet dot room */
.xray-sb-item {
  position: relative;
  padding-left: 18px;
  color: #9999aa;
  font-size: 12.5px;
  line-height: 1.7;
}

/* Teal glowing dot bullet */
.xray-sb-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ona-teal);
  box-shadow: 0 0 6px var(--ona-teal);
  flex-shrink: 0;
}

/* Bold term label ("The Hidden Influencers:") in --ona-orange */
.xray-sb-term {
  display: block;
  color: var(--ona-orange);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 3px;
}

/* ── Toggle button ────────────────────────────────────────────────────────── */
/*
  Default state (X-Ray mode): teal outline, transparent fill.
  Active state (.is-full-network): purple fill/border, light text.
  All properties transition so the swap between states is smooth.
*/
.xray-toggle-btn {
  display: block;
  width: 100%;
  padding: 13px 20px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  background: transparent;
  color: var(--ona-teal);
  border: 1.5px solid var(--ona-teal);
  box-shadow: none;
  transition:
    background   0.3s ease,
    border-color 0.3s ease,
    color        0.3s ease,
    box-shadow   0.3s ease;
}

.xray-toggle-btn:hover {
  background: rgba(0, 116, 128, 0.12);
  box-shadow: 0 0 22px rgba(0, 116, 128, 0.22);
  outline: none;
}

.xray-toggle-btn:focus-visible {
  outline: 2px solid var(--ona-teal);
  outline-offset: 3px;
}

/* Full-network active state: swap to --ona-purple palette */
.xray-toggle-btn.is-full-network {
  background: rgba(89, 6, 6, 0.2);
  border-color: var(--ona-purple);
  color: #f0f2f5;
  box-shadow: 0 0 22px rgba(89, 6, 6, 0.2);
}

.xray-toggle-btn.is-full-network:hover {
  background: rgba(89, 6, 6, 0.32);
  box-shadow: 0 0 28px rgba(89, 6, 6, 0.28);
}

/* ── Insights section ─────────────────────────────────────────────────────── */

.xray-insights {
  background: #0B0B0C;
  padding: 80px 0 96px;
  border-top: 1px solid rgba(153, 153, 170, 0.08);
}

/* Centre the badge inside the section header */
.xray-badge--center {
  justify-content: center;
}

.xray-insights-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 56px;
}

.xray-insights-title {
  color: #f0f2f5;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.2;
  margin: 14px 0 18px;
}

.xray-insights-intro {
  color: #9999aa;
  font-size: clamp(14px, 1.3vw, 16px);
  line-height: 1.78;
  margin: 0;
}

/* ── Three-column card grid ───────────────────────────────────────────────── */
.xray-insights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ── Individual insight card ──────────────────────────────────────────────── */
.xray-insight-card {
  position: relative;
  background: #111214;
  border-radius: 10px;
  border: 1px solid rgba(153, 153, 170, 0.08);
  padding: 32px 28px 36px;
  overflow: hidden;
}

/* Coloured top-edge accent line with glow */
.xray-insight-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.xray-insight-card--teal::before {
  background: var(--ona-teal);
  box-shadow: 0 0 18px rgba(0, 116, 128, 0.65);
}

.xray-insight-card--orange::before {
  background: var(--ona-orange);
  box-shadow: 0 0 18px rgba(209, 180, 156, 0.5);
}

.xray-insight-card--purple::before {
  background: var(--ona-purple);
  box-shadow: 0 0 18px rgba(89, 6, 6, 0.9), 0 0 4px rgba(140, 20, 20, 0.8);
}

/* Sequential number label in the card's accent colour */
.xray-insight-num {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.xray-insight-card--teal   .xray-insight-num { color: var(--ona-teal);   }
.xray-insight-card--orange .xray-insight-num { color: var(--ona-orange); }
.xray-insight-card--purple .xray-insight-num { color: #c41a1a;           }

/* Card headline */
.xray-insight-title {
  color: #f0f2f5;
  font-size: clamp(16px, 1.4vw, 19px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}

/* Card body copy */
.xray-insight-body {
  color: #9999aa;
  font-size: clamp(13px, 1.05vw, 15px);
  line-height: 1.75;
  margin: 0;
}

/* ── Touch / coarse-pointer: restore default cursor ──────────────────────── */
@media (hover: none) {
  .xray-wrapper {
    cursor: default;
  }
}

/* ── Responsive: stack vertically on narrow screens ──────────────────────── */
@media (max-width: 860px) {
  .xray-page {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }

  .xray-wrapper {
    flex: none;
    width: 100%;
    height: 55vw;
    min-height: 220px;
    border-right: none;
    border-bottom: 1px solid rgba(153, 153, 170, 0.08);
  }

  .xray-sidebar {
    flex: none;
    width: 100%;
    padding: 32px 24px;
    gap: 20px;
  }

  .xray-toggle-btn {
    padding: 14px 20px;
  }

  .xray-insights {
    padding: 56px 0 72px;
  }

  .xray-insights-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .xray-insight-card {
    padding: 24px 22px 28px;
  }
}
