@font-face {
  font-family: "Host Grotesk";
  src: url("/assets/host-grotesk-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
}

:root {
  color-scheme: light;
  color: #111;
  background: #fff;
  font: 14px/1.5 "Host Grotesk", system-ui, sans-serif;
  --gutter: 40px;
  --muted: #666;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; padding-block: 26px 50px; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
figure, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #111; outline-offset: 4px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.frame { padding-inline: var(--gutter); }

.header {
  position: sticky;
  z-index: 1;
  top: 0;
  background: rgb(255 255 255 / 90%);
  backdrop-filter: blur(12px);
}

.header-inner {
  position: relative;
  padding-block: 14px 16px;
  padding-inline-end: calc(var(--gutter) + 70px);
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .04em .24em;
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: clamp(48px, 4.7vw, 96px);
  line-height: 1.04;
  font-weight: 500;
  letter-spacing: -.035em;
}

.category {
  display: flex;
  align-items: flex-start;
  gap: .075em;
  white-space: nowrap;
  letter-spacing: inherit;
  border: 0;
  padding: 0;
  background: none;
  color: #929292;
  transition: color 160ms ease;
}

.category[aria-pressed="true"], .category:hover, .category:focus-visible {
  color: #080808;
}

.category sup {
  margin-top: .43em;
  font-size: .2em;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .02em;
  color: var(--muted);
}

.category[aria-pressed="true"] sup { color: inherit; }

.info-button, .about {
  border: 1px solid #dedede;
  background: #f7f7f7;
  background-image: radial-gradient(rgb(0 0 0 / 5%) .55px, transparent .7px);
  background-size: 3px 3px;
}

.info-button {
  position: absolute;
  top: 22px;
  right: var(--gutter);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  box-shadow: 0 2px 3px rgb(0 0 0 / 8%), 0 8px 15px rgb(0 0 0 / 6%);
}

.info-button:hover { background-color: #eee; }

.about {
  position: fixed;
  inset: 48px var(--gutter) auto auto;
  margin: 0;
  width: min(354px, calc(100vw - 2 * var(--gutter)));
  padding: 16px 40px 16px 16px;
  box-shadow: 0 3px 7px rgb(0 0 0 / 10%), 0 18px 30px rgb(0 0 0 / 12%);
}

.about h2 {
  margin: 0 0 5px;
  font: 400 36px/1.05 Georgia, serif;
  letter-spacing: -.048em;
}

.about p { margin-bottom: 8px; color: #4d4d4d; }
.about a { text-underline-offset: .2em; }
.close-button {
  position: absolute;
  inset: 5px 5px auto auto;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
}

.gallery { padding-top: 38px; }
.tally {
  text-align: right;
  color: var(--muted);
  margin-bottom: 51px;
}

.products {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
  --item-width: 20%;
}

.product {
  flex: 0 0 var(--item-width);
  min-width: 0;
  padding-inline: 6px;
}

.product a {
  display: block;
  padding: 0 4px;
  text-align: center;
  text-decoration: none;
}

.product-image {
  --image-size: calc(var(--display-width) * 1px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: clamp(136px, 13.5vw, 250px);
  margin-bottom: 13px;
}

.product-image img {
  width: min(100%, var(--image-size));
  height: min(100%, var(--image-size));
  object-fit: contain;
  object-position: center bottom;
  transition: transform 180ms ease;
}

.product a:hover img, .product a:focus-visible img { transform: translateY(-4px); }

.caption {
  min-height: 66px;
  font-size: clamp(12px, .94vw, 15px);
  line-height: 1.35;
}

.product-name, .detail { display: block; text-wrap: balance; }

.product-name::before {
  content: "";
  display: inline-block;
  width: .38em;
  height: .38em;
  vertical-align: .16em;
  margin-inline-end: .4em;
  background: currentColor;
}

.product a:hover .product-name, .product a:focus-visible .product-name {
  text-decoration: underline;
  text-underline-offset: .2em;
}

.detail { margin-block-start: 2px; color: var(--muted); }

@media (min-width: 1200px) {
  /* Leave half a column on either side of every second row. */
  .product:nth-child(9n + 6 of :not([hidden])) { margin-inline-start: 10%; }
  .product:nth-child(9n + 9 of :not([hidden])) { margin-inline-end: 10%; }
  .product:nth-last-child(-n + 3 of :not([hidden])):nth-child(9n + 6 of :not([hidden])) {
    margin-inline-start: 0;
  }
}

@media (min-width: 900px) and (max-width: 1199px) {
  .products { --item-width: 25%; }
  .product:nth-child(7n + 5 of :not([hidden])) { margin-inline-start: 12.5%; }
  .product:nth-child(7n + 7 of :not([hidden])) { margin-inline-end: 12.5%; }
  .product:nth-last-child(-n + 2 of :not([hidden])):nth-child(7n + 5 of :not([hidden])) {
    margin-inline-start: 0;
  }
}

@media (min-width: 621px) and (max-width: 899px) {
  :root { --gutter: 28px; }
  .products { --item-width: calc(100% / 3); }
}

@media (max-width: 620px) {
  :root { --gutter: 20px; }
  body { padding-block: 8px 50px; }
  .header-inner { padding: 8px 70px 10px 0; }
  .categories {
    overflow-x: auto;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 20px), transparent);
  }

  .category-list {
    flex-wrap: nowrap;
    width: max-content;
    padding: 3px 24px 7px 20px;
    font-size: clamp(36px, 13.4vw, 54px);
  }

  .category:focus-visible { outline-offset: 1px; }
  .info-button { top: 15px; }
  .about { inset-block-start: 23px; }
  .gallery { padding-top: 8px; }
  .tally { margin-bottom: 12px; font-size: 12px; }
  .products { --item-width: 50%; gap: 8px 0; }
  .product { min-height: 204px; }
  .product:nth-child(even of :not([hidden])) { padding-top: 36px; }
  .product-image {
    --image-size: calc(var(--display-width) * .88px);
    height: 116px;
    margin-bottom: 10px;
  }
  .caption { min-height: 53px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
