/* textures-wood.css — realistic wood textures for the Mahogany theme.
   Variants d (planks) and f (polish), chosen by html[data-texture="d"|"f"]; d is the fallback.
   Grain is generated by inline SVG filters (feTurbulence/feColorMatrix/
   feDisplacementMap) as data: URIs — generated code, not artwork assets.
   Each SVG layer is stretched to the viewport (background-size:100% 100%),
   so there is NO visible tile repeat; filters render once, no animation.
   First layer in every variant is a soft top scrim (150px) so the light
   "Chess with Alexander" header text keeps >= 4.5:1 even on the lightest
   fibre; all long reading still sits on panels per DESIGN-RULES.md. */

/* d) Массивная доска: прямое горизонтальное волокно с лёгкой живой волной (displacement), тонкие швы досок двух несовпадающих периодов (340/530px — повтор не виден). */
html[data-theme=mahogany]:not([data-texture]) body.studio,
html[data-theme=mahogany][data-texture="d"] body.studio{
  background-image:
    /* top scrim under the site header */
    linear-gradient(180deg, rgba(24,6,1,.42), rgba(24,6,1,0) 150px),
    /* centre light */
    radial-gradient(120% 90% at 50% 38%, rgba(255,196,104,.15), rgba(255,196,104,0) 44%),
    /* board seams: thin dark groove + faint highlight edge, two non-matching periods */
    repeating-linear-gradient(180deg, rgba(20,5,1,0) 0 216px, rgba(20,5,1,.28) 216px 218px, rgba(255,190,110,.10) 218px 219px, rgba(20,5,1,0) 219px 340px),
    repeating-linear-gradient(180deg, rgba(20,5,1,0) 0 400px, rgba(20,5,1,.20) 400px 402px, rgba(255,190,110,.07) 402px 403px, rgba(20,5,1,0) 403px 530px),
    /* board-to-board tonal drift */
    radial-gradient(70% 45% at 22% 30%, rgba(58,16,4,.15), rgba(58,16,4,0) 72%),
    radial-gradient(65% 42% at 80% 72%, rgba(255,175,95,.07), rgba(255,175,95,0) 72%),
    /* SVG: horizontal fibre, gently warped by low-frequency noise */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='800'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.004 0.02' numOctaves='2' seed='5' result='warp'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.006 0.11' numOctaves='4' seed='11' result='n'/%3E%3CfeDisplacementMap in='n' in2='warp' scale='34' xChannelSelector='R' yChannelSelector='G' result='g'/%3E%3CfeColorMatrix in='g' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.5 0.8 0.6 0 -1.15' result='da'/%3E%3CfeFlood flood-color='%232c0d03' flood-opacity='0.6' result='dc'/%3E%3CfeComposite in='dc' in2='da' operator='in' result='dark'/%3E%3CfeColorMatrix in='g' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.4 -0.7 -0.5 0 1.15' result='la'/%3E%3CfeFlood flood-color='%23ffcf94' flood-opacity='0.35' result='lc'/%3E%3CfeComposite in='lc' in2='la' operator='in' result='light'/%3E%3CfeMerge%3E%3CfeMergeNode in='dark'/%3E%3CfeMergeNode in='light'/%3E%3C/feMerge%3E%3C/filter%3E%3Crect width='800' height='800' filter='url(%23w)'/%3E%3C/svg%3E"),
    /* vignette */
    radial-gradient(140% 120% at 50% 50%, rgba(0,0,0,0) 46%, rgba(20,5,1,.55) 100%),
    /* base wood */
    linear-gradient(180deg,#8a3a16 0%, #a0451c 22%, #7a3512 58%, #4a1c0a 100%);
  background-size:100% 100%;
}

/* f) Полированный махагон «ribbon stripe»: широкие мягкие чередующиеся ленты света/тени с дрожащими краями + тонкое волокно + лаковый блик сверху. */
html[data-theme=mahogany][data-texture="f"] body.studio{
  background-image:
    linear-gradient(180deg, rgba(24,6,1,.42), rgba(24,6,1,0) 150px),
    /* polish gloss, upper centre */
    radial-gradient(90% 55% at 50% 16%, rgba(255,222,150,.17), rgba(255,222,150,0) 55%),
    radial-gradient(120% 90% at 50% 38%, rgba(255,196,104,.12), rgba(255,196,104,0) 46%),
    /* SVG: wavy ribbon bands (displaced gradient) + fine fibre */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='800'%3E%3Cdefs%3E%3ClinearGradient id='b' x1='0' y1='0' x2='1' y2='0'%3E%3Cstop offset='0' stop-color='%233a1104' stop-opacity='0'/%3E%3Cstop offset='.06' stop-color='%233a1104' stop-opacity='.3'/%3E%3Cstop offset='.16' stop-color='%233a1104' stop-opacity='0'/%3E%3Cstop offset='.22' stop-color='%23ffcf94' stop-opacity='0'/%3E%3Cstop offset='.30' stop-color='%23ffcf94' stop-opacity='.16'/%3E%3Cstop offset='.40' stop-color='%23ffcf94' stop-opacity='0'/%3E%3Cstop offset='.46' stop-color='%233a1104' stop-opacity='0'/%3E%3Cstop offset='.55' stop-color='%233a1104' stop-opacity='.3'/%3E%3Cstop offset='.66' stop-color='%233a1104' stop-opacity='0'/%3E%3Cstop offset='.72' stop-color='%23ffcf94' stop-opacity='0'/%3E%3Cstop offset='.80' stop-color='%23ffcf94' stop-opacity='.15'/%3E%3Cstop offset='.88' stop-color='%23ffcf94' stop-opacity='0'/%3E%3Cstop offset='.94' stop-color='%233a1104' stop-opacity='0'/%3E%3Cstop offset='1' stop-color='%233a1104' stop-opacity='.26'/%3E%3C/linearGradient%3E%3Cfilter id='rib'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.004 0.012' numOctaves='3' seed='3' result='w'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='w' scale='26' xChannelSelector='R' yChannelSelector='G'/%3E%3C/filter%3E%3Cfilter id='fine'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.008 0.3' numOctaves='2' seed='9' result='n'/%3E%3CfeColorMatrix in='n' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.4 0.7 0.5 0 -1.05' result='a'/%3E%3CfeFlood flood-color='%232e0d03' flood-opacity='0.45' result='c'/%3E%3CfeComposite in='c' in2='a' operator='in'/%3E%3C/filter%3E%3C/defs%3E%3Crect x='-40' y='-40' width='880' height='880' fill='url(%23b)' filter='url(%23rib)'/%3E%3Crect width='800' height='800' filter='url(%23fine)'/%3E%3C/svg%3E"),
    radial-gradient(140% 120% at 50% 50%, rgba(0,0,0,0) 46%, rgba(20,5,1,.55) 100%),
    linear-gradient(180deg,#8e3d17 0%, #a6481d 22%, #7c3612 58%, #4c1d0a 100%);
  background-size:100% 100%;
}

