:root {
  --paper: #ffffff;
  --ink: #060606;
  --muted: #777777;
  --gap-x: 28px;
  --gap-y: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Arial, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

.masthead {
  width: min(100% - 32px, 1120px);
  margin: 0 auto;
  padding: 26px 0 54px;
  text-align: center;
}

.masthead h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  font-style: italic;
  font-weight: 400;
  line-height: 1;
}

.category-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(26px, 7vw, 76px);
  margin-top: 34px;
  font-size: 14px;
  letter-spacing: 0;
  white-space: nowrap;
}

.category-nav a {
  position: relative;
  display: inline-block;
  padding: 3px 0;
}

.category-nav a::after {
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background: currentColor;
  content: "";
  opacity: 0;
  transform: scaleX(0.5);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.category-nav a:hover::after,
.category-nav a:focus-visible::after,
.category-nav a.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

main {
  width: min(100% - 28px, 1180px);
  margin: 0 auto;
  padding-bottom: 92px;
}

.gallery {
  display: grid;
  grid-auto-flow: dense;
  grid-auto-rows: 18px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--gap-y) var(--gap-x);
}

.tile {
  min-height: 64px;
  background: var(--ink);
}

.tile.is-hidden {
  display: none;
}

.tile-small {
  grid-column: span 1;
  grid-row: span 8;
}

.tile-square {
  grid-column: span 2;
  grid-row: span 12;
}

.tile-portrait {
  grid-column: span 2;
  grid-row: span 18;
}

.tile-tall {
  grid-column: span 2;
  grid-row: span 24;
}

.tile-landscape {
  grid-column: span 3;
  grid-row: span 12;
}

.tile-wide {
  grid-column: span 3;
  grid-row: span 15;
}

.info-panel {
  width: min(860px, 100%);
  margin: 10px auto 0;
  padding-top: 54px;
}

.info-panel[hidden] {
  display: none;
}

.info-panel h2 {
  margin: 0 0 38px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  text-align: center;
}

.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.75fr);
  gap: 64px;
}

.info-grid p {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.9;
}

dl {
  margin: 0;
}

dl div {
  border-top: 1px solid #dddddd;
  padding: 16px 0;
}

dl div:last-child {
  border-bottom: 1px solid #dddddd;
}

dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

dd {
  margin: 0;
}

@media (max-width: 820px) {
  :root {
    --gap-x: 14px;
    --gap-y: 14px;
  }

  .masthead {
    padding: 24px 0 38px;
  }

  .masthead h1 {
    font-size: 35px;
  }

  .category-nav {
    flex-wrap: wrap;
    gap: 12px 28px;
    margin-top: 28px;
  }

  main {
    width: min(100% - 24px, 680px);
  }

  .gallery {
    grid-auto-rows: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tile-small {
    grid-column: span 2;
    grid-row: span 10;
  }

  .tile-square,
  .tile-portrait,
  .tile-tall {
    grid-column: span 2;
  }

  .tile-landscape,
  .tile-wide {
    grid-column: span 4;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }
}

@media (max-width: 520px) {
  .masthead {
    width: min(100% - 24px, 390px);
    padding-bottom: 32px;
  }

  .masthead h1 {
    font-size: 31px;
  }

  .category-nav {
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
  }

  .gallery {
    display: block;
  }

  .tile {
    display: block;
    width: 100%;
    margin-bottom: 14px;
  }

  .tile.is-hidden {
    display: none;
  }

  .tile-small {
    aspect-ratio: 4 / 3;
  }

  .tile-square {
    aspect-ratio: 1 / 1;
  }

  .tile-portrait {
    aspect-ratio: 4 / 5;
  }

  .tile-tall {
    aspect-ratio: 3 / 5;
  }

  .tile-landscape,
  .tile-wide {
    aspect-ratio: 16 / 10;
  }

  .info-panel {
    padding-top: 28px;
  }
}
