/* VideoDesk. Design system. Calm dark product aesthetic, mobile-first (390px
   is the primary canvas; desktop is the adaptation). One amber accent. */

:root {
  --bg: #0b0b10;
  --bg-2: #101018;
  --card: #14141d;
  --card-2: #1a1a25;
  --border: #24242f;
  --border-strong: #30303e;

  --text: #f4f4f6;
  --text-muted: #b6b6c2;
  --text-dim: #7c7c8a;

  --accent: #fbbf24;               /* amber, the single brand accent */
  --accent-ink: #17130a;           /* text on amber */
  --accent-soft: rgba(251, 191, 36, 0.12);

  /* module-colour status chips */
  --ok: #34d399;      --ok-soft: rgba(52, 211, 153, 0.13);
  --info: #60a5fa;    --info-soft: rgba(96, 165, 250, 0.13);
  --warn: #fbbf24;    --warn-soft: rgba(251, 191, 36, 0.13);
  --violet: #a78bfa;  --violet-soft: rgba(167, 139, 250, 0.13);
  --danger: #f87171;  --danger-soft: rgba(248, 113, 113, 0.13);

  --radius: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --bottombar-h: 76px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }

/* ---- app shell ----------------------------------------------------------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #f59e0b);
  color: var(--accent-ink);
}
.brand-mark svg { width: 19px; height: 19px; }
.brand-name { display: block; font-weight: 800; font-size: 16px; letter-spacing: -0.01em; line-height: 1.15; white-space: nowrap; }
.brand-sub { display: block; font-size: 11px; color: var(--text-dim); line-height: 1.1; white-space: nowrap; }
.topbar-spacer { flex: 1; }
.topbar-nav {
  font-size: 12.5px; font-weight: 650; text-decoration: none; color: var(--text);
  background: var(--card-2); border: 1px solid var(--border-strong);
  padding: 7px 13px; border-radius: 999px; white-space: nowrap;
  transition: border-color 0.14s, background 0.14s;
}
.topbar-nav:hover { border-color: var(--accent); color: var(--accent); }
.stamp { font-size: 11px; color: var(--text-dim); white-space: nowrap; }
/* On phones the "updated" stamp competes with the brand + nav for width; the
   live status is non-essential on mobile, so hide it under the topbar squeeze. */
@media (max-width: 480px) { .stamp { display: none; } }

.wrap {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--bottombar-h) + 28px);
  flex: 1;
}

/* ---- generic bits -------------------------------------------------------- */
.section-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-dim); margin: 22px 2px 10px;
}
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 16px;
}
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }

/* buttons: big tap targets (>=44px) */
.btn {
  appearance: none; border: 1px solid var(--border-strong);
  background: var(--card-2); color: var(--text);
  font: inherit; font-weight: 600; font-size: 14.5px;
  padding: 12px 16px; border-radius: 11px; cursor: pointer;
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: filter 0.14s, background 0.14s, border-color 0.14s, opacity 0.14s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.btn.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.btn.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.mini { min-height: 38px; padding: 8px 12px; font-size: 13px; border-radius: 9px; }

.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track {
  width: 44px; height: 26px; border-radius: 999px; background: var(--border-strong);
  position: relative; transition: background 0.16s; flex: none;
}
.toggle .track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: transform 0.16s;
}
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track::after { transform: translateX(18px); }
.toggle .toggle-text { font-size: 14px; color: var(--text); }
.toggle .toggle-hint { font-size: 12px; color: var(--text-dim); display: block; }

textarea, input[type="text"], input[type="datetime-local"] {
  width: 100%; background: var(--card-2); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 11px 12px; font: inherit; font-size: 14.5px; resize: vertical;
}
textarea:focus, input:focus { outline: none; border-color: var(--accent); }

/* ---- status chip --------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.chip.working { color: var(--ok); background: var(--ok-soft); }
.chip.await { color: var(--warn); background: var(--warn-soft); }
.chip.done { color: var(--info); background: var(--info-soft); }
.chip.failed { color: var(--danger); background: var(--danger-soft); }
.chip.neutral { color: var(--text-dim); background: var(--card-2); }
.chip.working::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; animation: vblink 1.1s infinite;
}
@keyframes vblink { 50% { opacity: 0.25; } }

/* ---- batch header -------------------------------------------------------- */
.batch-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.batch-step { font-size: 15px; font-weight: 650; margin: 10px 0 2px; }
.batch-meta { font-size: 12.5px; color: var(--text-muted); }
.batch-note {
  font-size: 13px; color: var(--text-muted); background: var(--card-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 10px;
}

/* progress log */
.log {
  font-size: 12px; color: var(--text-dim); margin-top: 10px; line-height: 1.55;
  max-height: 96px; overflow: auto; white-space: pre-wrap; font-family: var(--mono);
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px;
}

/* ---- upload -------------------------------------------------------------- */
.drop {
  display: block; cursor: pointer;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg);
  padding: 26px 18px; text-align: center; background: var(--card);
  transition: border-color 0.16s, background 0.16s;
}
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-ico { display: block; width: 40px; height: 40px; margin: 0 auto 10px; color: var(--accent); }
.drop-ico svg { display: block; width: 100%; height: 100%; }
.drop-title { display: block; font-weight: 650; font-size: 15px; }
.drop-sub { display: block; font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.hidden-input { display: none; }

.uplist { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.upitem { background: var(--card-2); border: 1px solid var(--border); border-radius: 11px; padding: 11px 12px; }
.upitem-top { display: flex; align-items: center; gap: 10px; }
.upitem-name { font-size: 13.5px; font-weight: 550; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upitem-size { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; }
.upitem-state { font-size: 11.5px; white-space: nowrap; }
.upitem-state.done { color: var(--ok); }
.upitem-state.err { color: var(--danger); }
.bar { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; margin-top: 9px; }
.bar > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.upitem.done .bar > span { background: var(--ok); }

.batch-total { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 13px; color: var(--text-muted); }
.batch-total .bar { flex: 1; margin: 0 0 0 12px; }

/* ---- clip / finished-video card ----------------------------------------- */
.clips { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.clip {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card);
}
.clip.rejected { opacity: 0.5; }
.clip.approved { border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.clip.scheduled { border-color: color-mix(in srgb, var(--info) 40%, transparent); }

.clip video { width: 100%; display: block; background: #000; aspect-ratio: 9 / 16; max-height: 62vh; object-fit: contain; }
.clip-body { padding: 14px; }
.clip-topline { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.clip-n { font-size: 11px; font-weight: 700; color: var(--text-dim); }
.clip-len { font-size: 11.5px; color: var(--text-dim); }
.clip-title { font-size: 16px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.clip-desc { font-size: 13.5px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.clip-hook { font-size: 12.5px; color: var(--text-muted); margin-top: 8px; }
.clip-hook b { color: var(--accent); font-weight: 600; }
.cta-badge {
  display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--violet); background: var(--violet-soft); border-radius: 6px; padding: 3px 8px; margin-top: 9px;
}

/* version pills */
.versions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.versions .vlabel { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-dim); margin-right: 2px; }
.vpill {
  font-size: 12.5px; font-weight: 650; padding: 6px 11px; border-radius: 999px; cursor: pointer;
  background: var(--card-2); color: var(--text-muted); border: 1px solid var(--border-strong);
  min-height: 34px; display: inline-flex; align-items: center;
}
.vpill.active { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.vpill-note { font-size: 12px; color: var(--text-dim); margin-top: 6px; }

/* edit-request area */
.editbox { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.editbox-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.editbox-actions { display: flex; gap: 9px; margin-top: 10px; flex-wrap: wrap; }
.rec-status { font-size: 12.5px; color: var(--text-dim); align-self: center; }
.rec-status.live { color: var(--danger); }
.rec-status.live::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 6px; animation: vblink 1s infinite; vertical-align: 1px; }

.reqlist { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.reqitem { background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; font-size: 13px; color: var(--text-muted); }
.reqitem .req-type { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); margin-right: 6px; }
.reqitem audio { width: 100%; margin-top: 6px; height: 34px; }

/* publish controls */
.publish { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.publish-row { display: flex; gap: 9px; flex-wrap: wrap; }
.publish-row .btn { flex: 1; min-width: 120px; }
.slot-suggest {
  margin-top: 11px; font-size: 13px; color: var(--text-muted);
  background: var(--info-soft); border: 1px solid transparent; border-radius: 10px; padding: 11px 12px;
}
.slot-suggest b { color: var(--info); }
.slot-suggest .et { color: var(--text-dim); font-size: 12px; }
.picker { margin-top: 11px; display: none; }
.picker.open { display: block; }
.picker .picker-row { display: flex; gap: 9px; margin-top: 9px; }
.sched-line { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.sched-line b { color: var(--info); }

/* clip action buttons (approve / revise / schedule) */
.clip-actions { display: flex; gap: 9px; margin-top: 12px; flex-wrap: wrap; }
.clip-actions .btn { flex: 1; min-width: 110px; }

/* ---- empty / notice states ---------------------------------------------- */
.empty { text-align: center; padding: 40px 20px; }
.empty-ico { font-size: 34px; }
.empty-title { font-size: 16px; font-weight: 650; margin-top: 8px; }
.empty-line { font-size: 13.5px; color: var(--text-dim); margin-top: 5px; max-width: 340px; margin-inline: auto; line-height: 1.55; }
.notice {
  font-size: 13px; color: var(--warn); background: var(--warn-soft);
  border: 1px solid transparent; border-radius: 11px; padding: 12px 14px; margin-top: 12px; line-height: 1.5;
}
.notice code { font-family: var(--mono); font-size: 12px; }

/* ---- sticky bottom action bar (mobile-first) ---------------------------- */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: none;
}
.bottombar.show { display: block; }
.bottombar-inner { max-width: 640px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.bottombar .btn { flex: 1; }
.bottombar-hint { font-size: 12px; color: var(--text-dim); }

/* demo ribbon */
.demo-ribbon {
  font-size: 11.5px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border: 1px solid transparent; border-radius: 999px;
  padding: 4px 10px;
}
.demo-toast {
  position: fixed; left: 50%; bottom: calc(var(--bottombar-h) + 16px);
  transform: translateX(-50%) translateY(16px);
  background: var(--card); color: var(--text); border: 1px solid var(--border-strong);
  font-size: 13px; font-weight: 550; padding: 12px 16px; border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); max-width: min(92vw, 460px); text-align: center;
  opacity: 0; pointer-events: none; transition: opacity 0.22s, transform 0.22s; z-index: 9999;
}
.demo-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- desktop adaptation -------------------------------------------------- */
@media (min-width: 760px) {
  .wrap { max-width: 720px; padding-top: 24px; padding-bottom: 48px; }
  .clip video { aspect-ratio: auto; max-height: 520px; }
  /* On desktop the actions live in the cards; the sticky bar is hidden. */
  .bottombar { display: none !important; }
}

/* =========================================================================
   SHOWCASE  ("Real footage. Real results.")  -- the promo centrepiece.
   Mobile-first single column; widens into a grid on larger screens. Lives on
   /showcase and reuses the app's dark + amber design tokens.
   ========================================================================= */
.showcase { padding-bottom: 40px; }
/* The showcase has no sticky bottom bar, so reclaim that reserved space. */
body:has(.showcase) .wrap { padding-bottom: 40px; }

.sc-hero { padding: 14px 0 8px; }
.sc-eyebrow {
  display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 5px 12px; margin-bottom: 14px;
}
.sc-title {
  font-size: 27px; line-height: 1.14; font-weight: 800; letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.sc-lede { font-size: 15px; line-height: 1.6; color: var(--text-muted); margin: 0 0 18px; max-width: 56ch; }
.sc-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sc-hero-actions .btn { min-width: 160px; }

.sc-block { margin-top: 34px; }
.sc-h2 { font-size: 20px; font-weight: 750; letter-spacing: -0.01em; margin: 4px 0 6px; }
.sc-sub { font-size: 14px; color: var(--text-muted); margin: 0 0 16px; line-height: 1.55; max-width: 60ch; }

/* explainer (vertical 9:16 clip; centred on its own dark stage) */
.sc-explainer {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-2);
  min-height: 220px; display: grid; place-items: center;
}
.sc-explainer.ready { background: #000; }
.sc-explainer-video {
  display: block; margin: 0 auto; background: #000;
  width: auto; max-width: 100%; max-height: 78vh; object-fit: contain;
}
.sc-explainer-fallback { text-align: center; padding: 40px 20px; color: var(--text-dim); }
.sc-explainer-fallback .empty-ico { font-size: 30px; color: var(--accent); }
.sc-explainer-fallback .empty-title { font-size: 15px; font-weight: 650; margin-top: 8px; color: var(--text); }
.sc-explainer-fallback .empty-line { font-size: 13px; margin-top: 4px; }

/* clip grids */
.sc-inputs, .sc-outputs { display: grid; grid-template-columns: 1fr; gap: 16px; }

.sc-clip {
  margin: 0; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card);
}
.sc-out { border-color: color-mix(in srgb, var(--ok) 26%, var(--border)); }
.sc-video-wrap { position: relative; background: #000; }
.sc-video-wrap video {
  width: 100%; display: block; background: #000;
  aspect-ratio: 9 / 16; max-height: 74vh; object-fit: contain;
}
.sc-tag {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px; backdrop-filter: blur(6px);
}
.sc-tag.raw { color: var(--text); background: rgba(20, 20, 29, 0.72); border: 1px solid var(--border-strong); }
.sc-tag.live { color: #071b12; background: var(--ok); }
.sc-live-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: vblink 1.1s infinite; }

.sc-clip-body { padding: 14px 15px 16px; }
.sc-clip-label { font-size: 13px; font-weight: 700; color: var(--text); }
.sc-clip-note { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; line-height: 1.5; }
.sc-arrow {
  font-size: 12.5px; color: var(--accent); margin-top: 10px; font-weight: 600;
  border-top: 1px dashed var(--border-strong); padding-top: 10px;
}

.sc-out-top { display: flex; align-items: baseline; gap: 10px; }
.sc-out-title { font-size: 16.5px; font-weight: 750; line-height: 1.25; margin: 0; flex: 1; letter-spacing: -0.01em; }
.sc-out-len { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sc-out-desc { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; margin: 8px 0 0; }

.sc-links-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-dim); margin: 14px 0 9px;
}
.sc-links { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-plat {
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  font-size: 12.5px; font-weight: 650; color: var(--text);
  background: var(--card-2); border: 1px solid var(--border-strong);
  padding: 8px 12px; border-radius: 10px; min-height: 40px;
  transition: border-color 0.14s, background 0.14s, transform 0.06s;
}
.sc-plat:hover { border-color: var(--border-strong); background: var(--card); }
.sc-plat:active { transform: translateY(0.5px); }
.sc-plat svg { flex: none; }
.sc-plat.ig:hover { border-color: #d6336c; color: #f06595; }
.sc-plat.tt:hover { border-color: #4b5563; color: #e5e7eb; }
.sc-plat.yt:hover { border-color: #dc2626; color: #f87171; }
.sc-plat.x:hover { border-color: #4b5563; color: #e5e7eb; }
.sc-plat.th:hover { border-color: #4b5563; color: #e5e7eb; }

/* closing CTA */
.sc-cta {
  margin-top: 40px; text-align: center; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 30px 22px;
}
.sc-cta .sc-h2 { margin-bottom: 6px; }
.sc-cta .sc-sub { margin: 0 auto 16px; }
.sc-cta .btn { min-width: 220px; }
.sc-honest { font-size: 12px; color: var(--text-dim); margin-top: 14px; }

/* desktop: inputs in a row, outputs in a 2-up grid */
@media (min-width: 760px) {
  body:has(.showcase) .wrap { max-width: 960px; }
  .sc-title { font-size: 34px; }
  .sc-inputs { grid-template-columns: repeat(3, 1fr); }
  .sc-outputs { grid-template-columns: repeat(2, 1fr); }
  .sc-video-wrap video { max-height: 560px; }
}
@media (min-width: 1180px) {
  body:has(.showcase) .wrap { max-width: 1100px; }
}
