/* Colour + texture surfaces
   Source: Figma "Northbeam-Final", node 100:12333 (six swatches). Each surface carries BOTH its colour and its texture, so one class gives the finished look:
     <div class="surface surface--wine">...</div>
   How it is built (one `background`, nothing else needed): the colour is the background colour; the texture PNG is multiplied over it; a tint of the same colour
   sits on top, so the texture shows at --tx-opacity (Waves 50%, Diagonal 50%, Zig 70%).
   Blend mode: set --tx-blend on a surface (default multiply), e.g. `.surface--clay { --tx-blend: overlay; }` or inline `style="--tx-blend: soft-light"`.
   Textures: assets/images/texture.Waves.png, texture.Diagonal.png, texture.Zig.png (800 x 800, transparent, shown at --texture-size).
   Colours: --color-surface-* in css/tokens.css. Use on any block; give it a size, a radius or content as needed. */

.surface {
  --sw: var(--color-surface-wine);
  --tx: url("../../assets/images/texture.Waves.png");
  --tx-blend: multiply;                               /* how the texture blends with the colour: any CSS blend mode (multiply, overlay, soft-light, screen, ...) */
  --tx-opacity: 0.5;                                  /* how strongly the texture shows: 0 = flat colour, 1 = full texture */
  background-color: var(--sw);
  background-image:
    linear-gradient(color-mix(in srgb, var(--sw) calc((1 - var(--tx-opacity)) * 100%), transparent), color-mix(in srgb, var(--sw) calc((1 - var(--tx-opacity)) * 100%), transparent)),
    var(--tx);
  background-size: auto, var(--texture-size);
  background-position: 0 0, 0 0;
  background-repeat: no-repeat, repeat;
  background-blend-mode: normal, var(--tx-blend);
}

/* Waves (texture 50%) */
.surface--wine { --sw: var(--color-surface-wine); --tx: url("../../assets/images/texture.Waves.png"); }
.surface--moss { --sw: var(--color-surface-moss); --tx: url("../../assets/images/texture.Waves.png"); }
/* Diagonal (texture 50%) */
.surface--clay  { --tx-opacity: 0.5; --sw: var(--color-surface-clay);  --tx: url("../../assets/images/texture.Diagonal.png"); }
.surface--stone { --tx-opacity: 0.5; --sw: var(--color-surface-stone); --tx: url("../../assets/images/texture.Diagonal.png"); }
/* Zig (texture 70%) */
.surface--slate { --tx-opacity: 0.7; --sw: var(--color-surface-slate); --tx: url("../../assets/images/texture.Zig.png"); }
.surface--linen { --tx-opacity: 0.7; --sw: var(--color-surface-linen); --tx: url("../../assets/images/texture.Zig.png"); }
