/*
 * XGene Stage 9 RC1h — narrow corrective release.
 * Scope: definitive Article Contact XGene contrast, Expert single hero attachment,
 * and governed 404 crystal-lattice motion. Preserves RC1f scrollbar/mobile fixes.
 */

/* 1) Article CTA: classify by explicit runtime data attributes and force both
      foreground and background so legacy article link rules cannot win. */
body.single-xg-article a[data-xg-rc1h-cta="book"]{
  color:#fff!important;-webkit-text-fill-color:#fff!important;
  background:#0b2e4a!important;border-color:#0b2e4a!important;
  text-decoration:none!important;box-shadow:0 9px 22px rgb(11 46 74 / 16%)!important
}
body.single-xg-article a[data-xg-rc1h-cta="contact"]{
  color:#fff!important;-webkit-text-fill-color:#fff!important;
  background:#087f86!important;border-color:#066d72!important;
  text-decoration:none!important;box-shadow:0 9px 22px rgb(8 127 134 / 22%)!important
}
body.single-xg-article a[data-xg-rc1h-cta="contact"]:hover,
body.single-xg-article a[data-xg-rc1h-cta="contact"]:focus-visible{
  color:#fff!important;-webkit-text-fill-color:#fff!important;
  background:#065f65!important;border-color:#054f54!important
}

/* Catch the visible decision CTA even if stored markup is not inside the
   editorial wrappers used by earlier releases. */
body.single-xg-article :is(.site-main,.site-content,#primary,#main) a[data-xg-rc1h-cta]{
  opacity:1!important;visibility:visible!important
}

/* 2) Expert single: remove every known Astra single-post top offset and make
      the hero the first visual band directly below the site header. */
body.single-xg-expert #page,
body.single-xg-expert #content,
body.single-xg-expert .site-content,
body.single-xg-expert .site-content>.ast-container,
body.single-xg-expert #content>.ast-container,
body.single-xg-expert .ast-container#content,
body.single-xg-expert #primary,
body.single-xg-expert .content-area,
body.single-xg-expert #main,
body.single-xg-expert article.xg-expert-profile__article{
  margin-top:0!important;padding-top:0!important
}
body.single-xg-expert.ast-separate-container .ast-article-single,
body.single-xg-expert.ast-separate-container .ast-article-post,
body.single-xg-expert .ast-article-single{
  margin:0!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important
}
body.single-xg-expert .xg-expert-profile__article>.xg-expert-hero{
  display:block!important;position:relative!important;left:50%!important;
  width:100vw!important;max-width:100vw!important;
  margin-top:0!important;margin-right:0!important;margin-bottom:0!important;margin-left:-50vw!important;
  padding-top:clamp(3.25rem,4.5vw,5rem)!important;padding-bottom:clamp(3.25rem,4.5vw,5rem)!important;
  border:0!important;border-radius:0!important
}
body.single-xg-expert .xg-expert-hero__grid{
  width:min(88rem,calc(100vw - 3rem))!important;max-width:88rem!important;
  margin:0 auto!important;padding:0!important
}
/* Collapse any empty block or pseudo spacing Astra inserts before the first
   expert article child. */
body.single-xg-expert .xg-expert-profile__article>:first-child{margin-top:0!important}
body.single-xg-expert .site-content:before,
body.single-xg-expert #content:before,
body.single-xg-expert #primary:before,
body.single-xg-expert #main:before{content:none!important;display:none!important}

/* 3) 404 crystal-lattice recovery visual. Native SVG/HTML/CSS only; no image
      or external runtime dependency. */
.xg-404-crystal-scene{
  position:relative;min-height:32rem;overflow:hidden;isolation:isolate;
  border:1px solid rgb(255 255 255 / 18%);border-radius:1.7rem;
  background:
    radial-gradient(circle at 50% 48%,rgb(25 221 231 / 16%),transparent 24%),
    radial-gradient(circle at 78% 22%,rgb(17 93 246 / 15%),transparent 23%),
    radial-gradient(circle at 22% 75%,rgb(244 122 60 / 12%),transparent 25%),
    linear-gradient(155deg,rgb(255 255 255 / 11%),rgb(255 255 255 / 3%));
  box-shadow:inset 0 1px rgb(255 255 255 / 10%);perspective:1000px
}
.xg-404-crystal-scene:before{content:"";position:absolute;inset:0;opacity:.18;background-image:linear-gradient(rgb(255 255 255 / 13%) 1px,transparent 1px),linear-gradient(90deg,rgb(255 255 255 / 13%) 1px,transparent 1px);background-size:34px 34px;mask-image:linear-gradient(to bottom,rgb(0 0 0 / 75%),transparent)}
.xg-404-crystal-scene__404{position:absolute;z-index:5;top:2.4rem;right:2.6rem;text-align:right}
.xg-404-crystal-scene__404 strong{display:block;font-size:clamp(6.5rem,10vw,10rem);line-height:.75;letter-spacing:-.08em;background:linear-gradient(135deg,#fff,#6ce7eb 52%,#ff9464);-webkit-background-clip:text;background-clip:text;color:transparent;filter:drop-shadow(0 12px 28px rgb(0 0 0 / 20%))}
.xg-404-crystal-scene__404 span{display:block;margin-top:.7rem;color:#9fe4e4;font-size:.75rem;font-weight:850;letter-spacing:.14em;text-transform:uppercase}
.xg-404-crystal-wrap{position:absolute;z-index:3;inset:5.2rem 2rem 4.4rem 2rem;display:grid;place-items:center;transform-style:preserve-3d;animation:xg404h-crystal-float 7.5s ease-in-out infinite}
.xg-404-crystal{width:min(100%,34rem);height:auto;overflow:visible;filter:drop-shadow(0 22px 32px rgb(0 0 0 / 18%));transform-style:preserve-3d}
.xg-404-crystal .xg-bond{stroke:#7adfe6;stroke-width:2.5;stroke-linecap:round;opacity:.66;stroke-dasharray:8 8;animation:xg404h-bond-flow 2.8s linear infinite}
.xg-404-crystal .xg-bond--blue{stroke:#6ea1ff}.xg-404-crystal .xg-bond--coral{stroke:#ff8c5a}.xg-404-crystal .xg-bond--lime{stroke:#a8df38}
.xg-404-crystal .xg-atom{transform-box:fill-box;transform-origin:center;animation:xg404h-atom-breathe 2.6s ease-in-out infinite}
.xg-404-crystal .xg-atom:nth-of-type(3n){animation-delay:-.8s}.xg-404-crystal .xg-atom:nth-of-type(4n){animation-delay:-1.4s}.xg-404-crystal .xg-atom:nth-of-type(5n){animation-delay:-2s}
.xg-404-crystal .xg-atom circle:first-child{stroke:rgb(255 255 255 / 58%);stroke-width:2;filter:drop-shadow(0 0 8px currentColor)}
.xg-404-crystal .xg-atom--teal{color:#38d3d8}.xg-404-crystal .xg-atom--teal circle:first-child{fill:#0aa6a6}
.xg-404-crystal .xg-atom--blue{color:#6b9bff}.xg-404-crystal .xg-atom--blue circle:first-child{fill:#115df6}
.xg-404-crystal .xg-atom--coral{color:#ff9365}.xg-404-crystal .xg-atom--coral circle:first-child{fill:#e97246}
.xg-404-crystal .xg-atom--lime{color:#b4e45a}.xg-404-crystal .xg-atom--lime circle:first-child{fill:#89cf19}
.xg-404-crystal .xg-electron{fill:#fff;filter:drop-shadow(0 0 5px #fff);transform-box:fill-box;transform-origin:center;animation:xg404h-electron 3.5s linear infinite}
.xg-404-crystal .xg-electron:nth-of-type(even){animation-direction:reverse;animation-duration:4.4s}
.xg-404-crystal-scene__route{position:absolute;z-index:7;bottom:1.4rem;padding:.65rem .9rem;border:1px solid rgb(255 255 255 / 35%);border-radius:.7rem;color:#fff!important;background:rgb(4 46 75 / 72%);font:800 .78rem/1.2 inherit;text-decoration:none!important}
.xg-404-crystal-scene__route--primary{left:1.5rem}.xg-404-crystal-scene__route--search{right:1.5rem;cursor:pointer}
@keyframes xg404h-bond-flow{to{stroke-dashoffset:-32}}
@keyframes xg404h-atom-breathe{0%,100%{transform:scale(.94)}50%{transform:scale(1.12)}}
@keyframes xg404h-electron{0%{transform:translate(-3px,-3px) scale(.8);opacity:.45}25%{transform:translate(5px,-2px) scale(1.1);opacity:1}50%{transform:translate(3px,5px) scale(.9);opacity:.72}75%{transform:translate(-5px,2px) scale(1.15);opacity:1}100%{transform:translate(-3px,-3px) scale(.8);opacity:.45}}
@keyframes xg404h-crystal-float{0%,100%{transform:rotateX(2deg) rotateY(-5deg) translateY(0)}50%{transform:rotateX(-3deg) rotateY(6deg) translateY(-10px)}}

/* Supersede all dog/photo layers from RC1e–RC1g if a cached selector survives. */
.xg-404-dog-scene,.xg-404-dog-motion,.xg-404-dog-photo,.xg-404-dog{display:none!important}

@media(max-width:1100px){
  body.single-xg-expert .xg-expert-hero__grid{width:min(100% - 2rem,88rem)!important}
  .xg-404-crystal-scene{display:none!important}
}
@media(prefers-reduced-motion:reduce){
  .xg-404-crystal-wrap,.xg-404-crystal .xg-bond,.xg-404-crystal .xg-atom,.xg-404-crystal .xg-electron{animation:none!important}
}
