/* ================================================================
   Resayil — SVG background patterns (Phase 24.12 Plan 06)
   Pure CSS, no JS, no external assets.

   Each class paints a subtle accent-orange geometric pattern using
   a `background-image: url(data:image/svg+xml,...)` data URI — no
   external HTTP request is made.

   Usage:
     <div class="rs-hero-pattern rs-bg-dots" aria-hidden="true"></div>

   Variants:
     .rs-bg-dots    — 32px grid, 1.5px dot, 0.05 opacity
     .rs-bg-grid    — 48px cell, 1px lines, 0.05 opacity
     .rs-bg-diag    — 16px cell, 45° stripes, 0.035 opacity

   Modifier:
     .rs-bg-dense   — halves cell size, doubles density

   Dark theme: [data-theme="dark"] bumps opacity ~2x so the pattern
   remains legible against dark surfaces.
   ================================================================ */

/* Positioning helper — sits BEHIND the hero glow layer (z-index: 0)
   so existing radial-gradient overlays and text (z-index >= 1) read
   cleanly over the pattern. `pointer-events: none` keeps clicks
   passing through to the hero content underneath. */
.rs-hero-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* --- Dot grid: 32px cell, 1.5px dot, 0.05 opacity --------------- */
.rs-bg-dots {
  background-image: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='16' cy='16' r='1.5' fill='%23FF6A00' fill-opacity='0.05'/%3E%3C/svg%3E");
  background-size: 32px 32px;
  background-repeat: repeat;
}

/* --- Square grid: 48px cells, 1px lines, 0.05 opacity ----------- */
.rs-bg-grid {
  background-image: url("data:image/svg+xml,%3Csvg width='48' height='48' viewBox='0 0 48 48' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0 L48 0 M0 0 L0 48' stroke='%23FF6A00' stroke-opacity='0.05' stroke-width='1' fill='none'/%3E%3C/svg%3E");
  background-size: 48px 48px;
  background-repeat: repeat;
}

/* --- Diagonal stripes: 16px cell, 1px lines, 0.035 opacity ------ */
.rs-bg-diag {
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M-1 17 L17 -1' stroke='%23FF6A00' stroke-opacity='0.035' stroke-width='1' fill='none'/%3E%3Cpath d='M-1 9 L9 -1' stroke='%23FF6A00' stroke-opacity='0.035' stroke-width='1' fill='none'/%3E%3C/svg%3E");
  background-size: 16px 16px;
  background-repeat: repeat;
}

/* --- Denser composability modifier (halve cell, 2x density) ---- */
.rs-bg-dots.rs-bg-dense { background-size: 16px 16px; }
.rs-bg-grid.rs-bg-dense { background-size: 24px 24px; }
.rs-bg-diag.rs-bg-dense { background-size: 8px  8px; }

/* --- Dark-theme opacity nudge ----------------------------------- */
/* Low-opacity orange on a dark surface vanishes; bump to ~2x so the
   pattern stays visible without becoming loud. Same SVG geometry,
   just higher fill/stroke opacity baked in. */
[data-theme="dark"] .rs-bg-dots {
  background-image: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='16' cy='16' r='1.5' fill='%23FF6A00' fill-opacity='0.10'/%3E%3C/svg%3E");
}
[data-theme="dark"] .rs-bg-grid {
  background-image: url("data:image/svg+xml,%3Csvg width='48' height='48' viewBox='0 0 48 48' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0 L48 0 M0 0 L0 48' stroke='%23FF6A00' stroke-opacity='0.10' stroke-width='1' fill='none'/%3E%3C/svg%3E");
}
[data-theme="dark"] .rs-bg-diag {
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M-1 17 L17 -1' stroke='%23FF6A00' stroke-opacity='0.07' stroke-width='1' fill='none'/%3E%3Cpath d='M-1 9 L9 -1' stroke='%23FF6A00' stroke-opacity='0.07' stroke-width='1' fill='none'/%3E%3C/svg%3E");
}

/* --- System dark mode fallback ---------------------------------- */
/* Pages that don't declare data-theme (rare in Resayil portal but
   possible on third-party or future pages) still get a bump when
   the user's OS is in dark mode. Lower specificity than the
   data-theme rules above so an explicit [data-theme="light"] wins. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .rs-bg-dots {
    background-image: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='16' cy='16' r='1.5' fill='%23FF6A00' fill-opacity='0.10'/%3E%3C/svg%3E");
  }
  :root:not([data-theme="light"]) .rs-bg-grid {
    background-image: url("data:image/svg+xml,%3Csvg width='48' height='48' viewBox='0 0 48 48' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0 L48 0 M0 0 L0 48' stroke='%23FF6A00' stroke-opacity='0.10' stroke-width='1' fill='none'/%3E%3C/svg%3E");
  }
  :root:not([data-theme="light"]) .rs-bg-diag {
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M-1 17 L17 -1' stroke='%23FF6A00' stroke-opacity='0.07' stroke-width='1' fill='none'/%3E%3Cpath d='M-1 9 L9 -1' stroke='%23FF6A00' stroke-opacity='0.07' stroke-width='1' fill='none'/%3E%3C/svg%3E");
  }
}
