:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --text: #111827;
  --muted: #5b6472;
  --border: #e3e6eb;
  --brand: #e11d48;
  --brand-dark: #be123c;
  --ok: #047857;
  --err: #b91c1c;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(17, 24, 39, .08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --bg-soft: #171a21; --text: #eceff4; --muted: #a3abb8;
    --border: #2a2f3a; --ok: #34d399; --err: #f87171; --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
}
a { color: var(--brand); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin: .4rem 0 .6rem; }
h2 { font-size: 1.5rem; margin: 0 0 1rem; }
h3 { font-size: 1.05rem; margin: 0 0 .3rem; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }
.small { font-size: .875rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; background: var(--bg); padding: 8px 12px; z-index: 10; }

/* header */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; margin: 0; padding: 6px 0; }
.nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--brand); }

/* hero + form */
.hero { background: linear-gradient(180deg, var(--bg-soft), var(--bg)); padding: 28px 0 36px; text-align: center; }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 680px; margin: 0 auto 1.4rem; }
.crumbs { color: var(--muted); }
.crumbs a { color: var(--muted); }
.dl-form { max-width: 760px; margin: 0 auto; }
.input-row { display: flex; gap: 8px; background: var(--bg); border: 2px solid var(--border); border-radius: var(--radius); padding: 6px; box-shadow: var(--shadow); }
.input-row:focus-within { border-color: var(--brand); }
.input-row input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 1rem; padding: 10px; }
.btn-primary, .btn-ghost, .btn-dl {
  border: 0; border-radius: 9px; font-weight: 600; font-size: 1rem; cursor: pointer; padding: 12px 22px;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary[disabled] { opacity: .7; cursor: progress; }
.btn-ghost { background: var(--bg-soft); color: var(--text); }
@media (max-width: 560px) {
  .input-row { flex-wrap: wrap; }
  .input-row input { flex-basis: 100%; }
  .input-row button { flex: 1; }
}

.status { min-height: 1.6em; margin-top: 14px; }
.status.err { color: var(--err); }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* result card */
.result { max-width: 760px; margin: 18px auto 0; text-align: left; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: grid; grid-template-columns: 200px 1fr; gap: 16px; }
.result[hidden] { display: none; }
.result .thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: var(--bg-soft); }
.result h2 { font-size: 1.05rem; margin: 0 0 .25rem; word-break: break-word; }
.formats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn-dl { background: var(--bg-soft); color: var(--text); border: 1px solid var(--border); padding: 9px 14px; font-size: .92rem; }
.btn-dl:hover { border-color: var(--brand); color: var(--brand); }
.btn-dl .meta { color: var(--muted); font-weight: 400; font-size: .8rem; }
.btn-dl.best { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-dl.best .meta { color: #ffe4e6; }
@media (max-width: 560px) { .result { grid-template-columns: 1fr; } }

/* content */
.block { padding: 36px 16px; }
.steps, .features, .tiles { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: s; }
.steps li, .features li { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.steps li::before { counter-increment: s; content: counter(s); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; margin-bottom: 8px; }
.steps p, .features p { margin: 0; color: var(--muted); }
.features { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.prose p { max-width: 760px; }
.faq details { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: .6rem 0 0; color: var(--muted); }
.tiles { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tiles a { display: block; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); font-weight: 600; }
.tiles a:hover { border-color: var(--brand); color: var(--brand); }
.legal h2 { margin-top: 1.6rem; font-size: 1.2rem; }

/* footer */
.site-footer { border-top: 1px solid var(--border); padding: 26px 0; margin-top: 30px; background: var(--bg-soft); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: .92rem; }
.footer-links a:hover { color: var(--brand); }
