.footer {
  margin-top: 0;
  background: var(--bg-soft);
  padding: 40px 0 0;
  color: #e7e7e9;
}
.footer-logo {
  height: 28px;
  margin-bottom: 8px;
}
.linklist {
  list-style: none;
  margin: 0;
  padding: 0;
}
.linklist li {
  margin: 8px 0;
}

.footer .brand {
  align-items: flex-start;
}
.footer .brand-logo {
  height: auto;
  width: auto;
}
.footer .brand-text {
  font-size: calc(var(--header-font-size) * 2);
  line-height: 1.1;
  margin: 1rem;
}

.footer .socials img {
  width: 40px;
  height: 40px;
}

.footer .socials {
  gap: 1.5rem;
}

.footer-bottom {
  border-top: 0;
  margin-top: 24px;
  padding-top: 1rem;
  padding-bottom: 14px;
}

/* 3-column grid: left / center / right */
.footer-bottom.container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 28px;
  align-items: center;
}

.footer-bottom .footer-legal {
  justify-self: start;
}

.footer-bottom .footer-dev {
  justify-self: center;
  text-align: center;
  white-space: nowrap; /* prevents wrap; remove if you prefer wrapping */
}

.footer-bottom .footer-copy {
  justify-self: end;
  text-align: right;
}

/* Responsive: stack nicely on small screens */
@media (max-width: 640px) {
  .footer .container.grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "pages brand"
      "contact socials";
    column-gap: 20px;
    row-gap: 32px;
    align-items: flex-start;
  }

  .footer .container.grid.cols-4 > :nth-child(1) {
    grid-area: brand;
    padding-left: 12px;
  }

  .footer .container.grid.cols-4 > :nth-child(2) {
    grid-area: pages;
    padding-left: 0;
  }

  .footer .container.grid.cols-4 > :nth-child(3) {
    grid-area: contact;
  }

  .footer .container.grid.cols-4 > :nth-child(3) p {
    white-space: normal;
    word-break: break-word;
  }

  .footer .container.grid.cols-4 > :nth-child(4) {
    grid-area: socials;
    align-self: flex-start;
  }

  .footer-bottom.container {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .footer-bottom .footer-legal,
  .footer-bottom .footer-dev,
  .footer-bottom .footer-copy {
    justify-self: center;
    text-align: center;
  }
}
