:root {
  --bg: #0c0c0b; --panel: #151513; --panel-2: #1c1c19; --line: #2a2a26; --ink: #efece6; --muted: #a29d93; --dim: #6f6b63;
  --accent: #f1e9db; --on-accent: #12110f; --err: #ff9c8f; --ok: #9fd8ae; --radius: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 Inter, "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.2; margin: 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.top { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px); background: rgba(12, 12, 11, .82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { text-decoration: none; font-weight: 700; letter-spacing: .14em; font-size: 14px; }
.brand span { margin-left: 10px; letter-spacing: 0; font-weight: 500; color: var(--muted); font-size: 13px; }
.top nav { display: flex; gap: 18px; font-size: 14px; color: var(--muted); }
.top nav a { text-decoration: none; }
.top nav a:hover { color: var(--ink); }

main { max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.hero { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(24px, 4vw, 56px); align-items: center; padding: clamp(40px, 7vw, 88px) 0 40px; }
.eyebrow { color: var(--muted); font-size: 13px; letter-spacing: .08em; margin: 0 0 14px; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); }
.lead { color: var(--muted); font-size: 17px; margin: 18px 0 26px; max-width: 32em; }
.hero-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.note { color: var(--muted); font-size: 14px; }
.hero-media { margin: 0; }
.hero-media video { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); background: #000; display: block; border: 1px solid var(--line); }
.hero-media figcaption { color: var(--dim); font-size: 13px; margin-top: 10px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero-dots { display: flex; gap: 2px; }
.hero-dots button { width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.hero-dots button::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background .2s, transform .2s; }
.hero-dots button[aria-current="true"]::before { background: var(--ink); transform: scale(1.25); }
.hero-dots button:hover::before { background: var(--muted); }

.gallery { padding: 8px 0 56px; scroll-margin-top: 80px; }
.gallery-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.gallery-head h2 { font-size: clamp(24px, 3vw, 32px); }
.gallery-head p { color: var(--muted); margin: 10px 0 0; max-width: 42em; font-size: 15.5px; }
.examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.ex { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.ex-media { position: relative; aspect-ratio: 16 / 9; background: #000; cursor: pointer; }
.ex-media video { width: 100%; height: 100%; display: block; object-fit: cover; }
.ex-sound { position: absolute; right: 10px; bottom: 10px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .5);
  background: rgba(0, 0, 0, .55); color: #fff; font: inherit; font-size: 12.5px; cursor: pointer; }
.ex-sound[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.ex-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ex-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ex-title h3 { font-size: 16.5px; }
.ex-kind { color: var(--dim); font-size: 13px; }
.ex-body p { margin: 0; color: var(--muted); font-size: 14.5px; }
.ex-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.gallery-note { color: var(--dim); font-size: 12.5px; margin: 14px 0 0; }

.trial { margin: 0 0 40px; scroll-margin-top: 80px; }
.trial h2 { font-size: 24px; margin-bottom: 6px; }
.trial > .hint { margin: 0 0 18px; max-width: 46em; }
.trial input:disabled { opacity: .75; }
.demo-bar { margin: 0 0 16px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; }
.demo-bar .hint { margin: 0 0 8px; }
.demo-bar.hidden, .trial .hidden { display: none; }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 24px 0 48px; }
.how > div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.how b { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 14px; margin-bottom: 12px; }
.how h3 { font-size: 18px; margin-bottom: 6px; }
.how p { margin: 0; color: var(--muted); font-size: 15px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); }
.studio { scroll-margin-top: 80px; }
.credits { margin-bottom: 20px; }
.credits-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.credits-head .eyebrow { margin-bottom: 8px; }
.studio .credits h2 { margin-bottom: 0; font-size: clamp(20px, 3vw, 24px); }
.credits-intro { color: var(--muted); font-size: 14px; margin: 16px 0 22px; max-width: 42em; }
.credit-balance { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.credit-balance span { color: var(--muted); font-size: 13px; }
.credit-balance strong { font-size: 32px; font-variant-numeric: tabular-nums; line-height: 1; }
.credit-entry { display: flex; align-items: stretch; gap: 10px; }
.credit-entry input { min-width: 0; flex: 1; }
.credit-entry .btn { flex: none; }
.credit-message { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.credit-message:empty { display: none; }
.credit-message.error { color: var(--err); }
.credit-message.success { color: var(--ok); }
.credit-session { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.credit-policy { color: var(--muted); font-size: 13px; line-height: 1.8; margin: 18px 0 0; }
.credit-purchases { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.credit-purchases > p { margin: 0 0 10px; font-size: 14px; }
.credit-packs { display: flex; flex-wrap: wrap; gap: 10px; }
.code-lookup { margin: -6px 0 20px; border-color: var(--muted); }
.credit-purchases .purchase-email { margin-bottom: 16px; color: var(--muted); max-width: 40em; font-size: 13.5px; }
.purchase-email strong { color: var(--ink); font-weight: 500; }
.personal-mode { margin: -4px 0 24px; padding: 14px 16px; border-left: 2px solid var(--accent); background: var(--panel-2); font-size: 14px; }
.personal-mode p { margin: 4px 0 0; color: var(--muted); }
#credit-refresh { margin-top: 10px; }
.studio .card h2, .contact h2 { font-size: 24px; margin-bottom: 20px; }
.field { margin-bottom: 22px; }
label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 8px; }
label.inline, .inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; color: var(--muted); font-size: 14px; margin: 10px 0 0; cursor: pointer; }
.mt { margin-top: 16px; }
.req { color: var(--err); font-style: normal; }
.hint { color: var(--dim); font-size: 13.5px; margin: 8px 0 0; font-weight: 400; }
.inline-hint { margin-left: 6px; }
.err { color: var(--err); font-size: 14px; margin: 8px 0 0; }
.err:empty { display: none; }
input[type=text], input[type=file], textarea { width: 100%; background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 15px; font: inherit; font-size: 16px; }
input[type=file] { padding: 10px; font-size: 14px; }
textarea { resize: vertical; margin-top: 12px; }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#channel_url { font-size: 18px; padding: 16px 18px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 9px 15px; font: inherit; font-size: 14.5px; cursor: pointer; }
.chips button:hover { border-color: var(--muted); }
.chips button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }

details.more { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; margin-bottom: 20px; }
details.more summary { cursor: pointer; font-weight: 600; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: '+'; display: inline-block; width: 18px; color: var(--muted); }
details.more[open] summary::before { content: '−'; }
details.more[open] summary { margin-bottom: 16px; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg label { margin: 0; padding: 10px 16px; font-weight: 500; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--accent); color: var(--on-accent); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -3px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; color: var(--muted); }
.consent input { margin-top: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 20px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--ink); font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; padding: 16px; font-size: 17px; margin-top: 10px; }
.btn:disabled { opacity: .45; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }

.work-progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.work-progress i { height: 7px; background: var(--line); border-radius: 8px; position: relative; overflow: hidden; }
.work-progress i.done { background: var(--accent); }
.work-progress i.now::after { content: ''; position: absolute; inset: 0; border: 1px solid var(--muted); border-radius: inherit; animation: stage-pulse 1.8s ease-in-out infinite alternate; }
.work-meta { display: flex; justify-content: space-between; gap: 12px; margin: 10px 0 20px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.progress { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.progress li { color: var(--muted); font-size: 13px; }
#working, #preview { scroll-margin-top: 80px; }
.progress li.now { color: var(--ink); font-weight: 600; }
.progress li.done { color: var(--ink); }
@keyframes stage-pulse { to { opacity: .3; } }
.version-tag { border-color: var(--muted); color: var(--ink); }
.polish-notice { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.polish-notice p { margin: 0; }
.polish-bar { height: 4px; overflow: hidden; background: var(--line); border-radius: 8px; margin: 12px 0; }
.polish-bar i { display: block; width: 25%; height: 100%; background: var(--muted); animation: polish-sweep 2.4s ease-in-out infinite alternate; }
.polish-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; color: var(--muted); font-size: 12.5px; margin-top: 6px; }
#polish-elapsed { font-variant-numeric: tabular-nums; white-space: nowrap; }
@keyframes polish-sweep { to { transform: translateX(300%); } }

.preview-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.preview-head h2 { margin: 0 !important; }
.tag { font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.stage { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.stage canvas { width: 100%; height: 100%; display: block; }
.play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 76px; height: 76px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .85); background: rgba(0, 0, 0, .45); color: #fff; font-size: 26px; cursor: pointer; }
.play:hover { background: rgba(0, 0, 0, .6); }
.art { color: var(--muted); margin: 14px 0 0; font-size: 15px; }
.status { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; padding: 10px 14px; border-radius: 10px;
  background: var(--panel-2); color: var(--ink); font-size: 14.5px; }
.status.hidden { display: none; }
.status.done .spin { display: none; }
.spin { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.notes { margin: 12px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; color: var(--muted); }
.notes b { color: var(--ink); font-weight: 600; }
.notes p { margin: 6px 0 0; white-space: pre-line; }
.work-detail { color: var(--muted); font-size: 14px; margin: 0 0 4px; min-height: 1.4em; font-variant-numeric: tabular-nums; }
.actions { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.save-progress { margin-top: 12px; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.bar { flex: 1; height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.revise { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.revise h3 { font-size: 17px; margin-bottom: 12px; }
.foot { margin-top: 24px; }

.contact { margin: 48px 0; scroll-margin-top: 80px; }
.contact form { margin-top: 16px; }
.contact textarea { margin-top: 10px; }

footer { max-width: 1120px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px) 48px; color: var(--dim); font-size: 13px; border-top: 1px solid var(--line); }
footer p { margin: 4px 0; }
.brand-links { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.brand-links a { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--muted); font-size: 14px; }
.brand-links a:hover { color: var(--ink); border-color: var(--muted); }
.brand-links img { object-fit: contain; flex: none; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .how { grid-template-columns: 1fr; }
  .top nav { display: none; }
}
@media (max-width: 640px) {
  .credit-packs { flex-direction: column; }
  .credit-packs .btn { width: 100%; }
}
@media (max-width: 520px) {
  .progress { grid-template-columns: repeat(2, 1fr); gap: 8px 16px; }
  .brand-links { flex-direction: column; align-items: flex-start; }
  .credits-head { align-items: flex-start; flex-direction: column; gap: 16px; }
  .credit-entry { flex-direction: column; }
  .credit-packs .btn { flex: 1; padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .work-progress i.now::after, .polish-bar i { animation: none; }
}
