.home-projects {
  margin-top: clamp(20px, 2.6vw, 30px);
}

.home-projects__tabs {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  margin: 24px 0 24px;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  scrollbar-width: none;
}

.home-projects__tabs::-webkit-scrollbar {
  display: none;
}

.home-projects__tab {
  position: relative;
  border: 0;
  background: transparent;
  color: rgba(0, 0, 0, 0.58);
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 14px 18px 12px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.085em;
  text-transform: uppercase;
  flex: 0 0 auto;
  transition:
    color 180ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.home-projects__tab::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -1px;
  height: 2px;
  background: #111111;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.home-projects__tab:hover,
.home-projects__tab:focus-visible {
  color: #111111;
  opacity: 1;
  outline: none;
}

.home-projects__tab.is-active {
  color: #111111;
  opacity: 1;
}

.home-projects__tab.is-active::after {
  transform: scaleX(1);
}

.home-projects__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.home-project-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  transition:
    opacity 220ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 240ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.home-project-card:hover,
.home-project-card:focus-visible,
.project-card.home-project-card.card.card--editorial-trace:hover,
.project-card.home-project-card.card.card--editorial-trace:focus-visible {
  transform: translateY(-3px);
  border-color: #111111;
  box-shadow: none;
}

.home-project-card .project-thumb {
  padding-top: 0;
  margin-bottom: 14px;
  aspect-ratio: 1 / 1;
  border-radius: 0;
  border: 1px solid var(--hairline, rgba(10, 10, 10, 0.14));
  background: #f5f5f5;
}

.home-project-card .project-thumb::after {
  content: none;
}

.home-project-card .project-thumb-image {
  transform: scale(1);
  transition: transform 340ms cubic-bezier(0.16, 1, 0.3, 1);
}

.home-project-card:hover .project-thumb-image,
.home-project-card:focus-visible .project-thumb-image {
  transform: scale(1.02);
}

.home-project-card .project-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding-top: 12px;
  border-top: 1px solid #ececec;
}

.home-project-card .project-card__category {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 24px;
  width: fit-content;
  margin: 0 0 12px;
  padding: 5px 10px 4px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 0;
  background: transparent;
  color: #111111;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.home-project-card .project-title {
  margin: 0 0 10px;
  color: #111111;
  font-family: var(--title-font);
  font-size: clamp(19px, 1.35vw, 22px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-project-card .project-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.56;
  color: rgba(0, 0, 0, 0.66);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-project-card .project-card__footer {
  display: flex;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #ececec;
  gap: 12px;
  justify-content: flex-start;
  margin-top: 18px;
}

.home-project-card .project-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 0;
  pointer-events: none;
  color: #111111;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-project-card .project-btn::before,
.home-project-card .project-btn::after {
  content: none;
}

.home-project-card .project-btn__icon,
.home-project-card .project-btn .lucide {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  stroke-width: 1.85;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.home-project-card:hover .project-btn__icon,
.home-project-card:hover .project-btn .lucide,
.home-project-card:focus-visible .project-btn__icon,
.home-project-card:focus-visible .project-btn .lucide {
  transform: translate(2px, -2px);
}

.home-project-card.is-extra {
  opacity: 1;
}

.home-project-card.is-extra.is-entering,
.home-project-card.is-extra.is-collapsing {
  opacity: 0;
  transform: translateY(14px);
}

.home-project-card[hidden] {
  display: none !important;
}

.home-projects__actions {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.home-projects__actions[hidden] {
  display: none !important;
}

.home-projects__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  padding: 8px 25px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 30px;
  background: transparent;
  color: var(--primary-color);
  font-family: var(--title-font);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition:
    border-color 220ms cubic-bezier(0.16, 1, 0.3, 1),
    color 220ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.home-projects__toggle:hover,
.home-projects__toggle:focus-visible {
  color: #111111;
  border-color: #111111;
  transform: translateY(-1px);
  outline: none;
}

/* a keyboard user sees where they are */
.home-projects__toggle:focus-visible {
  outline: 2px solid #111111;
  outline-offset: 3px;
}

@media (min-width: 640px) {
  .home-projects__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (min-width: 1024px) {
  .home-projects__grid {
    /* 3 columns (larger cards) so the product-design portfolio reads as the
       primary work, a clear step above the 4-col vibe-code grid below it. */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }
}

@media (max-width: 767px) {
  .home-projects__tabs {
    margin: 20px 0 18px;
  }

  .home-projects__tab {
    min-height: 46px;
    padding: 12px 14px 10px;
  }

  .home-projects__tab::after {
    left: 14px;
    right: 14px;
  }

  .home-project-card {
    padding: 12px;
  }

  .home-project-card .project-content {
    padding-top: 10px;
  }

  .home-project-card .project-title {
    font-size: 16px;
  }

  .home-project-card .project-desc {
    font-size: 13px;
  }

  .home-project-card .project-card__footer {
    margin-top: 16px;
    padding-top: 10px;
  }

  .home-projects__actions {
    margin-top: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-project-card.is-extra,
  .home-projects__toggle,
  .home-project-card,
  .home-project-card .project-thumb-image,
  .home-project-card .project-btn,
  .home-project-card .project-btn__icon,
  .home-project-card .project-btn .lucide {
    transition: none !important;
    transform: none !important;
  }
}

/* Meta row: category chip left, publish month right, mirroring the vibe
   cards. The chip's own bottom margin moves to the row. */
.home-project-card .project-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

.home-project-card .project-card__meta .project-card__category {
  margin-bottom: 0;
}

.home-project-card .project-card__date {
  flex: 0 0 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.06em;
  color: rgba(10, 10, 10, 0.56);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 767px) {
  .home-project-card .project-card__date {
    font-size: 10px;
  }
}

/* The description keeps its two clamped lines: flex-grow stretched the clamp
   box and let a third line peek in under the ellipsis. The free space goes to
   the margin under it instead, so the footer still sits at the bottom. */
.home-project-card .project-desc {
  flex-grow: 0;
  margin-bottom: auto;
}
