:root {
  --bg: #fffaf5;
  --bg-soft: #fff1e6;
  --fg: #221c18;
  --muted: #6d635c;
  --card: #ffffff;
  --border: #f0e3d8;
  --accent: #ff6f4f;
  --accent-ink: #ffffff;
  --accent-soft: #ffe3d9;
  --violet: #7a5cff;
  --ok: #1d8a4e;
  --ok-soft: #e3f6ea;
  --err: #c93c3c;
  --err-soft: #fde8e8;
  --shadow: 0 10px 30px rgba(80, 40, 20, 0.08);
  --radius: 18px;
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15110f;
    --bg-soft: #1f1915;
    --fg: #f6efe9;
    --muted: #a99e95;
    --card: #1e1916;
    --border: #322a24;
    --accent: #ff8466;
    --accent-ink: #1a0f0b;
    --accent-soft: #3a2219;
    --ok: #5fd08f;
    --ok-soft: #173325;
    --err: #ff8a8a;
    --err-soft: #3b1d1d;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
img, video { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 5vw, 48px); }
h2 { font-size: clamp(22px, 3vw, 30px); }
h3 { font-size: 18px; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.section { padding: 48px 16px; }
.page { padding-top: 32px; padding-bottom: 56px; }
.narrow { max-width: 640px; }
.muted { color: var(--muted); }
.muted-h { color: var(--muted); font-weight: 500; }
.lead { font-size: 18px; color: var(--muted); max-width: 640px; }
.fine { font-size: 14px; color: var(--muted); margin: 10px 0 0; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; color: var(--fg); text-decoration: none; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; }
.logo-sub { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.nav { display: flex; gap: 18px; margin-left: 12px; }
.nav a { color: var(--fg); text-decoration: none; font-weight: 600; font-size: 15px; }
.nav a:hover { color: var(--accent); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.header-actions form { margin: 0; }
.credits-pill {
  background: var(--accent-soft); color: var(--fg); text-decoration: none;
  padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; white-space: nowrap;
}
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; padding: 6px; }
.lang-link { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; padding: 6px; white-space: nowrap; }
.lang-link:hover { color: var(--fg); }
.legal .notice { background: var(--bg-soft); color: var(--muted); font-size: 14px; }
.link-btn:hover { color: var(--fg); }
@media (max-width: 640px) {
  .nav { display: none; }
  .header-row { gap: 8px; }
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--card); color: var(--fg); font: inherit; font-weight: 700; font-size: 15px;
  text-decoration: none; cursor: pointer; transition: transform 0.08s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-small { padding: 8px 14px; font-size: 14px; }
.btn-block { width: 100%; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }

/* hero */
.hero { background: radial-gradient(1200px 500px at 85% -10%, var(--accent-soft), transparent 60%), var(--bg); padding: 56px 0 24px; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.hero-collage { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 420px; justify-self: end; width: 100%; }
.collage-tile {
  aspect-ratio: 4 / 5; border-radius: 22px; display: grid; place-items: center; font-size: 56px;
  box-shadow: var(--shadow); animation: floaty 6s ease-in-out infinite;
}
.collage-tile:nth-child(2) { animation-delay: -1.5s; }
.collage-tile:nth-child(3) { animation-delay: -3s; }
.collage-tile:nth-child(4) { animation-delay: -4.5s; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .collage-tile { animation: none; } html { scroll-behavior: auto; } }
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-collage { grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: none; justify-self: stretch; }
  .collage-tile { font-size: 32px; border-radius: 14px; }
}

/* template cards */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; margin-top: 20px; }
.tcard {
  display: flex; flex-direction: column; text-decoration: none; color: var(--fg);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform 0.15s ease;
}
.tcard:hover { transform: translateY(-3px); }
.tcard-media { position: relative; aspect-ratio: 4 / 5; display: grid; place-items: center; overflow: hidden; }
.tcard-media video { width: 100%; height: 100%; object-fit: cover; }
.tcard-emoji { font-size: 72px; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.18)); }
.tcard-badge {
  position: absolute; top: 10px; right: 10px; background: rgba(0, 0, 0, 0.55); color: #fff;
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.tcard-body { padding: 14px 16px 16px; }
.tcard-body h3 { margin-bottom: 4px; }
.tcard-body p { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.tcard-cta { font-weight: 700; color: var(--accent); font-size: 14px; }

/* steps & features */
.steps { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.steps li { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.steps p { color: var(--muted); margin: 0; }
.step-n {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; margin-bottom: 10px;
}
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { background: var(--bg-soft); border-radius: var(--radius); padding: 22px; }
.feature p { color: var(--muted); margin: 0; }
@media (max-width: 760px) { .steps, .features { grid-template-columns: 1fr; } }

/* faq */
.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--accent); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { color: var(--muted); margin: 10px 0 0; }

/* template page */
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.tpl-grid { display: grid; grid-template-columns: 1fr 420px; gap: 32px; align-items: start; }
.tpl-preview {
  margin-top: 8px; border-radius: var(--radius); aspect-ratio: 16 / 10; display: grid; place-items: center;
  overflow: hidden; box-shadow: var(--shadow);
}
.tpl-preview video { width: 100%; height: 100%; object-fit: cover; }
.tpl-emoji { font-size: 120px; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2)); }
@media (max-width: 900px) { .tpl-grid { grid-template-columns: 1fr; } }

.generator { padding: 22px; position: sticky; top: 84px; }
.generator h2 { font-size: 22px; }
.dropzone { border: 2px dashed var(--border); border-radius: 14px; transition: border-color 0.15s, background 0.15s; }
.dropzone.dragover, .dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.full { display: none; }
.dropzone-label { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 12px; cursor: pointer; text-align: center; }
.dropzone-label .muted { font-size: 13px; }
.dz-icon { font-size: 30px; }
.thumbs { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.thumbs:empty { display: none; }
.thumbs li { position: relative; width: 74px; height: 74px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .thumb-n {
  position: absolute; left: 4px; top: 4px; background: rgba(0, 0, 0, 0.6); color: #fff;
  font-size: 11px; font-weight: 700; border-radius: 6px; padding: 0 5px;
}
.thumbs button {
  position: absolute; right: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, 0.65); color: #fff; cursor: pointer; font-size: 14px; line-height: 22px; padding: 0;
}
.ratio { border: 0; padding: 0; margin: 16px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.ratio legend { font-weight: 700; font-size: 14px; margin-bottom: 6px; padding: 0; }
.ratio-opt { flex: 1; min-width: 120px; }
.ratio-opt input { position: absolute; opacity: 0; }
.ratio-opt span {
  display: block; text-align: center; padding: 9px 10px; border: 1.5px solid var(--border); border-radius: 12px;
  font-weight: 600; font-size: 14px; cursor: pointer;
}
.ratio-opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.ratio-opt input:focus-visible + span { outline: 3px solid var(--violet); outline-offset: 2px; }

.status { margin-top: 14px; font-size: 15px; }
.status:empty { display: none; }
.status.info { color: var(--fg); }
.status.error { color: var(--err); background: var(--err-soft); padding: 10px 12px; border-radius: 10px; }
.status.success { color: var(--ok); background: var(--ok-soft); padding: 10px 12px; border-radius: 10px; }
.result { margin-top: 14px; }
.result video { width: 100%; max-height: 70vh; border-radius: 14px; background: #000; }
.result .btn { margin-top: 10px; }
.spinner {
  display: inline-block; width: 18px; height: 18px; border-radius: 50%; vertical-align: -3px; margin-right: 8px;
  border: 2.5px solid var(--border); border-top-color: var(--accent); animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* pricing */
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 28px 0; }
.pack { padding: 24px; position: relative; display: flex; flex-direction: column; }
.pack h2 { font-size: 20px; margin-bottom: 4px; }
.pack-hl { border: 2px solid var(--accent); }
.pack-tag {
  position: absolute; top: -12px; left: 24px; background: var(--accent); color: var(--accent-ink);
  font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px;
}
.pack-price { font-size: 38px; font-weight: 800; margin: 6px 0 0; }
.pack-credits { font-weight: 700; margin: 0; }
.checks { list-style: none; padding: 0; margin: 12px 0 20px; flex: 1; }
.checks li { padding-left: 24px; position: relative; margin: 6px 0; font-size: 15px; }
.checks li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.pricing-notes { color: var(--muted); font-size: 15px; padding-left: 20px; margin-bottom: 32px; }
@media (max-width: 820px) { .packs { grid-template-columns: 1fr; } }

/* account */
.balance { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; margin: 16px 0 24px; flex-wrap: wrap; }
.big { font-size: 34px; font-weight: 800; }
.notice { padding: 12px 14px; border-radius: 12px; }
.notice.success { background: var(--ok-soft); color: var(--ok); }
.empty { padding: 32px; text-align: center; }
.jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.job { overflow: hidden; display: flex; flex-direction: column; }
.job-media { aspect-ratio: 16 / 9; background: var(--bg-soft); display: grid; place-items: center; }
.job-media.tall { aspect-ratio: 9 / 16; max-height: 460px; }
.job-media video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.job-wait { display: flex; align-items: center; color: var(--muted); font-weight: 600; }
.job-body { padding: 14px 16px 16px; }
.job-body h3 { margin-bottom: 2px; }
.job-body p { font-size: 14px; margin-bottom: 8px; }
.error-text { color: var(--err); }

/* legal */
.legal { max-width: 780px; }
.legal h2 { font-size: 21px; margin-top: 28px; }
.legal li { margin: 6px 0; }

/* footer */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 24px; margin-top: 24px; background: var(--bg-soft); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
.footer-col { display: flex; flex-direction: column; gap: 6px; }
.footer-col h4 { margin: 0 0 4px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.footer-col a { color: var(--fg); text-decoration: none; font-size: 15px; }
.footer-col a:hover { color: var(--accent); }
.footer-note { margin-top: 24px; font-size: 13px; color: var(--muted); }
.footer-note p { margin: 6px 0; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
