.projects-hero {
  padding: clamp(3rem, 8vw, 6rem) clamp(2rem, 8vw, 6rem);
  background: radial-gradient(circle at top left, rgba(41, 120, 160, 0.25), transparent 60%),
    linear-gradient(135deg, rgba(15, 17, 20, 0.95), rgba(27, 30, 34, 0.85));
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
}

.projects-hero__body {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: flex-start;
  max-width: 880px;
}

.projects-hero__lede {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.82);
  max-width: 72ch;
}

.hero-console {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  background: rgba(27, 30, 34, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  font-family: "mono";
  max-width: min(100%, 40rem);
}

.hero-console__prompt {
  color: #fc2500;
  font-weight: 600;
}

.hero-console__text {
  display: inline-block;
  min-height: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
}

.hero-console__link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: color 200ms ease, border-color 200ms ease;
}

.hero-console__link:hover,
.hero-console__link:focus {
  color: #fc2500;
  border-bottom-color: rgba(252, 37, 0, 0.6);
}

.hero-console__link:focus-visible {
  outline: 2px solid #fc2500;
  outline-offset: 3px;
}

.hero-console__cursor {
  display: inline-block;
  width: 0.65ch;
  height: 1.3rem;
  background: rgba(252, 37, 0, 0.9);
  border-radius: 0.2rem;
  animation: heroCursorBlink 1s steps(2) infinite;
}

.hero-console__cursor--hidden {
  animation: none;
  opacity: 0;
}

@keyframes heroCursorBlink {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-console__cursor {
    animation: none;
    opacity: 0.5;
  }
}

.projects-gallery {
  padding: clamp(3.5rem, 8vw, 6rem) clamp(2rem, 7vw, 5rem) clamp(4rem, 9vw, 6.5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 6vw, 3.5rem);
  background-color: rgba(15, 17, 20, 0.88);
  border-top: 1px solid var(--border-color);
}

.projects-gallery__header {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.projects-gallery__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.projects-gallery__title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0;
}

.projects-gallery__description {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.75);
  max-width: 75ch;
}

.projects-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filter-chip,
.project-tag {
  background: rgba(27, 30, 34, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 0.45rem 1.2rem;
  font-family: "mono";
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.project-tag {
  font-size: 0.85rem;
  padding: 0.35rem 0.9rem;
  letter-spacing: 0.06em;
  margin: 0 0.35rem 0.35rem 0;
}

.filter-chip:hover,
.filter-chip:focus-visible,
.project-tag:hover,
.project-tag:focus-visible {
  border-color: #fc2500;
  color: #fc2500;
}

.filter-chip[aria-pressed="true"],
.project-tag[aria-pressed="true"] {
  background: linear-gradient(135deg, rgba(41, 120, 160, 0.65), rgba(252, 37, 0, 0.65));
  border-color: transparent;
  color: white;
}

.project-tag.is-hover {
  border-color: rgba(252, 37, 0, 0.45);
  color: rgba(252, 37, 0, 0.85);
}

.filter-chip.is-hover {
  border-color: rgba(252, 37, 0, 0.45);
  color: rgba(252, 37, 0, 0.85);
}

.projects-clear {
  align-self: flex-start;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.8);
  font-family: "mono";
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.45rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease;
}

.projects-clear:hover,
.projects-clear:focus-visible {
  border-color: #fc2500;
  color: #fc2500;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1.5rem, 5vw, 2.75rem);
  max-width: 1100px;
  margin: 0 auto;
}

.project-card {
  background: rgba(27, 30, 34, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.5rem;
  padding: clamp(1.75rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 18px 45px rgba(5, 6, 8, 0.45);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 55px rgba(5, 6, 8, 0.6);
}

.project-card__header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.project-card__title {
  font-size: 1.35rem;
  margin: 0;
}

.project-card__summary {
  color: rgba(255, 255, 255, 0.75);
  font-size: 1rem;
  line-height: 1.7;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.project-card__links a {
  color: #fc2500;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.project-card__links a:hover,
.project-card__links a:focus-visible {
  text-decoration: underline;
}

.projects-empty {
  margin: 0 auto;
  max-width: 60ch;
  text-align: center;
  color: rgba(255, 255, 255, 0.65);
  font-size: 1rem;
}

@media (max-width: 900px) {
  .projects-gallery__header {
    gap: 1.5rem;
  }

  .projects-gallery__description {
    max-width: 60ch;
  }
}

@media (max-width: 640px) {
  .projects-hero {
    padding: 2.75rem 1.75rem 2.25rem;
  }

  .projects-hero__body {
    gap: 1.5rem;
  }

  .hero-console {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .hero-console__text {
    white-space: normal;
  }

  .projects-gallery__header {
    gap: 1.75rem;
  }

  .filter-chip {
    flex: 1 1 calc(50% - 0.75rem);
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .filter-chip {
    flex: 1 1 100%;
  }
}
