/*Returns a CSS clamp function which resolves to $size-at-min-width when page width is
below $min-width,
$size-at-max-width when page width is above $max-width,
and linearly scales between the two between $min-width and $max-width*/
@layer organisms {
  .stage {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap-l);
    overflow: hidden;
    background: var(--shade-grey-070);
    container-type: inline-size;
    max-width: 2560px;
    margin-inline: auto;
    --stage-inset: max(var(--padding-s), calc((100cqw - var(--pageHeaderFooter-width)) / 2));
  }
  @media (min-width: 992px) {
    .stage {
      grid-template-columns: minmax(0, 50%) minmax(0, 50%);
      align-items: stretch;
      min-height: 820px;
    }
  }
  @media (min-width: 992px) {
    .stage.-startpage:not(.-maskLeft) {
      min-height: 1080px;
    }
  }
  @media (min-width: 992px) {
    .stage:not(.-maskRight):not(.-split) {
      grid-template-columns: 1fr;
    }
    .stage:not(.-maskRight):not(.-split) .stage__media {
      position: absolute;
      inset: 0;
      z-index: 1;
    }
    .stage:not(.-maskRight):not(.-split) .stage__img {
      height: 100%;
      object-fit: cover;
    }
  }
  .stage.-maskLeft {
    --stage-hex-size: clamp(885px, 231.9047619048px + 1.6746031746 * 100vw, 1518px);
    --stage-hex-x: clamp(242.8px, 54.3px + 0.4833333333 * 100vw, 425.5px);
    --stage-hex-y: clamp(-172px, calc(522.9px - 0.9048 * 100vw), 170px);
    --stage-hex-turn: 50deg;
    min-height: clamp(844px, 658.2857142857px + 0.4761904762 * 100vw, 1024px);
  }
  @media (min-width: 768px) {
    .stage.-maskLeft {
      --stage-hex-size: 1518px;
      --stage-hex-x: 55.4cqw;
      --stage-hex-y: -172px;
      min-height: 1024px;
    }
  }
  @media (max-width: 1199.98px) {
    .stage.-maskLeft.-noText {
      --stage-hex-y: calc(
        clamp(-172px, calc(522.9px - 0.9048 * 100vw), 170px) - 178px +
          clamp(0px, calc((100vw - 768px) * 0.116), 50px)
      );
    }
  }
  @media (min-width: 1200px) {
    .stage.-maskLeft {
      --stage-hex-size: max(95rem, calc(var(--stage-inset) + 80rem));
      --stage-hex-x: min(calc(var(--stage-inset) + 5rem), calc(var(--stage-inset) / 2 + 12.5rem));
      --stage-hex-y: 44%;
      --stage-hex-turn: 15deg;
      --stage-hex-corner: calc(var(--stage-hex-x) + 0.4835 * var(--stage-hex-size));
      min-height: 820px;
    }
  }
  @media (min-width: 1200px) {
    .stage.-maskLeft.-startpage {
      min-height: 1080px;
    }
  }
  .stage.-maskLeft .stage__maskGlass {
    position: absolute;
    top: var(--stage-hex-y);
    left: var(--stage-hex-x);
    z-index: -1;
    --stage-hex-width: max(var(--stage-hex-size), var(--stage-hex-min, 0px));
    width: var(--stage-hex-width);
    height: calc(var(--stage-hex-width) * 1061 / 1197);
    transform: translate(-50%, -50%) rotate(var(--stage-hex-turn));
    mask: url("../../Images/SVG-Icons/hexagon.svg") 0 0/100% 100% no-repeat alpha;
  }
  .stage.-maskLeft .stage__maskGlass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(100px);
  }
  .stage.-maskLeft .stage__maskGlass::after {
    content: "";
    position: absolute;
    inset: 0;
    background: conic-gradient(from 90deg, #ececed 0deg, #ececed 2deg, #fff 48deg, #fff 108deg, #ececed 142deg, #fff 173deg, #fff 243deg, #ececed 360deg);
    mask-image: url("../../Images/SVG-Icons/hexagon.svg"), url("../../Images/SVG-Icons/hexagon.svg");
    mask-repeat: no-repeat, no-repeat;
    mask-mode: alpha, alpha;
    mask-position: 0 0, 50% 50%;
    mask-size: 100% 100%, calc(100% - 4px) calc(100% - 4px);
    mask-composite: exclude;
  }
  .stage.-maskLeft.-hexOpaque .stage__maskGlass {
    background: var(--shade-grey-070);
    backdrop-filter: none;
  }
  .stage.-maskLeft .stage__content {
    justify-content: flex-start;
    align-items: center;
    padding-block: var(--section-padding-default);
    padding-inline: max(var(--grid-padding), (100cqw - clamp(32.4rem, 70cqw, 43rem)) / 2);
    max-inline-size: none;
  }
  @media (min-width: 1200px) {
    .stage.-maskLeft .stage__content {
      justify-content: center;
      align-items: flex-start;
      padding-left: var(--stage-inset);
      padding-right: 0;
      max-inline-size: calc(var(--stage-inset) + 43rem);
    }
  }
  .stage.-maskLeft .stage__content :is(h1, h2, h3, h4, h5, h6, .subline),
  .stage.-maskLeft .stage__content .stage__text p {
    text-align: center;
  }
  @media (min-width: 1200px) {
    .stage.-maskLeft .stage__content :is(h1, h2, h3, h4, h5, h6, .subline),
    .stage.-maskLeft .stage__content .stage__text p {
      text-align: left;
    }
  }
  .stage.-maskLeft .stage__actions {
    align-items: center;
  }
  @media (min-width: 768px) {
    .stage.-maskLeft .stage__actions {
      flex-direction: row;
      justify-content: center;
    }
  }
  @media (min-width: 1200px) {
    .stage.-maskLeft .stage__actions {
      align-items: stretch;
      justify-content: flex-start;
    }
  }
  .stage.-maskLeft .stage__media {
    position: absolute;
    inset: 0;
    z-index: 1;
  }
  .stage.-maskLeft .stage__media .stage__img {
    height: 100%;
    object-fit: cover;
  }
  .stage.-maskRight .stage__img {
    mask-image: url("../../Images/vector-stage-mask-right-mobile.svg");
    mask-repeat: no-repeat;
    mask-mode: alpha;
    mask-position: 50% 0%;
  }
  @media (min-width: 992px) {
    .stage.-maskRight .stage__img {
      mask-image: url("../../Images/vector-stage-mask-right.svg");
      mask-position: 0;
    }
  }
  .stage.-split .stage__media:not(.-secondary) .stage__img {
    mask-image: url("../../Images/vector-stage-mask_small.svg");
    mask-repeat: no-repeat;
    mask-mode: alpha;
    mask-size: 580px;
    mask-position: 100% 100%;
  }
  .stage.-split .stage__media.-secondary .stage__img {
    mask-image: url("../../Images/vector-stage-mask_small-left.svg");
    mask-repeat: no-repeat;
    mask-mode: alpha;
    mask-size: 580px;
    mask-position: 0% 0%;
  }
  @media (min-width: 992px) {
    .stage.-split {
      grid-template-columns: minmax(0, 32%) minmax(0, 36%) minmax(0, 32%);
      min-height: 820px;
    }
    .stage.-split .stage__content {
      order: 2;
      max-width: none;
      align-items: center;
      padding-inline: var(--padding-l);
    }
    .stage.-split .stage__content :is(h1, h2, h3, h4, h5, h6, .subline) {
      text-align: center;
    }
    .stage.-split .stage__media.-secondary {
      order: 1;
      z-index: 10;
      height: 100%;
    }
    .stage.-split .stage__media:not(.-secondary) {
      order: 3;
    }
  }
  @media (min-width: 992px) {
    .stage.-overflow {
      height: 820px;
      overflow: visible;
      margin-bottom: 140px;
    }
    .stage.-overflow.-startpage {
      height: 1080px;
    }
    .stage.-overflow .stage__img {
      height: calc(100% + 110px);
    }
  }
  @media (min-width: 992px) {
    .stage.-overflow.-maskRight .stage__img {
      mask-image: url("../../Images/vector-stage-mask.svg");
      max-height: 1210px;
    }
  }
  @media (min-width: 992px) {
    .stage.-overflow.-split {
      height: 820px;
      margin-bottom: 100px;
    }
    .stage.-overflow.-split .stage__media:not(.-secondary) .stage__img {
      height: calc(100% + 80px);
      mask-image: url("../../Images/vector-stage-mask_small.svg");
      mask-size: contain;
      mask-position: 0% 100%;
      max-height: 900px;
    }
    .stage.-overflow.-split .stage__media.-secondary .stage__img {
      height: 100%;
    }
  }
  .stage__content {
    position: relative;
    z-index: 10;
    order: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--padding-l) var(--stage-inset) 0;
  }
  @media (min-width: 992px) {
    .stage__content {
      justify-content: center;
      align-items: flex-start;
      padding-top: var(--section-padding-default);
      padding-bottom: var(--section-padding-default);
      padding-left: var(--stage-inset);
      padding-right: 0;
      max-inline-size: calc(var(--stage-inset) + 43rem);
    }
  }
  .stage__content > header {
    display: flex;
    flex-direction: column;
    gap: var(--text-gap-kicker);
    margin-bottom: 0;
  }
  .stage__content > header:has(.stage__headImg) {
    gap: calc(var(--gap-s) + var(--gap-xs));
  }
  .stage__content > header .subline {
    order: -1;
  }
  .stage__content > header :is(h1, h2, h3, h4, h5, h6) {
    margin-bottom: 0;
  }
  .stage__content > header .stage__headImg img {
    display: block;
    width: 30rem;
    max-width: 100%;
    height: auto;
  }
  .stage__content > :is(header, .stage__text) + .stage__text {
    margin-top: var(--text-gap-h1);
  }
  .stage__content > :is(header, .stage__text) + .stage__actions {
    margin-top: var(--button-gap-default);
  }
  .stage__content .stage__text {
    color: var(--body-text-color);
    font-size: var(--font-size-l);
    font-weight: var(--font-weight-default);
    line-height: 1.5;
  }
  .stage__content .stage__text p {
    margin: 0;
  }
  .stage__content .stage__text p + p {
    margin-top: 1lh;
  }
  .stage__content :is(h1, h2, h3, h4, h5, h6, .subline),
  .stage__content .stage__text p {
    text-align: center;
  }
  @media (min-width: 992px) {
    .stage__content :is(h1, h2, h3, h4, h5, h6, .subline),
    .stage__content .stage__text p {
      text-align: left;
    }
  }
  .stage__media {
    position: relative;
    order: 2;
  }
  @media (min-width: 992px) {
    .stage__media {
      z-index: 10;
      height: 100%;
    }
  }
  .stage__img {
    display: block;
    width: 100%;
    height: auto;
    object-position: center bottom;
  }
  @media (min-width: 992px) {
    .stage__img {
      height: 100%;
      object-fit: cover;
    }
  }
  .stage__video {
    display: none;
  }
  @media (min-width: 1200px) {
    .stage__media.-hasVideo {
      position: absolute;
      inset: 0;
      z-index: 1;
      overflow: hidden;
    }
    .stage__media.-hasVideo picture,
    .stage__media.-hasVideo .stage__img.-defaultImg {
      display: none;
    }
  }
  .stage__video {
    position: absolute;
    right: 0;
    max-width: none;
    object-fit: cover;
    pointer-events: none;
    transform-origin: 0 0;
  }
  @media (min-width: 1200px) {
    .stage__video {
      display: block;
      --video-box-left: calc(var(--stage-inset) + var(--padding-l) + 5.625rem);
      right: auto;
      left: var(--video-box-left);
      top: 0;
      width: calc(100% - var(--video-box-left));
      height: 100%;
      object-position: 100% 50%;
    }
    .stage__video.-mirror {
      transform: scaleX(-1);
    }
    .-hasFocus > .stage__video {
      object-fit: none;
      object-position: clamp(100cqw - var(--video-box-left) - 1920px, var(--stage-hex-corner, 0px) - var(--video-focus-x) - var(--video-box-left), 0px) 50%;
    }
  }
  .stage__actions {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    gap: var(--button-gap-xs);
  }
  .stage__actions > :is(.btn, .btn-hollow) {
    box-sizing: border-box;
    height: calc(2 * var(--padding-button-t-b) + 1.5 * var(--font-size-button));
    padding-block: 0;
  }
  @media (min-width: 992px) {
    .stage__actions {
      flex-direction: row;
    }
  }
  .stage__badge {
    position: absolute;
    z-index: 10;
    right: var(--stage-inset);
    left: var(--padding-s);
    max-width: 437px;
    bottom: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: var(--padding-m);
    border-radius: var(--border-radius-default);
    border: var(--border-default-width) solid #ececed;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.6) 100%), linear-gradient(90deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 5%), linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 15%);
    backdrop-filter: blur(200px);
    box-shadow: 0 0 20px 0 rgba(162, 162, 165, 0.1);
    text-decoration: none;
    text-align: center;
  }
  @media (min-width: 640px) {
    .stage__badge {
      left: auto;
    }
  }
  @media (min-width: 992px) {
    .stage__badge {
      bottom: 64px;
    }
  }
  .stage__badgeHeader {
    color: var(--color-primary-orange);
    font-size: var(--font-size-h5);
    font-weight: var(--font-weight-h1-h6);
  }
  .stage__badgeText {
    color: var(--color-primary-anthracite);
    font-size: var(--font-size-default);
  }
}
