/* Home Styles */

.hero {
  background: linear-gradient(to bottom,
      var(--color-white) 0%,
      var(--color-white) 80%,
      var(--color-mediumgray) 100%);
  text-align: center;
  padding-top: 80px;
}

.hero h1 span.emoji {
  font-size: 3.8rem;
}

.hero .graphic {
  margin-top: 40px;
  width: 90%;
  max-width: 1038px;
}

.hero .cta {
  margin-top: 16px;
}

.hero .cta a {
  text-underline-offset: 4px;
}

.section-dark {
  background-color: var(--color-black);
  color: var(--color-white);
  text-align: center;
  padding: 40px 16px;
}

@media (max-width: 520px) {
  .hero h1 span.emoji {
    font-size: 2.4rem;
  }
}


.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 2rem;
  box-sizing: border-box;
  overflow: visible;
}

.portfolio-item {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  transition: transform 0.2s ease-in;
}

.portfolio-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.portfolio-card {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease-out, transform 0.5s ease;
  will-change: transform;
  display: block;
  container-type: inline-size;
}

@media (max-width: 768px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    padding: 0rem;
  }
}

.portfolio-card:hover .portfolio-item {
  transform: scale(1.05);
  z-index: 2;
}

.portfolio-card.visible {
  transform: translateY(0);
  opacity: 1;
}

.portfolio-item {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

/* Overlay panel */
.portfolio-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-black);
  opacity: .995;
  color: #fff;
  padding: 2rem;
  transform: translateY(100%);
  transition: transform 0.4s ease-in-out;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: left;
}

@container (max-width: 500px) {
  .portfolio-info {
    display: none;
  }
}

.portfolio-card:hover .portfolio-info {
  transform: translateY(0);
}

.portfolio-info h3 {
  line-height: 1rem;
  margin: 1.75rem 0 0 0;
}

.portfolio-info p {
  font-size: 1rem;
  line-height: 1.5rem;
  margin-top: 8px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tags span {
  background: var(--color-darkgray);
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.tags span:first-child {
  background: var(--color-coral);
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.learn-more {
  color: var(--color-white);
  text-decoration: underline;
  font-weight: 600;
  text-underline-offset: 5px;
  /* Adjust this value as needed */
  margin-top: 1rem;
}

.learn-more .arrow {
  font-size: 1.2rem;
}

.case-study {
  background-color: var(--color-white);
  text-align: center;
  padding: 60px 20px;
}

.case-study h2 {
  margin-bottom: 10px;
}

.case-study .btn {
  margin-top: 10px;
}

.carousel {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  margin: 30px 0;
  overflow: hidden;
  position: relative;
  margin: 30px 0;
}

.carousel-track {
  display: flex;
  gap: 20px;
  padding: 0 20px;
  scroll-snap-align: start;
  display: flex;
  gap: 20px;
  animation: scroll-left 80s linear infinite;
  will-change: transform;
  width: max-content;
}

.carousel-item {
  min-width: 400px;
  height: 240px;
  background-color: var(--color-gray);
  flex: 0 0 auto;
  border-radius: 8px;
  cursor: pointer;
}

.blur {
  filter: blur(5px);
}

.blur-notice {
  display: none;
  /* Hidden by default */
  position: absolute;
  top: 7.5rem;
  left: 0rem;
  z-index: 2000;
  background: rgba(246, 247, 197);
  color: var(--color-black);
  padding: 12px 40px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  max-width: 100%;
  line-height: 1.4;
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}

.blur-notice p {
  margin: 0;
  /* remove default p margin */
  display: block;
  /* ensure full-width text, not inline */
  line-height: 1.4;
}

.banner-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}


@keyframes scroll-left {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

.carousel:hover .carousel-track {
  animation-play-state: paused;
}

@media (max-width: 520px) {

  .carousel-item {
    min-width: 300px;
    height: 170px;
  }

  .blur-notice {
    padding: 12px 16px;
  }

  .blur-notice p {
    font-size: 0.9rem;
  }

}

/* Modal Styles */
/* Dark background */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  overflow: auto;
}

/* White container */
.modal-content {
  background: white;
  padding: 24px 40px;
  margin: 5% auto;
  border-radius: 10px;
  width: 80%;
  max-width: 920px;
  max-height: 672px;
  text-align: left;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.modal-body {
  display: flex;
  align-items: center;
  justify-content: left;
}

.modal-image-container {
  flex: 1;
}

#modalImage {
  width: 920px;
  height: 500px;
  object-fit: cover;
  display: block;
  margin: 24px auto 0px;
  border-radius: 8px;
}

#modalTitle {
  margin: 15px 0 5px;
  padding: 0px 0px;
  font-size: 32px;
  font-weight: 700;
  color: var(--color-black);
}

#modalDescription {
  font-size: 18px;
  color: var(--color-darkgray);
  margin-top: 8px;
}

/* Controls */
/* Close button */
.close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 30px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
}

.modal-prev,
.modal-next {
  background: var(--color-white);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 100%;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  color: var(--color-darkgray);
  transition: 0.3s;
  position: absolute;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 2000;
  top: 50%;
  transform: translateY(-50%);
}

.modal-prev {
  left: 12px;
}

.modal-next {
  right: 12px;
}

.modal-prev:hover,
.modal-next:hover {
  color: var(--color-black);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.modal-cta {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  /* prevents text from breaking into two lines */
}


@media (max-width: 1150px) {
  #modalImage {
    width: 100%;
    height: 100%;
  }

  .blur-notice {
    display: none;
    /* Hidden by default */
    position: static;
    margin-top: 1rem;
  }

  .modal-content {
    height: 100%;
  }

}

@media (max-width: 520px) {

  .modal-content {
    width: 70%;
    height: 60%;
    margin: 25% auto;
  }

  #modalTitle {
    font-size: 24px;
  }

}

/* Modal Inner Image */
.modal-inner img {
  width: 920px;
  /* fixed width */
  height: auto;
  /* maintain aspect ratio */
  max-width: 90vw;
  /* responsive fallback */
  max-height: 80vh;
  /* keep inside viewport */
  border-radius: 10px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform: scale(0.8);
  opacity: 0;
}

.modal.show .modal-inner img {
  transform: scale(1);
  opacity: 1;
}

body.modal-open {
  overflow: hidden;
  /* prevents background scroll */
}