/* Scene styling and keyframes for the hero animation of /features/id-checks.html,
   "Lukas rents a flat". Every animated element's resting style IS its final pose; the
   keyframes only animate towards it (fill-mode both), so a scene shown without animation
   (reduced motion) is complete. Keyframes run only while their scene carries .is-active.
   Timing: an element's timing class sets --ic-at (its start) and, for a flight, the
   --ic-dx / --ic-dy offset it flies in from. */

.ic-ink { color: var(--anim-ink); }
.ic-friend { color: var(--brand-2); }
.ic-brand { color: var(--brand-1); }
.ic-warm { color: var(--anim-warm); }
.ic-love { color: var(--anim-love); }
.ic-alert { color: var(--anim-alert); }
.ic-muted { color: var(--anim-muted); }
.ic-line { fill: var(--anim-muted); opacity: 0.7; }
.ic-line-ink { fill: var(--anim-ink); }
.ic-glow-soft { fill: var(--anim-warm-soft); }
.ic-floor { fill: var(--anim-muted); opacity: 0.35; }
.ic-beam, .ic-halo { fill: none; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; }
.ic-halo { stroke: var(--anim-warm-soft); stroke-width: 12; }
.ic-beam { stroke: var(--anim-warm); stroke-width: 3; }
.ic-beam-alert { stroke: var(--anim-alert); }
.ic-face-out, .ic-face-mid, .ic-gone, .ic-ringing, .ic-into, .ic-mid { opacity: 0; }
.ic-pop, .ic-fly, .ic-gone, .ic-drop, .ic-into, .ic-grow { transform-box: fill-box; transform-origin: center; }
.ic-grow { transform-origin: 0 50%; }
.ic-body { transform-box: fill-box; transform-origin: 50% 100%; }
.ic-buzz { transform-box: fill-box; transform-origin: 50% 50%; }

@keyframes ic-fade-in { from { opacity: 0; } }
@keyframes ic-fade-out { from { opacity: 1; } }
/* Shown only between two moments: in at the start, out at the end. */
@keyframes ic-mid { 0% { opacity: 0; } 14%, 86% { opacity: 1; } 100% { opacity: 0; } }
/* Gone for a while, then back: out at the start, in again at the end. */
@keyframes ic-away { 0% { opacity: 1; } 14%, 86% { opacity: 0; } 100% { opacity: 1; } }
@keyframes ic-pop { from { transform: scale(0); opacity: 0; } 50% { opacity: 1; } }
/* A thing flying to where it lands; each element names its own start offset. */
@keyframes ic-fly { from { transform: translate(var(--ic-dx, 0), var(--ic-dy, 0)) scale(0.4); opacity: 0; } 20% { opacity: 1; } }
/* A thing flying into a container and disappearing inside it. */
@keyframes ic-into { 0% { transform: translate(var(--ic-dx, 0), var(--ic-dy, 0)); opacity: 0; } 15% { opacity: 1; } 80% { transform: none; opacity: 1; } 100% { transform: translateY(14px) scale(0.6); opacity: 0; } }
/* Leaving: shrinks and fades to nothing. */
@keyframes ic-gone { from { transform: none; opacity: 1; } to { transform: scale(0.3); opacity: 0; } }
@keyframes ic-drop { from { transform: translateY(-70px); opacity: 0; } 30% { opacity: 1; } }
@keyframes ic-grow { from { transform: scaleX(0); } }
@keyframes ic-draw { from { stroke-dashoffset: 100; } }
@keyframes ic-hop { 0%, 100% { transform: none; } 40% { transform: translateY(-9px); } 70% { transform: translateY(2px); } }
@keyframes ic-giggle { 0%, 40%, 80%, 100% { transform: none; } 20% { transform: translateY(-6px) rotate(-2deg); } 60% { transform: translateY(-5px) rotate(2deg); } }
@keyframes ic-shake { 0%, 100% { transform: none; } 20% { transform: rotate(-4deg); } 40% { transform: rotate(4deg); } 60% { transform: rotate(-3deg); } 80% { transform: rotate(2deg); } }
@keyframes ic-buzz { 0%, 100% { transform: none; } 10%, 30%, 50%, 70%, 90% { transform: rotate(-6deg); } 20%, 40%, 60%, 80% { transform: rotate(6deg); } }
@keyframes ic-ring { 0% { opacity: 0; } 20%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* Springy entrances overshoot through the easing, not through extra keyframes. */
.is-active .ic-pop { animation: ic-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) var(--ic-at, 0s) both; }
.is-active .ic-fly { animation: ic-fly 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) var(--ic-at, 0s) both; }
.is-active .ic-drop { animation: ic-drop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) var(--ic-at, 0s) both; }
.is-active .ic-grow { animation: ic-grow 0.4s ease var(--ic-at, 0s) both; }
.is-active .ic-into { animation: ic-into 1.1s ease-in-out var(--ic-at, 0s) both; }
.is-active .ic-gone { animation: ic-gone 0.5s ease-in var(--ic-at, 1s) both; }
.is-active .ic-ringing { animation: ic-ring 1s ease var(--ic-at, 0.3s) both; }
.is-active .ic-buzzing { animation: ic-buzz 0.9s ease var(--ic-at, 0.3s) both; }
/* A face swap: the earlier face fades out as the later one fades in, at the pair's --ic-at. */
.is-active .ic-face-out { animation: ic-fade-out 0.2s ease var(--ic-at, 1s) both; }
.is-active .ic-face-in { animation: ic-fade-in 0.2s ease var(--ic-at, 1s) both; }
.is-active .ic-face-mid, .is-active .ic-mid { animation: ic-mid var(--ic-dur, 1.4s) linear var(--ic-at, 1s) both; }
.is-active .ic-away { animation: ic-away var(--ic-dur, 1.4s) linear var(--ic-at, 1s) both; }
.is-active .ic-hop { animation: ic-hop 0.5s ease-out var(--ic-at, 1s) both; }
.is-active .ic-giggle { animation: ic-giggle 0.6s ease var(--ic-at, 1s) both; }
.is-active .ic-shake { animation: ic-shake 0.4s ease var(--ic-at, 1s) both; }
.is-active .ic-beam, .is-active .ic-halo { animation: ic-draw 0.5s ease-in-out var(--ic-at, 1s) both; }

/* Scene 1, the moment: a flat and its key, and an agent asking for Lukas's passport. */
.ic-s1-lukas { --ic-at: 0.2s; }
.ic-s1-house { --ic-at: 0.3s; }
.ic-s1-key { --ic-at: 0.6s; }
.ic-s1-ask { --ic-at: 1s; }
.ic-s1-pass { --ic-at: 1.3s; }
.ic-s1-face { --ic-at: 2s; }

/* Scene 2, the old way: passport copies fly into three strangers' inboxes. */
.ic-s2-p1 { --ic-at: 0.5s; --ic-dx: -166px; --ic-dy: -6px; }
.ic-s2-p2 { --ic-at: 0.9s; --ic-dx: -276px; --ic-dy: 14px; }
.ic-s2-p3 { --ic-at: 1.3s; --ic-dx: -386px; --ic-dy: -6px; }
.ic-s2-no { --ic-at: 2s; }
.ic-s2-face, .ic-s2-lukas { --ic-at: 2.2s; }

/* Scene 3, allme: his passport is checked once on his phone and a verified tick appears. */
.ic-s3-pass { --ic-at: 0.4s; }
.ic-s3-l1 { --ic-at: 0.9s; }
.ic-s3-l2 { --ic-at: 1.1s; }
.ic-s3-check { --ic-at: 1.6s; }
.ic-s3-k1 { --ic-at: 1.9s; }
.ic-s3-k2 { --ic-at: 2s; }
.ic-s3-face, .ic-s3-lukas { --ic-at: 2.2s; }

/* Scene 4, the payoff: the agent receives a tick, not a copy, the key is his, and the same tick reaches another company later. */
.ic-s4-beam1 { --ic-at: 0.4s; }
.ic-s4-c1 { --ic-at: 0.9s; --ic-dx: -286px; --ic-dy: 124px; }
.ic-s4-key { --ic-at: 1.4s; }
.ic-s4-beam2 { --ic-at: 1.9s; }
.ic-s4-c2 { --ic-at: 2.4s; }
.ic-s4-face, .ic-s4-lukas { --ic-at: 2.6s; }
.ic-s4-k1 { --ic-at: 2.8s; }
.ic-s4-k2 { --ic-at: 2.9s; }
