html {
  font: 16px/1.25 "Source Serif 4", serif;
  text-size-adjust: none;
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
}

@media screen and (min-width: 640px) {
  html {
    font-size: 17px;
  }
}

body, h1, h2, p, ol, ul, li, figure, hr {
  margin: 0;
  padding: 0;
  font-weight: normal;
}

a {
  text-decoration: none;
}



/* BACKGROUND */

body {
  background-color: #f5f5f5;
}



/* HEADER */

header {
  background: url(../img/header.jpg) center / contain;
  height: 80px;
}

header div {
  position: relative;
  max-width: min(100vh, 960px);
  height: 100%;
  margin: auto;
  padding: 0 5%;
}

@media screen and (min-width: 640px) {
  header {
    height: 120px;
  }
}



/* MENU */

nav {
  background: #ddd;
}

nav ul {
  max-width: min(100vh, 960px);
  margin: auto;
  padding: 0 5%;
  list-style: none;
}

nav li {
  display: inline-block;
}

nav li:not(:last-child) {
  margin-right: 2em;
}

nav a {
  display: block;
  padding: 0.75rem 0;
  border-top: 3px solid #ddd;
  border-bottom: 3px solid #ddd;
  text-transform: uppercase;
  font-size: 0.9em;
  font-weight: 600;
  color: black;
  transition: border-bottom-color 0.25s;
}

nav a:hover {
  border-bottom-color: #666;
}

@media screen and (min-width: 400px) {
  nav a {
    letter-spacing: 1px;
    font-size: unset;
  }
}



/* CONTENT */

main {
  max-width: min(100vh, 960px);
  margin: auto;
  padding: 1em 5% 3em;
}

main div.narrow {
  max-width: 640px;
}

main a {
  border-bottom: 1px solid #faa;
  color: #c00;
}

main a:hover {
  color: #f00;
}

main h1 {
  margin-top: 0.66em;
  margin-bottom: 0.9em;
  font-size: 1.5em;
  font-weight: 700;
}

main h2 {
  margin-top: 0.75em;
  margin-bottom: 0.66em;
  font-size: 1.25em;
  font-weight: 700;
}

main p {
  margin-top: 0.66em;
  margin-bottom: 0.9em;
  line-height: 1.4;
}

main ol, main ul {
  margin-top: 0.9em;
  margin-bottom: 0.9em;
  margin-left: 2.25em;
}

main ol li, main ul li {
  margin-bottom: 0.5em;
  line-height: 1.4;
}

@media screen and (min-width: 640px) {
  main h1 {
    font-size: 1.75em;
  }
  main h2 {
    font-size: 1.5em;
  }
}



/* PORTFOLIO LINKS ON HOME PAGE */

ul#portfolio {
  list-style: none;
  margin-top: 1.5em;
  margin-left: 0;
}

ul#portfolio li {
  margin-bottom: 0.75em;
}

ul#portfolio a {
  display: block;
  border-bottom: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 1.25em;
  color: black;
  transition: color 0.5s;
}

ul#portfolio a img {
  width: 40%;
  margin-right: 3%;
  border-radius: 5px;
  vertical-align: middle;
  transition: filter 0.5s;
}

ul#portfolio a:hover img {
  filter: brightness(1.1);
}

ul#portfolio a:hover {
  color: #c00;
}

@media screen and (min-width: 640px) {
  ul#portfolio li {
    margin-bottom: 1em;
  }
  ul#portfolio li a {
    font-size: 1.5em;
  }
}



/* PHOTOS */

figure {
  overflow: hidden; /* Contain floated figcaption. */
  margin-bottom: 3em; /* Match div.gallery. */
}

figure img {
  display: block;
  max-width: 100%;
  margin-bottom: 10px;
}

figcaption {
  float: right; /* Allow for widths less than 100%. */
  max-width: 640px;
  margin-top: 0.25em;
  text-align: right;
  font-size: 0.9em;
}

figcaption p {
  margin-top: 0.6em;
  margin-bottom: 0;
  font-style: italic;
}

div.multi {
  display: flex;
  flex-direction: column;
}

div.multi img { /* For multiple <img> in one flexbox div, inside <figure>. */
  overflow: hidden; /* Allow shrinking of images, which are the flex items. */
}

@media screen and (min-width: 480px) {
  figcaption {
    font-size: unset;
  }
  div.multi {
    flex-direction: row;
    align-items: center;
    column-gap: 10px;
  }
}



/* GALLERIES (SLIDERS) */

div.gallery {
  position: relative;
  width: 100%;
  height: 540px;
  overflow: hidden;
  margin-bottom: 3em; /* Match figure. */
  background: #222;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

div.gallery div {
  position: absolute;
  left: 100%;  /* Hide all slides off the edge initially. */
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

div.gallery div.transitioning {
  transition: left 0.25s;
}

div.gallery div img {
  max-width: 100%;
  max-height: 100%;
  pointer-events: none;
}

div.gallery button {
  z-index: 1;
  position: absolute;
  top: 45%;
  width: 10%;
  height: 10%;
  border: none;
  background: none;
  font-size: 2.5em;
  color: white;
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.25s;
  -webkit-appearance: none;
  -moz-appearance: none;
}

div.gallery button:hover {
  opacity: 1;
}

div.gallery button.next-button {
  right: 0;
}

div.gallery button.prev-button {
  left: 0;
}



/* VIDEOS */

div.video { /* Container to set aspect ratio of iframe. */
  position: relative;
  width: 100%;
  margin-bottom: 10px;
  padding-top: 100%; /* 1:1 */
}

div.video.video-9-16 {
  padding-top: 177.78%; /* 9:16 (portrait) */
}

div.video#a-cast-of-mind,
div.video#requiem {
  padding-top: 73.14%; /* Almost 11:8 but not quite. No idea why! */
}

div.video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}



/* CONTACT PAGE */

form {
  margin-top: 1.5em;
}

label {
  display: block;
  margin-bottom: 0.5em;
}

input, textarea {
  display: block;
  width: 98%;
  margin-bottom: 1.5em;
  padding: 0.5em 3px;
  border: 1px solid #aaa;
  border-radius: 3px;
  font: 1em "Source Serif 4", serif;
  -webkit-appearance: none; /* Fix for iOS. */
}

input[type=submit] {
  width: 150px;
  margin-top: 1.5em;
  background: #222;
  border: none;
  color: white;
  cursor: pointer;
}

input[type=submit]:disabled {
  background: #999;
  color: silver;
  cursor: not-allowed;
}



/* SPECIAL CASES */

@media screen and (min-width: 480px) {
  div#sculptures-transformation div,
  div#sculptures-transformation img {
    flex-basis: 0;
    flex-grow: 1;
  }
}



/* MISCELLANEOUS */

main ul#collaborations {
  margin-left: 0;
  list-style: none;
}