:root {
  --bg: #f6f6f9;
  --surface: #ffffff;
  --sunk: #ecedf3;
  --ink: #15161c;
  --muted: #5d6070;
  --line: #dfe1ea;
  --accent: #5b3df5;
  --accent-ink: #ffffff;
  --accent-soft: #e9e4ff;
  --ok: #2c7a4b;
  --warn: #a5560b;
  --shadow: 0 1px 2px rgba(20, 22, 40, .06), 0 8px 28px rgba(20, 22, 40, .10);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1015;
    --surface: #181a22;
    --sunk: #20222c;
    --ink: #eef0f6;
    --muted: #a3a7b8;
    --line: #2c2f3b;
    --accent: #9a86ff;
    --accent-ink: #120c2e;
    --accent-soft: #2a2350;
    --ok: #6cc28f;
    --warn: #f0a85a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--font); }
img, video, svg, canvas { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .4em; }
h1 { font-size: clamp(2.1rem, 5.4vw, 3.6rem); font-weight: 850; letter-spacing: -.035em; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 750; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
header.site { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 850; font-size: 1.1rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; white-space: nowrap; }
.brand svg { width: 30px; height: 30px; color: var(--accent); }
nav.top { display: flex; gap: 18px; flex-wrap: wrap; font-size: .95rem; }
nav.top a { color: var(--muted); text-decoration: none; font-weight: 600; }
nav.top a:hover, nav.top a[aria-current] { color: var(--ink); }

.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding: 28px 0 8px; }
.hero .lede { font-size: 1.2rem; color: var(--muted); max-width: 38em; }
.hero .proof { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 0; list-style: none; font-size: .93rem; color: var(--muted); font-weight: 600; }
.hero .proof li::before { content: "✓ "; color: var(--ok); font-weight: 800; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 18px; }
.demo { margin: 0; justify-self: center; width: min(290px, 100%); }
.demo video { width: 100%; aspect-ratio: 9 / 16; display: block; border-radius: 22px; background: #111; box-shadow: var(--shadow); object-fit: cover; }
.demo figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 8px; }

.tool { margin: 28px 0 8px; scroll-margin-top: 12px; }
.drop { background: var(--surface); border: 2px dashed var(--line); border-radius: 22px; padding: clamp(24px, 5vw, 48px) 20px; text-align: center; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-art { width: 120px; height: 64px; color: var(--accent); margin-bottom: 8px; }
.drop-title { font-size: 1.35rem; font-weight: 800; margin: 0 0 4px; letter-spacing: -.01em; }
.drop-sub { color: var(--muted); margin-bottom: 18px; }
.drop-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.drop-privacy { display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 0; font-size: .92rem; color: var(--muted); font-weight: 600; }
.drop-privacy svg { width: 16px; height: 16px; color: var(--ok); flex: none; }

.btn { --b: var(--line); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--b); background: var(--surface); color: var(--ink); font: 650 1rem/1.2 var(--font); text-decoration: none; cursor: pointer; transition: transform .06s, background .15s, border-color .15s; }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.big { min-height: 52px; padding: 12px 26px; font-size: 1.06rem; }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: .92rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }

.notice { background: var(--accent-soft); border-radius: 12px; padding: 12px 16px; font-weight: 600; }
.status { font-weight: 650; min-height: 1.5em; margin-bottom: 8px; }
.progress { height: 6px; border-radius: 6px; background: var(--sunk); overflow: hidden; margin-bottom: 16px; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.review-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 8px 0 12px; }
.hint { color: var(--muted); margin: 0; font-size: .95rem; }
#count { font-weight: 700; color: var(--ink); }

.grid { list-style: none; margin: 0 0 28px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.card-btn { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--sunk); cursor: pointer; color: inherit; }
.card-btn svg { position: absolute; inset: 0; width: 100%; height: 100%; background: #0d0b09; }
.card-btn::after { content: ""; position: absolute; inset: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); pointer-events: none; }
.card-btn:hover::after { box-shadow: inset 0 0 0 3px var(--accent); }
.card-date { position: absolute; left: 6px; bottom: 6px; right: 6px; font-size: .74rem; font-weight: 750; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.9); text-align: left; }
.card-badge { position: absolute; top: 6px; left: 6px; font-size: .7rem; font-weight: 800; padding: 3px 7px; border-radius: 999px; background: rgba(255,255,255,.92); color: #1d1a16; }
.card.warn .card-badge { background: #ffe1c2; color: #6b3200; }
.card.off svg { opacity: .35; filter: grayscale(1); }
.card-wait { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.6rem; color: var(--muted); }

.settings { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(16px, 3vw, 28px); box-shadow: var(--shadow); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 20px; margin-bottom: 22px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: .93rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.field legend { font-weight: 700; font-size: .93rem; padding: 0; margin-bottom: 6px; }
.field.wide, .check.wide { grid-column: 1 / -1; }
.opt { font-weight: 500; color: var(--muted); margin-left: 4px; }
.field > .lbl { display: block; }
.field input[type=text], .field input[type=date], .field input[type=number], .field select, .field input[type=file] { font: 500 1rem var(--font); color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%; }
.field input[type=range] { width: 100%; accent-color: var(--accent); min-height: 32px; }
.field output, .field small { font-weight: 500; color: var(--muted); font-size: .88rem; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: .95rem; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-height: 44px; padding: 6px 14px; border: 1.5px solid var(--line); border-radius: 10px; font-weight: 700; cursor: pointer; background: var(--bg); line-height: 1.15; }
.seg small { font-weight: 500; font-size: .72rem; color: var(--muted); }
.seg input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.render { text-align: center; background: var(--surface); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); }
.render-preview { height: min(52vh, 420px); width: auto; border-radius: 12px; background: #0d0b09; margin-bottom: 12px; }
.render .progress { max-width: 420px; margin: 8px auto 14px; }
.result { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.result video { display: block; height: min(78vh, 820px); width: auto; max-width: 100%; margin: 0 auto; background: #0d0b09; border-radius: 18px; box-shadow: var(--shadow); }
.result-title { font-size: 1.6rem; font-weight: 850; letter-spacing: -.02em; margin-bottom: 4px; }
.meta { color: var(--muted); font-size: .92rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.fine { color: var(--muted); font-size: .85rem; }

dialog { border: 0; border-radius: 20px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px rgba(0,0,0,.35); width: min(560px, 100% - 24px); max-height: calc(100% - 24px); }
dialog::backdrop { background: rgba(10, 10, 20, .55); }
dialog form { padding: 22px; }
dialog h2 { font-size: 1.3rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.editor { width: min(860px, 100% - 16px); }
.ed-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ed-head h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; font-size: 1.05rem; }
.ed-stage { margin: 12px 0 6px; display: grid; place-items: center; background: #0d0b09; border-radius: 12px; cursor: crosshair; }
.ed-frame { position: relative; display: inline-block; line-height: 0; }
.ed-frame img { max-height: 58vh; width: auto; display: block; }
.ed-faces { position: absolute; inset: 0; }
.face-box { position: absolute; border: 2.5px solid rgba(255,255,255,.85); border-radius: 10px; background: transparent; cursor: pointer; padding: 0; }
.face-box.chosen { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,0,0,.35); }
.face-box:hover { border-color: #fff; background: rgba(255,255,255,.12); }
.dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; pointer-events: none; }
.dot.eye { background: var(--accent); box-shadow: 0 0 0 2px #fff; }
.dot.tap { background: #fff; box-shadow: 0 0 0 2px var(--accent); }
.ed-msg { min-height: 1.4em; font-weight: 650; font-size: .95rem; }
.ed-fields { display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; }
.ed-fields .field { flex: 1 1 200px; }
.ed-fields .field.year { flex: 0 1 150px; }

main section.band { padding: 40px 0; border-top: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; counter-increment: s; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 850; margin-bottom: 8px; }
.prose { max-width: 46em; }
.prose h2 { margin-top: 1.6em; }
.prose li { margin-bottom: .4em; }
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 1.2em; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { font-weight: 750; cursor: pointer; }
.faq details p { margin: 8px 0 0; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; list-style: none; padding: 0; }
.cards a { display: block; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--ink); text-decoration: none; }
.cards a:hover { border-color: var(--accent); }
.cards b { display: block; margin-bottom: 4px; }
.cards span { color: var(--muted); font-size: .93rem; }
.crumbs { font-size: .9rem; color: var(--muted); margin: 10px 0 0; }
.crumbs a { color: var(--muted); }
.paintings { width: 100%; border-collapse: collapse; font-size: .95rem; }
.paintings th, .paintings td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.slot { background: var(--accent-soft); border-radius: var(--radius); padding: 16px 18px; }
footer.site { border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 0 40px; color: var(--muted); font-size: .9rem; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 10px; }
footer.site a { color: var(--muted); }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 20px; padding-top: 12px; }
  .demo { width: min(220px, 62%); }
  .hero-cta .btn { flex: 1 1 auto; }
  .result { grid-template-columns: 1fr; }
  .result video { height: auto; max-height: 70vh; }
  .review-head { flex-direction: column; align-items: flex-start; }
  header.site { flex-wrap: wrap; row-gap: 8px; padding-bottom: 4px; }
  nav.top { gap: 6px 14px; font-size: .9rem; width: 100%; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .btn.big { width: 100%; }
  .drop-actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- studio ---------- */
.studio { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 24px; align-items: start; }
.stage-col { position: sticky; top: 12px; }
.viewport { position: relative; width: 100%; max-height: 78vh; aspect-ratio: 1; margin: 0 auto; border-radius: 18px; overflow: hidden; background: #0d0e12; box-shadow: var(--shadow); }
.viewport canvas { width: 100%; height: 100%; display: block; }
.samples { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.sample { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: 600 .85rem var(--font); cursor: pointer; }
.sample:hover { border-color: var(--accent); }
.sample img { width: 36px; height: 36px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; }
.controls { display: flex; flex-direction: column; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }
.controls .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.style-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 700; font-size: .85rem; background: var(--bg); }
.style-card input { position: absolute; opacity: 0; inset: 0; }
.style-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.style-card:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.swatch { width: 100%; height: 34px; border-radius: 8px; }
.sw-chrome { background: linear-gradient(160deg, #1b1e25 0%, #f5f7fb 38%, #6d7380 52%, #fdfdff 64%, #23262d 100%); }
.sw-gold { background: linear-gradient(160deg, #5a3b0c 0%, #ffe39a 36%, #b47d1f 54%, #fff1c4 66%, #6b4510 100%); }
.sw-marble { background: radial-gradient(120% 90% at 30% 20%, #ffffff 0%, #ece8e1 60%, #d7d0c5 100%), #eee; background-image: linear-gradient(115deg, transparent 40%, rgba(120,110,100,.45) 42%, transparent 46%), linear-gradient(160deg, transparent 62%, rgba(150,140,128,.35) 64%, transparent 67%), radial-gradient(120% 90% at 30% 20%, #ffffff 0%, #ece8e1 60%, #d7d0c5 100%); }
.sw-glass { background: linear-gradient(135deg, #ffd9ec, #9fc0ff); box-shadow: inset 0 0 0 2px rgba(255,255,255,.7), inset 6px 6px 12px rgba(255,255,255,.6); }
.sw-neon { background: #120f24; box-shadow: inset 0 0 0 2px #ff2bd6, inset 0 0 14px #ff2bd6, 0 0 10px rgba(255,43,214,.45); }
.sw-plastic { background: linear-gradient(90deg, #1d2b4f 0 33%, #f2a23c 33% 66%, #e0569a 66%); }
.swatches { display: flex; gap: 10px; }
.neon-swatch { position: relative; }
.neon-swatch input { position: absolute; opacity: 0; inset: 0; }
.neon-swatch span { display: block; width: 34px; height: 34px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); border: 3px solid var(--surface); cursor: pointer; }
.neon-swatch input:checked + span { outline: 3px solid var(--ink); }
.neon-swatch input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.field input[type=color] { width: 100%; height: 44px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); padding: 4px; }
.export { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; border-top: 1px solid var(--line); }
.export-row { display: flex; flex-wrap: wrap; gap: 8px; }
.export-row .btn { flex: 1 1 auto; }
.result { margin-top: 24px; }
.demo-still { margin: 0; justify-self: center; width: min(360px, 100%); }
.demo-still video, .demo-still img { width: 100%; aspect-ratio: 1; display: block; border-radius: 22px; background: #111; box-shadow: var(--shadow); object-fit: cover; }
.demo-still figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 8px; }
@media (max-width: 860px) {
  .studio { grid-template-columns: 1fr; }
  .stage-col { position: static; }
  .viewport { max-height: 62vh; }
}
@media (max-width: 420px) {
  .styles { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .controls .two { grid-template-columns: 1fr; }
}
