/* SVG path drawing.
   pathLength="1" makes every path exactly 1 unit long, so the dash is always
   1 and the offset goes from 1 (hidden) to 0 (drawn) — no measuring in JS.
   Exception to "animate only transform/opacity": stroke-dashoffset repaints the
   stroke on each frame. It is a single SVG, drawn once, so the cost is small. */

.draw__path {
  fill: none;
  stroke: var(--text, #f0ebe2);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.draw__path--echo {
  stroke: var(--accent, #ff6a3d);
  stroke-width: 2.5;
}
.draw__dot {
  fill: var(--accent, #ff6a3d);
  transform-box: fill-box;
  transform-origin: center;
}

@media (prefers-reduced-motion: no-preference) {
  .draw__path {
    animation: draw calc(var(--duration-cinematic) * 2) var(--ease-move) both;
  }
  .draw__path--echo {
    animation-duration: calc(var(--duration-cinematic) * 1.6);
    animation-delay: var(--duration-slow);
  }
  /* the dot lands when the main line ends, with a spring pop */
  .draw__dot {
    animation: pop var(--spring-bouncy-duration) var(--spring-bouncy) calc(var(--duration-cinematic) * 2 - 120ms) both;
  }
}

@keyframes draw {
  from { stroke-dashoffset: 1; }
  to   { stroke-dashoffset: 0; }
}
@keyframes pop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* Reduced motion: the drawing fades in already complete. */
@media (prefers-reduced-motion: reduce) {
  .draw { animation: fade var(--duration-slow) var(--ease-standard) both; }
}
@keyframes fade { from { opacity: 0; } }

/* demo layout */
.pd-stage { min-height: 100svh; display: grid; align-content: center; gap: 24px; max-width: 1180px; margin: 0 auto; padding: 96px 28px; }
.draw { width: 100%; height: auto; max-height: 52svh; overflow: visible; }
.pd-title { margin: 0; font: 700 clamp(40px, 6vw, 80px)/1 var(--font-display, system-ui, sans-serif); letter-spacing: -0.035em; }
.pd-replay { border: 0; background: none; color: var(--accent, #ff6a3d); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; }
