
.import__drop {
  align-items: center;
  border: 2px dashed var(--color-border-darker);
  border-radius: 1em;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--block-space-half);
  justify-content: center;
  min-block-size: 12rem;
  overflow: clip;
  padding: var(--block-space-double) var(--inline-space);
  position: relative;
  text-align: center;
  transition: background-color 150ms ease, border-color 150ms ease;

  /* Stretched over the whole zone and above the picture, so a drop anywhere lands on it */
  input[type="file"] {
    block-size: 100%;
    cursor: pointer;
    inline-size: 100%;
    inset: 0;
    opacity: 0;
    position: absolute;
    z-index: 1;
  }

  &:hover,
  &:has(:focus-visible) {
    background-color: var(--color-border);
    border-color: var(--color-text);
  }

  &:has(:focus-visible) {
    outline: 2px solid var(--color-link);
    outline-offset: 2px;
  }
}

.import__name,
.import__bar {
  display: none;
}

.import__bar {
  background-color: var(--color-border);
  block-size: 0.4em;
  border-radius: 1em;
  inline-size: min(100%, 16rem);
  overflow: clip;

  span {
    background-color: var(--color-text);
    block-size: 100%;
    display: block;
    inline-size: var(--upload-progress, 0%);
    transition: inline-size 200ms linear;
  }
}

.import__drop--uploading {
  border-style: solid;
  pointer-events: none;

  .import__prompt {
    display: none;
  }

  .import__name,
  .import__bar {
    display: block;
  }
}

.import__sources {
  display: grid;
  gap: var(--block-space-half) var(--inline-space);
  grid-template-columns: max-content 1fr;
  margin: 0;

  dt {
    font-weight: 600;
  }

  dd {
    color: var(--color-text-subtle);
    margin: 0;
  }
}

.import__header {
  display: flex;
  flex-direction: column;
  gap: var(--block-space-half);
  text-wrap: balance;
}

/* The Campfire flame with conversations gathering around it. They drift in once when the page opens,
   and while an export uploads or imports, they keep flowing into the fire. */
.hearth {
  block-size: 9rem;
  display: grid;
  inline-size: 14rem;
  margin-inline: auto;
  place-items: center;

  > * {
    grid-area: 1 / 1;
  }
}

.hearth__fire {
  block-size: auto;
  inline-size: 4rem;
  position: relative;
}

.hearth__bubble {
  animation: hearth-gather 700ms calc(var(--i) * 90ms) cubic-bezier(0.2, 0.8, 0.3, 1.2) backwards;
  background-color: var(--color-message-bg);
  block-size: 1.2rem;
  border: 1px solid var(--color-border-darker);
  border-radius: 0.8em 0.8em 0.8em 0.15em;
  inline-size: calc(2rem + var(--i) * 0.3rem);
  translate: var(--x) var(--y);

  &:nth-child(even) {
    background-color: var(--color-text);
    border-color: var(--color-text);
    border-radius: 0.8em 0.8em 0.15em 0.8em;
  }

  /* Each source's mark, in one color as their brand guidelines allow */
  &:is(.hearth__bubble--slack, .hearth__bubble--discord) {
    block-size: 1.6rem;
    inline-size: 2.8rem;

    &::before {
      background-color: var(--color-text);
      block-size: 1rem;
      content: "";
      display: block;
      inline-size: 1rem;
      margin: 0.25rem auto;
      mask: var(--mark) center / contain no-repeat;
    }
  }

  &.hearth__bubble--slack {
    --mark: url("/assets/slack-cdbcb290.svg");
  }

  &.hearth__bubble--discord {
    --mark: url("/assets/discord-46909fd1.svg");

    &::before {
      background-color: var(--color-text-reversed);
    }
  }

  .hearth--burning &,
  .import__drop--uploading & {
    animation: hearth-burn 1.8s calc(var(--i) * 360ms) ease-in infinite both;
  }
}

@keyframes hearth-gather {
  from {
    opacity: 0;
    translate: calc(var(--x) * 1.8) calc(var(--y) * 1.8);
  }
}

@keyframes hearth-burn {
  0%   { opacity: 0; scale: 1; translate: calc(var(--x) * 1.4) calc(var(--y) * 1.4); }
  25%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0; scale: 0.2; translate: 0 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hearth__bubble,
  .hearth--burning .hearth__bubble,
  .import__drop--uploading .hearth__bubble {
    animation: none;
  }
}


