:root {
  --ink: #11110f;
  --paper: #f6f5f1;
  --line: #cac8c0;
  --muted: #6f6d66;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

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

body.viewer-open {
  overflow: hidden;
}

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

button {
  border: 0;
  color: inherit;
  font: inherit;
}

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

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

.project-header {
  align-items: center;
  background: rgba(246, 245, 241, 0.95);
  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: 10;
}

.project-brand {
  display: flex;
  flex-direction: column;
  font-family: "Avenir Next", Avenir, "Helvetica Neue", sans-serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 0.84;
}

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

.back-button,
.icon-button {
  align-items: center;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  justify-self: end;
  width: 44px;
}

#projectPage {
  margin: 0 auto;
  max-width: 1500px;
  padding: 0 32px 90px;
}

.project-intro {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  padding: 72px 0 42px;
}

.project-intro > p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  margin: 8px 0 0;
}

.project-intro > p:last-child {
  justify-self: end;
}

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

.project-intro div > p {
  font-size: 13px;
  margin: 16px 0 0;
}

.project-cover,
.project-gallery button {
  background: #deddd8;
  cursor: zoom-in;
  display: block;
  padding: 0;
  width: 100%;
}

.project-cover img {
  display: block;
  max-height: 88vh;
  object-fit: contain;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
}

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

.project-notes > p {
  font-size: 17px;
  line-height: 1.7;
  margin: 0;
  white-space: pre-line;
}

.project-notes dl {
  margin: 0;
}

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

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

.project-notes dd {
  margin: 0;
}

.project-gallery {
  display: grid;
  gap: 80px 20px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.project-gallery figure {
  grid-column: 1 / span 8;
  margin: 0;
}

.project-gallery figure:nth-child(even) {
  grid-column: 5 / span 8;
}

.project-gallery figure:nth-child(3n) {
  grid-column: 3 / span 8;
}

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

.project-navigation {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 120px;
}

.project-navigation a {
  min-height: 130px;
  padding: 26px;
}

.project-navigation a + a {
  border-left: 1px solid var(--line);
  text-align: right;
}

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

.project-navigation strong {
  font-size: 20px;
  font-weight: 400;
}

.project-error {
  display: grid;
  min-height: calc(100vh - 82px);
  place-content: center;
  text-align: center;
}

.project-error p {
  font-size: 20px;
}

.project-error a {
  border-bottom: 1px solid;
  font-size: 12px;
  justify-self: center;
  padding-bottom: 4px;
}

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

.project-viewer {
  background: #0b0b0a;
  color: var(--paper);
  height: 100%;
  overflow: hidden;
  width: 100%;
}

.viewer-shell {
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
  height: 100dvh;
  min-height: 100vh;
  position: relative;
}

.viewer-shell > header {
  align-items: center;
  border-bottom: 1px solid #30302d;
  display: flex;
  justify-content: space-between;
  padding: 0 24px;
}

.viewer-shell > header p {
  color: #aaa89f;
  display: flex;
  font-size: 10px;
  gap: 22px;
  margin: 0;
}

.viewer-shell > figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 68px;
  margin: 0;
  min-height: 0;
  padding: 0 clamp(52px, 7vw, 100px);
}

.viewer-shell > figure > div {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  padding: 14px 0;
}

.viewer-shell > figure img {
  display: block;
  height: auto;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  width: auto;
}

.viewer-shell figcaption {
  align-items: center;
  border-top: 1px solid #30302d;
  display: flex;
  font-size: 12px;
}

.viewer-control {
  align-items: center;
  background: rgba(11, 11, 10, 0.72);
  color: var(--paper);
  cursor: pointer;
  display: flex;
  height: 68px;
  justify-content: center;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  z-index: 2;
}

.viewer-control:disabled {
  cursor: default;
  opacity: 0.25;
}

.viewer-previous {
  left: 0;
}

.viewer-next {
  right: 0;
}

@media (max-width: 700px) {
  .project-header {
    height: 68px;
    padding: 0 18px;
  }

  .project-brand {
    font-size: 14px;
  }

  #projectPage {
    padding: 0 16px 60px;
  }

  .project-intro {
    display: block;
    padding: 46px 0 24px;
  }

  .project-intro h1 {
    font-size: 46px;
  }

  .project-intro > p:last-child {
    margin-top: 18px;
  }

  .project-notes {
    display: block;
    padding: 46px 0 68px;
  }

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

  .project-gallery {
    display: block;
  }

  .project-gallery figure + figure {
    margin-top: 30px;
  }

  .project-navigation {
    margin-top: 70px;
  }

  .project-navigation a {
    min-height: 106px;
    padding: 18px 8px;
  }

  .project-navigation strong {
    font-size: 14px;
  }

  .viewer-shell {
    grid-template-rows: 58px minmax(0, 1fr);
  }

  .viewer-shell > header {
    padding: 0 16px;
  }

  .viewer-shell > figure {
    grid-template-rows: minmax(0, 1fr) 76px;
    padding: 0 42px;
  }

  .viewer-shell > figure > div {
    padding: 10px 0;
  }

  .viewer-control {
    background: transparent;
    height: 58px;
    width: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
