/* ---------- Preloader (first visit per browser session) ---------- */
.preloader { display: none; }
.show-loader .preloader {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 42%, rgba(242,106,27,.22), transparent 42%), var(--night);
}
.show-loader body { overflow: hidden; }
.pl-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.pl-diya { width: 120px; height: 120px; overflow: visible; }
.pl-flame { transform-origin: 60px 50px; animation: flicker 1.1s ease-in-out infinite alternate; filter: drop-shadow(0 0 10px rgba(255,160,50,.8)); }
.pl-draw { stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 1.4s ease-out .1s forwards; }
.pl-name { font: 700 1.9rem/1.2 var(--f-te); color: var(--gold); margin-top: 10px; opacity: 0; animation: rise .6s ease-out .5s forwards; }
.pl-en { font-size: .68rem; letter-spacing: .12em; color: var(--gold-soft); opacity: 0; animation: rise .6s ease-out .7s forwards; }
.pl-bar { width: 160px; height: 2px; margin-top: 18px; background: rgba(255,255,255,.1); border-radius: 2px; overflow: hidden; }
.pl-bar span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--saffron), var(--gold)); transform-origin: left; transform: scaleX(0); animation: load 2.2s cubic-bezier(.3,.6,.2,1) forwards; }

@keyframes flicker {
  0%   { transform: scale(1, 1) rotate(-2deg); opacity: .95; }
  40%  { transform: scale(.94, 1.06) rotate(1.5deg); opacity: 1; }
  100% { transform: scale(1.04, .95) rotate(-1deg); opacity: .9; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes load { to { transform: scaleX(.9); } }

/* ---------- Hide hero pieces until the intro timeline plays ---------- */
.js-anim .hero-title span,
.js-anim .hero-sub,
.js-anim .hero-tiles li,
.js-anim .hero-cta,
.js-anim .page-title,
.js-anim .article-head > * { visibility: hidden; }

/* Parallax hooks, driven by GSAP through CSS variables */
.hero::before { transform: translate3d(0, var(--hero-y, 0px), 0) scale(var(--hero-s, 1)); will-change: transform; }
.site-head { transition: transform .35s ease, background .3s; }
.site-head.is-hidden { transform: translateY(-100%); }
.site-head.is-scrolled { background: rgba(8,18,34,.97); }

/* ---------- Image loading shimmer ---------- */
.js .v-thumb img, .js .p-thumb img, .js .lead-img img, .js .next-thumb img { opacity: 0; transition: opacity .45s ease; }
.js .is-loaded { opacity: 1 !important; }
.v-thumb, .p-thumb, .lead-img, .next-thumb {
  background: linear-gradient(100deg, var(--panel) 30%, #1b3157 50%, var(--panel) 70%) 0 0 / 250% 100%;
  animation: shimmer 1.4s linear infinite;
}
.v-thumb.done, .p-thumb.done, .lead-img.done, .next-thumb.done { animation: none; background: var(--panel); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }

/* ---------- Button loading state ---------- */
.btn.is-busy { pointer-events: none; opacity: .85; }
.btn.is-busy::after {
  content: ""; width: 1em; height: 1em; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Topic ring glow while hovered */
.topic-ring { position: relative; }
.topic-ring::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 1px solid rgba(243,181,63,.0); transition: border-color .25s, inset .25s;
}
.topic:hover .topic-ring::after { border-color: rgba(243,181,63,.45); inset: -9px; }

@media (prefers-reduced-motion: reduce) {
  .preloader { display: none !important; }
  .v-thumb, .p-thumb, .lead-img, .next-thumb { animation: none; }
  .site-head { transition: none; }
}
