/* Page transition — fast branded loader between internal pages.
   Exit: dark curtain sweeps up from the bottom with the davies_ mark.
   Entrance: page is covered from first paint, green bar completes,
   curtain lifts away. Whole round trip stays under a second per side. */

/* solid cover while an entering page paints, released once the
   loader overlay is on top */
html.tr-cover::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #050505;
}

#tr-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
}
#tr-loader .tr-curtain {
  position: absolute;
  inset: 0;
  background: #050505;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transform: translateY(102%);
  transition: transform 0.42s cubic-bezier(0.76, 0, 0.24, 1);
}
#tr-loader.tr-on .tr-curtain { transform: none; }
#tr-loader.tr-out .tr-curtain {
  transform: translateY(-102%);
  transition: transform 0.55s cubic-bezier(0.65, 0, 0.35, 1);
}
/* entering pages start already covered — no slide-in animation */
#tr-loader.tr-instant .tr-curtain,
#tr-loader.tr-instant .tr-brand { transition: none !important; }

.tr-brand {
  font-family: Figtree, "Figtree Fallback", system-ui, sans-serif;
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #f2f2f2;
  opacity: 0;
  transition: opacity 0.25s ease 0.1s;
}
.tr-brand i {
  font-style: normal;
  color: #35E07F;
  animation: trBlink 0.9s steps(2) infinite;
}
#tr-loader.tr-on .tr-brand { opacity: 1; }

.tr-bar {
  width: 132px;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.tr-bar span {
  display: block;
  height: 100%;
  background: #35E07F;
  transform: scaleX(0);
  transform-origin: left;
}
#tr-loader.tr-on .tr-bar span {
  animation: trBar 0.5s cubic-bezier(0.65, 0, 0.35, 1) 0.05s forwards;
}

@keyframes trBar { to { transform: scaleX(1); } }
@keyframes trBlink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  #tr-loader .tr-curtain { transition-duration: 0.01s !important; }
  #tr-loader.tr-on .tr-bar span { animation-duration: 0.01s; }
}
