/* Official background layer — Baghdad Al Hayat Scientific Office.
   Replaces the animated "molecular network" with a still, ordered surface:
   a fine diamond lattice (echoing the facade of the head office) that fades out
   from the top edge, plus a hairline rule. No canvas, no particles, no glow,
   no motion. Colours follow the burgundy brand palette. */
:root{
  --amb-a:#b42865;          /* brand */
  --amb-b:#691237;          /* deep brand */
  --amb-c:#f08fba;          /* light brand (used on dark) */
  --amb-line:rgba(105,18,55,.075);
  --amb-rule:rgba(105,18,55,.22);
}

/* ---------- host sections ---------- */
.amb-host{position:relative;isolation:isolate}
.amb-layer{position:absolute;inset:0;z-index:-1;overflow:hidden;pointer-events:none;border-radius:inherit}

/* the lattice: one crisp diamond tile, strongest at the top, gone by ~70% */
.amb-layer::before{
  content:"";position:absolute;inset:0;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72'%3E%3Cpath d='M36 0 72 36 36 72 0 36Z' fill='none' stroke='%23691237' stroke-opacity='.10' stroke-width='1'/%3E%3C/svg%3E") center top/72px 72px repeat;
  -webkit-mask-image:linear-gradient(180deg,#000 0,rgba(0,0,0,.45) 42%,transparent 78%);
          mask-image:linear-gradient(180deg,#000 0,rgba(0,0,0,.45) 42%,transparent 78%);
}
/* hairline rule along the top edge */
.amb-layer::after{
  content:"";position:absolute;top:0;inset-inline:0;height:1px;
  background:linear-gradient(90deg,transparent,var(--amb-rule) 18%,var(--amb-rule) 82%,transparent);
}

/* dark blocks: the same lattice in white */
.amb-dark .amb-layer::before,
.amb-brand .amb-layer::before{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72'%3E%3Cpath d='M36 0 72 36 36 72 0 36Z' fill='none' stroke='%23ffffff' stroke-opacity='.075' stroke-width='1'/%3E%3C/svg%3E");
}
.amb-dark .amb-layer::after,
.amb-brand .amb-layer::after{background:linear-gradient(90deg,transparent,rgba(255,255,255,.22) 18%,rgba(255,255,255,.22) 82%,transparent)}

/* rounded brand block (home contact card) */
#contact .contact.amb-host{overflow:hidden}

/* ---------- scroll progress hairline (inner pages) ---------- */
.amb-progress{position:fixed;z-index:1001;top:0;left:0;right:0;height:2px;transform:scaleX(0);transform-origin:left;
  background:var(--amb-b);pointer-events:none}
html[dir="rtl"] .amb-progress{transform-origin:right}

/* ---------- finishing touches ---------- */
html{scroll-behavior:smooth}
::selection{background:rgba(105,18,55,.16)}
:focus-visible{outline-offset:3px}

@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
