/* Selbstaufbauende Seite: Nav zeichnet sich, Überschrift setzt sich Wort für Wort,
   Karten erscheinen als Umriss und füllen sich dann. Reine Optik, keine Logik. */
@property --bi-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
:root { --bi-ease: cubic-bezier(.16, 1, .3, 1); }

@media (prefers-reduced-motion: no-preference) {
  html.bi-pre .main-wrap, html.bi-pre .apple-nav { opacity: 0; }
  .bi-wait { opacity: 0; }

  /* Navigation */
  .apple-nav::before { content: ""; position: absolute; left: 0; bottom: -1px; width: 100%; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; opacity: 0; pointer-events: none; }
  .apple-nav.bi-go::before { animation: bi-line 1.3s cubic-bezier(.65, 0, .25, 1) both; }
  .apple-nav.bi-go .nav-content > * { animation: bi-child .6s var(--bi-ease) calc(.2s + var(--i, 0) * .08s) backwards; }

  /* Überschrift Wort für Wort */
  .bi-w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
  .bi-w > span { display: inline-block; }
  .bi-go .bi-w > span { animation: bi-rise .95s var(--bi-ease) calc(.35s + var(--i, 0) * .09s) backwards; }
  .bi-fade.bi-go { animation: bi-child .8s var(--bi-ease) var(--d, 0s) backwards; }

  /* Karten: Umriss zeichnen -> Fläche füllen -> Inhalt einsetzen */
  .bi-card { position: relative; }
  .bi-card::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none; opacity: 0;
    background: conic-gradient(from 0deg, var(--accent) var(--bi-a), transparent calc(var(--bi-a) + 1deg));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
  .bi-card.bi-go { animation: bi-card .9s var(--bi-ease) var(--d, 0s) backwards, bi-fill .8s ease calc(var(--d, 0s) + .55s) backwards; }
  .bi-card.bi-go::after { animation: bi-trace 1.4s cubic-bezier(.5, 0, .2, 1) var(--d, 0s) both; }
  .bi-card.bi-go > * { animation: bi-child .65s var(--bi-ease) calc(var(--d, 0s) + .5s + var(--i, 0) * .07s) backwards; }
  .bi-card.bi-go .bi-sub { animation: bi-pop .55s var(--bi-ease) calc(var(--d, 0s) + .75s + var(--j, 0) * .09s) backwards; }
}

@keyframes bi-line { 0% { transform: scaleX(0); opacity: 1; } 60% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes bi-rise { from { transform: translateY(110%); } }
@keyframes bi-child { from { opacity: 0; transform: translateY(12px); } }
@keyframes bi-pop { from { opacity: 0; transform: translateY(8px) scale(.93); } }
@keyframes bi-card { from { transform: translateY(20px) scale(.985); } }
@keyframes bi-fill { from { background-color: transparent; border-color: transparent; } }
@keyframes bi-trace { 0% { --bi-a: 0deg; opacity: 0; } 2% { opacity: 1; } 70% { --bi-a: 360deg; opacity: 1; } 100% { --bi-a: 360deg; opacity: 0; } }
