from pathlib import Path
from html import escape
import json

THEME=Path('/opt/cosmosluminosity/content/themes/clean')

L={
'ru':{
'layout':'default','file':'page-next-chapter-experiment.hbs','lang':'ru','url':'https://www.cosmosluminosity.com/next-chapter-experiment/','ru':'https://www.cosmosluminosity.com/next-chapter-experiment/','en':'https://www.cosmosluminosity.com/next-chapter-experiment-en/',
'title':'Что на самом деле меняется?','page':'Исследование профессионального перехода — Cosmos Luminosity','desc':'Управляемое исследование профессионального перехода: найди неочевидную структуру изменений и создай эксперимент до большого решения.','label':'Бесплатное управляемое исследование','lead':'Различи, что именно завершилось, что остаётся живым и что стоит проверить до большого профессионального решения.','promise':'Конкретные эпизоды → контрасты → возможное прочтение → Transition Square → эксперимент','time':'25–30 минут','privacy':'Без регистрации. Ответы остаются в браузере.','start':'Начать исследование','about_h':'Не анкета. Исследование по свидетельствам.','about_p':'Ты не обязана заранее знать, что сохранить, отпустить или выбрать. Мы начнём с конкретных рабочих эпизодов, сопоставим условия, живые части работы, скрытые функции и реальные ограничения. В финале ты увидишь возможное прочтение — вместе с основаниями, противоречиями и способом проверить его в жизни.','steps':['Разрыв','Живое','Контракт','Цена','Проверка','Brief'],
'back':'Назад','next':'Продолжить','make':'Создать мой Brief','required':'Ответь на отмеченные вопросы, чтобы продолжить.','choose':'Выбери хотя бы один вариант.','optional':'Необязательно',
's1h':'Начни с реального момента','s1p':'Не объясняй всю карьеру. Возьми один недавний эпизод, в котором особенно ясно прозвучало: «Я больше не хочу продолжать так».','question':'Какой профессиональный вопрос сейчас не даёт тебе покоя?','question_ph':'Например: я хочу уйти из профессии — или изменить способ, которым я в ней работаю?','rupture':'Что конкретно произошло в том эпизоде?','rupture_ph':'Где ты была, что делала, кто участвовал, в какой момент возникло внутреннее «больше нет»?','hardest':'Что в этом было самым тяжёлым?','hard_opts':[['content','Само содержание работы'],['rhythm','Ритм и постоянная срочность'],['responsibility','Объём или тип ответственности'],['availability','Постоянная доступность'],['environment','Среда, культура или отношения'],['identity','Необходимость соответствовать роли'],['agency','Недостаток влияния и авторства'],['meaning','Бессмысленность результата']], 'ideal':'Если та же работа происходила бы в другой среде, другом ритме и с ясными границами — что изменилось бы?','ideal_opts':[['yes','Большая часть напряжения исчезла бы'],['partly','Стало бы легче, но существенная часть осталась бы'],['no','Почти ничего: сама работа больше не оживает']], 'remains':'Что осталось бы неприемлемым даже в идеальных условиях?','remains_ph':'Назови то, что невозможно исправить одной сменой темпа, команды или границ.',
's2h':'Найди то, что действительно остаётся живым','s2p':'Мастерство, которое принадлежит тебе, не равно должности, которую ты сейчас занимаешь.','alive':'Вспомни рабочий момент последнего года, когда ты чувствовала себя наиболее присутствующей. Что происходило?','alive_ph':'Даже если ты устала, что в этом моменте давало ощущение жизни, ясности или глубины?','activity':'Что именно ты тогда делала?','act_opts':[['solve','Распутывала сложность'],['create','Создавала новое'],['explain','Объясняла и придавала смысл'],['decide','Принимала решения'],['connect','Соединяла людей или идеи'],['direct','Влияла на направление'],['support','Поддерживала развитие других'],['design','Создавала красоту или опыт'],['system','Выстраивала систему']], 'skilled':'Что ты всё ещё умеешь делать хорошо, но больше не хочешь делать центральной частью своей жизни?','skilled_ph':'Компетентность не обязывает продолжать.','underused':'Какой способности в тебе нынешняя роль почти не даёт места?','underused_ph':'Что в тебе используется слишком мало?','asked':'Если убрать должность и индустрию, за чем люди всё равно приходили бы именно к тебе?','asked_ph':'Какую ценность они доверяют тебе создавать?',
's3h':'Увидь скрытый контракт с нынешней работой','s3p':'Иногда удерживает не сама работа, а то, что через неё обеспечивается.','fear':'Если бы вопрос денег был безопасно решён, что всё равно было бы страшно потерять?','fear_opts':[['status','Статус и признание'],['belonging','Принадлежность к профессиональному кругу'],['identity','Понятную идентичность'],['influence','Влияние и видимость'],['structure','Структуру жизни'],['intensity','Интеллектуальную интенсивность'],['proof','Доказательство собственной ценности'],['investment','Смысл уже вложенных лет']], 'confirms':'Что нынешняя роль подтверждает о тебе?','confirm_opts':[['competent','Я компетентна'],['significant','Я значима'],['independent','Я независима'],['ambitious','Я всё ещё амбициозна'],['reliable','На меня можно положиться'],['insider','Я принадлежу к определённому кругу']], 'whose':'Чью реакцию ты невольно учитываешь, когда представляешь изменение?','whose_ph':'Конкретный человек, профессиональное сообщество или образ себя из прошлого.','functions':'Какие функции работа выполняет помимо дохода?','function_opts':[['time','Структурирует время'],['social','Даёт социальную среду'],['needed','Позволяет чувствовать себя нужной'],['certainty','Защищает от неопределённости'],['identity','Даёт идентичность'],['status','Даёт статус'],['intensity','Создаёт интеллектуальную интенсивность'],['avoidance','Позволяет не задавать другие вопросы']], 'portable':'Что из этого требуется сохранить, но не обязательно через нынешнюю работу?','portable_ph':'Какие функции можно перенести в новую архитектуру жизни?',
's4h':'Посчитай обе цены','s4p':'Большое решение и отсутствие решения создают последствия. Посмотрим на обе стороны без романтизации.','staycost':'Если ничего существенно не изменится два года, где накопится цена?','cost_opts':[['energy','Энергия'],['health','Здоровье'],['relations','Отношения'],['creativity','Творческая способность'],['respect','Самоуважение'],['money','Деньги'],['time','Время'],['future','Будущие возможности']], 'lose_stay':'Что ты постепенно теряешь, оставаясь?','lose_stay_ph':'Не драматизируй — назови наблюдаемый процесс.','gain_move':'Что может стать возможным при изменении?','gain_move_ph':'Какой новый ресурс, опыт или способ участия может появиться?','risk_move':'Что действительно может быть потеряно при изменении?','risk_move_ph':'Без идеализации новой главы.','reversible':'Какая часть возможного изменения обратима?','rev_opts':[['high','Большую часть можно проверить без окончательного решения'],['medium','Некоторые части обратимы, другие потребуют обязательств'],['low','Изменение затронет труднообратимые решения']], 'capacity':'Какой у тебя сейчас реальный запас для эксперимента?','cap_opts':[['low','Минимальный: важны безопасность и очень малый шаг'],['medium','Умеренный: могу выделить время и провести разговор'],['high','Достаточный: могу создать прототип или рыночную проверку']],
's5h':'Проверь неизвестное, а не себя','s5p':'Эксперимент не доказывает твою смелость и не подтверждает заранее выбранный ответ. Он создаёт данные там, где сейчас есть предположение.','synthesis_preview':'Предварительное различение','assumption':'Какое предположение особенно важно проверить?','experiment':'Какой ограниченный шаг способен создать данные?','boundary':'Что остаётся неизменным во время проверки?','boundary_ph':'Например: я не увольняюсь, не объявляю решение и не беру финансовых обязательств.','window':'Окно эксперимента','window_ph':'Один разговор, два рабочих блока, 72 часа, одна неделя…','evidence':'Что будет считаться данными?','evidence_opts':[['energy','Энергия после действия'],['curiosity','Желание продолжить'],['quality','Качество результата'],['response','Реакция людей или среды'],['money','Материальный интерес'],['body','Телесная реакция'],['resistance','Характер сопротивления']], 'evidence_other':'Добавить собственный критерий evidence','evidence_other_ph':'Какой наблюдаемый сигнал важен именно для твоего вопроса?','continue':'Сигнал продолжать','continue_ph':'Что покажет, что направление заслуживает следующего шага?','stop':'Сигнал остановиться или пересобрать','stop_ph':'Что будет достаточным основанием изменить эксперимент, а не обвинять себя?','review':'Вопрос для Evidence Review','review_ph':'Что должно стать яснее после контакта гипотезы с реальностью?',
'result_label':'Твой персональный документ','result_h':'Transition Intelligence Brief','result_p':'Возможное прочтение, а не внешний вердикт. Каждый вывод связан с твоими ответами и остаётся гипотезой до встречи с реальностью.','reading':'Что, возможно, меняется на самом деле','based':'На чём основано это прочтение','counter':'Что ему может противоречить','contract':'Скрытый контракт с нынешней работой','unchanged':'Цена неизменности','square':'Твой Transition Square','carry':'CARRY FORWARD · Что принадлежит тебе','release':'RELEASE · Что завершается','redesign':'REDESIGN · Что можно пересобрать','discover':'DISCOVER · Что пока требует данных','cont_a':'Продолжение A · Preserve & Redesign','cont_b':'Продолжение B · Recompose Elsewhere','assumption_out':'Ключевое недоказанное предположение','experiment_out':'Протокол эксперимента','evidence_out':'Наблюдаемые данные','rules':'Границы решения','review_out':'Вопрос Evidence Review','print':'Сохранить / распечатать Brief','copy':'Скопировать содержание','copied':'Содержание скопировано','restart':'Исследовать другой вопрос','after_h':'Что дальше','after_p':'Возьми Brief в один реальный разговор или эксперимент. Если потребуется полная архитектура перехода и Evidence Review, продолжи в Gateway: Between Identities.','gateway':'Исследовать Gateway','home':'На главную','empty':'Не указано',
},
'en':{
'layout':'default-en','file':'page-next-chapter-experiment-en.hbs','lang':'en','url':'https://www.cosmosluminosity.com/next-chapter-experiment-en/','ru':'https://www.cosmosluminosity.com/next-chapter-experiment/','en':'https://www.cosmosluminosity.com/next-chapter-experiment-en/',
'title':'What is actually changing?','page':'Professional Transition Investigation — Cosmos Luminosity','desc':'A guided professional-transition investigation that reveals what may actually be changing and what to test before a major decision.','label':'A free guided investigation','lead':'Discern what has actually ended, what remains alive, and what to test before making a major professional move.','promise':'Concrete episodes → contrasts → a possible reading → Transition Square → experiment','time':'25–30 minutes','privacy':'No sign-up. Your answers remain in your browser.','start':'Begin the investigation','about_h':'Not a questionnaire. An evidence-led investigation.','about_p':'You do not have to know in advance what to preserve, release, or choose. We begin with concrete work episodes, then compare conditions, living parts of the work, hidden functions, and real constraints. Your final Brief offers a possible reading—with its evidence, contradictions, and a way to test it in life.','steps':['Rupture','Alive','Contract','Cost','Test','Brief'],
'back':'Back','next':'Continue','make':'Create my Brief','required':'Complete the marked questions to continue.','choose':'Choose at least one option.','optional':'Optional',
's1h':'Begin with a real moment','s1p':'Do not explain your entire career. Choose one recent episode in which you clearly felt: “I do not want to continue like this.”','question':'What professional question will not leave you alone?','question_ph':'For example: do I want to leave my profession—or change the way I work inside it?','rupture':'What specifically happened in that episode?','rupture_ph':'Where were you, what were you doing, who was involved, and when did the inner “no more” appear?','hardest':'What was hardest about it?','hard_opts':[['content','The work itself'],['rhythm','Pace and constant urgency'],['responsibility','The volume or kind of responsibility'],['availability','Permanent availability'],['environment','Environment, culture, or relationships'],['identity','Having to perform the role'],['agency','Lack of influence and authorship'],['meaning','Meaninglessness of the outcome']], 'ideal':'If the same work happened in a different environment, at a different pace, with clear boundaries—what would change?','ideal_opts':[['yes','Most of the tension would disappear'],['partly','It would improve, but something significant would remain'],['no','Almost nothing: the work itself no longer comes alive']], 'remains':'What would remain unacceptable even under ideal conditions?','remains_ph':'Name what cannot be solved only by changing pace, team, or boundaries.',
's2h':'Find what remains genuinely alive','s2p':'The mastery that belongs to you is not the same as the role you currently occupy.','alive':'Recall a work moment in the last year when you felt most present. What was happening?','alive_ph':'Even if you were tired, what brought aliveness, clarity, or depth?','activity':'What were you actually doing?','act_opts':[['solve','Untangling complexity'],['create','Creating something new'],['explain','Explaining and making meaning'],['decide','Making decisions'],['connect','Connecting people or ideas'],['direct','Influencing direction'],['support','Supporting others’ growth'],['design','Creating beauty or experience'],['system','Building a system']], 'skilled':'What are you still good at, but no longer want at the center of your life?','skilled_ph':'Competence does not oblige continuation.','underused':'Which capacity in you gets almost no room in the current role?','underused_ph':'What is being underused?','asked':'Without title or industry, what would people still come to you for?','asked_ph':'What value do they trust you to create?',
's3h':'See the hidden contract with the current work','s3p':'Sometimes the work itself is not what holds us. Its other functions do.','fear':'If money were safely handled, what would still be frightening to lose?','fear_opts':[['status','Status and recognition'],['belonging','Professional belonging'],['identity','A legible identity'],['influence','Influence and visibility'],['structure','Life structure'],['intensity','Intellectual intensity'],['proof','Proof of my worth'],['investment','Meaning of the years invested']], 'confirms':'What does the current role confirm about you?','confirm_opts':[['competent','I am competent'],['significant','I matter'],['independent','I am independent'],['ambitious','I am still ambitious'],['reliable','I can be relied upon'],['insider','I belong to a particular world']], 'whose':'Whose response do you quietly account for when imagining change?','whose_ph':'A specific person, professional community, or an earlier image of yourself.','functions':'What functions does work perform beyond income?','function_opts':[['time','Structures time'],['social','Provides a social world'],['needed','Lets me feel needed'],['certainty','Protects from uncertainty'],['identity','Provides identity'],['status','Provides status'],['intensity','Creates intellectual intensity'],['avoidance','Lets me avoid other questions']], 'portable':'What needs to be preserved, but not necessarily through this work?','portable_ph':'Which functions could move into a new life architecture?',
's4h':'Count both costs','s4p':'A major move and no move both create consequences. Let us see both without romanticising either.','staycost':'If nothing materially changes for two years, where will the cost accumulate?','cost_opts':[['energy','Energy'],['health','Health'],['relations','Relationships'],['creativity','Creative capacity'],['respect','Self-respect'],['money','Money'],['time','Time'],['future','Future options']], 'lose_stay':'What are you gradually losing by staying?','lose_stay_ph':'Do not dramatise. Name the observable process.','gain_move':'What could become possible through change?','gain_move_ph':'What new resource, experience, or way of participating might appear?','risk_move':'What could genuinely be lost through change?','risk_move_ph':'Without idealising the next chapter.','reversible':'How much of the possible change is reversible?','rev_opts':[['high','Most can be tested before a final decision'],['medium','Some parts are reversible; others require commitment'],['low','The change touches hard-to-reverse decisions']], 'capacity':'What real capacity do you have for an experiment now?','cap_opts':[['low','Minimal: safety and a very small step matter'],['medium','Moderate: I can make time and have a conversation'],['high','Sufficient: I can build a prototype or market test']],
's5h':'Test the unknown, not yourself','s5p':'The experiment does not prove your courage or validate a preferred answer. It creates evidence where there is currently an assumption.','synthesis_preview':'Preliminary distinction','assumption':'Which assumption matters most to test?','experiment':'What bounded step could create evidence?','boundary':'What stays unchanged during the test?','boundary_ph':'For example: I do not resign, announce a decision, or take on a financial commitment.','window':'Experiment window','window_ph':'One conversation, two work blocks, 72 hours, one week…','evidence':'What will count as evidence?','evidence_opts':[['energy','Energy after the action'],['curiosity','Desire to continue'],['quality','Quality of the outcome'],['response','Response from people or environment'],['money','Material interest'],['body','Bodily response'],['resistance','Nature of the resistance']], 'evidence_other':'Add your own evidence criterion','evidence_other_ph':'What observable signal matters specifically for your question?','continue':'Signal to continue','continue_ph':'What would show that this direction deserves another step?','stop':'Signal to stop or redesign','stop_ph':'What would be sufficient reason to change the experiment rather than blame yourself?','review':'Evidence Review question','review_ph':'What should become clearer after the hypothesis meets real life?',
'result_label':'Your personal document','result_h':'Transition Intelligence Brief','result_p':'A possible reading, not an external verdict. Every conclusion is connected to your responses and remains a hypothesis until it meets reality.','reading':'What may actually be changing','based':'What this reading is based on','counter':'What may contradict it','contract':'The hidden contract with current work','unchanged':'The cost of no change','square':'Your Transition Square','carry':'CARRY FORWARD · What belongs to you','release':'RELEASE · What is ending','redesign':'REDESIGN · What can be reconfigured','discover':'DISCOVER · What still needs evidence','cont_a':'Continuation A · Preserve & Redesign','cont_b':'Continuation B · Recompose Elsewhere','assumption_out':'Key unproven assumption','experiment_out':'Experiment protocol','evidence_out':'Observable evidence','rules':'Decision boundaries','review_out':'Evidence Review question','print':'Save / print the Brief','copy':'Copy the content','copied':'Content copied','restart':'Investigate another question','after_h':'What comes next','after_p':'Take the Brief into one real conversation or experiment. If you need a fuller transition architecture and Evidence Review, continue into Gateway: Between Identities.','gateway':'Explore Gateway','home':'Return home','empty':'Not specified',
}}

def opts(name,items,multi=False):
 t='checkbox' if multi else 'radio'
 return ''.join(f'<label class="choice"><input type="{t}" name="{name}" value="{v}"><span>{escape(x)}</span></label>' for v,x in items)
def field(label,name,ph='',rows=3,required=True):
 req='<b aria-hidden="true">*</b>' if required else ''
 return f'<label class="field"><span>{escape(label)} {req}</span><textarea name="{name}" rows="{rows}" placeholder="{escape(ph)}"></textarea></label>'
def group(label,name,items,multi=False):
 return f'<div class="field-group"><span class="group-label">{escape(label)} <b aria-hidden="true">*</b></span><div class="choice-grid">{opts(name,items,multi)}</div></div>'
def result_item(key,label,cls=''):
 return f'<section class="brief-item {cls}"><h3>{escape(label)}</h3><div data-out="{key}"></div></section>'

def build(c):
 gateway='/gateways/' if c['lang']=='ru' else '/en/gateways/'
 home='/' if c['lang']=='ru' else '/en/'
 p=[f'{{{{!< {c["layout"]}}}}}',f'{{{{#contentFor "page_title"}}}}{c["page"]}{{{{/contentFor}}}}',f'{{{{#contentFor "page_description"}}}}{c["desc"]}{{{{/contentFor}}}}',f'{{{{#contentFor "canonical_url"}}}}{c["url"]}{{{{/contentFor}}}}',f'{{{{#contentFor "ru_url"}}}}{c["ru"]}{{{{/contentFor}}}}',f'{{{{#contentFor "en_url"}}}}{c["en"]}{{{{/contentFor}}}}','<link rel="stylesheet" href="{{asset "css/experiment.css"}}">',f'<div class="investigation-page" data-investigation data-version="3" lang="{c["lang"]}">']
 p.append(f'<section class="investigation-hero"><div class="hero-orbit" aria-hidden="true"></div><div class="investigation-hero-inner"><p class="eyebrow">{c["label"]}</p><h1>{c["title"]}</h1><p class="hero-lead">{c["lead"]}</p><p class="hero-sequence">{c["promise"]}</p><div class="hero-meta"><span>{c["time"]}</span><span>{c["privacy"]}</span></div><button class="ix-button primary" type="button" data-start>{c["start"]}</button></div></section>')
 p.append(f'<section class="investigation-about"><p class="eyebrow">Cosmos Luminosity</p><h2>{c["about_h"]}</h2><p>{c["about_p"]}</p></section>')
 p.append('<section class="investigation-workspace" data-workspace hidden><nav class="ix-progress" aria-label="Progress"><ol>'+''.join(f'<li data-progress="{i}"><span>{i}</span><b>{x}</b></li>' for i,x in enumerate(c['steps'],1))+'</ol><i data-bar></i></nav><form data-form novalidate>')
 # 1
 p.append(f'<fieldset class="ix-step" data-step="1"><legend>{c["s1h"]}</legend><p class="step-intro">{c["s1p"]}</p>{field(c["question"],"question",c["question_ph"],3)}{field(c["rupture"],"rupture",c["rupture_ph"],5)}{group(c["hardest"],"hardest",c["hard_opts"])}{group(c["ideal"],"ideal",c["ideal_opts"])}{field(c["remains"],"remains",c["remains_ph"],3)}<p class="form-error" data-error></p></fieldset>')
 # 2
 p.append(f'<fieldset class="ix-step" data-step="2" hidden><legend>{c["s2h"]}</legend><p class="step-intro">{c["s2p"]}</p>{field(c["alive"],"alive",c["alive_ph"],5)}{group(c["activity"],"activity",c["act_opts"],True)}{field(c["skilled"],"skilled",c["skilled_ph"],3)}{field(c["underused"],"underused",c["underused_ph"],3)}{field(c["asked"],"asked",c["asked_ph"],3)}<p class="form-error" data-error></p></fieldset>')
 # 3
 p.append(f'<fieldset class="ix-step" data-step="3" hidden><legend>{c["s3h"]}</legend><p class="step-intro">{c["s3p"]}</p>{group(c["fear"],"fear",c["fear_opts"],True)}{group(c["confirms"],"confirms",c["confirm_opts"],True)}{field(c["whose"],"whose",c["whose_ph"],3,False)}{group(c["functions"],"functions",c["function_opts"],True)}{field(c["portable"],"portable",c["portable_ph"],3)}<p class="form-error" data-error></p></fieldset>')
 # 4
 p.append(f'<fieldset class="ix-step" data-step="4" hidden><legend>{c["s4h"]}</legend><p class="step-intro">{c["s4p"]}</p>{group(c["staycost"],"staycost",c["cost_opts"],True)}{field(c["lose_stay"],"lose_stay",c["lose_stay_ph"],3)}{field(c["gain_move"],"gain_move",c["gain_move_ph"],3)}{field(c["risk_move"],"risk_move",c["risk_move_ph"],3)}{group(c["reversible"],"reversible",c["rev_opts"])}{group(c["capacity"],"capacity",c["cap_opts"])}<p class="form-error" data-error></p></fieldset>')
 # 5 dynamically prefilled
 p.append(f'<fieldset class="ix-step" data-step="5" hidden><legend>{c["s5h"]}</legend><p class="step-intro">{c["s5p"]}</p><aside class="preview"><span>{c["synthesis_preview"]}</span><p data-preview></p></aside>{field(c["assumption"],"assumption","",4)}{field(c["experiment"],"experiment","",4)}{field(c["boundary"],"boundary",c["boundary_ph"],3)}{field(c["window"],"window",c["window_ph"],2)}{group(c["evidence"],"evidence",c["evidence_opts"],True)}{field(c["evidence_other"],"evidence_other",c["evidence_other_ph"],2,False)}{field(c["continue"],"continue_rule",c["continue_ph"],3)}{field(c["stop"],"stop_rule",c["stop_ph"],3)}{field(c["review"],"review_question",c["review_ph"],3)}<p class="form-error" data-error></p></fieldset>')
 p.append(f'<div class="form-nav"><button class="ix-button" type="button" data-back hidden>{c["back"]}</button><button class="ix-button primary" type="button" data-next>{c["next"]}</button></div></form>')
 # result
 p.append(f'<section class="ix-result" data-result hidden aria-live="polite"><header class="result-intro"><p class="eyebrow">{c["result_label"]}</p><h2>{c["result_h"]}</h2><p>{c["result_p"]}</p></header><article class="intelligence-brief" data-brief><header class="brief-cover"><div><span>COSMOS LUMINOSITY</span><b>THE THOUGHTFUL TRANSITION</b></div><h2>Transition<br>Intelligence Brief</h2><p>Pattern · Tension · Choice · Evidence</p></header><div class="brief-body">')
 p += [result_item('reading',c['reading'],'feature'),result_item('based',c['based']),result_item('counter',c['counter']),result_item('contract',c['contract'],'wide'),result_item('unchanged',c['unchanged'],'wide')]
 p.append(f'<section class="square-section"><header><span>01—04</span><h3>{c["square"]}</h3></header><div class="transition-square">{result_item("carry",c["carry"],"carry")}{result_item("release",c["release"],"release")}{result_item("redesign",c["redesign"],"redesign")}{result_item("discover",c["discover"],"discover")}</div></section>')
 p.append('<section class="continuations">'+result_item('cont_a',c['cont_a'],'continuation')+result_item('cont_b',c['cont_b'],'continuation')+'</section>')
 p += [result_item('assumption_out',c['assumption_out'],'feature gold'),result_item('experiment_out',c['experiment_out'],'feature experiment'),result_item('evidence_out',c['evidence_out']),result_item('rules',c['rules']),result_item('review_out',c['review_out'],'wide closing')]
 p.append(f'</div><footer><span>Cosmos Luminosity</span><span>cosmosluminosity.com</span></footer></article><div class="result-actions"><button class="ix-button primary" type="button" data-print>{c["print"]}</button><button class="ix-button" type="button" data-copy>{c["copy"]}</button><button class="ix-button quiet" type="button" data-restart>{c["restart"]}</button></div><p data-copy-status role="status"></p><aside class="after-result"><h3>{c["after_h"]}</h3><p>{c["after_p"]}</p><div><a class="ix-button primary" href="{gateway}">{c["gateway"]}</a><a class="ix-button" href="{home}">{c["home"]}</a></div></aside></section></section></div>')
 data=json.dumps(c,ensure_ascii=False).replace('</','<\\/')
 p.append('<script>window.IX_COPY='+data+';</script><script src="{{asset "js/transition-investigation.js"}}" defer></script>')
 return '\n'.join(p)+'\n'

for c in L.values(): (THEME/c['file']).write_text(build(c))
# JavaScript and CSS are maintained as separate theme assets; this builder regenerates templates only.
print('templates v3 written')
