/* Hero text motion (see hero-motion.js). The server-rendered text stays in the DOM;
   html[data-hm="pending"] only holds the hero copy back until the script has measured lines. */
html[data-hm="pending"] #calamophyton-home[data-page="home"] .calamophyton-hero-kicker,
html[data-hm="pending"] #calamophyton-home[data-page="home"] .calamophyton-hero-phrase {
  opacity: 0;
  animation: hm-failsafe 0s linear 1.4s forwards; /* if the script never runs, show the copy */
}
@keyframes hm-failsafe { to { opacity: 1; } }

/* flex column: sibling margins of the lines do not collapse, so padding and negative margin cancel exactly (no layout shift). */
#calamophyton-home [data-hm-active] { display: flex; flex-direction: column; }
#calamophyton-home [data-hm-active] .hm-line {
  display: block;
  overflow: hidden;
  padding: 0.12em 0.25em 0.2em;
  margin: -0.12em -0.25em -0.2em;
}
#calamophyton-home [data-hm-active] .hm-inner { display: block; white-space: nowrap; will-change: transform; }
#calamophyton-home [data-hm-active] .hm-w { display: inline; }
#calamophyton-home [data-hm-active] .hm-c { display: inline-block; text-align: center; }

/* The hero copy block fades in over 0.8s in the existing timeline; with the line reveal it
   should be visible from the first frame, keep the existing hold and fade-out unchanged. */
#calamophyton-home[data-page="home"][data-hero-ready="true"] .calamophyton-hero-headline {
  animation-name: calamophyton-hero-copy-motion;
}
@keyframes calamophyton-hero-copy-motion {
  0%, 75.5% { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-hm="pending"] #calamophyton-home[data-page="home"] .calamophyton-hero-kicker,
  html[data-hm="pending"] #calamophyton-home[data-page="home"] .calamophyton-hero-phrase { opacity: 1; animation: none; }
  #calamophyton-home[data-page="home"][data-hero-ready="true"] .calamophyton-hero-headline { animation: none; opacity: 1; }
}
