/* ==========================================================================
   ShongZog Public — Abstract Background System
   Compose decorative layers inside any `.section` (which sets isolation).
   Usage:
     <section class="section bg-mesh">
       <div class="deco" aria-hidden="true">
         <span class="deco-grid"></span>
         <span class="deco-blob deco-blob--brand" style="--x:80%;--y:10%"></span>
       </div>
       ...content...
     </section>
   ========================================================================== */

/* Layer container */
.deco { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }

/* ---------- Full-section backgrounds ---------- */
.bg-mesh {
  background:
    radial-gradient(60% 50% at 85% 0%, rgba(255, 130, 83, .16) 0%, transparent 60%),
    radial-gradient(45% 40% at 0% 20%, rgba(245, 165, 36, .10) 0%, transparent 60%),
    radial-gradient(50% 50% at 60% 100%, rgba(255, 91, 34, .07) 0%, transparent 60%),
    var(--sand-50);
}
.bg-mesh-cool {
  background:
    radial-gradient(55% 45% at 100% 0%, rgba(47, 125, 246, .08) 0%, transparent 60%),
    radial-gradient(50% 50% at 0% 100%, rgba(255, 91, 34, .08) 0%, transparent 60%),
    var(--ink-50);
}
.bg-ink-glow {
  background:
    radial-gradient(50% 60% at 85% 10%, rgba(255, 91, 34, .22) 0%, transparent 60%),
    radial-gradient(40% 50% at 5% 95%, rgba(47, 125, 246, .14) 0%, transparent 60%),
    var(--grad-ink);
  color: var(--ink-300);
}
.bg-brand-glow {
  background:
    radial-gradient(60% 80% at 100% 0%, rgba(255, 196, 140, .55) 0%, transparent 55%),
    radial-gradient(50% 70% at 0% 100%, rgba(196, 54, 13, .55) 0%, transparent 60%),
    var(--grad-brand);
  color: rgba(255,255,255,.88);
}

/* ---------- Line grid (fades out radially) ---------- */
.deco-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(12, 18, 34, .055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(12, 18, 34, .055) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at var(--mx, 50%) var(--my, 30%), #000 10%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at var(--mx, 50%) var(--my, 30%), #000 10%, transparent 75%);
}
.deco-grid--light {
  background-image:
    linear-gradient(to right, rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.06) 1px, transparent 1px);
}

/* ---------- Dot matrix ---------- */
.deco-dots {
  position: absolute; width: var(--w, 220px); height: var(--h, 160px);
  left: var(--x, auto); top: var(--y, auto); right: var(--r, auto); bottom: var(--b, auto);
  background-image: radial-gradient(rgba(255, 91, 34, .35) 1.4px, transparent 1.6px);
  background-size: 16px 16px;
  -webkit-mask-image: linear-gradient(135deg, #000 30%, transparent 85%);
          mask-image: linear-gradient(135deg, #000 30%, transparent 85%);
}
.deco-dots--ink { background-image: radial-gradient(rgba(12, 18, 34, .18) 1.2px, transparent 1.4px); }
.deco-dots--light { background-image: radial-gradient(rgba(255,255,255,.22) 1.2px, transparent 1.4px); }

/* ---------- Soft blobs ---------- */
.deco-blob {
  position: absolute;
  width: var(--s, 520px); height: var(--s, 520px);
  left: var(--x, 50%); top: var(--y, 50%);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  filter: blur(var(--blur, 70px));
  opacity: var(--o, .5);
}
.deco-blob--brand { background: radial-gradient(circle at 30% 30%, #FF9A63, #FF5B22 60%); }
.deco-blob--amber { background: radial-gradient(circle at 30% 30%, #FFD58A, #F5A524 60%); }
.deco-blob--sky   { background: radial-gradient(circle at 30% 30%, #9CC3FF, #2F7DF6 60%); }
.deco-blob--rose  { background: radial-gradient(circle at 30% 30%, #FFB3A1, #FF6F5B 60%); }
.deco-blob--float { animation: blob-float 18s var(--ease-in-out) infinite alternate; }
@keyframes blob-float {
  0%   { transform: translate(-50%, -50%) scale(1); }
  50%  { transform: translate(-46%, -54%) scale(1.08); }
  100% { transform: translate(-54%, -47%) scale(.96); }
}

/* ---------- Concentric rings ---------- */
.deco-rings {
  position: absolute;
  width: var(--s, 560px); height: var(--s, 560px);
  left: var(--x, auto); top: var(--y, auto); right: var(--r, auto); bottom: var(--b, auto);
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 46px, rgba(255, 91, 34, .12) 46px 47px);
  -webkit-mask-image: radial-gradient(circle, #000 25%, transparent 70%);
          mask-image: radial-gradient(circle, #000 25%, transparent 70%);
}
.deco-rings--light { background: repeating-radial-gradient(circle, transparent 0 46px, rgba(255,255,255,.08) 46px 47px); }

/* ---------- Diagonal beam / stripes ---------- */
.deco-beam {
  position: absolute; width: 140%; height: 220px; left: -20%; top: var(--y, 40%);
  background: linear-gradient(90deg, transparent, rgba(255, 91, 34, .08), transparent);
  transform: rotate(-8deg);
}

/* ---------- Topographic contour lines (SVG) ---------- */
.deco-topo {
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600' viewBox='0 0 600 600'%3E%3Cg fill='none' stroke='%23FF5B22' stroke-opacity='.10' stroke-width='1.2'%3E%3Cpath d='M-50 120 C 80 40 200 200 320 110 S 520 40 650 130'/%3E%3Cpath d='M-50 170 C 90 90 210 250 330 160 S 530 90 650 180'/%3E%3Cpath d='M-50 220 C 100 140 220 300 340 210 S 540 140 650 230'/%3E%3Cpath d='M-50 270 C 110 190 230 350 350 260 S 550 190 650 280'/%3E%3Cpath d='M-50 320 C 120 240 240 400 360 310 S 560 240 650 330'/%3E%3Cpath d='M-50 370 C 130 290 250 450 370 360 S 570 290 650 380'/%3E%3Cpath d='M-50 420 C 140 340 260 500 380 410 S 580 340 650 430'/%3E%3Cpath d='M-50 470 C 150 390 270 550 390 460 S 590 390 650 480'/%3E%3C/g%3E%3C/svg%3E") center / 900px repeat;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at var(--mx, 80%) var(--my, 50%), #000 0%, transparent 70%);
          mask-image: radial-gradient(ellipse 60% 70% at var(--mx, 80%) var(--my, 50%), #000 0%, transparent 70%);
}
.deco-topo--light { filter: brightness(0) invert(1); opacity: .5; }

/* ---------- Film grain (adds tactile depth to gradients) ---------- */
.deco-grain {
  position: absolute; inset: 0; opacity: .35; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

/* ---------- Edge fades ---------- */
.fade-bottom::after {
  content: ""; position: absolute; inset: auto 0 0; height: 120px; z-index: -1;
  background: linear-gradient(to bottom, transparent, var(--fade-to, #fff));
}

@media (max-width: 767.98px) {
  .deco-blob { --s: 340px; }
  .deco-rings { --s: 380px; }
}
