.dark-section {
  padding: 40px 0;
  text-align: center;
}

/* Container for all boxes */
.container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin: 0 auto;
  max-width: 1200px;
}

/* Each individual box */
.box {
  background: linear-gradient(135deg, #0a0a1a 0%, #0d0d2b 100%);
  border-radius: 50px;
  position: relative;
  overflow: visible;
  width: 90%;
  max-width: 350px;
  margin: 20px auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 180, 255, 0.1);
  z-index: 1;
}
/* Glowing effect when in view (desktop) */
.box.glowing {
  box-shadow: 0 0 20px 10px rgba(0, 180, 255, 0.5);
}
/* Mobile active glow: only one box gets this at a time */
.box.active-glow {
  box-shadow: 0 0 20px 10px rgba(0, 180, 255, 0.7);
}
/* Brighter glow on hover (desktop) */
.box:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 40px 15px rgba(0, 180, 255, 0.8);
  background: linear-gradient(135deg, #03122f 0%, #0b2a5e 100%);
  border-radius: 50px;
  z-index: 2;
}

/* Slow swirl effect on idle, faster on hover */
.box::before,
.box::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  border-radius: 50%;
  z-index: -1;
}
.box::before {
  animation: spin 5s linear infinite, upGlow 5s ease-in-out infinite alternate;
  opacity: 0.2;
}
.box::after {
  animation: spinReverse 5s linear infinite, upGlow 5s ease-in-out infinite alternate;
  opacity: 0.2;
}
.box:hover::before {
  animation: spin 2s linear infinite, upGlow 2s ease-in-out infinite alternate;
  opacity: 0.4;
}
.box:hover::after {
  animation: spinReverse 2s linear infinite, upGlow 2s ease-in-out infinite alternate;
  opacity: 0.4;
}

/* Keyframes for swirling animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes spinReverse {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}
/* Slight vertical "up glow" shift */
@keyframes upGlow {
  0% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}

/* The outline that "rides" around each box once it appears */
.outline {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}
.outline svg {
  width: 100%;
  height: 100%;
}
.outline rect {
  fill: none;
  stroke: #00b4ff;
  stroke-width: 2;
  stroke-dasharray: 0;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.5s ease;
  rx: 50px;
  ry: 50px;
}

/* Image styling */
.box img {
  width: 100%;
  display: block;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 4;
  position: relative;
  border-top-left-radius: 50px;
  border-top-right-radius: 50px;
}

/* Content inside the box */
.box-content {
  position: relative;
  z-index: 4;
  padding: 15px;
  border-bottom-left-radius: 50px;
  border-bottom-right-radius: 50px;
}
.box-content h2 {
  margin: 0 0 10px;
  font-size: 1.4rem;
  color: #fff;
}
.box-content p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #ccc;
}

/* Read More button */
.read-more-btn {
  background: #ffffff10;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.3s ease;
  z-index: 5;
  position: relative;
}
.read-more-btn:hover {
  background: #ffffff30;
}

/* Extended text hidden by default, revealed on toggle */
.extended-text {
  display: none;
  margin-top: 10px;
  color: #ccc;
  font-size: 0.9rem;
  z-index: 5;
  position: relative;
}
.extended-text.show {
  display: block;
  animation: fadeIn 0.5s forwards;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}