/*
 * Brand skin (lumev2 FP-368): the placehold theme system shared by the loading
 * screen (app.blade.php), the Blade error pages and the SPA error pages.
 *
 * An element with class "brand-skin" and
 *   data-brand-theme="<family>"   theme family (public/media/brand/themes/<family>.css)
 *   data-bg="<n>"                 background variant index in that family
 *   data-brand-scheme="auto|app|light|dark"
 *                                 auto: device setting, app: the app's theme switch,
 *                                 light/dark: forced (previews)
 * paints the theme's base, layers and image. The moving layer is a child:
 *   <div class="brand-fx" style="--fx-src; --fx-filter; --fx-opacity">  vector effect
 *   <video class="brand-video" style="--video-filter; --video-opacity"> video clip
 * Defaults below are placehold's :root tokens (the dark look).
 */
.brand-skin {
  color-scheme: dark;
  --font-display: "Sora", "Inter", Arial, sans-serif;
  --font-body: "Inter", Arial, sans-serif;
  --font-logo: var(--font-display);
  --logo-glow1: color-mix(in srgb, var(--accent) 45%, transparent);
  --logo-glow2: color-mix(in srgb, var(--accent) 20%, transparent);
  --text: #f4f7f8;
  --muted: rgba(244, 247, 248, 0.64);
  --accent: #01b8e9;
  --accent-grad: linear-gradient(45deg, #a4e659, #4ae6a0, #01b8e9);
  --bg-base: #022b36;
  --bg-layers: none;
  --bg-image: none;
  --chip-bg: rgba(255, 255, 255, 0.08);
  --chip-border: rgba(255, 255, 255, 0.14);
  --halo: rgba(255, 255, 255, 0.06);
  --ghost: rgba(255, 255, 255, 0.03);
  --name-shadow: 0 0 22px var(--logo-glow1);
  --on-light-display: none;
  --on-dark-display: inline-flex;
  --fx-pre: brightness(1);
  --fx-blend: screen;
  --fx-scale: 1;
  --video-post: brightness(1);
  --video-blend: normal;
  --video-scale: 1;

  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--text);
  background-color: var(--bg-base);
  background-image: var(--bg-layers), var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* A forced dark scheme ignores the light variant even on a light device or app */
.brand-skin[data-brand-scheme="dark"] {
  color-scheme: dark;
}

.brand-on-light {
  display: var(--on-light-display) !important;
}

.brand-on-dark {
  display: var(--on-dark-display) !important;
}

/* Vector effect layer (neon / grid-wave art): screen blend drops its black
   ground on dark; inverted and multiplied on a light variant. Masked so it
   fades behind the content, slowly drifting. */
.brand-fx {
  position: absolute;
  inset: -12%;
  z-index: 0;
  background-image: var(--fx-src);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  mix-blend-mode: var(--fx-blend);
  filter: var(--fx-pre) var(--fx-filter, brightness(1));
  opacity: calc(var(--fx-opacity, 1) * var(--fx-scale));
  pointer-events: none;
  -webkit-mask-image: radial-gradient(115% 85% at 50% 60%, transparent 28%, #000 64%);
  mask-image: radial-gradient(115% 85% at 50% 60%, transparent 28%, #000 64%);
  animation: brand-fx-drift 75s ease-in-out infinite alternate;
}

/* Grid wave art (the GridWave theme, and the "grid" background of every family):
   fades out behind the copy and the card, exactly as placehold does (.fx), so
   the grid shows round the edges and the middle stays calm */
.brand-skin[data-brand-theme="gridwave"] .brand-fx,
.brand-skin[data-bg-id="grid"] .brand-fx {
  -webkit-mask-image: radial-gradient(115% 85% at 50% 72%, transparent 32%, #000 64%);
  mask-image: radial-gradient(115% 85% at 50% 72%, transparent 32%, #000 64%);
}

/* Video layer: cover crops instead of stretching. On a light variant the clip
   is inverted and multiplied, like the vector layer, so the chosen background
   still shows (FP-368); hidden for visitors who ask for reduced motion */
.brand-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: var(--video-blend);
  filter: var(--video-filter, brightness(1)) var(--video-post);
  opacity: calc(var(--video-opacity, 1) * var(--video-scale));
  pointer-events: none;
}

@keyframes brand-fx-drift {
  0% {
    transform: translate(-2.5%, -1.5%) scale(1);
  }
  50% {
    transform: translate(1.5%, 1%) scale(1.06);
  }
  100% {
    transform: translate(3%, -2%) scale(1.02);
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-fx {
    animation: none;
  }

  .brand-video {
    display: none;
  }
}

/* Net Advice's grid background (data-bg 4) is a still image on the page, not the masked effect layer
   the other themes use, so it had no calm centre. This overlay does what placehold's .fx mask does:
   the grid fades out behind the card and the copy and shows round the edges. The doubled class
   outranks themes/netadvice.css, which loads after this file and is generated. */
.brand-skin.brand-skin[data-brand-theme="netadvice"][data-bg="4"] {
  --bg-layers: radial-gradient(115% 85% at 50% 72%, rgba(1, 22, 30, 0.94) 32%, rgba(1, 22, 30, 0) 64%), var(--na-glow),
    linear-gradient(rgba(1, 20, 30, 0.42), rgba(1, 20, 30, 0.6));
}
