/* Typewriter — text marked [data-typewriter] types itself out letter by letter
   (with a blue caret) when it comes into view, on first load and every time it
   scrolls back in. Remove this file, js/typewriter.js and the "Typewriter"
   blocks in home.html to take it out (also drop the data-typewriter
   attributes, and add .intro__headline / .intro__statement back to the
   fade-in lists in css/reveal.css and js/reveal.js if you still want them
   to fade in). */

/* .has-typewriter is set by an inline script in <head>: hide the text until
   js/typewriter.js has split it into letters, so it never flashes in full. */
.has-typewriter [data-typewriter]:not(.tw-ready) { visibility: hidden; }

/* Failsafe: if js/typewriter.js never starts, show the text after 4s. */
.has-typewriter:not(.typewriter-ready) [data-typewriter] {
  animation: typewriter-failsafe 0s linear 4s forwards;
}
@keyframes typewriter-failsafe {
  to { visibility: visible; }
}

/* Every letter keeps its place from the start, so lines never jump while typing. */
.tw-char { visibility: hidden; }
.tw-char.is-typed { visibility: visible; }

/* Zero-width caret: a plain inline span, so it never adds a line-break point. */
.tw-caret { position: relative; }
.tw-caret::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 0.14em;
  bottom: 0.1em;
  width: 2px;
  border-radius: 1px;
  background: var(--accent);
}
.tw-caret.is-idle::after { animation: tw-blink 1s steps(1, end) infinite; }
.tw-caret.is-leaving::after {
  opacity: 0;
  transition: opacity 0.4s var(--hover-ease, ease);
}
@keyframes tw-blink {
  50% { opacity: 0; }
}
