/* ViralClip AI — simplified (v6).
   Flat white, ink text, hairline borders, one dark primary button.
   No gradients, no glow, no dark surfaces. Phone-first: base styles
   are the phone layout; wider screens enhance via min-width queries.
   Header: solid opaque white, sticky, hamburger menu on phones so
   nav links never wrap over the logo and content never bleeds through. */

:root {
  --bg: #ffffff;
  --ink: #111827;
  --text: #1f2937;
  --text-soft: #374151;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --field: #f9fafb;
  --accent: #7c3aed;
  --accent-deep: #5b21b6;
  --accent-soft: #f5f3ff;
  --green: #15803d;
  --green-bg: #f0fdf4;
  --red: #b91c1c;
  --red-bg: #fef2f2;
  --amber: #b45309;
  --amber-bg: #fffbeb;
  --radius: 12px;
  --shadow-1: 0 1px 2px rgba(17, 24, 39, .05);
  --shadow-2: 0 1px 2px rgba(17, 24, 39, .05), 0 8px 24px -12px rgba(17, 24, 39, .12);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { max-width: 100%; }
::selection { background: var(--accent-soft); color: var(--accent-deep); }
a { color: var(--accent-deep); }

/* ---------- header: solid opaque white, never lets content through ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 60px; padding: 0 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; flex-shrink: 0; }
.site-logo { height: 34px; width: auto; display: block; }
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; }
.nav-toggle {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  width: 44px; height: 44px; flex-shrink: 0;
  background: #fff; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; }
.nav-toggle:hover { background: var(--field); }
.topnav {
  display: none;
  position: absolute; top: 60px; left: 0; right: 0;
  flex-direction: column; gap: 2px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 8px 16px 12px;
  box-shadow: 0 12px 24px -12px rgba(17, 24, 39, .18);
}
.topnav.open { display: flex; }
.topnav a {
  color: var(--text-soft); text-decoration: none; font-size: 15px; font-weight: 700;
  padding: 12px 10px; border-radius: 8px; white-space: nowrap; min-height: 44px;
}
.topnav a:hover { color: var(--ink); background: var(--field); }

main { max-width: 1080px; margin: 0 auto; padding: 0 20px 64px; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 48px 0 8px; }
.eyebrow {
  margin: 0 0 14px; font-size: 12px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent);
}
.hero h1 {
  margin: 0 auto 14px; max-width: 680px;
  font-size: 32px; line-height: 1.12; font-weight: 800; letter-spacing: -.03em; color: var(--ink);
}
.hero-sub { margin: 0 auto 28px; max-width: 640px; font-size: 17px; line-height: 1.6; color: var(--muted); }
.work-card {
  text-align: left;
  max-width: 860px; margin: 0 auto;
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; box-shadow: var(--shadow-2);
}
.platform-line { margin: 22px 0 0; font-size: 13px; color: var(--muted); }
.platform-line span { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin-right: 8px; }
.platform-line i { font-style: normal; color: var(--border-strong); margin: 0 8px; }

/* ---------- sections ---------- */
.section { padding: 56px 0 8px; text-align: center; }
.section h2, .card h2 { margin: 0 0 10px; font-size: 28px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin-top: 32px; box-shadow: var(--shadow-1); }
.card h3 { margin: 0 0 6px; font-size: 19px; font-weight: 750; letter-spacing: -.01em; color: var(--ink); }
.sub { color: var(--muted); margin: 0 0 18px; font-size: 14px; line-height: 1.6; }

/* ---------- inputs ---------- */
.input-row { display: flex; flex-direction: column; gap: 10px; }
.input-row input[type="url"] {
  width: 100%; padding: 14px 16px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: #fff;
  color: var(--text); font-size: 16px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input-row input[type="url"]:focus {
  border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 24, 39, .08);
}
.or { color: var(--muted); font-size: 13px; align-self: center; }
.file-drop {
  width: 100%; padding: 14px 16px; border-radius: 10px;
  border: 1.5px dashed var(--border-strong); background: var(--field);
  color: var(--text-soft); font-size: 15px; cursor: pointer; text-align: center;
  display: flex; align-items: center; justify-content: center; min-height: 52px;
  transition: border-color .15s ease, background .15s ease;
}
.file-drop:hover, .file-drop.drag { border-color: var(--ink); background: #f3f4f6; }

/* ---------- buttons ---------- */
.cta-btn {
  margin-top: 18px; width: 100%; min-height: 52px; padding: 14px 16px;
  background: var(--ink); color: #fff; border: 0; border-radius: 10px;
  font-size: 16px; font-weight: 700; letter-spacing: -.01em; cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.cta-btn:hover { background: #1f2937; }
.cta-btn:active { transform: translateY(1px); }
.cta-btn:disabled { opacity: .55; cursor: wait; transform: none; }
.error { color: var(--red); margin: 10px 0 0; font-size: 14px; font-weight: 600; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.honest-notes {
  margin-top: 18px; display: grid; gap: 7px;
  font-size: 13px; color: var(--muted); line-height: 1.6;
  border-top: 1px solid var(--border); padding-top: 16px;
}
.honest-notes strong { color: var(--text); }

/* ---------- forms ---------- */
.path2-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.path2-grid label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-soft); }
.path2-grid input, .path2-grid select, .path2-grid textarea {
  width: 100%; min-height: 48px; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: #fff; color: var(--text);
  font-size: 16px; outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.path2-grid input:focus, .path2-grid select:focus, .path2-grid textarea:focus {
  border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 24, 39, .08);
}
.path2-grid .wide { grid-column: 1 / -1; }
.audio-row { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }
.audio-row label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-soft); }
.audio-row select, .audio-row input { width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: #fff; color: var(--text); font-size: 16px; outline: none; }
.audio-row select:focus, .audio-row input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 24, 39, .08); }
.advanced { margin: 4px 0 12px; border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: var(--field); }
.advanced summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-soft); min-height: 44px; display: flex; align-items: center; }
.advanced label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-soft); margin-top: 10px; }
.advanced p { margin: 8px 0 0; }
.gate-preview { font-size: 13px; font-weight: 700; margin: 8px 0; color: var(--green); }

/* ---------- tabs ---------- */
.tabs { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; padding: 4px; background: #f3f4f6; border: 1px solid var(--border); border-radius: 12px; }
.tab {
  width: 100%; min-height: 48px; padding: 12px 10px; border-radius: 9px; border: 0;
  background: transparent; color: var(--text-soft); font-weight: 700; font-size: 15px; cursor: pointer; text-align: center;
  transition: background .15s ease, color .15s ease;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--ink); color: #fff; }

/* ---------- steps ---------- */
.steps-grid { display: grid; grid-template-columns: 1fr; gap: 12px; text-align: left; }
.step { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 15px; font-weight: 800; margin-bottom: 12px;
}
.step h3 { margin: 0 0 6px; font-size: 16px; font-weight: 750; color: var(--ink); }
.step p { margin: 0; font-size: 14px; color: var(--muted); }
.unique-note { margin: 32px auto 0; max-width: 620px; border-top: 1px solid var(--border); padding-top: 28px; }
.unique-note h3 { margin: 0 0 6px; font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.unique-note p { margin: 0; font-size: 15px; color: var(--muted); }

/* ---------- jobs ---------- */
.job { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-top: 14px; background: var(--field); }
.job-head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.job-head b { font-size: 15px; color: var(--ink); word-break: break-word; }
.status { font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: #f3f4f6; color: #4b5563; text-transform: capitalize; }
.status.done { background: var(--green-bg); color: var(--green); }
.status.failed { background: var(--red-bg); color: var(--red); }
.status.processing, .status.queued { background: var(--amber-bg); color: var(--amber); }
.job-meta { color: var(--muted); font-size: 13px; margin: 8px 0; }
.job-error { background: var(--red-bg); color: var(--red); border: 2px solid #fca5a5; border-radius: 10px; padding: 12px 14px; font-size: 15px; font-weight: 600; margin: 10px 0; }
.job-error-hint { display: block; font-size: 13px; font-weight: 600; margin-top: 4px; }
.dl-log { margin: 8px 0; font-size: 12px; color: var(--muted); }
.dl-log summary { cursor: pointer; font-weight: 600; }
.dl-log pre { white-space: pre-wrap; word-break: break-word; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin: 6px 0 0; font-size: 11px; }
.stage-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.stage-chip { font-size: 12px; font-weight: 600; color: var(--muted); background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.stage-chip.done { color: var(--text); background: var(--green-bg); border-color: #bbf7d0; }
.stage-chip.current { color: var(--accent-deep); background: var(--accent-soft); border-color: var(--accent); }
.qc { font-size: 12px; padding: 9px 11px; border-radius: 9px; margin: 8px 0; font-weight: 600; }
.qc.pass { background: var(--green-bg); color: var(--green); }
.qc.fail { background: var(--red-bg); color: var(--red); }
.desc, .tags { margin-top: 10px; font-size: 13px; }
.desc b, .tags b { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.desc p, .tags p { margin: 4px 0 8px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.copy-btn {
  min-height: 44px; padding: 10px 14px; border-radius: 9px; font-size: 13px; font-weight: 700;
  background: #fff; color: var(--ink); border: 1px solid var(--border-strong); cursor: pointer;
  transition: border-color .15s ease;
}
.copy-btn:hover { border-color: var(--ink); }

/* ---- clips: ONE horizontal scrollable row ---- */
.clips-row { display: flex; gap: 12px; overflow-x: auto; padding: 10px 2px 12px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.clip-card { flex: 0 0 78vw; max-width: 320px; scroll-snap-align: start; background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-1); }
.clip-card video { width: 100%; display: block; aspect-ratio: 9/16; object-fit: cover; background: #111827; max-height: 440px; }
.clip-card-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.clip-card-body b { font-size: 13px; color: var(--ink); }
.clip-card-body span { font-size: 12px; color: var(--muted); }
.qc-badge { font-weight: 700; font-size: 11px; }
.qc-badge.pass { color: var(--green); }
.qc-badge.fail { color: var(--red); }
.dl-btn {
  display: block; width: 100%; min-height: 46px; padding: 12px 10px; margin-top: 4px;
  text-align: center; border-radius: 9px; font-size: 14px; font-weight: 700; line-height: 1.3;
  color: #fff; background: var(--ink); text-decoration: none;
}
.dl-btn:hover { background: #1f2937; }
.job-details { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.job-details > summary { cursor: pointer; font-weight: 700; font-size: 14px; min-height: 44px; color: var(--ink); }
.detail-clip { margin-top: 12px; }
.detail-clip h4 { margin: 0 0 6px; font-size: 14px; color: var(--ink); }

/* ---- gate / risk / fact / audit / reviews (inside job details only) ---- */
.gate-badge { font-size: 12px; font-weight: 800; padding: 5px 11px; border-radius: 999px; }
.gate-green { background: var(--green-bg); color: var(--green); }
.gate-amber { background: var(--amber-bg); color: var(--amber); }
.gate-red { background: var(--red-bg); color: var(--red); }
.gate-unknown { background: #f3f4f6; color: #4b5563; }
.gate-detail { font-size: 13px; margin: 8px 0; }
.risk, .audit, .reviews { font-size: 13px; margin: 8px 0; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; background: #fff; }
.risk summary, .audit summary, .reviews summary { cursor: pointer; font-weight: 700; color: var(--text); min-height: 44px; }
.risk-item, .review { margin-top: 5px; }
.risk-item.fail, .review.fail { color: var(--red); }
.risk-item.warn, .review.warn { color: var(--amber); }
.risk-item.ok, .review.pass { color: var(--green); }
.risk-item.unknown, .review.na { color: var(--muted); }
.fact { font-size: 12px; padding: 9px 11px; border-radius: 9px; margin: 8px 0; background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }

/* ---- live job banner (right under the form) ---- */
.job-banner { margin-top: 14px; border-radius: 12px; padding: 14px 16px; font-size: 15px; font-weight: 700; line-height: 1.5; }
.job-banner.working { background: var(--accent-soft); color: var(--accent-deep); border: 1px solid #ddd6fe; }
.job-banner.done { background: var(--green-bg); color: var(--green); border: 1px solid #86efac; }
.job-banner.failed { background: var(--red-bg); color: var(--red); border: 2px solid #fca5a5; }
.job-banner a { color: inherit; text-decoration: underline; font-weight: 800; white-space: nowrap; }
.job-banner .banner-sub { display: block; font-size: 13px; font-weight: 600; margin-top: 4px; opacity: .85; }
.job-banner .banner-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: currentColor; margin-right: 8px; animation: banner-pulse 1.2s ease-in-out infinite; }
@keyframes banner-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------- footer: simple ---------- */
footer { text-align: center; color: var(--muted); font-size: 13px; padding: 36px 20px 40px; line-height: 1.8; border-top: 1px solid var(--border); }
footer p { margin: 4px 0; }
.foot-brand { font-size: 15px; font-weight: 800; color: var(--ink); }
footer a { color: var(--text-soft); text-decoration: none; font-weight: 700; }
footer a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- tablet: 641px and up ---------- */
@media (min-width: 641px) {
  .topbar { padding: 0 28px; }
  .nav-toggle { display: none; }
  .topnav { display: flex; position: static; flex-direction: row; gap: 4px; background: transparent; border-bottom: 0; padding: 0; box-shadow: none; }
  .topnav a { font-size: 14px; padding: 8px 12px; }
  .hero { padding: 72px 0 12px; }
  .hero h1 { font-size: 44px; }
  .work-card { padding: 28px; }
  .tabs { flex-direction: row; display: inline-flex; width: auto; }
  .tab { width: auto; padding: 10px 18px; font-size: 14px; min-height: 44px; }
  .input-row { flex-direction: row; align-items: stretch; }
  .input-row input[type="url"] { flex: 1 1 320px; }
  .file-drop { flex: 1 1 320px; }
  .audio-row { flex-direction: row; align-items: end; flex-wrap: wrap; gap: 16px; }
  .audio-row label { flex: 1 1 200px; }
  .path2-grid { grid-template-columns: repeat(2, 1fr); }
  .path2-grid input, .path2-grid select, .path2-grid textarea { font-size: 14px; }
  .steps-grid { grid-template-columns: repeat(3, 1fr); }
  .job-head { flex-direction: row; justify-content: space-between; align-items: center; }
  .clip-card { flex: 0 0 240px; }
  .clip-card video { max-height: 360px; }
  .dl-btn { width: auto; display: inline-block; min-height: 44px; padding: 10px 16px; }
}

/* ---------- desktop: 901px and up ---------- */
@media (min-width: 901px) {
  .hero h1 { font-size: 48px; }
  .section h2 { font-size: 32px; }
  .path2-grid { grid-template-columns: repeat(3, 1fr); }
  .clip-card { flex: 0 0 220px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
