.mahina-project-section {
  --mahina-project-section-gap: 24px;
  --mahina-project-section-card-width: min(80vw, 1180px);
  --mahina-project-section-card-height: calc(100vh - (var(--mahina-section-padding) * 2));
  --mahina-project-section-side-padding: var(--mahina-global-padding);
  position: relative;
  min-height: var(--mahina-project-section-height, 200vh);
  background: var(--wp--preset--color--white, #fff);
}

.mahina-project-section__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
}

.mahina-project-section__viewport {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  overflow-x: hidden;
  overflow-y: visible;
}

.mahina-project-section__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8px;
  overflow: hidden;
  background: transparent;
}

.mahina-project-section__progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--mahina-color-light-green);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.12s linear;
}

.mahina-project-section__track {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--mahina-project-section-gap);
  padding-inline: var(--mahina-project-section-side-padding);
  will-change: transform;
}

.mahina-project-section__card {
  flex: 0 0 var(--mahina-project-section-card-width);
  width: var(--mahina-project-section-card-width);
  height: var(--mahina-project-section-card-height);
  display: flex;
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.mahina-project-section__card-link {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  height: 100%;
  min-height: 0;
  color: var(--mahina-color-dark-green);
  text-decoration: none;
  cursor: pointer;
  animation: mahina-project-card-float 11.5s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  will-change: transform;
}

.mahina-project-section__card:nth-child(2n) .mahina-project-section__card-link {
  animation-name: mahina-project-card-float-alt;
  animation-duration: 13s;
  animation-delay: -4.5s;
}

.mahina-project-section__card:nth-child(3n) .mahina-project-section__card-link {
  animation-duration: 12.2s;
  animation-delay: -7.2s;
}

.mahina-project-section__card:nth-child(4n) .mahina-project-section__card-link {
  animation-name: mahina-project-card-float-alt;
  animation-duration: 14.4s;
  animation-delay: -2.8s;
}

.mahina-project-section__card-media {
  flex: 1 1 auto;
  position: relative;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  background: transparent;
  isolation: isolate;
}

.mahina-project-section__card-media-canvas,
.mahina-project-section__card-plane {
  position: absolute;
  inset: 0;
}

.mahina-project-section__card-media-canvas {
  z-index: 1;
  pointer-events: none;
}

.mahina-project-section__card-media-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.mahina-project-section__card-plane {
  z-index: 2;
}

.mahina-project-section__card-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: none;
  transition: opacity 180ms ease-out;
}

.mahina-project-section__card-media.is-curtains-ready .mahina-project-section__card-plane {
  opacity: 0;
  pointer-events: none;
}

.mahina-project-section__card-media--empty {
  display: grid;
  place-items: center;
  background: rgba(4, 47, 17, 0.06);
}

.mahina-project-section__card-fallback {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mahina-project-section__card-meta {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.mahina-project-section__card-title {
  margin: 0;
  font-family: inherit;
  font-size: 18px;
  font-weight: 400;
  line-height: normal;
  text-transform: none;
}

.mahina-project-section__card-tag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  border-radius: 999px;
  background: var(--mahina-color-light-green);
  color: var(--mahina-color-dark-green);
  font-size: 16px;
  font-weight: 400;
  line-height: normal;
  white-space: nowrap;
}

.mahina-project-section__card-tag-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.mahina-project-section__card-tag-icon svg {
  display: block;
}

.mahina-project-section__card-tag-text {
  display: inline-flex;
  align-items: center;
}

.mahina-project-section.is-editor-preview {
  min-height: auto;
}

.mahina-project-section.is-editor-preview .mahina-project-section__sticky {
  position: relative;
  top: 0;
  height: auto;
  overflow: visible;
}

.mahina-project-section.is-editor-preview .mahina-project-section__viewport {
  overflow-x: auto;
  overflow-y: visible;
}

.mahina-project-section.is-editor-preview .mahina-project-section__card {
  opacity: 1;
  height: auto;
  transform: none;
}

.mahina-project-section.is-editor-preview .mahina-project-section__card-link,
.mahina-project-section.is-static .mahina-project-section__card-link {
  animation: none;
}

.mahina-project-section--curtains-active .mahina-project-section__card-link {
  animation: none;
}

.mahina-project-section.is-editor-preview .mahina-project-section__card-media,
.mahina-project-section.is-static .mahina-project-section__card-media {
  will-change: auto;
}

.mahina-project-section.is-editor-preview .mahina-project-section__progress,
.mahina-project-section.is-static .mahina-project-section__progress {
  display: none;
}

.mahina-project-section.is-static {
  min-height: auto;
}

.mahina-project-section.is-static .mahina-project-section__sticky {
  position: relative;
  top: 0;
  height: auto;
  overflow: visible;
}

.mahina-project-section.is-static .mahina-project-section__viewport {
  overflow: visible;
}

.mahina-project-section.is-static .mahina-project-section__track {
  display: block;
}

.mahina-project-section.is-static .mahina-project-section__card {
  width: min(100%, 1180px);
  height: auto;
  opacity: 1;
  transform: none;
}

.mahina-project-section-block .components-placeholder {
  min-height: 220px;
}

.mahina-project-section-block__order {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mahina-project-section-block__order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mahina-project-section-block__order-label {
  font-size: 13px;
  line-height: 1.4;
}

.mahina-project-section-block__order-actions {
  display: flex;
  gap: 8px;
}

@keyframes mahina-project-card-float {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  22% {
    transform: translate3d(3px, -5px, 0) rotate(0.35deg);
  }

  48% {
    transform: translate3d(-2px, -11px, 0) rotate(-0.3deg);
  }

  73% {
    transform: translate3d(2px, -7px, 0) rotate(0.2deg);
  }

  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
}

@keyframes mahina-project-card-float-alt {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  18% {
    transform: translate3d(-2px, -4px, 0) rotate(-0.2deg);
  }

  44% {
    transform: translate3d(2px, -9px, 0) rotate(0.3deg);
  }

  68% {
    transform: translate3d(-3px, -6px, 0) rotate(-0.35deg);
  }

  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
}

@media (max-width: 782px) {
  .mahina-project-section__progress {
    left: 0;
    right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mahina-project-section__card-plane {
    opacity: 1 !important;
    transition: none;
  }

  .mahina-project-section__card-media-canvas {
    display: none;
  }
}
