/**
 * XEYROX Homepage - Section 03: THE REAL CHALLENGE
 * "Growth creates complexity."
 */

/* ==========================================================================
   1. Section Wrapper & Atmospheric Background
   ========================================================================== */
.growth-complexity-section {
  position: relative;
  background-color: var(--x-white);
  padding-top: var(--space-8);
  padding-bottom: var(--space-9);
  min-height: 780px;
  overflow: hidden;
}

/* Atmospheric Flow-Line Background Layer */
.growth-complexity-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.growth-complexity-bg-graphic {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1920px;
  height: 100%;
  background-image: url("/storage/images/sections/growth-complexity/growth-complexity-background.webp");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  opacity: 0.85;
}

/* Seamless bottom transition into Connected Clarity */
.growth-complexity-bottom-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 1) 100%
  );
  pointer-events: none;
}

/* ==========================================================================
   2. Main Layout (40% Text / 60% Visual)
   ========================================================================== */
.growth-complexity-container {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin-inline: auto;
  padding-inline: var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 760px;
}

/* ==========================================================================
   3. Left Column: Text Content (~38% width)
   ========================================================================== */
.growth-complexity-text-col {
  flex: 0 0 45%;
  max-width: 530px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  z-index: 3;
}

/* Eyebrow */
.growth-complexity-eyebrow {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #4b8ef7;
  margin-bottom: var(--space-3);
  display: inline-block;
}

/* Main Headline */
.growth-complexity-headline {
  font-family: var(--font-primary);
  font-weight: 800;
  font-size: clamp(40px, 4.5vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--x-navy-900);
  margin-bottom: var(--space-4);
}

.growth-complexity-highlight {
  color: var(--x-blue-700);
  display: inline-block;
}

/* Primary Supporting Paragraph */
.growth-complexity-body {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.55;
  color: var(--x-text-secondary);
  max-width: 500px;
  margin-bottom: var(--space-5);
}

/* Strong Secondary Statement */
.growth-complexity-statement {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.45;
  color: var(--x-navy-900);
  max-width: 480px;
}

/* ==========================================================================
   4. Right Column: Complexity Visual & Floating Cards (~63% width)
   ========================================================================== */
.growth-complexity-visual-col {
  flex: 1 1 63%;
  position: relative;
  height: 740px;
  min-height: 740px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Subtle Core Glow Behind Visual */
.complexity-core-glow {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(39, 200, 245, 0.12) 0%,
    rgba(21, 94, 239, 0.04) 50%,
    rgba(255, 255, 255, 0) 75%
  );
  pointer-events: none;
  z-index: 1;
}

/* Central Generated Complexity Graphic */
.complexity-core-wrapper {
  position: absolute;
  top: 48%;
  left: 55%;
  transform: translate(-50%, -50%);
  width: 560px;
  max-width: 88%;
  z-index: 2;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.complexity-core-img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 15px 35px rgba(11, 23, 51, 0.07));
  user-select: none;
  -webkit-user-drag: none;
}

/* Central Dark Navy Core Disc with XEYROX 4-Direction Connection Mark */
.complexity-center-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14.8%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #081b3a;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.12),
    0 0 15px rgba(8, 27, 58, 0.9),
    0 0 12px rgba(39, 200, 245, 0.35);
  border: 1px solid rgba(39, 200, 245, 0.3);
  z-index: 3;
}

.center-core-svg {
  width: 72%;
  height: 72%;
  display: block;
}

/* Connector Lines SVG Layer */
.complexity-connector-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.complexity-connector-lines-mobile {
  display: none;
}

.connector-path {
  transition:
    stroke 0.3s ease,
    stroke-width 0.3s ease,
    opacity 0.3s ease;
}

/* ==========================================================================
   5. Floating Information Cards (HTML Components)
   ========================================================================== */
.complexity-cards-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
}

.complexity-card {
  position: absolute;
  width: 190px;
  background: #ffffff;
  border: 1px solid rgba(130, 160, 200, 0.2);
  border-radius: 18px;
  box-shadow:
    0 12px 35px rgba(30, 70, 120, 0.08),
    0 2px 6px rgba(30, 70, 120, 0.04);
  padding: 15px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition:
    box-shadow 0.25s ease,
    border-color 0.25s ease;
  will-change: transform, box-shadow;
}

.complexity-card:hover,
.complexity-card.is-active {
  z-index: 10 !important;
  border-color: rgba(21, 94, 239, 0.45);
  box-shadow:
    0 22px 50px rgba(21, 94, 239, 0.18),
    0 8px 20px rgba(30, 70, 120, 0.08);
}

/* Card Icon Box */
.card-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(21, 94, 239, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--x-blue-700);
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.complexity-card:hover .card-icon-wrap {
  background: rgba(21, 94, 239, 0.12);
  transform: scale(1.05);
}

.card-icon {
  width: 20px;
  height: 20px;
}

/* Card Typography */
.card-text {
  display: flex;
  flex-direction: column;
}

.card-title {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.25;
  color: var(--x-navy-900);
  margin-bottom: 3px;
}

.card-desc {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.35;
  color: var(--x-text-secondary);
  white-space: normal;
}

/* Precise Desktop Orbit Positions around Core Graphic */
.card-people {
  top: 4%;
  left: 40%;
}

.card-processes {
  top: 10%;
  left: 70%;
}

.card-information {
  top: 26%;
  left: 12%;
}

.card-customers {
  top: 31%;
  left: 74%;
}

.card-tasks {
  top: 53%;
  left: 14%;
}

.card-operations {
  top: 51%;
  left: 74%;
}

.card-reports {
  top: 73%;
  left: 35%;
}

.card-decisions {
  top: 72%;
  left: 58%;
}

/* ==========================================================================
   6. Subtle Floating Motion Animations
   ========================================================================== */
/* Enhanced Fallback Keyframes with organic 2D drift */
@keyframes cardFloat1 {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(4px, -11px, 0) rotate(1deg);
  }
  100% {
    transform: translate3d(-3px, -5px, 0) rotate(-0.5deg);
  }
}

@keyframes cardFloat2 {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(-5px, 12px, 0) rotate(-1.2deg);
  }
  100% {
    transform: translate3d(4px, 6px, 0) rotate(0.8deg);
  }
}

@keyframes cardFloat3 {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(-6px, -10px, 0) rotate(1.1deg);
  }
  100% {
    transform: translate3d(3px, -3px, 0) rotate(-0.6deg);
  }
}

@keyframes cardFloat4 {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(6px, 12px, 0) rotate(-1.1deg);
  }
  100% {
    transform: translate3d(-4px, 5px, 0) rotate(0.7deg);
  }
}

.complexity-card[data-float="1"] {
  animation: cardFloat1 5.5s ease-in-out infinite alternate;
}

.complexity-card[data-float="2"] {
  animation: cardFloat2 6.8s ease-in-out infinite alternate;
}

.complexity-card[data-float="3"] {
  animation: cardFloat3 7.6s ease-in-out infinite alternate;
}

.complexity-card[data-float="4"] {
  animation: cardFloat4 6.2s ease-in-out infinite alternate;
}

/* When interactive JavaScript motion engine is active, JS governs RAF transform */
.growth-complexity-section.has-motion-engine .complexity-card {
  animation: none !important;
}

/* ==========================================================================
   7. Far-Right Handwritten Observation Note
   ========================================================================== */
.growth-complexity-annotation {
  position: absolute;
  right: -20px;
  bottom: 8px;
  z-index: 4;
  pointer-events: none;
  transform: rotate(-5deg);
}

.annotation-text {
  display: flex;
  flex-direction: column;
  font-family: var(--font-handwritten);
  color: #536581;
  font-size: 23px;
  line-height: 1.25;
}

.note-part {
  display: block;
}

.note-word {
  display: block;
}

.note-underline-wrap {
  position: relative;
  display: inline-block;
  width: fit-content;
}

.note-underline-svg {
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 100%;
  height: 14px;
}

/* ==========================================================================
   8. Responsive Breakpoints
   ========================================================================== */

/* Medium Desktops & Large Tablets (1024px to 1240px) */
@media (max-width: 1240px) {
  .growth-complexity-container {
    gap: var(--space-4);
  }

  .growth-complexity-text-col {
    flex: 0 0 40%;
  }

  .growth-complexity-visual-col {
    flex: 1 1 60%;
    height: 680px;
    min-height: 680px;
  }

  .complexity-core-wrapper {
    width: 480px;
  }

  .complexity-card {
    width: 185px;
    padding: 14px 15px;
  }

  .card-title {
    font-size: 14px;
  }

  .card-desc {
    font-size: 12px;
  }

  .card-people {
    left: 32%;
    top: 3%;
  }
  .card-processes {
    left: 68%;
    top: 9%;
  }
  .card-information {
    left: 9%;
    top: 25%;
  }
  .card-customers {
    left: 74%;
    top: 29%;
  }
  .card-tasks {
    left: 10%;
    top: 54%;
  }
  .card-operations {
    left: 74%;
    top: 53%;
  }
  .card-reports {
    left: 32%;
    top: 76%;
  }
  .card-decisions {
    left: 66%;
    top: 74%;
  }

  .growth-complexity-annotation {
    right: 0;
    bottom: 4px;
  }

  .annotation-text {
    font-size: 20px;
  }
}

/* Tablet (768px to 1023px) */
@media (max-width: 1023px) {
  .growth-complexity-section {
    padding-top: var(--space-6);
    padding-bottom: var(--space-7);
  }

  .growth-complexity-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-6);
  }

  .growth-complexity-text-col {
    flex: 0 0 100%;
    max-width: 680px;
    align-items: center;
  }

  .growth-complexity-body,
  .growth-complexity-statement {
    max-width: 600px;
  }

  .growth-complexity-visual-col {
    width: 100%;
    max-width: 760px;
    height: 660px;
    min-height: 660px;
  }

  .complexity-core-wrapper {
    width: 440px;
  }

  .complexity-card {
    width: 175px;
    padding: 12px 14px;
  }

  .card-people {
    left: 30%;
    top: 2%;
  }
  .card-processes {
    left: 67%;
    top: 8%;
  }
  .card-information {
    left: 6%;
    top: 26%;
  }
  .card-customers {
    left: 72%;
    top: 30%;
  }
  .card-tasks {
    left: 7%;
    top: 55%;
  }
  .card-operations {
    left: 72%;
    top: 54%;
  }
  .card-reports {
    left: 30%;
    top: 76%;
  }
  .card-decisions {
    left: 56%;
    top: 74%;
  }

  .growth-complexity-annotation {
    position: absolute;
    right: 0;
    bottom: 4px;
    margin: 0;
    text-align: left;
    transform: rotate(-5deg);
  }
}

/* Mobile Devices (< 768px) */
@media (max-width: 767px) {
  .growth-complexity-section {
    padding-top: var(--space-5);
    padding-bottom: var(--space-8);
  }

  .growth-complexity-container {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: var(--space-4);
    padding-inline: 16px;
  }

  .growth-complexity-text-col {
    align-items: flex-start;
    max-width: 100%;
  }

  .growth-complexity-eyebrow {
    font-size: 13px;
    letter-spacing: 0.12em;
    margin-bottom: 12px;
  }

  .growth-complexity-headline {
    font-size: clamp(34px, 8.5vw, 42px);
    line-height: 0.98;
    letter-spacing: -0.025em;
    margin-bottom: 18px;
  }

  .growth-complexity-body {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 22px;
    max-width: 100%;
  }

  .growth-complexity-statement {
    font-size: 16.5px;
    line-height: 1.45;
    max-width: 100%;
  }

  /* Visual Column on Mobile: Orbiting Cards Around Central Core */
  .growth-complexity-visual-col {
    width: 100%;
    height: 560px;
    min-height: 560px;
    position: relative;
    margin-top: 24px;
    display: block;
  }

  /* Core Graphic Centerpiece */
  .complexity-core-wrapper {
    position: absolute;
    top: 245px;
    left: 55%;
    transform: translate(-50%, -50%);
    width: 260px;
    max-width: 72%;
    margin: 0;
    z-index: 2;
  }

  .complexity-core-glow {
    position: absolute;
    top: 245px;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 240px;
    height: 240px;
  }

  /* Switch to Mobile SVG Connectors */
  .complexity-connector-lines {
    display: none;
  }

  .complexity-connector-lines-mobile {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
  }

  /* Cards Container */
  .complexity-cards-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 3;
    margin-bottom: 0;
  }

  /* Base Mobile Card Styling */
  .complexity-card {
    position: absolute !important;
    background: #ffffff;
    border: 1px solid rgba(130, 160, 200, 0.2);
    box-shadow:
      0 6px 20px rgba(30, 70, 120, 0.08),
      0 2px 5px rgba(30, 70, 120, 0.04);
    cursor: default;
    animation: none !important;
    display: flex;
    align-items: center;
  }

  /* Top 5 Cards (People, Information, Processes, Tasks, Customers) */
  .card-people,
  .card-information,
  .card-processes,
  .card-tasks,
  .card-customers {
    padding: 8px 10px;
    border-radius: 14px;
    gap: 8px;
  }

  .card-people .card-icon-wrap,
  .card-information .card-icon-wrap,
  .card-processes .card-icon-wrap,
  .card-tasks .card-icon-wrap,
  .card-customers .card-icon-wrap {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  .card-people .card-icon,
  .card-information .card-icon,
  .card-processes .card-icon,
  .card-tasks .card-icon,
  .card-customers .card-icon {
    width: 15px;
    height: 15px;
  }

  .card-people .card-title,
  .card-information .card-title,
  .card-processes .card-title,
  .card-tasks .card-title,
  .card-customers .card-title {
    font-size: 11.5px;
    margin-bottom: 1px;
    line-height: 1.2;
  }

  .card-people .card-desc,
  .card-information .card-desc,
  .card-processes .card-desc,
  .card-tasks .card-desc,
  .card-customers .card-desc {
    font-size: 9px;
    line-height: 1.25;
  }

  /* Specific Mobile Positions for Upper Cards */
  .card-people {
    top: 10px;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translateX(-50%);
    width: 155px;
  }

  .card-information {
    top: 85px;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    width: 135px;
  }

  .card-processes {
    top: 85px;
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;
    width: 135px;
  }

  .card-tasks {
    top: 235px;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    width: 135px;
  }

  .card-customers {
    top: 235px;
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;
    width: 135px;
  }

  /* Bottom Row Cards (Reports, Decisions, Operations) */
  .card-reports,
  .card-decisions,
  .card-operations {
    top: 380px !important;
    bottom: auto !important;
    width: calc((100% - 14px) / 3) !important;
    padding: 7px 5px;
    border-radius: 12px;
    gap: 5px;
  }

  .card-reports .card-icon-wrap,
  .card-decisions .card-icon-wrap,
  .card-operations .card-icon-wrap {
    width: 22px;
    height: 22px;
    border-radius: 6px;
  }

  .card-reports .card-icon,
  .card-decisions .card-icon,
  .card-operations .card-icon {
    width: 12px;
    height: 12px;
  }

  .card-reports .card-title,
  .card-decisions .card-title,
  .card-operations .card-title {
    font-size: 10.5px;
    margin-bottom: 1px;
    line-height: 1.15;
  }

  .card-reports .card-desc,
  .card-decisions .card-desc,
  .card-operations .card-desc {
    font-size: 8px;
    line-height: 1.2;
  }

  .card-reports {
    left: 0 !important;
    right: auto !important;
  }

  .card-decisions {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
  }

  .card-operations {
    right: 0 !important;
    left: auto !important;
  }

  /* Handwritten Annotation on Mobile (Centered under visual) */
  .growth-complexity-annotation {
    position: absolute;
    top: 468px;
    left: 50%;
    transform: translateX(-50%) rotate(-4deg);
    right: auto;
    bottom: auto;
    margin: 0;
    text-align: center;
    display: flex;
    justify-content: center;
    width: max-content;
  }

  .annotation-text {
    align-items: center;
    font-size: 21px;
    line-height: 1.25;
  }

  .note-part {
    display: block;
    margin-bottom: 2px;
  }

  .note-word {
    display: inline;
  }
}

/* ==========================================================================
   9. Accessibility: Reduced Motion Support
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .complexity-card {
    animation: none !important;
    transition: none !important;
  }

  .complexity-card:hover {
    transform: none !important;
  }

  .card-icon-wrap {
    transition: none !important;
  }

  .connector-path {
    transition: none !important;
  }
}
