/* variables */

:root {
  --text-base: clamp(1rem, 0.7955rem + 0.9091vw, 1.5rem);
  --square-size: clamp(6rem, 3.3846rem + 9.8462vw, 12rem);
  --square-padding: clamp(1rem, 0.7821rem + 0.8205vw, 1.5rem);
  --modal-padding: clamp(1.5rem, -0.4615rem + 7.3846vw, 6rem);
  --modal-padding: clamp(1.5rem, 0.8462rem + 2.4615vw, 3rem);
  --gap: 2.5vw;
}

/* font */

@font-face {
  font-family: "Graphik";
  src: url("../fonts/Graphik-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Graphik";
  src: url("../fonts/Graphik-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* text select */

::selection {
  background-color: #ffffff;
  color: #000000;
}

::-moz-selection {
  background-color: #ffffff;
  color: #000000;
}

/* reset */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* panzoom */

body,
html {
  position: fixed;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  cursor: move;
}

/* elements */

body {
  font-family: "Graphik", sans-serif;
  font-size: var(--text-base);
  line-height: 1.4;
  text-wrap: balance;
  color: #fff;
  background-color: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: #fff;
}

button {
  font-family: "Graphik", sans-serif;
  font-size: var(--text-base);
}

button:hover {
  cursor: pointer;
}

/* loader */

.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  z-index: 20;
  cursor: auto;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
}

.logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--square-size);
  height: var(--square-size);
  padding: var(--square-padding);
  overflow: hidden;
}

.logo-text {
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.1;
  color: #000;
}

.logo-background {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  z-index: -1;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
}

/* header */

.header-logo {
  position: fixed;
  top: var(--page-padding);
  left: var(--page-padding);
  display: flex;
  align-items: center;
  height: var(--logo-height);
  text-decoration: none;
  padding-right: 20px;
  padding-left: 20px;
  color: #000;
  background-color: #fff;
  color: #000;
  z-index: 10;
}

@media (hover: hover) {
  .header-logo:hover {
    background-color: #000;
    color: #fff;
  }
}

/* grid */

#scene {
  width: 5120px;
  transform: translateZ(0);
  transition: opacity 300ms;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols, 1), 1fr);
  grid-auto-flow: dense;
}

.grid-item {
  display: flex;
  padding: clamp(51.2px, 2.18rem + 5.09vw, 96px);
  /* overflow: hidden; */
  max-width: 100%;
}

.grid-item.aspect-1\/1 {
  aspect-ratio: 1 / 1;
  grid-row: span 1;
  grid-column: span 1;
}

.grid-item.aspect-2\/1 {
  aspect-ratio: 2 / 1;
  grid-row: span 1;
  grid-column: span 2;
}

.grid-item.aspect-1\/2 {
  aspect-ratio: 1 / 2;
  grid-row: span 2;
  grid-column: span 1;
}

.grid-item.aspect-2\/2 {
  aspect-ratio: 1 / 1;
  grid-row: span 2;
  grid-column: span 2;
}

.grid-item.border {
  border: 1px solid red;
}

.wrapper {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  /*background-color: #eaeaea;*/
  /*border: 1px solid blue;*/
}

.wrapper img,
.wrapper video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
  transition: clip-path 750ms;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

#scene.hide .grid-item img,
#scene.hide .grid-item video {
  clip-path: polygon(0% 100%, 100% 100%, 100% 100%, 0% 100%);
}

.wrapper span {
  position: absolute;
  margin-top: 16px;
  padding-right: 4px;
  padding-left: 4px;
  background-color: #000;
  clip-path: polygon(0% 100%, 100% 100%, 100% 100%, 0% 100%);
  transition: clip-path 300ms;
}

@media (hover: hover) and (pointer: fine) {
  .wrapper img:hover + span,
  .wrapper video:hover + span {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
  }
}

/* follower */

.cursor-follower {
  display: none;
  position: fixed;
  padding: 8px;
  font-size: 12px;
  line-height: 1;
  color: #000;
  background-color: #fff;
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
  z-index: 9999;
  transition: clip-path 300ms;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .cursor-follower {
    display: block;
  }
}

.cursor-follower.hide {
  clip-path: polygon(0% 100%, 100% 100%, 100% 100%, 0% 100%);
}
