/* PatternField host + fallback. The host keeps its own content above the canvas. */
.pf-host {
  position: relative;
  isolation: isolate;
  /* CSS fallback (also shown before the first WebGL frame) */
  background-color: #040817;
  background-image:
    radial-gradient(60% 70% at 72% 50%, rgba(30, 70, 190, 0.28), transparent 70%),
    radial-gradient(40% 40% at 72% 50%, rgba(90, 70, 200, 0.12), transparent 70%),
    linear-gradient(180deg, #050b20 0%, #081436 100%);
}
.pf-host[data-pf="fallback"] {
  background-image:
    url("../img/pattern-field-fallback.8a0aa8357fdb.svg"),
    radial-gradient(60% 70% at 72% 50%, rgba(30, 70, 190, 0.28), transparent 70%),
    linear-gradient(180deg, #050b20 0%, #081436 100%);
  background-size: cover, auto, auto;
  background-position: 72% 50%, center, center;
  background-repeat: no-repeat;
}
.pf-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
  display: block;
}
/* Readability scrim: darkens behind the text column, leaves the focal pattern visible.
   Put <div class="pf-scrim" aria-hidden="true"></div> inside the host. */
.pf-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(3, 7, 22, 0.78) 0%, rgba(3, 7, 22, 0.5) 38%, rgba(3, 7, 22, 0) 68%),
    linear-gradient(180deg, rgba(3, 7, 22, 0.45) 0%, rgba(3, 7, 22, 0) 18%, rgba(3, 7, 22, 0) 80%, rgba(3, 7, 22, 0.6) 100%);
}
:dir(rtl) > .pf-scrim, [dir="rtl"] .pf-scrim {
  background:
    linear-gradient(270deg, rgba(3, 7, 22, 0.78) 0%, rgba(3, 7, 22, 0.5) 38%, rgba(3, 7, 22, 0) 68%),
    linear-gradient(180deg, rgba(3, 7, 22, 0.45) 0%, rgba(3, 7, 22, 0) 18%, rgba(3, 7, 22, 0) 80%, rgba(3, 7, 22, 0.6) 100%);
}
@media (max-width: 899px) {
  .pf-scrim, [dir="rtl"] .pf-scrim {
    background: linear-gradient(180deg, rgba(3, 7, 22, 0.72) 0%, rgba(3, 7, 22, 0.55) 45%, rgba(3, 7, 22, 0.1) 75%, rgba(3, 7, 22, 0.35) 100%);
  }
}

/* Light scheme: pale page, ink-coloured pattern. The scrim lightens behind the text instead of darkening. */
.pf-host[data-pf-scheme="light"] {
  background-color: #f6f7fb;
  background-image:
    radial-gradient(60% 70% at 72% 50%, rgba(120, 100, 220, 0.14), transparent 70%),
    linear-gradient(180deg, #f8f9fd 0%, #eef0f9 100%);
}
.pf-host[data-pf-scheme="light"] .pf-scrim {
  background:
    linear-gradient(90deg, rgba(246, 247, 251, 0.82) 0%, rgba(246, 247, 251, 0.5) 38%, rgba(246, 247, 251, 0) 68%),
    linear-gradient(180deg, rgba(246, 247, 251, 0.5) 0%, rgba(246, 247, 251, 0) 18%, rgba(246, 247, 251, 0) 80%, rgba(246, 247, 251, 0.6) 100%);
}
/* The scrim may sit deeper than the host (Home: inside .home-hero) and dir is usually set
   above the host, so match the scrim's own direction; this also outranks the light LTR rule. */
.pf-host[data-pf-scheme="light"] .pf-scrim:dir(rtl), [dir="rtl"] .pf-host[data-pf-scheme="light"] .pf-scrim {
  background:
    linear-gradient(270deg, rgba(246, 247, 251, 0.82) 0%, rgba(246, 247, 251, 0.5) 38%, rgba(246, 247, 251, 0) 68%),
    linear-gradient(180deg, rgba(246, 247, 251, 0.5) 0%, rgba(246, 247, 251, 0) 18%, rgba(246, 247, 251, 0) 80%, rgba(246, 247, 251, 0.6) 100%);
}
@media (max-width: 899px) {
  .pf-host[data-pf-scheme="light"] .pf-scrim, .pf-host[data-pf-scheme="light"][dir="rtl"] .pf-scrim {
    background: linear-gradient(180deg, rgba(246, 247, 251, 0.78) 0%, rgba(246, 247, 251, 0.6) 45%, rgba(246, 247, 251, 0.15) 75%, rgba(246, 247, 251, 0.4) 100%);
  }
}
