# Notion · Keep meeting notes inside a toggle

On a new line, type > followed by a space to create a toggle. Put the meeting notes inside it so readers can expand the item when they need the detail, then collapse it again.

[Official source](https://www.notion.com/help/writing-and-editing-basics)

## Related motion · Accordion

# Accordion

Each paper-care question opens to reveal its answer in place.

## Try it

Open a question, read its answer, and select it again to collapse it.

## Interaction details

Opening an answer moves the following questions down and preserves their order.

## Platform controls

- iOS · Tap a question to reveal the answer, then tap again to close it.
- Android · Tap a question to reveal the answer, then tap again to close it.
- PC · Open a question, read its answer, and select it again to collapse it.

## Where to use it

Frequently asked questions and concise, optional guidance.

## Implementation prompt

> Let visitors expand or collapse each answer from its question.

## Standalone HTML

Save the code below as an HTML file and open it in your browser. The example works offline.

```html
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Accordion · Motion Lab</title><style>*{box-sizing:border-box}body{margin:0;background:#f4f3ec;color:#24251f;font:15px/1.5 system-ui,sans-serif}main{width:min(1080px,100%);margin:auto}header.sample-heading,footer.sample-tools{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;padding:12px 16px}.sample-heading h1{margin:0;font-size:clamp(20px,3vw,32px)}.sample-tools p{margin:0;flex:1 1 240px;font-size:13px}.sample-tools button{min-height:42px;padding:6px 12px;border:1px solid #666957;background:#fcfbf4;color:#202219;border-radius:3px;font:inherit}#playDemo{background:#272a23;color:white}#stage{width:100%;height:clamp(310px,70dvh,700px);position:relative;overflow:auto}.sample-status{min-height:1.4em;margin:0 16px 12px;font-size:13px}button{cursor:pointer}button:focus-visible,a:focus-visible{outline:3px solid #a64c27;outline-offset:2px}[hidden]{display:none!important}@media(prefers-reduced-motion:reduce){*,*::after,*::before{scroll-behavior:auto!important}}
.demo-scene.foundation-scene{--paper:#f6f0e3;--ink:#292a24;--line:#c8c4b5;--rust:#ac402a;--green:#27453d;position:relative;box-sizing:border-box;display:grid;place-items:safe center;isolation:isolate;overflow:auto;width:100%;height:100%;min-width:0;min-height:0;padding:clamp(14px,3vw,50px);background:#d7d4c7;color:var(--ink);font:500 14px/1.45 Inter,Pretendard,"Malgun Gothic",system-ui,sans-serif;container-type:inline-size}
.demo-scene.foundation-scene{grid-template-columns:minmax(0,1fr)}
.foundation-scene *, .foundation-scene *::before,.foundation-scene *::after{box-sizing:border-box}
.foundation-scene [hidden]{display:none!important}
.foundation-scene .ff-page{position:relative;width:min(100%,790px);max-width:100%;min-width:0;padding:clamp(17px,3.5cqw,44px);background:var(--paper);box-shadow:1px 3px 0 #827d6d2e,0 16px 40px -28px #34382b86}
.foundation-scene button,.foundation-scene summary{color:inherit;font:inherit;cursor:pointer}
.foundation-scene button:focus-visible,.foundation-scene summary:focus-visible,.foundation-scene [tabindex]:focus-visible{outline:3px solid #00778a;outline-offset:3px;z-index:2}
.foundation-scene .ff-image{display:block;object-fit:cover;width:100%;min-width:0;max-width:100%}
.foundation-scene .ff-heading h3,.foundation-scene .ff-hero h3{margin:0;color:inherit;font:700 clamp(24px,4.4cqw,53px)/1.09 Inter,Pretendard,"Malgun Gothic",sans-serif;letter-spacing:-.072em}
.foundation-scene .ff-heading i,.foundation-scene .ff-work i,.foundation-scene .ff-register i,.foundation-scene .ff-drawer-copy>i,.foundation-scene figcaption i,.foundation-scene .ff-hoverwork>span i,.foundation-scene .ff-load>div>i{display:block;margin-top:4px;color:inherit;font:italic 400 clamp(13px,1.8cqw,20px)/1.25 Georgia,serif;letter-spacing:-.035em}
.foundation-scene .ff-heading{margin-bottom:clamp(14px,2.6cqw,27px)}
.foundation-scene .ff-heading i{color:#695f50}
.foundation-scene .ff-stamp,.foundation-scene .ff-kind{display:block;color:inherit;font-size:clamp(10px,1.35cqw,13px);line-height:1.45;font-weight:580}
.foundation-scene .ff-stamp{padding-bottom:8px;margin-bottom:12px;border-bottom:1px solid currentColor}
.foundation-scene .ff-kind{color:#5c5a4e;margin-top:6px}
.foundation-scene .ff-cmd,.foundation-scene .ff-heart{display:inline-flex;align-items:center;justify-content:center;gap:.5em;border:1px solid var(--ink);border-radius:2px;background:var(--ink);color:#fbf7e9;padding:9px 14px;font-size:clamp(12px,1.55cqw,15px);font-weight:620;line-height:1.35}
.foundation-scene p{color:inherit;margin:8px 0 15px;line-height:1.65;font-size:clamp(13px,1.8cqw,17px);word-break:keep-all}
.foundation-scene h4{margin:0;color:inherit;font:700 clamp(16px,2.5cqw,26px)/1.25 Inter,Pretendard,"Malgun Gothic",sans-serif;letter-spacing:-.05em}
.foundation-scene .ff-work{width:100%;min-width:0;overflow:hidden;padding:0;border:0;border-radius:0;background:transparent;color:inherit;text-align:left}
.foundation-scene .ff-work img{aspect-ratio:1/.91;margin-bottom:9px}
.foundation-scene .ff-work strong,.foundation-scene .ff-register strong,.foundation-scene figcaption strong,.foundation-scene .ff-drawer-copy>strong,.foundation-scene .ff-hoverwork>span strong,.foundation-scene .ff-load>div>strong{display:block;line-height:1.22;font-size:clamp(15px,2.2cqw,25px);letter-spacing:-.04em}
.foundation-scene .ff-trio,.foundation-scene .ff-contact{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(8px,1.4cqw,18px)}
.foundation-scene .ff-underlay,.foundation-scene .ff-over{min-width:0}
.foundation-scene .ff-flexhead{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.foundation-scene .ff-flexhead .ff-heading{margin:0}
.foundation-scene .ff-viewport{width:100%;height:clamp(175px,30cqw,310px);overflow:auto;padding:5px;transition:width .44s cubic-bezier(.2,.7,.2,1);scrollbar-gutter:stable}
.foundation-scene .ff-viewport.ff-narrow{width:min(58%,225px);margin-inline:auto;border-inline:2px solid #aaa797;background:#eee6d4}
.foundation-scene .ff-narrow .ff-trio{grid-template-columns:1fr}.foundation-scene .ff-narrow .ff-work img{aspect-ratio:1.85}
.foundation-scene[data-demo="1"] .ff-page,.foundation-scene[data-demo="6"] .ff-page,.foundation-scene[data-demo="7"] .ff-page,.foundation-scene[data-demo="15"] .ff-page,.foundation-scene[data-demo="21"] .ff-page,.foundation-scene[data-demo="22"] .ff-page,.foundation-scene[data-demo="23"] .ff-page{padding:0}
.foundation-scene .ff-hero{position:relative;min-height:clamp(245px,41cqw,460px);isolation:isolate;display:flex;align-items:flex-end;padding:clamp(19px,4cqw,46px);color:#fff9e8;background:#171812}
.foundation-scene .ff-hero img,.foundation-scene .ff-glass>img,.foundation-scene .ff-depth>img,.foundation-scene .ff-snap figure>img,.foundation-scene .ff-filmtrack img{position:absolute;inset:0;height:100%;width:100%;z-index:-2}
.foundation-scene .ff-hero::before,.foundation-scene .ff-depth::before,.foundation-scene .ff-snap figure::before,.foundation-scene .ff-filmtrack figure::before{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(0deg,#15180fbb,transparent 68%)}
.foundation-scene .ff-hero h3{font-size:clamp(39px,7.5cqw,82px);margin:0 0 19px}
.foundation-scene .ff-hero .ff-cmd{color:#fcf2d9;border-color:#fcf2d9;background:#14161265}
.foundation-scene .ff-index{padding:clamp(18px,3cqw,36px)}.foundation-scene .ff-index .ff-cmd{margin-top:18px}
.foundation-scene .ff-pickgrid .ff-work,.foundation-scene .ff-bento button{position:relative}
.foundation-scene .ff-pickgrid .ff-work{border-bottom:3px solid transparent;padding-bottom:10px}.foundation-scene .ff-pickgrid .ff-work[aria-pressed=true]{border-color:var(--rust)}
.foundation-scene .ff-record{padding-top:14px;border-top:1px solid var(--line)}.foundation-scene .ff-record p{margin-bottom:0}
.foundation-scene .ff-bento{display:grid;grid-template-columns:1.65fr 1fr;grid-template-rows:repeat(2,clamp(95px,14cqw,158px));gap:7px}
.foundation-scene .ff-bento .ff-work{color:white;display:flex;align-items:flex-end;padding:12px;isolation:isolate}.foundation-scene .ff-bento .ff-work[aria-pressed=true]{grid-row:span 2}
.foundation-scene .ff-bento img{position:absolute;inset:0;height:100%;width:100%;z-index:-2}
.foundation-scene .ff-bento button::after{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(0deg,#18171196,transparent 68%)}.foundation-scene .ff-bento .ff-work i{display:none}
.foundation-scene .ff-side{display:grid;grid-template-columns:minmax(92px,.72fr) 2fr;gap:clamp(12px,3cqw,32px)}
.foundation-scene .ff-side nav{padding-right:12px;border-right:1px solid var(--line)}
.foundation-scene .ff-nav{display:flex;gap:4px;flex-wrap:wrap}.foundation-scene .ff-nav button{border:1px solid transparent;background:transparent;color:var(--ink);font-size:clamp(11px,1.4cqw,14px)}
.foundation-scene .ff-nav button[aria-pressed=true],.foundation-scene .ff-nav button[aria-selected=true]{background:var(--ink);color:var(--paper)}
.foundation-scene .ff-side .ff-nav{display:grid;justify-content:stretch}
.foundation-scene .ff-register article{display:flex;align-items:center;gap:clamp(10px,2cqw,20px);padding:10px 0;border-bottom:1px solid var(--line)}
.foundation-scene .ff-register article>img{width:clamp(44px,10cqw,104px);aspect-ratio:1.2}.foundation-scene .ff-register article>div{min-width:0}.foundation-scene .ff-register button{margin-left:auto;white-space:nowrap}
.foundation-scene .ff-scroll{height:clamp(235px,37cqw,420px);overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;min-height:0}
.foundation-scene .ff-sticky{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;padding:13px 19px;background:var(--green);color:#fffae9}
.foundation-scene .ff-sticky .ff-heading,.foundation-scene .ff-sticky .ff-stamp{margin:0;border:0;padding:0}.foundation-scene .ff-sticky h3{font-size:clamp(21px,3.1cqw,34px)}
.foundation-scene .ff-sticky-scroll .ff-register{padding:0 20px}.foundation-scene .ff-sticky-scroll .ff-register article{min-height:clamp(120px,18cqw,186px)}.foundation-scene .ff-sticky-scroll article img{width:28%;max-height:155px}
.foundation-scene .ff-split{display:grid;grid-template-columns:1fr 1fr;transition:grid-template-columns .45s ease;align-items:stretch}
.foundation-scene .ff-split.ff-wide{grid-template-columns:1.65fr 1fr}.foundation-scene .ff-split>img{height:100%;max-height:440px}.foundation-scene .ff-split>div{padding:clamp(14px,3.6cqw,41px);align-self:center;min-width:0}
.foundation-scene .ff-detail,.foundation-scene .ff-proof,.foundation-scene .ff-paper,.foundation-scene .ff-ink-proof{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center;gap:clamp(13px,4cqw,48px);min-width:0}
.foundation-scene .ff-detail>img,.foundation-scene .ff-proof>img{aspect-ratio:1/1.08;max-height:390px}
.foundation-scene .ff-detail .ff-nav{border-bottom:1px solid var(--line);border-top:1px solid var(--line);padding:4px 0;gap:0}.foundation-scene .ff-detail .ff-nav button{padding:7px 9px}
.foundation-scene .ff-detail [role=tabpanel]{min-height:5.5em}
.foundation-scene .ff-faq details{background:transparent!important;border:0!important;border-top:1px solid var(--line)!important;border-radius:0!important;margin:0!important;padding:0!important}
.foundation-scene .ff-faq summary{display:flex;align-items:center;gap:10px;list-style:none;padding:15px 0;font-size:clamp(13px,2cqw,20px);font-weight:630;color:var(--ink)}
.foundation-scene .ff-faq summary::after{content:'+';margin-left:auto}.foundation-scene .ff-faq details[open] summary::after{content:'−'}
.foundation-scene .ff-faq small,.foundation-scene .ff-contact small{color:var(--rust);font:italic 15px Georgia,serif}
.foundation-scene .ff-faq p{margin:0 0 14px;padding:0 20px}
.foundation-scene .ff-over{position:absolute;inset:0;z-index:4;display:grid;place-items:center;background:#15191270;padding:12px}
.foundation-scene .ff-modal,.foundation-scene .ff-drawer{width:min(100%,430px);max-height:100%;overflow:auto;background:#f9f5e9;color:var(--ink);padding:clamp(14px,2.2cqw,24px);box-shadow:0 8px 42px #25251b41}
.foundation-scene .ff-modal{display:grid;grid-template-columns:.8fr 1fr;gap:16px;align-items:center;animation:ff-popup .24s ease-out}.foundation-scene .ff-modal>img{aspect-ratio:.75}.foundation-scene .ff-modal h3{font-size:clamp(18px,3cqw,30px)}
.foundation-scene .ff-drawer-layer{display:flex;justify-content:flex-end;align-items:stretch;padding:0}
.foundation-scene .ff-drawer{width:min(75%,370px);border-left:1px solid var(--line);animation:ff-drawer .33s cubic-bezier(.2,.72,.22,1)}
.foundation-scene .ff-drawer>.ff-cmd{float:right;padding:5px 8px}.foundation-scene .ff-drawer-copy{clear:both;padding-top:9px}.foundation-scene .ff-drawer-copy img{height:clamp(64px,14cqw,145px);margin-bottom:10px}
.foundation-scene .ff-drawer-copy p{margin-bottom:0}
@keyframes ff-popup{from{opacity:0;transform:scale(.95)}}@keyframes ff-drawer{from{transform:translateX(95%)}}
.foundation-scene .ff-sample-stock,.foundation-scene .ff-ink-swatch{display:flex;flex-direction:column;align-items:center;justify-content:center;background:#efe4ca;aspect-ratio:.94;border:1px solid #b6b09f}
.foundation-scene .ff-sample-stock span{font-size:clamp(9px,1.4cqw,13px)}.foundation-scene .ff-sample-stock b,.foundation-scene .ff-ink-swatch b{color:var(--rust);font:italic 650 clamp(42px,11cqw,126px)/1 Georgia,serif;letter-spacing:-.1em}
.foundation-scene .ff-drop,.foundation-scene .ff-help{position:relative;display:inline-flex;align-items:center;gap:9px}.foundation-scene #ff-papers{position:absolute;z-index:4;top:calc(100% + 3px);left:0;min-width:100%;background:#fffdf5;border:1px solid var(--ink);box-shadow:2px 3px 0 #252a2022}
.foundation-scene #ff-papers button{display:block;width:100%;white-space:nowrap;text-align:left;color:var(--ink);background:transparent;border:0;border-radius:0}.foundation-scene #ff-papers button:is(:hover,:focus-visible){background:#e8dfc9}
.foundation-scene .ff-help button{padding:0;width:27px;height:27px;border-radius:50%}.foundation-scene #ff-tip{position:absolute;z-index:3;bottom:calc(100% + 8px);right:0;width:min(215px,53cqw);padding:11px 14px;background:#222821;color:#fff9e9;font-size:12px;line-height:1.55;box-shadow:0 3px 10px #2223}
.foundation-scene .ff-toast{position:absolute;right:12px;bottom:12px;max-width:calc(100% - 24px);display:flex;align-items:center;gap:12px;padding:9px 12px;background:#26372c;color:#fff8e7;box-shadow:1px 5px 19px #241d173f;animation:ff-popup .2s ease}
.foundation-scene .ff-toast .ff-cmd{padding:4px 7px;color:white;background:transparent;border-color:#b6c4b5}
.foundation-scene .ff-film{overflow:hidden;touch-action:pan-y;cursor:grab}.foundation-scene .ff-filmtrack{display:flex;transition:transform .4s cubic-bezier(.2,.7,.22,1)}
.foundation-scene figure{margin:0}.foundation-scene .ff-filmtrack figure,.foundation-scene .ff-snap figure{position:relative;isolation:isolate;display:flex;align-items:flex-end;color:#fffbee}
.foundation-scene .ff-filmtrack figure{height:clamp(220px,36cqw,400px);min-width:100%;padding:clamp(14px,3cqw,34px)}.foundation-scene[data-demo="15"] .ff-nav{padding:7px;justify-content:center}
.foundation-scene .ff-load{min-height:clamp(125px,24cqw,245px);display:flex;align-items:center;gap:clamp(14px,3cqw,32px)}
.foundation-scene .ff-load>img,.foundation-scene .ff-skeleton span:first-child{width:40%;align-self:stretch;min-height:100%;max-height:245px}
.foundation-scene .ff-skeleton{width:100%;display:grid;grid-template-columns:40% 1fr;grid-template-rows:1fr 1fr;gap:14px;align-self:stretch}
.foundation-scene .ff-skeleton span{background:#d8d2c3;align-self:end;height:13px;animation:ff-pulse .7s ease-in-out alternate infinite}.foundation-scene .ff-skeleton span:first-child{width:100%;grid-row:span 2;height:auto;align-self:stretch}.foundation-scene .ff-skeleton span:last-child{width:65%;align-self:start}
@keyframes ff-pulse{to{opacity:.4}}
.foundation-scene[data-demo="17"] .ff-page{width:min(70%,430px);padding:0;background:none;box-shadow:none}
.foundation-scene .ff-hoverwork{display:block;position:relative;width:100%;padding:0;overflow:hidden;border:0;background:var(--paper);text-align:left;box-shadow:1px 4px 8px #32352a38;transition:transform .32s ease,box-shadow .32s ease}
.foundation-scene .ff-hoverwork>img{aspect-ratio:1.24}.foundation-scene .ff-hoverwork>span{display:block;padding:14px}.foundation-scene .ff-hoverwork small{display:block;max-height:0;opacity:0;overflow:hidden;transition:opacity .25s,max-height .3s;font-weight:500}
.foundation-scene .ff-hoverwork.ff-raised{transform:translateY(-6px) rotate(-1.1deg);box-shadow:2px 13px 18px #32352a40}.foundation-scene .ff-hoverwork.ff-raised small{max-height:5em;opacity:1;margin-top:6px}
.foundation-scene .ff-reveal figure{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);align-items:center;gap:clamp(12px,3cqw,28px);padding:15px 0;border-top:1px solid var(--line);transition:opacity .45s,transform .45s}.foundation-scene .ff-reveal img{height:clamp(120px,20cqw,225px)}
.foundation-scene.ff-live .ff-reveal figure:not(.ff-shown){opacity:0;transform:translateY(18px)}
.foundation-scene .ff-contact figure{padding:6px 6px 10px;background:#fffaf0;box-shadow:1px 3px 6px #3d39292e}.foundation-scene .ff-contact img{aspect-ratio:.78}.foundation-scene .ff-contact figcaption{display:flex;gap:6px;align-items:baseline;margin-top:7px;font-size:clamp(10px,1.6cqw,15px)}
.foundation-scene .ff-ink-swatch{background:#a9442f;border:none;border-radius:2px;position:relative;transition:border-radius .63s,background-color .63s,transform .63s;transform:scale(.89)}
.foundation-scene .ff-ink-swatch b,.foundation-scene .ff-ink-swatch em{color:#fff0ca}.foundation-scene .ff-ink-swatch em{font:14px Georgia,serif}.foundation-scene .ff-ink-swatch.ff-alt{border-radius:48%;background:#345962;transform:scale(.98)}
.foundation-scene .ff-glass,.foundation-scene .ff-depth{isolation:isolate;position:relative;min-height:clamp(245px,39cqw,425px);display:flex;align-items:flex-end;padding:clamp(14px,3cqw,36px)}
.foundation-scene .ff-plaque{padding:clamp(16px,2.8cqw,30px);border:1px solid #e9e4d786;background:#f6f1dcba;backdrop-filter:blur(13px);max-width:70%;transition:background-color .3s}.foundation-scene .ff-plaque.ff-solid{background:#f8f3e4;backdrop-filter:none}
.foundation-scene .ff-depth{overflow:hidden;min-height:100%;color:white}.foundation-scene .ff-depth img{height:125%;top:-12%;will-change:transform}.foundation-scene .ff-depth .ff-heading i{color:#fff4d7}
.foundation-scene .ff-depth-note{padding:clamp(20px,4cqw,45px);min-height:85%}.foundation-scene .ff-snap{scroll-snap-type:y mandatory}
.foundation-scene .ff-snap figure{height:100%;scroll-snap-align:start;padding:clamp(15px,3.6cqw,40px)}
.foundation-scene .ff-heart{background:transparent;color:var(--ink);gap:9px}.foundation-scene .ff-heart b{font-size:1.35em;line-height:1;color:var(--rust)}.foundation-scene .ff-heart em{font:italic 1em Georgia,serif;padding-left:8px;border-left:1px solid #bcb7a3}.foundation-scene .ff-heart[aria-pressed=true]{background:#ead1bc}
.foundation-scene.ff-reduced *, .foundation-scene.ff-reduced *::before{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
@container(max-width:450px){.foundation-scene .ff-page{padding:15px}.foundation-scene .ff-kind{font-size:10px}.foundation-scene .ff-heading h3{font-size:22px}.foundation-scene .ff-flexhead{gap:6px}.foundation-scene .ff-cmd{padding:8px 9px}.foundation-scene .ff-side{grid-template-columns:74px minmax(0,1fr);gap:9px}.foundation-scene .ff-side nav{padding-right:6px}.foundation-scene .ff-side .ff-register .ff-kind{display:none}.foundation-scene .ff-detail{grid-template-columns:minmax(0,.63fr) minmax(0,1fr);gap:12px}.foundation-scene .ff-detail .ff-nav button{padding:7px 5px}.foundation-scene .ff-register article{gap:7px}.foundation-scene .ff-register article>img{width:42px}.foundation-scene .ff-register .ff-work i{font-size:12px}.foundation-scene .ff-split.ff-wide{grid-template-columns:1.35fr 1fr}.foundation-scene .ff-contact figure{padding:3px 3px 6px}.foundation-scene .ff-toast{font-size:11px}.foundation-scene .ff-contact figcaption{display:block}.foundation-scene .ff-contact small{display:block;font-size:11px}.foundation-scene .ff-sticky-scroll article>img{width:29%}.foundation-scene .ff-hero{min-height:270px}.foundation-scene .ff-glass{min-height:260px}}
@media(prefers-reduced-motion:reduce){.foundation-scene *, .foundation-scene *::before{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
</style></head><body><main><header class="sample-heading"><h1>Accordion</h1></header><div id="stage"></div><footer class="sample-tools"><p>Expand a question to read how to care for a print.</p><button id="playDemo">Open first answer</button><button id="reset">Restart</button></footer><p class="sample-status" id="sampleStatus" role="status"></p></main><script>window.MotionFoundationMedia={};</script><script>'use strict';
(() => {
  const works = [
    {title:'Paper Loop', en:'Paper Loop', kind:'Sculpture', process:'Halftone print · paper sculpture', image:'media/paper-loop.webp', alt:'A paper strip printed with red halftone dots and curled into two loops', note:'Look for the deeper red where the strip overlaps.'},
    {title:'Tidal Lines', en:'Tidal Lines', kind:'Print', process:'Two-color print', image:'media/tidal-print.webp', alt:'Teal waves overlap a vermilion sun', note:'Evenly spaced lines shift across the paper like ripples.'},
    {title:'Offset Walk', en:'Offset Walk', kind:'Print', process:'Three-color print', image:'media/offset-print.webp', alt:'Indigo and rust-colored lines form a folded wall', note:'Three offset plates give this print a sense of depth.'}
  ];
  const guides = [
    ['Select View works to open the exhibition list.','An exhibition entrance linking its featured image to the list of works.','Give the featured work one clear action that opens the collection.','View works'],
    ['Switch the width to see the same works arranged in one or three columns.','Keep each image and its title together across screen sizes.','Adjust the number of columns and reading order to suit the available width.','Switch width'],
    ['Select a card to compare the printing process and notes for each work.','Present an image, title, and description as one selectable item.','Select anywhere on a card to update its selection and accompanying description.','Select next work'],
    ['Change the featured work to rearrange the large and small tiles.','Show a featured work alongside related pieces in an exhibition index.','Give the featured work the large tile and keep related works visible.','Change featured work'],
    ['Choose a category on the left to filter the works on the right.','Browse an archive while its categories stay in view.','Keep the category menu in place while the list of works updates.','Next category'],
    ['Scroll inside the list. The exhibition title stays at the top.','Keep the exhibition title visible while reading a long list of works.','Pin the exhibition heading as its list scrolls.','Next work'],
    ['Change the split to compare the space given to the image and its record.','Keep details alongside the work being viewed.','Place the photo and its record side by side with an option to enlarge the photo.','Change split'],
    ['Choose Work, Process, or Care. You can also use the arrow keys on the tabs.','Read different records for the same work.','Group the work, process, and care notes in keyboard-accessible tabs.','Next tab'],
    ['Expand a question to read how to care for a print.','Show individual answers on topics such as shipping or storage.','Expand and collapse the answer in place when its question is selected.','Open first answer'],
    ['Select Check proof. Close the dialog or press Escape to return to your work.','Review a proof and return to the task you were working on.','Open the proof in a centered modal and restore focus to its trigger on close.','Check proof'],
    ['Select View record to open a work’s details beside the list.','Read one work’s full record while keeping your place in the list.','Slide the record in from the side and let Escape close it.','Open record'],
    ['Choose a paper stock and compare its color and description.','Offer a single choice from a small set of colors or materials.','Immediately update the swatch and button when the paper selection changes.','Choose paper'],
    ['Focus or select the help icon next to Spot color to read its definition.','Explain an unfamiliar technical term in context.','Open the help text by mouse, touch, or keyboard and close it with Escape.','Explain spot color'],
    ['Add the work to your viewing list, then select Undo in the notification.','Confirm that a work was saved and offer an immediate way to undo.','Show a notification after saving and restore the previous state on Undo.','Add to viewing list'],
    ['Swipe across the works or select a title below to change slides.','Show several works at the same size in a single viewing area.','Create a manual carousel with navigation that identifies the current work.','Next slide'],
    ['Reload to see the placeholders give way to the cover and notes.','Keep the layout steady while images and records load.','Reserve space for the cover and text, then fill those spaces with the loaded content.','Reload'],
    ['Hover or focus the card to lift the cover and reveal the work’s details.','Hint that more information is available for a work.','Give the card the same response to hover and keyboard focus, with touch support.','Lift cover'],
    ['Scroll down the record to watch the next image and title appear.','Introduce the next work or paragraph as it scrolls into view.','Reveal each work once on entry and show it immediately with reduced motion.','View next work'],
    ['Press play to reveal three proofs one after another.','Present a group of items in a deliberate sequence.','Stagger three proofs by a short interval and keep their final alignment.','Reveal proofs'],
    ['Switch the palette to see the print sample change color, size, and shape.','Connect the two states of a selection visually.','Animate the color and shape between two swatch states.','Switch swatch'],
    ['Change the label material to see how much texture shows through.','Let a readable artwork label float over an image.','Place a translucent label on the photo and adjust its contrast and backdrop blur.','Switch material'],
    ['Scroll inside the panel to see the copy and the image move at different speeds.','Give an artwork commentary a sense of depth.','Move the image and text at different speeds and use a static layout with reduced motion.','Next paragraph'],
    ['Scroll a page at a time and watch each work settle against the edge.','A vertical exhibition of photos or posters, one work at a time.','Snap each work to the viewport edge on vertical scroll.','Next wall'],
    ['Select the heart to save this work and select it again to undo.','Acknowledge a selection as soon as it happens.','Animate the heart briefly and update its saved state and count.','Toggle heart']
  ];
  const guide=Object.fromEntries(guides.map(([instruction,use,request,action],i)=>[i+1,{instruction,use,request,action}]));
  guide[11].spec='Stack three works vertically with a View record button at the right of each row. Slide the selected image and notes in from the right over 330 ms. The panel takes 75% of the list width, up to 370 px. Dim and disable the list and focus Close. Closing with the button, backdrop, or Escape returns focus to the selected row. Open immediately with reduced motion.';
  const media = key => window.MotionFoundationMedia?.[key] || key;
  const img=(i,cls='')=>'<img class="ff-image '+cls+'" src="'+media(works[i].image)+'" alt="'+works[i].alt+'" draggable="false">';
  const name=i=>'<strong>'+works[i].title+'</strong>';
  const byline=i=>'<span class="ff-kind">'+works[i].process+'</span>';
  const command=(act,label,extra='')=>'<button type="button" class="ff-cmd" data-fn="'+act+'" '+extra+'>'+label+'</button>';
  const stamp=text=>'<span class="ff-stamp">'+text+'</span>';
  const heading=(title,sub='')=>'<div class="ff-heading"><h3>'+title+'</h3>'+(sub && sub!==title?'<i lang="en">'+sub+'</i>':'')+'</div>';
  const card=(i,act='',attr='')=>act?'<button class="ff-work" type="button" data-fn="'+act+'" data-i="'+i+'" '+attr+'>'+img(i)+name(i)+'</button>':'<div class="ff-work">'+img(i)+name(i)+'</div>';
  const register=()=>works.map((w,i)=>'<article>'+img(i)+'<div>'+name(i)+byline(i)+'</div></article>').join('');
  const nav=(name,labels,attr='')=>'<div class="ff-nav" '+attr+'>'+labels.map((text,i)=>command(name,text,'data-i="'+i+'" aria-pressed="'+(i===0)+'"')).join('')+'</div>';
  const labelRow=(i)=>'<h4>'+works[i].title+'</h4><p>'+works[i].note+'</p>';
  const selections=['Work','Process','Care'];
  const papers=[
    ['Natural white','Warm, uncoated stock that preserves the texture of the ink.','#efe4ca'],
    ['Bright white','Smooth stock with a crisp white surface.','#f7f6f0'],
    ['Kraft','Brown recycled paper suited to bold line work.','#bf9a67']
  ];
  const answer=[
    ['How should I hold a print?','With clean, dry hands, hold the edges and avoid touching the ink.'],
    ['Where should I store it?','Store it flat, away from direct sunlight, moisture, and bright light.'],
    ['Can I stack the prints?','Separate printed surfaces with clean, thin interleaving paper.']
  ];
  const strips=()=>works.map((w,i)=>'<figure>'+img(i)+'<figcaption>'+name(i)+'</figcaption></figure>').join('');
  const pages = {
    1:()=>'<div class="ff-hero">'+img(0)+'<div>'+stamp('Paper Forms')+'<h3>The Paper Surface</h3>'+command('landing','View works ↗')+'</div></div><div class="ff-index" hidden>'+heading('Exhibited works','Exhibition index')+'<div class="ff-trio">'+works.map((_,i)=>card(i)).join('')+'</div>'+command('landing','← Exhibition cover')+'</div>',
    2:()=>'<div class="ff-flexhead">'+heading('Exhibited works','Exhibition catalogue')+command('width','Single column')+'</div><div class="ff-viewport"><div class="ff-trio">'+works.map((_,i)=>card(i)).join('')+'</div></div>',
    3:()=>heading('Work record','Selected work')+'<div class="ff-trio ff-pickgrid">'+works.map((_,i)=>card(i,'record','aria-pressed="'+(i===0)+'"')).join('')+'</div><div class="ff-record" aria-live="polite">'+labelRow(0)+'</div>',
    4:()=>heading('Three works in this exhibition','On view')+'<div class="ff-bento">'+works.map((_,i)=>card(i,'lead','aria-pressed="'+(i===0)+'"')).join('')+'</div>',
    5:()=>'<div class="ff-side"><nav aria-label="Categories">'+heading('Print archive')+nav('section',['All','Print','Sculpture'])+'</nav><div class="ff-side-results"><h4>All · 3 works</h4><div class="ff-register">'+register()+'</div></div></div>',
    6:()=>'<div class="ff-scroll ff-sticky-scroll" tabindex="0" aria-label="Scroll exhibition list"><div class="ff-sticky">'+heading('The Paper Surface')+stamp('Works')+'</div><div class="ff-register">'+register()+'</div></div>',
    7:()=>'<div class="ff-split">'+img(0)+'<div>'+stamp('Work record')+heading('Paper Loop','Paper Loop')+'<p>'+works[0].note+'</p>'+command('split','Enlarge photo')+'</div></div>',
    8:()=>'<div class="ff-detail">'+img(1)+'<div>'+heading('Tidal Lines','Tidal Lines')+'<div class="ff-nav" role="tablist" aria-label="Work record">'+selections.map((s,i)=>command('tab',s,'role="tab" id="ff-tab-'+i+'" data-i="'+i+'" aria-controls="ff-panel" aria-selected="'+(i===0)+'" tabindex="'+(i===0?'0':'-1')+'"')).join('')+'</div><div id="ff-panel" role="tabpanel" aria-labelledby="ff-tab-0"><p>'+works[1].note+'</p></div></div></div>',
    9:()=>heading('Print care guide','Paper care')+'<div class="ff-faq">'+answer.map(([q,a],i)=>'<details><summary><small>0'+(i+1)+'</small>'+q+'</summary><p>'+a+'</p></details>').join('')+'</div>',
    10:()=>'<div class="ff-proof ff-underlay">'+img(2)+'<div>'+stamp('Print proof')+heading('Offset Walk','Offset Walk')+'<p>Check the registration and edges of the plates.</p>'+command('modal','Check proof')+'</div></div><div class="ff-over" hidden><div class="ff-modal" role="dialog" aria-label="Enlarge proof" aria-modal="true">'+img(2)+'<div>'+heading('Final proof')+'<p>Indigo, vermilion, and brown plates in register.</p>'+command('close','Close and return')+'</div></div></div>',
    11:()=>'<div class="ff-underlay">'+heading('Works','Works register')+'<div class="ff-register">'+works.map((w,i)=>'<article>'+img(i)+'<div>'+name(i)+byline(i)+'</div>'+command('drawer','View record','data-i="'+i+'" aria-label="'+w.title+' View record"')+'</article>').join('')+'</div></div><div class="ff-over ff-drawer-layer" hidden><div class="ff-drawer" role="dialog" aria-label="Work details" aria-modal="true">'+command('close','Close ×')+'<div class="ff-drawer-copy"></div></div></div>',
    12:()=>'<div class="ff-paper"><div class="ff-sample-stock"><span>Spot color proof</span><b>Ink</b></div><div>'+heading('Choose paper','Paper stock')+'<div class="ff-drop">'+command('dropdown',papers[0][0]+' ▾','aria-expanded="false" aria-controls="ff-papers"')+'<div id="ff-papers" hidden>'+papers.map((p,i)=>command('paper',p[0],'data-i="'+i+'"')).join('')+'</div></div><p class="ff-paper-note">'+papers[0][1]+'</p></div></div>',
    13:()=>'<div class="ff-proof">'+img(1)+'<div>'+stamp('Print specifications')+heading('Tidal Lines','Tidal Lines')+'<div class="ff-help"><strong>Two spot colors</strong>'+command('tip','?','aria-label="About spot color" aria-describedby="ff-tip"')+'<div role="tooltip" id="ff-tip" hidden>A spot color uses premixed ink. This work uses two colors.</div></div></div></div>',
    14:()=>'<div class="ff-proof">'+img(2)+'<div>'+stamp('My viewing list')+heading('Offset Walk','Offset Walk')+command('save','Add to viewing list','aria-pressed="false"')+'</div></div><div class="ff-toast" hidden><span role="status">Added to your viewing list.</span>'+command('undo','Undo')+'</div>',
    15:()=>'<div class="ff-film" aria-label="Artwork slides" tabindex="0"><div class="ff-filmtrack">'+works.map((w,i)=>'<figure>'+img(i)+'<figcaption>'+name(i)+'</figcaption></figure>').join('')+'</div></div>'+nav('slide',works.map(w=>w.title)),
    16:()=>heading('New prints','New acquisition')+'<div class="ff-load" aria-live="polite"></div>',
    17:()=>'<button class="ff-hoverwork" data-fn="hover" type="button" aria-expanded="false">'+img(2)+'<span>'+name(2)+'<small>'+works[2].note+'</small></span></button>',
    18:()=>'<div class="ff-scroll ff-reveal" tabindex="0" aria-label="Scroll work records">'+heading('Lines into Images','Line studies')+strips()+'</div>',
    19:()=>heading('Printing sequence','Proof sequence')+'<div class="ff-contact">'+works.map((_,i)=>'<figure>'+img(i)+'<figcaption><small>0'+(i+1)+'</small>'+works[i].title+'</figcaption></figure>').join('')+'</div>',
    20:()=>'<div class="ff-ink-proof"><div class="ff-ink-swatch"><b>Ink</b><em>01</em></div><div>'+heading('Ink swatches','Ink study')+'<p class="ff-ink-name">Red · square swatch</p>'+command('ink','Switch swatch')+'</div></div>',
    21:()=>'<div class="ff-glass">'+img(0)+'<div class="ff-plaque">'+stamp('Paper Forms')+heading('Paper Loop','Paper Loop')+'<p>Halftone print · paper sculpture</p>'+command('glass','Use opaque label')+'</div></div>',
    22:()=>'<div class="ff-scroll ff-parallax" tabindex="0" aria-label="Tidal Lines artwork notes"><div class="ff-depth">'+img(1)+'<div>'+heading('Tidal Lines','Tidal Lines')+'</div></div><div class="ff-depth-note">'+stamp('Artwork notes')+'<h4>Where Lines Become Waves</h4><p>'+works[1].note+'</p></div></div>',
    23:()=>'<div class="ff-scroll ff-snap" tabindex="0" aria-label="Vertical artwork slides">'+strips()+'</div>',
    24:()=>'<div class="ff-proof">'+img(0)+'<div>'+stamp('Saved works')+heading('Paper Loop','Paper Loop')+'<button type="button" class="ff-cmd ff-heart" data-fn="like" aria-pressed="false"><b aria-hidden="true">♡</b><span>Save work</span><em>0</em></button></div></div>'
  };
  function html(id){
    if(!pages[id])return '';
    return '<div class="demo-scene foundation-scene" data-demo="'+id+'"><div class="ff-page" data-cover>'+pages[id]()+'</div></div>';
  }

  function mount(id, root, options={}) {
    const scene=root.querySelector('.foundation-scene');
    const touchProfile=()=>['ios','android'].includes(scene.ownerDocument.documentElement.dataset.motionPlatform);
    const reduced=!!options.reduced || (!!window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches);
    const report=options.status || (()=>{});
    const q=s=>scene.querySelector(s), all=s=>Array.from(scene.querySelectorAll(s));
    const commandFor=act=>q('[data-fn="'+act+'"]');
    const lifetime=new AbortController();
    const on=(element,event,handler,opts={})=>element.addEventListener(event,handler,{...opts,signal:lifetime.signal});
    const timers=new Map();
    const later=(key,fn,ms)=>{clearTimeout(timers.get(key));timers.set(key,setTimeout(fn,ms));};
    const stopTimer=key=>{clearTimeout(timers.get(key)); timers.delete(key);};
    scene.classList.toggle('ff-reduced',reduced);
    let index=0, busy=false, innerOpener=null;
    function listPressed(selector,i){
      all(selector).forEach((entry,n)=>entry.setAttribute('aria-pressed',String(i===n)));
    }
    function scrollOne(){
      const sc=q('.ff-scroll');
      if(!sc)return;
      const end=sc.scrollHeight-sc.clientHeight;
      const target=sc.scrollTop>=end-3?0:Math.min(end,sc.scrollTop+Math.max(75,sc.clientHeight*(id===23?1:.62)));
      sc.scrollTo({top:target,behavior:reduced?'instant':'smooth'});
    }
    function section(i){
      index=i;listPressed('[data-fn="section"]',i);
      const type=['All','Print','Sculpture'][i];
      let count=0;
      all('.ff-register article').forEach((a,j)=>{a.hidden=i!==0&&works[j].kind!==type;if(!a.hidden)count++;});
      q('.ff-side-results h4').textContent=type+' · '+count+(count===1?' work':' works');
    }
    function tab(i,focus=false){
      index=i;
      all('[role="tab"]').forEach((b,n)=>{b.setAttribute('aria-selected',String(n===i));b.tabIndex=n===i?0:-1;});
      if(focus) all('[role="tab"]')[i].focus();
      q('[role="tabpanel"]').setAttribute('aria-labelledby','ff-tab-'+i);
      q('[role="tabpanel"] p').textContent=[works[1].note,'Teal and vermilion inks were printed separately, leaving the paper visible between lines.','Store flat between acid-free sheets without touching the printed surface.'][i];
    }
    function openLayer(button,i){
      innerOpener=button;
      const over=q('.ff-over');
      if(id===11)q('.ff-drawer-copy').innerHTML=img(i)+name(i)+byline(i)+'<p>'+works[i].note+'</p>';
      q('.ff-underlay').inert=true;
      over.hidden=false;commandFor('close').focus({preventScroll:true});
    }
    function closeLayer(){
      q('.ff-over').hidden=true;q('.ff-underlay').inert=false;
      innerOpener?.focus({preventScroll:true});
    }
    function drop(open,focus=false){
      const toggle=commandFor('dropdown');q('#ff-papers').hidden=!open;
      toggle.setAttribute('aria-expanded',String(open));
      if(open&&focus)all('[data-fn="paper"]')[index].focus();
    }
    function slide(i){
      index=(i+works.length)%works.length;
      q('.ff-filmtrack').style.transform='translateX(-'+index*100+'%)';
      listPressed('[data-fn="slide"]',index);
      all('.ff-filmtrack figure').forEach((f,n)=>f.setAttribute('aria-hidden',String(n!==index)));
      report(works[index].title);
    }
    function load(){
      const host=q('.ff-load');
      host.setAttribute('aria-busy','true');
      host.innerHTML='<div class="ff-skeleton"><span></span><span></span><span></span></div>';
      later('load',()=>{
        host.innerHTML=img(1)+'<div>'+byline(1)+name(1)+'<p>'+works[1].note+'</p></div>';
        host.setAttribute('aria-busy','false');report('Work record loaded.');
      },reduced?30:950);
    }
    function pokeHover(show){
      const b=commandFor('hover');b.classList.toggle('ff-raised',show);b.setAttribute('aria-expanded',String(show));
    }
    function reveal(){
      const scroll=q('.ff-scroll'),r=scroll.getBoundingClientRect();
      all('.ff-reveal figure').forEach(el=>{if(el.getBoundingClientRect().top<r.bottom-15 || reduced)el.classList.add('ff-shown');});
    }
    function save(on){
      const b=commandFor('save');b.setAttribute('aria-pressed',String(on)); b.textContent=on?'✓ In viewing list':'Add to viewing list';
      q('.ff-toast').hidden=!on;stopTimer('toast');
      if(on)later('toast',()=>{q('.ff-toast').hidden=true;},3800);
      else report('Removed from your viewing list.');
    }
    function act(button,kind=button?.dataset.fn) {
      if(!button)return;
      const i=Number(button.dataset.i || 0);
      switch(kind){
        case 'landing':{
          const cover=q('.ff-hero'),list=q('.ff-index');
          const open=list.hidden;list.hidden=!open;cover.hidden=open;
          (open?list:cover).querySelector('button').focus({preventScroll:true});
          report(open?'Three works are on display.':'Exhibition cover.');break;
        }
        case 'width':{const small=q('.ff-viewport').classList.toggle('ff-narrow');button.textContent=small?'Three columns':'Single column';button.setAttribute('aria-pressed',String(small));break;}
        case 'record':index=i; listPressed('[data-fn="record"]',i);q('.ff-record').innerHTML=labelRow(i);break;
        case 'lead':{
          index=i; const set=all('[data-fn="lead"]');
          listPressed('[data-fn="lead"]',i);
          set.forEach((b,n)=>b.style.order=String((n-i+3)%3));break;
        }
        case 'section':section(i);break;
        case 'split':{const wide=q('.ff-split').classList.toggle('ff-wide');button.textContent=wide?'Enlarge record':'Enlarge photo';button.setAttribute('aria-pressed',String(wide));break;}
        case 'tab':tab(i);break;
        case 'modal':case 'drawer':openLayer(button,i);break;
        case 'close':closeLayer();break;
        case 'dropdown':drop(q('#ff-papers').hidden);break;
        case 'paper':{
          index=i; const [title,note,color]=papers[i];
          commandFor('dropdown').textContent=title+' ▾';q('.ff-paper-note').textContent=note;
          q('.ff-sample-stock').style.backgroundColor=color;drop(false);commandFor('dropdown').focus();break;
        }
        case 'tip':q('#ff-tip').hidden=touchProfile()?!q('#ff-tip').hidden:false;break;
        case 'save':save(button.getAttribute('aria-pressed')!=='true');break;
        case 'undo':save(false);commandFor('save').focus();break;
        case 'slide':slide(i);break;
        case 'hover':pokeHover(!button.classList.contains('ff-raised'));break;
        case 'ink':{const alt=q('.ff-ink-swatch').classList.toggle('ff-alt');q('.ff-ink-name').textContent=alt?'Blue · rounded swatch':'Red · square swatch';q('.ff-ink-swatch em').textContent=alt?'02':'01';button.setAttribute('aria-pressed',String(alt));break;}
        case 'glass':{const opaque=q('.ff-plaque').classList.toggle('ff-solid');button.textContent=opaque?'Use glass label':'Use opaque label';button.setAttribute('aria-pressed',String(opaque));break;}
        case 'like':{const yes=button.getAttribute('aria-pressed')!=='true';button.setAttribute('aria-pressed',String(yes));button.querySelector('b').textContent=yes?'♥':'♡';button.querySelector('span').textContent=yes?'Saved works':'Save work';button.querySelector('em').textContent=yes?'1':'0';if(!reduced)button.querySelector('b').animate([{transform:'scale(.86)'},{transform:'scale(1.22)'},{transform:'scale(1)'}],{duration:310});break;}
      }
    }
    function play(){
      if(id===1)return act(q((q('.ff-hero').hidden?'.ff-index':'.ff-hero')+' [data-fn]'));
      if(id===3||id===4||id===5||id===8||id===15){
        const action={3:'record',4:'lead',5:'section',8:'tab',15:'slide'}[id];
        return act(all('[data-fn="'+action+'"]')[(index+1)%3]);
      }
      if([6,18,22,23].includes(id))return scrollOne();
      if(id===9){const details=q('details');details.open=!details.open;return;}
      if(id===16)return load();
      if(id===17){pokeHover(true);later('hover',()=>pokeHover(false),1600);return;}
      if(id===19){
        all('.ff-contact figure').forEach((el,n)=>{
          el.getAnimations().forEach(a=>a.cancel());
          if(!reduced)el.animate([{opacity:0,transform:'translateY(24px) rotate(2deg)'},{opacity:1,transform:'none'}],{duration:430,delay:n*150,easing:'cubic-bezier(.2,.75,.25,1)',fill:'backwards'});
        });
        report('Three proofs revealed.');return;
      }
      const primary={2:'width',7:'split',10:'modal',11:'drawer',12:'dropdown',13:'tip',14:'save',20:'ink',21:'glass',24:'like'}[id];
      if(primary){if((id===10||id===11)&&!q('.ff-over').hidden)return closeLayer();return act(commandFor(primary));}
    }
    on(scene,'click',e=>{const b=e.target.closest('button[data-fn]');if(b)act(b);else if(e.target.classList.contains('ff-over'))closeLayer();});
    on(scene,'keydown',e=>{
      const target=e.target, key=e.key;
      if((id===10||id===11)&&!q('.ff-over').hidden){
        if(key==='Escape'){e.preventDefault();e.stopPropagation();closeLayer();}
        else if(key==='Tab'){e.preventDefault();commandFor('close').focus();}
      }else if(id===8&&target.matches('[role="tab"]')&&['ArrowLeft','ArrowRight','Home','End'].includes(key)){
        e.preventDefault();tab(key==='Home'?0:key==='End'?2:(index+(key==='ArrowLeft'?2:1))%3,true);
      }else if(id===12){
        if(key==='Escape'&&!q('#ff-papers').hidden){e.preventDefault();e.stopPropagation();drop(false);commandFor('dropdown').focus();}
        if(['ArrowDown','ArrowUp','Home','End'].includes(key)){e.preventDefault();if(q('#ff-papers').hidden)drop(true,true);else{const items=all('[data-fn="paper"]');const pos=items.indexOf(target);items[key==='Home'?0:key==='End'?2:(pos+(key==='ArrowDown'?1:2))%3].focus();}}
      }else if(id===13&&key==='Escape'&&!q('#ff-tip').hidden){e.preventDefault();e.stopPropagation();q('#ff-tip').hidden=true;}
      else if(id===15&&['ArrowLeft','ArrowRight'].includes(key)){e.preventDefault();slide(index+(key==='ArrowRight'?1:-1));}
    });
    if(id===12) on(scene,'focusout',e=>{if(!q('.ff-drop').contains(e.relatedTarget))drop(false);});
    if(id===13){
      const trigger=commandFor('tip');
      on(trigger,'pointerenter',()=>{if(!touchProfile())q('#ff-tip').hidden=false;});
      on(trigger,'focus',()=>{if(!touchProfile()||trigger.matches(':focus-visible'))q('#ff-tip').hidden=false;});
      on(trigger,'pointerleave',()=>{if(!touchProfile())q('#ff-tip').hidden=true;});
      on(trigger,'blur',()=>{q('#ff-tip').hidden=true;});
      on(scene.ownerDocument,'pointerdown',e=>{if(touchProfile()&&!q('.ff-help').contains(e.target))q('#ff-tip').hidden=true;});
    }
    if(id===15){
      let start=0;
      const surface=q('.ff-film');
      on(surface,'pointerdown',e=>{start=e.clientX;busy=true;surface.setPointerCapture(e.pointerId);});
      on(surface,'pointerup',e=>{if(busy && Math.abs(e.clientX-start)>30)slide(index+(e.clientX<start?1:-1));busy=false;});
      on(surface,'pointercancel',()=>busy=false);
      slide(0);
    }
    if(id===16)load();
    if(id===17){
      const b=commandFor('hover');
      on(b,'pointerenter',e=>{if(!touchProfile()&&e.pointerType==='mouse')pokeHover(true);});
      on(b,'pointerleave',e=>{if(!touchProfile()&&e.pointerType==='mouse')pokeHover(false);});
      on(b,'focus',()=>{if(b.matches(':focus-visible'))pokeHover(true);});on(b,'blur',()=>pokeHover(false));
    }
    if(id===18) {scene.classList.add('ff-live');on(q('.ff-scroll'),'scroll',reveal,{passive:true});reveal();}
    if(id===22&&!reduced){const sc=q('.ff-scroll');on(sc,'scroll',()=>{q('.ff-depth img').style.transform='translateY('+sc.scrollTop*.34+'px)';},{passive:true});}
    function dispose(){lifetime.abort();timers.forEach(clearTimeout);scene.getAnimations({subtree:true}).forEach(a=>a.cancel());}
    return {play,dispose};
  }
  const assetsFor=id=>{
    const ids={7:[0],8:[1],9:[],10:[2],12:[],13:[1],14:[2],16:[1],17:[2],20:[],21:[0],22:[1],24:[0]}[id] || [0,1,2];
    return ids.map(i=>works[i].image);
  };
  window.MotionFoundation={html,mount,guide,assetsFor,assets:works.map(work=>work.image)};
})();
</script><script>const id=9, stage=document.querySelector("#stage"), play=document.querySelector("#playDemo"), status=document.querySelector("#sampleStatus"),m=matchMedia("(prefers-reduced-motion: reduce)");let view;function mount(){view?.dispose();status.textContent="";play.textContent="Open first answer";const options={reduced:m.matches,status:text=>{status.textContent=text},playButton:play};stage.innerHTML=MotionFoundation.html(id);view=MotionFoundation.mount(id,stage,options);}mount();play.addEventListener("click",()=>view.play());document.querySelector("#reset").addEventListener("click",mount);m.addEventListener("change",mount);</script></body></html>
```
