:root {
  --ink: #11110f;
  --paper: #f6f5f1;
  --line: #cac8c0;
  --muted: #6f6d66;
  --red: #e33f2f;
  --max: 1560px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.dialog-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

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

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.site-header {
  align-items: center;
  background: rgba(246, 245, 241, 0.94);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  height: 82px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  flex-direction: column;
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  font-weight: 600;
  justify-self: start;
  line-height: 0.84;
  letter-spacing: 0;
}

.main-nav {
  display: flex;
  gap: 34px;
}

.nav-link,
.filter,
.page-number,
.next-page {
  background: transparent;
  cursor: pointer;
}

.nav-link {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 0;
  position: relative;
}

.nav-link::after {
  background: var(--ink);
  bottom: 1px;
  content: "";
  height: 1px;
  left: 0;
  position: absolute;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
  width: 100%;
}

.nav-link:hover,
.nav-link.active {
  color: var(--ink);
}

.nav-link.active::after,
.nav-link:hover::after {
  transform: scaleX(1);
}

.icon-button {
  align-items: center;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  min-height: 42px;
  min-width: 42px;
  padding: 0;
}

.search-toggle {
  justify-self: end;
}

main {
  margin: 0 auto;
  max-width: var(--max);
  padding: 0 32px;
}

.intro {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  min-height: 154px;
  padding: 32px 0 23px;
}

.intro p {
  font-size: clamp(24px, 3vw, 48px);
  font-weight: 400;
  line-height: 1;
  margin: 0;
}

.intro .issue {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.toolbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 55px;
}

.filters {
  display: flex;
  gap: 26px;
}

.filter {
  color: var(--muted);
  font-size: 12px;
  padding: 18px 0;
}

.filter:hover,
.filter.active {
  color: var(--ink);
}

.filter.active::before {
  content: "●";
  font-size: 7px;
  margin-right: 7px;
  vertical-align: 2px;
}

.result-count {
  color: var(--muted);
  font-size: 11px;
  margin: 0;
}

.work-grid {
  display: grid;
  gap: 66px 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 38px 0 100px;
}

.work-card {
  cursor: pointer;
  min-width: 0;
}

.work-card:nth-child(6n + 2),
.work-card:nth-child(6n + 5) {
  padding-top: 82px;
}

.work-image {
  aspect-ratio: 4 / 5;
  background: #deddd8;
  overflow: hidden;
  position: relative;
}

.work-image img {
  display: block;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
  width: 100%;
}

.work-overlay {
  align-items: center;
  background: rgba(12, 12, 10, 0.1);
  color: white;
  display: flex;
  inset: 0;
  justify-content: center;
  opacity: 0;
  position: absolute;
  transition: opacity 240ms ease;
}

.work-overlay span {
  border-bottom: 1px solid currentColor;
  font-size: 11px;
  padding-bottom: 5px;
}

.work-card:hover .work-image img {
  transform: scale(1.018);
}

.work-card:hover .work-overlay {
  opacity: 1;
}

.work-meta {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding-top: 13px;
}

.work-meta h2 {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  margin: 0 0 4px;
}

.work-meta p,
.work-number {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  margin: 0;
  text-transform: uppercase;
}

.work-number {
  padding-top: 3px;
}

.empty-state {
  padding: 120px 0;
  text-align: center;
}

.empty-state button {
  background: transparent;
  border-bottom: 1px solid;
  cursor: pointer;
  padding: 4px 0;
}

.pagination {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: center;
  min-height: 112px;
}

.page-numbers {
  display: flex;
  gap: 8px;
}

.pagination[hidden] {
  display: none;
}

.page-number {
  border: 1px solid transparent;
  font-size: 11px;
  height: 34px;
  width: 34px;
}

.page-number.active {
  border-color: var(--ink);
}

.next-page {
  align-items: center;
  display: flex;
  height: 34px;
  justify-content: center;
  margin-left: 6px;
  width: 34px;
}

footer {
  align-items: flex-end;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  font-size: 10px;
  grid-template-columns: 1fr 1fr 1fr;
  min-height: 220px;
  padding: 38px 32px;
}

footer p {
  margin: 0;
}

footer p:nth-child(2) {
  color: #99978f;
  justify-self: center;
}

footer div {
  display: flex;
  gap: 18px;
  justify-self: end;
}

.search-panel {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  left: 0;
  opacity: 0;
  padding: 38px 32px 44px;
  pointer-events: none;
  position: fixed;
  right: 0;
  top: 0;
  transform: translateY(-20px);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 40;
}

.search-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.search-inner {
  margin: auto;
  max-width: 900px;
}

.search-inner > label {
  color: var(--muted);
  display: block;
  font-size: 10px;
  margin-bottom: 20px;
}

.search-field {
  align-items: center;
  display: flex;
}

.search-field input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  font-size: clamp(24px, 4vw, 48px);
  outline: 0;
  padding: 4px 48px 10px 0;
  width: 100%;
}

.search-field input::placeholder {
  color: #aaa8a0;
}

.close-search {
  margin-left: -42px;
}

dialog {
  border: 0;
  margin: 0;
  max-height: none;
  max-width: none;
  padding: 0;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.detail-dialog {
  background: var(--paper);
  height: 100%;
  width: 100%;
}

.detail-page {
  min-height: 100%;
}

.detail-header {
  align-items: center;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  height: 82px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.detail-header > p {
  color: var(--muted);
  font-size: 10px;
  margin: 0;
}

.close-detail {
  justify-self: end;
}

.detail-content {
  margin: auto;
  max-width: 1380px;
  padding: 0 32px 90px;
}

.detail-title-block {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  padding: 72px 0 42px;
}

.detail-kicker {
  color: var(--muted);
  font-size: 10px;
  margin: 8px 0 0;
}

.detail-title-block h1 {
  font-size: clamp(42px, 6vw, 92px);
  font-weight: 400;
  line-height: 0.96;
  margin: 0;
}

.detail-title-block > p:last-child {
  align-self: end;
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
  max-width: 220px;
}

.detail-hero {
  background: #dddcd7;
  margin: 0;
  width: 100%;
}

.detail-hero img {
  display: block;
  height: auto;
  max-height: 88vh;
  object-fit: cover;
  object-position: center;
  width: 100%;
}

.detail-notes {
  display: grid;
  gap: 12%;
  grid-template-columns: 1fr 1fr;
  padding: 72px 16% 96px;
}

.detail-notes > p {
  font-size: 17px;
  line-height: 1.7;
  margin: 0;
}

.detail-notes dl {
  margin: 0;
}

.detail-notes dl div {
  border-bottom: 1px solid var(--line);
  display: grid;
  font-size: 11px;
  grid-template-columns: 90px 1fr;
  padding: 11px 0;
}

.detail-notes dt {
  color: var(--muted);
}

.detail-notes dd {
  margin: 0;
}

.detail-gallery {
  display: grid;
  gap: 20px;
  grid-template-columns: 1.2fr 0.8fr;
}

.detail-gallery figure {
  margin: 0;
}

.detail-gallery figure:nth-child(2) {
  padding-top: 18%;
}

.detail-gallery img {
  display: block;
  height: auto;
  width: 100%;
}

.detail-nav {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 110px;
}

.detail-nav button {
  background: transparent;
  cursor: pointer;
  min-height: 130px;
  padding: 24px;
  text-align: left;
}

.detail-nav button + button {
  border-left: 1px solid var(--line);
  text-align: right;
}

.detail-nav span {
  color: var(--muted);
  display: block;
  font-size: 10px;
  margin-bottom: 14px;
}

.detail-nav strong {
  font-size: 20px;
  font-weight: 400;
}

.submit-dialog {
  background: var(--ink);
  color: var(--paper);
  height: 100%;
  width: 100%;
}

.submit-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100%;
}

.submit-copy {
  border-right: 1px solid #41413e;
  display: flex;
  flex-direction: column;
  padding: 54px;
}

.submit-copy > p:first-child {
  color: #9f9d96;
  font-size: 10px;
  margin: 0;
}

.submit-copy h2 {
  font-size: clamp(48px, 6vw, 92px);
  font-weight: 400;
  line-height: 1.04;
  margin: auto 0;
}

.submit-note {
  color: #b8b6ae;
  font-size: 12px;
  line-height: 1.7;
  margin: 0;
  max-width: 390px;
}

.submit-layout form {
  align-content: center;
  display: grid;
  gap: 24px;
  padding: 80px clamp(34px, 7vw, 120px);
  position: relative;
}

.close-submit {
  color: var(--paper);
  position: absolute;
  right: 30px;
  top: 28px;
}

.submit-layout label {
  color: #aaa89f;
  display: grid;
  font-size: 10px;
  gap: 8px;
}

.submit-layout input,
.submit-layout select,
.submit-layout textarea {
  background: transparent;
  border: 0;
  border-bottom: 1px solid #55544f;
  border-radius: 0;
  color: var(--paper);
  font-size: 15px;
  outline: 0;
  padding: 8px 0 12px;
  resize: vertical;
}

.submit-layout input:focus,
.submit-layout select:focus,
.submit-layout textarea:focus {
  border-color: var(--paper);
}

.submit-layout select option {
  background: var(--ink);
}

.submit-button {
  align-items: center;
  background: var(--paper);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  min-height: 54px;
  padding: 0 18px;
}

.form-status {
  color: #b6b4ad;
  font-size: 11px;
  min-height: 16px;
  margin: 0;
}

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

  .work-card:nth-child(6n + 2),
  .work-card:nth-child(6n + 5) {
    padding-top: 0;
  }

  .work-card:nth-child(4n + 2) {
    padding-top: 54px;
  }

  .detail-title-block {
    grid-template-columns: 1fr 2fr;
  }

  .detail-title-block > p:last-child {
    display: none;
  }

  .detail-notes {
    padding-left: 6%;
    padding-right: 6%;
  }

  .submit-layout {
    grid-template-columns: 0.8fr 1.2fr;
  }

  .submit-copy {
    padding: 34px;
  }
}

@media (max-width: 640px) {
  .site-header,
  .detail-header {
    height: 68px;
    padding: 0 18px;
  }

  .brand {
    font-size: 14px;
  }

  .main-nav {
    gap: 18px;
  }

  .main-nav .nav-link:nth-child(2) {
    display: none;
  }

  main {
    padding: 0 16px;
  }

  .intro {
    min-height: 118px;
    padding-bottom: 18px;
  }

  .intro p {
    font-size: 26px;
  }

  .intro .issue {
    font-size: 9px;
  }

  .toolbar {
    align-items: flex-start;
    overflow: hidden;
  }

  .filters {
    gap: 20px;
    overflow-x: auto;
    padding-right: 30px;
    scrollbar-width: none;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .filter {
    white-space: nowrap;
  }

  .result-count {
    display: none;
  }

  .work-grid {
    gap: 48px;
    grid-template-columns: 1fr;
    padding-top: 20px;
  }

  .work-card:nth-child(4n + 2) {
    padding-top: 0;
  }

  .work-meta h2 {
    font-size: 14px;
  }

  footer {
    align-items: start;
    gap: 28px;
    grid-template-columns: 1fr;
    min-height: 260px;
    padding: 34px 18px;
  }

  footer p:nth-child(2),
  footer div {
    justify-self: start;
  }

  .search-panel {
    padding: 28px 18px 34px;
  }

  .detail-content {
    padding: 0 16px 60px;
  }

  .detail-title-block {
    display: block;
    padding: 46px 0 24px;
  }

  .detail-kicker {
    margin-bottom: 14px;
  }

  .detail-title-block h1 {
    font-size: 46px;
  }

  .detail-notes {
    display: block;
    padding: 46px 0 64px;
  }

  .detail-notes > p {
    font-size: 15px;
    margin-bottom: 36px;
  }

  .detail-gallery {
    gap: 10px;
    grid-template-columns: 1fr;
  }

  .detail-gallery figure:nth-child(2) {
    padding-top: 0;
  }

  .detail-nav {
    margin-top: 70px;
  }

  .detail-nav button {
    min-height: 110px;
    padding: 16px 8px;
  }

  .detail-nav strong {
    font-size: 14px;
  }

  .submit-layout {
    display: block;
  }

  .submit-copy {
    border-bottom: 1px solid #41413e;
    border-right: 0;
    min-height: 410px;
    padding: 28px 20px 34px;
  }

  .submit-copy h2 {
    font-size: 50px;
  }

  .submit-layout form {
    padding: 76px 20px 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
