/* Video Alpha — web. Same visual language as the desktop tool (serve.py). */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --amber: #ff7a3d;
  --hair: rgba(255,255,255,.08);
  --hair2: rgba(255,255,255,.14);
}
html, body { height: 100%; }
body {
  background: #050505; color: rgba(255,255,255,.92);
  font: 15px/1.5 -apple-system, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
body::before, body::after {
  content: ""; position: fixed; border-radius: 50%; pointer-events: none;
  filter: blur(90px); z-index: 0;
}
body::before { width: 560px; height: 560px; right: -140px; top: -180px;
  background: radial-gradient(circle, rgba(255,122,61,.14), transparent 65%); }
body::after { width: 640px; height: 640px; left: -200px; bottom: -260px;
  background: radial-gradient(circle, rgba(124,80,255,.10), transparent 65%); }

.state { position: fixed; inset: 0; z-index: 1; display: none; }
body[data-state="idle"] #sIdle,
body[data-state="editor"] #sEditor,
body[data-state="exporting"] #sEditor { display: flex; }

.shell { background: rgba(255,255,255,.045); border: 1px solid var(--hair);
         border-radius: 28px; padding: 8px; }
.core { background: #0a0a0cee; border-radius: 20px;
        box-shadow: inset 0 1px 1px rgba(255,255,255,.06); }

.btn {
  display: inline-flex; align-items: center; gap: 12px; border: 0;
  font: inherit; font-weight: 600; letter-spacing: -.01em; cursor: pointer;
  border-radius: 999px; padding: 13px 15px 13px 26px;
  background: #f4f4f5; color: #0a0a0a;
  transition: transform .5s var(--ease), opacity .4s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(255,255,255,.08); }
.btn:hover .arr { transform: translate(2px, -1px) scale(1.05); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .35; cursor: default; }
.btn .arr {
  width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.08);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; transition: transform .5s var(--ease);
}
.btn.ghost { background: transparent; color: rgba(255,255,255,.65);
  border: 1px solid var(--hair2); padding: 12px 24px; }
.btn.ghost:hover { color: #fff; border-color: rgba(255,255,255,.3); }
.btn.ghost.sm { padding: 8px 16px; font-size: 13px; font-weight: 500; }
.btn.ghost.on { color: #0a0a0a; background: var(--amber); border-color: transparent; }
.btn.danger { background: transparent; color: #ff6b57;
  border: 1px solid rgba(255,107,87,.35); padding: 12px 24px; }

.eyebrow { display: inline-block; border: 1px solid var(--hair2);
  border-radius: 999px; padding: 5px 14px; font-size: 12px; font-weight: 500;
  color: rgba(255,255,255,.55); }

/* ── idle ─────────────────────────────────────────────────────────── */
#sIdle { align-items: center; justify-content: center; }
.hero { width: min(620px, calc(100vw - 48px)); text-align: center;
  animation: rise .8s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(28px); }
                  to { opacity: 1; transform: none; } }
.hero h1 { font-size: 44px; font-weight: 700; letter-spacing: -.03em; margin: 20px 0 6px; }
.hero h1 em { font-style: normal; color: var(--amber); }
.hero p.sub { color: rgba(255,255,255,.45); margin-bottom: 34px; }
#drop .core { padding: 46px 32px; cursor: pointer;
  border: 1px dashed transparent; transition: all .4s var(--ease); }
#drop:hover .core, #drop.over .core { border-color: rgba(255,122,61,.6); background: #101014ee; }
#drop .dz { width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 50%;
  background: rgba(255,255,255,.06); border: 1px solid var(--hair2);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: rgba(255,255,255,.7); transition: all .4s var(--ease); }
#drop:hover .dz, #drop.over .dz { background: rgba(255,122,61,.15);
  color: var(--amber); transform: translateY(-2px); }
#drop .core .big { font-size: 17px; font-weight: 600; }
#drop .core .hint { color: rgba(255,255,255,.4); font-size: 13px; margin-top: 6px; }
#fname { color: var(--amber); font-size: 13px; margin-top: 10px; display: block; }
.privacy { color: rgba(255,255,255,.38); font-size: 13px; margin-top: 26px; }
.unsupported { color: #ff6b57; font-size: 13px; margin-top: 14px; }

/* ── editor ───────────────────────────────────────────────────────── */
#sEditor { padding: 16px; gap: 16px; }
.stage { position: relative; flex: 1; touch-action: none; border-radius: 24px;
  overflow: hidden; background: #000; border: 1px solid var(--hair);
  display: flex; align-items: center; justify-content: center; }
.stage canvas { max-width: 100%; max-height: 100%; display: block;
  transform-origin: 0 0; will-change: transform; user-select: none; }
.stage.picking { cursor: crosshair; }
.stage.zoomed { cursor: grab; } .stage.dragging { cursor: grabbing; }
.stage[data-bg="checker"] { background:
  repeating-conic-gradient(#2a2a2e 0 25%, #1b1b1f 0 50%) 0 0 / 24px 24px; }
.stage[data-bg="white"] { background: #fff; }

.zoomctl { position: absolute; top: 14px; right: 14px; display: flex;
  align-items: center; gap: 2px; padding: 4px; border-radius: 999px;
  background: rgba(10,10,12,.55); backdrop-filter: blur(18px);
  border: 1px solid var(--hair); z-index: 2; }
.zoomctl button { font: inherit; font-size: 16px; line-height: 1;
  width: 30px; height: 30px; padding: 0; display: flex; align-items: center;
  justify-content: center; border: 0; border-radius: 50%; background: transparent;
  cursor: pointer; color: rgba(255,255,255,.7); transition: all .3s var(--ease); }
.zoomctl button:hover { background: rgba(255,255,255,.1); color: #fff; }
.zoomctl output { font-size: 11px; color: rgba(255,255,255,.55); min-width: 42px;
  text-align: center; cursor: pointer; font-variant-numeric: tabular-nums; }

.scrub { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  width: min(560px, 78%); padding: 6px 18px 6px 8px; border-radius: 999px;
  background: rgba(10,10,12,.55); backdrop-filter: blur(18px);
  border: 1px solid var(--hair); display: flex; align-items: center; gap: 12px; z-index: 2; }
.scrub button { font: inherit; font-size: 13px; width: 32px; height: 32px;
  border: 0; border-radius: 50%; background: rgba(255,255,255,.08); color: #fff;
  cursor: pointer; transition: all .3s var(--ease); }
.scrub button:hover { background: rgba(255,255,255,.16); }
.scrub output { font-size: 11px; color: rgba(255,255,255,.55); min-width: 46px;
  text-align: right; font-variant-numeric: tabular-nums; }

.panel { width: 350px; display: flex; flex-direction: column; }
.panel .core { padding: 26px 24px; height: 100%; overflow-y: auto;
  display: flex; flex-direction: column; }
.panel h2 { font-size: 15px; font-weight: 700; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel .meta { font-size: 12px; color: rgba(255,255,255,.35); margin-top: 3px;
  font-variant-numeric: tabular-nums; }
.panel .sec { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.38);
  margin: 26px 0 6px; }
.tip { font-size: 12px; color: rgba(255,255,255,.4); margin-top: 8px; }
.ctl { margin-top: 12px; }
.ctl label { display: flex; justify-content: space-between; font-size: 13px;
  color: rgba(255,255,255,.7); margin-bottom: 7px; }
.ctl output { color: #fff; font-variant-numeric: tabular-nums; }

input[type=range] { appearance: none; width: 100%; height: 22px;
  background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px;
  background: linear-gradient(to right, var(--amber) var(--f, 50%), rgba(255,255,255,.13) 0); }
input[type=range]::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; margin-top: -6.5px;
  box-shadow: 0 1px 6px rgba(0,0,0,.5); transition: transform .3s var(--ease); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.25); }
input[type=range]::-moz-range-track { height: 3px; border-radius: 2px;
  background: rgba(255,255,255,.13); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border: 0;
  border-radius: 50%; background: #fff; }

.keyrow { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.swatch { width: 38px; height: 38px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--hair2); background: #1de03a; flex: none; }

.seg { display: flex; gap: 6px; margin-top: 10px; }
.seg button { flex: 1; font: inherit; font-size: 12px; padding: 8px 0;
  border-radius: 10px; border: 1px solid var(--hair); background: transparent;
  color: rgba(255,255,255,.55); cursor: pointer; transition: all .4s var(--ease); }
.seg button:hover { border-color: rgba(255,255,255,.25); color: #fff; }
.seg button.on { background: rgba(255,255,255,.1); color: #fff; border-color: var(--hair2); }
.seg .dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%;
  margin-right: 7px; vertical-align: -1px; border: 1px solid rgba(255,255,255,.25); }
.seg .dot.checker { background:
  repeating-conic-gradient(#8a8a8a 0 25%, #3a3a3a 0 50%) 0 0 / 6px 6px; }

.fmt { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.fmt label { display: block; border: 1px solid var(--hair); border-radius: 14px;
  padding: 11px 13px; cursor: pointer; transition: all .4s var(--ease); }
.fmt input { display: none; }
.fmt b { display: block; font-size: 13px; }
.fmt span { font-size: 11px; color: rgba(255,255,255,.4); }
.fmt label:hover { border-color: rgba(255,255,255,.3); }
.fmt label.on { border-color: rgba(255,122,61,.55); background: rgba(255,122,61,.07); }
.fmt label.off { opacity: .35; pointer-events: none; }

.panel .grow { flex: 1; min-height: 18px; }
#exp { width: 100%; justify-content: space-between; margin-top: 22px; height: 54px; }
.files { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.files a { display: flex; justify-content: space-between; align-items: center;
  text-decoration: none; color: #fff; font-size: 13px; font-weight: 600;
  border: 1px solid var(--hair2); border-radius: 12px; padding: 11px 16px;
  transition: all .4s var(--ease); }
.files a:hover { background: rgba(255,255,255,.07); }
.files a i { font-style: normal; opacity: .5; font-weight: 400; font-size: 12px; }
#newBtn { margin-top: 14px; width: 100%; justify-content: center; height: 54px; }

.brand { position: absolute; top: 14px; left: 14px; z-index: 2;
  display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  border-radius: 999px; background: rgba(10,10,12,.55);
  backdrop-filter: blur(18px); border: 1px solid var(--hair); font-size: 12px; }
.brand b { font-weight: 700; letter-spacing: -.01em; }
.brand span { color: rgba(255,255,255,.45); }

.veil { position: absolute; inset: 0; display: none; z-index: 3;
  align-items: center; justify-content: center; flex-direction: column;
  background: rgba(5,5,5,.55); backdrop-filter: blur(14px); }
body[data-state="exporting"] .veil { display: flex; }
body[data-state="exporting"] .panel .core > *:not(.keepAlive) { opacity: .35; pointer-events: none; }
body[data-state="exporting"] #exp { opacity: .35; pointer-events: none; }
.ring { width: 76px; height: 76px; border-radius: 50%;
  background: conic-gradient(var(--amber) var(--p, 8%), rgba(255,255,255,.09) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 0);
          mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 0); }
.ring.spin { animation: whirl 1.1s linear infinite; }
@keyframes whirl { to { transform: rotate(360deg); } }
.pctBig { font-size: 32px; font-weight: 700; letter-spacing: -.03em; margin-top: 18px; }
.etaLine { color: rgba(255,255,255,.45); font-size: 13px; margin-top: 4px; min-height: 20px; }
.veil .btn.danger { margin-top: 24px; }

@media (max-width: 900px) {
  #sEditor { flex-direction: column; }
  .stage { flex: none; height: 48dvh; }
  .panel { width: 100%; flex: 1; min-height: 0; }
  .hero h1 { font-size: 34px; }
}
