from pathlib import Path
root=Path(__file__).resolve().parent
plates=[('01 / Direction','Three ways to tell the same story','directions/three-directions.png','Soft 3D is recommended. Fieldbook and clay remain alternatives.'),('02 / Summit','A steady hand','characters/summit-sheet.png','Round hood, charcoal parka, warm trim, and green-gold goggles.'),('03 / Ridge','Read the route','characters/ridge-sheet.png','Helmet, parked goggles, blue harness, and clipped rope.'),('04 / Terra','Learn along the way','characters/terra-sheet.png','Modern trekking gear for an invented Andean route. The textile band is an original pattern.'),('05 / World','Every route has a guide','world/routes-and-story.png','Snow, rock, and Andean scenes. Forest, desert, and coast remain open paths.'),('06 / Motion','Thought becomes action','motion/family-keyposes.png','New key poses. Each action has a prop, a hold, and a clear end.'),('07 / Parts','Build from clear shapes','parts/family-exploded-study.png','Concept split only. Separate vector parts below use the old draft shape.')]
html='''<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Sherpa — First artbook</title><style>*{box-sizing:border-box}body{margin:0;background:#eee7d8;color:#29342f;font:17px/1.6 system-ui,sans-serif}main{max-width:1240px;margin:auto;padding:60px 32px}header{max-width:860px;margin-bottom:64px}h1{font:clamp(48px,7vw,92px)/1.05 Georgia,serif;margin:12px 0 24px}h2{font:36px/1.2 Georgia,serif;margin:8px 0 14px}.kicker{text-transform:uppercase;letter-spacing:.17em;font-size:12px;color:#795f48}section{margin:56px 0}img.plate{display:block;width:100%;border:1px solid #cfbfaa;border-radius:4px}a{color:#4c654c;text-underline-offset:4px}.loops{display:grid;grid-template-columns:repeat(6,1fr);gap:10px}figure{margin:0;background:#faf6ec;padding:12px;border:1px solid #d8cab5;text-align:center;border-radius:6px}figure img{width:100%;display:block}figcaption{font-size:13px}details{margin:18px 0}summary{cursor:pointer;font-weight:600}.note{padding:20px;background:#e0d8c7;border-left:3px solid #a45f43}nav{display:flex;flex-wrap:wrap;gap:16px}@media(max-width:700px){main{padding:36px 16px}.loops{grid-template-columns:repeat(3,1fr)}h2{font-size:28px}}@media print{body{background:white}section{break-before:page}.loops{display:none}}</style><main><header><div class="kicker">Sherpa / Artbook 01 / October 8, 2026</div><h1>Small guides.<br>Wide horizons.</h1><p>A family that helps people learn, choose a route, and take the next step.</p><p class="note"><strong>Recommendation: soft 3D.</strong> Keep the warmth and shape of the original. Give each guide a clear outline, useful gear, and a world to explore.</p><nav><a href="notes/art-direction.md">Design rules</a><a href="notes/motion.md">Motion notes</a><a href="notes/world.md">World notes</a><a href="parts/README.md">Parts guide</a><a href="notes/review.md">Review limits</a></nav></header>'''
for k,title,path,caption in plates:
    html+=f'<section><div class="kicker">{k}</div><h2>{title}</h2><a href="{path}"><img class="plate" src="{path}" alt="{title}"></a><p>{caption}</p></section>'
html+='<section><div class="kicker">08 / Timing lab</div><h2>Draft vector motion loops</h2><p>These loops use the starting vector shapes. They test timing. They are not the new 3D designs. Celebration plays once; open its file to replay it. Reduced motion holds a still pose.</p>'
for name in ['summit','ridge','terra']:
    html+=f'<h3>{name.title()}</h3><div class="loops">'
    for state in ['idle','thinking','working','writing','celebrate','rest']:
        path=f'motion/{name}/{state}.svg'
        html+=f'<figure><a href="{path}"><img src="{path}" alt="{name.title()} {state} draft timing study"></a><figcaption>{state.title()}</figcaption></figure>'
    html+='</div><details><summary>Separate '+name.title()+' vector parts</summary><p>'
    for p in sorted((root/'parts'/name).glob('*.svg')):
        rel=p.relative_to(root);html+=f'<a href="{rel}">{p.stem}</a> · '
    html+='</p></details>'
html+='</section><footer><p>Draft for review. Starting assets are preserved. Built-in imagegen artwork; local SVG timing studies.</p></footer></main></html>'
(root/'index.html').write_text(html)
print('Saved local review document.')
