:root {
  --primary: #c8a951;
  --secondary: #1f4e79;
  --color1: #ffffff;
  --color2: #e0e0e0;
  --color3: #b5b5b5;
  --color4: #565656;
  --color5: #2e2e2e;

  --max-width: 1440px;
  --unit: calc(clamp(0px, 100vw, var(--max-width)) / 180); /* 8px for 1440w */
}

a {
  color: var(--color5);
  text-decoration: none;
}

a:hover {
  cursor: pointer;
}

body {
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-template-columns: 1fr 16fr 1fr;
  margin: 0;
  margin-bottom: calc(6 * var(--unit));
  padding: 0;
}

button {
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-sizing: border-box;
  border: 1px solid var(--color3);
  border-radius: calc(3 * var(--unit));
  background: transparent;
  padding: 0 calc(3 * var(--unit));
  width: calc(36 * var(--unit));
  height: calc(6 * var(--unit));
  color: var(--color5);
  font-weight: 300;
  font-size: calc(3 * var(--unit));
}

button:hover {
  cursor: pointer;
}

h1 {
  display: block;
  align-self: end;
  margin: 0;
  color: var(--primary);
  font-weight: 300;
  font-size: calc(4 * var(--unit));
  line-height: calc(4 * var(--unit));
}

h2 {
  margin: 0;
  font-weight: 300;
  font-size: calc(2 * var(--unit));
  line-height: calc(4 * var(--unit));
}

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

input,
textarea {
  box-sizing: border-box;
  margin-bottom: calc(3 * var(--unit));
  border: 1px solid var(--color3);
  border-radius: var(--unit);
  padding: calc(3 * var(--unit));
  height: calc(9 * var(--unit));
  font-size: calc(2 * var(--unit));
}

label {
  margin: 0;
  height: calc(3 * var(--unit));
  font-weight: 300;
  font-size: calc(2 * var(--unit));
}

label span {
  color: red;
}

p {
  margin-bottom: calc(3 * var(--unit));
  color: var(--color4);
  font-weight: 400;
  font-size: calc(2 * var(--unit));
  line-height: calc(3 * var(--unit));
}

.single-page-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-auto-rows: minmax(calc(3 * var(--unit)), auto);
  column-gap: calc(3 * var(--unit));
  grid-column: 2;
  box-sizing: border-box;
  margin: 0 auto;
  padding: calc(6 * var(--unit)) calc(13 * var(--unit));
  width: 100%;
  max-width: var(--max-width);
}

.single-page-grid * {
  grid-column: 1/-1;
}

.card {
  display: grid;
  grid-template-rows: repeat(12, minmax(calc(3 * var(--unit)), auto));
  grid-template-columns: repeat(2, 1fr);
  column-gap: calc(3 * var(--unit));
  margin-top: calc(9 * var(--unit));
  border: 1px solid var(--color3);
  border-radius: calc(2 * var(--unit));
  padding: 0 calc(13 * var(--unit));
}

.card button {
  grid-column: 1/-1;
  margin: 0 auto;
}

.card h1 {
  grid-column: 1/-1;
  color: var(--color5);
  text-align: center;
}

.carousel-button {
  border: none;
  width: 100%;
  height: 100%;
  color: var(--color2);
  font-weight: 300;
  font-size: calc(8 * var(--unit));
}

.carousel-element {
  height: 100%;
}

.carousel-image-wrapper {
  grid-column: span 6;
  cursor: pointer;
  aspect-ratio: calc(638 / 479);
  overflow: hidden;
}

.carousel-image {
  width: unset;
  object-fit: contain;
}

.contact-form {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-auto-rows: minmax(calc(3 * var(--unit)), auto);
  column-gap: calc(3 * var(--unit));
  margin: calc(6 * var(--unit)) 0;
}

.contact-form-element-half {
  display: flex;
  grid-column: span 4;
  flex-direction: column;
}

.contact-info {
  grid-column: span 2;
  border-top: 1px solid var(--color3);
  padding-top: calc(3 * var(--unit));
}

.header-container {
  display: flex;
  grid-row: 1;
  grid-column: 1 /-1;
  justify-content: space-between;
  background-color: var(--secondary);
  padding: calc(3 * var(--unit))
    calc(min(max(10 * var(--unit), (100% - var(--max-width)) / 2), 100%));
}

.header-link {
  display: flex;
  align-items: center;
  height: calc(3 * var(--unit));
  color: var(--color1);
}

.header-link-selected {
  color: var(--primary);
}

.header-logo {
  display: flex;
  align-items: center;
  height: calc(9 * var(--unit));
  color: var(--primary);
}

.header-logo-img {
  margin-right: calc(3 * var(--unit));
  width: calc(4 * var(--unit));
  height: unset;
}

.header-text {
  font-weight: 400;
  font-size: calc(2 * var(--unit));
}

.image-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  overflow: hidden;
}

.modal {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  flex-direction: column;
  z-index: 10;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.4);
  padding: calc(6 * var(--unit));
  width: 100%;
  height: 100%;
}

.modal-close-button {
  position: relative;
  z-index: 1000;
  cursor: pointer;
  margin-left: auto;
  border: none;
  background: transparent;
  padding: 0;
  width: calc(4 * var(--unit));
  height: calc(4 * var(--unit));
}

.modal-close-button span {
  position: absolute;
  left: 0;
  background-color: var(--color2);
  width: calc(4 * var(--unit));
  height: calc(var(--unit) / 2);
}

.modal-close-button span:nth-child(1) {
  top: calc(var(--unit) / 4);
  transform: translate(0, calc(1.5 * var(--unit))) rotate(45deg);
}

.modal-close-button span:nth-child(2) {
  bottom: calc(var(--unit) / 4);
  transform: translate(0, calc(-1.5 * var(--unit))) rotate(-45deg);
}

.modal-image {
  height: unset;
  max-height: calc(100% - 6 * var(--unit));
  object-fit: contain;
}

.modal-inner {
  display: flex;
  flex-direction: column;
  margin: auto auto;
  max-width: 100%;
  max-height: 100%;
}

.navbar-links {
  display: flex;
  column-gap: calc(3 * var(--unit));
  row-gap: calc(3 * var(--unit));
  justify-content: right;
  align-items: center;
  min-height: calc(9 * var(--unit));
}

.nav-icon {
  display: none;
  position: relative;
  cursor: pointer;
  margin: calc(2 * var(--unit)) 0;
  width: calc(4 * var(--unit));
  height: calc(4 * var(--unit));
}

.nav-icon span {
  position: absolute;
  transition: 0.4s;
  background-color: var(--color2);
  width: 100%;
  height: calc(var(--unit) / 2);
}

.nav-icon span:nth-child(1) {
  top: calc(var(--unit) / 4);
  left: 0;
}

.nav-icon span:nth-child(2) {
  top: calc(1.75 * var(--unit));
  left: 0;
}

.nav-icon span:nth-child(3) {
  bottom: calc(var(--unit) / 4);
  left: 0;
}

.nav-icon.open {
  transform: rotate(45deg);
  animation-duration: 0.24s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
  animation-delay: 0.16s;
}

.nav-icon.open span:nth-child(1) {
  transform: translate(0, calc(1.5 * var(--unit)));
  animation-duration: 0.24s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
  animation-delay: 0.16s;
}

.nav-icon.open span:nth-child(2) {
  opacity: 0;
  animation-duration: 0.24s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
  animation-delay: 0.16s;
}

.nav-icon.open span:nth-child(3) {
  transform: translate(0, calc(-1.5 * var(--unit))) rotate(-90deg);
  animation-duration: 0.24s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
  animation-delay: 0.16s;
}

.nav-link {
  display: none;
}

.project-cell {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(calc(3 * var(--unit)), auto);
  grid-column: span 4;
  margin-bottom: calc(3 * var(--unit));
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(calc(3 * var(--unit)), auto);
  column-gap: calc(3 * var(--unit));
  grid-column: 2;
  box-sizing: border-box;
  margin: 0 auto;
  width: 100%;
  max-width: var(--max-width);
}

.project-grid-element {
  height: calc(39 * var(--unit));
}

.project-title {
  display: block;
  align-self: end;
  margin: 0;
  color: var(--color4);
  font-weight: 400;
  font-size: calc(var(--unit) * 1.5);
  line-height: calc(var(--unit) * 2);
  text-align: center;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(calc(3 * var(--unit)), auto);
  column-gap: calc(3 * var(--unit));
  grid-column: 2;
  box-sizing: border-box;
  margin: 0 auto;
  width: 100%;
  max-width: var(--max-width);
}

.section-grid-element {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(calc(3 * var(--unit)), auto);
  grid-column: span 4;
  margin-bottom: calc(3 * var(--unit));
  aspect-ratio: calc(1320 / 990);
  /* height: calc(39 * var(--unit)); */
}

.section-title {
  display: flex;
  grid-column: 1/-1;
  justify-content: center;
  align-items: center;
  margin: 0;
  height: calc(9 * var(--unit));
  color: var(--color4);
  font-weight: 400;
  font-size: calc(var(--unit) * 1.5);
  line-height: calc(var(--unit) * 2);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(calc(3 * var(--unit)), auto);
  column-gap: calc(3 * var(--unit));
  grid-column: 2;
  box-sizing: border-box;
  margin: 0 auto;
  width: 100%;
  max-width: var(--max-width);
}

.work-title,
.work-info,
.work-content {
  grid-column: 4 / span 6;
  margin: 0;
}

.work-title {
  margin: calc(3 * var(--unit)) 0;
  color: var(--color5);
}

.youtube-container {
  display: flex;
  grid-column: 1/-1;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--color3);
  border-radius: calc(2 * var(--unit));
  aspect-ratio: calc(1.6);
  overflow: hidden;
}

@media only screen and (max-width: 920px) {
  :root {
    --unit: calc(100vw / 72); /* 10px for 720w */
  }

  .card {
    padding: 0 calc(3 * var(--unit));
  }

  .carousel-image-wrapper {
    grid-column: span 10;
  }

  .contact-form-element-half {
    grid-column: span 8;
  }

  .contact-info {
    grid-column: span 8;
  }

  .desktop-spacer {
    display: none;
  }

  .header-container {
    padding: calc(3 * var(--unit)) calc(7 * var(--unit));
  }

  .header-link {
    display: none;
  }

  .header-link.open {
    display: flex;
  }

  .navbar-links {
    flex-direction: column;
    align-items: end;
  }

  .nav-icon {
    display: inline-block;
  }

  .projects-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .project-title {
    font-size: calc(var(--unit) * 2);
    line-height: calc(var(--unit) * 2);
  }

  .section-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .single-page-grid {
    padding: calc(6 * var(--unit)) calc(3 * var(--unit));
  }

  .work-title,
  .work-info,
  .work-content {
    grid-column: 2 / span 10;
  }
}
