:root {
  --bg: #07090d;
  --panel: #0f131a;
  --panel-2: #151a23;
  --line: #222a36;
  --text: #e9eef5;
  --muted: #8592a6;
  --aqua: #2fe1ff;
  --aqua-2: #1a8cff;
  --danger: #ff6b6b;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(47, 225, 255, .12), transparent 60%),
    radial-gradient(700px 400px at -10% 10%, rgba(26, 140, 255, .10), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, sans-serif;
  min-height: 100vh;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }

.top { display: flex; align-items: center; gap: 16px; padding: 20px clamp(16px, 4vw, 48px); }
.brand { display: flex; align-items: center; gap: 10px; font: 700 20px "Space Grotesk", sans-serif; color: var(--text); text-decoration: none; letter-spacing: -.02em; }
.brand .mark { position: relative; width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--aqua), var(--aqua-2)); box-shadow: 0 0 18px rgba(47, 225, 255, .55); }
.brand .mark::after { content: ""; position: absolute; left: 8px; top: 6px; border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent var(--bg); } /* play button */
.brand .tld { color: var(--aqua); }
.tag { color: var(--muted); font-size: 13px; }

main { max-width: 1100px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) 60px; }
.hero { text-align: center; padding: 36px 0 12px; }
h1 { font: 700 clamp(30px, 5vw, 52px)/1.05 "Space Grotesk", sans-serif; letter-spacing: -.035em; margin: 0 auto 14px; max-width: 760px; }
h1 em { font-style: normal; background: linear-gradient(90deg, var(--aqua), var(--aqua-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { color: var(--muted); max-width: 560px; margin: 0 auto 30px; font-size: 16px; }
h2 { font: 700 22px "Space Grotesk", sans-serif; letter-spacing: -.02em; margin: 0; }

.card { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-align: left; }
form.card { max-width: 760px; margin: 0 auto; box-shadow: 0 30px 80px -30px rgba(47, 225, 255, .25); }

.tabs { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 14px; }
.tab { border: 0; background: none; color: var(--muted); padding: 7px 16px; border-radius: 999px; cursor: pointer; font: 600 13px Inter, sans-serif; }
.tab.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }

input[type=url] { width: 100%; padding: 15px 16px; font: 16px Inter, sans-serif; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; outline: none; }
input[type=url]:focus { border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(47, 225, 255, .15); }
.drop-zone { display: flex; align-items: center; justify-content: center; min-height: 92px; padding: 16px; border: 1.5px dashed var(--line); border-radius: 12px; background: var(--bg); color: var(--muted); cursor: pointer; text-align: center; }
.drop-zone.over, .drop-zone:hover { border-color: var(--aqua); color: var(--text); }
.drop-zone input { display: none; }

.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 16px 0; }
.options label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
select { appearance: none; width: 100%; padding: 10px 30px 10px 12px; font: 500 14px Inter, sans-serif; color: var(--text); background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238592a6'/%3E%3C/svg%3E") no-repeat right 12px center; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }

.go { width: 100%; padding: 15px; border: 0; border-radius: 12px; cursor: pointer; font: 700 17px "Space Grotesk", sans-serif; color: #021018; background: linear-gradient(90deg, var(--aqua), var(--aqua-2)); transition: transform .1s, filter .2s; }
.go:hover { filter: brightness(1.08); }
.go:active { transform: scale(.99); }
.go:disabled { filter: grayscale(.7) brightness(.7); cursor: wait; }
.error { color: var(--danger); margin: 12px 0 0; }

.status { max-width: 760px; margin: 22px auto 0; }
.status-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.status-title { font-weight: 600; overflow-wrap: anywhere; }
.status-msg { color: var(--muted); font-size: 14px; margin-top: 2px; }
.pct { font: 700 26px "Space Grotesk", sans-serif; color: var(--aqua); white-space: nowrap; }
.pct .eta { margin-left: 8px; font: 500 14px Inter, sans-serif; color: var(--muted); }
.bar { height: 8px; background: var(--bg); border-radius: 99px; margin: 14px 0; overflow: hidden; }
.bar .fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--aqua-2), var(--aqua)); border-radius: 99px; transition: width .6s ease; }
.status.error .fill { background: var(--danger); }
.status.error .status-msg { color: var(--danger); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; list-style: none; padding: 0; margin: 0; font-size: 12px; color: var(--muted); }
.steps li { padding-top: 8px; border-top: 2px solid var(--line); }
.steps li.active { color: var(--text); border-color: var(--aqua); }
.steps li.done { color: var(--aqua); border-color: var(--aqua-2); }

#results, #recentWrap { margin-top: 40px; }
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.clip { background: var(--panel); 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: cover; }
.clip .meta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.clip .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.score { font: 700 13px "Space Grotesk", sans-serif; padding: 3px 9px; border-radius: 99px; background: rgba(47, 225, 255, .12); color: var(--aqua); }
.time { color: var(--muted); font-size: 12px; }
.clip .title { font-weight: 600; line-height: 1.3; }
.clip .reason { color: var(--muted); font-size: 13px; }
.clip .actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.btn { flex: 1; text-align: center; text-decoration: none; padding: 9px; border-radius: 10px; font: 600 13px Inter, sans-serif; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); }
.btn.primary { background: linear-gradient(90deg, var(--aqua), var(--aqua-2)); color: #021018; border: 0; }

.recent { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.recent a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.recent a:hover { border-color: var(--aqua); }
.recent .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .s { color: var(--muted); font-size: 13px; flex-shrink: 0; }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; }

@media (max-width: 560px) {
  .tag { display: none; }
  .steps { font-size: 11px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
