/* wayvl · dark UI, one accent */
:root {
  --bg: #08090d;
  --bg-2: #0d0f16;
  --panel: #11131c;
  --panel-2: #171a25;
  --line: #23273420;
  --border: #232734;
  --border-2: #2d3242;
  --text: #e9ecf3;
  --muted: #8f98ab;
  --muted-2: #6b7386;
  --accent: #7c5cff;
  --accent-2: #9a83ff;
  --accent-ink: #ffffff;
  --ok: #2fd18a;
  --warn: #ffb454;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .55);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(900px 520px at 12% -8%, #1d1740 0%, transparent 62%),
    radial-gradient(760px 480px at 96% 4%, #0a2a3a 0%, transparent 58%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.02em; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 50;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

/* header */
.site-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; max-width: 1240px; margin: 0 auto; padding: 20px 22px 6px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 750; font-size: 21px; letter-spacing: -.03em;
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 21px; color: var(--accent); }
.site-nav { display: flex; gap: 20px; font-size: 14.5px; }
.site-nav a { color: var(--muted); }
.site-nav a:hover { color: var(--text); text-decoration: none; }

/* hero */
.hero { max-width: 880px; margin: 0 auto; padding: 24px 22px 20px; text-align: center; }
.hero h1 { font-size: clamp(28px, 4.2vw, 42px); font-weight: 780; }
.hero .sub { color: var(--muted); font-size: clamp(14.5px, 2vw, 17px); margin: 12px auto 0; max-width: 620px; }
.badges { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0; margin: 14px 0 0; }
.badges li {
  font-size: 12.5px; color: var(--muted); border: 1px solid var(--border);
  background: #ffffff06; padding: 5px 11px; border-radius: 999px;
}

/* app shell */
.app {
  max-width: 1240px; margin: 6px auto 0; padding: 0 22px;
  display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 20px; align-items: start;
}
.stage {
  background: linear-gradient(180deg, var(--panel) 0%, #0f111a 100%);
  border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
  padding: 18px; min-height: 460px; display: flex;
}
.stage-inner { width: 100%; display: flex; flex-direction: column; }

/* dropzone */
.dropzone {
  flex: 1; border: 1.5px dashed var(--border-2); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 22px; gap: 6px; min-height: 424px;
  transition: border-color .15s, background .15s;
}
.dropzone.is-over { border-color: var(--accent); background: #7c5cff12; }
.dz-icon { width: 40px; height: 40px; color: var(--accent); opacity: .9; }
.dz-title { font-size: 19px; font-weight: 650; margin: 10px 0 0; }
.dz-sub { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.dz-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }
.dz-note { color: var(--warn); font-size: 13.5px; margin: 14px 0 0; min-height: 1em; }

/* preview */
.preview { display: flex; flex-direction: column; gap: 14px; }
.canvas-wrap {
  display: flex; align-items: center; justify-content: center;
  background: #05060a; border-radius: var(--radius); border: 1px solid var(--border);
  padding: 12px; min-height: 360px;
}
#previewCanvas {
  max-width: 100%; border-radius: 8px; display: block;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .5);
}

.transport { display: flex; align-items: center; gap: 12px; }
.time { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--muted); min-width: 34px; }

.trim { position: relative; flex: 1; height: 56px; border-radius: 8px; overflow: hidden; background: #0a0c13; border: 1px solid var(--border); }
.trim canvas { width: 100%; height: 100%; display: block; }
.trim-mask { position: absolute; top: 0; bottom: 0; background: #05060ac2; pointer-events: none; }
.trim-mask-l { left: 0; width: 0; }
.trim-mask-r { right: 0; width: 0; }
.trim-handle {
  position: absolute; top: 0; bottom: 0; width: 12px; margin-left: -6px;
  cursor: ew-resize; touch-action: none;
}
.trim-handle::after {
  content: ""; position: absolute; left: 4px; top: 4px; bottom: 4px; width: 4px;
  border-radius: 3px; background: var(--accent); box-shadow: 0 0 0 1px #0008;
}
.trim-handle:focus-visible::after { background: #fff; }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; opacity: .85; left: 0; display: none; pointer-events: none; }
.trim-note { color: var(--muted); font-size: 13px; margin: 0; }
.trim-note strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* panel */
.panel {
  background: linear-gradient(180deg, var(--panel) 0%, #0f111a 100%);
  border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}
.panel-scroll { padding: 6px 18px 4px; max-height: min(58vh, 640px); overflow-y: auto; }
.panel-foot { padding: 16px 18px 18px; border-top: 1px solid var(--border); background: #0d0f17; display: grid; gap: 10px; }

.group { border: 0; border-top: 1px solid var(--border); margin: 0; padding: 16px 0; }
.panel-scroll .group:first-child { border-top: 0; }
.group legend {
  padding: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted-2);
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border-2); color: var(--muted);
  border-radius: 9px; padding: 8px 12px; font: inherit; font-size: 13.5px; font-weight: 550;
  transition: .13s;
}
.chip:hover { color: var(--text); border-color: #3b4256; }
.chip.is-on { background: #7c5cff1f; border-color: var(--accent); color: #fff; }
.ratio { display: block; border: 1.6px solid currentColor; border-radius: 2px; opacity: .85; }
.r-1x1 { width: 12px; height: 12px; }
.r-9x16 { width: 8px; height: 13px; }
.r-16x9 { width: 15px; height: 9px; }
.r-4x5 { width: 10px; height: 12px; }
.hint { color: var(--muted-2); font-size: 12px; margin: 9px 0 0; font-variant-numeric: tabular-nums; }

.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-top: 11px; }
.sw {
  height: 40px; border-radius: 9px; border: 1.5px solid var(--border-2); cursor: pointer;
  padding: 0; position: relative; transition: .13s;
}
.sw:hover { transform: translateY(-1px); }
.sw.is-on { border-color: #fff; box-shadow: 0 0 0 2px #7c5cff77; }

.mini-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.msw { width: 24px; height: 24px; border-radius: 6px; border: 1.5px solid var(--border-2); cursor: pointer; padding: 0; }
.msw.is-on { border-color: #fff; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.block { margin-top: 13px; }
.field > span:first-child { font-size: 12.5px; color: var(--muted); }
input[type="text"] {
  background: #0a0c13; border: 1px solid var(--border-2); color: var(--text);
  border-radius: 9px; padding: 9px 11px; font: inherit; font-size: 14px; width: 100%;
}
input[type="text"]:focus { outline: none; border-color: var(--accent); }
input[type="text"]::placeholder { color: #545c70; }
input[type="color"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 38px;
  background: #0a0c13; border: 1px solid var(--border-2); border-radius: 9px; padding: 4px; cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }

.filebtn { position: relative; display: block; }
.filebtn input[type="file"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.filebtn > span {
  display: block; background: #0a0c13; border: 1px solid var(--border-2); border-radius: 9px;
  padding: 9px 11px; font-size: 13.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.filebtn:hover > span { border-color: #3b4256; color: var(--text); }

.link-btn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 12.5px; padding: 8px 0 0; cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--text); }

.toggle { display: flex; align-items: center; gap: 10px; margin-top: 12px; cursor: pointer; font-size: 14px; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track {
  width: 38px; height: 22px; border-radius: 999px; background: #262b3a; position: relative;
  flex: none; transition: background .15s;
}
.toggle .knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #8f98ab; transition: .15s; }
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track .knob { left: 19px; background: #fff; }
.toggle input:focus-visible + .track { box-shadow: 0 0 0 2px #fff6; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  font: inherit; font-size: 14.5px; font-weight: 600; padding: 10px 18px;
  transition: .14s; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 22px #7c5cff40; }
.btn-primary:hover { background: var(--accent-2); }
.btn-primary:disabled { background: #2b2f3d; color: #6b7386; box-shadow: none; cursor: not-allowed; }
.btn-success { background: var(--ok); color: #04170e; }
.btn-success:hover { background: #48dc9c; }
.btn-ghost { background: #ffffff08; border-color: var(--border-2); color: var(--text); }
.btn-ghost:hover { background: #ffffff12; border-color: #3b4256; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 13px 20px; font-size: 15.5px; width: 100%; }
.btn-round {
  width: 44px; height: 44px; padding: 0; border-radius: 50%; flex: none;
  background: var(--accent); color: #fff; box-shadow: 0 6px 20px #7c5cff44;
}
.btn-round:hover { background: var(--accent-2); }
.btn-round svg { width: 20px; height: 20px; }

.export-status .bar { height: 6px; border-radius: 999px; background: #262b3a; overflow: hidden; }
.export-status .bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .18s; }
.export-status p { margin: 8px 0 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.warn { color: var(--warn); font-size: 13px; margin: 0; }

/* ads */
.ad-wrap { max-width: 1240px; margin: 34px auto 0; padding: 0 22px; text-align: center; }
.ad-label { display: block; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 6px; }
.ad-slot { min-height: 100px; display: block; overflow: hidden; }

/* how + faq */
.how, .faq { max-width: 1000px; margin: 0 auto; padding: 56px 22px 0; }
.how h2, .faq h2 { font-size: clamp(23px, 3.4vw, 30px); font-weight: 730; text-align: center; }
.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li { background: #ffffff06; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.num {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 8px; background: #7c5cff22; color: var(--accent-2); font-weight: 700; font-size: 14px;
}
.steps h3 { font-size: 17px; margin: 12px 0 6px; font-weight: 650; }
.steps p { color: var(--muted); font-size: 14.5px; margin: 0; }

.qa { margin-top: 22px; display: grid; gap: 8px; }
details { background: #ffffff06; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; }
details summary {
  cursor: pointer; font-weight: 600; font-size: 15.5px; list-style: none;
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; color: var(--muted); font-weight: 500; flex: none; }
details[open] summary::after { content: "\2013"; }
details p { color: var(--muted); font-size: 14.5px; margin: 10px 0 0; }

/* prose pages */
.prose { max-width: 760px; margin: 0 auto; padding: 34px 22px 0; }
.prose h1 { font-size: clamp(27px, 4.4vw, 38px); font-weight: 760; }
.prose h2 { font-size: 20px; font-weight: 660; margin: 34px 0 8px; }
.prose p, .prose li { color: #c3c9d6; font-size: 15.5px; }
.prose ul { padding-left: 20px; }
.prose .updated { color: var(--muted-2); font-size: 13.5px; }

/* footer */
.site-foot {
  max-width: 1240px; margin: 64px auto 0; padding: 22px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  color: var(--muted); font-size: 14px;
}
.site-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-foot nav a { color: var(--muted); }
.site-foot nav a:hover { color: var(--text); text-decoration: none; }
.site-foot .made { margin: 0; }

/* 404 */
.notfound { max-width: 620px; margin: 0 auto; padding: 80px 22px; text-align: center; }
.notfound h1 { font-size: 64px; font-weight: 800; color: var(--accent); }
.notfound p { color: var(--muted); margin: 12px 0 24px; }

@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .panel-scroll { max-height: none; }
  .steps { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .site-head { padding: 16px 16px 4px; }
  .site-nav { gap: 14px; font-size: 13.5px; }
  .site-nav a[href="#how"] { display: none; }
  .hero { padding: 24px 16px 20px; }
  .app { padding: 0 14px; gap: 14px; }
  .stage { padding: 12px; min-height: 0; }
  .dropzone { padding: 30px 14px; min-height: 300px; }
  .panel-scroll { padding: 4px 14px; }
  .panel-foot { padding: 14px; }
  .transport { flex-wrap: wrap; }
  .trim { order: 3; flex-basis: 100%; }
  .swatches { grid-template-columns: repeat(5, 1fr); }
  .how, .faq { padding: 44px 16px 0; }
  .site-foot { margin-top: 44px; }
}

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