/* =====================================================
   SUTRA AI — ANIMATED BACKGROUND SYSTEM v2.0
   Three layers: blobs → canvas → content
   Works on BOTH dark and light modes.
   ===================================================== */

/* ── CANVAS (Layer 1) ──────────────────────────────── */
#liquid-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ── ANIMATED BLOB CONTAINER (Layer 0 — below canvas) ── */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

/* SHARED blob style */
.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0;
  animation: blob-drift 20s ease-in-out infinite;
  will-change: transform, opacity;
}

/* BLOB POSITIONS & SIZES */
.bg-blob--1 {
  width: 700px;
  height: 700px;
  top: -200px;
  left: -150px;
  animation-delay: 0s;
  animation-duration: 22s;
}
.bg-blob--2 {
  width: 550px;
  height: 550px;
  top: 30%;
  right: -100px;
  animation-delay: -7s;
  animation-duration: 18s;
}
.bg-blob--3 {
  width: 450px;
  height: 450px;
  bottom: -100px;
  left: 30%;
  animation-delay: -14s;
  animation-duration: 25s;
}
.bg-blob--4 {
  width: 300px;
  height: 300px;
  top: 60%;
  left: 10%;
  animation-delay: -5s;
  animation-duration: 30s;
}

/* ── DARK MODE BLOB COLORS ── */
/* Dark = default (no data-theme, or data-theme=dark) */
.bg-blob--1 {
  background: radial-gradient(circle, rgba(255,120,30,0.35) 0%, transparent 70%);
  opacity: 1;
}
.bg-blob--2 {
  background: radial-gradient(circle, rgba(0,180,255,0.20) 0%, transparent 70%);
  opacity: 1;
}
.bg-blob--3 {
  background: radial-gradient(circle, rgba(120,80,255,0.15) 0%, transparent 70%);
  opacity: 1;
}
.bg-blob--4 {
  background: radial-gradient(circle, rgba(255,200,50,0.12) 0%, transparent 70%);
  opacity: 1;
}

/* ── LIGHT MODE BLOB COLORS ── */
[data-theme="light"] .bg-blob--1 {
  background: radial-gradient(circle, rgba(255,140,30,0.18) 0%, transparent 70%);
  opacity: 1;
  filter: blur(100px);
}
[data-theme="light"] .bg-blob--2 {
  background: radial-gradient(circle, rgba(180,100,20,0.12) 0%, transparent 70%);
  opacity: 1;
  filter: blur(90px);
}
[data-theme="light"] .bg-blob--3 {
  background: radial-gradient(circle, rgba(100,140,255,0.10) 0%, transparent 70%);
  opacity: 1;
  filter: blur(120px);
}
[data-theme="light"] .bg-blob--4 {
  background: radial-gradient(circle, rgba(255,180,60,0.15) 0%, transparent 70%);
  opacity: 1;
}

/* ── BLOB DRIFT ANIMATION ── */
@keyframes blob-drift {
  0%   { transform: translate(0px,   0px)   scale(1.0); }
  25%  { transform: translate(60px,  -40px) scale(1.08); }
  50%  { transform: translate(-30px, 70px)  scale(0.95); }
  75%  { transform: translate(80px,  30px)  scale(1.05); }
  100% { transform: translate(0px,   0px)   scale(1.0); }
}

/* ── GRID/MESH OVERLAY ── */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,140,30,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,140,30,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 100% 100% at 50% 50%,
                               black 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 100% 100% at 50% 50%,
                                       black 0%, transparent 75%);
  animation: grid-shift 40s linear infinite;
  will-change: background-position;
  opacity: 1;
}

[data-theme="light"] .bg-grid {
  background-image:
    linear-gradient(rgba(160,90,20,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160,90,20,0.07) 1px, transparent 1px);
}

@keyframes grid-shift {
  0%   { background-position: 0px 0px; }
  100% { background-position: 60px 60px; }
}

/* ── 3D BREATHING DEPTH RINGS ── */
.bg-ring {
  position: fixed;
  border-radius: 50%;
  border: 1px solid rgba(255,140,30,0.06);
  pointer-events: none;
  z-index: -1;
  animation: ring-breathe 8s ease-in-out infinite;
}
.bg-ring--1 {
  width:  600px; height: 600px;
  top:  calc(50% - 300px);
  left: calc(50% - 300px);
  animation-delay: 0s;
}
.bg-ring--2 {
  width:  900px; height: 900px;
  top:  calc(50% - 450px);
  left: calc(50% - 450px);
  border-color: rgba(255,140,30,0.035);
  animation-delay: -2.5s;
}
.bg-ring--3 {
  width: 1200px; height: 1200px;
  top:  calc(50% - 600px);
  left: calc(50% - 600px);
  border-color: rgba(255,140,30,0.02);
  animation-delay: -5s;
}

@keyframes ring-breathe {
  0%, 100% { transform: scale(1);    opacity: 0.5; }
  50%       { transform: scale(1.04); opacity: 1.0; }
}

[data-theme="light"] .bg-ring {
  border-color: rgba(160, 90, 20, 0.08);
}

/* ── LIGHT MODE BODY BACKGROUND ── */
[data-theme="light"] body {
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(255,160,50,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 80%, rgba(100,140,220,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 100% 100% at 50% 50%, rgba(255,245,225,1) 0%, rgba(248,240,220,1) 100%) !important;
  min-height: 100vh;
}

/* Section alternation for visual rhythm */
.section--alt {
  background: rgba(255, 255, 255, 0.40);
  backdrop-filter: blur(8px);
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  .bg-blob,
  .bg-grid,
  .bg-ring {
    animation: none !important;
  }
  .bg-blob {
    opacity: 0.5 !important;
  }
}

/* ── MOBILE: smaller blobs ── */
@media (max-width: 768px) {
  .bg-blob--1 { width: 400px; height: 400px; }
  .bg-blob--2 { width: 300px; height: 300px; }
  .bg-blob--3 { width: 250px; height: 250px; }
  .bg-blob--4 { width: 180px; height: 180px; }
  .bg-ring--2, .bg-ring--3 { display: none; }
}
