.mobile-menu-button,
.mobile-drawer,
.mobile-overlay {
  display: none;
}

.nav-links {
  flex-wrap: wrap;
  justify-content: center;
}

.projects-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.projects-head h2 {
  max-width: 12ch;
}

.projects-head-copy {
  max-width: 34rem;
}

.projects-head-copy p {
  margin-bottom: 1.2rem;
  color: var(--muted);
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
}

.client-grid:has(.client-card:only-child) {
  grid-template-columns: minmax(0, 1fr);
}

.client-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(97, 217, 232, 0.28);
  border-radius: var(--radius-lg);
  background: #10263a;
  box-shadow: var(--shadow);
}

.client-card:only-child {
  width: min(100%, 54rem);
  justify-self: start;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(15rem, 0.55fr);
}

.client-card:only-child .client-card-copy {
  justify-content: center;
}

.client-browser {
  min-width: 0;
  padding: 1rem;
}

.client-card-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  padding: 1.3rem;
  border-top: 1px solid rgba(210, 230, 244, 0.08);
}

.client-card-copy .card-label {
  margin-bottom: 0.6rem;
  color: var(--lime);
}

.client-card-copy h3 {
  margin-bottom: 0.45rem;
  font-size: 1.35rem;
}

.client-card-copy p {
  color: var(--muted);
  font-size: 0.94rem;
}

.client-card-copy .text-link {
  margin-top: auto;
  padding-top: 1.2rem;
}

.client-preview {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #f7f4ee;
}

.client-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.catalog-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--cyan);
  font-weight: 800;
}

.selected-template {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(183, 243, 107, 0.35);
  border-radius: 0.85rem;
  background: rgba(183, 243, 107, 0.08);
  color: var(--lime);
}

.selected-template.is-visible {
  display: flex;
}

.selected-template button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.load-note {
  grid-column: 1 / -1;
  padding: 2rem;
  border: 1px dashed rgba(97, 217, 232, 0.3);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .client-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-card:only-child {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 20;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px);
  }

  .nav-cta {
    display: none;
  }

  .mobile-menu-button {
    display: inline-grid;
    width: 2.8rem;
    height: 2.8rem;
    place-items: center;
    border: 1px solid rgba(97, 217, 232, 0.35);
    border-radius: 0.8rem;
    background: rgba(97, 217, 232, 0.08);
    color: #05121f;
    cursor: pointer;
  }

  .mobile-menu-icon,
  .mobile-menu-icon::before,
  .mobile-menu-icon::after {
    display: block;
    width: 1.2rem;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    content: "";
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .mobile-menu-icon {
    position: relative;
  }

  .mobile-menu-icon::before {
    position: absolute;
    top: -0.38rem;
  }

  .mobile-menu-icon::after {
    position: absolute;
    top: 0.38rem;
  }

  .mobile-menu-button[aria-expanded="true"] .mobile-menu-icon {
    background: transparent;
  }

  .mobile-menu-button[aria-expanded="true"] .mobile-menu-icon::before {
    top: 0;
    transform: rotate(45deg);
  }

  .mobile-menu-button[aria-expanded="true"] .mobile-menu-icon::after {
    top: 0;
    transform: rotate(-45deg);
  }

  .mobile-overlay {
    position: fixed;
    z-index: 29;
    inset: 0;
    display: block;
    visibility: hidden;
    border: 0;
    background: rgba(2, 10, 18, 0.7);
    opacity: 0;
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  .mobile-drawer {
    position: fixed;
    z-index: 30;
    top: 0;
    right: 0;
    display: flex;
    width: min(86vw, 22rem);
    height: 100dvh;
    flex-direction: column;
    padding: 1.25rem;
    border-left: 1px solid rgba(97, 217, 232, 0.25);
    background: #081b2d;
    box-shadow: -2rem 0 5rem rgba(0, 0, 0, 0.35);
    transform: translateX(102%);
    transition: transform 220ms ease;
  }

  .mobile-drawer.is-open {
    transform: translateX(0);
  }

  .mobile-overlay.is-open {
    visibility: visible;
    opacity: 1;
  }

  .mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 2rem;
  }

  .mobile-menu-close {
    display: grid;
    width: 2.6rem;
    height: 2.6rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 1.4rem;
  }

  .mobile-drawer nav {
    display: grid;
    gap: 0.45rem;
  }

  .mobile-drawer nav a {
    padding: 0.9rem 0.75rem;
    border-radius: 0.7rem;
    color: var(--muted);
    font-size: 1.08rem;
    font-weight: 700;
  }

  .mobile-drawer nav a:hover,
  .mobile-drawer nav a:focus-visible {
    background: rgba(97, 217, 232, 0.08);
    color: var(--cyan);
  }

  body.menu-open {
    overflow: hidden;
  }

  .projects-head {
    display: block;
  }

  .projects-head-copy {
    margin-top: 1rem;
  }

  .client-grid {
    display: flex;
    width: calc(100% + 0.75rem);
    margin-right: -0.75rem;
    padding-right: 0.75rem;
    gap: 0.9rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .client-grid::-webkit-scrollbar {
    display: none;
  }

  .client-card,
  .client-card:only-child {
    display: flex;
    width: auto;
    min-width: min(72vw, 18rem);
    scroll-snap-align: start;
  }

  .client-browser {
    padding: 0.8rem;
  }

  .client-preview {
    aspect-ratio: 540 / 1038;
  }

  .selected-template {
    align-items: flex-start;
    flex-direction: column;
  }
}
