/* ==========================================
   JUAN FARACO — PORTFOLIO PROTOTYPE
   ========================================== */

#jf-lab {
  --bg: #f4f4f0;
  --fg: #111;
  
  position: relative;
  width: 100%;
  min-height: 190vh;
  background: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
}


/* ------------------------------------------
   UI
   ------------------------------------------ */

#jf-lab .jf-ui {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;

  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  padding: 18px 20px;

  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.02em;
}


/* ------------------------------------------
   LOADER
   ------------------------------------------ */

#jf-lab .jf-loader {
  position: fixed;
  inset: 0;
  z-index: 2000;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--bg);

  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

#jf-lab .jf-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#jf-lab .jf-loader-grid {
  width: 22px;
  height: 22px;

  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;

  gap: 1px;
}

#jf-lab .jf-loader-grid i {
  display: block;
  background: transparent;
  border: 1px solid currentColor;

  transition:
    background 0.12s ease;
}

#jf-lab .jf-loader-grid i.active {
  background: currentColor;
}


/* ------------------------------------------
   STAGE
   ------------------------------------------ */

#jf-lab .jf-stage {
  position: fixed;
  inset: 0;

  width: 100%;
  height: 100vh;

  overflow: visible;
}


/* ------------------------------------------
   PROJECTS
   ------------------------------------------ */

#jf-lab .jf-project {
  position: absolute;

  left: 0;
  top: 50%;

  width: 30vw;
  height: 38vw;

  max-width: 520px;
  max-height: 620px;

  transform-origin: center center;

  cursor: none;

  will-change:
    transform;
}


/* Number */

#jf-lab .jf-number {
  position: absolute;

  left: 50%;
  top: 50%;

  transform:
    translate(-50%, -50%);

  z-index: 4;

  font-size: clamp(
    24px,
    3vw,
    54px
  );

  line-height: 1;

  transition:
    opacity 0.15s linear;
}


/* Canvas */

#jf-lab canvas {
  position: absolute;

  left: 0;
  top: 0;

  width: 100%;
  height: 100%;

  opacity: 0;

  pointer-events: none;
}


/* Metadata */

#jf-lab .jf-meta {
  position: absolute;

  left: 0;
  top: calc(100% + 8px);

  width: 100%;

  display: flex;
  justify-content: space-between;

  font-size: 10px;
  line-height: 1;

  opacity: 0;

  transition:
    opacity 0.25s ease;

  pointer-events: none;
}

#jf-lab .jf-project.is-hovered .jf-meta {
  opacity: 1;
}


/* ------------------------------------------
   CUSTOM CURSOR
   ------------------------------------------ */

#jf-lab .jf-cursor {
  position: fixed;

  left: 0;
  top: 0;

  width: 14px;
  height: 14px;

  margin-left: -7px;
  margin-top: -7px;

  z-index: 3000;

  pointer-events: none;

  mix-blend-mode: difference;

  will-change: transform;
}

#jf-lab .jf-cursor::before,
#jf-lab .jf-cursor::after {
  content: "";

  position: absolute;

  left: 50%;
  top: 50%;

  background: white;

  transform: translate(-50%, -50%);
}

#jf-lab .jf-cursor::before {
  width: 14px;
  height: 1px;
}

#jf-lab .jf-cursor::after {
  width: 1px;
  height: 14px;
}


/* ------------------------------------------
   HOVER
   ------------------------------------------ */

#jf-lab .jf-project.is-hovered {
  z-index: 20;
}

#jf-lab .jf-project.is-hovered canvas {
  filter: none;
}


/* ------------------------------------------
   MOBILE
   ------------------------------------------ */

@media (max-width: 700px) {

  #jf-lab {
    min-height: 170vh;
  }

  #jf-lab .jf-ui {
    padding: 14px;
    font-size: 11px;
  }

  #jf-lab .jf-project {
    width: 58vw;
    height: 72vw;
  }

  #jf-lab .jf-number {
    font-size: 28px;
  }

  #jf-lab .jf-cursor {
    display: none;
  }

  #jf-lab .jf-meta {
    font-size: 9px;
  }

}