/* The empty state every index shares. Ghosts of the rows that will fill the
   screen sit behind the invitation, masked and inert, so a first visit
   previews where the page is going instead of apologising for being blank.
   The ghosts are built from the real components (.card, .card--row,
   .blockquote), so they cannot drift away from the rows they stand in for.

   Every class here is namespaced blank-*: one bundle ships on every page,
   so a bare name would be a claim on the whole app. */

.blank {
  display: grid;
  grid-template-columns: 1fr;
}

/* Ghosts and invitation share the one cell, so the card floats over the
   preview rather than pushing it down the page. */
.blank > * {
  grid-area: 1 / 1;
}

/* Quiet enough to read as a preview at a glance, even where the stack is one
   row deep and the fade has no room to work. A ghost that reads as content
   is a row the user tries to click. */
.blank-ghosts {
  pointer-events: none;
  user-select: none;
  opacity: 0.42;
  filter: saturate(0.25);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgb(0 0 0 / 55%) 45%, transparent 88%);
  mask-image: linear-gradient(180deg, #000 0%, rgb(0 0 0 / 55%) 45%, transparent 88%);
}

.blank-invite {
  align-self: center;
  justify-self: center;
  width: min(30rem, 100%);
  margin-block: 3.5rem 1rem;
  padding: 1.9rem 1.75rem 1.6rem;
  text-align: center;
  box-shadow:
    0 1.75rem 3rem -1.6rem color-mix(in srgb, var(--shadow) 34%, transparent),
    0 0.125rem 0.375rem -0.125rem color-mix(in srgb, var(--shadow) 10%, transparent);
}

/* Nothing to preview (a filter that matched nothing, a list already
   cleared): the card carries the page on its own and sits higher. */
.blank:not(:has(.blank-ghosts)) .blank-invite {
  margin-block: 2.25rem 1rem;
}

.blank-eyebrow {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.blank-headline {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.015em;
  font-size: clamp(1.35rem, 3.2vw, 1.75rem);
  line-height: 1.2;
  margin-bottom: 0.55rem;
}

.blank-lede {
  color: var(--muted);
  max-width: 26rem;
  margin: 0 auto 1.35rem;
  font-size: 0.95rem;
}

.blank-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
}

.blank-alt {
  color: var(--muted);
  font-size: 0.88rem;
  text-underline-offset: 3px;
  padding: 0.42rem 0.25rem;
}

.blank-alt:hover {
  color: var(--bs-body-color);
}

/* One orchestrated entrance: the ghosts surface in sequence, the invitation
   settles onto them. */
@media (prefers-reduced-motion: no-preference) {
  .blank-ghosts > * > * {
    animation: blank-surface 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  }

  .blank-ghosts > * > :nth-child(2) {
    animation-delay: 70ms;
  }

  .blank-ghosts > * > :nth-child(3) {
    animation-delay: 140ms;
  }

  .blank-ghosts > * > :nth-child(n + 4) {
    animation-delay: 210ms;
  }

  .blank-invite {
    animation: blank-settle 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both;
    animation-delay: 210ms;
  }
}

@keyframes blank-surface {
  from {
    opacity: 0;
    transform: translateY(0.7rem);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes blank-settle {
  from {
    opacity: 0;
    transform: translateY(1rem) scale(0.985);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Narrow screens have no room to stack the two, so the invitation leads and
   the preview follows it down the page. */
@media (max-width: 640px) {
  .blank {
    display: block;
  }

  .blank-invite {
    width: 100%;
    margin-block: 0 1.25rem;
  }
}
