@import url('fonts.css');

:root {
  --font-family: 'Geist', sans-serif;
  --font-title: 'Geist', sans-serif;
  --font-mono: 'GeistMono', monospace;
  --font-pixel-circle: 'GeistPixel-Circle', monospace;
  --font-pixel-grid: 'GeistPixel-Grid', monospace;
  --font-pixel-line: 'GeistPixel-Line', monospace;
  --font-pixel-square: 'GeistPixel-Square', monospace;
  --font-pixel-triangle: 'GeistPixel-Triangle', monospace;
  --accent-color: #004bff;
  --fluid-color: #004bff;
  --background-color: #000;
  --color-text: #FFF;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* outline: 1px solid red; */
}

html {
  font-size: 10px;
}

body {
  font-size: 1.4rem;
  background-color: var(--background-color);
  background-image: url("data:image/svg+xml;utf8,<svg width='51' height='51' viewBox='0 0 51 51' fill='none' xmlns='http://www.w3.org/2000/svg'><line x1='4.18933' y1='0' x2='4.18933' y2='8.124' stroke='%23D9D9D9'/><line y1='3.93469' x2='8.1989' y2='3.93469' stroke='%23D9D9D9'/></svg>");
  background-size: 16px 16px;
  background-position: 2% 0.5%;
  color: var(--color-text);
  font-family: var(--font-mono);
  padding: 2rem;
  overflow-x: hidden;
}

strong {
  font-family: var(--font-pixel-line);
  font-weight: 100;
  color: var(--accent-color);
}

h2,
h3 {
  font-size: 2rem;
  margin-bottom: 2rem;
}

ol,
ul {
  list-style: none;
  margin-bottom: 2rem;
}

a {
  text-decoration: none;
  color: var(--color-text);
  text-decoration: underline;
  transition: all 0.2s ease-out;
}

/* a:hover {
  color: var(--accent-color);
  background-color: var(--color-text);
  animation: underline 0.2s ease-out;
} */

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

span {
  display: inline-block;
  width: max-content;
}

*::selection {
  color: var(--accent-color);
  background-color: var(--color-text);
}

#fluid {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}


.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 5rem;
}

.header-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}


.header-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: flex-end;
}

.header-nav a {
  display: flex;
}

.header-nav a>span {
  width: max-content;
}

.header-nav a:hover>span {
  animation: type-lette-opacity 0.1s linear forwards;
  animation-delay: calc(0.02s * sibling-index());
}

.header-nav--divider {
  display: none;
}

.header-title {
  font-size: 1.5rem;
  max-width: 25ch;
  font-weight: 400;
}

.header-title__link {
  transition: none;
}

.header-title__link__text {
  display: inline-flex;
}

.header-title__link__text>span {
  text-decoration: underline;
}

.header-title__link:focus-visible {
  outline: 1px solid var(--accent-color);
  outline-offset: 2px;
  background-color: var(--color-text);
  color: var(--accent-color);
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 5rem;
}

.hero__container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;

}

.hero__header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}

.hero__work__status {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.hero__work__status--blink {
  height: 2rem;
  width: 2rem;
  background-color: var(--accent-color);
  border-radius: 50%;
  animation: blink 1.5s linear infinite;
}

.hero__work__status--text {
  font-family: var(--font-pixel-square);
  font-size: clamp(1.2rem, 5vw, 2rem);
  font-weight: 100;
}

.hero__title {
  font-weight: 400;
  font-size: clamp(3rem, 13vw, 12rem);
  text-align: center;
}

.hero__work__roles {
  display: flex;
  gap: 0ch;
  justify-content: center;
  align-items: center;

  font-size: clamp(1.6rem, 6.5vw, 8rem);
}

.hero__work__roles>span {
  font-family: var(--font-pixel-line);
}

.hero__work__roles--underscore {
  animation: underscore 0.9s steps(1, end) infinite;
}

.hero__work__roles--word {

  display: flex;
  --typing-duration: 1.2s;

  --word-in-scene-duration: 2.5s;
  --word-gap-duration: 0.5s;
  --words-total: 5;
  --slot-duration: calc(var(--typing-duration) + var(--word-in-scene-duration) + var(--word-gap-duration));
  --cycle-duration: calc(var(--slot-duration) * var(--words-total));
}

.hero__work__roles--letter {
  display: inline-block;
  --letters-total: sibling-count();
  --typing-step: calc(var(--typing-duration) / var(--letters-total));
  opacity: 0;
  width: 0ch;
  overflow: hidden;
  animation: type-letter var(--cycle-duration) linear infinite both;
  animation-delay: calc(var(--word-delay) + var(--typing-step) * sibling-index());
}

.is-frontend {
  font-family: var(--font-pixel-square);
  --word-delay: calc(0 * var(--slot-duration));
}

.is-motion {
  font-family: var(--font-pixel-circle);
  --word-delay: calc(1 * var(--slot-duration));
}

.is-creative {
  font-family: var(--font-pixel-triangle);
  --word-delay: calc(2 * var(--slot-duration));
}

.is-webgl {
  font-family: var(--font-pixel-grid);
  --word-delay: calc(3 * var(--slot-duration));
}

.is-interactive {
  font-family: var(--font-pixel-line);
  --word-delay: calc(4 * var(--slot-duration));
}

.is-developer {
  padding-left: 1ch;
}

@keyframes type-letter {


  0% {
    /* width: 0ch; */
    opacity: 0;
    transform: translateY(0.1rem);
  }

  1% {
    width: max-content;
    opacity: 1;
    transform: translateY(0rem);
  }

  12% {
    width: max-content;
    opacity: 1;
    transform: translateY(0rem);
  }

  13% {
    width: 0ch;
    opacity: 0;
    transform: translateY(0.1rem);
  }

  100% {
    width: 0ch;
    opacity: 0;
    transform: translateY(0.1rem);
  }
}




.hero__poster {
  position: relative;
}

.hero__picture {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  margin-block: 4em;
}

.hero__picture__svg {
  display: block;
  width: 100%;
  height: auto;
}

.hero__quotes {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 10rem;
  padding-block: 5rem;
}

.hero .hero__quotes {
  display: none;
}

.hero__quotes__item {
  position: relative;
  padding: 2rem;
  background-color: var(--accent-color);
  width: 80%;
  transition: all 0.2s ease;
  animation: floating 10s linear infinite;
  animation-delay: calc(2s * sibling-index());
}

.hero__quotes__item--text {
  transition: all 0.2s ease;
}

.hero__quotes__item--text>.is-span-word {
  display: inline-flex;
  width: max-content;
}

.hero__quotes__item--text>span {
  display: inline-block;
  width: 1ch;
}

.hero__quotes__item--text .is-space {
  width: 1ch;
}

.hero__quotes__item--border {
  position: absolute;
  background-color: var(--color-text);
  z-index: 1;
  transition: all 0.2s ease;
}

.hero__quotes__item--border.is-horizontal {
  height: 1px;
  width: calc(100% + 1rem);
  left: 50%;
  transform: translateX(-50%);
}

.hero__quotes__item--border.is-vertical {
  width: 1px;
  height: calc(100% + 1rem);
  top: 50%;
  transform: translateY(-50%);
}

.hero__quotes__item--border.is-top {
  top: 0;
}

.hero__quotes__item--border.is-bottom {
  bottom: 0;
}

.hero__quotes__item--border.is-left {
  left: 0;
}

.hero__quotes__item--border.is-right {
  right: 0;

}

/* Grid mask */
.grid-mask .rect {
  fill: white;
  animation: unset;
}

.grid-mask rect {
  fill: black;
  animation: disappear-rect 3s linear infinite both;
  animation-range: 50% 100%;
  animation-delay: calc(0.1s * sibling-index());
}

.grid-mask rect:nth-child(2n) {
  animation-delay: calc(0.2s * sibling-index());
}

.grid-mask rect:nth-child(3n) {
  animation-delay: calc(0.3s * sibling-index());
}

.grid-mask rect:nth-child(4n) {
  animation-delay: calc(0.4s * sibling-index());
}

.grid-mask rect:nth-child(5n) {
  animation-delay: calc(0.5s * sibling-index());
}

/* Projects & Labs */
.projects,
.labs,
.demo-reel,
.about {
  margin-bottom: 8rem;
}

.projects__container,
.labs__container,
.demo-reel__container,
.about__container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.projects__title,
.labs__title,
.demo-reel__title,
.about__title {
  font-family: var(--font-pixel-square);
  font-weight: 100;
  font-size: clamp(3rem, 8vw, 6rem);
  margin-bottom: 3rem;
}

.projects__grid,
.labs__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem 2rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.card__badge {
  position: absolute;
  top: 0.1rem;
  left: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  max-width: calc(100% - 2rem);
  margin: 0;
  padding: 0.6rem 1rem;
  font-family: var(--font-pixel-square);
  font-size: 1.2rem;
  line-height: 1.2;
  color: var(--color-text);
  background-color: var(--accent-color);
  text-decoration: none;
  transition: none;
}

.card__badge:focus-visible {
  outline: 1px solid var(--accent-color);
  outline-offset: 2px;
  background-color: var(--color-text);
  color: var(--accent-color);
}

.card__badge__text {
  display: inline-flex;
}

.card__badge__text .is-space {
  width: 1ch;
}

.card__badge svg {
  width: auto;
  height: 1.6rem;
  flex-shrink: 0;
}

.card__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--color-text);
}

.card__media img {
  display: block;
  height: 100%;
  transition: transform 0.4s ease;
}

.card__info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
}

.card__title {
  font-size: 1.6rem;
  font-weight: 400;
  margin-bottom: 0;
}

.card__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem 1.5rem;
  flex-shrink: 0;
}

.card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.2rem 0.4rem;
  text-decoration: none;
  transition: none;
}

.card__link__text {
  display: inline-flex;
}

.card__link__text .is-space {
  width: 1ch;
}

.card__link svg {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.card__link:focus-visible,
.footer-nav a:focus-visible {
  outline: 1px solid var(--accent-color);
  outline-offset: 2px;
  background-color: var(--color-text);
  color: var(--accent-color);
}

.footer-nav a:focus-visible svg {
  color: var(--accent-color);
}

/* Demo reel */
.demo-reel__player {
  max-width: 1080px;
  margin-inline: auto;
}

.demo-reel__frame {
  aspect-ratio: 1280 / 800;
  overflow: hidden;
  border: 1px solid var(--color-text);
  background-color: var(--background-color);
}

.demo-reel__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.demo-reel__video:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: -2px;
}

.demo-reel__timeline {
  --progress: 0%;
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 1rem;
  margin-top: 1.2rem;
  background: linear-gradient(to right, var(--color-text) var(--progress), transparent var(--progress));
  border: 1px solid var(--color-text);
  cursor: pointer;
}

.demo-reel__timeline::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1rem;
  height: 1.8rem;
  background-color: var(--accent-color);
  border: 1px solid var(--color-text);
  border-radius: 0;
}

.demo-reel__timeline::-moz-range-thumb {
  width: 1rem;
  height: 1.8rem;
  background-color: var(--accent-color);
  border: 1px solid var(--color-text);
  border-radius: 0;
}

.demo-reel__timeline::-moz-range-track {
  background: transparent;
}

.demo-reel__timeline:focus-visible {
  outline: 1px solid var(--accent-color);
  outline-offset: 3px;
}

.demo-reel__info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.2rem;
}

.demo-reel__playback {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: start;
  gap: 0.5rem 1.5rem;
}

.demo-reel__time {
  font-family: var(--font-pixel-square);
  font-size: 1.6rem;
  width: max-content;
}

.demo-reel__options {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem 1.5rem;
}

.demo-reel__play {
  padding: 0.2rem 0rem;
}

.demo-reel__play,
.demo-reel__sound,
.demo-reel__fullscreen {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.demo-reel__play[data-playing="false"] .is-pause,
.demo-reel__play[data-playing="true"] .is-play,
.demo-reel__sound[aria-pressed="false"] .is-on,
.demo-reel__sound[aria-pressed="true"] .is-off,
.demo-reel__fullscreen[data-fullscreen="false"] .is-exit,
.demo-reel__fullscreen[data-fullscreen="true"] .is-enter {
  display: none;
}

.demo-reel__hint {
  margin-top: 1.2rem;
  font-size: 1.2rem;
  padding-left: 0.4rem;
  opacity: 0.6;
}

.demo-reel__player:fullscreen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: none;
  padding: 2rem;
  background-color: var(--background-color);
}

.demo-reel__player:fullscreen .demo-reel__frame {
  flex: 1;
  min-height: 0;
  aspect-ratio: auto;
  border: none;
}

.demo-reel__player:fullscreen .demo-reel__video {
  object-fit: contain;
}

.demo-reel__player:fullscreen .demo-reel__hint {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .demo-reel__hint {
    display: none;
  }
}

/* Footer */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding-block: 3rem;
}

.footer-title {
  font-size: clamp(1.2rem, 5vw, 4rem);
  font-family: var(--font-pixel-square);
}

.footer-nav {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: center;
}

.footer-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 5rem;
  width: 5rem;
  transition: unset;
}

.footer-nav a svg {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--color-text);
  image-rendering: pixelated;
}

.footer-legal {
  font-size: 1.2rem;
  opacity: 0.7;
}

.footer-legal:hover,
.footer-legal:focus-visible {
  opacity: 1;
}

.card__link.is-back svg {
  transform: scaleX(-1);
}

/* 404 */
.not-found {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  min-height: calc(100vh - 4rem);
  min-height: calc(100svh - 4rem);
  text-align: center;
}

.not-found__code {
  font-family: var(--font-pixel-square);
  font-weight: 100;
  font-size: clamp(10rem, 30vw, 28rem);
  line-height: 1;
}

.not-found__text {
  max-width: 40ch;
}

/* Legal */
.legal {
  max-width: 72ch;
  margin-inline: auto;
  padding-block: 2rem 6rem;
}

.legal__back {
  margin-bottom: 4rem;
}

.legal__title {
  font-family: var(--font-pixel-square);
  font-weight: 100;
  font-size: clamp(3rem, 8vw, 6rem);
  margin-bottom: 1rem;
}

.legal__updated {
  margin-bottom: 4rem;
  opacity: 0.6;
}

.legal h2 {
  font-family: var(--font-pixel-square);
  font-weight: 100;
  margin-top: 4rem;
  margin-bottom: 1.5rem;
}

.legal p,
.legal li {
  line-height: 1.6;
}

.legal p {
  margin-bottom: 1.5rem;
}

.legal ul {
  list-style: square;
  padding-left: 2rem;
}




/* Tablet */
@media (min-width: 768px) {
  .header-title {
    max-width: 50ch;
  }

  .header-nav {
    flex-direction: row;
    gap: 0.4rem;
  }

  .header-nav--divider {
    display: inline-block;
  }

  .hero__quotes {
    position: absolute;
    inset: 0;
  }

  .hero .hero__quotes {
    display: flex;
  }

  .hero__quotes__item {
    position: absolute;
    max-width: 300px;
    /* animation: floating 10s linear infinite; */
    animation-delay: calc(2s * sibling-index());
  }



  .hero__quotes__item:nth-child(1) {
    top: 7%;
    right: 10%;
  }

  .hero__quotes__item:nth-child(2) {
    top: 33%;
    left: 0%;
  }

  .hero__quotes__item:nth-child(3) {
    top: 89%;
    left: 51%;

  }

  .hero__quotes__item:nth-child(4) {
    top: -5%;
    left: 12%;
  }

  .hero__quotes__item:nth-child(5) {
    top: 70%;
    left: 6%;
  }

  .hero__quotes__item:nth-child(6) {
    top: 45%;
    right: 3%;
  }

  .about {
    display: none;
  }

  .projects__grid,
  .labs__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .demo-reel__playback {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
  }

  .footer {
    padding-block: 5rem;
    padding-bottom: 8rem;
  }

  .footer-nav {
    gap: 1.5rem;
  }

  .footer-nav a {
    height: 6rem;
    width: 6rem;
  }

  .footer-nav a svg {
    width: 3rem;
    height: 3rem;
  }

}

/* Desktop */
@media (min-width: 1200px) {
  .header-title {
    max-width: 57ch;
  }

  .hero__poster {
    margin-block: 16rem 4rem;
  }

  .hero__quotes__item {
    max-width: 360px;
  }

  .hero__quotes__item--text {
    font-size: 1.6rem;
  }

  .header-content {
    max-width: none;
  }

  .labs__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero,
  .projects,
  .labs,
  .demo-reel {
    margin-bottom: 16rem;
  }

  .footer-nav {
    gap: 3rem;
  }
}

/* Hover */
@media (hover: hover) and (pointer: fine) {
  .hero__quotes__item:hover .hero__quotes__item--text {
    scale: 0.9;
  }

  .hero__quotes__item:hover .hero__quotes__item--border.is-horizontal {
    width: calc(100% - 4rem);
  }

  .hero__quotes__item:hover .hero__quotes__item--border.is-vertical {
    height: calc(100% - 3rem);
  }

  .hero__quotes__item:hover .is-top {
    translate: 0 1.5rem;
  }

  .hero__quotes__item:hover .is-bottom {
    translate: 0 -1.5rem;
  }

  .hero__quotes__item:hover .is-left {
    translate: 2rem 0;
  }

  .hero__quotes__item:hover .is-right {
    translate: -2rem 0;
  }

  .hero__quotes__item:hover .is-span-word {
    background-color: var(--color-text);
    color: var(--accent-color);
  }

  .hero__quotes__item:hover .is-span-word>span {

    animation: type-lette-opacity 0.15s linear forwards;
    animation-delay: calc(0.1s + 0.02s * sibling-index());
  }

  .card__media:hover img {
    transform: scale(1.03);
  }

  .card:has(.card__media:hover) .card__badge,
  .card__badge:hover {
    background-color: var(--color-text);
    color: var(--accent-color);
  }

  .card__badge:hover .card__badge__text>span {
    animation: type-lette-opacity 0.2s linear forwards;
    animation-delay: calc(0.05s + 0.015s * sibling-index());
  }

  .card__link:hover {
    background-color: var(--color-text);
    color: var(--accent-color);
  }

  .demo-reel__timeline:hover {
    background: linear-gradient(to right, var(--accent-color) var(--progress), transparent var(--progress));
  }

  .demo-reel__play {
    padding: 0.2rem 0.4rem;
  }

  .header-title__link:hover {
    background-color: var(--color-text);
    color: var(--accent-color);
  }

  .header-title__link:hover .header-title__link__text>span {
    animation: type-lette-opacity 0.2s linear forwards;
    animation-delay: calc(0.05s + 0.02s * sibling-index());
  }

  .card__link:hover .card__link__text>span {
    animation: type-lette-opacity 0.2s linear forwards;
    animation-delay: calc(0.05s + 0.02s * sibling-index());
  }

  .footer-nav a:hover {
    background-color: var(--color-text);
  }

  .footer-nav a:hover svg {
    transform: scale(1.05);
    color: var(--accent-color);
  }
}

/* no hover */
@media (hover: none) and (pointer: coarse) {
  .hero__quotes__item .is-span-word {
    background-color: var(--color-text);
    color: var(--accent-color);
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}



@keyframes floating {
  0% {
    transform: translate(0, 0);
  }

  20% {
    transform: translate(8px, -10px);
  }

  40% {
    transform: translate(14px, -2px);
  }

  60% {
    transform: translate(6px, 9px);
  }

  80% {
    transform: translate(-6px, 6px);
  }

  100% {
    transform: translate(0, 0);
  }
}


@keyframes disappear-rect {

  /* from {
    fill: black;
  }

  to {
    fill: white;
  } */
  0% {
    fill: black;
  }

  33% {
    fill: white;
  }

  66% {
    fill: white;
  }

  100% {
    fill: black;
  }

}

@keyframes blink {
  0% {
    opacity: 0;
  }

  33% {
    opacity: 1;
  }

  66% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes underscore {

  0% {
    opacity: 1;
  }

  49% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }

  100% {
    opacity: 0;
  }
}

@keyframes type-lette-opacity {


  0% {
    /* width: 0ch; */
    opacity: 0;
  }

  1% {
    opacity: 1;
  }

  12% {
    opacity: 1;
  }

  13% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}