/* ========== COLORS (from the logo) ========== */
/* White is the base. Red and yellow are used only as small accents. */
:root {
  --white: #ffffff;
  --red: #D90A17;       /* logo red */
  --yellow: #F8B80A;    /* logo yellow */
  --ink: #1B0709;       /* dark text */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--white);
  color: var(--ink);
  font-family: "Inter", "Noto Sans Devanagari", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* No scrolling while the loader is visible */
body.is-loading { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ========== LOADER (white background) ========== */
#loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.8s ease, transform 0.8s var(--ease);
}

/* Loader fades out and zooms a little */
#loader.hide { opacity: 0; transform: scale(1.08); pointer-events: none; }

.loader-ring { position: relative; width: 190px; height: 190px; }
.loader-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }

.ring-bg, .ring-bar { fill: none; stroke-width: 4; }
.ring-bg { stroke: rgba(27, 7, 9, 0.1); }
.ring-bar {
  stroke: var(--red);
  stroke-linecap: round;
  stroke-dasharray: 590.62;     /* 2 * 3.1416 * 94 */
  stroke-dashoffset: 590.62;    /* JS changes this */
}

.loader-logo {
  position: absolute;
  inset: 14px;
  width: calc(100% - 28px);
  height: calc(100% - 28px);
  border-radius: 50%;
  object-fit: cover;
  animation: pulse 1.6s ease-in-out infinite;
}

.loader-count {
  margin-top: 26px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  color: var(--red);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

/* ========== BACKGROUND LOGO (transparent, behind everything) ========== */
.bg-logo {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  overflow: hidden;
}

.bg-logo img {
  width: min(95vw, 95vh);
  height: auto;
  border-radius: 8%;
  opacity: 0;                         /* shown after the loader */
  filter: blur(1px);
  /* edges fade out softly */
  -webkit-mask-image: radial-gradient(circle at center, #000 45%, transparent 75%);
          mask-image: radial-gradient(circle at center, #000 45%, transparent 75%);
  transition: opacity 2s ease 0.3s, transform 0.4s ease-out;
  animation: drift 14s ease-in-out infinite;
}

/* After the loader, the background logo becomes faintly visible */
body:not(.is-loading) .bg-logo img { opacity: 0.1; }

@keyframes drift {
  0%, 100% { margin-top: 0; }
  50%      { margin-top: -18px; }
}

/* ========== MAIN ========== */
.stage {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px 70px;
}

/* Items appear one by one after the loader */
.fade {
  transition: opacity 1s var(--ease) var(--d, 0s), transform 1s var(--ease) var(--d, 0s);
}
body.is-loading .fade { opacity: 0; transform: translateY(26px); }

/* ========== LOGO WITH ROTATING TEXT ========== */
.badge {
  position: relative;
  width: min(86vw, 380px);
  aspect-ratio: 1;
}

.ring { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Outer text ring, clockwise, never stops */
.ring-text { animation: spin 20s linear infinite; }
.ring-text text {
  fill: var(--red);
  font-family: "Inter", Arial, sans-serif;
  font-size: 24px;
  font-weight: 600;
}

/* Inner dashed ring, opposite direction */
.ring-dash { animation: spin 40s linear infinite reverse; }
.ring-dash circle {
  fill: none;
  stroke: var(--yellow);
  stroke-width: 3;
  stroke-dasharray: 2 14;
  stroke-linecap: round;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Main logo in the middle */
.badge-logo {
  position: absolute;
  inset: 21%;
  width: 58%;
  height: 58%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 25px 60px -20px rgba(217, 10, 23, 0.55),
              0 0 0 6px var(--white),
              0 0 0 7px rgba(27, 7, 9, 0.08);
}

/* ========== TEXT ========== */
h1 {
  margin-top: 26px;
  font-family: "Noto Sans Devanagari", "Inter", Arial, sans-serif;
  font-size: clamp(2.4rem, 8vw, 4.6rem);
  font-weight: 800;
  line-height: 1.3;               /* Devanagari needs extra line height */
  color: var(--ink);
}
h1 .red { color: var(--red); }

/* Three dots that blink one after another */
.dots i { font-style: normal; animation: blink 1.4s infinite; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 20%   { opacity: 0; }
  50%, 100% { opacity: 1; }
}

.sub {
  max-width: 460px;
  margin-top: 6px;
  font-size: 1.05rem;
  opacity: 0.75;
}

.copy {
  position: absolute;
  bottom: 22px;
  left: 0; right: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  opacity: 0.5;
}

/* ========== MOBILE ========== */
@media (max-width: 500px) {
  .ring-text text { font-size: 26px; }
}

/* People who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}