.case-study {
  max-width: 860px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.spacer {
  margin: 10% 0;
}

.case-hero {
  margin-bottom: 3rem;
}

.case-content ul {
  list-style: disc;
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.case-content li {
  margin-bottom: 0.6rem;
}

.keywords {
  border-top: 1px solid #ddd;
  margin-top: 2.5rem;
  padding-top: 1rem;
  color: var(--text-color-grey);
  font-size: 0.95rem;
}

@media (prefers-color-scheme: dark) {
  .case-study {
    color: #eaeaea;
  }
  .case-content h2 {
    color: #fff;
  }
  .keywords {
    border-top-color: #333;
    color: var(text-color-grey);
  }
}

/* --- Reveal Animation --- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: all 1s ease-out;
  will-change: opacity, transform;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Optional: a slight stagger effect */
.reveal:nth-of-type(2) {
  transition-delay: 0.1s;
}
.reveal:nth-of-type(3) {
  transition-delay: 0.2s;
}
.reveal:nth-of-type(4) {
  transition-delay: 0.3s;
}

/* --- Hero Intro Animation --- */
.case-hero {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 1.2s ease-out forwards;
  animation-delay: 0.3s;
}

.case-hero h1,
.case-hero .subtitle {
  animation: fadeInText 1.2s ease-out forwards;
}

.case-hero h1 {
  animation-delay: 0.4s;
}

.case-hero .subtitle {
  animation-delay: 0.7s;
}

/* Keyframes */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInText {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.case-hero {
  animation-play-state: paused;
}
body.loaded .case-hero {
  animation-play-state: running;
}

/* --- Parallax header effect --- */
.case-hero {
  position: relative;
  text-align: center;
  padding: 8rem 1.5rem 6rem;
  overflow: hidden;
  transition: transform 0.1s ease-out;
  background: var(--hero-bg, transparent);
  will-change: transform;
}

.case-hero h1 {
  margin-bottom: 0.75rem;
  transition: transform 0.2s ease-out;
}

.case-hero .subtitle {
  max-width: 600px;
  margin: 0 auto;
  transition: transform 0.3s ease-out;
}

@media (prefers-color-scheme: dark) {
  .case-hero .subtitle {
    color: #aaa;
  }
}

/* --- End of Reveal Animation --- */