/*
 * One-time typing reveal for inner-page hero headings.
 * The original server-rendered H1 remains intact when JavaScript is unavailable.
 */
.rf-type-word {
  display: inline-block !important;
  white-space: nowrap;
}

.rf-type-space {
  display: inline !important;
  white-space: pre;
}

.rf-type-heading .rf-type-char {
  display: inline-block !important;
  opacity: 0;
  transform: translateY(0.16em);
  filter: blur(3px);
  will-change: opacity, transform, filter;
}

.rf-type-heading.is-typing .rf-type-char {
  animation: rf-type-char-in 240ms cubic-bezier(0.2, 0.72, 0.2, 1) both;
  animation-delay: calc(120ms + (var(--rf-type-index) * 34ms));
}

.rf-type-heading.is-typed .rf-type-char {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.rf-type-caret {
  width: 0.08em;
  height: 0.82em;
  display: inline-block !important;
  margin-left: 0.08em;
  vertical-align: -0.04em;
  background: #FF4500;
  opacity: 0;
}

.rf-type-heading.is-typing .rf-type-caret {
  animation:
    rf-type-caret-start 1ms linear 100ms both,
    rf-type-caret-blink 620ms steps(1, end) 100ms infinite;
}

.rf-type-heading.is-typed .rf-type-caret {
  animation: rf-type-caret-finish 220ms ease both;
}

@keyframes rf-type-char-in {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes rf-type-caret-start {
  to { opacity: 1; }
}

@keyframes rf-type-caret-blink {
  0%,
  48% { opacity: 1; }
  49%,
  100% { opacity: 0; }
}

@keyframes rf-type-caret-finish {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .rf-type-heading .rf-type-char {
    opacity: 1;
    transform: none;
    filter: none;
    animation: none;
  }

  .rf-type-caret {
    display: none;
  }
}
