/* Chorus — the line the person is typing, shown small and warm near the foot of the frame. */

.typed {
  position: fixed;
  left: 50%;
  bottom: clamp(104px, 17.5vh, 176px);
  z-index: 9;
  transform: translateX(-50%);
  max-width: 86vw;
  pointer-events: none;
  white-space: pre;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(21px, 2.1vw, 30px);
  line-height: 1.2;
  letter-spacing: 0.012em;
  color: var(--amber);
  text-shadow: 0 0 22px rgba(255, 122, 61, 0.5);
  opacity: 0.5;
  transition: opacity 0.6s ease, transform 1.3s cubic-bezier(0.2, 0.7, 0.2, 1), filter 1.3s ease, letter-spacing 1.3s ease;
}
.typed.on { opacity: 1; }
.typed.sent { opacity: 0; transform: translate(-50%, -54px); filter: blur(7px); letter-spacing: 0.2em; }
.typed.sent .caret { visibility: hidden; }

.typed .caret {
  display: inline-block;
  width: 1.5px;
  height: 0.92em;
  margin-left: 0.14em;
  vertical-align: -0.1em;
  background: var(--ember);
  box-shadow: 0 0 10px rgba(255, 122, 61, 0.9);
  animation: chorus-caret 1.15s steps(1, end) infinite;
}
@keyframes chorus-caret { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0.12; } }

/* The real text field, kept invisible: it gives touch devices a keyboard and gives everyone IME. */
.typed-field {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: 2px;
  height: 2px;
  padding: 0;
  border: 0;
  outline: 0;
  opacity: 0;
  font-size: 16px;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  pointer-events: none;
}

@media (max-width: 640px) {
  .typed { bottom: 212px; font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .typed { transition: opacity 0.4s ease; }
  .typed .caret { animation: none; }
}
