/* ──────────────────────────────────────────────────────────────
   5D — Mobile gradient backgrounds
   --------------------------------------------------------------
   On phones (≤ 720px) we skip the animated iframe backgrounds
   entirely — they're heavy and don't carry their atmosphere
   well at small sizes. Instead we render a multi-stop radial
   gradient on the parent container that mirrors the colour
   palette of the desktop animation.

   The same static gradients are used in Safari (desktop and iOS),
   where the blurred animations don't render reliably.

   The companion script (mobile-iframe-swap.js) hides the iframe
   on mobile / Safari and tags the parent with one of:
     .anim-mint   – mint/teal  (index hero, mission, services CTA)
     .anim-warm   – warm cream (services hero)
     .anim-cool   – cool blue  (about hero)
     .anim-multi  – pink/teal/blue (packages, projects, project,
                                    contact, enquiry)
   ────────────────────────────────────────────────────────── */

/* Phones always hide the iframes, even before the script runs */
@media (max-width: 720px) {
  iframe[data-desktop-src] {
    display: none !important;
  }
}

/* Static gradient mode — the script adds .static-bg to <html> on
   phones (≤ 720px) and in Safari, where the animated iframes
   render poorly. */
/* Hide every animated iframe */
html.static-bg iframe[data-desktop-src] {
  display: none !important;
}

/* And kill the desktop tint layer we'd otherwise stack */
html.static-bg .hero-bg::before,
html.static-bg .page-bg::before {
  display: none !important;
}

/* ── MINT / TEAL palette ────────────────────────────────── */
html.static-bg .anim-mint {
  background:
    radial-gradient(ellipse 78% 60% at 22% 28%, rgba(0, 230, 180, 0.22) 0%, transparent 65%),
    radial-gradient(ellipse 60% 70% at 78% 72%, rgba(180, 250, 220, 0.14) 0%, transparent 65%),
    radial-gradient(ellipse 100% 80% at 50% 50%, rgba(40, 60, 55, 0.4) 30%, rgba(14, 22, 22, 0.85) 85%),
    linear-gradient(160deg, #122220 0%, #0d1a1a 60%, #08110f 100%) !important;
}

/* ── WARM CREAM palette ─────────────────────────────────── */
html.static-bg .anim-warm {
  background:
    radial-gradient(ellipse 78% 60% at 22% 28%, rgba(255, 220, 170, 0.22) 0%, transparent 65%),
    radial-gradient(ellipse 60% 70% at 78% 72%, rgba(255, 230, 195, 0.14) 0%, transparent 65%),
    radial-gradient(ellipse 100% 80% at 50% 50%, rgba(50, 38, 26, 0.4) 30%, rgba(20, 15, 10, 0.85) 85%),
    linear-gradient(160deg, #221a13 0%, #1a140e 60%, #110b07 100%) !important;
}

/* ── COOL BLUE palette ──────────────────────────────────── */
html.static-bg .anim-cool {
  background:
    radial-gradient(ellipse 78% 60% at 22% 28%, rgba(92, 138, 224, 0.28) 0%, transparent 65%),
    radial-gradient(ellipse 60% 70% at 78% 72%, rgba(200, 220, 250, 0.12) 0%, transparent 65%),
    radial-gradient(ellipse 100% 80% at 50% 50%, rgba(22, 28, 50, 0.45) 30%, rgba(10, 14, 24, 0.88) 85%),
    linear-gradient(160deg, #11192c 0%, #0c1322 60%, #080d18 100%) !important;
}

/* ── PINK / TEAL / BLUE multi palette ──────────────────── */
html.static-bg .anim-multi {
  background:
    radial-gradient(ellipse 55% 50% at 22% 22%, rgba(224, 92, 138, 0.22) 0%, transparent 60%),
    radial-gradient(ellipse 50% 55% at 78% 22%, rgba(78, 207, 160, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 55% 55% at 55% 82%, rgba(92, 138, 224, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 100% 90% at 50% 50%, transparent 35%, rgba(14, 16, 24, 0.7) 85%),
    linear-gradient(160deg, #131524 0%, #0e1018 60%, #080a14 100%) !important;
}

/* The .page-bg parent on these pages had pointer-events:none and z-index:0
   but no background; gradients show through and the rest of the page
   sits above it via its own z-index. Make sure the gradient layer
   covers the full viewport on those pages. */
html.static-bg .page-bg.anim-mint,
html.static-bg .page-bg.anim-warm,
html.static-bg .page-bg.anim-cool,
html.static-bg .page-bg.anim-multi {
  /* extend the gradient across the whole fixed page bg */
}

/* The mission card's iframe parent (mission-card) — anchor the
   gradient inside its rounded edges */
html.static-bg .mission-card.anim-mint,
html.static-bg .mission-card.anim-warm,
html.static-bg .mission-card.anim-cool,
html.static-bg .mission-card.anim-multi {
  /* already overflow:hidden + border-radius */
}

/* On desktop, none of these classes do anything */
@media (min-width: 721px) {
  .anim-mint,
  .anim-warm,
  .anim-cool,
  .anim-multi {
    /* no-op */
  }
}
