/* Bottom-background texture library. Each style sets a default in themes.css; html[data-texture="<id>"] overrides it. */
/* Fine grain: Uncoated-stock grain, the quietest option. */
[data-texture="grain"] { --base-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0.216 -0.090'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); --base-texture-size: 240px 240px; }
/* Laid paper: Fine horizontal laid lines with wide chain lines, as in letterhead stock. */
[data-texture="laid"] { --base-texture: repeating-linear-gradient(0deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 4px), repeating-linear-gradient(90deg, rgba(255,255,255,0.07) 0 2px, transparent 2px 96px), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0.120 -0.050'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); --base-texture-size: auto, auto, 240px 240px; }
/* Cold-press watercolor: Low-frequency mottling plus tooth, like cold-press watercolor paper. */
[data-texture="coldpress"] { --base-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.035' numOctaves='4' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0.168 -0.070'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0.120 -0.050'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); --base-texture-size: 420px 420px, 240px 240px; }
/* Newsprint: Short fibers and uneven ink pickup of newsprint. */
[data-texture="newsprint"] { --base-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9 0.35' numOctaves='2' seed='5' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0.168 -0.070'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.02' numOctaves='3' seed='9' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0.120 -0.050'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); --base-texture-size: 240px 240px, 400px 400px; }
/* Kraft / chipboard: Long fibers and dark-light flecks of kraft board. Pair with a brown or olive --base. */
[data-texture="kraft"] { --base-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.015 0.5' numOctaves='3' seed='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0.192 -0.080'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5' numOctaves='1' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 -30 21.00'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.090'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); --base-texture-size: 360px 360px, 300px 300px; }
/* Recycled fleck: Scattered flecks of recycled stock. */
[data-texture="fleck"] { --base-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.35' numOctaves='1' seed='13' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 -30 21.00'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.120'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='1' seed='21' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 -30 22.20'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.070'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0.096 -0.040'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); --base-texture-size: 300px 300px, 200px 200px, 240px 240px; }
/* Cardstock tooth: Very fine, even tooth. */
[data-texture="cardstock"] { --base-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.6' numOctaves='1' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0.192 -0.080'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); --base-texture-size: 240px 240px; }
/* Riso grain: Clumpy risograph ink grain with uneven coverage. */
[data-texture="riso"] { --base-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='1' seed='31' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 -30 16.50'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.160'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.05' numOctaves='2' seed='8' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0.120 -0.050'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); --base-texture-size: 220px 220px, 400px 400px; }
/* Halftone dots: Offset 45-degree halftone screen. */
[data-texture="halftone"] { --base-texture: radial-gradient(circle at 25% 25%, rgba(255,255,255,0.14) 2.2px, transparent 2.6px), radial-gradient(circle at 75% 75%, rgba(255,255,255,0.14) 2.2px, transparent 2.6px); --base-texture-size: 14px 14px; }
/* Linen: Linen-finish stationery. */
[data-texture="linen"] { --base-texture: repeating-linear-gradient(0deg, rgba(255,255,255,0.045) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(255,255,255,0.045) 0 1px, transparent 1px 3px), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.02 0.6' numOctaves='2' seed='6' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0.120 -0.050'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); --base-texture-size: auto, auto, 300px 300px; }
/* Canvas: Coarse woven canvas, light warp and dark weft. */
[data-texture="canvas"] { --base-texture: repeating-linear-gradient(0deg, rgba(255,255,255,0.06) 0 2px, transparent 2px 5px), repeating-linear-gradient(90deg, rgba(0,0,0,0.1) 0 2px, transparent 2px 5px), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0.120 -0.050'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); --base-texture-size: auto, auto, 240px 240px; }
/* Folded mailer creases: Two tri-fold creases with paper grain. Not a tile; stretches to the page. */
[data-texture="creases"] { --base-texture: linear-gradient(90deg, transparent calc(33.3% - 3px), rgba(0,0,0,0.18) calc(33.3% - 1px), rgba(255,255,255,0.12) 33.3%, transparent calc(33.3% + 4px)), linear-gradient(90deg, transparent calc(66.6% - 3px), rgba(0,0,0,0.18) calc(66.6% - 1px), rgba(255,255,255,0.12) 66.6%, transparent calc(66.6% + 4px)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0.120 -0.050'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); --base-texture-size: 100% 100%, 100% 100%, 240px 240px; }
/* Poster paste-up: Overlapping paper sheets and glue patches of a wheat-pasted wall. */
[data-texture="pasteup"] { --base-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012' numOctaves='2' seed='17' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0.216 -0.090'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0.120 -0.050'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); --base-texture-size: 600px 600px, 240px 240px; }
/* Letterpress deboss: Debossed rule grid with a light lower edge, as if pressed into soft stock. */
[data-texture="letterpress"] { --base-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cg fill='none' stroke-width='1.2'%3E%3Cpath d='M0 40.5h80M40.5 0v80' stroke='rgba(0,0,0,0.25)'/%3E%3Cpath d='M0 41.7h80M41.7 0v80' stroke='rgba(255,255,255,0.1)'/%3E%3C/g%3E%3C/svg%3E"); --base-texture-size: 80px 80px; }
/* Faded flag stripes: Wide stripes faded and mottled like a sun-bleached flag. */
[data-texture="flag"] { --base-texture: repeating-linear-gradient(180deg, rgba(255,255,255,0.07) 0 46px, transparent 46px 92px), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.05' numOctaves='3' seed='19' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0.120 -0.050'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); --base-texture-size: auto, 400px 400px; }
/* Ruled ledger: Account-book rules with a red double margin. */
[data-texture="ledger"] { --base-texture: linear-gradient(90deg, transparent 88px, rgba(255,138,128,0.22) 88px 90px, transparent 90px 94px, rgba(255,138,128,0.22) 94px 96px, transparent 96px), repeating-linear-gradient(180deg, transparent 0 31px, rgba(255,255,255,0.1) 31px 32px); --base-texture-size: auto, auto; }
/* Airmail border (mailer styles only): Airmail envelope stripes. Postal; reserved for the playful mailer style. */
[data-texture="airmail"] { --base-texture: repeating-linear-gradient(-45deg, rgba(224,49,49,0.2) 0 22px, transparent 22px 44px, rgba(77,171,247,0.2) 44px 66px, transparent 66px 88px); --base-texture-size: auto; }
/* Pinstripe: Thin vertical pinstripes. */
[data-texture="pinstripe"] { --base-texture: repeating-linear-gradient(90deg, rgba(255,255,255,0.08) 0 1.5px, transparent 1.5px 14px); --base-texture-size: auto; }
/* Polka dots: Small even dots. */
[data-texture="dots"] { --base-texture: radial-gradient(rgba(255,255,255,0.14) 1.6px, transparent 2px); --base-texture-size: 18px 18px; }
/* Graph paper: Graph-paper grid. */
[data-texture="graph"] { --base-texture: linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px); --base-texture-size: 32px 32px; }
/* Crosshatch: Engraving crosshatch. */
[data-texture="crosshatch"] { --base-texture: repeating-linear-gradient(45deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 12px), repeating-linear-gradient(-45deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 12px); --base-texture-size: auto; }
/* Star field: Offset rows of small stars. */
[data-texture="stars"] { --base-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cg fill='rgba(255,255,255,0.14)'%3E%3Cpath transform='translate(4 4) scale(.7)' d='M10 1.5l2.47 5.6 6.03.55-4.57 4.04 1.36 5.96L10 14.6l-5.29 3.05 1.36-5.96L1.5 7.65l6.03-.55z'/%3E%3Cpath transform='translate(32 32) scale(.7)' d='M10 1.5l2.47 5.6 6.03.55-4.57 4.04 1.36 5.96L10 14.6l-5.29 3.05 1.36-5.96L1.5 7.65l6.03-.55z'/%3E%3C/g%3E%3C/svg%3E"); --base-texture-size: 56px 56px; }
/* Waves: Repeating wave lines. */
[data-texture="waves"] { --base-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='32'%3E%3Cpath d='M0 16 q16 -8 32 0 t32 0' fill='none' stroke='rgba(255,255,255,0.12)' stroke-width='2'/%3E%3C/svg%3E"); --base-texture-size: 64px 32px; }
/* Topo lines: Contour lines, for western and outdoors styles. */
[data-texture="topo"] { --base-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='160'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.09)' stroke-width='1.4'%3E%3Cpath d='M-10 40 C40 10 80 70 130 40 S210 10 250 40'/%3E%3Cpath d='M-10 80 C40 50 80 110 130 80 S210 50 250 80'/%3E%3Cpath d='M-10 120 C40 90 80 150 130 120 S210 90 250 120'/%3E%3C/g%3E%3C/svg%3E"); --base-texture-size: 240px 160px; }
/* Sunburst: Rays from the top center. */
[data-texture="sunburst"] { --base-texture: repeating-conic-gradient(from 0deg at 50% 0%, rgba(255,255,255,0.06) 0deg 4deg, transparent 4deg 10deg); --base-texture-size: 100% 100%; }
/* Plaid: Flannel plaid. */
[data-texture="plaid"] { --base-texture: repeating-linear-gradient(0deg, rgba(255,255,255,0.06) 0 22px, transparent 22px 64px), repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 22px, transparent 22px 64px); --base-texture-size: auto; }
/* Denim twill: Diagonal twill with grain. */
[data-texture="denim"] { --base-texture: repeating-linear-gradient(60deg, rgba(255,255,255,0.06) 0 1px, transparent 1px 5px), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0 1.000 0 0 0 0.120 -0.050'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); --base-texture-size: auto, 240px 240px; }
/* Brick wall: Mortar lines, for union-hall styles. */
[data-texture="bricks"] { --base-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='32'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.08)' stroke-width='1.5'%3E%3Cpath d='M0 0.75h64M0 16.75h64M32 0v16M0 16v16M64 16v16'/%3E%3C/g%3E%3C/svg%3E"); --base-texture-size: 64px 32px; }
/* Chevron: Stacked chevrons. */
[data-texture="chevron"] { --base-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20'%3E%3Cpath d='M0 20 L20 4 L40 20' fill='none' stroke='rgba(255,255,255,0.08)' stroke-width='3'/%3E%3C/svg%3E"); --base-texture-size: 40px 20px; }
/* Flat color: No texture. */
[data-texture="flat"] { --base-texture: none; --base-texture-size: auto; }
