:root {
  --bg: #0E0F12; --s1: #15171C; --s2: #1C1F26; --line: #282C35; --line2: #343946;
  --ink: #F2EFE8; --dim: #A3A6AF; --mute: #6E727C;
  --acc: #FFD23F; --acc-ink: #17140A; --coral: #FF6A3D; --ok: #3DDC97;
  --r: 16px; --r-sm: 10px;
  --fd: "Bricolage Grotesque", "Plus Jakarta Sans", system-ui, sans-serif;
  --fb: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--fb); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 14px clamp(16px, 4vw, 40px); background: rgba(14, 15, 18, 0.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.mark svg { width: 30px; height: 30px; display: block; } .mark rect { fill: var(--acc); } .mark path { fill: var(--acc-ink); }
.word { font: 600 19px/1 var(--fd); letter-spacing: -0.01em; } .word b { font-weight: 800; color: var(--acc); }
.beta { font: 600 11px/1 var(--fb); color: var(--dim); border: 1px solid var(--line2); border-radius: 99px; padding: 4px 8px; }
.topnav a { color: var(--dim); text-decoration: none; font-weight: 600; font-size: 14px; } .topnav a:hover { color: var(--ink); }

/* hero */
.studio { max-width: 1240px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 60px; }
.hero { padding: clamp(28px, 6vw, 56px) 0 28px; max-width: 760px; }
.hero h1 { margin: 0; font: 800 clamp(40px, 7vw, 76px)/0.98 var(--fd); letter-spacing: -0.035em; }
.hero h1 em { font-style: normal; color: var(--acc); }
.lede { margin: 18px 0 0; color: var(--dim); font-size: clamp(16px, 1.6vw, 18px); max-width: 620px; }
.lede strong { color: var(--ink); font-weight: 600; }
.flow { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 0; margin: 22px 0 0; color: var(--dim); font-size: 14px; font-weight: 500; }
.flow li { display: flex; align-items: center; gap: 8px; }
.flow span { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--s2); border: 1px solid var(--line2); color: var(--acc); font-weight: 700; font-size: 12px; }

/* layout */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
@media (max-width: 980px) { .grid { grid-template-columns: 1fr; } .preview { order: -1; } }
.step { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(16px, 2.4vw, 22px); margin-bottom: 16px; }
.sh { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sh h2 { margin: 0; font: 700 17px/1.2 var(--fd); letter-spacing: -0.01em; }
.sh .n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--acc); color: var(--acc-ink); font-weight: 800; font-size: 13px; }
.sh .hint { margin-left: auto; color: var(--mute); font-size: 13px; }

/* style picker */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filters button { border: 1px solid var(--line2); background: transparent; border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--dim); cursor: pointer; }
.filters button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { position: relative; text-align: left; border: 2px solid transparent; background: var(--s2); border-radius: 14px; padding: 0; overflow: hidden; cursor: pointer; transition: transform .15s ease, border-color .15s ease; }
.tile:hover { transform: translateY(-2px); }
.tile.on { border-color: var(--acc); }
.tile .art { height: 92px; position: relative; overflow: hidden; }
.tile .art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tile .cap { padding: 9px 11px 11px; }
.tile b { display: block; font: 700 14px/1.2 var(--fd); }
.tile small { display: block; color: var(--dim); font-size: 12px; line-height: 1.35; margin-top: 3px; }
.tile .tag { position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: rgba(0,0,0,.55); color: #fff; border-radius: 6px; padding: 3px 6px; }

/* platforms */
.plats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 560px) { .plats { grid-template-columns: 1fr; } }
.plat { text-align: left; background: var(--s2); border: 2px solid transparent; border-radius: 14px; padding: 14px; cursor: pointer; }
.plat.on { border-color: var(--acc); }
.plat b { display: block; font: 700 16px/1.2 var(--fd); }
.plat small { display: block; color: var(--dim); font-size: 12.5px; margin-top: 4px; }
.plat .st { display: inline-block; margin-top: 8px; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 3px 7px; }
.st.good { background: rgba(61, 220, 151, .14); color: var(--ok); } .st.warn { background: rgba(255, 106, 61, .14); color: var(--coral); }

/* idea */
.ideabox { position: relative; }
textarea, input, select { width: 100%; background: var(--bg); border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 12px 14px; }
#idea { font: 600 clamp(17px, 2vw, 20px)/1.35 var(--fd); padding: 16px 16px 56px; resize: none; }
.ideatools { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chips button { border: 1px solid var(--line2); background: var(--s2); border-radius: 99px; padding: 7px 12px; font-size: 13px; cursor: pointer; }
.chips button:hover { border-color: var(--acc); }
.opts { display: grid; grid-template-columns: auto 1fr 1fr; gap: 12px; margin: 16px 0; }
@media (max-width: 700px) { .opts { grid-template-columns: 1fr; } }
.opt label { display: block; color: var(--dim); font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 3px; }
.seg button { border: 0; background: transparent; padding: 8px 12px; border-radius: 7px; font-weight: 700; font-size: 13px; color: var(--dim); cursor: pointer; }
.seg button.on { background: var(--s2); color: var(--ink); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line2); background: var(--s2); border-radius: var(--r-sm); padding: 10px 16px; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; } .btn svg circle { fill: currentColor; stroke: none; }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn.primary { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.btn.big { width: 100%; padding: 16px; font: 800 17px/1 var(--fd); border-radius: 14px; }
.btn:disabled { opacity: .5; cursor: progress; }
.spin { display: none; width: 18px; height: 18px; border: 3px solid rgba(23,20,10,.25); border-top-color: var(--acc-ink); border-radius: 50%; animation: rot .8s linear infinite; }
.busy .spin { display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }
.note { min-height: 22px; margin: 10px 0 0; color: var(--dim); font-size: 13.5px; }
.note.err { color: var(--coral); } .note.ok { color: var(--ok); }

/* results */
.result { scroll-margin-top: 80px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 6px; margin-bottom: 16px; animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.rtabs { display: flex; gap: 4px; padding: 4px; }
.rtabs button { flex: 1; border: 0; background: transparent; border-radius: 10px; padding: 11px 8px; font-weight: 700; color: var(--dim); cursor: pointer; }
.rtabs button.on { background: var(--s2); color: var(--ink); }
.rpane { padding: 14px; }
.rhead { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.titlein { font: 700 19px/1.2 var(--fd); flex: 1; min-width: 200px; }
.meta { color: var(--mute); font-size: 13px; }
.scenes { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.scene { display: grid; grid-template-columns: 40px 1fr; gap: 12px; background: var(--s2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.scene .no { width: 40px; height: 40px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; font: 800 16px var(--fd); color: var(--acc); }
.scene .dur { display: block; text-align: center; font-size: 11px; color: var(--mute); margin-top: 4px; }
.scene textarea { background: transparent; border: 0; padding: 0; resize: vertical; }
.scene .nar { font-weight: 600; min-height: 46px; }
.scene .vis { color: var(--dim); font-size: 13.5px; margin-top: 6px; border-top: 1px dashed var(--line2) !important; padding-top: 8px !important; min-height: 60px; }
.howto { margin: 0 0 14px; padding-left: 20px; color: var(--dim); font-size: 14px; }
.howto b { color: var(--ink); }
.kv { display: flex; gap: 10px; align-items: baseline; margin-bottom: 12px; } .kv span { color: var(--dim); font-size: 13px; } .kv b { font: 800 20px var(--fd); color: var(--acc); }
.block { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.bh { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 8px 14px; background: var(--s2); font-size: 13px; color: var(--dim); font-weight: 600; }
pre { margin: 0; padding: 14px; white-space: pre-wrap; word-break: break-word; font: 13px/1.6 ui-monospace, "SF Mono", Menlo, monospace; color: #DCDAD4; max-height: 260px; overflow: auto; background: var(--bg); }
pre.long { max-height: 380px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

/* preview phone */
.preview { position: sticky; top: 84px; }
.phone { width: min(300px, 78vw); margin: 0 auto; aspect-ratio: 9 / 16; border-radius: 34px; padding: 10px; background: #050506; border: 1px solid var(--line2); box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.screen { position: relative; width: 100%; height: 100%; border-radius: 26px; overflow: hidden; }
.pvbg { position: absolute; inset: 0; transition: background .5s ease; }
.pvmotif { position: absolute; left: 0; right: 0; top: 36%; bottom: 24%; } .pvmotif svg { width: 100%; height: 100%; }
.pvtitle { position: absolute; left: 0; right: 0; top: 13%; text-align: center; padding: 0 16px; font: 800 26px/1.02 var(--fd); letter-spacing: -0.02em; text-transform: uppercase; color: #fff; -webkit-text-stroke: 6px #17140A; paint-order: stroke; }
.pvtitle span { display: block; animation: pop .5s cubic-bezier(.34,1.56,.64,1) both; }
.pvtitle span:last-child { color: var(--acc); }
.pvtitle.short span:last-child { font-size: 1.22em; }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }
.pvcap { position: absolute; left: 10px; right: 10px; bottom: 16%; text-align: center; font: 800 17px/1.25 "Arial Black", var(--fd); color: #fff; -webkit-text-stroke: 5px #17140A; paint-order: stroke; }
.pvcap b { background: var(--acc); color: var(--acc-ink); -webkit-text-stroke: 0; padding: 1px 6px; border-radius: 6px; }
.pvbar { position: absolute; left: 14px; right: 14px; top: 12px; height: 3px; background: rgba(255,255,255,.25); border-radius: 3px; overflow: hidden; }
.pvbar i { display: block; height: 100%; width: 0; background: var(--acc); }
.pvinfo { display: flex; justify-content: space-between; gap: 10px; width: min(300px, 78vw); margin: 14px auto 0; font-size: 13px; color: var(--dim); } .pvinfo b { color: var(--ink); }
.pvscenes { list-style: none; padding: 0; margin: 12px auto 0; width: min(300px, 78vw); display: flex; gap: 4px; }
.pvscenes li { flex: 1; height: 6px; border-radius: 3px; background: var(--line2); }
.pvscenes li.on { background: var(--acc); }
@media (max-width: 980px) { .preview { position: static; } .phone { width: min(200px, 54vw); } }

/* motifs (shared by tiles + preview) */
.m-float { animation: mfloat 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.m-spin { animation: rot 8s linear infinite; transform-box: fill-box; transform-origin: center; }
.m-pulse { animation: mpulse 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.m-lift { animation: mlift 2.6s ease-in-out infinite; }
.m-draw { stroke-dasharray: 300; animation: mdraw 3s ease-in-out infinite; }
.m-rise { animation: mrise 3s linear infinite; }
.m-wave { animation: mwave 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.m-slide { animation: mslide 3s ease-in-out infinite; }
@keyframes mfloat { 50% { transform: translateY(-6%); } }
@keyframes mpulse { 50% { transform: scale(1.12); } }
@keyframes mlift { 0%, 20% { transform: translateY(0); } 50%, 70% { transform: translateY(-14px); } 100% { transform: translateY(0); } }
@keyframes mdraw { 0% { stroke-dashoffset: 300; } 60%, 100% { stroke-dashoffset: 0; } }
@keyframes mrise { from { transform: translateY(30px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(-60px); opacity: 0; } }
@keyframes mwave { 50% { transform: rotate(-14deg); } }
@keyframes mslide { 0% { transform: translateX(-8px) rotate(-3deg); } 50% { transform: translateX(8px) rotate(2deg); } 100% { transform: translateX(-8px) rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); font-weight: 700; padding: 11px 18px; border-radius: 12px; opacity: 0; transition: .25s ease; pointer-events: none; z-index: 50; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.foot { text-align: center; color: var(--mute); font-size: 13px; padding: 24px 16px 40px; }

.row.sub { margin-top: 10px; }
.paste { width: min(420px, calc(100vw - 32px)); background: var(--s1); color: var(--ink); border: 1px solid var(--line2); border-radius: 18px; padding: 22px; }
.paste::backdrop { background: rgba(5, 5, 6, .7); backdrop-filter: blur(3px); }
.paste .ok { margin: 0; color: var(--ok); font-weight: 700; font-size: 13px; }
.paste h3 { margin: 6px 0 14px; font: 800 22px/1.15 var(--fd); letter-spacing: -0.01em; }
.paste ol { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 8px; }
.paste .dim { color: var(--dim); font-size: 13.5px; margin: 0 0 16px; }
kbd { display: inline-block; font: 700 13px/1 var(--fb); background: var(--bg); border: 1px solid var(--line2); border-bottom-width: 3px; border-radius: 7px; padding: 5px 8px; }
