/* Welcome reporter - slides in at the bottom right, blinks, says hello, then leaves */
.reporter {
  position: fixed; right: 12px; bottom: 0; z-index: 60;
  width: 230px; pointer-events: none;
  transform: translateX(120%); opacity: 0;
  transition: transform .7s cubic-bezier(.25,1.2,.4,1), opacity .5s;
}
.reporter.in { transform: none; opacity: 1; }
.reporter.out { transform: translateX(120%); opacity: 0; transition: transform .6s ease-in, opacity .6s ease-in; }

.reporter-fig { position: relative; filter: drop-shadow(0 12px 18px rgba(0,0,0,.5)); }
.reporter-fig img { display: block; width: 100%; height: auto; }

/* Eyelids sit over each eye and close from the top. Positions are % of the picture. */
.reporter-lid {
  position: absolute; border-radius: 50% 50% 45% 45%;
  transform: scaleY(0); transform-origin: top center;
  box-shadow: inset 0 -2px 0 #1a0805;
}
.reporter-lid.l { left: 29.6%; top: 12.6%; width: 5.4%; height: 3%; background: linear-gradient(#a8613c, #b7693d 70%); }
.reporter-lid.r { left: 38.4%; top: 12.7%; width: 5.2%; height: 3%; background: linear-gradient(#c98557, #d9946a 70%); }
.reporter.blink .reporter-lid { animation: reporter-blink .26s ease-in-out; }
@keyframes reporter-blink { 0%, 100% { transform: scaleY(0); } 45%, 55% { transform: scaleY(1); } }

/* Speech bubble with the welcome note */
.reporter-note {
  position: absolute; right: 72%; bottom: 84%;
  width: min(270px, calc(100vw - 140px));
  padding: 14px 16px 12px; border-radius: 18px 18px 4px 18px;
  background: #fff; color: #1d1d1d; font-size: 14px; line-height: 1.45;
  box-shadow: 0 12px 28px rgba(0,0,0,.4);
  opacity: 0; transform: translateY(10px) scale(.92); transform-origin: bottom right;
  transition: opacity .35s, transform .35s cubic-bezier(.3,1.4,.5,1);
  pointer-events: auto;
}
.reporter.talk .reporter-note { opacity: 1; transform: none; }
.reporter-note b { display: block; font-size: 15px; margin-bottom: 4px; }
.reporter-note a { color: #e46d00; font-weight: 600; }
.reporter-note .rn-x {
  position: absolute; top: 6px; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.06); color: #555; font-size: 16px; line-height: 1; cursor: pointer;
}

/* Arrow on the reporter: slides her away to the right */
.reporter-hide {
  position: absolute; left: 4%; top: 46%; width: 42px; height: 42px; border-radius: 50%;
  border: 2px solid #fff; background: linear-gradient(135deg, #ff8a1f, #ff6a00); color: #fff;
  font-size: 22px; font-weight: 700; line-height: 1; cursor: pointer; pointer-events: auto;
  box-shadow: 0 6px 16px rgba(0,0,0,.45); opacity: 0; transition: opacity .3s, transform .2s;
}
.reporter.talk .reporter-hide { opacity: 1; animation: reporter-nudge 1.6s ease-in-out infinite; }
.reporter-hide:hover { transform: translateX(3px) scale(1.06); animation: none; }
.reporter-hide:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@keyframes reporter-nudge { 0%, 70%, 100% { transform: none; } 80% { transform: translateX(5px); } 90% { transform: translateX(-1px); } }

/* "Reporter here" sign hanging on two strings at the right edge while she is tucked away */
.reporter-tag {
  position: fixed; right: 10px; bottom: 150px; z-index: 60;
  border: 0; padding: 0; background: none; cursor: pointer; font: inherit;
  display: grid; justify-items: center;
  transform-origin: top center; transform: translateX(160%);
  opacity: 0; pointer-events: none; transition: transform .5s cubic-bezier(.25,1.3,.4,1), opacity .3s;
}
.reporter-tag.on { transform: none; opacity: 1; pointer-events: auto; animation: reporter-swing 3.2s ease-in-out .5s infinite; }
.rt-strings {
  width: 58px; height: 22px;
  background: linear-gradient(to bottom right, transparent calc(50% - 1px), #d9d2c8 50%, transparent calc(50% + 1px)) left / 50% 100% no-repeat,
              linear-gradient(to bottom left, transparent calc(50% - 1px), #d9d2c8 50%, transparent calc(50% + 1px)) right / 50% 100% no-repeat;
  position: relative;
}
.rt-strings::before { /* the nail the sign hangs from */
  content: ""; position: absolute; left: 50%; top: -4px; width: 8px; height: 8px; margin-left: -4px;
  border-radius: 50%; background: #9a9086; box-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.rt-board {
  padding: 8px 12px; border-radius: 10px; white-space: nowrap;
  background: #fff; color: #1d1d1d; font-size: 13px; font-weight: 700;
  border: 2px solid #ff8a1f; box-shadow: 0 8px 18px rgba(0,0,0,.45);
}
.reporter-tag:hover .rt-board { background: #fff4ea; }
.reporter-tag:focus-visible .rt-board { outline: 3px solid #ff8a1f; outline-offset: 2px; }
@keyframes reporter-swing { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(4deg); } 75% { transform: rotate(-4deg); } }

/* Phones: smaller, and above the bottom tab bar */
@media (max-width: 959px) {
  .reporter { width: 150px; right: 4px; bottom: 104px; }
  .reporter-note { right: 70%; bottom: 84%; font-size: 13px; width: min(230px, calc(100vw - 100px)); }
  .reporter-hide { width: 34px; height: 34px; font-size: 18px; }
  .reporter-tag { right: 6px; bottom: 112px; }
  .rt-board { font-size: 12px; padding: 6px 10px; }
}
/* The tag gives way to the chat message box */
body.in-chat .reporter-tag { display: none; }

@media (prefers-reduced-motion: reduce) {
  .reporter, .reporter.out { transform: none; transition: opacity .4s; }
  .reporter.blink .reporter-lid { animation: none; }
  .reporter.talk .reporter-hide, .reporter-tag.on { animation: none; }
}
