/* Keep the page covered until its first scene can be displayed. */
html[data-hx-board-entry]::after {
  content: ""; position: fixed; inset: 0; z-index: 9047;
  background: var(--pl-panel-gray,#c8c8c8); pointer-events: none;
}
html[data-hx-loading]::before {
  content: ""; position: fixed; inset: 0; z-index: 9047; background: var(--pl-panel-gray,#c8c8c8);
}
#hx-page-gate { display: none; }
@media (max-width: 520px) {
  .pl-overlay-center .pl-overlay-tagline {
    display: grid; grid-template-columns: auto auto auto; justify-content: center;
    align-items: center; row-gap: .35rem; text-align: center;
  }
  .pl-overlay-tagline .pl-tag-word { white-space: nowrap; }
  .pl-overlay-tagline .pl-tag-dot:nth-child(4) { display: none; }
  .pl-overlay-tagline .pl-tag-word:last-child { grid-column: 1 / -1; }
}
html[data-hx-loading] body > :not(#hx-page-gate) { interactivity: inert; }
html[data-hx-loading] #hx-page-gate {
  display: block; position: fixed; inset: 0; z-index: 2147483646;
  pointer-events: none; touch-action: none;
}
/* While the scripts download, draw the outline of the original three pieces.
   The native intro takes ownership as soon as its overlay becomes active.
   Only a fresh document has data-hx-intro, so navigation cannot replay this. */
@media (prefers-reduced-motion: no-preference) {
  html[data-hx-intro]:not(:has(.pl-overlay.active)) .pl-overlay-center {
    visibility: visible;
  }
  html[data-hx-intro]:not(:has(.pl-overlay.active)) .pl-t-path {
    opacity: 1;
  }
  html[data-hx-intro]:not(:has(.pl-overlay.active)) .pl-t-path > path {
    stroke: #434343; stroke-width: 3; stroke-dasharray: 35 12;
    animation: hx-intro-trace 1.6s linear infinite;
  }
  @keyframes hx-intro-trace { to { stroke-dashoffset: -94; } }
}
.hx-gate-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.hx-gate-status > span { display: none; }
html[data-hx-loading="home"]:not([data-hx-load-error]) .hx-loading-home,
html[data-hx-loading="whitepaper"]:not([data-hx-load-error]) .hx-loading-paper,
html[data-hx-loading="home"][data-hx-load-error] .hx-error-home,
html[data-hx-loading="whitepaper"][data-hx-load-error] .hx-error-paper { display: inline; }
.hx-gate-retry, .hx-gate-status {
  position: absolute; left: 50%; transform: translateX(-50%); background: #c8c8c8;
  color: #262926; text-align: center; font: 400 13px/1.5 var(--font-martian,monospace);
}
/* A plain history entry or reduced-motion visit can have no native overlay.
   Give that wait a visible status, also available when scripts load slowly. */
html[data-hx-loading]:not(:has(.pl-overlay.active,.pl-trans-overlay.active)) .hx-gate-status,
html[data-hx-load-error] .hx-gate-status {
  width: max-content; max-width: 90vw; height: auto; clip-path: none;
  bottom: max(5rem,12vh);
}
@media (prefers-reduced-motion: no-preference) {
  html[data-hx-loading]:not([data-hx-load-error]):not(:has(.pl-overlay.active,.pl-trans-overlay.active)) .hx-gate-status::after {
    content: ""; display: block; width: 100%; height: 1px; margin-top: .5rem;
    background: linear-gradient(90deg, transparent, currentColor, transparent) -100% 0 / 50% 100% no-repeat;
    animation: hx-wait-line 1.4s ease-in-out infinite;
  }
  @keyframes hx-wait-line { to { background-position: 200% 0; } }
}
.hx-gate-retry {
  bottom: max(1.5rem,env(safe-area-inset-bottom)); padding: .6em 1em;
  text-decoration: underline; text-underline-offset: .25em; visibility: hidden; pointer-events: auto;
}
html[data-hx-loading] .hx-gate-retry { animation: hx-retry-visible 0s 18s forwards; }
@keyframes hx-retry-visible { to { visibility: visible; } }
html[data-hx-load-error] .hx-gate-status {
  bottom: 4.5rem;
}
html[data-hx-load-error] .hx-gate-retry { visibility: visible; animation: none; }
