/* ================
   Original Styles
   ================ */

.hero h1,
.hero p {
  letter-spacing: 0.1rem;
}
.art-3d,
body {
  overflow-x: hidden;
}
html {
  scroll-behavior: smooth;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  background-color: #000;
  color: #fff;
  min-height: 100vh;
  line-height: 1.5;
}
main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: 15rem;
  min-height: calc(90vh - 6rem);
}
.hero {
  max-width: 45%;
  z-index: 999;
  margin-left: 5%;
}
.hero h1 {
  font-size: 3rem;
  font-weight: 600;
}
.hero p {
  color: gray;
}
.case-study-card-3d {
  margin-top: 3rem;
  width: 820px;
  border-radius: 0;
  overflow: hidden;
  background-color: #100f0f;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.6s, box-shadow 0.6s;
}
.case-study-card-3d:hover {
  transform: rotateX(8deg) rotateY(8deg) scale(1.03);
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.6);
}
.case-study-image {
  height: 200px;
  background-size: cover;
  background-position: center;
  transform: translateZ(30px);
}
.case-study-content {
  padding: 1.2rem;
  transform: translateZ(20px);
}
.case-study-content h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
}
.case-study-content p {
  font-size: 0.95rem;
  color: #ccc;
  line-height: 1.4;
  margin-bottom: 1rem;
}
.read-more {
  font-size: 0.9rem;
  color: #40c9ff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.read-more:hover {
  color: #0af;
}
.art-3d {
  position: absolute;
  top: 0;
  right: -22%;
}
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
}
.modal.open {
  display: flex !important;
}
.modal-content {
  background: #111;
  color: #fff;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 8px;
  position: relative;
  padding: 2rem;
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: 0 0;
  border: none;
  font-size: 1.5rem;
  color: #fff;
  cursor: pointer;
}
.modal-body h2 {
  margin-top: 0;
}
.modal-body p {
  line-height: 1.6;
  margin-bottom: 1rem;
}
.modal-gallery {
  margin-bottom: 1.5rem;
}
.modal-gallery .gallery-main img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.modal-gallery .gallery-thumbs {
  display: flex;
  gap: 0.5rem;
}
.modal-gallery .gallery-thumbs img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.6;
  border: 2px solid transparent;
  border-radius: 4px;
  transition: opacity 0.2s, border-color 0.2s;
}
.modal-gallery .gallery-thumbs img.active,
.modal-gallery .gallery-thumbs img:hover {
  opacity: 1;
  border-color: #7f42a7;
}

/* ===========================
   Mobile-First Responsive
   =========================== */
@media (max-width: 768px) {
  /* Hero: full-width & centered */
  .hero {
    max-width: 90% !important;
    margin: 2rem auto !important;
    padding: 0 1rem;
  }
  .hero h1 {
    font-size: 2rem !important;
    line-height: 1.2 !important;
    margin-bottom: 1rem !important;
    text-align: center;
  }
  .hero p {
    font-size: 0.9rem !important;
    text-align: center;
  }

  /* Hide heavy 3D art on mobile */
  .art-3d {
    display: none;
  }

  /* Main spacing & height */
  main {
    margin-top: 9rem !important;
    padding: 0 1rem;
    min-height: auto;
  }

  /* Case study cards: full width, static */
  .case-study-card-3d {
    width: 100% !important;
    margin: 1.5rem 0 !important;
    transform: none !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5) !important;
  }
  .case-study-content p {
    text-align: left;
  }
  /* Modal image height cap */
  .modal-gallery .gallery-main img {
    height: auto !important;
    max-height: 200px;
  }

  /* Larger tap area for read-more */
  .read-more {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 1rem !important;
  }

  /* Slightly smaller base font */
  body {
    font-size: 0.95rem;
  }

  /* Ensure forms & containers don’t overflow */
  .form-field,
  .contact-form,
  .get-in-touch {
    width: 100%;
    padding: 0 1rem;
  }
}
