:root {
  --white:hsl(0, 0%, 98%);
  --light-grey:hsl(0, 0%, 55%);
  --dark-grey:hsl(0, 0%, 13%);
  --black:hsl(0, 0%, 0%);
  --text-light: var(--white);
  --text-dark: var(--black);
  --background-light: var(--white);
  --background-dark: var(--black);
  --font-size-l: 1.5rem;
  --font-size-m: 1rem;
  --font-size-s: 0.8rem;
  --gap: 0.3rem;
}

html {
  background-color: var(--background-light);
  color: var(--text-dark);
  font-family: sans-serif;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.015em;
  hyphens: auto;
  -webkit-hyphens: auto;
}

body {
  position: relative;
  z-index: 0;
}

main {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

section {
  padding-left: var(--gap);
  padding-right: var(--gap);
}

a, a:link, a:visited {
  cursor: pointer;
}

@media (hover: hover) {
    a:hover, a:link:hover, a:visited:hover {
    cursor: pointer;
    text-decoration: underline;
  }
}

header a:hover, 
header a:link:hover, 
header a:visited:hover,
.project-tile a:hover, 
.project-tile a:link:hover, 
.project-tile a:visited:hover {
  text-decoration: none;
}

img {
  object-fit: cover;
  object-position: center;
  height: 100%;
  width: 100%;
}

/* header */

header {
  position: fixed;
  top: 0;
  left: 0;
  padding: var(--gap);
  padding-bottom: calc(0.75 * var(--gap));
  box-sizing: border-box;
  background-color: var(--background-light);
  z-index: 10;
}

.button.filter {
  display: inline;
  cursor: pointer;
}

.button.filter.active {
  text-decoration: none;
}

.button.filter.inactive {
  text-decoration: line-through;
}

@media (hover: hover) {
  .button.filter:hover,
  .button.filter.inactive:hover {
    text-decoration: underline;
  }
}

.back {
  display: none;
}

@media (hover: hover) {
  header a:hover .back {
    display: block;
    animation: move 1s;
    animation-iteration-count: infinite;
  }
}

@keyframes move {
  0% { margin-left: 0.3em; }
  50% { margin-left: 0em; }
  100% { margin-left: 0.3em; }
}

@media (hover: hover) {
  header a:hover .subtitle {
    display: none;
  }
}

/* info */

.info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  padding-top: var(--gap);
  padding-bottom: calc(0.75 * var(--gap));
  box-sizing: border-box;
  background-color: var(--background-light);
  position: sticky;
  top: 0;
  left: 0;
  z-index: -1;
}

.contact-details:before {
  content: "\A \A \A";
  white-space: pre;
}

/* project collection */

.project-collection {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  background-color: var(--background-light);
  position: relative;
  min-height: 100vh;
}

.project-tile {
  width: 100%;
  position: relative;
  z-index: 0;
}

.project-tile.inactive {
  display: none;
}

.project-tile figure {
  width: 100%;
  padding-bottom: 100%;
  background-color: var(--background-dark);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  overflow: hidden;
  transition: border-radius 0.2s;
}

.project-tile figcaption {
  padding: var(--gap);
  padding-left: 0;
  padding-right: 0;
  padding-top: calc(0.5 * var(--gap));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--background-light);
  width: 100%;
  transition: padding-left 0.2s;
}

.project-subtitle {
  font-size: var(--font-size-s);
}

@media (hover: hover) {
  .project-tile:hover figure {
    border-radius: 30px;
  }

  .project-tile:hover figcaption {
    padding-left: 0.5rem;
  }
}

/* project single */

.project .intro {
  height: 90vh;
  max-height: 100vw;
  padding-top: var(--gap);
  padding-bottom: var(--gap);
}

.project .intro .opener {
  width: 100%;
  height: 100%;
  background-color: var(--background-dark);
  display: flex;
  justify-content: center;
  align-items: center;
}

.intro .design-collection img {
  object-fit: contain;
  object-position: center;
  height: 100%;
  width: 100%;
  pointer-events: none;
}

.intro .code-collection video {
  max-width: 87.7vw;
  max-height: 75%;
  object-fit: contain;
  transition: opacity 3s;
  cursor: pointer;
}

.intro .type-collection {
  text-align: center;
  color: var(--white);
  font-size: 12vw;
  line-height: 1.1;
  overflow: hidden;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
  white-space: break-spaces;
}

.intro .type-collection p {
  background-color: transparent;
  margin-top: -0.3em;
}

.intro .type-collection p::selection {
  background-color: white;
  color: black;
}

.project .gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  position: relative;
}

.gallery figure {
  width: 100%;
  height: 100%;
  aspect-ratio: 1/1;
  background-position: center;
  background-size: 100%;
  background-repeat: no-repeat;
  overflow: hidden;
  cursor: zoom-in;
}

.gallery figure.zoomed {
  cursor: zoom-out;
}

.gallery img {
  transform: scale(100%) translateX(0%, 0%);
  transition: transform 0.6s;
  transition-timing-function: cubic-bezier(0.445, 0.05, 0.55, 1.2);
  pointer-events: none;
  object-fit: cover;
}

.intro figcaption,
.gallery figcaption {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
}

.info table {
  font-size: var(--font-size-s);
}

.info table td:first-child {
  width: 8em;
}

td {
  vertical-align: top;
  padding: 0;
}

/*  default */

.default .text {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  padding: var(--gap);
  font-size: var(--font-size-m);
}

.default .text *:first-child {
  margin-top: 0;
}

.default .text *:last-child {
  margin-bottom: 0;
}

.default .text p {
  margin-bottom: 1.2em;
}

.default .text h1 {
  margin-top: 2.4em;
  margin-bottom: 1.2em;
  font-size: var(--font-size-s);
}

.default .text h2 {
  margin-top: 1.2em;
  margin-bottom: 0.3em;
  font-size: var(--font-size-m);
  text-decoration: underline;
}

.default .text h3 {
  margin-top: 0.6em;
  margin-bottom: 0.3em;
  font-size: var(--font-size-s);
  text-decoration: underline;
}

.default .text h4 {
  font-size: var(--font-size-s);
}

.default .text ul {
  margin-bottom: 1.2em;
  padding-left: 1.5em;
  box-sizing: border-box;
}

.default .text li {
  list-style: disc;
}

/*  footer */

footer {
  display: flex;
  position: absolute;
  bottom: 0;
  right: 0;
  padding: var(--gap);
  padding-right: calc(2 * var(--gap));
  box-sizing: border-box;
  font-size: var(--font-size-s);
}

footer a {
  margin-left: 1.5em;
}

.lazy {
  opacity: 0;
}

.loaded {
  opacity: 1;
  transition: opacity 1s;
}