/* Shared by the pre-script shell and every mounted DECRYPTING simulation. */
:root {
  --loading-foreground: 43 76% 53%;
  --loading-track: 0 0% 100%;
  --loading-surface: 0 0% 2%;
  --loading-glow: 0 0 10px hsl(var(--loading-foreground) / .55);
}
/* Startup, route and media loading stay silent on every screen size. */
#boot-shell,
[data-app-loading],
.decrypting-simulation { display: none !important; }
.decrypting-simulation {
  position: relative;
  isolation: isolate;
  align-items: center;
  width: min(460px, calc(100vw - 48px));
  max-width: 100%;
  height: 68px;
  box-sizing: border-box;
  padding: 0 26px;
  gap: 16px;
  border: 1px solid hsl(var(--loading-track) / .09);
  background: hsl(var(--loading-surface) / .94);
  box-shadow: 0 10px 30px hsl(0 0% 0% / .9);
  color: hsl(var(--loading-foreground));
  font-family: ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}
/* Four gold corner brackets */
.decrypting-simulation::before,
.decrypting-simulation::after,
.decrypting-scan::before,
.decrypting-scan::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-color: hsl(var(--loading-foreground));
  pointer-events: none;
}
.decrypting-simulation::before { top: -1px; left: -1px; border-top: 1px solid; border-left: 1px solid; }
.decrypting-simulation::after { bottom: -1px; right: -1px; border-bottom: 1px solid; border-right: 1px solid; }
.decrypting-scan::before { top: -1px; right: -1px; border-top: 1px solid; border-right: 1px solid; }
.decrypting-scan::after { bottom: -1px; left: -1px; border-bottom: 1px solid; border-left: 1px solid; }
.decrypting-simulation > span {
  position: relative;
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  color: transparent;
  white-space: nowrap;
}
.decrypting-simulation > span::after {
  position: absolute;
  inset: 0;
  content: "[DECRYPTING]";
  color: hsl(var(--loading-foreground));
  letter-spacing: .32em;
  text-shadow: var(--loading-glow);
  animation: decrypting-code 3.6s steps(1, end) infinite;
}
/* Subtle telemetry ticks on the right edge */
.decrypting-simulation > span::before {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 30px;
  height: 9px;
  transform: translateY(-50%);
  background: repeating-linear-gradient(to right, hsl(var(--loading-foreground) / .38) 0 2px, transparent 2px 7px);
  animation: decrypting-signal 1.8s ease-in-out infinite reverse;
}
.decrypting-scan {
  position: static;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: hsl(var(--loading-foreground));
  box-shadow: var(--loading-glow);
  animation: decrypting-signal 2.4s ease-in-out infinite;
}
.decrypting-scan span {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  overflow: hidden;
  background: hsl(var(--loading-track) / .04);
}
.decrypting-scan span::after {
  content: "";
  position: absolute;
  inset-block: 0;
  left: 0;
  width: 32%;
  background: linear-gradient(90deg, transparent, hsl(var(--loading-foreground) / .8), transparent);
  animation: decrypting-sweep 3.6s ease-in-out infinite;
}
@keyframes decrypting-code {
  0% { content: "[7#X@9&K2$Q]"; }
  4% { content: "[Q8&4X#7@N2]"; }
  8% { content: "[D$9#K2&X7@]"; }
  12% { content: "[D7@Q4#N8&X]"; }
  16% { content: "[DE#2$X9&7Q]"; }
  20% { content: "[DE8@4&K#2N]"; }
  24% { content: "[DEC#7@Q4&X]"; }
  28% { content: "[DEC9&2$K7#]"; }
  32% { content: "[DECR#8@4&X]"; }
  36% { content: "[DECR7$Q2#N]"; }
  40% { content: "[DECRY@4&8#]"; }
  44% { content: "[DECRY7$Q2&]"; }
  48% { content: "[DECRYP#9@X]"; }
  52% { content: "[DECRYP4&2#]"; }
  56% { content: "[DECRYPT@8&]"; }
  60% { content: "[DECRYPT7#Q]"; }
  64% { content: "[DECRYPTI&2]"; }
  68% { content: "[DECRYPTI9#]"; }
  72% { content: "[DECRYPTIN@]"; }
  76%, 100% { content: "[DECRYPTING]"; }
}
@keyframes decrypting-signal { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes decrypting-sweep { from { transform: translateX(-100%); } to { transform: translateX(415%); } }
@media (prefers-reduced-motion: reduce) {
  .decrypting-simulation > span::before, .decrypting-simulation > span::after, .decrypting-scan, .decrypting-scan span::after { animation: none; }
  .decrypting-scan span::after { left: 34%; }
}
