/* Social World and SOWO Admin's loading screen over the shared shell (absurd-loader.css), loaded for
   this app alone: web/branding names it, and the build links only it. */

/* The intro script brings a mark of its own. Keyed on the app rather than on a
   class the script adds, or the shared mark shows and then vanishes when the
   script lands. */
body:is([data-app-name="social_world"], [data-app-name="gus"]) .loader-brand {
  display: none;
}

/* ------------------------------------------------------------------
   The intro's variant screens (sowo-intro-screens.js): their first
   styles, then the loader's refinements of them.
   ------------------------------------------------------------------ */
.intro-headline {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--theme-on-background);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  text-align: center;
  opacity: 0;
  animation: fadeSlideUp 800ms ease-out 300ms forwards;
}

.intro-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  font-weight: 300;
  color: rgba(241, 241, 241, 0.7);
  letter-spacing: 0.5px;
  text-align: center;
  opacity: 0;
  animation: fadeSlideUp 600ms ease-out 600ms forwards;
}

.intro-headline.mono {
  font-family: 'Fira Code', 'Courier New', monospace;
  letter-spacing: 0;
}

.intro-headline.shimmer {
  background: linear-gradient(90deg,
      var(--theme-primary), var(--theme-secondary), var(--theme-primary));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeSlideUp 800ms ease-out 300ms forwards,
    gradientShimmer 3s linear infinite;
}

.intro-body .gradient-text {
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
}

.intro-body .color-indigo {
  color: #6366F1;
  -webkit-text-fill-color: #6366F1;
}

.intro-body .color-emerald {
  color: #10B981;
  -webkit-text-fill-color: #10B981;
}

.intro-body .sparkle::before {
  content: '✦ ';
  opacity: 0.7;
}

.intro-coord {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 11px;
  color: rgba(241, 241, 241, 0.3);
  letter-spacing: 1px;
  margin-bottom: 8px;
  opacity: 0;
  animation: fadeSlideUp 500ms ease-out 100ms forwards;
}

.intro-counter {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 72px;
  font-weight: 700;
  color: var(--theme-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.intro-counter-label {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: rgba(241, 241, 241, 0.5);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.intro-body .shimmer-word {
  background: linear-gradient(90deg,
      var(--theme-on-background), var(--theme-secondary), var(--theme-on-background));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShimmer 2s linear infinite;
}

.intro-body .color-purple {
  color: #762FEF;
  -webkit-text-fill-color: #762FEF;
}

.intro-body .color-gold {
  color: #FED338;
  -webkit-text-fill-color: #FED338;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gradientShimmer {
  0% {
    background-position: 200% center;
  }

  100% {
    background-position: -200% center;
  }
}

/* ------------------------------------------------------------------
   Intro-screen (FFFD / SOWO) overrides — preserved for the post-loader
   overlay copy. Kept structurally intact but cleaned up for consistency.
   ------------------------------------------------------------------ */
.intro-headline {
  max-width: 760px;
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 38px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0;
  color: var(--theme-on-background);
  text-align: center;
  opacity: 0;
  animation: loader-title-in 800ms ease-out 260ms forwards;
}

.intro-body {
  max-width: 520px;
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0;
  color: var(--loader-muted);
  text-align: center;
  opacity: 0;
  animation: loader-title-in 650ms ease-out 520ms forwards;
}

.intro-headline.mono,
.intro-coord,
.intro-counter {
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0;
}

.intro-headline.shimmer,
.intro-body .gradient-text,
.intro-body .shimmer-word {
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary), var(--theme-tertiary));
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: loader-title-in 800ms ease-out 260ms forwards, loader-text-flow 2600ms linear infinite;
}

.intro-body .color-indigo,
.intro-body .color-purple {
  color: var(--theme-primary);
  -webkit-text-fill-color: var(--theme-primary);
}

.intro-body .color-emerald,
.intro-body .color-gold {
  color: var(--theme-secondary);
  -webkit-text-fill-color: var(--theme-secondary);
}

.intro-coord,
.intro-counter-label {
  font-size: 11px;
  font-weight: 700;
  color: color-mix(in srgb, var(--theme-on-background) 42%, transparent);
  text-transform: uppercase;
}

.intro-counter {
  font-size: 68px;
  font-weight: 800;
  line-height: 0.95;
  color: var(--theme-secondary);
}

/* ------------------------------------------------------------------
   Social World - cosmic loader
   Logo-forward and copy-light. Keep the loading bar treatment, but
   drop the full-screen frame, beams, grid, noise, and footer wordmark.
   ------------------------------------------------------------------ */

/* The shared deco gold is an antique #c69a4a, which sits a long way from the
   gold in the mark. Everything drawn beside the logo should be the same gold
   as the smile. */
body[data-app-name="social_world"],
body[data-app-name="gus"] {
  /* The branding file's colours, held here too so the first paint is not the
     default loader's colours. */
  --theme-primary: #7c3aed;
  --theme-secondary: #f6c343;
  --theme-tertiary: #14b8a6;
  --theme-background: #07030c;
  --theme-on-background: #f1f1f1;
  --loader-deco: #f6c343;
  --loader-deco-rgb: 246, 195, 67;
  --loader-deco-soft: rgba(246, 195, 67, 0.38);
}

body:is([data-app-name="social_world"], [data-app-name="gus"]) .intro-overlay,
body:is([data-app-name="social_world"], [data-app-name="gus"]) .intro-text-container {
  display: none;
}

/* The SoWo mark carries the screen without promo copy. */
body:is([data-app-name="social_world"], [data-app-name="gus"]) .intro-headline,
body:is([data-app-name="social_world"], [data-app-name="gus"]) .intro-body,
body:is([data-app-name="social_world"], [data-app-name="gus"]) .intro-counter,
body:is([data-app-name="social_world"], [data-app-name="gus"]) .intro-counter-label,
body:is([data-app-name="social_world"], [data-app-name="gus"]) .intro-coord {
  display: none;
}

/* The mark and the bar are one object, so they hold together rather than
   drifting apart down the middle of an empty field. One width drives both:
   two clamps that happen to land near each other agree on wide screens and
   invert on narrow ones. */
body:is([data-app-name="social_world"], [data-app-name="gus"]) {
  --sowo-block: clamp(208px, 34vw, 320px);
}

body:is([data-app-name="social_world"], [data-app-name="gus"]) .loader {
  min-height: 0;
  gap: 40px;
}

/* ---- Progress ---------------------------------------------------- */
body:is([data-app-name="social_world"], [data-app-name="gus"]) .loader-status {
  width: var(--sowo-block);
  gap: 16px;
  opacity: 0;
  animation: loader-status-in 800ms cubic-bezier(0.2, 0.7, 0.2, 1) 620ms forwards;
}

/* A capsule with an unfilled remainder, drawn out from the middle on entry.
   The shared track is a pair of fading hairlines — at this width the empty
   part vanishes, so a part-full bar reads as a gold smear rather than
   progress against a known distance. */
body:is([data-app-name="social_world"], [data-app-name="gus"]) .loader-track {
  height: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--theme-on-background) 19%, transparent);
  transform: scaleX(0);
  transform-origin: center;
  animation: loader-rail-draw 900ms cubic-bezier(0.2, 0.7, 0.2, 1) 660ms forwards;
}

body:is([data-app-name="social_world"], [data-app-name="gus"]) .loader-track::before,
body:is([data-app-name="social_world"], [data-app-name="gus"]) .loader-track::after {
  display: none;
}

body:is([data-app-name="social_world"], [data-app-name="gus"]) .loader-track-fill {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 999px;
  width: calc(var(--loader-progress, 0) * 100%);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--loader-deco) 45%, transparent),
    var(--loader-deco)
  );
  box-shadow: 0 0 12px rgba(var(--loader-deco-rgb), 0.5);
}

/* The marker rides the head of the fill instead of marching back and forth
   on a loop that means nothing. */
body:is([data-app-name="social_world"], [data-app-name="gus"]) .loader-track-marker {
  left: calc(var(--loader-progress, 0) * 100%);
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  margin-left: -2.5px;
  animation: none;
  box-shadow: 0 0 12px rgba(var(--loader-deco-rgb), 0.85);
}

/* Only on completion, so the bar visibly closes as the screen leaves. */
body:is([data-app-name="social_world"], [data-app-name="gus"]) .loader-status.is-complete .loader-track-fill,
body:is([data-app-name="social_world"], [data-app-name="gus"]) .loader-status.is-complete .loader-track-marker {
  transition: width 520ms cubic-bezier(0.2, 0.8, 0.2, 1), left 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---- Status line ------------------------------------------------- */

/* The bar carries the motion now, so the pulsing dots are a second thing
   saying the same nothing — and they hung off the right of a centred line,
   pushing the words a dot-width out of true. */
body:is([data-app-name="social_world"], [data-app-name="gus"]) .loading-dots {
  display: none;
}

body:is([data-app-name="social_world"], [data-app-name="gus"]) .loader-status-line {
  justify-content: center;
  font-size: 9px;
  letter-spacing: 0.4em;
  color: color-mix(in srgb, var(--theme-on-background) 62%, transparent);
}

body:is([data-app-name="social_world"], [data-app-name="gus"]) .loader-status-text {
  /* Tracking hangs off the last letter; nudge back by half of it. */
  padding-left: 0.4em;
  transition: opacity 240ms ease, transform 240ms ease;
}

body:is([data-app-name="social_world"], [data-app-name="gus"]) .loader-status-text.is-swapping {
  opacity: 0;
  transform: translateY(-4px);
}

/* ---- Mark -------------------------------------------------------- */

/* The SoWo mark floats with a soft violet aura. */
body:is([data-app-name="social_world"], [data-app-name="gus"]) .intro-logo {
  width: var(--sowo-block);
  margin: 0;
  opacity: 0;
  transform: translateY(12px) scale(0.94);
  animation:
    loader-logo-in 1000ms cubic-bezier(0.2, 0.7, 0.2, 1) 140ms forwards,
    loader-logo-float 6s ease-in-out 1140ms infinite;
}

/* Two violet passes, tight then wide, plus a low warm one so the smile keeps
   its own colour instead of being swallowed by the purple bloom. */
body:is([data-app-name="social_world"], [data-app-name="gus"]) .intro-logo img {
  display: block;
  width: 100%;
  height: auto;
  filter:
    drop-shadow(0 0 16px color-mix(in srgb, var(--theme-primary) 40%, transparent))
    drop-shadow(0 0 56px color-mix(in srgb, var(--theme-primary) 22%, transparent))
    drop-shadow(0 8px 24px color-mix(in srgb, var(--theme-secondary) 15%, transparent));
}

@keyframes loader-status-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loader-rail-draw {
  to {
    transform: scaleX(1);
  }
}

@keyframes loader-logo-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes loader-logo-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-9px);
  }
}
