/* Feature pages: prose + animated illustration rows. Colours come from the page's own :root tokens. */
.story { padding-bottom: 24px; }
.story-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.story-row.rev .story-text { order: 2; }
.story-text h2 { font-size: clamp(28px, 3.2vw, 46px); font-weight: 700; margin-bottom: 18px; }
.story-text p { color: var(--muted); font-size: 18px; line-height: 1.7; max-width: 62ch; }
.story-text p strong { color: var(--text); font-weight: 600; }
.story-text a { color: var(--accent); }
.story-text .note { margin-top: 20px; font-size: 15px; }
.story-fig { margin: 0; background: var(--card); border: 1px solid var(--line-2); border-radius: 22px; padding: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.story-fig svg { display: block; width: 100%; height: auto; overflow: visible; }
@media (max-width: 900px) { .story-row { grid-template-columns: 1fr; gap: 28px; } .story-row.rev .story-text { order: 0; } .story-text p { font-size: 17px; } }

/* svg paint helpers */
.f-card { fill: var(--card-solid); } .f-p { fill: var(--primary); } .f-s { fill: var(--secondary); } .f-a { fill: var(--accent); }
.f-ok { fill: var(--ok); } .f-warn { fill: #f0b43c; } .f-bad { fill: #e0556b; } .f-dim { fill: hsl(225, 14%, 32%); } .f-line { fill: var(--line-2); }
.s-line { stroke: var(--line-2); fill: none; } .s-p { stroke: var(--primary); fill: none; } .s-a { stroke: var(--accent); fill: none; }
.s-ok { stroke: var(--ok); fill: none; } .s-warn { stroke: #f0b43c; fill: none; } .s-dim { stroke: hsl(225, 14%, 40%); fill: none; }
.t { fill: var(--muted); font: 600 13px var(--font-body); } .t-w { fill: #fff; font: 700 14px var(--font-body); }
.t-s { fill: var(--dim); font: 500 11px var(--font-body); } .t-d { fill: #fff; font: 700 16px var(--font-display); }
.mid { text-anchor: middle; } .end { text-anchor: end; }

/* motion */
.flow-dash { stroke-dasharray: 5 7; animation: sdm 1.2s linear infinite; }
.flow-rev { stroke-dasharray: 5 7; animation: sdm-r 1.2s linear infinite; }
.pulse { transform-box: fill-box; transform-origin: center; animation: spl 2.6s ease-in-out infinite; }
.float { animation: sfl 4s ease-in-out infinite; }
@keyframes sdm { to { stroke-dashoffset: -12; } }
@keyframes sdm-r { to { stroke-dashoffset: 12; } }
@keyframes spl { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes sfl { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* reveal on scroll (only when the script ran) */
.js .story-row { opacity: 0; transform: translateY(24px); transition: opacity .8s cubic-bezier(.25, .8, .25, 1), transform .8s cubic-bezier(.25, .8, .25, 1); }
.js .story-row.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .flow-dash, .flow-rev, .pulse, .float { animation: none; }
  .js .story-row { opacity: 1; transform: none; transition: none; }
}
