/* Featured Work + More Work — homepage project grid */

#projects {
  scroll-margin-top: 5rem;
}

/* Keep Framer horizontal padding (64px / 48px / 32px) */
#projects.portfolio-sections-active {
  width: 100%;
  padding-bottom: 4rem;
  overflow-x: clip;
}

#projects.portfolio-sections-active .framer-j1veje,
#projects.portfolio-sections-active .framer-50x893 {
  width: 100% !important;
  flex: none !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  place-content: flex-start !important;
}

#projects.portfolio-sections-active [data-framer-name="Sticky Section Column"],
#projects.portfolio-sections-active .framer-fvouqb {
  position: static !important;
  top: auto !important;
  height: auto !important;
  width: 100% !important;
  flex: none !important;
  align-self: stretch !important;
}

#projects.portfolio-sections-active [data-framer-name="Inner Stack"],
#projects.portfolio-sections-active .framer-1lyxf97 {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  place-content: flex-start !important;
  width: 100% !important;
  flex: none !important;
}

.portfolio-sections {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4rem;
  width: 100%;
  max-width: 100%;
}

.portfolio-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
}

.portfolio-section-header {
  margin-bottom: 1.75rem;
  width: 100%;
  text-align: left;
}

.portfolio-section-title {
  margin: 0 0 0.35rem;
  font-family: "Satoshi", "Satoshi Placeholder", sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: rgb(17, 17, 17);
  line-height: 1.15;
}

.portfolio-section-subtitle {
  margin: 0;
  font-family: "Satoshi", "Satoshi Placeholder", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: rgb(100, 100, 100);
  line-height: 1.5;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  width: 100%;
  max-width: 100%;
  justify-items: stretch;
}

@media (min-width: 810px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem;
  }

  .portfolio-featured .portfolio-grid {
    gap: 2rem;
  }
}

.portfolio-card-slot {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  justify-self: stretch;
}

/* Scroll-triggered 3D flip on project preview containers */
.portfolio-card-scroll-slot {
  perspective: 1400px;
}

.portfolio-card-slot .portfolio-card-scroll-pending {
  opacity: 0 !important;
  transform: rotateX(72deg) scale(0.82) !important;
  transform-origin: center bottom;
  will-change: transform, opacity;
}

.portfolio-card-slot .portfolio-card-scroll-visible {
  opacity: 1 !important;
  transform: rotateX(0deg) scale(1) !important;
  transform-origin: center bottom;
  transition:
    opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--portfolio-scroll-delay, 0s);
}

.portfolio-card-slot .portfolio-scroll-owned[data-portfolio-scroll-locked="1"] {
  opacity: 1 !important;
  transform: rotateX(0deg) scale(1) !important;
  transition: none !important;
}

/* Text cascade: title → description → tags (after preview flip) */
.portfolio-card-slot .portfolio-cascade-pending {
  opacity: 0 !important;
  will-change: transform, opacity;
}

.portfolio-card-slot .portfolio-cascade-visible {
  opacity: 1 !important;
  transform: none !important;
  transition:
    opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--portfolio-cascade-delay, 0s);
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-card-slot .portfolio-card-scroll-pending {
    opacity: 1 !important;
    transform: none !important;
  }

  .portfolio-card-slot .portfolio-card-scroll-visible {
    transition: none;
  }

  .portfolio-card-slot .portfolio-cascade-pending {
    opacity: 1 !important;
    transform: none !important;
  }

  .portfolio-card-slot .portfolio-cascade-visible {
    transition: none;
  }
}

/* Hide ghost slots Framer sometimes leaves empty */
.portfolio-card-slot:not(:has(a[href])) {
  display: none !important;
}

/* Left-align cards inside grid cells (Framer defaults to center) */
.portfolio-card-slot .framer-ovc53e {
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  place-content: flex-start !important;
}

.portfolio-card-slot .framer-mh873d,
.portfolio-card-slot .framer-fgk8xb,
.portfolio-card-slot .framer-dvcf1z,
.portfolio-card-slot .framer-1mucho4,
.portfolio-card-slot .framer-ovc53e > a {
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
  justify-content: flex-start !important;
  align-items: stretch !important;
}

.portfolio-card-slot .framer-a8b9he-container,
.portfolio-card-slot .framer-t53t97-container,
.portfolio-card-slot .framer-1v83jgh-container,
.portfolio-card-slot .framer-1ath0tk-container {
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
}

.portfolio-card-slot .framer-DJlHa {
  width: 100% !important;
  max-width: 100% !important;
  align-items: stretch !important;
  align-self: stretch !important;
}

.portfolio-card-slot .framer-9gnnq8 {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

/* Description text */
.portfolio-card-slot .framer-1dksa0l,
.portfolio-card-slot .framer-rsk6bn,
.portfolio-card-slot .framer-12yglhn,
.portfolio-card-slot .framer-14z2bxh,
.portfolio-card-slot .framer-1n5soel,
.portfolio-card-slot .framer-1lcdrhw {
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
  min-width: 0;
  text-align: left;
}

.portfolio-card-slot .framer-text {
  white-space: pre-wrap !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

/* Card header row: project name + tag pills */
.portfolio-card-slot .framer-18eudtu,
.portfolio-card-slot .framer-1af63p {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
  gap: 12px;
  min-width: 0;
}

.portfolio-card-slot .framer-16766jq,
.portfolio-card-slot .framer-1dvwhfe {
  flex: none !important;
  width: auto !important;
  max-width: 50% !important;
  white-space: pre !important;
  overflow: visible !important;
}

.portfolio-card-slot .framer-1snjzis,
.portfolio-card-slot .framer-1ba37lt,
.portfolio-card-slot .framer-xksxka,
.portfolio-card-slot .framer-1krqdsv {
  display: flex !important;
  flex-flow: row wrap !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 8px !important;
  width: auto !important;
  max-width: none !important;
  flex: none !important;
  overflow: visible !important;
}

.portfolio-card-slot .framer-17gbmsu-container,
.portfolio-card-slot .framer-1usnfkg-container,
.portfolio-card-slot .framer-9qh2z1-container,
.portfolio-card-slot .framer-36vxlk-container,
.portfolio-card-slot .framer-9aqmbe-container,
.portfolio-card-slot .framer-1u9m50r-container {
  overflow: visible !important;
  width: auto !important;
  flex: none !important;
}

.portfolio-card-slot .framer-qff6D {
  width: max-content !important;
  max-width: none !important;
  overflow: visible !important;
  flex: none !important;
}

.portfolio-card-slot .framer-qff6D .framer-15vdter,
.portfolio-card-slot .framer-qff6D .framer-text {
  white-space: pre !important;
  overflow: visible !important;
}

.portfolio-card-slot .framer-17lmp2b {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 auto !important;
  min-height: 0;
}

.portfolio-card-slot .framer-17lmp2b img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Hide duplicate rows Framer re-inserts after hydration */
#projects.portfolio-sections-active .portfolio-source-hidden {
  display: none !important;
}

.portfolio-more .portfolio-section-header {
  margin-bottom: 1.5rem;
}

@media (max-width: 809px) {
  .portfolio-card-slot .framer-18eudtu,
  .portfolio-card-slot .framer-1af63p {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .portfolio-card-slot .framer-1snjzis,
  .portfolio-card-slot .framer-1ba37lt,
  .portfolio-card-slot .framer-xksxka {
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }
}
