/* Tocsin scenes: see scenes.js */
.sc { width: 100%; max-width: 440px; height: auto; display: block; margin-inline: auto; }
.sc .in { opacity: 0; animation: sc-in 320ms cubic-bezier(.2, .7, .2, 1) forwards; }
.sc .drop { opacity: 0; animation: sc-drop 520ms cubic-bezier(.2, .7, .2, 1) forwards; }
/* a caption or a line that is shown for one beat only: duration is set inline per element */
.sc .cap { opacity: 0; animation: sc-cap 2s linear forwards; }
.sc .draw { fill: none; stroke: #3a3f47; stroke-width: 1.5; stroke-dasharray: 600; stroke-dashoffset: 600; animation: sc-draw 700ms cubic-bezier(.2, .7, .2, 1) forwards; }
.sc .draw.amber { stroke: #e9a23b; }
.sc .draw.bad { stroke: #e5484d; }
.sc .head rect { stroke: #e9a23b; }
/* travellers: --dx/--dy set inline; .go stays where it lands, .mv is absorbed on arrival */
.sc .go, .sc .mv { opacity: 0; animation: sc-go 600ms cubic-bezier(.45, 0, .2, 1) forwards; }
.sc .mv { animation-name: sc-mv; }
.sc .mv.queued { opacity: 1; animation-fill-mode: both; } /* sits in the queue before it moves */
.sc .flash { opacity: 0; animation: sc-flash 900ms linear forwards; }
@keyframes sc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes sc-drop { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }
@keyframes sc-cap { 0% { opacity: 0; } 8% { opacity: 1; } 90% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sc-draw { to { stroke-dashoffset: 0; } }
@keyframes sc-go { 0% { opacity: 0; transform: none; } 12% { opacity: 1; transform: none; } 100% { opacity: 1; transform: translate(var(--dx), var(--dy)); } }
@keyframes sc-mv { 0% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)); } }
@keyframes sc-flash { 0%, 30%, 60% { opacity: 1; } 15%, 45% { opacity: .15; } 100% { opacity: 1; } }
/* held on the first frame until the section scrolls into view */
.sc-wait * { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  .sc .in, .sc .drop, .sc .draw, .sc .go, .sc .flash { animation: none; opacity: 1; stroke-dashoffset: 0; }
  .sc .go { transform: translate(var(--dx), var(--dy)); }
  .sc .cap, .sc .mv { animation: none; opacity: 0; }
}

/* Narration stays in document flow so it wraps instead of shrinking with the SVG. */
.scene-captions { display: grid; min-height: 3.2em; padding: 4px 20px 12px; color: #ece7dc; font: 14px/1.5 Inter, sans-serif; text-align: center; }
.scene-caption { grid-area: 1 / 1; align-self: start; opacity: 0; animation: sc-cap 2s linear forwards; }
.scene-caption-final { animation: sc-in 320ms ease forwards; }
@media (max-width: 480px) { .scene-captions { padding-inline: 12px; font-size: 13px; min-height: 4.5em; } }
@media (prefers-reduced-motion: reduce) {
  .scene-caption { animation: none; opacity: 0; }
  .scene-caption-final { opacity: 1; }
}

/* Scenes use a 360-unit canvas and keep labels readable at phone widths. */
.sc-compact text { font-size: 14px; }
