:root {
  --bg: #0d0b16;
  --bg-2: #141024;
  --surface: #1a1530;
  --surface-2: #231c40;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --text: #f4f1ff;
  --muted: #a79fcf;
  --yellow: #FFD43B;
  --pink: #FF5C8A;
  --ink: #0d0b16;
  --radius: 18px;
  --radius-sm: 12px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--text); line-height: 1.55;
  background: radial-gradient(1200px 700px at 50% -10%, #2a1f4d 0%, var(--bg) 62%) no-repeat, var(--bg);
  min-height: 100vh;
}
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: var(--yellow); }
button, input, select, textarea { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; z-index: 50; background: var(--yellow); color: var(--ink); padding: 8px 12px; border-radius: 8px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); background: rgba(13, 11, 22, .72); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.12rem; letter-spacing: -.01em; }
.nav { display: flex; align-items: center; gap: 18px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .94rem; }
.nav a:hover { color: var(--text); }
.lang-pick select { background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 10px; font-weight: 600; font-size: .9rem; }
@media (max-width: 640px) { .nav a { display: none; } }

/* ---------- hero ---------- */
.hero { padding-top: 44px; padding-bottom: 24px; text-align: center; }
.eyebrow { display: inline-block; margin: 0 0 14px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 212, 59, .1); color: var(--yellow); font-weight: 700; font-size: .82rem; letter-spacing: .02em; }
h1 { font-size: clamp(2rem, 6.4vw, 3.7rem); line-height: 1.06; letter-spacing: -.035em; font-weight: 900; margin: 0 auto 16px; max-width: 16ch; text-wrap: balance; }
h1 mark { background: var(--yellow); color: var(--ink); padding: 0 .18em; border-radius: .18em; display: inline-block; transform: rotate(-3deg); }
.sub { color: var(--muted); font-size: clamp(1rem, 2.4vw, 1.18rem); max-width: 60ch; margin: 0 auto 18px; text-wrap: pretty; }
.badges { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0; margin: 0 0 28px; }
.badges li { font-size: .82rem; font-weight: 600; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text); }
.badges li::before { content: "✓ "; color: var(--yellow); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 20px; font-weight: 800; cursor: pointer; text-decoration: none; transition: transform .12s ease, background .15s ease, opacity .15s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--yellow); color: var(--ink); }
.btn-primary:hover { background: #ffdd5f; }
.btn-primary[disabled] { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 8px 14px; font-size: .9rem; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; padding: 4px; font-size: .9rem; }
.link-btn:hover { color: var(--text); }
.pro-badge { display: inline-block; font-size: .64rem; font-weight: 900; letter-spacing: .06em; padding: 2px 6px; border-radius: 6px; background: var(--pink); color: #fff; text-decoration: none; vertical-align: middle; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* ---------- app shell ---------- */
.app { text-align: left; background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%); border: 1px solid var(--line); border-radius: 24px; padding: 16px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 212, 59, .04) inset; max-width: 1040px; margin: 0 auto; }
.drop, .drop-row, .busy, .editor { display: none; }
.app[data-state="idle"] .drop { display: flex; }
.app[data-state="idle"] .drop-row { display: flex; }
.app[data-state="busy"] .busy { display: flex; }
.app[data-state="editor"] .editor { display: grid; }

.drop { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; min-height: 280px; padding: 28px 16px; border: 2px dashed var(--line-2); border-radius: 18px; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.is-over { border-color: var(--yellow); background: rgba(255, 212, 59, .04); }
.drop-icon { margin-bottom: 6px; transform: rotate(-6deg); }
.drop-title { font-size: 1.3rem; font-weight: 800; margin: 0; }
.drop-sub { color: var(--muted); margin: 0 0 12px; font-size: .92rem; }
.drop-row { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 4px 0; }
.field-inline { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); font-weight: 600; }
.field-inline select, .pro-item select { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 7px 10px; color: var(--text); max-width: 220px; }

.busy { flex-direction: column; align-items: center; text-align: center; gap: 12px; min-height: 280px; justify-content: center; padding: 24px 12px; }
.busy-spark { width: 44px; height: 44px; background: var(--pink); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.busy-text { font-weight: 700; font-size: 1.1rem; margin: 0; }
.busy-note { color: var(--muted); font-size: .88rem; margin: 0; }
.bar { width: 100%; max-width: 420px; height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--yellow), var(--pink)); border-radius: inherit; transition: width .25s ease; }
.bar.indet .bar-fill { width: 35% !important; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

/* ---------- editor ---------- */
.editor { grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
@media (max-width: 860px) { .editor { grid-template-columns: 1fr; } }
.stage { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.frame { position: relative; margin: 0 auto; border-radius: 14px; overflow: hidden; background: #000; width: min(100%, calc(66vh * var(--ar, .5625))); aspect-ratio: var(--ar, .5625); }
@media (max-width: 860px) { .frame { width: min(100%, calc(58vh * var(--ar, .5625))); } }
.frame video, .frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.frame video { object-fit: contain; }
.play-big { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; cursor: pointer; }
.play-big::after { content: ""; position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: rgba(13, 11, 22, .6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5l12 7-12 7z' fill='%23fff'/%3E%3C/svg%3E") center/28px no-repeat; transition: opacity .2s; }
.app.is-playing .play-big::after { opacity: 0; }
.transport { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; }
.icon-btn .i-pause { display: none; }
.app.is-playing .icon-btn .i-pause { display: block; }
.app.is-playing .icon-btn .i-play { display: none; }
.vol { display: flex; align-items: center; gap: 8px; flex: 0 0 150px; }
.vol .i-mute { display: none; }
.vol.is-muted .i-mute { display: block; }
.vol.is-muted .i-vol { display: none; }
#seek { flex: 1; min-width: 0; }
@media (max-width: 520px) { .transport { flex-wrap: wrap; } .vol { flex: 1 1 100%; } }
.retry-box { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px; background: rgba(255, 212, 59, .07); border: 1px solid rgba(255, 212, 59, .25); }
.retry-row { display: flex; gap: 8px; flex-wrap: wrap; }
.retry-row select { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 7px 10px; color: var(--text); flex: 1; min-width: 0; }
.time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .88rem; min-width: 42px; text-align: right; }
input[type=range] { width: 100%; accent-color: var(--yellow); }

.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--surface); padding: 4px; border-radius: 12px; }
.tab { border: 0; background: transparent; padding: 8px; border-radius: 9px; font-weight: 700; cursor: pointer; color: var(--muted); font-size: .92rem; }
.tab.is-on { background: var(--surface-2); color: var(--text); }
.tabpane { display: none; flex-direction: column; gap: 14px; }
.tabpane.is-on { display: flex; }
.style-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.style-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; }
.style-btn.is-on { border-color: var(--yellow); box-shadow: 0 0 0 1px var(--yellow) inset; }
.style-demo { font-weight: 900; font-size: 1.05rem; line-height: 1; padding: 4px 6px; border-radius: 6px; }
.s-pop .style-demo { color: var(--hl, var(--yellow)); -webkit-text-stroke: 1px #000; text-shadow: 0 2px 0 #000; }
.s-box .style-demo { background: var(--hl, var(--yellow)); color: var(--ink); }
.s-karaoke .style-demo { color: #fff; background: linear-gradient(90deg, var(--hl, var(--yellow)) 50%, rgba(255,255,255,.4) 50%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.s-clean .style-demo { color: #fff; font-weight: 700; text-shadow: 0 2px 6px #000; }
.s-neon .style-demo { color: var(--hl, var(--yellow)); text-shadow: 0 0 8px var(--hl, var(--yellow)); }
.style-name { font-size: .72rem; font-weight: 700; color: var(--muted); }
.ctl { display: flex; flex-direction: column; gap: 6px; }
.ctl-label { font-size: .84rem; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.ctl-label small { font-weight: 600; opacity: .8; }
.ctl-label output { color: var(--text); }
.swatches { display: flex; gap: 8px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; box-shadow: 0 0 0 1px var(--line-2); }
.swatch.is-on { border-color: var(--bg-2); box-shadow: 0 0 0 2px var(--c); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; color: var(--muted); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--yellow); width: 16px; height: 16px; flex: none; }
.hint { color: var(--muted); font-size: .85rem; margin: 0; }
.hint.warn { color: var(--yellow); }
.lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow: auto; }
.line { display: grid; grid-template-columns: 52px 1fr; gap: 8px; align-items: start; padding: 8px; border-radius: 10px; background: var(--surface); border: 1px solid transparent; }
.line.is-active { border-color: var(--yellow); }
.line-time { border: 0; background: none; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .8rem; padding: 3px 0; cursor: pointer; text-align: left; }
.line-text { outline: none; font-weight: 600; font-size: .94rem; min-height: 1.4em; word-break: break-word; border-radius: 6px; }
.line-text:focus { background: var(--surface-2); box-shadow: 0 0 0 2px var(--surface-2); }
.pro-list { display: flex; flex-direction: column; gap: 6px; }
.pro-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .9rem; }
.pro-item:hover { border-color: var(--pink); }
.pro-item select { max-width: 150px; }
.toggle { width: 38px; height: 22px; flex: none; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); position: relative; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); }
.actions { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.export-row { display: flex; gap: 8px; }
.export-prog { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.export-prog p { margin: 0; font-weight: 700; font-size: .92rem; }
.export-prog .bar { max-width: none; }
.sub-actions { display: flex; justify-content: space-between; }
.app-error { margin: 12px 4px 0; padding: 10px 12px; border-radius: 10px; background: rgba(255, 92, 138, .12); color: #ffc2d3; font-weight: 600; font-size: .92rem; }

/* ---------- sections ---------- */
section h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); letter-spacing: -.03em; font-weight: 900; margin: 0 0 18px; }
.how, .pro, .faq { padding-top: 64px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.step-n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--yellow); color: var(--ink); font-weight: 900; transform: rotate(-6deg); }
.steps h3 { margin: 14px 0 6px; font-size: 1.12rem; }
.steps p { margin: 0; color: var(--muted); }
.pro-card { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; padding: 28px; border-radius: 24px; background: linear-gradient(135deg, #2a1f4d, #1a1530 60%); border: 1px solid rgba(255, 92, 138, .3); }
@media (max-width: 760px) { .pro-card { grid-template-columns: 1fr; padding: 22px; } }
.pro-card p { color: var(--muted); margin: 0 0 18px; }
.pro-feats { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.pro-feats li { padding-left: 26px; position: relative; font-weight: 600; }
.pro-feats li::before { content: "✦"; position: absolute; left: 0; color: var(--pink); }
.faq-list { display: grid; gap: 8px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 18px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 12px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--yellow); font-weight: 900; }
.faq details[open] summary::after { content: "–"; }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { margin: 0 0 14px; color: var(--muted); }

/* ---------- footer ---------- */
.foot { margin-top: 80px; border-top: 1px solid var(--line); padding: 28px 0 40px; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: flex-start; }
.foot-in p { margin: 6px 0 0; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.foot-nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; }
.foot-nav a:hover { color: var(--text); }

/* ---------- dialogs & toast ---------- */
.dlg { border: 0; padding: 0; border-radius: 22px; background: var(--surface); color: var(--text); width: min(440px, calc(100vw - 32px)); box-shadow: 0 40px 100px rgba(0, 0, 0, .6); }
.dlg::backdrop { background: rgba(5, 4, 10, .7); backdrop-filter: blur(4px); }
.dlg-in { padding: 26px 22px 22px; display: flex; flex-direction: column; gap: 12px; position: relative; }
.dlg h3 { margin: 0; font-size: 1.3rem; letter-spacing: -.02em; padding-right: 24px; }
.dlg p { margin: 0; color: var(--muted); }
.dlg-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.dlg-spark { color: var(--pink); font-size: 1.6rem; line-height: 1; }
.dlg input[type=email], .dlg textarea { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); outline: none; }
.dlg input[type=email]:focus, .dlg textarea:focus { border-color: var(--yellow); }
.dlg textarea { resize: vertical; }
#doorEmailBox { display: flex; flex-direction: column; gap: 12px; }
.form-err { color: #ffc2d3 !important; font-size: .86rem; font-weight: 600; }
.dlg-thanks { color: var(--yellow) !important; font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: var(--text); color: var(--ink); padding: 12px 18px; border-radius: 12px; font-weight: 700; z-index: 60; transition: transform .25s ease; max-width: calc(100vw - 32px); text-align: center; }
.toast.is-on { transform: translate(-50%, 0); }

/* ---------- legal ---------- */
.legal { max-width: 760px; padding-top: 40px; }
.legal h1 { text-align: left; margin: 0 0 6px; max-width: none; font-size: clamp(1.8rem, 5vw, 2.6rem); }
.legal h2 { font-size: 1.2rem; margin: 28px 0 8px; }
.legal p, .legal li { color: #d8d2f5; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
