/* ============================================================
   Projects Section — Desktop 1440 px (no responsive logic yet)
   ============================================================ */

/* ── Section wrapper ──────────────────────────────────────── */

.projects {
  width: 100%;
  background-color: var(--color-bg);
  padding: 6rem 0;
  position: relative;
  z-index: 1;
}

.projects__top,
.projects__grid,
.testimonials {
  max-width: var(--max-width-section);
  margin: 0 auto;
  padding: 0 clamp(2rem, 5vw, 7.5rem);
}

/* ── Top area: 2-column flex ──────────────────────────────── */

.projects__top {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: clamp(2rem, 21.43vw - 228.6px, 5rem);
  margin-bottom: 4rem;
}

/* ── Left column: title group ─────────────────────────────── */

.projects__title-group {
  flex: 0 0 auto;
  width: 560px;
  height: 238px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3rem;
  margin-top: 11rem;
}

.projects__title-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.projects__label {
  font-family: var(--font-base);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--color-text-dark);
  margin: 0;
}

.projects__heading-wrapper {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.projects__heading {
  font-family: var(--font-base);
  font-size: var(--font-size-section-heading);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  color: var(--color-text-dark);
  margin: 0;
}

@keyframes projects-underline-sweep {
  0% {
    clip-path: inset(0 100% 0 0);
  }
  10% {
    clip-path: inset(0 0% 0 0);
  }
  70% {
    clip-path: inset(0 0% 0 0);
  }
  80% {
    clip-path: inset(0 100% 0 0);
  }
  100% {
    clip-path: inset(0 100% 0 0);
  }
}

.projects__heading-decoration {
  display: block;
  width: 16.25rem;
  height: 1.25rem;
  pointer-events: none;
  animation: projects-underline-sweep 5s ease-out infinite;
  animation-delay: 3000ms;
}

.projects__description {
  font-family: var(--font-base);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-text);
  margin: 0;
}

/* ── Right column: featured project ──────────────────────── */

.projects__featured {
  flex: 1 1 auto;
  min-width: 0;
}

.projects__featured-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 3rem;
  cursor: pointer;
}

.projects__featured-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.projects__featured-visual {
  position: relative;
  width: 560px;
  height: 398px;
  border-radius: 1.3rem;
  cursor: pointer;
  display: block;
}

.projects__featured-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1.3rem;
  background: linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
  opacity: 0;
  transition: opacity 0.4s ease-out;
  pointer-events: none;
  z-index: 5;
}

.projects__featured-visual:hover::after {
  opacity: 1;
}

.projects__featured-laptop {
  position: absolute;
  top: 0;
  left: 0;
  right: 5px;
  bottom: 0;
  animation: projects-laptop-float 4.5s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  transition: transform 0.51s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes projects-laptop-float {
  0% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-30px);
  }
  70% {
    transform: translateY(11px);
  }
  100% {
    transform: translateY(0);
  }
}

.projects__featured-image {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 1.3rem;
  user-select: none;
  object-fit: contain;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.projects__featured-visual[data-enter-edge="left"]:hover .projects__featured-image {
  transform: translateX(-0.6rem) scale(1.05);
}

.projects__featured-sticker {
  position: absolute;
  top: 11rem;
  width: 168px;
  height: 168px;
  object-fit: contain;
  pointer-events: none;
  z-index: 6;
}

/* Pill badge that surfaces on hover, in place of the "Project details"
   label that used to be baked into the (now-removed) second hover image. */
.projects__featured-cta {
  position: absolute;
  right: 2.5rem;
  bottom: 2.5rem;
  z-index: 10;
  height: 44px;
  box-shadow:
    inset 0 0 0 1px var(--color-off-white),
    2px 3.5px 0 0 var(--color-off-white);
  font-size: 1.125rem;
  color: var(--color-text-light);
  opacity: 0;
  transition:
    opacity 0.51s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 90ms ease-in,
    background-color 80ms ease-in,
    box-shadow 90ms ease-in;
  pointer-events: none;
}

.projects__featured-visual:hover .projects__featured-cta {
  opacity: 1;
  pointer-events: auto;
}

.projects__featured-cta:hover {
  background-color: var(--color-cta-hover);
  box-shadow: inset 0 0 0 2px var(--color-off-white);
  transform: translate(0.25rem, 0.25rem);
}

.projects__featured-name {
  font-family: var(--font-base);
  font-size: var(--font-size-xl);
  font-weight: 700;
  line-height: 1;
  color: var(--color-text);
  margin: 0;
}

.projects__featured-description {
  font-family: var(--font-base);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-text);
  margin: 0;
  max-width: 56ch;
  text-align: justify;
}

/* ── Project cards grid ───────────────────────────────────── */

.projects__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  margin-bottom: 9rem;
}

.project-card {
  display: flex;
  flex-direction: column;
}

.project-card__image-wrapper {
  position: relative;
  width: 100%;
  height: 398px;
  overflow: hidden;
  border-radius: 1.3rem;
}

.project-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.project-card__image-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1.3rem;
  background: linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, 0.65) 100%);
  opacity: 0;
  transition: opacity 0.4s ease-out;
  pointer-events: none;
  z-index: 3;
}

.project-card__cta {
  position: absolute;
  right: 3rem;
  bottom: 2.5rem;
  z-index: 10;
  height: 44px;
  box-shadow:
    inset 0 0 0 1px var(--color-off-white),
    3px 3.5px 0 0 var(--color-off-white);
  font-size: 1.125rem;
  color: var(--color-text-light);
  opacity: 0;
  transition:
    opacity 0.4s ease-out,
    transform 90ms ease-in,
    background-color 80ms ease-in,
    box-shadow 90ms ease-in;
  pointer-events: none;
}

.project-card__image-wrapper:hover .project-card__image {
  transform: translateX(-10px) scale(1.1);
}

.project-card__image-wrapper:hover::after {
  opacity: 1;
}

.project-card__image-wrapper:hover .project-card__cta {
  opacity: 1;
  pointer-events: auto;
}

.project-card__cta:hover {
  background-color: var(--color-cta-hover);
  box-shadow: inset 0 0 0 1px var(--color-off-white);
  transform: translate(0.25rem, 0.25rem);
}

.project-card__title {
  font-family: var(--font-base);
  font-size: var(--font-size-xl);
  font-weight: 700;
  line-height: 1;
  color: var(--color-text);
  margin: 2rem 0 0;
}

.project-card__description {
  font-family: var(--font-base);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-text);
  margin: 1rem 0 0;
  text-align: justify;
}

/* ── Mobile CTA (hidden on desktop) ──────────────────────── */

.project-card__cta-mobile {
  display: none;
}

/* ── Responsive: columns shrink (1216px → 900px) ─────────── */

@media (max-width: 1216px) {
  .projects__title-group {
    flex: 1 1 0;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 238px;
  }

  .projects__featured {
    flex: 1 1 0;
  }

  .projects__featured-visual {
    width: 100%;
    height: auto;
    aspect-ratio: 560 / 398;
  }

  .projects__featured-sticker {
    top: 44.2%;
    width: 30%;
    height: auto;
  }
}

/* ── Responsive (≤ 900px) ─────────────────────────────────── */

@media (max-width: 900px) {
  .projects {
    padding: 4rem 0;
  }

  .projects__top,
  .projects__grid,
  .testimonials {
    padding: 0 clamp(1rem, 16vw - 64px, 5rem);
  }

  .projects__top {
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2.5rem;
  }

  .projects__title-group {
    width: 100%;
    height: auto;
    margin-top: 0;
    gap: 1.5rem;
  }

  .projects__featured-visual {
    width: 100%;
    max-width: 560px;
    overflow: hidden;
  }

  .projects__featured-card {
    max-width: 560px;
    margin-right: auto;
    margin-left: auto;
  }

  .projects__featured-cta {
    display: none;
  }

  .project-card__cta-mobile {
    display: inline-flex;
    align-self: flex-end;
    width: 172px;
    height: 40px;
    gap: 0.625rem;
    margin-top: 1.5rem;
    font-size: var(--font-size-18px);
    color: var(--color-text-dark);
    background-color: rgba(0, 0, 0, 0.01);
    border: 1px solid var(--color-text-dark);
    box-shadow: 2px 4px 0 0 var(--color-text-dark);
    transition:
      transform 90ms ease-in,
      box-shadow 90ms ease-in;
  }

  .project-card__cta-mobile:hover {
    box-shadow: none;
    transform: translate(2px, 4px);
  }

  .projects__grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-bottom: 5rem;
  }

  .project-card {
    max-width: 560px;
    margin: 0 auto;
  }

  .project-card__image-wrapper {
    max-width: 560px;
    height: auto;
    aspect-ratio: 560 / 398;
  }

  .project-card__cta {
    display: none;
  }

  /* Testimonial card mobile styles moved to project-testimonial-cards.css */
}

/* ── Responsive (≤ 500px) ─────────────────────────────────── */

@media (max-width: 500px) {
  .projects {
    padding-top: 0;
  }

  .projects__top {
    gap: clamp(4rem, 153px - 2.78vw, 8rem);
  }

  .projects__heading {
    font-size: 3rem;
  }

  .projects__heading-wrapper {
    display: block;
    width: fit-content;
  }

  .projects__heading-decoration {
    width: 100%;
  }

  .projects__label {
    font-size: 1.125rem;
  }

  .projects__featured-name {
    font-size: var(--font-size-lg);
  }

  .project-card__title {
    font-size: var(--font-size-lg);
  }
}

/* Re-enable text selection for meaningful copy (heading/label/description/
   titles), overriding the global user-select: none from base.css. The
   "Project details" CTAs and card links stay non-selectable. */
.projects__heading,
.projects__label,
.projects__description,
.projects__featured-name,
.projects__featured-description,
.project-card__title,
.project-card__description {
  user-select: text;
  -webkit-user-select: text;
}
