:root {
  color-scheme: light dark;
}

body {
  line-height: 1.5;
}

.portal {
  display: flex;
  min-height: 100vh;
  width: min(60rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 4rem 0;
  flex-direction: column;
}

.portal-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.portal-icon {
  width: 4.5rem;
  height: 4.5rem;
  flex: 0 0 auto;
  fill: var(--color-link);
}

.portal-header h1 {
  margin: 0 0 0.25rem;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  line-height: 1.15;
}

.product-content p {
  margin: 0;
  color: var(--gray-500);
}

.products {
  display: grid;
  gap: 1rem;
}

.product {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
}

.product-logo {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
}

.product-logo img,
.product-logo svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-logo svg {
  fill: var(--color-link);
}

.product-content h2 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.product-content p {
  line-height: 1.4;
}

.product-distributions {
  display: inline-block;
  margin-top: 0.5rem;
}

.product-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.product-link {
  flex: none;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-link);
  border-radius: var(--border-radius);
  color: var(--color-link);
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
}

.product-link:hover,
.product-link:focus-visible {
  opacity: 0.65;
}

.product-link.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.product-link.primary {
  background: var(--color-link);
  color: var(--body-background);
}

.empty-state {
  padding: 3rem 1.5rem;
  border: 1px dashed var(--gray-200);
  border-radius: var(--border-radius);
  color: var(--gray-500);
  text-align: center;
}

.portal-footer {
  margin-top: auto;
  padding-top: 4rem;
  text-align: center;
}

.portal-footer a {
  display: inline-block;
}

.portal-footer img {
  width: 13.125rem;
  max-width: 40vw;
  height: auto;
}

.error-message {
  display: flex;
  flex: 1;
  padding: 2rem 0 4rem;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.error-code {
  margin: 0;
  color: var(--body-font-color);
  font-size: clamp(6rem, 20vw, 12rem);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 0.9;
}

.error-message h1 {
  margin: 1.5rem 0 0;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 500;
}

.error-portal .portal-footer {
  margin-top: 0;
}

@media (max-width: 45rem) {
  .portal {
    padding: 2.5rem 0;
  }

  .portal-header {
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
  }

  .portal-icon {
    width: 3.25rem;
    height: 3.25rem;
  }

  .product {
    grid-template-columns: 3rem minmax(0, 1fr);
    padding: 1.25rem;
  }

  .product-logo {
    width: 2.75rem;
    height: 2.75rem;
  }

  .product-links {
    grid-column: 1 / -1;
  }
}

@media (max-width: 30rem) {
  .product-link {
    padding-inline: 0.375rem;
    font-size: 0.875rem;
    overflow-wrap: anywhere;
    white-space: normal;
  }
}
