/* =========================================================
   REFERENZEN SCRAPBOOK
========================================================= */

.ref-scrapbook {
  position: relative;
  min-height: 850vh;
  overflow: clip;
  color: #ffffff;

  background:
    radial-gradient(
      circle at 18% 18%,
      rgba(224, 32, 38, 0.24),
      transparent 31%
    ),
    radial-gradient(
      circle at 82% 72%,
      rgba(255, 255, 255, 0.08),
      transparent 30%
    ),
    linear-gradient(
      145deg,
      #151515 0%,
      #050505 52%,
      #381013 100%
    );
}

.ref-scrapbook::before {
  content: "";
  position: absolute;
  inset: 0;

  background-image:
    linear-gradient(
      rgba(255, 255, 255, 0.045) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.045) 1px,
      transparent 1px
    );

  background-size: 42px 42px;
  opacity: 0.75;
  pointer-events: none;
}

.ref-scrapbook__sticky {
  position: sticky;
  top: 0;

  width: 100%;
  height: 100vh;
  height: 100svh;

  overflow: hidden;
  perspective: 1400px;
}

.ref-scrapbook__backword {
  position: absolute;
  left: 50%;
  top: 50%;

  color: rgba(255, 255, 255, 0.035);

  font-size: clamp(85px, 17vw, 310px);
  font-weight: 900;
  line-height: 0.8;
  letter-spacing: -0.09em;
  white-space: nowrap;

  transform:
    translate(-50%, -50%)
    translateX(
      calc(var(--ref-progress, 0) * -12vw)
    )
    scale(
      calc(1 + var(--ref-progress, 0) * 0.24)
    );

  pointer-events: none;
}

.ref-scrapbook__heading {
  position: absolute;
  left: 6vw;
  top: clamp(145px, 17vh, 190px);
  z-index: 50;

  width: min(52vw, 760px);

  opacity:
    calc(
      1 -
      clamp(
        (var(--ref-progress, 0) - 0.33) * 5,
        0,
        1
      )
    );

  transform:
    translateY(
      calc(var(--ref-progress, 0) * -22vh)
    );
}

.ref-scrapbook__heading > span {
  display: block;
  margin-bottom: 18px;

  color: #e02026;

  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.ref-scrapbook__heading h1 {
  margin: 0;

  font-size: clamp(52px, 9vw, 145px);
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: -0.075em;

  text-shadow:
    0 0 24px rgba(255, 255, 255, 0.12),
    0 0 55px rgba(224, 32, 38, 0.18);
}

.ref-scrapbook__heading p {
  width: min(460px, 92%);
  margin: 25px 0 0;

  color: rgba(255, 255, 255, 0.7);

  font-size: clamp(16px, 1.6vw, 22px);
  line-height: 1.5;
}

.ref-scrapbook__table {
  position: absolute;
  inset: -6vh 0 8vh;

  transform:
    rotateX(
      calc(
        1deg -
        var(--ref-progress, 0) * 2deg
      )
    )
    scale(
      calc(
        0.96 +
        var(--ref-progress, 0) * 0.06
      )
    );

  transform-origin: center;
}


/* =========================================================
   BEWEGTE ELEMENTE
========================================================= */

.ref-piece {
  position: absolute;

  left: var(--x);
  top: calc(var(--y) + 180px);

  z-index: 20;

  opacity: var(--piece-visible, 0);

  transform:
    translateX(
      calc(
        (1 - var(--piece-enter, 0))
        * var(--enter-x, 30vw)

        + var(--piece-enter, 0)
        * var(--settle-x, 0vw)

        + var(--piece-exit, 0)
        * var(--exit-x, 0vw)
      )
    )

    translateY(
      calc(
        (1 - var(--piece-enter, 0))
        * var(--enter-y, 70vh)

        + var(--piece-enter, 0)
        * var(--settle-y, 0vh)

        + var(--piece-exit, 0)
        * var(--exit-y, 100vh)
      )
    )

    rotate(
      calc(
        var(--rotation)

        + (1 - var(--piece-enter, 0))
        * var(--enter-rotation, 20deg)

        + var(--piece-exit, 0)
        * var(--exit-rotation, -15deg)
      )
    )

    scale(
      calc(
        0.72
        + var(--piece-enter, 0) * 0.28
        - var(--piece-exit, 0) * 0.12
      )
    );

  will-change: transform, opacity;
}


/* =========================================================
   FOTOS
========================================================= */

.ref-photo {
  width: clamp(210px, 23vw, 360px);

  padding:
    clamp(9px, 1vw, 14px)
    clamp(9px, 1vw, 14px)
    clamp(48px, 5vw, 70px);

  color: #141414;
  background: #f3f0e8;

  border-radius: 3px;

  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.55),
    0 5px 14px rgba(0, 0, 0, 0.28);
}

.ref-photo__image {
  position: relative;

  width: 100%;
  aspect-ratio: 4 / 3;

  overflow: hidden;

  background:
    linear-gradient(
      135deg,
      #2b2b2b,
      #76171b
    );
}

.ref-photo__image::before {
  content: "REFERENZFOTO";

  position: absolute;
  inset: 0;

  display: grid;
  place-items: center;

  color: rgba(255, 255, 255, 0.55);

  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.ref-photo__image img {
  position: relative;
  z-index: 2;

  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;

  filter:
    saturate(0.9)
    contrast(1.05);
}

.ref-photo__caption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
    z-index: 3;
}

.ref-photo__caption strong {
  display: block;

  margin-bottom: 3px;

  color: #171717;

  font-family: Georgia, serif;
  font-size: clamp(18px, 2vw, 25px);
  font-weight: 500;
}

.ref-photo__caption span {
  color: rgba(20, 20, 20, 0.65);

  font-size: 11px;
  letter-spacing: 0.05em;
}


/* =========================================================
   KLEBEBAND UND KLAMMER
========================================================= */

.ref-tape {
  position: absolute;
  z-index: 12;

  width: 90px;
  height: 27px;

  background:
    linear-gradient(
      90deg,
      rgba(185, 185, 185, 0.72),
      rgba(245, 245, 245, 0.88),
      rgba(160, 160, 160, 0.72)
    );

  opacity: 0.78;

  box-shadow:
    inset 0 0 5px rgba(255, 255, 255, 0.5);

  pointer-events: none;
}

.ref-tape--top {
  left: 50%;
  top: -11px;

  transform:
    translateX(-50%)
    rotate(-2deg);
}

.ref-tape--corner {
  right: -22px;
  top: 18px;

  transform: rotate(44deg);
}

.ref-paperclip {
  position: absolute;
  right: 15px;
  top: -16px;
  z-index: 12;

  width: 20px;
  height: 62px;

  border: 3px solid rgba(170, 170, 170, 0.95);
  border-radius: 12px;

  transform: rotate(7deg);
}

.ref-paperclip::after {
  content: "";

  position: absolute;
  left: 4px;
  top: 7px;

  width: 7px;
  height: 40px;

  border: 2px solid rgba(125, 125, 125, 0.9);
  border-radius: 8px;
}


/* =========================================================
   NOTIZZETTEL
========================================================= */

.ref-note {
  width: clamp(230px, 27vw, 390px);

  padding: clamp(26px, 3vw, 42px);

  color: #181818;

  background:
    repeating-linear-gradient(
      180deg,
      transparent 0 30px,
      rgba(30, 30, 30, 0.12) 30px 31px
    ),
    #ded9c8;

  box-shadow:
    0 30px 75px rgba(0, 0, 0, 0.48);

  clip-path:
    polygon(
      1% 2%,
      99% 0,
      97% 96%,
      70% 99%,
      40% 97%,
      2% 100%
    );
}

.ref-note small {
  display: block;
  margin-bottom: 18px;

  color: #a0181d;

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.ref-note p {
  margin: 0;

  font-family: Georgia, serif;
  font-size: clamp(17px, 1.8vw, 24px);
  line-height: 1.5;
}

.ref-note__signature {
  display: block;

  margin-top: 22px;

  text-align: right;

  font-family: Georgia, serif;
  font-size: 14px;
  font-style: italic;
}

.ref-pin {
  position: absolute;
  left: 50%;
  top: 9px;

  width: 16px;
  height: 16px;

  border-radius: 50%;

  background:
    radial-gradient(
      circle at 32% 28%,
      white,
      #e02026 30%,
      #65090d 78%
    );

  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.5);

  transform: translateX(-50%);
}


/* =========================================================
   MATERIALKARTE
========================================================= */

.ref-material-card {
  width: clamp(245px, 29vw, 430px);

  padding: clamp(28px, 3vw, 46px);

  color: #ffffff;

  border: 1px solid rgba(224, 32, 38, 0.7);

  background:
    linear-gradient(
      145deg,
      rgba(35, 35, 35, 0.97),
      rgba(8, 8, 8, 0.98)
    );

  box-shadow:
    0 35px 90px rgba(0, 0, 0, 0.55);
}

.ref-material-card small {
  display: block;
  margin-bottom: 22px;

  color: #e02026;

  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.ref-material-card h2 {
  margin: 0;

  font-family: Georgia, serif;
  font-size: clamp(29px, 3.4vw, 50px);
  font-weight: 500;
  line-height: 0.98;
}

.ref-material-card p {
  margin: 22px 0 0;

  color: rgba(255, 255, 255, 0.68);

  font-size: 14px;
  line-height: 1.55;
}


/* =========================================================
   PROJEKTBERICHT
========================================================= */

.ref-report {
  width: clamp(290px, 34vw, 500px);

  padding: clamp(20px, 2.3vw, 34px);

  color: #1c1b18;

  background:
    linear-gradient(
      rgba(255, 255, 255, 0.08),
      rgba(0, 0, 0, 0.04)
    ),
    #d8d2c3;

  box-shadow:
    0 35px 90px rgba(0, 0, 0, 0.58);
}

.ref-report__head {
  padding-bottom: 9px;

  border-bottom: 3px double #28251d;

  text-align: center;

  font-family: Georgia, serif;
  font-size: clamp(21px, 2.8vw, 38px);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.ref-report__meta {
  margin: 8px 0 16px;

  text-align: center;

  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.ref-report h2 {
  margin: 0 0 18px;

  font-family: Georgia, serif;
  font-size: clamp(28px, 3.5vw, 51px);
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.ref-report__content {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 15px;
}

.ref-report__content p {
  margin: 0;

  font-family: Georgia, serif;
  font-size: 12px;
  line-height: 1.45;
}

.ref-report__image {
  position: relative;

  min-height: 150px;
  overflow: hidden;

  background:
    linear-gradient(
      135deg,
      #252525,
      #8d2025
    );
}

.ref-report__image::before {
  content: "REFERENZFOTO";

  position: absolute;
  inset: 0;

  display: grid;
  place-items: center;

  color: rgba(255, 255, 255, 0.6);

  font-size: 9px;
  letter-spacing: 0.14em;
}

.ref-report__image img {
  position: relative;
  z-index: 2;

  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;

  filter:
    grayscale(0.3)
    contrast(1.08);
}


/* =========================================================
   AUFTRAGSZETTEL
========================================================= */

.ref-order {
  width: clamp(200px, 21vw, 295px);

  padding: 28px 23px 38px;

  color: #242424;

  background:
    repeating-linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.025) 0 2px,
      transparent 2px 5px
    ),
    #ece9df;

  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.52);

  clip-path:
    polygon(
      0 0,
      100% 0,
      100% 96%,
      94% 100%,
      88% 96%,
      81% 100%,
      74% 96%,
      67% 100%,
      60% 96%,
      53% 100%,
      46% 96%,
      39% 100%,
      32% 96%,
      25% 100%,
      18% 96%,
      11% 100%,
      5% 96%,
      0 100%
    );

  font-family: monospace;
}

.ref-order__logo {
  margin-bottom: 23px;
  padding-bottom: 13px;

  border-bottom: 2px dashed rgba(35, 35, 35, 0.48);

  text-align: center;

  font-family: Arial, sans-serif;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.ref-order__line {
  display: flex;
  justify-content: space-between;
  gap: 15px;

  margin-bottom: 12px;

  font-size: 11px;
}

.ref-order__line span:last-child {
  text-align: right;
  font-weight: 700;
}

.ref-order__total {
  margin-top: 22px;
  padding-top: 15px;

  border-top: 2px dashed rgba(35, 35, 35, 0.48);

  color: #a0181d;

  text-align: center;
  font-weight: 800;
}


/* =========================================================
   ZITAT
========================================================= */

.ref-quote {
  width: clamp(280px, 37vw, 570px);

  padding:
    clamp(26px, 3vw, 48px)
    clamp(30px, 4vw, 60px);

  color: white;

  border: 1px solid rgba(224, 32, 38, 0.58);

  background:
    rgba(18, 18, 18, 0.88);

  box-shadow:
    0 35px 95px rgba(0, 0, 0, 0.62);

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ref-quote p {
  position: relative;
  z-index: 2;

  margin: 0;

  font-family: Georgia, serif;
  font-size: clamp(24px, 3vw, 43px);
  line-height: 1.16;
}

.ref-quote__mark {
  position: absolute;
  right: 20px;
  top: -44px;

  color: rgba(224, 32, 38, 0.28);

  font-family: Georgia, serif;
  font-size: 150px;
}


/* =========================================================
   WERKZEUGE
========================================================= */

.ref-tool {
  width: clamp(110px, 15vw, 240px);
  pointer-events: none;
  transform-origin: center;
}

.ref-tool img {
  display: block;

  width: 100%;
  height: auto;

  object-fit: contain;

  filter:
    drop-shadow(
      0 20px 18px rgba(0, 0, 0, 0.45)
    );
}

.ref-tool--measure {
  width: clamp(150px, 20vw, 320px);
}

.ref-tool--shears {
  width: clamp(125px, 17vw, 270px);
}

.ref-tool--hammer {
  width: clamp(110px, 14vw, 220px);
}


/* =========================================================
   BAUPLAN
========================================================= */

.ref-blueprint {
  width: clamp(260px, 31vw, 470px);
  padding: clamp(24px, 3vw, 40px);

  color: rgba(255, 255, 255, 0.92);

  border: 1px solid rgba(255, 255, 255, 0.28);

  background:
    linear-gradient(
      rgba(255, 255, 255, 0.09) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.09) 1px,
      transparent 1px
    ),
    #1d2931;

  background-size: 24px 24px;

  box-shadow:
    0 35px 90px rgba(0, 0, 0, 0.56);
}

.ref-blueprint__label {
  margin-bottom: 20px;

  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.ref-blueprint__drawing {
  position: relative;

  height: 160px;

  border-bottom: 3px solid rgba(255, 255, 255, 0.85);
  border-left: 3px solid rgba(255, 255, 255, 0.85);
}

.ref-blueprint__roof {
  position: absolute;
  left: 15%;
  top: 35px;

  width: 70%;
  height: 3px;

  background: white;

  transform: rotate(-23deg);
  transform-origin: left;
}

.ref-blueprint__wall {
  position: absolute;
  right: 21%;
  top: 72px;

  width: 3px;
  height: 88px;

  background: white;
}

.ref-blueprint__line {
  position: absolute;
  left: 12%;

  height: 1px;

  background: rgba(255, 255, 255, 0.48);
}

.ref-blueprint__line--one {
  top: 84px;
  width: 65%;
}

.ref-blueprint__line--two {
  top: 106px;
  width: 52%;
}

.ref-blueprint__line--three {
  top: 128px;
  width: 73%;
}

.ref-blueprint p {
  margin: 18px 0 0;

  font-family: monospace;
  font-size: 12px;
  line-height: 1.5;
}


/* =========================================================
   FORTSCHRITTSANZEIGE
========================================================= */

.ref-scrapbook__progress {
  position: absolute;
  right: 3vw;
  top: 20vh;
  z-index: 60;

  width: 3px;
  height: 62vh;

  overflow: hidden;

  background: rgba(255, 255, 255, 0.12);
}

.ref-scrapbook__progress span {
  display: block;

  width: 100%;
  height: 100%;

  background:
    linear-gradient(
      180deg,
      #e02026,
      rgba(224, 32, 38, 0.14)
    );

  transform:
    translateY(
      calc(
        -100% +
        var(--ref-progress, 0) * 100%
      )
    );
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 800px) {

  .ref-scrapbook {
    min-height: 720svh;
  }

  .ref-scrapbook__heading {
    left: 7vw;
    top: 140px;

    width: 86vw;
  }

  .ref-scrapbook__heading h1 {
    font-size: clamp(46px, 15vw, 82px);
  }

  .ref-scrapbook__heading p {
    font-size: 15px;
  }

  .ref-scrapbook__table {
    transform:
      scale(
        calc(
          0.9 +
          var(--ref-progress, 0) * 0.05
        )
      );
  }

  .ref-photo {
    width: min(62vw, 290px);
  }

  .ref-note {
    width: min(68vw, 315px);
  }

  .ref-report {
    width: min(88vw, 420px);
  }

  .ref-material-card {
    width: min(76vw, 360px);
  }

  .ref-quote {
    width: min(84vw, 400px);
  }

  .ref-blueprint {
    width: min(86vw, 410px);
  }

  .ref-photo--one {
    --x: 4vw !important;
    --y: 25vh !important;
  }

  .ref-note--one {
    --x: 35vw !important;
    --y: 45vh !important;
  }

  .ref-photo--two {
    --x: 10vw !important;
    --y: 50vh !important;
  }

  .ref-material-card {
    --x: 5vw !important;
    --y: 20vh !important;
  }

  .ref-report {
    --x: 3vw !important;
    --y: 16vh !important;
  }

  .ref-photo--three {
    --x: 39vw !important;
    --y: 31vh !important;
  }

  .ref-order {
    --x: 8vw !important;
    --y: 39vh !important;
  }

  .ref-photo--four {
    --x: 30vw !important;
    --y: 48vh !important;
  }

  .ref-quote {
    --x: 7vw !important;
    --y: 47vh !important;
  }

  .ref-blueprint {
    --x: 4vw !important;
    --y: 22vh !important;
  }

  .ref-tool--measure {
    --x: 55vw !important;
    --y: 17vh !important;
  }

  .ref-tool--shears {
    --x: 58vw !important;
    --y: 58vh !important;
  }

  .ref-tool--hammer {
    --x: 65vw !important;
    --y: 20vh !important;
  }
}

@media (max-width: 380px) {

  .ref-scrapbook__heading {
    top: 125px;
  }

  .ref-scrapbook__heading h1 {
    font-size: 14vw;
  }

  .ref-photo {
    width: 68vw;
  }

  .ref-note {
    width: 73vw;
  }

  .ref-order {
    width: 62vw;
  }

  .ref-scrapbook__progress {
    right: 12px;
  }
}

.ref-scrapbook__table {
    position: absolute;
    top: -10vh;
    left: 0;
    right: 0;
    bottom: -25vh;
}

.ref-scrapbook__table {
    position: absolute;
    inset: -10vh 0 -10vh;
}

.ref-photo--six {
  --x: 6vw !important;
  --y: 31vh !important;
}

.ref-photo--seven {
  --x: 34vw !important;
  --y: 47vh !important;
}

.ref-photo--eight {
  --x: 5vw !important;
  --y: 52vh !important;
}

.ref-photo--nine {
  --x: 38vw !important;
  --y: 27vh !important;
}

.ref-photo--ten {
  --x: 9vw !important;
  --y: 43vh !important;
}