/* Loading screen: the wordmark rises letter by letter over Obsidian, a hairline fills as the page really loads,
   and the three engine dots light in turn. When everything is ready the screen lifts away like a curtain.
   It only exists while <html> has .is-loading (set by a tiny script in the head), so without JavaScript the page shows as normal. */
html.is-loading { overflow: hidden; }
.loader { display: none; }
html.is-loading .loader, .loader.is-leaving { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: var(--obsidian, #0B0B0C); }
.loader::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 50% at 50% 46%, rgba(250, 250, 248, 0.045), transparent 70%); }

.ld-inner { position: relative; display: grid; justify-items: center; gap: 26px; }
.ld-word { display: flex; font-family: var(--display); font-weight: 500; font-size: clamp(30px, 4.2vw, 56px); letter-spacing: -0.035em; color: var(--milk, #FAFAF8); line-height: 1.1; overflow: hidden; padding: .04em .02em .24em; }
.ld-word span { display: inline-block; transform: translateY(105%); opacity: 0; animation: ldRise .7s cubic-bezier(.2, .8, .2, 1) forwards; animation-delay: calc(var(--i) * 32ms + 100ms); }
.ld-word .ld-gap { width: .28em; }

/* the hairline: its fill follows real loading progress (--p, 0 to 1, written by the script) */
.ld-line { position: relative; width: clamp(140px, 16vw, 220px); height: 1px; background: rgba(250, 250, 248, 0.12); overflow: hidden; opacity: 0; animation: ldFade .6s ease .45s forwards; }
.ld-line::after { content: ""; position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); transition: transform .5s cubic-bezier(.2, .8, .2, 1);
  background: linear-gradient(90deg, rgba(250, 250, 248, 0.4), var(--milk, #FAFAF8)); box-shadow: 0 0 10px rgba(250, 250, 248, 0.5); }

/* the three engines: Studios, Growth, Acquisition */
.ld-dots { display: flex; gap: 12px; opacity: 0; animation: ldFade .6s ease .6s forwards; }
.ld-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); opacity: .35; animation: ldDot 2.4s ease-in-out infinite; }
.ld-dots i:nth-child(1) { --c: var(--studios, #FF4200); }
.ld-dots i:nth-child(2) { --c: var(--growth, #7AF4D0); animation-delay: .8s; }
.ld-dots i:nth-child(3) { --c: var(--acq, #6A4BF2); animation-delay: 1.6s; }

/* exit: the content settles, then the whole screen lifts away */
.loader.is-leaving .ld-inner { animation: ldOut .5s cubic-bezier(.4, 0, .2, 1) forwards; }
.loader.is-leaving { animation: ldLift .9s cubic-bezier(.76, 0, .24, 1) .3s forwards; }

@keyframes ldRise { to { transform: none; opacity: 1; } }
@keyframes ldFade { to { opacity: 1; } }
@keyframes ldDot { 0%, 100% { opacity: .35; box-shadow: none; } 18% { opacity: 1; box-shadow: 0 0 14px var(--c); } 40% { opacity: .35; box-shadow: none; } }
@keyframes ldOut { to { opacity: 0; transform: translateY(-12px); } }
@keyframes ldLift { to { transform: translateY(-100%); } }

@media (prefers-reduced-motion: reduce) {
  .ld-word span, .ld-line, .ld-dots { transform: none; opacity: 1; animation: none; }
  .ld-dots i { animation: none; opacity: .8; }
  .loader.is-leaving .ld-inner { animation: none; }
  .loader.is-leaving { animation: ldFadeOut .4s ease forwards; }
  @keyframes ldFadeOut { to { opacity: 0; } }
}
