/* Elephant thought bubble (home doors, desktop 901px and up)
   The sleeping elephant dreams the door hint: "Select a door to enter" floats in a thought balloon,
   joined to its head by little bubbles. Everything inside is sized in em, so font-size sets the scale.
   - Classic: a calm, smooth oval balloon with a grey line like the elephant's own drawing. Four bubbles curve up from the top
     of its head to the balloon over its back, on the right, well away from the Blog / LinkedIn / Google Scholar buttons.
   - Forest: a puffy white cloud with a soft dark-green edge, like the forest elephant, tilted a little to the right.
     Three bubbles lean up and right from its forehead. The cloud sits in the gap between the ghost's stops
     over the Research and Books doors, so the ghost never covers it.
   - Hover the elephant and it wakes: the dream shrinks back into its head, then forms again.
   Phones and tablets (900px and below) keep the current hint. */

@media (min-width: 901px) {
  :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors > #chic-door-hint {
    position: absolute;
    right: auto;
    bottom: auto;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--ethink-w);
    height: var(--ethink-h);
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    clip-path: none;
    transform: none;
    translate: none;
    transform-origin: var(--ethink-head);
    font-style: italic;
    font-weight: 400;
    font-family: Georgia, serif;
    font-size: var(--ethink-size);
    line-height: 1.25;
    color: var(--ethink-ink);
    text-align: center;
    text-wrap: wrap;
    white-space: normal;
    text-shadow: none;
    background: var(--ethink-cloud) var(--ethink-from) / 100% 100% no-repeat;
    border-radius: 0;
    pointer-events: none;
    transition: opacity .3s ease, scale .35s ease;
  }

  /* Narrow enough that the words sit on two lines: "Select a door / to enter" */
  :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors > #chic-door-hint > .door-universal-hint {
    display: block;
    width: 6.286em;
    color: inherit;
  }

  /* The four little bubbles, from the head up: span::before, span::after, ::after, ::before (largest) */
  :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors > #chic-door-hint::before,
  :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors > #chic-door-hint::after,
  :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors > #chic-door-hint > .door-universal-hint::before,
  :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors > #chic-door-hint > .door-universal-hint::after {
    content: "";
    position: absolute;
    box-sizing: border-box;
    border: 1.4px solid var(--ethink-line);
    border-radius: 50%;
    background: var(--ethink-fill);
    box-shadow: var(--ethink-shadow);
  }
  :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors > #chic-door-hint > .door-universal-hint::before {
    left: var(--ethink-b1-x); top: var(--ethink-b1-y); width: .45em; height: .45em;
  }
  :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors > #chic-door-hint > .door-universal-hint::after {
    left: var(--ethink-b2-x); top: var(--ethink-b2-y); width: .6em; height: .6em;
  }
  :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors > #chic-door-hint::after {
    left: var(--ethink-b3-x); top: var(--ethink-b3-y); width: .75em; height: .75em;
  }
  :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors > #chic-door-hint::before {
    left: var(--ethink-b4-x); top: var(--ethink-b4-y); width: .9em; height: .9em;
  }

  /* Classic: small; balloon over the back, on the right; bubbles curve up from the top of the head */
  body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]) .chic-doors > #chic-door-hint {
    left: calc(50% + 18.7px);
    top: -79.1px;
    --ethink-size: 9px;
    --ethink-w: 10.444em;
    --ethink-h: 6.889em;
    --ethink-cloud: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 94 62'%3E%3Cpath d='M54.51 55.58C49.55 56.22 44.18 56.40 39.29 55.80C34.40 55.20 29.72 53.90 25.18 51.97C20.63 50.04 15.15 47.68 11.99 44.20C8.84 40.73 6.23 35.56 6.25 31.13C6.27 26.70 8.97 21.14 12.10 17.62C15.23 14.11 20.49 11.94 25.03 10.04C29.57 8.13 34.40 6.78 39.33 6.19C44.26 5.61 49.65 5.93 54.61 6.53C59.58 7.13 64.61 7.91 69.11 9.80C73.62 11.70 78.49 14.39 81.66 17.90C84.82 21.41 88.06 26.46 88.10 30.87C88.14 35.28 85.10 40.85 81.92 44.36C78.74 47.87 73.61 50.06 69.04 51.93C64.47 53.80 59.47 54.93 54.51 55.58Z' fill='%23fff' stroke='%23a4a19d' stroke-width='1.4' stroke-linejoin='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    --ethink-ink: #444;
    --ethink-line: #a4a19d;
    --ethink-fill: #fff;
    --ethink-shadow: none;
    --ethink-from: 10% 70%;
    --ethink-head: -4.97em 8.57em;
    --ethink-b1-x: -4.97em;  --ethink-b1-y: 7.12em;
    --ethink-b2-x: -3.8em;   --ethink-b2-y: 6.111em;
    --ethink-b3-x: -2.353em; --ethink-b3-y: 5.303em;
    --ethink-b4-x: -.639em;  --ethink-b4-y: 4.772em;
  }

  /* Forest: three bubbles lean up and right from the forehead; the cloud tilts a little to the right */
  body[data-site-scene="forest"] .forest-stage[data-scene="forest"] .chic-doors > #chic-door-hint {
    left: calc(50% - 128px);
    top: 70px;
    --ethink-size: 10px;
    --ethink-w: 10em;
    --ethink-h: 7.2em;
    --ethink-cloud: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 72'%3E%3Cdefs%3E%3Cfilter id='s' x='-5%25' y='-5%25' width='110%25' height='120%25'%3E%3CfeDropShadow dx='0' dy='1' stdDeviation='0.5' flood-color='%23142f24' flood-opacity='0.85'/%3E%3C/filter%3E%3C/defs%3E%3Cpath d='M57.65 63.96A12.95 12.95 0 0 1 37.19 62.10A12.72 12.72 0 0 1 19.73 53.94A12.60 12.60 0 0 1 8.35 37.10A12.19 12.19 0 0 1 14.49 19.38A13.25 13.25 0 0 1 32.74 9.59A13.24 13.24 0 0 1 52.44 8.11A12.28 12.28 0 0 1 71.62 13.01A13.43 13.43 0 0 1 87.86 25.80A11.77 11.77 0 0 1 90.86 44.23A13.37 13.37 0 0 1 76.83 58.86A12.70 12.70 0 0 1 57.65 63.96Z' fill='%23fff' fill-opacity='0.9'/%3E%3Cpath d='M57.65 63.96A12.95 12.95 0 0 1 37.19 62.10A12.72 12.72 0 0 1 19.73 53.94A12.60 12.60 0 0 1 8.35 37.10A12.19 12.19 0 0 1 14.49 19.38A13.25 13.25 0 0 1 32.74 9.59A13.24 13.24 0 0 1 52.44 8.11A12.28 12.28 0 0 1 71.62 13.01A13.43 13.43 0 0 1 87.86 25.80A11.77 11.77 0 0 1 90.86 44.23A13.37 13.37 0 0 1 76.83 58.86A12.70 12.70 0 0 1 57.65 63.96Z' fill='none' stroke='%23fff' stroke-width='1.4' stroke-linejoin='round' vector-effect='non-scaling-stroke' filter='url(%23s)'/%3E%3C/svg%3E");
    --ethink-ink: #24392d;
    --ethink-line: #fff;
    --ethink-fill: rgba(255, 255, 255, .9);
    --ethink-shadow: 0 1px 1px rgba(20, 47, 36, .85);
    --ethink-from: 49% 94%;
    --ethink-head: 4.3em 11em;
    --ethink-b1-x: 3.675em; --ethink-b1-y: 9.975em;
    --ethink-b2-x: 4.05em;  --ethink-b2-y: 8.8em;
    --ethink-b3-x: 4.525em; --ethink-b3-y: 7.625em;
  }
  body[data-site-scene="forest"] .forest-stage[data-scene="forest"] .chic-doors > #chic-door-hint::before {
    display: none;
  }
}

/* Motion: the bubbles pop up one by one from the head, then the cloud puffs out and the words appear.
   It plays each time the doors come into view; after that the dream floats gently.
   Skipped when the site's Motion is off or the visitor prefers reduced motion. */
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  body.motion-enabled :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors.doors-ready.doors-offscreen:not(.doors-static) > #chic-door-hint {
    visibility: hidden;
  }
  body.motion-enabled :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors.doors-ready:not(.doors-offscreen, .doors-static) > #chic-door-hint {
    animation: ethink-cloud .5s .7s ease-out both, ethink-float 5.8s 1.5s ease-in-out infinite;
  }
  body.motion-enabled :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors.doors-ready:not(.doors-offscreen, .doors-static) > #chic-door-hint > .door-universal-hint {
    animation: ethink-ink .4s 1.02s ease-out both;
  }
  body.motion-enabled :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors.doors-ready:not(.doors-offscreen, .doors-static) > #chic-door-hint > .door-universal-hint::before {
    animation: ethink-dot .34s .1s ease-out both;
  }
  body.motion-enabled :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors.doors-ready:not(.doors-offscreen, .doors-static) > #chic-door-hint > .door-universal-hint::after {
    animation: ethink-dot .34s .24s ease-out both;
  }
  body.motion-enabled :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors.doors-ready:not(.doors-offscreen, .doors-static) > #chic-door-hint::after {
    animation: ethink-dot .34s .38s ease-out both;
  }
  body.motion-enabled :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors.doors-ready:not(.doors-offscreen, .doors-static) > #chic-door-hint::before {
    animation: ethink-dot .34s .52s ease-out both;
  }

  /* The elephant wakes (hover): the dream shrinks back into its head. When it dozes off, the dream forms again. */
  body.motion-enabled :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors:has(.door-elephant.is-peeking) > #chic-door-hint {
    opacity: 0;
    scale: .4;
  }
  body.motion-enabled :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors.doors-ready:has(.door-elephant.is-peeking) > #chic-door-hint,
  body.motion-enabled :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors.doors-ready:has(.door-elephant.is-peeking) > #chic-door-hint::before,
  body.motion-enabled :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors.doors-ready:has(.door-elephant.is-peeking) > #chic-door-hint::after,
  body.motion-enabled :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors.doors-ready:has(.door-elephant.is-peeking) > #chic-door-hint > .door-universal-hint,
  body.motion-enabled :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors.doors-ready:has(.door-elephant.is-peeking) > #chic-door-hint > .door-universal-hint::before,
  body.motion-enabled :is(body[data-site-scene="plain"] .forest-landing:has(.forest-stage[data-scene="plain"]),
      body[data-site-scene="forest"] .forest-stage[data-scene="forest"]) .chic-doors.doors-ready:has(.door-elephant.is-peeking) > #chic-door-hint > .door-universal-hint::after {
    animation: none;
  }
}

@keyframes ethink-dot {
  from { scale: 0; opacity: 0; }
  60% { scale: 1.18; opacity: 1; }
  to { scale: 1; opacity: 1; }
}
@keyframes ethink-cloud {
  from { background-size: 0% 0%; }
  70% { background-size: 104% 104%; }
  to { background-size: 100% 100%; }
}
@keyframes ethink-ink {
  from { color: transparent; }
  to { color: var(--ethink-ink); }
}
@keyframes ethink-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -2px; }
}
