:root {
  --bg: #f7f6fb; --fg: #16151d; --muted: #5d5a6e; --card: #fff; --line: #e3e0ee; --soft: #efecf8;
  --brand: #5b3df5; --brand-ink: #fff; --accent: #ffe14d; --cut: #c2183f; --ok: #0d7a4f;
  --radius: 14px; --shadow: 0 1px 2px rgba(20, 16, 50, .06), 0 8px 24px rgba(20, 16, 50, .06);
  --head: Montserrat, "Arial Black", system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f0e15; --fg: #f1effa; --muted: #a9a5bd; --card: #18171f; --line: #2c2a38; --soft: #221f2e; --brand: #8c74ff; --brand-ink: #0f0e15; --cut: #ff6b8b; --ok: #52d69a; --shadow: none; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); }
img, video, canvas { max-width: 100%; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 10; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
header.site { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--head); font-weight: 800; font-size: 19px; color: var(--fg); text-decoration: none; letter-spacing: -.01em; }
.brand svg { width: 28px; height: 28px; color: var(--brand); }
nav.top { display: flex; gap: 4px 16px; flex-wrap: wrap; font-size: 15px; }
nav.top a { color: var(--muted); text-decoration: none; padding: 4px 0; }
nav.top a[aria-current="page"], nav.top a:hover { color: var(--fg); }
h1, h2, h3 { font-family: var(--head); font-weight: 800; letter-spacing: -.015em; line-height: 1.15; }
h1 { font-size: clamp(30px, 5.2vw, 52px); margin: 8px 0 12px; }
h2 { font-size: clamp(22px, 3vw, 30px); margin: 40px 0 12px; }
h3 { font-size: 18px; margin: 20px 0 8px; }
.lede { font-size: clamp(17px, 2.1vw, 20px); color: var(--muted); max-width: 40em; }
.hero { display: grid; grid-template-columns: 1.25fr .75fr; gap: 32px; align-items: center; padding: 16px 0 28px; }
.hero .crumbs { margin: 0; }
.proof { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; padding: 0; margin: 18px 0 0; font-size: 15px; color: var(--muted); }
.proof li::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
figure.demo { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
figure.demo video { width: 100%; border-radius: 12px; background: #000; display: block; }
figure.demo .before video { aspect-ratio: 16 / 9; }
figure.demo .after video { aspect-ratio: 9 / 16; }
figure.demo figcaption { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
figure.demo span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--fg); border-radius: 999px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 40px; }
.btn:hover { border-color: var(--brand); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.ghost { background: transparent; }
.btn.big { padding: 12px 22px; font-size: 17px; min-height: 48px; }
.btn.small { padding: 5px 12px; min-height: 32px; font-size: 14px; }
.btn.icon { width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 16px; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }
.muted { color: var(--muted); }
.note { font-size: 14px; color: var(--muted); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ---------- the tool ---------- */
.tool { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 20px; margin: 8px 0 24px; scroll-margin-top: 12px; }
.drop { border: 2px dashed var(--line); border-radius: 16px; padding: 36px 16px; text-align: center; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--brand); background: var(--soft); }
.drop-icon { width: 56px; height: 56px; color: var(--brand); }
.drop-title { font-family: var(--head); font-weight: 800; font-size: 21px; margin: 6px 0 14px; }
.drop-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.drop-sub { color: var(--muted); font-size: 14px; margin: 14px 0 6px; }
.lang { font-size: 14px; color: var(--muted); display: inline-flex; gap: 8px; align-items: center; }
select, input[type="range"] { font: inherit; }
select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--fg); }
.work { display: grid; grid-template-columns: minmax(260px, .9fr) 1.1fr; gap: 22px; align-items: start; }
.stage { position: sticky; top: 12px; }
.frame { position: relative; display: flex; justify-content: center; background: #08070c; border-radius: 14px; padding: 10px; }
#preview { display: block; max-height: 68vh; width: auto; height: auto; max-width: 100%; border-radius: 8px; background: #000; }
#video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: 0; top: 0; }
.transport { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.transport input[type="range"] { flex: 1; accent-color: var(--brand); }
.clock { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--muted); min-width: 96px; text-align: right; }
.stats { font-weight: 600; margin: 8px 0 0; min-height: 1.5em; }
.panel { min-width: 0; }
.status p { margin: 0 0 6px; }
.status p.error { color: var(--cut); font-weight: 600; }
progress { width: 100%; height: 6px; accent-color: var(--brand); }
.tabs { display: flex; gap: 4px; margin: 14px 0 10px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 12px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--brand); }
fieldset { border: 0; padding: 0; margin: 0 0 12px; }
legend { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; padding: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg legend { width: 100%; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg label { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px; cursor: pointer; user-select: none; }
.seg label:has(input:checked) { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; }
.swatches span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, #fff); border: 1px solid rgba(0,0,0,.3); margin-right: 6px; vertical-align: -1px; }
.sw-yellow { --c: #ffe14d; } .sw-green { --c: #5cf2a0; } .sw-cyan { --c: #4dd8ff; } .sw-pink { --c: #ff6fb5; } .sw-none { --c: #fff; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; font-size: 15px; cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--brand); width: 16px; height: 16px; flex: none; }
.range { display: flex; gap: 10px; align-items: center; font-size: 15px; margin: 6px 0 12px; }
.range input { flex: 1; accent-color: var(--brand); }
.transcript-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.transcript-head h3 { margin: 0; }
.word-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0; }
.transcript { border: 1px solid var(--line); border-radius: 12px; padding: 10px; max-height: 42vh; overflow: auto; line-height: 2; font-size: 16px; background: var(--bg); touch-action: pan-y; }
.transcript button { font: inherit; border: 0; background: none; color: var(--fg); padding: 1px 3px; margin: 0 1px; border-radius: 5px; cursor: pointer; }
.transcript .w:hover { background: var(--soft); }
.transcript .w.filler { text-decoration: underline wavy #d6a700; text-underline-offset: 4px; }
.transcript .w.cut { color: var(--cut); text-decoration: line-through; opacity: .75; }
.transcript .w.loose { color: var(--muted); font-style: italic; }
.transcript .w.sel { background: var(--accent); color: #16151d; }
.transcript .chip { font-size: 12px; font-weight: 700; padding: 1px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); vertical-align: 1px; }
.transcript .chip.cut { color: var(--cut); border-color: currentColor; text-decoration: line-through; }
.transcript .chip.kept { color: var(--ok); border-color: currentColor; }
.word-edit { font: inherit; width: 9em; padding: 2px 6px; border: 2px solid var(--brand); border-radius: 6px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; position: sticky; bottom: 0; background: var(--card); padding: 10px 0 2px; }
.tool.busy .pane, .tool.busy .tabs { opacity: .5; pointer-events: none; }
.result h2 { margin-top: 0; }
.result-grid { display: grid; grid-template-columns: minmax(220px, .7fr) 1fr; gap: 22px; align-items: start; }
.result video { width: 100%; max-height: 70vh; background: #000; border-radius: 12px; }
.result-meta { color: var(--muted); }
.files a, .files button { font-weight: 600; }

/* ---------- content ---------- */
.band { padding: 8px 0 24px; }
.cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cards a { display: block; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--fg); }
.cards a:hover { border-color: var(--brand); }
.cards b { display: block; font-family: var(--head); margin-bottom: 4px; }
.cards span { color: var(--muted); font-size: 15px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; list-style: none; padding: 0; counter-reset: s; }
.steps li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; counter-increment: s; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 800; margin-bottom: 6px; }
.prose { max-width: 46em; }
.prose p, .prose li { font-size: 17px; }
.prose code { background: var(--soft); padding: 1px 5px; border-radius: 5px; font-size: .92em; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 12px 0; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.prose blockquote { margin: 12px 0; padding: 4px 16px; border-left: 4px solid var(--brand); color: var(--muted); }
.meta { color: var(--muted); font-size: 14px; }
details { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 8px 0; background: var(--card); }
details summary { font-weight: 700; cursor: pointer; }
.slot { border: 1px solid var(--line); background: var(--soft); border-radius: var(--radius); padding: 12px 16px; margin: 16px 0; }
footer.site { border-top: 1px solid var(--line); margin-top: 40px; padding: 20px 0 40px; color: var(--muted); font-size: 14px; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; }
footer.site a { color: var(--muted); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 18px; }
  figure.demo { max-width: 400px; grid-template-columns: 1fr .62fr; align-items: center; }
  figure.demo .after video { max-height: 44vh; object-fit: cover; }
  .work { grid-template-columns: 1fr; }
  .stage { position: static; }
  #preview { max-height: 56vh; }
  .result-grid { grid-template-columns: 1fr; }
  .tool { padding: 14px; border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
.prose pre { background: var(--soft); padding: 12px 14px; border-radius: 10px; overflow-x: auto; font-size: 14px; line-height: 1.45; }
.prose pre code { background: none; padding: 0; }
