@font-face {
  font-family: "Office";
  src: url("../assets/fonts/Office-Regular.woff2") format("woff2"),
      url("../assets/fonts/Office-Regular.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Office";
  src: url("../assets/fonts/Office-Bold.woff2") format("woff2"),
      url("../assets/fonts/Office-Bold.woff") format("woff");
  font-weight: bold;
  font-style: normal;
}

*,
*:before,
*:after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
}

body {
  --margin: 2rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  font-family: "Office", "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.3;
}

a {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

a:focus {
  outline: 0;
}

h1,
h2,
h3 {
  font-weight: normal;
}

h1,
h2,
h3 {
  font-size: inherit;
}

header {
  /* display: flex;
  justify-content: space-between; */
  display: grid;
  gap: var(--margin);
  grid-template-columns: repeat(auto-fill, minmax(140px,1fr));
  padding: calc(var(--margin) - 0.5em) var(--margin) var(--margin);
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  left: 0;
  z-index: 100000;
  background-color: white;
}

.headroom {
  will-change: transform;
  transition: transform 0.3s ease-out;
}

.headroom--pinned {
  transform: translateY(0%);
}

.headroom--unpinned {
  transform: translateY(-100%);
}

header>h1 {
  font-size: 1.5em;
  line-height: 1.154;
  white-space: nowrap;
  cursor: pointer;
}

header>h1>a {
  text-decoration: none;
}

header>h1>a:hover {
  text-decoration: underline;
}

header>h2 {
  grid-column-start: 4;
  grid-column-end: -2;
  transition: height 0s, opacity 0.3s ease-in-out, visibility 0s;
}

header>h2.hide {
  height: 0;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition-delay: 0.3s, 0s, 0.3s;
}

header>h2,
header>nav {
  /* margin-top: 0.6em; */
}

header>nav {
  grid-column-end: -1;
  text-align: right;
}

header>nav>a {
  text-decoration: none;
}

header>nav>a:hover {
  text-decoration: underline;
}

header>nav>a.plus {
  display: none;
  margin-top: -0.3em;
  margin-right: -0.3em;
  padding: 0.25em 0.45em;
  transform: rotate(45deg);
}

header>nav>a.plus:hover {
  text-decoration: none;
}

header>nav.close>a:first-of-type {
  display: none;
}

header>nav.close>a.plus {
  display: inline-block;
  transform: rotate(0deg);
}

section {
  flex: 1;
  display: flex;
  transition: opacity 0.3s ease-in-out, visibility 0s;
}

section.hide {
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition-delay: 0s, 0.3s;
}

article {
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  padding: 0 var(--margin);
}

article>h2 {
  display: none;
}

.grid {
  display: grid;
  align-content: start;
  /* align-items: start; */
  gap: var(--margin);
  grid-template-columns: repeat(auto-fill, minmax(140px,1fr));
  /* grid-template-rows: repeat(auto-fill, calc((100vw - var(--margin) * 9) / 8)); */
  grid-auto-flow: dense;
  width: 100%;
  padding-bottom: var(--margin);
  overflow-x: hidden;
}

figure {
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

figure.landscape.active {
  grid-column-end: span 4;
  grid-row-end: span 3;
}

figure.portrait.active {
  grid-column-end: span 2;
  grid-row-end: span 3;
}

figure.square.active {
  grid-column-end: span 4;
  grid-row-end: span 4;
}

figure:before {
  content: "";
  display: block;
  padding-top: 100%;
}

figure.landscape.active:before {
  padding-top: calc(4 / 5 * 100%);
}

figure.portrait.active:before {
  padding-top: calc(4.095 / 3 * 100%);
}

figure>img,
figure>picture>img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  -o-object-fit: cover;
  object-fit: cover;
  -o-object-position: center;
  object-position: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: top left;
  transform: translate(-50%, -50%);
}

figure>picture {
	display: contents;
	width: 100%;
	height: 100%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: top left;
  transform: translate(-50%, -50%);
}

figure>img.transition,
figure>picture>img.transition {
  transition: all 0.5s cubic-bezier(0.2, 0, 0.3, 1);
}

figure.active>img,
figure.active>picture>img {
  width: 100%;
  height: calc(100% - 2em);
  transform: translate(-50%, -50%) translateY(-1em);
}

figcaption {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background-color: white;
  opacity: 0;
}

figure>img.transition+figcaption {
  z-index: 10000;
}

figure.active>figcaption {
  height: auto;
  top: auto;
  bottom: 0;
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

figcaption>a {
  display: flex;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  padding-top: 1em;
  line-height: 1;
  text-decoration: none;
}

figcaption>a>span {
  opacity: 0;
  visibility: hidden;
}

figcaption>a>span:first-child {
  padding-right: 0.5em;
}

figcaption>a>span:last-child {
  flex: 0 0 auto;
}

figcaption>a:hover>span:last-child {
  text-decoration: underline;
}

figure.active>figcaption>a>span {
  opacity: 1;
  visibility: visible;
}

.about {
  width: 62.5%;
  padding-right: calc(var(--margin) / 2);
}

.about .credits {
  display: none;
}

address {
  width: 37.5%;
  padding-left: calc(var(--margin) / 2);
  font-style: normal;
}

/* .about>h3,
address>h3 {
  padding-top: 1em;
  padding-bottom: 0.3em;
} */

.about h3,
address h3 {
  padding-top: 0;
  padding-bottom: 0.5em;
  font-size: 1em;
}

.about p,
address p {
  margin-bottom: 1.3em;
  font-size: 1.5em;
}

.project {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  width: calc(((100% - var(--margin) * 9) / 8) * 6 + var(--margin) * 5);
  margin: 0 auto;
  padding: 0 calc(var(--margin) / 2);
}

.project>div {
  width: 100%;
  margin: 0 calc(var(--margin) / 2) 1rem;
}

.project>img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: var(--margin);
  padding: 0 calc(var(--margin) / 2);
}

.project>img.portrait {
  width: 50%;
}

.project>h3,
.project>p {
  width: 100%;
  padding: 0 calc(var(--margin) / 2);
  font-size: 1.5em;
}

.project>p {
  margin-bottom: 1.3em;
}

@media (max-width: 1440px) {
  html {
    font-size: calc(6px + .694vw);
  }
}

@media (max-width: 1400px) {
  header>h2 {
    grid-column-start: 3;
  }
}

@media (max-width: 1023px) {
  .project {
    width: 100%;
  }

  .about {
    width: 60%;
  }

  address {
    width: 40%;
  }
}

@media (max-width: 857px) {
  header,
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(130px,1fr));
  }

  .about,
  address {
    width: 50%;
  }
}

@media (max-width: 806px) {
  header,
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(120px,1fr));
  }
}

@media (max-width: 767px) {
  html {
    font-size: 16px;
  }

  header {
    padding-top: var(--margin);
  }

  header > h1 {
    font-size: inherit;
  }

  header > h2 {
    display: none;
  }

  header > nav {
    grid-column-start: -3;
    /* line-height: 1; */
  }

  header,
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(90px,1fr));
  }

  .project > img.portrait {
    width: 100%;
  }

  article>h2 {
    display: block;
    width: 100%;
    padding-bottom: var(--margin);
  }

  .about,
  address {
    width: 100%;
  }

  .about {
    order: 2;
    padding-right: 0;
  }

  .about .credits {
    display: block;
  }

  address {
    order: 1;
    padding-bottom: 0;
    padding-left: 0;
  }

  address .credits {
    display: none;
  }

  .about h3,
  address h3 {
    padding-top: 0;
    padding-bottom: 0.5em;
    font-size: 0.7em;
  }

  .about p,
  address p,
  .project>p {
    font-size: 1em;
    margin-bottom: var(--margin);
	}
	
  .project>h3 {
    font-size: 1em;
	}

	figcaption>a>span:first-child {
		font-size: 0.8em;
		line-height: 1rem;
	}
}

@media (max-width: 680px) {
  body {
    --margin: 1.5rem;
  }

  header, .grid {
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(80px,1fr));
  }

  header {
    padding-bottom: 0.8rem;
  }

  .project>img {
    margin-bottom: 1rem;
  }

  article>h2 {
    padding-bottom: 1rem;
  }

  .about p,
  address p,
  .project>p {
    margin-bottom: 1rem;
  }
}

@media (max-width: 480px) {
  body {
    --margin: 1rem;
  }

  header {
    padding-bottom: 0.6rem;
  }

  header>nav>a:first-child:not(:last-child) {
    display: none;
  }

  header>nav>a.plus {
    display: inline-block;
    transition: transform 0.3s ease-in-out;
  }

  header, .grid {
    grid-template-columns: repeat(auto-fill, minmax(65px,1fr));
  }
}

@media (-webkit-min-device-pixel-ratio: 2) {
  figure.portrait.active:before {
    padding-top: calc(4.11 / 3 * 100%);
  }
}

@media (min-resolution: 2ddpx) {
  figure.portrait.active:before {
    padding-top: calc(4.11 / 3 * 100%);
  }
}