/* The animated mock-ups of src/animations: a stage with one shot at a time. Every delay is seconds from the start
   (--from, --to, --t in the markup), so the video recorder can seek to any moment. Sizes follow the stage (cq units). */
figure.an { max-width: 36rem; margin: 1rem auto 1.5rem; }
.an-box { position: relative; }
/* A guide holds thousands of animated elements: those off screen are not laid out. The stage's size does not depend on them. */
figure.an .an-stage { content-visibility: auto; }
.an-stage {
  position: relative; container-type: size; aspect-ratio: 1; overflow: hidden; border-radius: 16px;
  background: #efeae2; color: #0d0d0d; line-height: 1.35;
  font-family: an-emoji, ui-sans-serif, Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.an-stage::before { content: ""; position: absolute; inset: 0; background: url(/doodle.svg?v=p63P6AwaUaOd75B1) 0 0 / 700px auto repeat; opacity: .07; mix-blend-mode: multiply; }
@media (max-width: 600px) { .an-stage { aspect-ratio: 4 / 5; } }
.an .an-stage p, .an-video .an-stage p { margin: 0; }
figure.an figcaption { margin-top: .5rem; font-size: .875rem; color: var(--muted); text-align: center; }
figure.an figcaption ol { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
figure.an .an-replay { position: absolute; inset-inline-end: .6rem; bottom: .6rem; width: 2.25rem; height: 2.25rem; padding: 0; border-radius: 50%; background: rgb(0 0 0 / .55); }
.an-paused *, .an-paused *::after { animation-play-state: paused !important; }

/* time */
.an-layer { animation: an-fade-in .3s var(--from) both, an-fade-out .25s calc(var(--to) - .25s) forwards; }
.an-layer.an-stays { animation: an-fade-in .3s var(--from) both; }
.an-at { animation: an-pop .35s var(--t) both; }
@keyframes an-fade-in { from { opacity: 0; } }
@keyframes an-fade-out { to { opacity: 0; } }
/* in a video a shot pushes the one before it out: it enters from the right */
.an-video .an-layer.an-shot { animation: an-push-in .55s var(--from) both ease-in-out, an-push-out .55s var(--to) forwards ease-in-out; }
.an-video .an-layer.an-shot.an-stays { animation: an-push-in .55s var(--from) both ease-in-out; }
.an-video .an-window, .an-video .an-phone, .an-video .an-caption span { animation: none; }
/* so do the screens of a phone; its first one comes in with the shot */
.an-video .an-screen > .an-layer { animation: an-push-in .55s var(--from) both ease-in-out, an-push-out .55s var(--to) forwards ease-in-out; }
.an-video .an-screen > .an-layer.an-stays { animation: an-push-in .55s var(--from) both ease-in-out; }
.an-video .an-screen > .an-layer:first-child { animation: an-push-out .55s var(--to) forwards ease-in-out; }
.an-video .an-screen > .an-layer.an-stays:first-child { animation: none; }
@keyframes an-push-in { from { transform: translateX(100%); visibility: hidden; } }
@keyframes an-push-out { to { transform: translateX(-100%); visibility: hidden; } }
@keyframes an-pop { from { opacity: 0; transform: translateY(.5em) scale(.92); } 70% { opacity: 1; transform: translateY(-.1em) scale(1.02); } }
.an-ch { position: relative; animation: an-appear .001s var(--t) both; }
.an-ch::after { content: ""; position: absolute; inset-inline-start: 100%; top: .1em; width: .55em; height: 1.1em; background: currentColor; opacity: 0; animation: an-caret var(--step) var(--t) linear; }
@keyframes an-appear { from { opacity: 0; } }
@keyframes an-caret { from, to { opacity: .8; } }

/* a shot: the caption, a message from the narrator, above the scene */
.an-shot { position: absolute; inset: 0; display: flex; flex-direction: column; }
.an-caption { height: 18cqh; flex: none; display: flex; align-items: center; justify-content: center; padding: 0 5cqw; font-size: min(4.6cqw, 4.4cqh); font-weight: 800; line-height: 1.2; text-align: center; text-wrap: balance; }
.an-caption span { position: relative; padding: .4em .75em; background: #d9fdd3; border-radius: .6em; border-end-end-radius: 0; box-shadow: 0 .08em .2em rgb(0 0 0 / .18); animation: an-bubble .45s var(--from) both cubic-bezier(.3, 1.6, .5, 1); }
.an-caption span::after { content: ""; position: absolute; inset-inline-end: -.38em; bottom: 0; width: .4em; height: .5em; background: #d9fdd3; clip-path: polygon(0 0, 100% 100%, 0 100%); }
[dir="rtl"] .an-caption span::after { transform: scaleX(-1); }
@keyframes an-bubble { from { transform: scale(.5) rotate(-3deg); opacity: 0; } }
.an-scene { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; padding-bottom: 3cqh; }
.an-scene > .an-layer { position: absolute; inset: 0 0 3cqh; display: flex; align-items: center; justify-content: center; }

/* the opening of a video: the story's name and the part */
.an-title { display: flex; flex-direction: column; align-items: center; gap: 5cqh; padding: 0 7cqw; text-align: center; font-size: min(7cqw, 6.5cqh); }
.an .an-stage .an-title h2, .an-video .an-stage .an-title h2 { margin: 0; font-size: 1.5em; font-weight: 800; line-height: 1.15; text-wrap: balance; }
.an-crown { font-size: 2.6em; line-height: 1; margin-bottom: -2cqh; }
.an-title .an-at { padding: .3em .9em; background: #d9fdd3; border-radius: 2em; box-shadow: 0 .08em .2em rgb(0 0 0 / .18); font-weight: 700; }

/* "To be continued...": a large sent message, its dots appearing one by one */
.an-continued { position: relative; padding: .6em .9em; background: #d9fdd3; border-radius: .45em; border-start-end-radius: 0; filter: drop-shadow(0 .06em .08em rgb(0 0 0 / .2)); font-size: min(7.5cqw, 7cqh); font-weight: 700; white-space: nowrap; }
.an-continued .tail { position: absolute; top: 0; inset-inline-start: calc(100% - 1px); width: .8em; height: 1.3em; }
[dir="rtl"] .an-continued .tail { transform: scaleX(-1); }
.an-continued span { animation: an-appear .001s var(--t) both; }

/* windows */
.an-window { display: flex; flex-direction: column; overflow: hidden; border-radius: .8em; box-shadow: 0 .6em 2em rgb(0 0 0 / .25); animation: an-rise .45s var(--from) both cubic-bezier(.2, 1.3, .4, 1); }
.an-scene > .an-layer > .an-window { animation: none; }
@keyframes an-rise { from { transform: translateY(1.5em) scale(.94); } }
.an-bar { display: flex; align-items: center; gap: .4em; padding: .6em .8em; }
.an-bar i { width: .65em; height: .65em; border-radius: 50%; background: #ff5f57; }
.an-bar i:nth-child(2) { background: #febc2e; }
.an-bar i:nth-child(3) { background: #28c840; }

/* Claude Code */
.an-terminal { width: 30em; height: 24em; font-size: min(3.1cqw, 3.3cqh); background: #1f1e1d; color: #eeece8; font-family: an-emoji, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace; text-align: left; }
.an-terminal .an-bar { background: #2e2c2a; }
.an-term { flex: 1; display: flex; flex-direction: column; gap: .7em; padding: .9em 1.1em; overflow: hidden; }
.an-welcome { display: flex; align-items: center; gap: 1em; padding: .45em 1em; border: 1px solid #d97757; border-radius: .5em; }
.an-welcome div { display: flex; flex-direction: column; }
.an-welcome span { color: #a8a29b; font-size: .85em; }
.an-claude { width: 4em; flex: none; }
.an-eye { fill: #1f1e1d; transform-box: fill-box; transform-origin: center; animation: an-blink 9s infinite; }
.an-eye ~ .an-eye { animation-name: an-wink; }
/* now and then: both eyes blink, later one of them winks */
@keyframes an-blink { 0%, 14%, 18%, 100% { transform: scaleY(1); } 16% { transform: scaleY(.08); } }
@keyframes an-wink { 0%, 14%, 18%, 58%, 66%, 100% { transform: scaleY(1); } 16%, 60%, 64% { transform: scaleY(.08); } }
.an-command, .an-prompt { display: flex; gap: .7em; overflow-wrap: anywhere; }
.an-sign { flex: none; color: #a8a29b; }
.an-prompt { padding: .6em .8em; border: 1px solid #55504b; border-radius: .5em; }
.an-text { flex: 1; min-width: 0; text-align: start; }
.an-tool, .an-reply { display: flex; gap: .7em; align-items: baseline; }
.an-tool i, .an-reply i { flex: none; width: .55em; height: .55em; border-radius: 50%; background: #4eba65; }
.an-reply i { background: #eeece8; }
.an-ran { color: #4eba65; }
.an-link { display: block; color: #8ab4ff; text-decoration: underline; overflow-wrap: anywhere; }
.an-big-code { display: block; width: max-content; margin-block: .2em; padding: 0 .5em; border: 2px dashed #d97757; border-radius: .3em; font-size: 2em; letter-spacing: .08em; }
.an-reply small { display: block; color: #febc2e; }

.an-option { display: flex; gap: .7em; padding: .35em .8em; }
.an-option > span:last-child { position: relative; }
.an-chosen { position: absolute; inset: 0; border: 1px solid #d97757; border-radius: .4em; background: rgb(217 119 87 / .2); animation: an-appear .25s var(--t) both; }

/* browser */
.an-browser { width: 28em; height: 22em; font-size: min(3.3cqw, 3.6cqh); background: #fff; text-align: center; }
.an-browser .an-bar { background: #ececec; }
.an-url { display: flex; align-items: center; gap: .35em; flex: 1; margin-inline-start: .6em; padding: .25em .8em; background: #fff; border-radius: 1em; font-size: .75em; }
.an-url svg { width: 1em; height: 1em; }
.an-page { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1em; padding: 1em; }
.an-brand { display: flex; align-items: center; gap: .4em; font-size: 1.4em; font-weight: 700; }
.an-brand img { width: 1.5em; height: 1.5em; }
.an-page .an-qr { width: 10.5em; display: block; }
.an-button { display: inline-flex; align-items: center; gap: .6em; padding: .6em 1.6em; border-radius: .6em; background: #0d0d0d; color: #fff; font-weight: 600; font-size: 1.1em; }
.an-button.an-light { background: #fff; color: #0d0d0d; border: 1px solid #d5d5d5; }
.an-button svg { width: 1.2em; height: 1.2em; }
.an-touch { position: relative; }
.an-tap { position: absolute; left: 50%; top: 50%; width: 3.6em; height: 3.6em; margin: -1.8em; border-radius: 50%; background: rgb(201 48 92 / .55); border: .2em solid #c9305c; pointer-events: none; z-index: 5; animation: an-tap 1.2s var(--t) both; }
@keyframes an-tap { 0% { opacity: 0; transform: scale(1.6); } 35% { opacity: 1; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.2); } }

/* phone */
.an-phone { width: 19em; height: 36em; padding: .6em; font-size: min(4.4cqw, 2.1cqh); background: #111; border-radius: 2.6em; box-shadow: 0 .8em 2.4em rgb(0 0 0 / .3); animation: an-rise .45s var(--from) both cubic-bezier(.2, 1.3, .4, 1); }
.an-screen { position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden; isolation: isolate; background: #fff; border-radius: 2em; }
.an-screen > .an-layer { position: absolute; inset: 0; display: flex; flex-direction: column; background: #fff; }
.an-appbar { display: flex; align-items: center; justify-content: space-between; gap: .5em; flex: none; padding: 1.8em 1.1em .9em; background: #008069; color: #fff; font-weight: 700; font-size: 1.1em; }
.an-appbar svg { width: 1.3em; height: 1.3em; display: block; }
.an-chat { display: flex; align-items: center; gap: .8em; padding: .8em 1em; }
.an-chat i { width: 2.8em; height: 2.8em; border-radius: 50%; background: #e4e4e4; }
.an-chat div { flex: 1; display: grid; gap: .5em; }
.an-chat b { height: .7em; width: 70%; border-radius: 1em; background: #e4e4e4; }
.an-chat b:last-child { width: 45%; background: #efefef; }
.an-menu { position: absolute; top: 4.6em; inset-inline-end: .7em; width: 80%; display: grid; gap: .3em; padding: .8em; background: #fff; border-radius: .8em; box-shadow: 0 .3em 1.4em rgb(0 0 0 / .25); }
.an-menu > span:empty { height: .8em; width: 60%; margin: .6em .5em; border-radius: 1em; background: #e4e4e4; }
.an-pick { display: flex; align-items: center; gap: .6em; padding: .6em .5em; border-radius: .5em; background: #e7f5f1; font-weight: 700; }
.an-pick svg { width: 1.2em; height: 1.2em; flex: none; }
.an-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6em; padding: 1em; text-align: center; font-size: 1.1em; }
.an-center > svg { width: 5em; height: 5em; color: #008069; }
.an-wa-button { padding: .7em 1.4em; border-radius: 2em; background: #008069; color: #fff; font-weight: 700; }
.an-camera { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.5em; background: #22282b; color: #fff; }
.an-frame { position: relative; width: 14em; height: 14em; display: flex; align-items: center; justify-content: center; border: .25em solid #25d366; border-radius: 1em; }
.an-frame > svg { width: 5em; height: 5em; opacity: .3; }
.an-seen { position: absolute; inset: 1em; animation: an-seen .8s var(--t) both ease-out; }
.an-seen svg { width: 100%; height: 100%; display: block; }
@keyframes an-seen { from { opacity: 0; transform: rotate(-14deg) scale(.5); } }
.an-found { position: absolute; display: flex; padding: .6em; border-radius: 50%; background: #25d366; }
.an-found svg { width: 4em; height: 4em; }
.an-laser { position: absolute; left: .4em; right: .4em; top: .6em; height: .2em; background: #25d366; box-shadow: 0 0 .8em .15em #25d366; animation: an-laser 1.1s infinite alternate ease-in-out; }
@keyframes an-laser { to { transform: translateY(12.4em); } }
.an-other { margin: 0 1em; padding: .6em 1em; border-radius: 2em; background: rgb(255 255 255 / .12); color: #6ee7a8; font-weight: 700; text-align: center; }
.an-code { display: flex; align-items: center; gap: .25em; font-family: ui-monospace, "DejaVu Sans Mono", monospace; font-size: 1.25em; }
.an-code b { width: 1.35em; height: 1.8em; display: flex; align-items: center; justify-content: center; border-bottom: .18em solid #008069; }
.an-code .an-ch::after { content: none; }
.an-ok { display: flex; padding: 1.2em; border-radius: 50%; background: #25d366; color: #fff; }
.an-ok svg { width: 4.5em; height: 4.5em; }
.an-talk { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 1em; padding: 1em; background: #efeae2; font-size: 1.15em; }
.an-day { align-self: center; padding: .25em .8em; border-radius: .5em; background: #fff; font-size: .75em; }
.an-msg { display: flex; flex-direction: column; max-width: 88%; padding: .55em .75em; border-radius: .7em; box-shadow: 0 .05em .15em rgb(0 0 0 / .15); }
.an-msg.an-in { align-self: flex-start; background: #fff; border-start-start-radius: 0; }
.an-msg.an-out { align-self: flex-end; background: #d9fdd3; border-start-end-radius: 0; }
.an-msg time { align-self: flex-end; color: #667781; font-size: .7em; }
.an-footer { align-self: flex-start; margin-top: .4em; color: #667781; font-size: .85em; }

/* the last shot of the video */

/* the video: the stage is the whole frame (walkthrough/animation-video.tsx) */
.an-video { margin: 0; }
.an-video .an-stage { width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; }
