/* CREATIVWORLDS logo intro. Plays once per visit on the homepage (add ?intro to the URL to replay).
   To turn it off, remove the intro.css link and the intro.js script from index.html.

   TIMING: edit the values at the top of the .intro block below. Each step has a start time
   (seconds after the page loads) and a duration. js/intro.js reads --end for the fade-out. */

html.intro-on body::before { content: ""; position: fixed; inset: 0; z-index: 9998; background: #000; }
html.intro-on body { overflow: hidden; }

.intro {
  /* 1. Circle outline draws from the bottom up */
  --outline-start: .1s;
  --outline-time: 0.5s;
  /* 2. Circle fills white, sweeping left to right */
  --fill-start: 0.5s;
  --fill-time: .3s;
  /* 3. Curved sphere line reveals top to bottom */
  --line-start: 0.9s;
  --line-time: .5s;
  /* 4. CREATIV slides out left, WORLDS slides out right */
  --word-start: 1.5s;
  --word-time: 1.0s;
  /* 5. Intro fades out to the homepage (the fade itself lasts .7s) */
  --end: 2.8s;

  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: #000; cursor: pointer;
  transition: opacity .7s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .7s;
}
.intro.is-done { opacity: 0; visibility: hidden; }

/* The sphere stays centered the whole time; the words slide out on either side of it */
.intro-logo { width: min(84vw, 684px); height: auto; overflow: visible; }

/* 1. Outline, drawn both ways from the bottom point; hidden once the fill is complete */
.intro-outline {
  stroke-dasharray: 0 1; stroke-dashoffset: -.0573;
  animation:
    intro-outline var(--outline-time) cubic-bezier(.65, 0, .35, 1) var(--outline-start) forwards,
    intro-fade-out .2s linear calc(var(--fill-start) + var(--fill-time)) forwards;
}

/* 2. Fill sweep */
.intro-fill-sweep {
  transform-box: fill-box; transform-origin: 0% 50%; transform: scaleX(0);
  animation: intro-sweep var(--fill-time) cubic-bezier(.45, 0, .2, 1) var(--fill-start) forwards;
}

/* 3. Sphere line */
.intro-line {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: intro-draw var(--line-time) cubic-bezier(.65, 0, .35, 1) var(--line-start) forwards;
}

/* 4. Words (they start tucked behind the sphere; 780 = distance each word travels, in logo units) */
.intro-word { animation: intro-word-out var(--word-time) cubic-bezier(.7, 0, .2, 1) var(--word-start) forwards; }
.intro-word-left { transform: translateX(780px); }
.intro-word-right { transform: translateX(-780px); }

@keyframes intro-outline { to { stroke-dasharray: 1 0; stroke-dashoffset: .4427; } }
@keyframes intro-fade-out { to { opacity: 0; } }
@keyframes intro-sweep { to { transform: scaleX(1); } }
@keyframes intro-draw { to { stroke-dashoffset: 0; } }
@keyframes intro-word-out { to { transform: none; } }

@media (prefers-reduced-motion: reduce) { .intro { display: none; } }
