/* Set to 0 to disable the decorative texture throughout the draft theme. */
body { --arganart-motif-opacity: .03; }

/* Carry the cream texture through the gutters without changing content widths. */
.av2-home #MainContent :is(.av2-proof--homepage, .av2-story),
.av2-home .shopify-section > .av2-footer {
  background-color: transparent;
}

/* Each surface keeps its own base colour or gradient beneath the texture. */
:where(
  #MainContent,
  #MainContent > .shopify-section > .gradient,
  #MainContent .av2,
  #MainContent .av2-needs-band,
  #MainContent .av2-promise,
  #MainContent .av2-universes,
  #MainContent .av2-final > .av2-editorial-copy,
  #MainContent .collection-hero,
  #MainContent section[id^="MainProduct-"],
  #MainContent .related-products,
  #MainContent .av-treatment,
  #MainContent .av2-ritual-recommendations,
  #MainContent .contact,
  #MainContent .main-blog,
  #MainContent .article-template__content,
  #MainContent .article-template__back,
  #MainContent .article-template__comment-wrapper,
  .shopify-section:has(> .av2-footer),
  .shopify-section > footer.footer
) {
  position: relative;
  isolation: isolate;
}
:where(
  #MainContent,
  #MainContent > .shopify-section > .gradient,
  #MainContent .av2,
  #MainContent .av2-needs-band,
  #MainContent .av2-promise,
  #MainContent .av2-universes,
  #MainContent .av2-final > .av2-editorial-copy,
  #MainContent .collection-hero,
  #MainContent section[id^="MainProduct-"],
  #MainContent .related-products,
  #MainContent .av-treatment,
  #MainContent .av2-ritual-recommendations,
  #MainContent .contact,
  #MainContent .main-blog,
  #MainContent .article-template__content,
  #MainContent .article-template__back,
  #MainContent .article-template__comment-wrapper,
  .shopify-section:has(> .av2-footer),
  .shopify-section > footer.footer,
  #MainContent .av2-campaign-bestsellers
)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--arganart-pattern-image) repeat center top / 144px 144px;
  opacity: var(--arganart-motif-opacity);
}
#MainContent .av2-campaign-hero { background-color: #f7f4ee; }
@media (prefers-reduced-motion: no-preference) {
  #MainContent .av2-campaign-sequence.is-scroll-ready .av2-campaign-bestsellers::after {
    opacity: 0;
  }
  #MainContent .av2-campaign-sequence.is-scroll-ready > :is(.av2-needs-band, .av2-promise)::after {
    opacity: 0;
  }
}

/* Share one viewport origin at the editorial seams and feather the existing texture. */
.av2-home #MainContent::after,
.av2-home #MainContent .av2:has(> .av2-campaign-sequence)::after,
.av2-home #MainContent .av2-universes::after,
.av2-home #MainContent .av2-campaign-baume::after,
.av2-home #MainContent .av2-campaign-texture,
.av2-home #MainContent .av2-atelier-motif,
.av2-home #MainContent .av2-final--jasmin-box > .av2-editorial-copy::after {
  background-attachment: fixed;
  background-position: center top;
}

.av2-home #MainContent .av2-campaign-sequence--overlap > .av2-final--jasmin-box::before {
  background-color: var(--av2-cream, #eee8de);
}

.av2-home #MainContent .av2-final--jasmin-box > .av2-editorial-copy::after {
  mask-image: linear-gradient(to bottom, transparent, #000 var(--campaign-box-entry, 0px), #000 calc(100% - 94px), transparent),
    linear-gradient(to right, #000 38%, transparent 98%);
  mask-composite: intersect;
}

.av2-home #MainContent .av2-campaign-sequence.is-scroll-ready .av2-campaign-baume::after {
  mask-image: var(--campaign-baume-decor-mask), linear-gradient(to bottom, #000 calc(var(--campaign-backdrop-edge, 100lvh) - 92px), transparent var(--campaign-backdrop-edge, 100lvh));
  mask-size: cover, 100% 100%;
  mask-position: 62% center, center;
  mask-repeat: no-repeat;
  mask-composite: intersect;
}

@media (max-width: 989px) {
  .av2-home #MainContent .av2-final--jasmin-box > .av2-editorial-copy::after {
    mask-image: linear-gradient(to bottom, transparent, #000 var(--campaign-box-entry, 0px), #000 55%, transparent);
  }
}
@media (max-width: 749px) {
  .av2-home #MainContent .av2-campaign-sequence.is-scroll-ready .av2-campaign-baume::after {
    mask-image: var(--campaign-baume-decor-mask), linear-gradient(to bottom, #000 calc(var(--campaign-backdrop-edge, 100lvh) - 92px), transparent var(--campaign-backdrop-edge, 100lvh)),
      linear-gradient(to bottom, #000 85%, transparent);
    mask-size: cover, 100% 100%, 100% 100%;
    mask-position: 62% 60%, center, center;
    mask-composite: intersect;
  }
}

/* Keep each motif aligned to the crop of its own photograph. */
.av2-home .av2-campaign-sequence--overlap {
  --campaign-baume-decor-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%221774%22%20height%3D%22887%22%20viewBox%3D%220%200%20887%20443.5%22%3E%3Cdefs%3E%3Cfilter%20id%3D%22soft%22%20x%3D%22-20%25%22%20y%3D%22-20%25%22%20width%3D%22140%25%22%20height%3D%22140%25%22%3E%3CfeGaussianBlur%20stdDeviation%3D%224%22%2F%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%3Cpath%20fill%3D%22white%22%20filter%3D%22url(%23soft)%22%20d%3D%22M-20-20H369C360%2021%20354%2054%20356%2083C344%20111%20341%20156%20345%20191C323%20205%20294%20219%20272%20239C252%20256%20243%20289%20236%20325C223%20331%20210%20344%20200%20360C163%20346%20124%20345%2090%20356C44%20371%2023%20402%2010%20463H-20Z%20M711-20H907V463H777C779%20426%20773%20392%20758%20370C745%20350%20726%20336%20709%20328C748%20302%20776%20260%20791%20216C808%20170%20799%20143%20782%20114C771%2094%20749%2072%20739%2045C733%2020%20719%201%20711-20Z%22%2F%3E%3C%2Fsvg%3E");
}
.av2-home #MainContent .av2-campaign-sequence--overlap > .av2-universes::after {
  mask: var(--campaign-baume-decor-mask) 62% center / cover no-repeat;
}
@media (prefers-reduced-motion: no-preference) {
  .av2-home #MainContent .is-scroll-ready .av2-campaign-texture::after {
    mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%221672%22%20height%3D%22941%22%20viewBox%3D%220%200%20836%20470.5%22%3E%3Cdefs%3E%3Cfilter%20id%3D%22soft%22%20x%3D%22-20%25%22%20y%3D%22-20%25%22%20width%3D%22140%25%22%20height%3D%22140%25%22%3E%3CfeGaussianBlur%20stdDeviation%3D%224%22%2F%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%3Cpath%20fill%3D%22white%22%20filter%3D%22url(%23soft)%22%20d%3D%22M-20-20H282C268%204%20261%2036%20258%2074C252%20127%20244%20173%20247%20222C246%20263%20251%20297%20257%20324C224%20318%20188%20323%20155%20338C111%20358%2078%20400%2053%20444L35%20487H-20Z%20M856%20238C829%20225%20805%20209%20780%20193C785%20226%20785%20258%20776%20291C767%20331%20758%20374%20752%20423L856%20424Z%22%2F%3E%3C%2Fsvg%3E") 73% center / cover no-repeat;
  }
}
@media (min-width: 750px) and (prefers-reduced-motion: no-preference) {
  .av2-home #MainContent .is-scroll-ready .av2-campaign-texture::after {
    mask-position: center;
  }
}
