body {
  transform-origin: 0 0;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0 90px;
  font-family: 'Montserrat', sans-serif, Arial, sans-serif;
  overflow-x: hidden;
  overflow-y: scroll;
  color: #e5e5e5;
  background: #1c1c1c url(/img/bg.png);
}

a,
button,
* {
  outline: none;
}

img {
  font-size: 0;
}

::selection {
  background: #bbb;
  color: #222;
}

.content {
  position: relative;
  max-width: 1150px;
  margin: 0 auto;
}

h1,
h2 {
  margin: 0;
  padding: 0;
  font-size: 24px;
  font-weight: 500;
  line-height: 40px;
}



h1 a {
  text-decoration: none;
  color: #e5e5e5;
}

h3 {
  margin: 20px 0 0 0;
  padding: 0;
  font-size: 18px;
  font-weight: 400;
  line-height: 36px;
  text-align: center;
  color: #aaa;
}


header {
  position: relative;
  padding: 40px 5px 50px;
  display: flex;
  flex-direction: column;
}

.header-top {
  display: flex;
  flex-wrap: nowrap;
  /* Prevent accidental wrapping - use breakpoint instead */
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 20px;
  /* Minimum gap between logo and nav */
}

header h1 {
  /* float: left; Removed float */
  line-height: 0;
  /* Fix for image height */
}

h1 a {
  text-decoration: none;
  display: block;
}

.header-logo-link {
  display: block;
  position: relative;
  text-decoration: none;
  width: 280px;
  max-width: 100%;
}

.header-logo {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.back-text {
  position: absolute;
  top: 62%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 35px;
  font-weight: 700;
  color: #e5e5e5;
  white-space: nowrap;
  letter-spacing: normal;
  opacity: 0;
  filter: blur(3px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

/* Hover effect only when 'back' class is present */
.header-logo-link.back:hover .header-logo {
  opacity: 0.3;
  filter: grayscale(100%) blur(3px);
  /* Slight ghosting or 0 for full hide */
}

.header-logo-link.back:hover .back-text {
  opacity: 1;
  filter: blur(0);
  color: #00c8ff;
}

header ul {
  display: block;
  margin: 0;
  padding: 0;
  font-weight: 400;
  text-align: right;
  list-style: none;
  align-self: flex-end;
  padding-bottom: 5px;
}

header ul li {
  display: inline-block;
  margin: 0 0 0 15px;
  padding: 0;
  font-size: 17px;
  line-height: 40px;
}

header ul li a {
  display: block;
  color: #e5e5e5;
  text-decoration: none;
  height: 41px;
  box-sizing: border-box;
}

header ul li a:hover {
  border-bottom: 2px solid;
  height: 40px;
  transition: height 0.3s cubic-bezier(0, 0, 0, 1);
}

header p {
  /* clear: both; Removed clear */
  max-width: 100%;
  /* Allow full width or constrain if preferred */
  font-size: 18px;
  line-height: 30px;
  font-weight: 300;
  color: #808080;
  margin: 20px 0 0 0;
  /* Add margin-top */
  padding: 0;
}

header:after {
  display: none;
  /* Removed decorative line */
}

header.noline:after {
  display: none;
}


footer {
  padding: 80px 5px 40px;
  font-weight: 300;
  text-align: center;
  color: #999;
}

footer small {
  color: #666;
}

.projects,
.scripts {
  display: flex;
  flex-flow: row wrap;
  align-items: flex-start;
}


.thumb {
  position: relative;
  overflow: hidden;
  background: url(/img/noise-dark.png);
  animation: noiser 0.3s infinite;
}

@keyframes noiser {
  0% {
    background-position: 0;
  }

  49% {
    background-position: 0;
  }

  50% {
    background-position: 0 1000px;
  }

  51% {
    background-position: 0 2000px;
  }

  100% {
    background-position: 0 2000px;
  }
}

.thumb.x1 {
  width: 33.33%;
}

.thumb.x2 {
  width: 66.67%;
}


.thumb.x3 {
  width: 100%;
}

.thumb img {
  display: block;
  width: 100%;
  object-fit: cover;
  transition-duration: 0.8s;
  transition-timing-function: cubic-bezier(0, 1, 0.3, 1);
}

.thumb.x1 img {
  aspect-ratio: 1 / 1;
}

.thumb.x2 img {
  aspect-ratio: 2 / 1;
}

.thumb.x3 img {
  aspect-ratio: 3 / 1;
}

.thumb .caption {
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9;
  text-align: center;
  justify-content: center;
  align-items: center;
  flex-flow: column;
  opacity: 0;
  transition-duration: 0.3s;
  transition-timing-function: cubic-bezier(0, 1, 0.3, 1);
  transform: scale(1.1);
}

.thumb .caption b {
  font-size: 22px;
  font-weight: 400;
  line-height: 30px;
  color: #eee;
  margin: 0 80px;
}

.thumb .caption em {
  font-size: 14px;
  font-weight: 400;
  line-height: 24px;
  font-style: normal;
  color: #aaa;
}

.thumb:after {
  display: block;
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  /*border: solid #1c1c1c;
  border-width: 5px;*/
  pointer-events: none;
}

.thumb:hover img {
  opacity: 0.15;
  transition-duration: 0.2s;
  transform: scale(1.05);
  filter: blur(10px) grayscale(100%);
}

.thumb:hover .caption {
  opacity: 1;
  transition-duration: 0.2s;
  transform: scale(1);
}




/* PROJECT */

.project {
  padding: 80px 5px 50px;
}

.video {
  position: relative;
  padding: 56.25% 0 0 0;
  margin: 40px 0;
  background: #111;
}

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


.video.flex {
  background: none;
}

.video.flex iframe,
.video.flex video {
  width: auto;
}

.video.square {
  background: none;
  padding: 0;
}

.video.square iframe {
  position: relative;
  width: 70vh;
  height: 70vh;
  max-width: 100%;
}



.illustration {
  position: relative;
  padding: 0;
  margin: 40px 0;
}

.illustration img {
  display: block;
  width: 100%;
  max-width: 900px;
}

.illustration.w img {
  max-width: 100%;
}

.illustration.m img {
  max-width: 700px;
}

.illustration.centered {
  text-align: center;
}

.illustration.centered img {
  margin: 0 auto;
}

.project .caption {
  display: block;
  margin: 10px 0;
  font-size: 14px;
  color: #999;
}


.lightbox {
  display: none;
  position: fixed;
  z-index: 999;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  cursor: zoom-out;
}

.lightbox:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url(/img/noise-dark.png);
  opacity: 0.9;
  z-index: -1;
}

.lightbox:target {
  display: block;
}

.lightbox:target img {
  animation: popin 0.5s cubic-bezier(.2, 1, .2, 1);
}

.lightbox img {
  display: block;
  max-width: 95vw;
  max-height: 95vh;
  margin: 2.5vh auto;
}




.project p {
  font-size: 17px;
  line-height: 28px;
  font-weight: 400;
  color: #999;
  margin: 18px 0;
}

.project img {
  background-image: url(/img/noise-dark.png);
}

.project p a,
.project li a {
  color: #999;
  text-decoration: none;
  border-bottom: 1px solid #999;
  transition: 0.2s;
}

.project p a:hover,
.project li a:hover {
  color: #eee;
  border-bottom: 1px solid #eee;
  padding-bottom: 3px;
}

.project a.more {
  display: inline-block;
  color: #ccc;
  border: 1px solid #ccc;
  padding: 10px 18px;
  margin: 18px 0;
}

.project a.more:hover {
  color: #111;
  border: 1px solid #ddd;
  background: #ddd;
  transition: 0s;
  padding: 10px 18px;
  margin: 18px 0;
}

.project a.more.subtle {
  border-color: #333
}

.project a.more.subtle:hover {
  background-color: #333;
  color: #eee;
}

.project a img {
  cursor: zoom-in;
}

.project a:active img {
  transform: scale(0.98);
  transition: 0.1s;
}


.project ul.credits {
  list-style: none;
  padding: 0;
  margin: 18px 0;
}

.project ul.credits li {
  padding: 0;
  font-size: 13px;
  line-height: 17px;
  font-weight: 400;
  color: #999;
  margin: 0 0 6px;
}



.extras {
  display: flex;
  margin: 0 -15px;
}

.extras>* {
  flex: 1;
  margin: 15px;
  position: relative;
  overflow: hidden;
}

.extras.mix>*.x2 {
  flex: 64%;
}

.extras.mix>*.x1 {
  flex: 36%;
}

.extras .caption {
  margin: -5px 15px 10px;
}

.extras img,
.extras video {
  display: block;
  width: 100%;
  /* max- */
}





hr {
  display: block;
  position: relative;
  clear: both;
  border-color: transparent;
  height: 20px;
  margin: 20px 0;
}



/* ANIMATION */

html.fadeout .projects,
html.fadeout .project,
html.fadeout .tagline {
  opacity: 0;
  transition: 0.3s cubic-bezier(.8, 0, .8, 0);
  transform: translateY(10px);
}



.project.fadein,
.projects.fadein,
.tagline.fadein {
  animation: fadein 1s cubic-bezier(.2, 1, .2, 1);
}


@keyframes fadein {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }

  100% {
    opacity: 1;
    transform: none;
  }
}

#trans {
  background: #555;
}

#trans:before {
  background-color: inherit;
  content: "";
  display: block;
  height: 100vh;
  position: fixed;
  top: 0;
  width: 100vw;
  z-index: -1;
  transition: transform 0.3s cubic-bezier(0.2, 0, 0.2, 0);
  transform: translateY(0);
  /*opacity: 0;*/
  /*box-shadow: 0 5px 90px rgba(0, 0, 0, 0.5);*/
}

#trans:after {
  background: #1c1c1c url(/img/bg.png);
  content: "";
  display: block;
  height: 100vh;
  position: fixed;
  top: 0;
  width: 100vw;
  z-index: -1;
  transition: transform 0.6s cubic-bezier(0.2, 1, 0.2, 1) 0.3s;
  transform: translateY(0);
  /*opacity: 0;*/
}



#trans.hidden:before,
#trans.hidden:after {
  transform: translate(0, -100vh);
  transition: 0s;
  /*opacity: 1;*/
}


/* Scripts */


.scripts .thumb.txt {
  background: none;
  padding: 5px 0 0 30px;
  box-sizing: border-box;
}

.scripts .thumb.txt:after {
  display: none;
}

.scripts .thumb.txt p {
  font-size: 16px;
  line-height: 26px;
  font-weight: 400;
  color: #999;
  margin: 0 0 18px;
}


/* LINKS Page */
\n\n.links .content {
  width: 340px;
}

.links header:after {
  display: none;
}

.links .project {
  padding-top: 0;
}

.links .project a.more {
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

ul.links-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.links-list li {
  padding: 0;
  margin: 0 0 16px;
  font-weight: 300;
  color: #808080;
  font-size: 17px;
  line-height: 28px;
}

ul.links-list li a {
  color: #e5e5e5;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: padding 0.2s;
}

ul.links-list li a:hover {
  color: #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 3px;
  transition: padding 0.1s;
}