/* The feature cards' small scenes, built like the ones on wishkit.io. Sizes and positions are in cqw, so a
   scene scales with its card (a scene is 100cqw wide and 75cqw tall). The styles draw each scene's finished
   state, and the loops run only while a scene is on screen (the script in feature-cards.leaf). With reduced
   motion, or without the script, each scene rests on its finished state. Only transforms, opacity and colors
   animate, never filters. Everything is prefixed m- so nothing meets Bootstrap's classes. */

.motion {
    container-type: inline-size;
    --m-loop: 6s;
    --m-ease: cubic-bezier(0.65, 0, 0.35, 1);
    --m-border: #dde1e6;
    --m-bar: #f4f5f7;
    --m-ln: #e5e8ec;
    --m-code-bg: #1f1f24;
    --m-code-bar: #2a2b30;
    --m-code-text: #dfdfe0;
}

.motion > * {
    position: absolute;
}

/* MARK: - Pieces every scene uses */

.m-win {
    overflow: hidden;
    border: 1px solid var(--m-border);
    border-radius: 2.4cqw;
    background: #ffffff;
    box-shadow: 0 2cqw 5cqw -2.4cqw rgba(26, 29, 33, 0.3);
}

.m-bar {
    display: flex;
    align-items: center;
    gap: 1.4cqw;
    height: 7cqw;
    padding: 0 2.4cqw;
    border-bottom: 1px solid #e7e9ec;
    background: var(--m-bar);
    color: #3c4a5e;
    font-size: 2.6cqw;
    font-weight: 600;
    white-space: nowrap;
}

.m-dots {
    display: flex;
    gap: 0.9cqw;
}

.m-dots i {
    width: 1.5cqw;
    height: 1.5cqw;
    border-radius: 50%;
    background: #ff5f57;
}

.m-dots i:nth-child(2) {
    background: #febc2e;
}

.m-dots i:nth-child(3) {
    background: #28c840;
}

.m-body {
    display: grid;
    align-content: start;
    gap: 1.5cqw;
    padding: 2.6cqw 3cqw;
}

.m-h {
    color: var(--ink);
    font-size: 3.4cqw;
    font-weight: 800;
    line-height: 1.2;
}

.m-ln {
    height: 1.5cqw;
    border-radius: 1cqw;
    background: var(--m-ln);
}

.w40 { width: 40%; }
.w55 { width: 55%; }
.w60 { width: 60%; }
.w70 { width: 70%; }
.w75 { width: 75%; }
.w85 { width: 85%; }
.w95 { width: 95%; }

.m-txt {
    color: var(--muted);
    font-size: 2.5cqw;
    line-height: 1.4;
    white-space: nowrap;
}

.m-key {
    display: grid;
    place-items: center;
    height: 8cqw;
    border: 1px solid #d3d8de;
    border-radius: 1.6cqw;
    background: #ffffff;
    box-shadow: 0 0.7cqw 0 #d3d8de;
    color: var(--ink);
    font-size: 2.8cqw;
    font-weight: 600;
}

.m-doc {
    flex: none;
    font-size: 2.8cqw;
    line-height: 1;
    opacity: 0.6;
}

/* The pointer's tip sits at its top left, about 1cqw in, so a target at (x, y) means translate(x - 1cqw, y - 0.5cqw). */
.m-cursor {
    top: 0;
    left: 0;
    z-index: 5;
    width: 5cqw;
    height: 5cqw;
    opacity: 0;
}

.m-stack {
    display: grid;
}

.m-stack > * {
    grid-area: 1 / 1;
}

/* MARK: - 1. Quick Look */

.m-finder {
    top: 13cqw;
    left: 6cqw;
    width: 46cqw;
}

.m-rows {
    display: grid;
    gap: 0.6cqw;
    padding: 1.6cqw;
}

.m-file {
    display: flex;
    align-items: center;
    gap: 1.6cqw;
    height: 6cqw;
    padding: 0 1.6cqw;
    border-radius: 1.2cqw;
    color: var(--ink);
    font-size: 2.7cqw;
}

.m-file-sel {
    background: var(--accent);
    color: #ffffff;
}

.m-space {
    top: 52cqw;
    left: 17cqw;
    width: 24cqw;
}

.m-peek {
    top: 19cqw;
    left: 40cqw;
    width: 54cqw;
    transform-origin: 0% 40%;
}

.m-peek .m-bar {
    justify-content: center;
}

.m-bullet {
    display: flex;
    align-items: center;
    gap: 1.4cqw;
}

.m-bullet::before {
    content: "";
    flex: none;
    width: 1.2cqw;
    height: 1.2cqw;
    border-radius: 50%;
    background: #9aa3ad;
}

/* MARK: - 2. Links between files */

/* Where the pointer clicks, measured from the rendered scene: the link on the first page and the Back button. */
.m-links {
    --m-link-x: 34.5cqw;
    --m-link-y: 27cqw;
    --m-back-x: 9.7cqw;
    --m-back-y: 9.9cqw;
}

.m-reader {
    top: 7cqw;
    left: 6cqw;
    width: 88cqw;
    height: 61cqw;
}

.m-navs {
    display: flex;
    gap: 1.6cqw;
    font-size: 2.8cqw;
}

.m-back,
.m-fwd {
    display: grid;
    place-items: center;
    width: 3.6cqw;
    height: 3.6cqw;
    border-radius: 0.8cqw;
    color: #b7bdc6;
}

.m-back {
    color: var(--ink);
}

.m-viewport {
    position: absolute;
    top: 7cqw;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
}

.m-track {
    display: flex;
    width: 200%;
    transform: translateX(-50%);
}

.m-track > .m-body {
    width: 50%;
    gap: 1.6cqw;
    padding: 3.4cqw 4cqw;
}

.m-link {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 0.4cqw;
}

.m-title-a {
    opacity: 0;
}

.m-mini-code {
    display: grid;
    gap: 1.2cqw;
    padding: 2cqw 2.4cqw;
    border-radius: 1.2cqw;
    background: #f1f3f5;
}

.m-mini-code i {
    height: 1.4cqw;
    border-radius: 1cqw;
    background: #c9d4e3;
}

.m-mini-code i:first-child {
    width: 50%;
    background: #f3a7c8;
}

.m-mini-code i:last-child {
    width: 70%;
}

/* MARK: - 3. Copy with formatting */

.m-src {
    top: 7cqw;
    left: 5cqw;
    width: 52cqw;
}

.m-src .m-body,
.m-mail .m-body {
    position: relative;
    gap: 1.2cqw;
}

.m-h-sm {
    color: var(--ink);
    font-size: 3cqw;
    font-weight: 800;
    line-height: 1.2;
}

.m-rich {
    display: flex;
    align-items: center;
    gap: 1.4cqw;
    color: var(--ink);
    font-size: 2.5cqw;
    line-height: 1.4;
    white-space: nowrap;
}

.m-rich::before {
    content: "";
    flex: none;
    width: 1.1cqw;
    height: 1.1cqw;
    border-radius: 50%;
    background: var(--ink);
}

.m-sel {
    position: absolute;
    inset: 1.6cqw 2cqw;
    border-radius: 0.8cqw;
    background: rgba(0, 113, 227, 0.16);
    transform-origin: 0 50%;
}

.m-copykey {
    top: 43cqw;
    left: 18cqw;
    width: 18cqw;
}

.m-mail {
    top: 30cqw;
    left: 42cqw;
    width: 53cqw;
}

.m-to {
    padding-bottom: 1.2cqw;
    border-bottom: 1px solid #eceef1;
    color: #8a939e;
    font-size: 2.4cqw;
}

.m-to b {
    color: var(--ink);
    font-weight: 600;
}

.m-pasted {
    display: grid;
    gap: 1.2cqw;
}

/* MARK: - 4. Print and PDF */

.m-sheet {
    top: 9cqw;
    left: 36.5cqw;
    width: 27cqw;
    height: 38cqw;
    display: grid;
    align-content: start;
    gap: 1.4cqw;
    padding: 2.8cqw 2.6cqw;
    border: 1px solid var(--m-border);
    border-radius: 1.2cqw;
    background: #ffffff;
    box-shadow: 0 1.6cqw 4cqw -2cqw rgba(26, 29, 33, 0.3);
}

.m-sheet-1 {
    z-index: 2;
    transform: translateX(-16cqw) rotate(-3deg);
}

.m-sheet-2 {
    transform: translateX(16cqw) rotate(3deg);
}

.m-sheet-h {
    width: 60%;
    height: 2.2cqw;
    margin-bottom: 0.6cqw;
    border-radius: 1cqw;
    background: #6b7684;
}

.m-sheet .m-ln {
    height: 1.2cqw;
}

.m-pnum {
    position: absolute;
    right: 0;
    bottom: 2cqw;
    left: 0;
    color: #8a939e;
    font-size: 2.2cqw;
    font-weight: 600;
    text-align: center;
}

.m-pdf {
    top: 53cqw;
    left: 29cqw;
    width: 42cqw;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 2cqw;
    padding: 1.8cqw 2.4cqw;
    border: 1px solid var(--m-border);
    border-radius: 2cqw;
    background: #ffffff;
    box-shadow: 0 1.6cqw 4cqw -2cqw rgba(26, 29, 33, 0.3);
}

.m-pdf-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 6cqw;
    height: 7cqw;
    border-radius: 1cqw;
    background: #e5483b;
    color: #ffffff;
    font-size: 1.9cqw;
    font-weight: 800;
}

.m-pdf b {
    display: block;
    color: var(--ink);
    font-size: 2.7cqw;
    font-weight: 700;
    line-height: 1.3;
}

.m-pdf span {
    color: #8a939e;
    font-size: 2.3cqw;
}

/* MARK: - 5. Code, highlighted */

/* Where the pointer clicks: the Copy button. */
.m-codes {
    --m-copy-x: 82.2cqw;
    --m-copy-y: 18.4cqw;
}

.m-codewin {
    top: 15.5cqw;
    left: 6cqw;
    width: 88cqw;
    height: 44cqw;
    overflow: hidden;
    border: 1px solid #2c2d31;
    border-radius: 2.4cqw;
    background: var(--m-code-bg);
    box-shadow: 0 2cqw 5cqw -2.4cqw rgba(26, 29, 33, 0.45);
}

.m-codewin .m-bar {
    border-bottom-color: #34353a;
    background: var(--m-code-bar);
    color: #c8c8c8;
}

.m-copy {
    margin-left: auto;
    padding: 0.8cqw 1.8cqw;
    border: 1px solid #45474d;
    border-radius: 1.2cqw;
    color: var(--m-code-text);
    font-size: 2.4cqw;
    font-weight: 600;
}

.m-copy span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8cqw;
}

.m-copy .m-copy-idle {
    opacity: 0;
}

.m-copy .m-copy-done {
    color: var(--accent-on-dark);
}

.m-code {
    padding: 3.4cqw 3.6cqw;
    color: var(--m-code-text);
    font: 3cqw/1.95 ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* pre on each line rather than the block, so the line breaks between the lines in the HTML don't show */
.m-code > div {
    white-space: pre;
}

.m-lno {
    display: inline-block;
    width: 4.6cqw;
    color: #6c6c70;
}

/* Xcode's Default (Dark) colors */
.m-kw { color: #fc5fa3; font-weight: 600; }
.m-ty { color: #5dd8ff; }
.m-st { color: #fc6a5d; }
.m-nu { color: #d0bf69; }

/* MARK: - 6. Heading links */

/* Where the pointer clicks: Usage in the contents, before the page scrolls. */
.m-heads {
    --m-usage-x: 15.8cqw;
    --m-usage-y: 27.4cqw;
}

.m-anchor {
    margin-left: 0.4cqw;
    padding: 0.3cqw 1.2cqw;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: 2.2cqw;
}

.m-scroll {
    display: grid;
    align-content: start;
    gap: 3cqw;
    padding: 3cqw 4cqw;
    transform: translateY(-38cqw);
}

.m-toc {
    box-sizing: border-box;
    height: 19cqw;
    padding: 2cqw 2.4cqw;
    border: 1px solid var(--m-ln);
    border-radius: 1.4cqw;
}

.m-toc small {
    display: block;
    color: #8a939e;
    font-size: 2.2cqw;
    font-weight: 600;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.m-toc span {
    display: block;
    color: var(--accent);
    font-size: 2.6cqw;
    line-height: 1.5;
}

.m-sec {
    box-sizing: border-box;
    display: grid;
    align-content: start;
    gap: 1.5cqw;
    height: 13cqw;
}

.m-sec .m-h {
    justify-self: start;
    margin-left: -1cqw;
    padding: 0 1cqw;
    border-radius: 0.8cqw;
    font-size: 3.2cqw;
}

/* MARK: - 7. Always up to date */

.m-ed,
.m-prev {
    top: 10cqw;
    width: 43cqw;
    height: 52cqw;
}

.m-ed {
    left: 4.5cqw;
    border-color: #2c2d31;
    background: var(--m-code-bg);
}

.m-ed .m-bar {
    border-bottom-color: #34353a;
    background: var(--m-code-bar);
    color: #c8c8c8;
}

.m-prev {
    left: 52.5cqw;
}

.m-md {
    padding: 2.8cqw 3cqw;
    color: var(--m-code-text);
    font: 2.5cqw/1.9 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.m-md > div {
    white-space: pre;
}

.m-md .m-mark {
    color: #fc5fa3;
}

.m-md .m-hash {
    color: #7f8c98;
}

.m-md b {
    color: #ffffff;
}

/* typed character by character: the width runs in ch of the monospace font */
.m-typed {
    display: inline-block;
    width: 13ch;
    overflow: hidden;
    vertical-align: bottom;
    border-right: 0.35cqw solid transparent;
}

.m-task {
    display: flex;
    align-items: center;
    gap: 1.4cqw;
    margin: 0 -1cqw;
    padding: 0.4cqw 1cqw;
    border-radius: 0.8cqw;
    color: var(--ink);
    font-size: 2.5cqw;
}

.m-box {
    flex: none;
    display: grid;
    place-items: center;
    width: 2cqw;
    height: 2cqw;
    border: 1px solid #aab2bc;
    border-radius: 0.5cqw;
}

.m-box-on {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
    font-size: 1.6cqw;
}

/* MARK: - 8. More than .md */

.m-types {
    top: 13cqw;
    left: 8.25cqw;
    display: flex;
    gap: 2.75cqw;
}

.m-type {
    position: relative;
    display: grid;
    align-content: end;
    justify-items: center;
    width: 14.5cqw;
    height: 18cqw;
    padding-bottom: 2.2cqw;
    border: 1px solid var(--accent);
    border-radius: 1.4cqw;
    background: linear-gradient(225deg, #e9eef5 0 16%, #ffffff 16%);
    color: var(--accent-ink);
    font-size: 2.1cqw;
    font-weight: 700;
    box-shadow: 0 1.2cqw 3cqw -1.6cqw rgba(26, 29, 33, 0.25);
}

.m-type::before {
    content: "";
    position: absolute;
    top: 4cqw;
    left: 3cqw;
    right: 3cqw;
    height: 6cqw;
    background: repeating-linear-gradient(180deg, var(--m-ln) 0 1.1cqw, transparent 1.1cqw 2.4cqw);
}

.m-check {
    position: absolute;
    top: -1.6cqw;
    right: -1.6cqw;
    display: grid;
    place-items: center;
    width: 4.6cqw;
    height: 4.6cqw;
    border-radius: 50%;
    background: var(--accent);
    color: #ffffff;
    font-size: 2.6cqw;
}

.m-menu {
    top: 41cqw;
    left: 22cqw;
    width: 56cqw;
    display: grid;
    gap: 0.4cqw;
    padding: 1.4cqw;
    border: 1px solid var(--m-border);
    border-radius: 1.8cqw;
    background: #ffffff;
    box-shadow: 0 2cqw 5cqw -2.4cqw rgba(26, 29, 33, 0.3);
}

.m-menu small {
    padding: 0.4cqw 1.4cqw 0.6cqw;
    color: #8a939e;
    font-size: 2.2cqw;
    font-weight: 600;
}

.m-menu .m-file {
    height: 5cqw;
    font-size: 2.5cqw;
}

.m-menu .m-file-hl {
    background: var(--accent);
    color: #ffffff;
}

/* MARK: - The loops */

.is-playing .m-file-sel { animation: m-ql-select var(--m-loop) linear infinite; }
.is-playing .m-space { animation: m-ql-press var(--m-loop) var(--m-ease) infinite; }
.is-playing .m-peek { animation: m-ql-peek var(--m-loop) var(--m-ease) infinite; }

.is-playing .m-track { animation: m-ln-track var(--m-loop) var(--m-ease) infinite; }
.is-playing .m-title-a { animation: m-ln-title-a var(--m-loop) linear infinite; }
.is-playing .m-title-b { animation: m-ln-title-b var(--m-loop) linear infinite; }
.is-playing .m-back { animation: m-ln-back var(--m-loop) linear infinite; }
.is-playing .m-fwd { animation: m-ln-fwd var(--m-loop) linear infinite; }
.is-playing.m-links .m-cursor { animation: m-ln-cursor var(--m-loop) var(--m-ease) infinite; }

.is-playing .m-sel { animation: m-cp-select var(--m-loop) var(--m-ease) infinite; }
.is-playing .m-copykey { animation: m-cp-press var(--m-loop) var(--m-ease) infinite; }
.is-playing .m-mail { animation: m-cp-mail var(--m-loop) var(--m-ease) infinite; }
.is-playing .m-pasted { animation: m-cp-pasted var(--m-loop) linear infinite; }

.is-playing .m-sheet-1 { animation: m-pdf-left var(--m-loop) var(--m-ease) infinite; }
.is-playing .m-sheet-2 { animation: m-pdf-right var(--m-loop) var(--m-ease) infinite; }
.is-playing .m-pnum { animation: m-pdf-num var(--m-loop) linear infinite; }
.is-playing .m-pdf { animation: m-pdf-file var(--m-loop) var(--m-ease) infinite; }

.is-playing .m-code > div { animation: m-cd-line var(--m-loop) var(--m-ease) infinite; }
.is-playing .m-code > div:nth-child(2) { animation-name: m-cd-line-2; }
.is-playing .m-code > div:nth-child(3) { animation-name: m-cd-line-3; }
.is-playing .m-code > div:nth-child(4) { animation-name: m-cd-line-4; }
.is-playing .m-copy-idle { animation: m-cd-idle var(--m-loop) linear infinite; }
.is-playing .m-copy-done { animation: m-cd-done var(--m-loop) linear infinite; }
.is-playing.m-codes .m-cursor { animation: m-cd-cursor var(--m-loop) var(--m-ease) infinite; }

.is-playing .m-scroll { animation: m-hd-scroll var(--m-loop) var(--m-ease) infinite; }
.is-playing .m-anchor { animation: m-hd-anchor var(--m-loop) linear infinite; }
.is-playing .m-target { animation: m-hd-target var(--m-loop) linear infinite; }
.is-playing.m-heads .m-cursor { animation: m-hd-cursor var(--m-loop) var(--m-ease) infinite; }

.is-playing .m-typed { animation: m-lv-type var(--m-loop) linear infinite, m-lv-caret 0.9s step-end infinite; }
.is-playing .m-task-new { animation: m-lv-new var(--m-loop) var(--m-ease) infinite; }

.is-playing .m-check { animation: m-ty-check var(--m-loop) var(--m-ease) infinite; }
.is-playing .m-type:nth-child(2) .m-check { animation-name: m-ty-check-2; }
.is-playing .m-type:nth-child(3) .m-check { animation-name: m-ty-check-3; }
.is-playing .m-type:nth-child(4) .m-check { animation-name: m-ty-check-4; }
.is-playing .m-type:nth-child(5) .m-check { animation-name: m-ty-check-5; }
.is-playing .m-type { animation: m-ty-type var(--m-loop) linear infinite; }
.is-playing .m-type:nth-child(2) { animation-name: m-ty-type-2; }
.is-playing .m-type:nth-child(3) { animation-name: m-ty-type-3; }
.is-playing .m-type:nth-child(4) { animation-name: m-ty-type-4; }
.is-playing .m-type:nth-child(5) { animation-name: m-ty-type-5; }
.is-playing .m-menu { animation: m-ty-menu var(--m-loop) var(--m-ease) infinite; }

/* 1. Quick Look: the file is selected, Space goes down, the preview opens from the file */
@keyframes m-ql-select {
    0%, 6% { background: transparent; color: var(--ink); }
    10%, 90% { background: var(--accent); color: #ffffff; }
    96%, 100% { background: transparent; color: var(--ink); }
}
@keyframes m-ql-press {
    0%, 20% { transform: translateY(0); box-shadow: 0 0.7cqw 0 #d3d8de; }
    24% { transform: translateY(0.7cqw); box-shadow: 0 0 0 #d3d8de; }
    28%, 100% { transform: translateY(0); box-shadow: 0 0.7cqw 0 #d3d8de; }
}
@keyframes m-ql-peek {
    0%, 26% { opacity: 0; transform: scale(0.35); }
    38%, 88% { opacity: 1; transform: scale(1); }
    95%, 100% { opacity: 0; transform: scale(1); }
}

/* 2. Links between files: click the link, the next file slides in, Back slides it out and lights up Forward */
@keyframes m-ln-track {
    0%, 20% { transform: translateX(0); }
    30%, 58% { transform: translateX(-50%); }
    68%, 100% { transform: translateX(0); }
}
@keyframes m-ln-title-a {
    0%, 21% { opacity: 1; }
    24%, 63% { opacity: 0; }
    66%, 100% { opacity: 1; }
}
@keyframes m-ln-title-b {
    0%, 24% { opacity: 0; }
    27%, 60% { opacity: 1; }
    63%, 100% { opacity: 0; }
}
@keyframes m-ln-back {
    0%, 26% { color: #b7bdc6; background: transparent; }
    28%, 54% { color: var(--ink); background: transparent; }
    57%, 60% { color: var(--ink); background: #e3e6ea; }
    64%, 100% { color: #b7bdc6; background: transparent; }
}
@keyframes m-ln-fwd {
    0%, 62% { color: #b7bdc6; }
    66%, 92% { color: var(--ink); }
    98%, 100% { color: #b7bdc6; }
}
@keyframes m-ln-cursor {
    0% { opacity: 0; transform: translate(76cqw, 62cqw); }
    6% { opacity: 1; transform: translate(76cqw, 62cqw); }
    16% { opacity: 1; transform: translate(var(--m-link-x), var(--m-link-y)) scale(1); }
    19% { transform: translate(var(--m-link-x), var(--m-link-y)) scale(0.82); }
    22%, 40% { transform: translate(var(--m-link-x), var(--m-link-y)) scale(1); }
    52% { transform: translate(var(--m-back-x), var(--m-back-y)) scale(1); }
    56% { transform: translate(var(--m-back-x), var(--m-back-y)) scale(0.82); }
    59% { transform: translate(var(--m-back-x), var(--m-back-y)) scale(1); }
    76% { opacity: 1; transform: translate(76cqw, 62cqw); }
    84%, 100% { opacity: 0; transform: translate(76cqw, 62cqw); }
}

/* 3. Copy with formatting: select the notes, press ⌘C, they arrive in a new mail with their formatting */
@keyframes m-cp-select {
    0%, 6% { opacity: 1; transform: scaleX(0); }
    20%, 90% { opacity: 1; transform: scaleX(1); }
    96%, 100% { opacity: 0; transform: scaleX(1); }
}
@keyframes m-cp-press {
    0%, 24% { transform: translateY(0); box-shadow: 0 0.7cqw 0 #d3d8de; }
    28% { transform: translateY(0.7cqw); box-shadow: 0 0 0 #d3d8de; }
    32%, 100% { transform: translateY(0); box-shadow: 0 0.7cqw 0 #d3d8de; }
}
@keyframes m-cp-mail {
    0%, 34% { opacity: 0; transform: translateY(6cqw); }
    44%, 90% { opacity: 1; transform: translateY(0); }
    96%, 100% { opacity: 0; transform: translateY(0); }
}
@keyframes m-cp-pasted {
    0%, 50% { opacity: 0; }
    56%, 100% { opacity: 1; }
}

/* 4. Print and PDF: the page splits into numbered pages, then the PDF appears */
@keyframes m-pdf-left {
    0%, 10% { transform: translateX(0) rotate(0); }
    26%, 88% { transform: translateX(-16cqw) rotate(-3deg); }
    97%, 100% { transform: translateX(0) rotate(0); }
}
@keyframes m-pdf-right {
    0%, 10% { transform: translateX(0) rotate(0); }
    26%, 88% { transform: translateX(16cqw) rotate(3deg); }
    97%, 100% { transform: translateX(0) rotate(0); }
}
@keyframes m-pdf-num {
    0%, 28% { opacity: 0; }
    36%, 86% { opacity: 1; }
    92%, 100% { opacity: 0; }
}
@keyframes m-pdf-file {
    0%, 40% { opacity: 0; transform: translateY(4cqw) scale(0.94); }
    50%, 86% { opacity: 1; transform: translateY(0) scale(1); }
    92%, 100% { opacity: 0; transform: translateY(0) scale(1); }
}

/* 5. Code, highlighted: the lines appear in Xcode's colors, then Copy turns into Copied */
@keyframes m-cd-line {
    0%, 4% { opacity: 0; transform: translateX(-2cqw); }
    10%, 90% { opacity: 1; transform: translateX(0); }
    96%, 100% { opacity: 0; transform: translateX(0); }
}
@keyframes m-cd-line-2 {
    0%, 11% { opacity: 0; transform: translateX(-2cqw); }
    17%, 90% { opacity: 1; transform: translateX(0); }
    96%, 100% { opacity: 0; transform: translateX(0); }
}
@keyframes m-cd-line-3 {
    0%, 18% { opacity: 0; transform: translateX(-2cqw); }
    24%, 90% { opacity: 1; transform: translateX(0); }
    96%, 100% { opacity: 0; transform: translateX(0); }
}
@keyframes m-cd-line-4 {
    0%, 25% { opacity: 0; transform: translateX(-2cqw); }
    31%, 90% { opacity: 1; transform: translateX(0); }
    96%, 100% { opacity: 0; transform: translateX(0); }
}
@keyframes m-cd-idle {
    0%, 55% { opacity: 1; }
    56%, 88% { opacity: 0; }
    89%, 100% { opacity: 1; }
}
@keyframes m-cd-done {
    0%, 55% { opacity: 0; }
    56%, 88% { opacity: 1; }
    89%, 100% { opacity: 0; }
}
@keyframes m-cd-cursor {
    0%, 34% { opacity: 0; transform: translate(62cqw, 60cqw); }
    40% { opacity: 1; transform: translate(62cqw, 60cqw); }
    51% { opacity: 1; transform: translate(var(--m-copy-x), var(--m-copy-y)) scale(1); }
    54% { transform: translate(var(--m-copy-x), var(--m-copy-y)) scale(0.82); }
    57%, 64% { transform: translate(var(--m-copy-x), var(--m-copy-y)) scale(1); }
    78% { opacity: 1; transform: translate(66cqw, 50cqw); }
    86%, 100% { opacity: 0; transform: translate(66cqw, 50cqw); }
}

/* 6. Heading links: click Usage in the contents, the page scrolls to that heading and #usage shows in the title */
@keyframes m-hd-scroll {
    0%, 20% { transform: translateY(0); }
    32%, 86% { transform: translateY(-38cqw); }
    95%, 100% { transform: translateY(0); }
}
@keyframes m-hd-anchor {
    0%, 24% { opacity: 0; }
    30%, 86% { opacity: 1; }
    92%, 100% { opacity: 0; }
}
@keyframes m-hd-target {
    0%, 32% { background: transparent; }
    38%, 50% { background: rgba(0, 113, 227, 0.16); }
    66%, 100% { background: transparent; }
}
@keyframes m-hd-cursor {
    0% { opacity: 0; transform: translate(72cqw, 60cqw); }
    6% { opacity: 1; transform: translate(72cqw, 60cqw); }
    15% { opacity: 1; transform: translate(var(--m-usage-x), var(--m-usage-y)) scale(1); }
    18% { transform: translate(var(--m-usage-x), var(--m-usage-y)) scale(0.82); }
    21% { opacity: 1; transform: translate(var(--m-usage-x), var(--m-usage-y)) scale(1); }
    34% { opacity: 1; transform: translate(72cqw, 60cqw); }
    42%, 100% { opacity: 0; transform: translate(72cqw, 60cqw); }
}

/* 7. Always up to date: a line typed in another app shows up in the preview right away */
@keyframes m-lv-type {
    0%, 10% { width: 0; opacity: 1; animation-timing-function: steps(13, end); }
    34%, 90% { width: 13ch; opacity: 1; }
    94% { width: 13ch; opacity: 0; }
    96%, 100% { width: 0; opacity: 1; }
}
@keyframes m-lv-caret {
    0%, 100% { border-right-color: var(--m-code-text); }
    50% { border-right-color: transparent; }
}
@keyframes m-lv-new {
    0%, 38% { opacity: 0; transform: translateY(-1cqw); background: rgba(0, 113, 227, 0.18); }
    44% { opacity: 1; transform: translateY(0); background: rgba(0, 113, 227, 0.18); }
    70%, 90% { opacity: 1; transform: translateY(0); background: transparent; }
    94%, 100% { opacity: 0; transform: translateY(0); background: transparent; }
}

/* 8. More than .md: each kind of file gets its check, then Open Recent lists them */
@keyframes m-ty-check {
    0%, 6% { transform: scale(0); }
    10% { transform: scale(1.2); }
    13%, 90% { transform: scale(1); }
    96%, 100% { transform: scale(0); }
}
@keyframes m-ty-check-2 {
    0%, 13% { transform: scale(0); }
    17% { transform: scale(1.2); }
    20%, 90% { transform: scale(1); }
    96%, 100% { transform: scale(0); }
}
@keyframes m-ty-check-3 {
    0%, 20% { transform: scale(0); }
    24% { transform: scale(1.2); }
    27%, 90% { transform: scale(1); }
    96%, 100% { transform: scale(0); }
}
@keyframes m-ty-check-4 {
    0%, 27% { transform: scale(0); }
    31% { transform: scale(1.2); }
    34%, 90% { transform: scale(1); }
    96%, 100% { transform: scale(0); }
}
@keyframes m-ty-check-5 {
    0%, 34% { transform: scale(0); }
    38% { transform: scale(1.2); }
    41%, 90% { transform: scale(1); }
    96%, 100% { transform: scale(0); }
}
@keyframes m-ty-type {
    0%, 6% { border-color: var(--m-border); }
    10%, 90% { border-color: var(--accent); }
    96%, 100% { border-color: var(--m-border); }
}
@keyframes m-ty-type-2 {
    0%, 13% { border-color: var(--m-border); }
    17%, 90% { border-color: var(--accent); }
    96%, 100% { border-color: var(--m-border); }
}
@keyframes m-ty-type-3 {
    0%, 20% { border-color: var(--m-border); }
    24%, 90% { border-color: var(--accent); }
    96%, 100% { border-color: var(--m-border); }
}
@keyframes m-ty-type-4 {
    0%, 27% { border-color: var(--m-border); }
    31%, 90% { border-color: var(--accent); }
    96%, 100% { border-color: var(--m-border); }
}
@keyframes m-ty-type-5 {
    0%, 34% { border-color: var(--m-border); }
    38%, 90% { border-color: var(--accent); }
    96%, 100% { border-color: var(--m-border); }
}
@keyframes m-ty-menu {
    0%, 46% { opacity: 0; transform: translateY(-2cqw); }
    56%, 90% { opacity: 1; transform: translateY(0); }
    96%, 100% { opacity: 0; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .motion * {
        animation: none !important;
    }
}
