/* ============================= */
/*         GENERAL STUFF         */
/* ============================= */

/* ============================= */
/* ========= variables ========= */

:root {
  --global-padding: 0.5rem;
  --dark: #161616;
  --light: #eaeaea;
  --global-borders: 1px;
  --global-animations: 400ms;
}

/* ============================= */
/* ========= fontfaces ========= */

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

@font-face {
  font-family: "apfel";
  src: url("../fonts/ApfelGrotezk-Mittel.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: "apfel";
  src: url("../fonts/ApfelGrotezk-Fett.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: "apfel";
  src: url("../fonts/ApfelGrotezk-Satt.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
}

/* ============================= */
/* ========= keyframes ========= */

@keyframes greyOut {
  0% {
    filter: grayscale(0);
  }
  100% {
    filter: grayscale(1);
  }
}

@keyframes recolor {
  0% {
    filter: grayscale(1);
  }
  100% {
    filter: grayscale(0);
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0%;
  }
  50% {
    opacity: 100%;
  }
  100% {
    opacity: 100%;
  }
}

@keyframes fadeInLater {
  0% {
    opacity: 0%;
  }
  50% {
    opacity: 0%;
  }
  100% {
    opacity: 100%;
  }
}

@keyframes fadeOut {
  0% {
    opacity: 100%;
  }
  100% {
    opacity: 0%;
  }
}

/* ================================= */
/* ========= generic stuff ========= */

* {
  transition: all var(--global-animations);
}

/* @media (prefers-color-scheme: dark) { */
/* body {
  --color-1: var(--dark);
  --color-2: var(--light);
} */
/* } */

/* @media (prefers-color-scheme: light) { */
body {
  --color-1: var(--light);
  --color-2: var(--dark);
}
/* } */

@media (pointer: coarse) {
  #cursor {
    display: none;
  }
  a,
  button {
    background-size: 0 0 !important;
  }
  a:hover,
  a:active,
  button:hover,
  button:active {
    outline: 0;
    background-position: 0 0;
    background-size: 0 0 !important;
  }
}

button {
  padding: 0;
  border: none;
  background-color: transparent;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: var(--color-2);
  /* transition: all 300ms; */
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
}

a,
a:focus,
a:active,
a:visited,
a:focus,
button {
  text-decoration: none;
  color: var(--color-2);
  cursor: pointer;
}

a:hover,
a:active,
button:hover,
button:active {
  outline: 0;
  /* background-position: 100% 100%;
  background-size: 100% 0.085em; */
  color: var(--color-1);
  background-color: var(--color-2);
}

a,
button {
  display: inline-block;
  padding-bottom: -1rem;
  background-image: linear-gradient(var(--color-2), var(--color-2));
  background-position: 0 100%;
  background-size: 0% 0.085em;
  background-repeat: no-repeat;
  transition: background-size var(--global-animations), background-position 0ms var(--global-animations);
}

a::before,
button::before,
a::after,
button::after {
  background: var(--color-1);
  color: var(--color-2);
  /* background-position: 0 0 !important; */
}

a:hover::before,
button:hover::before,
a:hover::after,
button:hover::after {
  background: var(--color-2);
  color: var(--color-1);
}

html,
body {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--color-1);
  font-size: 100%;
  color: var(--color-2);
  overflow-x: hidden;
  overflow-y: hidden;
}

.hidden {
  display: none !important;
}

::selection {
  background-color: var(--color-2);
}

main {
  padding: 0 var(--global-padding);
}

@media screen and (max-width: 40rem) {
  .hide-small {
    display: none !important;
    visibility: hidden !important;
  }
}

/* ===================================== */
/* ========= basic font styles ========= */

html,
body {
  font-family: "apfel";
  line-height: 1;
}

/* ============================== */
/* ========= typography ========= */

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.375rem;
}

.ignore-width {
  position: absolute;
  margin-left: -1em;
}

/* ============================= */
/*             HEADER            */
/* ============================= */

header {
  --color-1: var(--dark);
  --color-2: white !important;
  position: fixed;
  width: calc(100% - (var(--global-padding) * 2));
  height: 1rem;
  top: 0;
  z-index: 10;
  font-size: 100%;
  font-weight: 600;
  color: var(--color-2);
  mix-blend-mode: difference;
  white-space: nowrap;
  padding: var(--global-padding);
}

/* ============================ */
/* ========= main nav ========= */

.main-navigation {
  display: flex;
  justify-content: space-between;
}

.main-navigation ul {
  display: flex;
  flex-direction: row;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu {
  flex-grow: 0.5;
}

header .menu li {
  margin: 0 var(--global-padding);
  padding: 0;
}

header .menu li:first-of-type {
  margin-left: 0;
}

header .menu li:last-of-type {
  margin-right: 0;
}

.main-navigation ul:first-of-type {
  justify-content: start;
}

.main-navigation ul:last-of-type {
  justify-content: end;
}

#main-about-toggle.active {
  background-color: var(--color-2);
  color: var(--color-1);
}

/* ============================= */
/*             CURSOR            */
/* ============================= */

#cursor {
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background-color: white;
  mix-blend-mode: difference;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: all 0s, width 300ms, height 300ms;
}

#cursor.active {
  width: 3rem;
  height: 3rem;
  box-shadow: 0 30px 40px rgba(0, 0, 0, 0.1);
}

/* ============================= */
/*          WORK SECTION         */
/* ============================= */

/* ============================= */
/* ========= container ========= */

.work-container {
  width: 100%;
  height: 100svh;
  overflow: scroll;
  /* scroll-snap-type: y proximity; */
  /* scroll-snap-stop: always; */
  scroll-padding: calc(1rem + var(--global-padding));
  padding-top: calc(1rem + var(--global-padding));
}

/* ========================= */
/* ========= cells ========= */

.work-cell {
  border-bottom: var(--global-borders) solid var(--color-2);
  background-color: var(--color-1);
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: var(--global-padding);
  padding: var(--global-padding) 0;
  scroll-snap-align: start;
}

/* ============================== */
/* ========= work media ========= */

.work-media {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
}

.work-media .work-img:first-child,
.work-media.scroll .work-img:first-child {
  opacity: 1;
}

.work-media .work-img {
  grid-column-start: 1;
  grid-row-start: 1;
  max-width: 100%;
  height: auto;
  max-height: 80svh;
}

@media all and (max-width: 40rem) {
  .work-media .work-img {
    max-height: 50svh;
  }
}

.work-media.scroll .work-img {
  transition: 100ms linear all;
  opacity: 0;
}

.work-media.scroll .work-img.inactive {
  opacity: 0;
}

.work-media.scroll .work-img.active {
  opacity: 1;
}

.work-media {
  filter: none;
}

.work-media.loaded {
  opacity: 1;
}

.insideofviewport,
.work-media:first-of-type {
  filter: grayscale(0);
  animation: recolor 300ms;
  opacity: 1;
}

.outsideofviewport {
  filter: grayscale(1);
  animation: greyOut 300ms;
  opacity: 0.25;
}

.work-img.cover {
  object-fit: cover;
}

.work-img.contain {
  object-fit: contain;
}

/* ======================================= */
/* ========= work media — videos ========= */

.work-media.vid {
  height: auto;
  text-align: center;
  width: 100%;
}

.work-media video {
  max-width: 100%;
  min-width: 0;
  max-height: 80svh;
  object-fit: contain;
  display: block;
}

.plyr {
  max-height: 80svh;
  width: 100%;
  align-self: center;
}

.plyr {
  --plyr-color-main: var(--light);
  --plyr-video-control-color: var(--light);
  --plyr-video-control-color-hover: var(--dark);
  --plyr-menu-background: var(--light);
  --plyr-menu-color: var(--dark);
  --plyr-font-size-small: 0.8rem;
  --plyr-control-icon-size: 1rem;
  --plyr-control-spacing: 0.5rem;
}

.plyr__menu {
  display: none;
}

.plyr__control--overlaid,
.plyr__control--overlaid:hover {
  background-color: var(--light) !important;
  color: var(--dark) !important;
}

.plyr__video-embed iframe {
  pointer-events: none !important;
  top: -50%;
  height: 200%;
}

/* videos from bunny.net */

/* .bunny div {
  padding: 0 !important;
  max-height: 65svh !important;
  aspect-ratio: 16 / 9 !important;
  left: 50%;
  transform: translateX(-50%);
}

.bunny iframe {
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  left: 0;
} */

/* ===================================== */
/* ========= work media multi =========  */

.work-media-multi {
  display: flex;
  justify-content: center;
  width: calc(100% - (var(--global-padding) * 2));
  /* background-color: var(--color-2); */
  /* padding: var(--global-padding); */
  padding-bottom: var(--global-padding);
  gap: var(--global-padding);
}

.work-media-multi .work-media {
  padding: 0;
}

@media all and (max-width: 40rem) {
  .work-media-multi {
    flex-direction: column;
  }
  .work-media-multi > .work-media {
    width: auto;
    justify-items: center;
  }
}

@media all and (min-width: 40rem) {
  .work-media-multi {
    flex-direction: row;
    /* gap: var(--global-padding); */
  }
  .work-media-multi > .work-media {
    width: fit-content;
  }
  .work-media-multi > .work-media:first-of-type {
    justify-items: end;
  }
  .work-media-multi > .work-media:last-of-type {
    justify-items: start;
  }
}

/* ============================= */
/* ========= work info ========= */

@media all and (max-width: 40rem) {
  .work-info {
    grid-template-columns: auto;
    grid-auto-rows: min-content;
    gap: calc(var(--global-padding) * 2);
  }
}

@media all and (min-width: 40rem) {
  .work-info {
    grid-template-columns: auto;
    grid-auto-rows: min-content;
    gap: calc(var(--global-padding) * 2);
  }
}

@media all and (min-width: 64rem) {
  .work-info {
    grid-template-columns: 1fr minmax(7%, auto);
    gap: calc(var(--global-padding) * 4);
  }
}

.work-info {
  display: grid;
  width: 100%;
  padding: 0;
}

.work-info-title * {
  white-space: nowrap;
}

.work-info-title h1,
.work-info-title h2 {
  margin: 0;
  font-size: 100%;
}

.work-info h2 {
  font-weight: 400;
}

.work-info-short-description {
  margin: 0;
  width: auto;
}

.work-actions {
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: start;
  padding: 0;
  list-style: none;
}

.work-actions * {
  white-space: nowrap;
  display: flex;
}

.work-actions a::before {
  content: "\2197\00A0";
}

.work-overview-toggle::before {
  content: "\002B\00A0";
}

.work-overview-toggle.active::before {
  content: "\2212\00A0";
}

.work-overview-toggle.active,
.work-overview-toggle.active::before {
  background-color: var(--color-2);
  color: var(--color-1);
}

/* ===================================== */
/* =========== work overview =========== */

@media all and (max-width: 40rem) {
  .work-overview {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media all and (min-width: 40rem) {
  .work-overview {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media all and (min-width: 64rem) {
  .work-overview {
    grid-template-columns: repeat(6, 1fr);
  }
}

.work-overview {
  display: grid;
  opacity: 0;
  gap: calc(var(--global-padding) / 2);
  width: 100%;
  height: fit-content;
  transition: max-height 300ms;
  grid-auto-rows: 1fr;
  max-height: 0px;
  /* overflow: hidden; */
}

.work-overview .work-overview-nav {
  display: none;
}

.work-overview.focus {
  display: grid;
  position: fixed;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  top: 0;
  left: 0;
  width: calc(100% - (var(--global-padding) * 0));
  height: calc(100% - (var(--global-padding) * 0));
  z-index: 20;
  background-color: var(--color-1);
  align-items: center;
  justify-items: center;
}

.work-overview.focus .work-overview-nav {
  display: grid;
}

.work-overview-nav {
  position: absolute;
  z-index: 21;
  width: calc(100% - (var(--global-padding) * 2));
  height: calc(100% - (var(--global-padding) * 2));
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  padding: var(--global-padding);
}

.work-overview-nav * {
  width: fit-content;
  height: fit-content;
}

.work-overview-nav-close {
  grid-column: 1;
  grid-row: 1;
}

.work-overview-nav-prev {
  align-self: self-end;
  justify-self: start;
  grid-column: 1;
  grid-row: 2;
}

.work-overview-nav-next {
  align-self: self-end;
  justify-self: end;
  grid-column: 3;
  grid-row: 2;
}

.work-overview-nav-counter {
  grid-column: 2;
  grid-row: 2;
  align-self: self-end;
  justify-self: center;
}

.work-overview.focus > .work-img.inactive {
  opacity: 0;
}

.work-overview.focus > .work-img.active {
  opacity: 1;
}

.work-overview.focus > .work-img {
  max-height: 80svh;
  max-width: 100%;
  object-fit: contain;
  grid-column: 1;
  grid-row: 1;
  position: absolute;
  background-color: transparent;
  transition: none;
}

.work-overview .work-img {
  width: /*calc(100% - (var(--global-padding) * 4))*/ 100%;
  aspect-ratio: 3/2;
  /* object-fit: cover; */
  /* background-color: var(--color-2); */
  /* padding: calc(var(--global-padding) * 2); */
}

.work-overview.active {
  opacity: 1;
  max-height: 100svh;
}

.work-overview.focus .work-overview-focus-preoverlay {
  display: block;
  position: fixed;
  z-index: 22;
  width: 100%;
  height: 100%;
  background-color: var(--color-1);
  pointer-events: none;
  transition: opacity var(--global-animations);
}

.work-overview.focus .work-overview-focus-preoverlay.visible {
  opacity: 1;
}

.work-overview.focus .work-overview-focus-preoverlay.hidden {
  opacity: 0;
}

.work-overview.active .work-img {
  cursor: pointer;
}

/* ===================================== */
/* ========= work custom stuff ========= */

#inerzia .work-img {
  max-height: 65svh;
}

@media all and (max-width: 40rem) {
  .work-cell#inerzia .work-vid {
    max-height: 50svh;
  }
  .work-cell#inerzia .work-media.vid {
    padding: 0 calc(var(--global-padding) * 2);
  }
}

#brujeria .work-media {
  background: black;
  height: 65svh;
}

#brujeria .work-media img {
  object-fit: cover;
  max-height: 65svh;
  height: 100%;
}

#ermalmeta-buonafortuna .work-media {
  background-image: url("../img/work/ermalmeta-buonafortuna/ermalmeta-buonafortuna_background.jpg");
  background-size: cover;
  max-height: 65svh;
}

#ermalmeta-buonafortuna .work-media img {
  padding: calc(var(--global-padding) * 3);
  max-height: calc(65svh - (var(--global-padding) * 6));
}

/* ============================= */
/*         ABOUT SECTION         */
/* ============================= */

section#about {
  font-weight: 600;
  font-size: 2rem;
  display: flex;
  visibility: hidden;
  position: fixed;
  flex-direction: column;
  z-index: 9;
  align-items: start;
  justify-content: center;
  height: 100svh;
  max-height: 100svh;
  /* overflow-y: scroll; */
  overflow: auto;
  width: 100%;
  top: 0;
  left: var(--global-padding);
  background-color: var(--color-1);
}

section#about,
section#about * {
  transition: visibility 0s;
}

section#about.active {
  visibility: visible;
}

#about-close-btn-wrapper {
  font-size: 1rem;
}

#about-text,
#about-close-btn-wrapper {
  width: min(calc(100dvw - (var(--global-padding) * 2)), calc(600px - (var(--global-padding) * 2)));
}

#about-text em {
  font-style: normal;
  font-weight: 800;
}

/* ============================= */
/*            FOOTER             */
/* ============================= */

footer {
  padding: var(--global-padding);
  text-align: center;
  margin: var(--global-padding);
  margin-bottom: 2rem;
  /* border-top: var(--global-borders) solid var(--color-2); */
}

footer > p {
  margin: 0;
  font-size: 75%;
}

/* ============================= */
/*         WORK LIST NAV         */
/* ============================= */

/* main {
  display: flex;
  flex-direction: row;
  height: 100dvh;
  overflow: hidden;
} */

/* .work-container {
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-snap-align: start;
} */

/* #work-list-nav {
  width: 33%;
} */

/* #work-list-nav ul {
  list-style: none;
  padding: 0;
  width: 100%;
  gap: var(--global-padding);
  display: flex;
  flex-direction: column;
}

#work-list-nav li {
  width: 100%;
}

#work-list-nav li a {
  width: 100%;
} */

.work-overview {
  max-height: 99999px !important;
  opacity: 1 !important;
}

/* ============================= */
/*        ARCHIVED CODE          */
/* ============================= */

/*.work-tags {
  padding: 0;
  font-size: 75%;
  list-style: none;
  margin: 0;
  margin-top: calc(var(--global-padding) * 0.75);
  opacity: 0.5;
  width: 100%;
}

.work-tags > li {
  display: inline-block;
  width: fit-content;
}

.work-tags > li::after {
  content: "\002C";
}

.work-tags > li:last-of-type::after {
  content: "";
}*/
