.physics-section {
  position: relative;
  width: 100%;
  min-height: 800px;
  height: 90vh;
  background-color: #ffea00;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 100px 0 160px 0;
  box-sizing: border-box;
}

.physics-container {
  width: 100%;
  max-width: 1200px;
  padding: 0 20px;
  position: relative;
  z-index: 10;
  pointer-events: none; /* Let mouse clicks pass through to the canvas behind */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.physics-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1),
    transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
  transition-delay: 0.1s;
}

.physics-tag {
  background-color: #f35e46;
  color: #ffffff;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 6px 16px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(243, 94, 70, 0.2);
}

.physics-tag.highlight {
  background-color: #ff745e;
}

.physics-title {
  color: #ffffff;
  font-family: "Inter", sans-serif;
  font-size: 64px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -2px;
  margin: 0 0 24px 0;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(35px);
  transition:
    opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1),
    transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
  transition-delay: 0.25s;
}

.physics-subtitle {
  color: #a0a0a5;
  font-family: "Inter", sans-serif;
  font-size: 18px;
  line-height: 1.6;
  max-width: 620px;
  margin: 0;
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1),
    transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
  transition-delay: 0.4s;
}

.physics-word-highlight {
  background-color: #3da9fc;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  display: inline-block;
  opacity: 0;
  transform: scale(0.8);
  transition:
    opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: 0.9s;
}

/* Visibility states activated by scroll observer */
.physics-section.is-visible .physics-tags,
.physics-section.is-visible .physics-title,
.physics-section.is-visible .physics-subtitle {
  opacity: 1;
  transform: translateY(0);
}

.physics-section.is-visible .physics-word-highlight {
  opacity: 1;
  transform: scale(1);
}

.physics-canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: auto; /* Ensure canvas receives mouse events */
}

/* Responsive adjustments */
@media (max-width: 991px) {
  .physics-section {
    min-height: 700px;
    padding-top: 80px;
    padding-bottom: 140px; /* Safe zone for resting shapes */
  }

  .physics-title {
    font-size: 48px;
    letter-spacing: -1.5px;
  }

  .physics-subtitle {
    font-size: 16px;
  }
}

@media (max-width: 767px) {
  .physics-section {
    min-height: 520px;
    height: auto;
    padding-top: 50px;
    padding-bottom: 150px; /* Safe zone at the bottom for resting shapes to prevent text overlap */
  }

  .physics-title {
    font-size: 32px;
    letter-spacing: -1px;
  }

  .physics-subtitle {
    font-size: 14px;
  }

  /* Disable touch interference on mobile canvas to ensure perfect native scroll */
  .physics-canvas-container {
    pointer-events: none !important;
  }
}
