.elementor-11101 .elementor-element.elementor-element-b0dd4de{--display:flex;--flex-direction:column;--container-widget-width:100%;--container-widget-height:initial;--container-widget-flex-grow:0;--container-widget-align-self:initial;--flex-wrap-mobile:wrap;}:root{--page-title-display:none;}/* Start custom CSS for html, class: .elementor-element-cee9d66 */<script>
(() => {

  /* ========================================================
     CONFIGURACIÓN
     ======================================================== */

  const CONFIG = {

    /*
    FASE 1
    Entrada en espiral
    */

    introDuration: 1800,

    spiralTurns: 1.25,

    spiralRadiusDesktop: 210,
    spiralRadiusMobile: 120,


    /*
    COLUMNA MINI
    */

    miniWidthDesktop: 74,
    miniWidthMobile: 46,

    miniGapDesktop: 7,
    miniGapMobile: 5,


    /*
    GALERÍA GRANDE
    */

    largeWidthDesktop: 490,
    largeWidthMobile: 270,

    largeGapDesktop: 150,
    largeGapMobile: 90,


    /*
    IMPORTANTE:

    Esto crea el hueco blanco superior.

    0.58 = primera imagen empieza aproximadamente
    al 58% de la altura de pantalla.
    */

    galleryStartY: 0.58,


    /*
    FUERZA DE LA DEFORMACIÓN
    */

    waveStrength: 0.22,

    perspectiveStrength: 0.17,


    /*
    SUAVIDAD DEL SCROLL
    */

    lerp: 0.075

  };


  /* ========================================================
     PROYECTOS
     ======================================================== */

  const PROJECTS = [

    {
      image:
      "https://semicustom3.wearelaava.com/wp-content/uploads/2026/09/ChatGPT-Image-11-sept-2026-12_24_52.png",

      title:
      "NUDE LAB",

      location:
      "MADRID, 2026",

      category:
      "SKINCARE · BELLEZA",

      service:
      "DIRECCIÓN DE ARTE"
    },


    {
      image:
      "https://semicustom3.wearelaava.com/wp-content/uploads/2026/09/ChatGPT-Image-11-sept-2026-12_27_36.png",

      title:
      "LUMBRE",

      location:
      "MADRID, 2026",

      category:
      "VELAS · FRAGANCIAS",

      service:
      "FOTOGRAFÍA"
    },


    {
      image:
      "https://semicustom3.wearelaava.com/wp-content/uploads/2026/09/ChatGPT-Image-11-sept-2026-12_28_32.png",

      title:
      "ORRIS",

      location:
      "MADRID, 2026",

      category:
      "COSMÉTICA",

      service:
      "FOTOGRAFÍA"
    },


    {
      image:
      "https://semicustom3.wearelaava.com/wp-content/uploads/2026/09/ChatGPT-Image-2-abr-2026-00_56_12.png",

      title:
      "BALLET SEASON",

      location:
      "MADRID, 2026",

      category:
      "JOYERÍA · ACCESORIOS",

      service:
      "DIRECCIÓN CREATIVA"
    },


    {
      image:
      "https://semicustom3.wearelaava.com/wp-content/uploads/2026/09/ChatGPT-Image-14-jul-2026-15_13_02.png",

      title:
      "OLEA",

      location:
      "MADRID, 2026",

      category:
      "CUIDADO CORPORAL",

      service:
      "FOTOGRAFÍA"
    }

  ];



  /* ========================================================
     ELEMENTOS
     ======================================================== */

  const root =
    document.querySelector("#laava-bulbs");

  if (!root) return;


  const canvas =
    root.querySelector("#laava-bulbs-canvas");

  const ctx =
    canvas.getContext("2d");


  const info =
    root.querySelector(".lb-info");

  const title =
    root.querySelector(".lb-title");

  const location =
    root.querySelector(".lb-location");

  const category =
    root.querySelector(".lb-category");

  const service =
    root.querySelector(".lb-service");



  /* ========================================================
     VARIABLES
     ======================================================== */

  let W = 0;
  let H = 0;
  let DPR = 1;

  let images = [];

  let loaded = 0;

  let introStart = null;

  let introFinished = false;

  let scrollTarget = 0;
  let scrollCurrent = 0;

  let previousScroll = 0;
  let velocity = 0;

  let activeIndex = -1;



  /* ========================================================
     UTILIDADES
     ======================================================== */

  const clamp = (v, min, max) =>
    Math.max(min, Math.min(max, v));


  const lerp = (a, b, t) =>
    a + (b - a) * t;


  const easeOutCubic = t =>
    1 - Math.pow(1 - t, 3);


  const easeInOutCubic = t =>
    t < .5
      ? 4 * t * t * t
      : 1 - Math.pow(-2 * t + 2, 3) / 2;



  /* ========================================================
     RESPONSIVE
     ======================================================== */

  function isMobile() {
    return W <= 767;
  }


  function miniWidth() {

    return isMobile()
      ? CONFIG.miniWidthMobile
      : CONFIG.miniWidthDesktop;

  }


  function miniGap() {

    return isMobile()
      ? CONFIG.miniGapMobile
      : CONFIG.miniGapDesktop;

  }


  function largeWidth() {

    return isMobile()
      ? CONFIG.largeWidthMobile
      : CONFIG.largeWidthDesktop;

  }


  function largeGap() {

    return isMobile()
      ? CONFIG.largeGapMobile
      : CONFIG.largeGapDesktop;

  }



  /* ========================================================
     CANVAS SIZE
     ======================================================== */

  function resize() {

    W = window.innerWidth;
    H = window.innerHeight;

    DPR = Math.min(
      window.devicePixelRatio || 1,
      2
    );

    canvas.width =
      Math.round(W * DPR);

    canvas.height =
      Math.round(H * DPR);

    canvas.style.width =
      W + "px";

    canvas.style.height =
      H + "px";


    ctx.setTransform(
      DPR,
      0,
      0,
      DPR,
      0,
      0
    );

  }


  resize();

  window.addEventListener(
    "resize",
    resize
  );



  /* ========================================================
     CARGA DE IMÁGENES
     ======================================================== */

  PROJECTS.forEach((project, index) => {

    const img = new Image();

    img.crossOrigin = "anonymous";

    img.onload = () => {

      loaded++;

      images[index] = img;

      if (loaded === PROJECTS.length) {

        requestAnimationFrame(render);

      }

    };


    img.src = project.image;

  });



  /* ========================================================
     SCROLL
     ======================================================== */

  function updateScroll() {

    const rect =
      root.getBoundingClientRect();

    const total =
      root.offsetHeight - H;

    scrollTarget =
      clamp(
        -rect.top / Math.max(total, 1),
        0,
        1
      );

  }


  window.addEventListener(
    "scroll",
    updateScroll,
    {
      passive: true
    }
  );


  updateScroll();



  /* ========================================================
     ACTUALIZAR TEXTO
     ======================================================== */

  function updateInfo(index) {

    index =
      clamp(
        index,
        0,
        PROJECTS.length - 1
      );


    if (index === activeIndex)
      return;


    activeIndex = index;

    const p =
      PROJECTS[index];


    info.style.opacity = 0;


    setTimeout(() => {

      title.textContent =
        p.title;

      location.textContent =
        p.location;

      category.textContent =
        p.category;

      service.textContent =
        p.service;


      info.style.opacity = 1;

    }, 130);

  }



  /* ========================================================
     DRAW IMAGE NORMAL
     ======================================================== */

  function drawImageNormal(
    img,
    cx,
    cy,
    width,
    rotation = 0,
    alpha = 1
  ) {

    if (!img) return;


    const ratio =
      img.height / img.width;

    const height =
      width * ratio;


    ctx.save();

    ctx.globalAlpha =
      alpha;

    ctx.translate(
      cx,
      cy
    );

    ctx.rotate(rotation);


    ctx.drawImage(
      img,
      -width / 2,
      -height / 2,
      width,
      height
    );


    ctx.restore();

  }



  /* ========================================================
     IMAGEN DEFORMADA
     ========================================================

     Dividimos la imagen en pequeñas franjas.

     Cada franja recibe:
     - escala diferente
     - desplazamiento X
     - deformación según posición

     Esto crea la sensación de onda / perspectiva.
     ======================================================== */

  function drawWarpedImage(
    img,
    cx,
    cy,
    width,
    strength
  ) {

    if (!img) return;


    const ratio =
      img.height / img.width;

    const height =
      width * ratio;


    const slices =
      isMobile() ? 45 : 70;


    const sourceSlice =
      img.height / slices;

    const destSlice =
      height / slices;


    for (
      let i = 0;
      i < slices;
      i++
    ) {

      const normalized =
        i / (slices - 1);


      /*
      -1 arriba
       0 centro
       1 abajo
      */

      const vertical =
        normalized * 2 - 1;


      /*
      Curva central.
      */

      const curve =
        Math.sin(
          normalized * Math.PI
        );


      /*
      La anchura cambia ligeramente.
      */

      const perspective =
        1 -
        Math.abs(vertical) *
        CONFIG.perspectiveStrength *
        strength;


      const sliceWidth =
        width * perspective;


      /*
      Movimiento lateral ondulado.
      */

      const waveX =
        Math.sin(
          normalized * Math.PI * 2
        ) *
        width *
        0.045 *
        strength;


      /*
      Ligero arqueado vertical.
      */

      const bow =
        curve *
        width *
        CONFIG.waveStrength *
        strength;


      const dy =
        cy
        - height / 2
        + i * destSlice
        - bow * 0.18;


      ctx.drawImage(

        img,

        0,
        i * sourceSlice,

        img.width,
        sourceSlice + 1,

        cx
        - sliceWidth / 2
        + waveX,

        dy,

        sliceWidth,
        destSlice + 1

      );

    }

  }



  /* ========================================================
     FASE INTRO — ESPIRAL
     ======================================================== */

  function drawIntro(progress) {

    const centerX =
      W / 2;

    const centerY =
      H / 2;


    const radius =
      isMobile()
        ? CONFIG.spiralRadiusMobile
        : CONFIG.spiralRadiusDesktop;


    const finalWidth =
      miniWidth();


    PROJECTS.forEach(
      (project, i) => {

        const img =
          images[i];

        if (!img)
          return;


        /*
        Cada imagen tiene un pequeño delay.
        */

        const delay =
          i * 0.055;


        const local =
          clamp(
            (progress - delay) /
            (1 - delay),
            0,
            1
          );


        const eased =
          easeOutCubic(local);


        /*
        Espiral.
        */

        const startAngle =
          i *
          (Math.PI * 2 / PROJECTS.length);


        const angle =
          startAngle
          +
          (1 - eased)
          *
          Math.PI
          * 2
          * CONFIG.spiralTurns;


        const r =
          radius *
          (1 - eased);


        const spiralX =
          centerX
          +
          Math.cos(angle) * r;


        const spiralY =
          centerY
          +
          Math.sin(angle) * r;


        /*
        Posición final de columna.
        */

        const ratio =
          img.height / img.width;

        const h =
          finalWidth * ratio;


        let totalHeight = 0;


        for (
          let j = 0;
          j < PROJECTS.length;
          j++
        ) {

          const im =
            images[j];

          if (!im)
            continue;


          totalHeight +=
            finalWidth *
            (im.height / im.width);


          if (
            j < PROJECTS.length - 1
          ) {

            totalHeight +=
              miniGap();

          }

        }


        let finalY =
          centerY
          - totalHeight / 2;


        for (
          let j = 0;
          j < i;
          j++
        ) {

          const previous =
            images[j];

          finalY +=
            finalWidth *
            (
              previous.height /
              previous.width
            )
            +
            miniGap();

        }


        finalY +=
          h / 2;


        const x =
          lerp(
            spiralX,
            centerX,
            eased
          );


        const y =
          lerp(
            spiralY,
            finalY,
            eased
          );


        /*
        Giro desaparece al llegar.
        */

        const rotation =
          (1 - eased)
          *
          Math.sin(i * 2.3)
          *
          1.4;


        const width =
          lerp(
            finalWidth * .55,
            finalWidth,
            eased
          );


        drawImageNormal(
          img,
          x,
          y,
          width,
          rotation,
          local
        );

      }
    );

  }



  /* ========================================================
     GALERÍA
     ======================================================== */

  function drawGallery(progress) {

    /*
    El principio del scroll sigue mostrando
    la columna pequeña.

    Luego crece.
    */

    const growEnd =
      0.15;


    const galleryProgress =
      clamp(
        progress / growEnd,
        0,
        1
      );


    const grow =
      easeInOutCubic(
        galleryProgress
      );


    const smallW =
      miniWidth();


    const bigW =
      largeWidth();


    const currentWidth =
      lerp(
        smallW,
        bigW,
        grow
      );


    /*
    Separación también crece.
    */

    const gap =
      lerp(
        miniGap(),
        largeGap(),
        grow
      );


    /*
    Durante crecimiento:
    centro.

    Después:
    empieza más abajo para dejar
    hueco blanco.
    */

    const startY =
      lerp(
        H / 2,
        H * CONFIG.galleryStartY,
        grow
      );


    /*
    Una vez termina el crecimiento
    empieza el desplazamiento vertical.
    */

    const travelProgress =
      clamp(
        (progress - growEnd) /
        (1 - growEnd),
        0,
        1
      );


    /*
    Calculamos altura media.
    */

    let averageHeight = 0;


    images.forEach(img => {

      averageHeight +=
        bigW *
        (
          img.height /
          img.width
        );

    });


    averageHeight /=
      images.length;


    const itemDistance =
      averageHeight
      +
      largeGap();


    /*
    Cuánto recorremos.
    */

    const totalTravel =
      itemDistance *
      (PROJECTS.length - 1);


    const travel =
      travelProgress *
      totalTravel;


    /*
    Proyecto activo según
    la posición de la galería.
    */

    const rawIndex =
      travel /
      itemDistance;


    const currentIndex =
      clamp(
        Math.round(rawIndex),
        0,
        PROJECTS.length - 1
      );


    if (grow > .92) {

      updateInfo(
        currentIndex
      );

    } else {

      info.style.opacity = 0;

    }



    /* ======================================================
       DIBUJAR
       ====================================================== */

    let cursorY =
      startY - travel;


    PROJECTS.forEach(
      (project, i) => {

        const img =
          images[i];

        if (!img)
          return;


        const ratio =
          img.height /
          img.width;


        const height =
          currentWidth *
          ratio;


        const cy =
          cursorY
          +
          height / 2;


        /*
        Distancia al centro de pantalla.

        Cuanto más cerca esté del texto,
        más deformamos.
        */

        const distance =
          Math.abs(
            cy - H / 2
          );


        const influence =
          1 -
          clamp(
            distance /
            (H * .62),
            0,
            1
          );


        /*
        Además usamos velocidad de scroll.
        */

        const velocityBoost =
          clamp(
            Math.abs(velocity) * 8,
            0,
            1
          );


        const warp =
          clamp(
            influence *
            (
              .35 +
              velocityBoost
            ),
            0,
            1
          );


        /*
        Durante fase mini:
        normal.

        Cuando ya es grande:
        deformada.
        */

        if (
          grow < .55
        ) {

          drawImageNormal(
            img,
            W / 2,
            cy,
            currentWidth
          );

        } else {

          drawWarpedImage(
            img,
            W / 2,
            cy,
            currentWidth,
            warp
          );

        }


        cursorY +=
          height + gap;

      }
    );

  }



  /* ========================================================
     RENDER
     ======================================================== */

  function render(time) {

    if (!introStart)
      introStart = time;


    ctx.clearRect(
      0,
      0,
      W,
      H
    );


    /* ======================================================
       INTRO
       ====================================================== */

    if (!introFinished) {

      const elapsed =
        time - introStart;


      const progress =
        clamp(
          elapsed /
          CONFIG.introDuration,
          0,
          1
        );


      drawIntro(progress);


      if (progress >= 1) {

        introFinished = true;

      }


      requestAnimationFrame(render);

      return;

    }



    /* ======================================================
       SCROLL SUAVE
       ====================================================== */

    scrollCurrent =
      lerp(
        scrollCurrent,
        scrollTarget,
        CONFIG.lerp
      );


    velocity =
      scrollCurrent
      -
      previousScroll;


    previousScroll =
      scrollCurrent;



    /* ======================================================
       GALERÍA
       ====================================================== */

    drawGallery(
      scrollCurrent
    );


    requestAnimationFrame(render);

  }

})();
</script>/* End custom CSS */
/* Start custom CSS for container, class: .elementor-element-b0dd4de *//* =========================================================
   LAÄVA — SPIRAL / VERTICAL PORTFOLIO
   ========================================================= */

#laava-bulbs {
    position: relative;
    width: 100%;
    background: transparent;
}


/* =========================================================
   ESCENARIO FIJO
   ========================================================= */

#laava-bulbs .lb-stage {
    position: fixed;
    inset: 0;

    width: 100vw;
    height: 100vh;

    overflow: hidden;

    z-index: 20;

    pointer-events: none;

    perspective: 1000px;
}


/* =========================================================
   GALERÍA
   ========================================================= */

#laava-bulbs .lb-gallery {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    /*
    IMPORTANTE:
    LAS FOTOS POR DETRÁS DEL TEXTO
    */
    z-index: 2;
}


/* =========================================================
   IMÁGENES
   ========================================================= */

#laava-bulbs .lb-item {
    position: absolute;

    left: 50%;
    top: 0;

    width: 72px;

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

    transform-origin:
        center center;

    /*
    Solo transform + opacity: son las únicas propiedades
    que se animan por JS ahora (width/left/top se fijan
    una vez). Pedirle al navegador que prepare capas para
    width/left/top de más solo gasta memoria sin necesidad.
    */
    will-change:
        transform,
        opacity;

    /*
    Evita renderizar la cara trasera de la imagen durante
    los giros rotateY/rotateZ del efecto tornillo.
    */
    backface-visibility: hidden;

    pointer-events: none;
}


#laava-bulbs .lb-item img {
    display: block;

    width: 100%;
    height: auto;

    margin: 0;
    padding: 0;

    object-fit: contain;

    pointer-events: none;
    user-select: none;

    -webkit-user-drag: none;
}


/* =========================================================
   TEXTO

   AHORA ESTÁ POR ENCIMA DE LAS FOTOS
   ========================================================= */

#laava-bulbs .lb-info {
    position: absolute;

    left: 50%;
    top: 45%;

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

    width: min(620px, 78vw);

    display: grid;

    grid-template-columns:
        1fr
        1.35fr
        1fr;

    column-gap: 32px;

    align-items: start;

    color: #000;

    opacity: 0;

    z-index: 50;

    pointer-events: none;
}


#laava-bulbs .lb-info,
#laava-bulbs .lb-info * {
    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 14px;

    line-height: 1.05;

    font-weight: 400;

    text-transform: uppercase;
}


#laava-bulbs .lb-info-left,
#laava-bulbs .lb-meta,
#laava-bulbs .lb-service {
    text-align: left;
}


/* =========================================================
   SCROLL
   ========================================================= */

#laava-bulbs .lb-scroll-space {
    position: relative;

    width: 100%;

    height: 650vh;
}


/* =========================================================
   MÓVIL
   ========================================================= */

@media (max-width: 767px) {

    #laava-bulbs .lb-item {
        width: 48px;
    }


    #laava-bulbs .lb-info {
        top: 43%;

        width: 84vw;

        grid-template-columns:
            1fr
            1fr;

        column-gap: 16px;

        row-gap: 4px;
    }


    #laava-bulbs .lb-service {
        grid-column: 2;
    }


    #laava-bulbs .lb-info,
    #laava-bulbs .lb-info * {
        font-size: 10px;
    }


    #laava-bulbs .lb-scroll-space {
        height: 600vh;
    }

}/* End custom CSS */