/* The homepage's ending (#turn, home-ending.js): the doorway to Starling's page, laid out as that page opens
   (apps/app/chat/agent.css, .agent-welcome): Starling on the staff its flock writes on, the question, the request box
   and the requests people bring. The flock (apps/app/chat/starling-flock.js, loaded from the app) flies behind it;
   the staff canvas sits under Starling's feet. Both take no pointer. */
@font-face {
  font-family: Leipzig;
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(/assets/fonts/leipzig.woff2) format("woff2");
}

.hm-end {
  isolation: isolate;
  overflow: hidden;
  /* Starling's page stands on a quiet ground of its own; the box and the requests are white on it. */
  background: var(--layer-1);
  --stage-space: 8px;
}
.hm-end-sky {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  color: var(--ink);
  pointer-events: none;
  will-change: transform;
}
/* Where the flock's ceiling is: the section's top. */
.hm-end-roof {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 0;
  pointer-events: none;
}
.hm-end-in {
  display: grid;
  justify-items: center;
  text-align: center;
}

/* Starling on the staff (agent.css .agent-welcome .sl-perched; starling.css .sl-perched, .sl-bird, .sl-cel). */
.hm-end .sl-perched {
  position: relative;
  display: flex;
  justify-content: center;
  box-sizing: border-box;
  width: min(100%, 944px);
  margin: 0 0 20px;
  padding-bottom: calc(var(--stage-space) * 6.25 - 4px);
}
.hm-end .sl-bird {
  --sl-size: 104px;
  --sl-box: var(--sl-size);
  --sl-cel-h: 1.2979;
  --sl-cel-w: 1.0966;
  --sl-cel-x: -0.1277;
  --sl-cel-y: -0.1571;
  position: relative;
  z-index: 1;
  display: inline-block;
  flex: none;
  width: var(--sl-size);
  height: var(--sl-size);
}
.hm-end .sl-cel {
  position: absolute;
  left: calc((var(--sl-size) - var(--sl-box)) / 2 + var(--sl-box) * var(--sl-cel-x));
  top: calc((var(--sl-size) - var(--sl-box)) / 2 + var(--sl-box) * var(--sl-cel-y));
  width: calc(var(--sl-box) * var(--sl-cel-w));
  height: calc(var(--sl-box) * var(--sl-cel-h));
  max-width: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.hm-end .sl-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--ink);
  pointer-events: none;
  will-change: transform;
}

.hm-end-title {
  max-width: 18em;
  margin: 0 0 clamp(24px, 4svh, 36px);
  font-family: var(--poster);
  font-size: clamp(40px, 4.6vw, 68px);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  color: var(--ink);
  text-wrap: balance;
}
:root:is(:lang(zh), :lang(ja), :lang(ko)) .hm-end-title {
  font-family: var(--display);
  font-size: clamp(32px, 3.6vw, 52px);
  font-weight: 600;
  line-height: var(--lh-heading);
  text-transform: none;
  word-break: keep-all;
}

.hm-end .hm-end-ask {
  width: min(100%, 780px);
  text-align: left;
}
.hm-end:not([data-end-visible]) .hc-demo::after {
  animation-play-state: paused;
}

/* The requests people bring, as Starling's page offers them; acted by the flock (data-playing) and put in the box when
   pressed. White on the ground, as the box is; each presses edge to edge with its neighbours. */
.hm-end-starters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  width: min(100%, 780px);
  margin-top: var(--space-4);
}
.hm-end-starter {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 0 var(--space-4) 0 var(--space-3);
  border: 0;
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 0 0 1px var(--hair);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
  cursor: pointer;
  transition:
    background-color 0.15s var(--ease),
    box-shadow 0.15s var(--ease);
}
/* The press reaches half the gap toward each neighbour and 2px past the drawn edge above and below (44px). */
.hm-end-starter::before {
  content: "";
  position: absolute;
  inset: -2px calc(var(--space-2) / -2);
}
.hm-end-starter .icon {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: color 0.15s var(--ease);
}
.hm-end-starter:hover,
.hm-end-starter[data-playing] {
  box-shadow: 0 0 0 1px var(--hair-strong);
}
.hm-end-starter[data-playing] .icon {
  color: var(--accent);
}
.hm-end-starter:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}
.hm-end-starter:active {
  transform: scale(0.97);
}

/* A laptop's short window: Starling and the staff as /agent sets them there. */
@media (min-width: 901px) and (max-height: 760px) {
  .hm-end {
    --stage-space: 6px;
  }
  .hm-end .sl-bird {
    --sl-size: 84px;
  }
  .hm-end .sl-perched {
    margin-bottom: 12px;
  }
}

@media (max-width: 759.98px) {
  .hm-end {
    --stage-space: 6px;
  }
  .hm-end .sl-bird {
    --sl-size: 76px;
  }
  .hm-end .sl-perched {
    margin-bottom: 14px;
  }
  .hm-end-starters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hm-end-starter {
    justify-content: flex-start;
    gap: 6px;
    min-height: 48px;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 13px;
    letter-spacing: -0.005em;
    text-align: left;
  }
  .hm-end-starter .icon {
    width: 16px;
    height: 16px;
  }
  .hm-end-starter::before {
    inset: calc(var(--space-2) / -2);
  }
}
@media (max-width: 759.98px) and (max-height: 700px) {
  .hm-end .sl-bird {
    --sl-size: 68px;
  }
  .hm-end-title {
    margin-bottom: var(--space-5);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hm-end-starter:active {
    transform: none;
  }
}
