/* ============================================================
   clipzers studio — dark editing-suite theme
   ============================================================ */

:root {
  --bg: #131214;
  --panel: #1c1b1e;
  --panel-2: #232225;
  --line: #39373c;
  --text: #f0ede4;
  --text-dim: #9b97a0;
  --accent: #ff4d1c;
  --lime: #d8f34f;
  --sky: #b7dcff;
  --radius: 14px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--lime); color: #131214; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* top bar */
.studio-nav {
  border-bottom: 1px solid var(--line);
  background: rgba(19, 18, 20, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.studio-nav-inner { display: flex; align-items: center; height: 62px; gap: 18px; }
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 23px;
  letter-spacing: -0.04em;
  color: var(--text);
  text-decoration: none;
}
.brand .tick { color: var(--accent); }
.studio-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bg);
  background: var(--lime);
  border-radius: 5px;
  padding: 2px 8px;
}
.studio-nav .right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.usage-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.usage-pill .meter {
  width: 70px; height: 6px;
  background: var(--panel-2);
  border-radius: 3px;
  overflow: hidden;
}
.usage-pill .meter i { display: block; height: 100%; background: var(--lime); border-radius: 3px; transition: width 0.4s ease; }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}
.nav-link { color: var(--text-dim); text-decoration: none; font-size: 14px; }
.nav-link:hover { color: var(--text); }

/* control deck */
.deck { padding: 46px 0 10px; }
.deck h1 { font-size: clamp(26px, 3.2vw, 36px); margin-bottom: 6px; }
.deck .sub { color: var(--text-dim); font-size: 15px; margin-bottom: 28px; }
.deck .sub .demo-flag { color: var(--lime); }

.console {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.url-row { display: flex; gap: 12px; }
.url-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.url-input::placeholder { color: #5d5a62; font-family: var(--font-body); }
.url-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 77, 28, 0.22); }

.go-btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0 28px;
  transition: transform 0.12s ease, background 0.15s ease;
  white-space: nowrap;
}
.go-btn:hover { background: #e8430f; transform: translateY(-1px); }
.go-btn:active { transform: translateY(1px); }
.go-btn:disabled { opacity: 0.55; cursor: wait; transform: none; }

.options-row { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 20px; align-items: center; }
.opt-group { display: flex; align-items: center; gap: 12px; }
.opt-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.chips { display: flex; gap: 8px; }
.chip {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  transition: all 0.15s ease;
}
.chip:hover { color: var(--text); border-color: var(--text-dim); }
.chip.active { background: var(--lime); color: #131214; border-color: var(--lime); }

.custom-len { display: none; align-items: center; gap: 12px; }
.custom-len.show { display: flex; }
.custom-len input[type="range"] { width: 140px; accent-color: var(--accent); }
.custom-len .val { font-family: var(--font-mono); font-size: 13px; color: var(--lime); min-width: 38px; }

/* loading */
.loading { display: none; padding: 60px 0; text-align: center; }
.loading.show { display: block; }
.loading .reel {
  width: 58px; height: 58px;
  margin: 0 auto 22px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading .msg { font-family: var(--font-mono); font-size: 14px; color: var(--text-dim); min-height: 22px; }

/* error */
.error-box {
  display: none;
  margin-top: 22px;
  border: 1px solid #ff6b5e;
  background: rgba(255, 107, 94, 0.09);
  color: #ffb4ac;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 14px;
}
.error-box.show { display: block; }

/* results */
.results { padding: 36px 0 80px; display: none; }
.results.show { display: block; }
.results-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.results-head h2 { font-size: 22px; }
.results-head .vid-title { color: var(--text-dim); font-size: 14px; }
.mode-note {
  display: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #131214;
  background: var(--lime);
  border-radius: 6px;
  padding: 6px 12px;
  margin: 10px 0 6px;
}
.mode-note.show { display: inline-block; }

.clip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 22px;
  margin-top: 22px;
}
.clip-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(18px);
  animation: cardIn 0.5s ease forwards;
}
@keyframes cardIn { to { opacity: 1; transform: none; } }
.clip-card .player { aspect-ratio: 16 / 9; background: #000; }
.clip-card .player iframe { width: 100%; height: 100%; border: 0; display: block; }
.clip-body { padding: 18px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.clip-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.clip-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.25; }
.score-ring {
  --p: 70;
  flex: none;
  width: 46px; height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--lime) calc(var(--p) * 1%), var(--panel-2) 0);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--lime);
  position: relative;
}
.score-ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--panel); }
.score-ring span { position: relative; }
.clip-range {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  gap: 10px;
  align-items: center;
}
.clip-range .dur { color: var(--sky); }
.clip-hook { font-size: 14px; color: var(--text); background: var(--panel-2); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 9px 12px; }
.clip-caption { font-size: 13px; color: var(--text-dim); }
.clip-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.clip-tags span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--sky);
  background: rgba(183, 220, 255, 0.08);
  border: 1px solid rgba(183, 220, 255, 0.22);
  border-radius: 999px;
  padding: 3px 10px;
}
.clip-actions { display: flex; gap: 10px; margin-top: auto; padding-top: 6px; }
.mini-btn {
  flex: 1;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 0;
  transition: all 0.15s ease;
}
.mini-btn:hover { border-color: var(--text-dim); }
.mini-btn.copied { background: var(--lime); color: #131214; border-color: var(--lime); }
.mini-btn:disabled { opacity: 0.6; cursor: wait; }
.dl-btn { background: rgba(255, 77, 28, 0.12); border-color: rgba(255, 77, 28, 0.45); color: #ffb39e; }
.dl-btn:hover { background: rgba(255, 77, 28, 0.22); border-color: var(--accent); color: #fff; }
.clip-actions + .clip-actions { margin-top: 0; padding-top: 0; }

/* empty state */
.empty {
  padding: 70px 0 90px;
  text-align: center;
  color: var(--text-dim);
}
.empty .big { font-size: 44px; margin-bottom: 14px; }
.empty p { font-size: 15px; max-width: 420px; margin: 0 auto; }

@media (max-width: 720px) {
  .url-row { flex-direction: column; }
  .go-btn { padding: 14px; }
  .usage-pill { display: none; }
}
