/* Connect by JBRH — Interactive Outcome Explorer Stylesheet
   Replaces static product screenshots with an interactive SVG-driven outcome explorer.
   Palette: Warm ivory/white, dark ink, soft gold, restrained teal accent.
   Desktop: 4 vertical tabs + large inline SVG scene stage.
   Mobile: Accessible accordion panels revealing the same rich scenes.
*/

/* ==================================================
   1. SECTION CONTAINER & HEADER
   ================================================== */
.outcome-explorer-section {
  position: relative;
  padding-top: clamp(2.5rem, 5vw, 4.5rem);
  padding-bottom: clamp(2.5rem, 5vw, 4.5rem);
  overflow: visible;
  box-sizing: border-box;
  scroll-margin-top: calc(var(--header-h, 72px) + 2rem);
}

.outcome-section-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto clamp(2rem, 3.5vw, 2.75rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
}

.outcome-section-header .lp-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--premium-copper, #AA682B);
  background: rgba(226, 177, 118, 0.12);
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(226, 177, 118, 0.28);
}

html[data-theme="dark"] .outcome-section-header .lp-label {
  color: var(--premium-gold, #FFD685);
  background: rgba(240, 191, 128, 0.1);
  border-color: rgba(226, 177, 118, 0.22);
}

.outcome-section-header h2 {
  font-size: clamp(1.85rem, 3.8vw, 2.85rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink, #171916);
  margin: 0;
}

html[data-theme="dark"] .outcome-section-header h2 {
  color: #F8F9FA;
}

.outcome-lede {
  font-size: clamp(0.95rem, 1.4vw, 1.08rem);
  line-height: 1.55;
  color: var(--muted, #67635C);
  max-width: 68ch;
  margin: 0 auto;
}

html[data-theme="dark"] .outcome-lede {
  color: #A0A5A2;
}

/* ==================================================
   2. EXPLORER SHELL (Desktop Grid Layout)
   ================================================== */
.outcome-explorer-shell {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 1.75rem;
  align-items: stretch;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Left Flank: Vertical Tabs Column */
.outcome-tabs-column {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  justify-content: space-between;
}

.outcome-item-group {
  display: flex;
  flex-direction: column;
}

/* Tab Button Primitives */
.outcome-tab-btn {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.85);
  border: 1px solid rgba(170, 104, 43, 0.14);
  box-shadow: 0 4px 16px rgba(62, 44, 25, 0.04);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: all 280ms cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--ink, #171916);
  position: relative;
  box-sizing: border-box;
}

html[data-theme="dark"] .outcome-tab-btn {
  background: rgba(24, 28, 26, 0.85);
  border-color: rgba(226, 177, 118, 0.14);
  color: #F8F9FA;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.outcome-tab-btn:hover {
  border-color: rgba(226, 177, 118, 0.45);
  background: rgba(255, 253, 248, 0.98);
  transform: translateY(-1px);
}

html[data-theme="dark"] .outcome-tab-btn:hover {
  background: rgba(30, 35, 32, 0.95);
  border-color: rgba(240, 191, 128, 0.35);
}

/* Active Tab State */
.outcome-tab-btn.is-active,
.outcome-tab-btn[aria-selected="true"] {
  background: rgba(255, 253, 248, 1);
  border-color: #E2B176;
  box-shadow: 0 8px 24px rgba(170, 104, 43, 0.12), 0 0 0 2px rgba(226, 177, 118, 0.3);
}

html[data-theme="dark"] .outcome-tab-btn.is-active,
html[data-theme="dark"] .outcome-tab-btn[aria-selected="true"] {
  background: rgba(32, 38, 35, 1);
  border-color: #FFD685;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 0 2px rgba(240, 191, 128, 0.25);
}

.outcome-tab-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(226, 177, 118, 0.14);
  color: var(--premium-copper, #AA682B);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 260ms ease;
  margin-top: 0.1rem;
}

html[data-theme="dark"] .outcome-tab-icon-box {
  background: rgba(240, 191, 128, 0.12);
  color: var(--premium-gold, #FFD685);
}

.outcome-tab-btn.is-active .outcome-tab-icon-box {
  background: #2FA896;
  color: #FFFFFF;
  box-shadow: 0 0 14px rgba(47, 168, 150, 0.45);
}

.outcome-tab-svg {
  width: 20px;
  height: 20px;
  display: block;
}

.outcome-tab-text-stack {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.outcome-tab-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink, #171916);
  line-height: 1.25;
}

html[data-theme="dark"] .outcome-tab-title {
  color: #FFFFFF;
}

.outcome-tab-benefit {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted, #67635C);
}

html[data-theme="dark"] .outcome-tab-benefit {
  color: #A0A5A2;
}

.outcome-tab-chevron {
  font-size: 1.1rem;
  color: rgba(170, 104, 43, 0.4);
  transition: transform 260ms ease, color 260ms ease;
  align-self: center;
}

.outcome-tab-btn.is-active .outcome-tab-chevron {
  color: #2FA896;
  transform: translateX(3px);
}

/* ==================================================
   3. STAGE CONTAINER & SCENE PANELS
   ================================================== */
.outcome-stage-container {
  position: relative;
  min-height: 520px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.85) 0%, rgba(250, 246, 238, 0.75) 60%, rgba(243, 237, 225, 0.6) 100%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.98) 0%, rgba(246, 239, 228, 0.94) 100%);
  border: 1px solid rgba(170, 104, 43, 0.16);
  box-shadow: 0 16px 44px rgba(62, 44, 25, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

html[data-theme="dark"] .outcome-stage-container {
  background:
    radial-gradient(circle at 50% 30%, rgba(28, 34, 31, 0.9) 0%, rgba(18, 22, 20, 0.95) 65%, rgba(12, 15, 14, 0.98) 100%),
    linear-gradient(180deg, rgba(20, 24, 22, 0.98) 0%, rgba(14, 17, 16, 0.98) 100%);
  border-color: rgba(226, 177, 118, 0.18);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Scene Panel Wrapper */
.outcome-scene-panel {
  position: relative;
  width: 100%;
  height: 100%;
  flex: 1;
  padding: 1.5rem clamp(1.25rem, 2.5vw, 2rem);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
}

.outcome-scene-panel[hidden] {
  display: none !important;
}

/* Scene Top Bar: Breadcrumb Kicker & Live Status */
.scene-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  z-index: 5;
}

.scene-kicker-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--premium-copper, #AA682B);
  background: rgba(226, 177, 118, 0.12);
  border: 1px solid rgba(226, 177, 118, 0.25);
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
}

html[data-theme="dark"] .scene-kicker-pill {
  color: var(--premium-gold, #FFD685);
  background: rgba(240, 191, 128, 0.1);
  border-color: rgba(226, 177, 118, 0.2);
}

.scene-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink, #171916);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(170, 104, 43, 0.14);
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

html[data-theme="dark"] .scene-status-indicator {
  color: #F8F9FA;
  background: rgba(22, 26, 24, 0.85);
  border-color: rgba(226, 177, 118, 0.16);
}

.pulse-dot-teal {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2FA896;
  box-shadow: 0 0 8px #2FA896;
}

.pulse-dot-gold {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #E2B176;
  box-shadow: 0 0 8px #E2B176;
}

/* ==================================================
   4. THREE-STAGE FLOW ARCHITECTURE (Incoming -> Connect -> Outcome)
   ================================================== */
.scene-flow-workspace {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 330px;
  display: grid;
  grid-template-columns: 1fr 140px 1.2fr;
  align-items: center;
  gap: 1rem;
  z-index: 4;
}

/* Underlying Background SVG Signal Paths Canvas */
.scene-svg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.outcome-spline-path {
  fill: none;
  stroke: rgba(170, 104, 43, 0.18);
  stroke-width: 2.2;
  stroke-linecap: round;
  transition: stroke 320ms ease, stroke-width 320ms ease;
}

html[data-theme="dark"] .outcome-spline-path {
  stroke: rgba(226, 177, 118, 0.18);
}

.outcome-spline-path.is-active {
  stroke: #E2B176;
  stroke-width: 2.5;
  filter: drop-shadow(0 0 5px rgba(226, 177, 118, 0.6));
}

.outcome-spline-path.is-success {
  stroke: #2FA896;
  stroke-width: 2.5;
  filter: drop-shadow(0 0 5px rgba(47, 168, 150, 0.65));
}

.spline-port-dot {
  fill: #E2B176;
  filter: drop-shadow(0 0 3px rgba(226, 177, 118, 0.8));
  transition: all 260ms ease;
}

.spline-port-dot.is-success {
  fill: #2FA896;
  filter: drop-shadow(0 0 3px rgba(47, 168, 150, 0.8));
}

/* Stage Columns */
.flow-column {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.flow-column.incoming-column {
  align-items: stretch;
}

.flow-column.center-column {
  align-items: center;
  justify-content: center;
}

.flow-column.outcome-column {
  align-items: stretch;
}

/* Flow Column Labels */
.flow-col-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #67635C);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.15rem;
}

html[data-theme="dark"] .flow-col-label {
  color: #8C928E;
}

/* Cards inside the Flow */
.outcome-flow-card {
  position: relative;
  z-index: 5;
  border-radius: 12px;
  background: #FFFDF8;
  border: 1px solid rgba(170, 104, 43, 0.14);
  box-shadow: 0 4px 14px rgba(62, 44, 25, 0.05);
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  box-sizing: border-box;
  transition: all 260ms ease;
}

html[data-theme="dark"] .outcome-flow-card {
  background: #181C1A;
  border-color: rgba(226, 177, 118, 0.16);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.outcome-flow-card.is-active-input {
  border-color: #E2B176;
  box-shadow: 0 4px 18px rgba(170, 104, 43, 0.12), 0 0 0 1.5px rgba(226, 177, 118, 0.3);
}

.outcome-flow-card.is-completed-output {
  border-color: #2FA896;
  background: linear-gradient(135deg, rgba(47, 168, 150, 0.08) 0%, #FFFDF8 100%);
  box-shadow: 0 4px 18px rgba(47, 168, 150, 0.12), 0 0 0 1.5px rgba(47, 168, 150, 0.3);
}

html[data-theme="dark"] .outcome-flow-card.is-completed-output {
  background: linear-gradient(135deg, rgba(47, 168, 150, 0.14) 0%, #181C1A 100%);
  box-shadow: 0 6px 20px rgba(47, 168, 150, 0.22);
}

.card-mini-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(226, 177, 118, 0.15);
  color: var(--premium-copper, #AA682B);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

html[data-theme="dark"] .card-mini-icon {
  background: rgba(240, 191, 128, 0.12);
  color: var(--premium-gold, #FFD685);
}

.is-completed-output .card-mini-icon {
  background: rgba(47, 168, 150, 0.18);
  color: #2FA896;
}

.card-text-block {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
}

.card-title-row {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink, #171916);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

html[data-theme="dark"] .card-title-row {
  color: #FFFFFF;
}

.card-desc-row {
  font-size: 0.75rem;
  color: var(--muted, #67635C);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .card-desc-row {
  color: #9AA09C;
}

/*  0.64rem is 10.24px: under the 11px the public-site audit treats as a defect,
    and under the 12px secondary floor the app holds itself to. */
.card-status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.badge-gold {
  background: rgba(226, 177, 118, 0.18);
  /*  3.92:1 as #AA682B. The shared ink token is the same copper, readable. */
  color: var(--accent-text, #8D551E);
}

html[data-theme="dark"] .badge-gold {
  background: rgba(240, 191, 128, 0.16);
  color: #FFD685;
}

.badge-teal {
  background: rgba(47, 168, 150, 0.16);
  /*  #2FA896 on its own tint is 2.45:1 ("Authorized", the Control scene). The
      same teal the call button was darkened to reads at 5:1. */
  color: #1C7468;
}

html[data-theme="dark"] .badge-teal {
  color: #52C6B3;
}

.badge-amber {
  background: rgba(230, 106, 18, 0.16);
  /*  Amber stays its own hue — it is the difference between "needs review" and
      "urgent", and two badges that differ only by a tint are one badge. #E66A12
      on its own tint is 2.68:1; this is the same orange at 4.62. */
  color: #A84D0D;
}

/*  The light-theme orange above is 2.5:1 on the dark card. Same hue, lifted. */
html[data-theme="dark"] .badge-amber {
  background: rgba(245, 162, 93, 0.16);
  color: #F5A25D;
}

/* ==================================================
   5. CENTER CONNECT PROCESSING NEXUS
   ================================================== */
.outcome-core-nexus {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #FFFFFF 0%, #FAF6EE 50%, #ECE3D4 100%);
  border: 2px solid #E2B176;
  box-shadow: 0 0 28px rgba(226, 177, 118, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 4;
}

html[data-theme="dark"] .outcome-core-nexus {
  background: radial-gradient(circle at 40% 35%, #2A322E 0%, #1A201D 60%, #101412 100%);
  border-color: #FFD685;
  box-shadow: 0 0 32px rgba(240, 191, 128, 0.25), inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

.nexus-orbit-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1.5px dashed rgba(226, 177, 118, 0.35);
  animation: nexusSpin 20s linear infinite;
  pointer-events: none;
}

@keyframes nexusSpin {
  100% { transform: rotate(360deg); }
}

.nexus-logo-glyph {
  width: 30px;
  height: 30px;
  display: block;
}

.nexus-label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--premium-copper, #AA682B);
  margin-top: 0.2rem;
}

html[data-theme="dark"] .nexus-label {
  color: var(--premium-gold, #FFD685);
}

.nexus-pulse-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid rgba(47, 168, 150, 0.6);
  opacity: 0;
  animation: nexusPulse 3s ease-out infinite;
}

@keyframes nexusPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* ==================================================
   6. DELIVERABLE RESULTS STRIP (BOTTOM OF SCENE)
   ================================================== */
.scene-results-strip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(170, 104, 43, 0.12);
  width: 100%;
  z-index: 5;
}

html[data-theme="dark"] .scene-results-strip {
  border-top-color: rgba(226, 177, 118, 0.12);
}

.result-metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(47, 168, 150, 0.12);
  color: #165E54;
  border: 1px solid rgba(47, 168, 150, 0.3);
  box-shadow: 0 2px 8px rgba(47, 168, 150, 0.08);
  backdrop-filter: blur(6px);
}

html[data-theme="dark"] .result-metric-chip {
  background: rgba(47, 168, 150, 0.16);
  color: #5CE1C6;
  border-color: rgba(47, 168, 150, 0.35);
}

.result-metric-chip.is-gold {
  background: rgba(226, 177, 118, 0.15);
  color: #AA682B;
  border-color: rgba(226, 177, 118, 0.35);
}

html[data-theme="dark"] .result-metric-chip.is-gold {
  background: rgba(240, 191, 128, 0.14);
  color: #FFD685;
}

.result-chip-icon {
  font-size: 0.8rem;
}

/* ==================================================
   7. MOBILE ACCORDION STYLING (<= 820px)
   ================================================== */
@media (max-width: 820px) {
  /*  `1fr` floors at the content's min-width, so the tab column kept a
      356px track inside a 285px phone and the whole page scrolled sideways.
      `minmax(0, 1fr)` lets the track be the viewport; `min-width: 0` lets the
      cards inside it follow.  */
  .outcome-explorer-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .outcome-tabs-column,
  .outcome-item-group,
  .outcome-tab-btn,
  .outcome-mobile-scene-slot,
  .outcome-scene-panel {
    min-width: 0;
  }

  .outcome-stage-container {
    display: none !important; /* On mobile, panels live inside accordion drawers */
  }

  .outcome-tab-btn {
    padding: 0.95rem 1.1rem;
    border-radius: 14px;
  }

  .outcome-tab-chevron {
    transform: rotate(90deg) !important;
    transition: transform 280ms ease !important;
  }

  .outcome-tab-btn[aria-expanded="false"] .outcome-tab-chevron {
    transform: rotate(0deg) !important;
  }

  /* Mobile Accordion Drawer Container */
  .outcome-mobile-scene-slot {
    width: 100%;
    overflow: hidden;
    transition: max-height 380ms cubic-bezier(0.16, 1, 0.3, 1), opacity 300ms ease;
  }

  .outcome-mobile-scene-slot:empty {
    display: none;
  }

  .outcome-mobile-scene-slot .outcome-scene-panel {
    display: flex !important;
    padding: 1.25rem 1rem;
    margin-top: 0.65rem;
    border-radius: 18px;
    background:
      radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.9) 0%, rgba(250, 246, 238, 0.85) 100%),
      linear-gradient(180deg, rgba(255, 253, 248, 0.98) 0%, rgba(246, 239, 228, 0.95) 100%);
    border: 1px solid rgba(170, 104, 43, 0.18);
    box-shadow: 0 10px 28px rgba(62, 44, 25, 0.08);
  }

  html[data-theme="dark"] .outcome-mobile-scene-slot .outcome-scene-panel {
    background:
      radial-gradient(circle at 50% 30%, rgba(28, 34, 31, 0.95) 0%, rgba(18, 22, 20, 0.98) 100%),
      linear-gradient(180deg, rgba(20, 24, 22, 0.98) 0%, rgba(14, 17, 16, 0.98) 100%);
    border-color: rgba(226, 177, 118, 0.2);
  }

  /*  The same `minmax(0, 1fr)` as the shell above: with `1fr` the track floors
      at the widest card's nowrap title and badge, so one longer badge pushed
      every card in the scene past the panel's edge (CONNECT_BUYER_FIRST_SCREEN_V1). */
  .scene-flow-workspace {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
    min-height: auto;
  }

  .flow-column.center-column {
    display: none; /* In mobile viewport, connect processing is represented as a badge/pill to prevent overcrowding */
  }

  .scene-svg-canvas {
    display: none; /* Hide background SVG connectors on narrow screens for maximum clarity */
  }

  .scene-results-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .result-metric-chip {
    justify-content: center;
  }
}
