:root {
  --bg: #0b0a12;
  --bg-2: #14121f;
  --card: #1a1728;
  --line: #2b2740;
  --text: #f3f1fa;
  --muted: #a39fb8;
  --pink: #ff3d8b;
  --orange: #ff9a3c;
  --cyan: #3de3ff;
  --ok: #3ddc97;
  --err: #ff5a5a;
  --radius: 16px;
  --grad: linear-gradient(100deg, var(--pink), var(--orange));
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #3a1240 0%, transparent 60%),
              radial-gradient(900px 500px at -10% 10%, #12304a 0%, transparent 60%), var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--cyan); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* header */
header.top { border-bottom: 1px solid var(--line); background: rgba(11,10,18,.7); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-family: "Anton", Impact, sans-serif; font-size: 26px; letter-spacing: 1px; text-decoration: none; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
nav a { color: var(--muted); text-decoration: none; margin-left: 20px; font-size: 14px; }
nav a:hover { color: var(--text); }

/* hero */
.hero { text-align: center; padding: 56px 0 24px; }
.hero h1 { font-family: "Anton", Impact, sans-serif; font-weight: 400; font-size: clamp(36px, 7vw, 68px); line-height: 1.05; margin: 0 0 14px; text-transform: uppercase; }
.hero h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 18px; margin: 0 auto; max-width: 620px; }

/* form */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 28px auto; max-width: 760px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.row { display: flex; gap: 10px; }
.row input[type=url] { flex: 1; min-width: 0; background: var(--bg-2); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 16px; font-size: 16px; outline: none; }
.row input[type=url]:focus { border-color: var(--pink); }
.btn { background: var(--grad); border: 0; color: #160814; font-weight: 800; font-size: 16px; padding: 0 26px; border-radius: 12px; cursor: pointer; white-space: nowrap; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 10px 16px; font-size: 14px; text-decoration: none; display: inline-block; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; color: var(--muted); font-size: 14px; }
.check input { margin-top: 4px; accent-color: var(--pink); }
.hint { color: var(--muted); font-size: 13px; margin-top: 10px; }
.msg { margin-top: 14px; padding: 12px 14px; border-radius: 10px; font-size: 14px; display: none; }
.msg.err { display: block; background: rgba(255,90,90,.12); border: 1px solid rgba(255,90,90,.4); color: #ffc2c2; }

/* progress */
.progress { display: none; }
.progress.on { display: block; }
.bar { height: 10px; background: var(--bg-2); border-radius: 99px; overflow: hidden; margin: 14px 0 8px; }
.bar > div { height: 100%; width: 3%; background: var(--grad); transition: width .6s ease; }
.stage { font-weight: 700; }
.sub { color: var(--muted); font-size: 14px; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 40px 0; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.step b { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #160814; margin-bottom: 8px; }
.step h3 { margin: 4px 0 6px; }
.step p { color: var(--muted); margin: 0; font-size: 14px; }

/* clips */
#results h2 { font-family: "Anton", Impact, sans-serif; font-weight: 400; font-size: 32px; letter-spacing: .5px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.clip { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.clip video { width: 100%; aspect-ratio: 9/16; background: #000; display: block; object-fit: contain; }
.clip .body { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.clip h3 { margin: 0; font-size: 16px; }
.clip .desc { color: var(--muted); font-size: 14px; white-space: pre-wrap; margin: 0; }
.clip .meta { font-size: 12px; color: var(--muted); }
.clip .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

/* ads */
.ad { margin: 24px auto; text-align: center; min-height: 0; }
.ad.hidden { display: none; }

/* pages */
.page { max-width: 760px; margin: 40px auto; }
.page h1 { font-family: "Anton", Impact, sans-serif; font-weight: 400; font-size: 40px; }
.page h2 { margin-top: 28px; }
.page p, .page li { color: #d6d2e6; }

footer { border-top: 1px solid var(--line); margin-top: 60px; padding: 28px 0; color: var(--muted); font-size: 13px; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--muted); margin-right: 16px; }

@media (max-width: 700px) {
  .row { flex-direction: column; }
  .btn { padding: 14px; }
  .steps { grid-template-columns: 1fr; }
  nav a { margin-left: 12px; }
  .hero { padding-top: 36px; }
}

/* ===== v2: richer UI ===== */
.center { text-align: center; margin-top: 24px; }
.pill-badge { display: inline-block; font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; margin-bottom: 18px; background: rgba(255,255,255,.03); }
.sec-title { font-family: "Anton", Impact, sans-serif; font-weight: 400; font-size: 32px; letter-spacing: .5px; margin: 48px 0 16px; }

.input-wrap { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; }
.input-wrap input[type=url] { width: 100%; padding-left: 46px; padding-right: 76px; }
.yt-ico { position: absolute; left: 14px; width: 22px; height: 22px; color: #ff4e45; pointer-events: none; }
.paste { position: absolute; right: 8px; background: var(--line); border: 0; color: var(--text); font-size: 13px; padding: 7px 12px; border-radius: 8px; cursor: pointer; }
.paste:hover { background: #3a3555; }

.preview { display: flex; gap: 14px; align-items: center; margin-top: 14px; padding: 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; }
.preview[hidden] { display: none; }
.preview img { width: 120px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: #000; flex: none; }
.pv-title { font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pv-sub { color: var(--muted); font-size: 13px; }

.options { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.options summary { cursor: pointer; padding: 12px 16px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; }
.options summary::after { content: "+"; color: var(--muted); }
.options[open] summary::after { content: "\2212"; }
.options summary::-webkit-details-marker { display: none; }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 4px 16px 18px; }
.opt.wide { grid-column: 1 / -1; }
.opt > label:first-child { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }

.seg { display: inline-flex; flex-wrap: wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { background: transparent; border: 0; color: var(--muted); padding: 8px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; font-weight: 600; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--grad); color: #160814; }
.seg.small button { padding: 6px 10px; font-size: 13px; }

.toggle { position: relative; display: flex; align-items: center; gap: 10px; cursor: pointer; margin: 6px 0; font-size: 14px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }  /* hidden but still keyboard-focusable */
.toggle span { width: 38px; height: 22px; border-radius: 99px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.toggle span::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: left .2s; }
.toggle input:checked + span { background: var(--pink); }
.toggle input:checked + span::after { left: 19px; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { background: var(--bg); border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; min-width: 74px; }
.swatches button.on { border-color: var(--pink); color: var(--text); box-shadow: 0 0 0 1px var(--pink) inset; }
.sw { font-style: normal; font-weight: 800; font-size: 13px; padding: 3px 8px; border-radius: 6px; font-family: Inter, sans-serif; }
.sw-pill { background: #fff; color: #000; border-radius: 99px; }
.sw-classic { background: #fff; color: #000; font-family: Georgia, serif; }
.sw-dark { background: #111; color: #fff; border: 1px solid #444; }
.sw-yellow { background: #ffd400; color: #000; }
.sw-red { background: #e5242b; color: #fff; }
.sw-outline { color: #fff; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; background: #555; }
.sw-outline-y { color: #ffd400; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; background: #555; }
#hook-styles.off { opacity: .4; pointer-events: none; }

.prog-head { display: flex; gap: 14px; align-items: center; }
.prog-head img { width: 96px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; flex: none; }
.prog-head img[hidden] { display: none; }
.tracker { list-style: none; padding: 0; margin: 18px 0 8px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; counter-reset: s; }
.tracker li { font-size: 12px; color: var(--muted); text-align: center; position: relative; padding-top: 30px; counter-increment: s; }
.tracker li::before { content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--card); }
.tracker li.done { color: var(--text); }
.tracker li.done::before { content: "\2713"; background: var(--ok); border-color: var(--ok); color: #062; }
.tracker li.now { color: var(--text); font-weight: 700; }
.tracker li.now::before { border-color: var(--pink); color: var(--pink); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,61,139,.6); } 50% { box-shadow: 0 0 0 6px rgba(255,61,139,0); } }
.prog-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }

.res-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.res-tools { display: flex; gap: 10px; align-items: center; }
.count { font-family: Inter, sans-serif; font-size: 16px; color: var(--muted); }
.clip .vbox { position: relative; background: #000; }
.score { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.75); border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 800; }
.score.hi { color: var(--ok); } .score.mid { color: #ffd166; } .score.lo { color: var(--muted); }
.rank { position: absolute; top: 10px; right: 10px; background: var(--grad); color: #160814; border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 800; }
.clip.horizontal video { aspect-ratio: 16/9; } .clip.square video { aspect-ratio: 1/1; }
.hook { font-size: 13px; color: var(--orange); font-weight: 700; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; color: var(--muted); font-size: 13px; padding: 6px 8px; cursor: pointer; border-bottom: 2px solid transparent; font-weight: 600; }
.tabs button.on { color: var(--text); border-color: var(--pink); }
.linkbtn { background: none; border: 0; color: var(--cyan); cursor: pointer; font-size: 13px; padding: 0; align-self: flex-end; }

.history { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.hist { display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; cursor: pointer; text-align: left; color: var(--text); font: inherit; }
.hist:hover { border-color: var(--pink); }
.hist img { width: 72px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; flex: none; background: #000; }
.hist .t { font-size: 13px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hist .s { font-size: 12px; color: var(--muted); }

#faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 0 16px; }
#faq summary { cursor: pointer; padding: 14px 0; font-weight: 700; }
#faq details p { color: var(--muted); margin: 0 0 14px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(140px); background: #241f38; border: 1px solid var(--line); color: var(--text); padding: 12px 18px; border-radius: 12px; transition: transform .25s; z-index: 50; font-size: 14px; max-width: calc(100% - 32px); }
.toast.on { transform: translateX(-50%) translateY(0); }

@media (max-width: 700px) {
  .opt-grid { grid-template-columns: 1fr; }
  .tracker { grid-template-columns: repeat(3, 1fr); row-gap: 14px; }
  .preview img { width: 96px; }
}

/* ===== accessibility: visible keyboard focus, reduced motion ===== */
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, .seg button:focus-visible {
  outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 6px;
}
.toggle input:focus-visible + span { outline: 3px solid var(--cyan); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ===== guides ===== */
.guide { max-width: 820px; }
.guide .crumbs, .guide .meta { color: var(--muted); font-size: 14px; }
.guide .crumbs a { color: var(--muted); }
.guide article h2 { font-size: 24px; }
.guide ul, .guide ol { padding-left: 22px; }
.guide li { margin: 6px 0; }
.cta { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 32px 0; }
.cta h2 { margin-top: 0; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 24px 0; }
.guide-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; color: var(--text); text-decoration: none; }
.guide-card:hover { border-color: var(--pink); }
.guide-card h2 { font-size: 18px; margin: 0 0 8px; }
.guide-card p { color: var(--muted); font-size: 14px; margin: 0; }
.more ul { list-style: none; padding: 0; }
.more li { margin: 8px 0; }
