/* The SVG controls line geometry; the fill below supplies the chosen brand ink. */
html[data-pattern-preview] .surface-pattern,
.pattern-ink {
  background-image: none;
}
.surface-pattern::before,
.pattern-ink::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ornament-color-dark, #cc9e6d);
  mask-image: var(--study-dark);
  mask-size: var(--study-size) auto;
  mask-repeat: repeat;
  mask-position: center;
}
.surface-pattern::before {
  /* Every section samples the same document-wide tile, never its own centre. */
  mask-position: var(--weave-x, 0px) var(--weave-y, 0px);
}
.surface-pattern--light::before,
.swatch--light .pattern-ink::before {
  background: var(--ornament-color-light, #cc9e6d);
  mask-image: var(--study-light);
}
.mini-hero .pattern-ink::before {
  mask-size: calc(var(--study-size) * 0.62) auto;
}
.swatch--light .pattern-ink {
  background-image: none;
}

/* Seams belong to the same surface as the side weave. There is no separate
   strip: a low-contrast, continuous vertical fade joins the adjacent sections. */
.section-divider {
  display: none;
}
html[data-pattern-preview] .surface-pattern {
  --weave-fade: clamp(100px, 10vw, 160px);
  --weave-seam-top: #0005;
  --weave-seam-bottom: #0005;
  mask-image:
    linear-gradient(
      90deg,
      #000,
      #0006 20%,
      transparent 39%,
      transparent 61%,
      #0006 80%,
      #000
    ),
    linear-gradient(
      180deg,
      var(--weave-seam-top) 0,
      #0003 calc(var(--weave-fade) * 0.25),
      #0001 calc(var(--weave-fade) * 0.6),
      transparent var(--weave-fade),
      transparent calc(100% - var(--weave-fade)),
      #0001 calc(100% - var(--weave-fade) * 0.6),
      #0003 calc(100% - var(--weave-fade) * 0.25),
      var(--weave-seam-bottom) 100%
    );
  mask-composite: add;
}
html[data-pattern-preview] .hero > .surface-pattern {
  /* The first screen has no preceding section to connect to. */
  mask-image:
    linear-gradient(
      90deg,
      #000,
      #0006 20%,
      transparent 39%,
      transparent 61%,
      #0006 80%,
      #000
    ),
    linear-gradient(
      180deg,
      transparent calc(100% - var(--weave-fade)),
      #0001 calc(100% - var(--weave-fade) * 0.6),
      #0003 calc(100% - var(--weave-fade) * 0.25),
      #0005
    );
}
@media (max-width: 700px) {
  html[data-pattern-preview] .surface-pattern,
  html[data-pattern-preview] .hero > .surface-pattern {
    mask-image:
      linear-gradient(
        90deg,
        #000,
        #0006 10%,
        transparent 28%,
        transparent 72%,
        #0006 90%,
        #000
      ),
      linear-gradient(
        180deg,
        var(--weave-seam-top) 0,
        #0002 32px,
        transparent var(--weave-fade),
        transparent calc(100% - var(--weave-fade)),
        #0002 calc(100% - 32px),
        var(--weave-seam-bottom) 100%
      );
  }
  html[data-pattern-preview] .hero > .surface-pattern {
    --weave-seam-top: transparent;
  }
}
