:root {
  --bg: #f7f5f1; --surface: #ffffff; --surface-2: #f0ece5; --text: #1d1b18; --muted: #6b655c; --line: #e3ddd3;
  --accent: #e2553d; --accent-ink: #ffffff; --accent-soft: #fbe3dd; --ok: #2f8a5b; --warn: #b7791f; --err: #c0392b;
  --radius: 16px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 30px rgba(0,0,0,.06);
  --font: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141311; --surface: #1d1b19; --surface-2: #26231f; --text: #f3efe8; --muted: #a39b8f; --line: #34302a;
    --accent: #ff6b52; --accent-soft: #3a211b; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 30px rgba(0,0,0,.35);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img, video { max-width: 100%; display: block; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; text-decoration: none; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.nav { display: flex; gap: 6px; align-items: center; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--text); background: var(--surface-2); }

/* buttons */
.btn { appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); transition: transform .08s, filter .15s; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.small { padding: 8px 14px; font-size: 14px; border-radius: 10px; }

/* hero */
.hero { padding: 72px 0 40px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(36px, 5.4vw, 60px); line-height: 1.04; letter-spacing: -.025em; margin: 0 0 18px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { font-size: 19px; color: var(--muted); margin: 0 0 28px; max-width: 34em; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art { aspect-ratio: 4/3; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); padding: 14px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr auto; gap: 10px; }
.cam { border-radius: 12px; position: relative; overflow: hidden; background: linear-gradient(160deg, #f6b38f, #c9644d); }
.cam:nth-child(2) { background: linear-gradient(160deg, #9fc2d9, #4f6f8f); }
.cam:nth-child(3) { background: linear-gradient(160deg, #c6d8a6, #6d8d51); }
.cam span { position: absolute; left: 8px; top: 8px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(0,0,0,.35); padding: 2px 8px; border-radius: 99px; }
.timeline { grid-column: 1 / -1; display: flex; gap: 4px; height: 34px; }
.timeline i { flex: var(--w, 1); border-radius: 6px; background: var(--c, #c9644d); opacity: .9; }

section { padding: 40px 0; }
.section-title { font-size: 30px; letter-spacing: -.015em; margin: 0 0 8px; }
.section-sub { color: var(--muted); margin: 0 0 28px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card h3 { margin: 10px 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.icon { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.step-n { font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; }

/* forms */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); }
.page-head { padding: 40px 0 20px; }
.page-head h1 { margin: 0 0 6px; font-size: 34px; letter-spacing: -.02em; }
.page-head p { margin: 0; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }
label.lbl { font-weight: 600; font-size: 15px; }
.hint { color: var(--muted); font-size: 14px; }
input[type=text], select { font: inherit; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%; }
input[type=text]:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice .face { display: block; border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; height: 100%; background: var(--bg); transition: border-color .15s, background .15s; }
.choice .face b { display: block; margin-bottom: 2px; }
.choice .face small { color: var(--muted); font-size: 13px; line-height: 1.4; display: block; }
.choice input:checked + .face { border-color: var(--accent); background: var(--accent-soft); }
.choice input:focus-visible + .face { outline: 2px solid var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; padding: 4px; background: var(--bg); flex-wrap: wrap; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 500; }
.seg input:checked + span { background: var(--surface); box-shadow: var(--shadow); color: var(--accent); font-weight: 700; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); }

.drop { border: 2px dashed var(--line); border-radius: 18px; padding: 34px 20px; text-align: center; background: var(--bg); cursor: pointer; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop b { font-size: 18px; }
.files { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; max-height: 360px; overflow: auto; }
.files li { display: grid; grid-template-columns: 26px 1fr auto auto; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.files .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .size { color: var(--muted); font-variant-numeric: tabular-nums; }
.files .x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 6px; }
.bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; grid-column: 2 / -1; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.summary { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin-top: 10px; }
.actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 24px; flex-wrap: wrap; }
.error { color: var(--err); font-weight: 600; }

/* job page */
.job { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; align-items: start; padding-bottom: 60px; }
.player { background: #000; border-radius: 18px; overflow: hidden; aspect-ratio: 16/9; display: grid; place-items: center; color: #fff; }
.player video { width: 100%; height: 100%; }
.waiting { text-align: center; padding: 20px; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(255,255,255,.2); border-top-color: var(--accent); animation: spin 1s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.big-bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 14px 0 6px; }
.big-bar > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .6s ease; }
.steps { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 4px; }
.steps li { display: flex; gap: 12px; align-items: center; padding: 8px 0; color: var(--muted); }
.steps li .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; flex: none; }
.steps li.now { color: var(--text); font-weight: 600; }
.steps li.now .dot { border-color: var(--accent); background: var(--accent-soft); }
.steps li.done { color: var(--text); }
.steps li.done .dot { border-color: var(--ok); background: var(--ok); color: #fff; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.pill.done { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pill.failed { background: color-mix(in srgb, var(--err) 15%, transparent); color: var(--err); }
.pill.running, .pill.queued { background: var(--accent-soft); color: var(--accent); }
details.log { margin-top: 16px; }
details.log summary { cursor: pointer; color: var(--muted); font-size: 14px; }
details.log pre { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 12px; max-height: 260px; overflow: auto; white-space: pre-wrap; }
.report { font-size: 14px; }
.report table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report th, .report td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.report h2 { font-size: 16px; margin: 18px 0 8px; }
.meta { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }

/* list of videos */
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.vcard { text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.vcard .thumb { aspect-ratio: 16/9; background: var(--surface-2) center/cover no-repeat; }
.vcard .body { padding: 12px 14px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.vcard .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--muted); padding: 20px; border: 1px dashed var(--line); border-radius: 14px; text-align: center; }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 14px; margin-top: 40px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .grid3, .choices { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .job { grid-template-columns: 1fr; }
  .nav a.hide-sm { display: none; }
  .panel { padding: 20px; }
}
.nav a.btn { color: var(--accent-ink); }
.nav a.btn:hover { background: var(--accent); filter: brightness(1.06); }
.brand, .nav a { white-space: nowrap; }

/* plans, account, checkout */
.pill.pro { background: var(--accent); color: var(--accent-ink); }
.pill.awaiting_payment { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.vcard .sub { padding: 0 14px 12px; color: var(--muted); font-size: 13px; }
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); position: relative; }
.plan.hl { border: 2px solid var(--accent); }
.plan .tag { position: absolute; top: -12px; left: 18px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.plan h3 { margin: 0; font-size: 20px; }
.plan .price { font-size: 34px; font-weight: 700; letter-spacing: -.02em; }
.plan .price small { font-size: 15px; color: var(--muted); font-weight: 500; }
.plan ul { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 7px; font-size: 14.5px; flex: 1; }
.plan li { display: flex; gap: 8px; }
.plan li::before { content: "✓"; color: var(--ok); font-weight: 700; }
.plan li.no { color: var(--muted); }
.plan li.no::before { content: "–"; color: var(--muted); }
.plan .btn { width: 100%; }
.toggle { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 18px; }
.toggle button { border: 0; background: none; font: inherit; padding: 8px 14px; border-radius: 9px; cursor: pointer; color: var(--muted); }
.toggle button.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.auth { max-width: 420px; margin: 40px auto; }
.auth .field { margin-bottom: 14px; }
.auth input[type=email], .auth input[type=password] { font: inherit; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%; }
.testbanner { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); border-radius: 12px; padding: 10px 14px; font-weight: 600; font-size: 14px; margin-bottom: 16px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 15px; }
.kv b { font-weight: 600; }
.actions-col { display: grid; gap: 10px; margin-top: 16px; }
textarea { font: inherit; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%; min-height: 90px; resize: vertical; }
.box { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--bg); margin-top: 14px; }
.box h4 { margin: 0 0 6px; font-size: 15px; }
@media (max-width: 980px) { .plans { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .plans { grid-template-columns: 1fr; } }
