/* Klein Lochieland · Tuisblad-opening · Stylgids v1
   Add-on only. All animation selectors are scoped to the kl-opening state.
   The SVG is a decorative element, not part of the official logo. */

/* In every state (including no JS) this SVG is a faint, unobtrusive decoration. */
#view-tuis .hero .kl-opening-rainbow {
  position: absolute;
  inset: -11% -3% auto;
  width: 106%;
  height: 108%;
  display: block;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
  opacity: .18;
}
#view-tuis .hero .kl-opening-rainbow .kl-opening-band {
  fill: none;
  stroke-width: 11;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: var(--kl-opening-path-length);
  stroke-dashoffset: 0;
  vector-effect: non-scaling-stroke;
}
/* Measured SVG path lengths in the fixed viewBox; no runtime measurements. */
#view-tuis .hero .kl-opening-band:nth-child(1) { --kl-opening-path-length: 1780; }
#view-tuis .hero .kl-opening-band:nth-child(2) { --kl-opening-path-length: 1720; }
#view-tuis .hero .kl-opening-band:nth-child(3) { --kl-opening-path-length: 1660; }
#view-tuis .hero .kl-opening-band:nth-child(4) { --kl-opening-path-length: 1600; }
#view-tuis .hero .kl-opening-band:nth-child(5) { --kl-opening-path-length: 1540; }
#view-tuis .hero .kl-opening-band:nth-child(6) { --kl-opening-path-length: 1480; }
/* Explicit stacking; does not move or resize existing page elements. */
#view-tuis .hero .hero-content { position: relative; z-index: 1; }
#view-tuis .hero .hero-wave { z-index: 2; }

/* Stage-specific animation styles run ONLY when JS adds .kl-opening. */
.kl-opening #view-tuis .hero .kl-opening-rainbow .kl-opening-band {
  animation: kl-opening-draw 735ms cubic-bezier(.25,.65,.22,1) both;
}
.kl-opening #view-tuis .hero .kl-opening-rainbow .kl-opening-band:nth-child(2) { animation-delay: 45ms; }
.kl-opening #view-tuis .hero .kl-opening-rainbow .kl-opening-band:nth-child(3) { animation-delay: 80ms; }
.kl-opening #view-tuis .hero .kl-opening-rainbow .kl-opening-band:nth-child(4) { animation-delay: 115ms; }
.kl-opening #view-tuis .hero .kl-opening-rainbow .kl-opening-band:nth-child(5) { animation-delay: 140ms; }
.kl-opening #view-tuis .hero .kl-opening-rainbow .kl-opening-band:nth-child(6) { animation-delay: 165ms; }
@keyframes kl-opening-draw {
  from { stroke-dashoffset: var(--kl-opening-path-length); }
  to { stroke-dashoffset: 0; }
}

/* The heading is already readable at the first frame. Nothing is hidden. */
.kl-opening #view-tuis .hero .hero-copy > .eyebrow,
.kl-opening #view-tuis .hero .hero-copy > h1 > span,
.kl-opening #view-tuis .hero .hero-copy > h1 > strong,
.kl-opening #view-tuis .hero .hero-copy > .hero-tag,
.kl-opening #view-tuis .hero .hero-copy > .hero-description,
.kl-opening #view-tuis .hero .hero-copy > .hero-actions,
.kl-opening #view-tuis .hero .hero-copy > .hero-note {
  animation: kl-opening-rise 380ms ease-out both;
}
.kl-opening #view-tuis .hero .hero-copy > .eyebrow { animation-delay: 280ms; }
.kl-opening #view-tuis .hero .hero-copy > h1 > span { animation-delay: 345ms; }
.kl-opening #view-tuis .hero .hero-copy > h1 > strong { animation-delay: 420ms; }
.kl-opening #view-tuis .hero .hero-copy > .hero-tag { animation-delay: 510ms; }
.kl-opening #view-tuis .hero .hero-copy > .hero-description { animation-delay: 625ms; }
.kl-opening #view-tuis .hero .hero-copy > .hero-actions { animation-delay: 725ms; }
.kl-opening #view-tuis .hero .hero-copy > .hero-note { animation-delay: 835ms; }
@keyframes kl-opening-rise {
  from { opacity: .82; transform: translate3d(0,7px,0); }
  to { opacity: 1; transform: translate3d(0,0,0); }
}

/* Respect the pre-existing 1deg rotation of the teddy frame. */
.kl-opening #view-tuis .hero .hero-visual {
  --kl-opening-rotation: 1deg;
  animation: kl-opening-picture 520ms cubic-bezier(.2,.65,.25,1) 490ms both;
}
@keyframes kl-opening-picture {
  from { opacity: .75; transform: rotate(var(--kl-opening-rotation)) translate3d(0,8px,0) scale(.975); }
  to { opacity: 1; transform: rotate(var(--kl-opening-rotation)) translate3d(0,0,0) scale(1); }
}

/* Decor elements retain their original rotation and position after playing. */
.kl-opening #view-tuis .hero .visual-leaf.l1 {
  animation: kl-opening-flower-one 490ms ease-out 840ms both;
}
.kl-opening #view-tuis .hero .visual-leaf.l2 {
  animation: kl-opening-flower-two 490ms ease-out 920ms both;
}
@keyframes kl-opening-flower-one {
  from { opacity: .45; transform: rotate(-25deg) translate3d(0,8px,0); }
  to { opacity: 1; transform: rotate(-25deg) translate3d(0,0,0); }
}
@keyframes kl-opening-flower-two {
  from { opacity: .45; transform: translate3d(0,8px,0); }
  to { opacity: 1; transform: translate3d(0,0,0); }
}

/* Animate the unchanged logo asset, not the artwork inside it. */
.kl-opening .site-header .brand img {
  animation: kl-opening-logo 390ms cubic-bezier(.2,.8,.2,1) 400ms both;
}
@keyframes kl-opening-logo {
  0%, 100% { transform: scale(1.04); }
  48% { transform: scale(1.105); }
  78% { transform: scale(1.025); }
}

@media (max-width: 680px) {
  #view-tuis .hero .kl-opening-rainbow {
    inset: -4% -20% auto;
    width: 140%;
    height: 54%;
    opacity: .13;
  }
  .kl-opening #view-tuis .hero .hero-visual { --kl-opening-rotation: 0deg; }
}

/* Explicitly bypass ALL motion for accessibility. Static decoration remains. */
@media (prefers-reduced-motion: reduce) {
  .kl-opening #view-tuis .hero .kl-opening-rainbow .kl-opening-band,
  .kl-opening #view-tuis .hero .hero-copy > *,
  .kl-opening #view-tuis .hero .hero-copy > h1 > *,
  .kl-opening #view-tuis .hero .hero-visual,
  .kl-opening #view-tuis .hero .visual-leaf,
  .kl-opening .site-header .brand img {
    animation: none !important;
    opacity: 1 !important;
  }
  .kl-opening #view-tuis .hero .kl-opening-rainbow .kl-opening-band { stroke-dashoffset: 0 !important; }
}

/* --- Matimba: stronger draw-in plus a gentle continuous shimmer --- */
#view-tuis .hero .kl-opening-rainbow{opacity:.34;animation:kl-rainbow-float 9s ease-in-out infinite}
#view-tuis .hero .kl-opening-rainbow .kl-opening-band{animation:kl-rainbow-glow 5s ease-in-out infinite}
#view-tuis .hero .kl-opening-band:nth-child(2){animation-delay:.35s}#view-tuis .hero .kl-opening-band:nth-child(3){animation-delay:.7s}
#view-tuis .hero .kl-opening-band:nth-child(4){animation-delay:1.05s}#view-tuis .hero .kl-opening-band:nth-child(5){animation-delay:1.4s}#view-tuis .hero .kl-opening-band:nth-child(6){animation-delay:1.75s}
@keyframes kl-rainbow-float{0%,100%{transform:translate3d(0,0,0)}50%{transform:translate3d(0,-10px,0)}}
@keyframes kl-rainbow-glow{0%,100%{opacity:.55}50%{opacity:1}}
.kl-opening #view-tuis .hero .kl-opening-rainbow{animation:kl-rainbow-bright 6s ease-out both}
.kl-opening #view-tuis .hero .kl-opening-rainbow .kl-opening-band{animation:kl-opening-draw 5000ms cubic-bezier(.4,0,.6,1) both}
@keyframes kl-rainbow-bright{0%,45%{opacity:.6}100%{opacity:.34}}
@media (max-width:680px){#view-tuis .hero .kl-opening-rainbow{opacity:.26}@keyframes kl-rainbow-bright{0%,45%{opacity:.5}100%{opacity:.26}}}
@media (prefers-reduced-motion:reduce){#view-tuis .hero .kl-opening-rainbow,#view-tuis .hero .kl-opening-rainbow .kl-opening-band{animation:none!important}}

/* --- Matimba: shooting star that leads the rainbow from the ground up and over --- */
#view-tuis .hero .kl-star-svg{position:absolute;inset:-11% -3% auto;width:106%;height:108%;display:block;z-index:0;pointer-events:none;overflow:visible}
#view-tuis .hero .kl-star{opacity:0}
#view-tuis .hero .kl-star-in{transform-box:fill-box;transform-origin:center}
.kl-opening #view-tuis .hero .kl-star{animation:kl-star-life 5.5s linear both}
.kl-opening #view-tuis .hero .kl-star-in{animation:kl-star-twinkle .32s ease-in-out infinite alternate}
@keyframes kl-star-life{0%{opacity:0}3%,90%{opacity:1}100%{opacity:0}}
@keyframes kl-star-twinkle{from{transform:scale(.85) rotate(0deg)}to{transform:scale(1.25) rotate(20deg)}}
.kl-opening #view-tuis .hero .kl-opening-rainbow .kl-opening-band:nth-child(n){animation-delay:0s}
@media (max-width:680px){#view-tuis .hero .kl-star-svg{inset:-4% -20% auto;width:140%;height:54%}}
@media (prefers-reduced-motion:reduce){#view-tuis .hero .kl-star,#view-tuis .hero .kl-star-in{animation:none!important;opacity:0!important}}
