/* ========== INFINITY / MARKETECTURE SECTION ========== */
.infinity-section {
  padding: 80px 80px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: var(--color-bg-dark);
}

.infinity-heading {
  font-size: 42px;
  line-height: 1.2;
  margin-bottom: 50px;
}

.infinity-heading strong {
  background: linear-gradient(135deg, var(--color-green), var(--color-teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-style: italic;
}

/* Infinity Container — square so H and V lemniscates both fit without clipping */
.infinity-container {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 0 40px;
}

.infinity-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
}

/* Hex-infinity variant — wider to fit two interlocking hexagons */
.infinity-visual.hex-infinity-visual {
  aspect-ratio: 1.6 / 1;
  max-width: 960px;
  margin: 0 auto;
}

/* Canvas for 3D ribbon */
.infinity-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

/* Host layer for dynamically-generated dots (sits on top of the canvas) */
.inf-dots-host {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
.inf-dots-host .inf-dot { pointer-events: auto; }

/* ========== PERSON OVERLAYS — SVG silhouettes inside the infinity loops ==========
   Inline SVG people (no external image URLs, always load). They sit above
   the canvas (z-index: 5 > canvas z-index: 2) with a soft drop shadow so
   they feel embedded in the ribbon. Variants place the person inside the
   correct lobe for horizontal / vertical orientations. */
.inf-person {
  position: absolute;
  display: block;
  z-index: 5;
  pointer-events: none;
}

/* Horizontal ribbon — persons sit in the left / right lobes */
.inf-person-left  { top: 16%; left: 8%;  width: 28%; height: 68%; }
.inf-person-right { top: 16%; right: 8%; width: 28%; height: 68%; }

/* Vertical ribbon — persons sit in the top / bottom lobes */
.inf-person-top    { top: 7%;    left: 50%; transform: translateX(-50%); width: 42%; height: 36%; }
.inf-person-bottom { bottom: 7%; left: 50%; transform: translateX(-50%); width: 42%; height: 36%; }

/* The SVG figure itself — always visible, soft shadow for depth */
.inf-person-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 6px 20px var(--overlay-black-55))
          drop-shadow(0 0 12px var(--ribbon-teal-light));
  overflow: visible;
}

/* Capsule pill labels — sit just below each figure */
.inf-capsule {
  display: inline-block;
  padding: 7px 22px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 700;
  color: white;
  letter-spacing: 0.4px;
  white-space: nowrap;
  position: absolute;
  bottom: -14%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  pointer-events: auto;
}
.inf-person-top .inf-capsule    { bottom: -16%; }
.inf-person-bottom .inf-capsule { bottom: auto; top: -12%; transform: translateX(-50%); }

.inf-capsule-employees {
  background: linear-gradient(135deg, var(--color-purple), var(--color-purple-dark));
  box-shadow: 0 4px 18px var(--glow-purple-50);
}
.inf-capsule-customers {
  background: linear-gradient(135deg, var(--color-purple-dark), var(--color-purple-darker));
  box-shadow: 0 4px 18px var(--glow-purple-dark-50);
}

.infinity-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--color-green);
  margin: 0 0 14px;
  text-align: center;
}

/* ========== COMPARE SECTION — H + V side by side in one section ========== */
.compare-section {
  padding: 80px 60px 100px;
  background: linear-gradient(180deg, var(--color-bg-dark) 0%, var(--color-bg-darkest) 100%);
  text-align: center;
  position: relative;
  border-top: 1px solid var(--overlay-white-06);
}
.compare-heading {
  font-size: 36px;
  line-height: 1.2;
  margin: 0 0 50px;
  color: white;
}
.compare-heading strong {
  background: linear-gradient(135deg, var(--color-green), var(--color-teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-style: italic;
}
.compare-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  max-width: 1300px;
  margin: 0 auto;
  align-items: center;    /* vertical centers line up across columns */
  justify-items: center;
}
.compare-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: 100%;
  max-width: 620px;
}
.compare-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--color-green);
  margin: 0;
}
.compare-visual {
  position: relative;
  width: 100%;
}
.compare-visual .infinity-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}
.compare-visual .inf-center-label span {
  font-size: 16px;
  padding: 8px 18px;
}
.compare-visual[data-infinity-mode="horizontal"] { aspect-ratio: 1.55 / 1; }
.compare-visual[data-infinity-mode="vertical"]   { aspect-ratio: 1 / 1.25; max-width: 480px; }

/* ========== CENTER LABEL ========== */
.inf-center-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.inf-center-label span {
  font-size: 24px;
  font-weight: 800;
  white-space: nowrap;
  color: white;
  text-shadow: 0 2px 12px var(--overlay-black-60);
  background: var(--scrim-dark-50);
  padding: 10px 28px;
  border-radius: 8px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ========== DYNAMIC DOTS — positioned in pixels by infinity.js ========== */
/* Each .inf-dot is a zero-size button placed at a curve point by JS.
   The circle + label are absolutely positioned relative to that point,
   and the label side is controlled by .inf-dot-label-{top|bottom|left|right}. */
.inf-dot {
  position: absolute;
  width: 0;
  height: 0;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 8;
}

.inf-dot-circle {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--overlay-white-96);
  border: 3px solid var(--overlay-white-100);
  box-shadow: 0 0 14px var(--overlay-white-45), 0 2px 10px var(--overlay-black-45);
  transition: all 0.3s ease;
}

.inf-dot-label {
  position: absolute;
  font-size: 14px;
  font-weight: 700;
  color: var(--overlay-white-94);
  white-space: nowrap;
  text-shadow: 0 2px 8px var(--overlay-black-90), 0 0 18px var(--overlay-black-55);
  transition: color 0.3s ease;
  letter-spacing: 0.2px;
}

/* Label position variants — the slot layout in infinity.js picks the best side */
.inf-dot-label-top .inf-dot-label {
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
}
.inf-dot-label-bottom .inf-dot-label {
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
}
.inf-dot-label-left .inf-dot-label {
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
}
.inf-dot-label-right .inf-dot-label {
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.inf-dot:hover .inf-dot-circle {
  transform: translate(-50%, -50%) scale(1.25);
  background: var(--color-green);
  border-color: var(--color-green);
  box-shadow: 0 0 24px var(--glow-green-80), 0 0 48px var(--glow-green-40);
}

.inf-dot.active .inf-dot-circle {
  background: var(--color-green);
  border-color: var(--color-green);
  box-shadow: 0 0 24px var(--glow-green-80), 0 0 48px var(--glow-green-40);
}

.inf-dot:hover .inf-dot-label,
.inf-dot.active .inf-dot-label {
  color: var(--color-green);
}

/* ========== THREE PILLARS ========== */
.pillars-section {
  padding: 80px 80px;
  background: var(--color-bg-dark);
  position: relative;
}

.pillars-heading {
  font-size: 38px;
  line-height: 1.2;
  text-align: center;
  margin-bottom: 60px;
}

.pillars-heading strong {
  background: linear-gradient(135deg, var(--color-green), var(--color-teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.pillar-card {
  background: var(--overlay-white-03);
  border: 1px solid var(--overlay-white-08);
  border-radius: 16px;
  padding: 32px 24px;
  transition: all 0.3s ease;
}

.pillar-card:hover {
  background: var(--overlay-white-06);
  border-color: var(--glow-green-20);
  transform: translateY(-4px);
}

.pillar-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-gray);
  margin-bottom: 8px;
}

.pillar-title {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-green), var(--color-teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.pillar-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-gray-light);
  margin-bottom: 24px;
}

.pillar-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-green);
  transition: gap 0.3s;
}

.pillar-cta:hover {
  gap: 12px;
}

.pillar-cta .arrow {
  transition: transform 0.3s;
}

.pillar-cta:hover .arrow {
  transform: translateX(4px);
}

/* ========== SOLUTIONS TAB SWITCHER ========== */
.solutions-section {
  position: relative;
  min-height: 720px;
  overflow: hidden;
  background: var(--color-bg-dark);
}

.solutions-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  overflow: hidden;
}

/* Live canvas rendering of the same lemniscate ribbon, zoomed by tab */
.solutions-bg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Readability overlay — vertical fade + horizontal side fade */
.solutions-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      var(--color-bg-dark) 0%,
      var(--scrim-dark-72) 8%,
      var(--scrim-dark-55) 45%,
      var(--scrim-dark-55) 55%,
      var(--scrim-dark-72) 92%,
      var(--color-bg-dark) 100%),
    linear-gradient(90deg,
      var(--scrim-dark-45) 0%,
      var(--scrim-dark-0) 30%,
      var(--scrim-dark-0) 70%,
      var(--scrim-dark-45) 100%);
  z-index: 1;
  pointer-events: none;
}

.solutions-tabs-bar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 40px 0;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.solution-tab {
  flex: 1 1 auto;
  padding: 16px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-gray-light);
  text-align: center;
  border-radius: 28px;
  transition: all 0.4s ease;
  cursor: pointer;
  white-space: nowrap;
  border: 2px solid transparent;
  min-width: fit-content;
}

.solution-tab:hover {
  color: var(--color-white);
  background: var(--overlay-white-05);
}

.solution-tab.active {
  color: var(--color-bg-dark);
  background: var(--color-white);
  box-shadow: 0 4px 20px var(--overlay-black-30);
}

.solutions-panels {
  position: relative;
  z-index: 5;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 80px 80px;
}

.solution-panel {
  display: none;
  animation: panelFadeIn 0.6s ease;
}

.solution-panel.active {
  display: block;
}

@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-content {
  display: flex;
  gap: 60px;
  align-items: flex-start;
}

.panel-text {
  flex: 1;
  max-width: 480px;
}

.panel-heading {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
}

.panel-desc {
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-gray-light);
  margin-bottom: 28px;
}

.panel-cta {
  margin-bottom: 32px;
}

.panel-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-links li a {
  display: inline-flex;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-white);
  transition: all 0.3s;
}

.panel-links li a:hover {
  color: var(--color-green);
  transform: translateX(4px);
}

.panel-visual {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 400px;
}

.panel-card {
  background: var(--overlay-white-97);
  border-radius: 20px;
  overflow: hidden;
  width: 380px;
  box-shadow: 0 20px 60px var(--overlay-black-30);
  color: var(--color-bg-night);
  animation: cardSlideIn 0.8s ease 0.2s both;
}

@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.panel-card-header {
  padding: 16px 24px;
  font-size: 15px;
  font-weight: 600;
  background: var(--overlay-black-03);
  border-bottom: 1px solid var(--overlay-black-06);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sparkle-icon { font-size: 16px; }

.panel-card-body { padding: 20px 24px; }

.card-issue {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px;
  background: var(--glow-blue-06);
  border-radius: 12px;
}

.card-issue-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glow-blue-10);
  border-radius: 8px;
}

.card-issue strong { font-size: 14px; display: block; margin-bottom: 4px; }
.card-issue p { font-size: 13px; color: var(--color-gray-darker); line-height: 1.4; }
.card-actions strong { font-size: 13px; color: var(--color-gray-darkest); display: block; margin-bottom: 12px; }

.action-item {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
  border-left: 4px solid;
}

.action-green { background: var(--glow-green-08); border-left-color: var(--color-green); }
.action-yellow { background: var(--ribbon-amber-dim); border-left-color: var(--color-amber); }
.action-item strong { font-size: 13px; color: var(--color-ink); display: block; margin-bottom: 2px; }
.action-item p { font-size: 12px; color: var(--color-gray-dark); }

.panel-person {
  position: absolute;
  right: -20px;
  bottom: 40px;
  z-index: 6;
}

.panel-person-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--color-green);
  box-shadow: 0 8px 32px var(--overlay-black-30);
  font-size: 36px;
  animation: personPopIn 0.6s ease 0.5s both;
}

@keyframes personPopIn {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

/* ========== EDIT MODE (toggle with ?edit in URL or Ctrl+Shift+E) ========== */
.edit-mode-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(90deg, var(--color-green-dark), var(--color-green-darker));
  color: white;
  padding: 10px 18px;
  z-index: 9999;
  font-family: 'Gilroy', -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 12px var(--overlay-black-35);
}
.edit-mode-bar .edit-title { flex: 1; }
.edit-mode-bar button {
  background: var(--overlay-white-18);
  border: 1px solid var(--overlay-white-40);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}
.edit-mode-bar button:hover { background: var(--overlay-white-32); }
body.edit-mode-active { padding-top: 44px; }
[data-editable] {
  outline: 1px dashed transparent;
  transition: outline-color 0.2s, background 0.2s;
  position: relative;
}
body.edit-mode-active [data-editable] {
  outline: 1px dashed var(--glow-green-60);
}
body.edit-mode-active [data-editable]:hover {
  outline: 1px solid var(--glow-green-100);
  background: var(--glow-green-08);
}
body.edit-mode-active [data-editable][contenteditable="true"] {
  outline: 2px solid var(--color-green);
  background: var(--glow-green-12);
}
.edit-remove-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-red);
  color: white;
  border: 2px solid white;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: none;
  z-index: 10;
  box-shadow: 0 2px 6px var(--overlay-black-40);
}
body.edit-mode-active [data-editable]:hover .edit-remove-btn {
  display: block;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .infinity-section { padding: 60px 40px; }
  .infinity-heading { font-size: 32px; }
  .compare-grid { grid-template-columns: 1fr; gap: 60px; }
  .compare-section { padding: 60px 32px 80px; }
  .compare-heading { font-size: 28px; }
  .inf-center-label span { font-size: 18px; }
  .inf-dot-label { font-size: 12px; }
  .pillars-grid { grid-template-columns: repeat(2, 1fr); }
  .solutions-tabs-bar { padding: 24px 24px 0; overflow-x: auto; }
  .solution-tab { font-size: 13px; padding: 14px 12px; }
  .solutions-panels { padding: 32px 24px 60px; }
  .panel-content { flex-direction: column; }
  .panel-visual { min-height: 300px; }
}

/* ========== SHAPE VISUAL CONTAINERS (for product sub-pages) ========== */
.shape-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-width: 900px;
  margin: 0 auto;
}

.shape-visual .shape-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.shape-visual .inf-dots-host {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.shape-visual .inf-dots-host .inf-dot {
  pointer-events: auto;
}

@media (max-width: 768px) {
  .infinity-section { padding: 40px 20px; }
  .infinity-heading { font-size: 26px; margin-bottom: 24px; }
  .compare-section { padding: 50px 20px 70px; }
  .compare-heading { font-size: 22px; margin-bottom: 32px; }
  .infinity-container { padding: 0 0 40px; }
  .inf-center-label span { font-size: 14px; padding: 6px 16px; }
  .inf-dot-circle { width: 14px; height: 14px; }
  .inf-dot-label { font-size: 11px; }
  .inf-person-left  { top: 18%; left: 4%;  width: 32%; height: 66%; }
  .inf-person-right { top: 18%; right: 4%; width: 32%; height: 66%; }
  .pillars-grid { grid-template-columns: 1fr; }
  .pillars-section { padding: 40px 24px; }
  .solutions-tabs-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding: 16px 16px 0;
    -webkit-overflow-scrolling: touch;
  }
  .solution-tab { min-width: 120px; font-size: 12px; }
  .panel-heading { font-size: 26px; }
  .panel-card { width: 100%; }
}
