.demo-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.demo-particles > span {
  position: absolute;
  left: var(--x);
}

.demo-particles > span:nth-child(1) { --x: 4%; --delay: -.1s; --time: 1.3s; }
.demo-particles > span:nth-child(2) { --x: 12%; --delay: -2.3s; --time: 1.6s; }
.demo-particles > span:nth-child(3) { --x: 23%; --delay: -3.7s; --time: 1.9s; }
.demo-particles > span:nth-child(4) { --x: 31%; --delay: -1.1s; --time: 1.1s; }
.demo-particles > span:nth-child(5) { --x: 40%; --delay: -4.2s; --time: 1.8s; }
.demo-particles > span:nth-child(6) { --x: 49%; --delay: -5.4s; --time: 1.2s; }
.demo-particles > span:nth-child(7) { --x: 58%; --delay: -1.8s; --time: 1.6s; }
.demo-particles > span:nth-child(8) { --x: 65%; --delay: -3.4s; --time: 1.4s; }
.demo-particles > span:nth-child(9) { --x: 72%; --delay: -2.5s; --time: 1.1s; }
.demo-particles > span:nth-child(10) { --x: 79%; --delay: -5.1s; --time: 1.8s; }
.demo-particles > span:nth-child(11) { --x: 86%; --delay: -.7s; --time: 1.5s; }
.demo-particles > span:nth-child(12) { --x: 92%; --delay: -4.2s; --time: 1.3s; }
.demo-particles > span:nth-child(13) { --x: 96%; --delay: -2.8s; --time: 1.7s; }

.forest-rain {
  z-index: -1;
  mask-image: linear-gradient(90deg, transparent 16%, #000 75%);
}

.forest-rain > span {
  top: -70px;
  bottom: 0;
  width: 1px;
}

.forest-rain > span::before,
.forest-rain > span::after {
  content: '';
  position: absolute;
  top: 0;
  width: 1px;
  height: 20px;
  background: linear-gradient(transparent, #D6E8DD85);
  transform: rotate(8deg);
}

.forest-rain > span::after {
  top: -17px;
  left: 28px;
  height: 27px;
  opacity: .48;
}

.forest-rain > span:nth-child(3n)::before { height: 34px; }

.creative-hero { isolation: isolate; }
.creative-hero > div:first-child,
.creative-photo { position: relative; z-index: 1; }
.creative-hero .burst { z-index: 2; }

.creative-confetti { inset-inline: -14px; }

.creative-confetti > span {
  --piece: #CB4E7B;
  --sideways: 54px;
  top: -30px;
  bottom: 0;
  width: 0;
}

.creative-confetti > span:nth-child(2n) { --piece: #6254B6; --sideways: -40px; }
.creative-confetti > span:nth-child(3n) { --piece: #DB682F; --sideways: 25px; }
.creative-confetti > span:nth-child(5n) { --piece: #548A65; --sideways: -23px; }

.creative-confetti > span::before {
  content: '';
  display: block;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  background: var(--piece);
}

.creative-confetti > span:nth-child(3n)::before {
  height: 8px;
  border-radius: 50%;
}

.creative-confetti > span:nth-child(4n)::before {
  width: 14px;
  height: 14px;
  clip-path: polygon(50% 0, 63% 37%, 100% 50%, 63% 63%, 50% 100%, 37% 63%, 0 50%, 37% 37%);
}

.creative-ribbon-track { display: flex; width: max-content; }
.creative-ribbon-track > span { min-width: 100vw; padding-right: 38px; }

.workshop-symbol { position: relative; }

.workshop-project {
  width: 100%;
  margin-top: 14px;
  border-block: 1px solid #2920515C;
}

.workshop-project summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  gap: 10px;
  list-style: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.workshop-project summary::-webkit-details-marker { display: none; }
.workshop-project summary:focus-visible { outline: 2px solid; outline-offset: 3px; }

.workshop-project summary::after {
  content: '';
  width: 10px;
  height: 10px;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 2px,
    linear-gradient(currentColor, currentColor) center / 2px 100%;
  background-repeat: no-repeat;
}

.workshop-project[open] summary::after { background-size: 100% 2px, 2px 0; }
.workshop-grid .workshop-project p { margin: 0 0 14px; }

.cabin { position: relative; overflow: hidden; }
.cabin::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(112deg, transparent 35%, #E2F4DD22 49%, transparent 63%);
  pointer-events: none;
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .forest-rain > span { animation: forest-rainfall var(--time) linear var(--delay) infinite; }
  @keyframes forest-rainfall {
    from { transform: translate(0, 0); }
    to { transform: translate(-55px, calc(100% + 22px)); }
  }

  .creative-confetti > span {
    animation: creative-fall calc(var(--time) * 4) linear var(--delay) infinite;
  }

  .creative-confetti > span::before {
    animation: creative-tumble calc(var(--time) * 1.4) ease-in-out var(--delay) infinite alternate;
  }

  @keyframes creative-fall {
    0% { opacity: 0; transform: translate(0, 0); }
    12%, 86% { opacity: .85; }
    100% { opacity: 0; transform: translate(var(--sideways), 100%); }
  }

  @keyframes creative-tumble {
    from { transform: translateX(-10px) rotate(-65deg) scaleX(.55); }
    to { transform: translateX(10px) rotate(125deg) scaleX(1); }
  }

  .creative-hero .burst { animation: creative-sticker 3.6s ease-in-out infinite; }
  @keyframes creative-sticker {
    0%, 100% { transform: translateY(0) rotate(12deg); }
    50% { transform: translateY(-7px) rotate(4deg); }
  }

  .creative-ribbon-track { animation: creative-ribbon-loop 29s linear infinite; }
  @keyframes creative-ribbon-loop {
    to { transform: translateX(-50%); }
  }

  .workshop-symbol { transition: transform 230ms cubic-bezier(.2,.8,.3,1.4); }
  .workshop-grid article:focus-within .workshop-symbol,
  .workshop-grid article:hover .workshop-symbol { transform: translateY(-4px) rotate(-13deg); }
  .workshop-project summary::after { transition: background-size 180ms ease; }
  .workshop-project[open] p { animation: workshop-project-in 250ms ease-out both; }

  .workshop-symbol::after {
    content: '';
    position: absolute;
    top: 47%;
    left: 45%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    color: #5535A8;
    box-shadow: 31px -16px #D84925, -20px -25px currentColor, 12px -34px #368B68,
      -34px 5px #DE5174, 39px 4px currentColor, 26px 22px #368B68;
    opacity: 0;
    pointer-events: none;
  }

  .workshop-grid article:has(.workshop-project[open]) .workshop-symbol::after {
    animation: workshop-spark 620ms cubic-bezier(.17,.72,.29,1) both;
  }

  @keyframes workshop-project-in {
    from { opacity: .3; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @keyframes workshop-spark {
    0% { opacity: 0; transform: scale(.25); }
    28% { opacity: 1; }
    100% { opacity: 0; transform: scale(1.35) rotate(15deg); }
  }

  .cabin:is(:hover, :focus-within)::after { animation: cabin-glint 750ms ease-out both; }
  @keyframes cabin-glint {
    0% { opacity: 0; transform: translateX(-52%); }
    25% { opacity: 1; }
    100% { opacity: 0; transform: translateX(52%); }
  }

  .barber-title h1 > span {
    display: inline-block;
    animation: barber-type-in 500ms cubic-bezier(.16,.75,.35,1) both;
  }

  .barber-stamp { animation: barber-stamp-in 450ms 80ms cubic-bezier(.16,.77,.32,1.2) both; }
  @keyframes barber-type-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @keyframes barber-stamp-in {
    from { opacity: 0; transform: translateY(-12px) rotate(-7deg) scale(1.08); }
    to { opacity: 1; transform: translateY(0) rotate(8deg) scale(1); }
  }

  .barber-title .action span { transition: transform 190ms ease; }
  .barber-title .action:is(:hover, :focus-visible) span { transform: translate(3px, 3px); }
  .barber-title .action:is(:hover, :focus-visible) { background-color: var(--brick); color: #FFF; }

  @supports (animation-timeline: view()) {
    [data-scene-reveal] {
      animation: scene-reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 65%;
    }

    @keyframes scene-reveal {
      from { opacity: .8; translate: 0 9px; }
      to { opacity: 1; translate: 0 0; }
    }
  }
}

@media (max-width: 700px) {
  .forest-rain > span:nth-child(even),
  .creative-confetti > span:nth-child(even) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .demo-particles { display: none; }
  .barber-title .action:hover,
  .creative-hero .action:hover,
  .creative-includes .action:hover,
  .forest-copy .action:hover { transform: none; }
}
