/* ============================================================
   CastClipper — design system
   Brand: near-black canvas, one neon-green accent (#00ff9d),
   Space Grotesk (display), Inter (body), JetBrains Mono (data).

   System rules:
   - The accent marks exactly four things: the primary action,
     interactive affordances (links/hover/focus), live/success
     state, and the one conversion surface (upgrade card).
     Everything else is neutral.
   - One radius (10px; pills only for status signifiers),
     one shadow (the active app panel), one hairline.
   - No ambient gradients, glows, or decorative framing.
   Mobile-first.
   ============================================================ */

:root {
  --bg: #0b0f0e;
  --bg-alt: #0e1513;
  --panel: #101815;
  --line: #1e2b26;
  --line-strong: #33463d;
  --text: #e8f5ef;
  --muted: #9db8ad;   /* body-level secondary text, AA on all surfaces */
  --dim: #83a296;     /* metadata/captions, AA on all surfaces */
  --accent: #00ff9d;
  --accent-hover: #33ffb2;
  --accent-ink: #04120c;
  --danger: #ff5d6c;
  --danger-tint: rgba(255, 93, 108, 0.08);
  --radius: 10px;
  --border: var(--line-strong); /* alias used by media/frames */
  --shadow-panel: 0 18px 50px rgba(0, 0, 0, 0.4);
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--font-mono); }

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.wrap-narrow { max-width: 760px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 15, 14, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.brand-accent { color: var(--accent); }

.site-nav {
  display: none;
  align-items: center;
  gap: 26px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.site-nav a:hover { color: var(--text); }

.nav-cta {
  color: var(--accent) !important;
  border: 1px solid rgba(0, 255, 157, 0.4);
  padding: 6px 13px;
  border-radius: var(--radius);
}

.nav-cta:hover {
  color: var(--accent-hover) !important;
  border-color: var(--accent);
}

@media (min-width: 720px) {
  .site-nav { display: flex; }
}

/* ---------- Type scale / sections ---------- */

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  font-weight: 700;
  margin: 0 0 20px;
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 700;
  margin: 0 0 14px;
}

h3 { font-size: 1.15rem; font-weight: 600; }

.section { padding: 64px 0; }

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-lede {
  color: var(--muted);
  max-width: 52ch;
  margin-bottom: 28px;
}

/* ---------- Hero ---------- */

.hero { padding: 84px 0 72px; }

.hero-inner {
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 900px) {
  .hero-inner { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
}

.hero-sub {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 58ch;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

@media (min-width: 560px) {
  .hero-actions { flex-direction: row; }
}

.hero-proof {
  color: var(--dim);
  font-size: 0.88rem;
  letter-spacing: 0.01em;
}

/* Hero media: two real rendered clips, overlapping on a subtle dialed frame.
   The only job of this block is to prove output quality at first glance. */
.hero-media {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: 24px 0 44px;
}

.hero-clip {
  width: 172px;
  flex: 0 0 auto;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-panel);
}

.hero-clip video {
  display: block;
  width: 100%;
  height: auto;
}

.hero-clip-a {
  position: relative;
  z-index: 2;
  transform: rotate(-4deg);
}

.hero-clip-b {
  position: relative;
  z-index: 1;
  width: 154px;
  margin-left: -34px;
  transform: rotate(3deg) translateY(14px);
  opacity: 0.92;
}

@media (min-width: 1100px) {
  .hero-clip { width: 216px; }
  .hero-clip-b { width: 192px; }
}

.hero-media-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--dim);
  letter-spacing: 0.01em;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.2;
  padding: 14px 26px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-primary:disabled,
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-small {
  padding: 8px 14px;
  font-size: 0.85rem;
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent);
  border-color: rgba(0, 255, 157, 0.4);
}

.btn-small:hover { background: rgba(0, 255, 157, 0.1); }

/* ---------- Steps (ordered sequence) ---------- */

.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 16px;
  margin-top: 34px;
}

@media (min-width: 780px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}

.step {
  counter-increment: step;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px 22px;
}

.step::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.step h3 { margin-bottom: 10px; }
.step p { color: var(--muted); font-size: 0.95rem; }

/* ---------- App panels ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 24px;
  box-shadow: var(--shadow-panel);
}

.panel-error {
  border-color: rgba(255, 93, 108, 0.45);
  background: linear-gradient(var(--danger-tint), var(--danger-tint)), var(--panel);
  box-shadow: none;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.panel-lede { color: var(--muted); font-size: 0.97rem; margin-bottom: 22px; }
.panel-lede strong { color: var(--accent); }

.panel-note { color: var(--dim); font-size: 0.88rem; margin-top: 18px; }
.panel-foot { margin-top: 26px; }

.panel label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

.url-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 560px) {
  .url-row { flex-direction: row; }
  .url-row .btn { flex-shrink: 0; }
}

.url-row input {
  flex: 1;
  width: 100%;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.url-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 255, 157, 0.25);
}

.url-row input::placeholder { color: var(--dim); }

.form-hint { color: var(--dim); font-size: 0.82rem; margin-top: 12px; }
.form-error { color: var(--danger); font-size: 0.88rem; margin-top: 12px; }

/* ---------- Invoice ---------- */

.invoice-grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 620px) {
  .invoice-grid { grid-template-columns: 216px 1fr; align-items: start; }
}

.invoice-qr {
  background: #ffffff; /* wallet/scanner readability — a white pad is required */
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  width: 216px;
}

.invoice-qr img { display: block; border-radius: 4px; }

.invoice-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--dim);
  margin-top: 14px;
}

.invoice-label:first-child { margin-top: 0; }

.invoice-value { font-size: 1.05rem; font-weight: 600; }

.invoice-value.mono { color: var(--accent); }

.address-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.address {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.85rem;
  color: var(--text);
  scrollbar-width: thin;
}

.copy-confirm { color: var(--accent); font-size: 0.82rem; margin-top: 8px; }

.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(0, 255, 157, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: -2px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Status chips (semantic states) ---------- */

.status-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 5px 12px;
  border-radius: 999px; /* pills reserved for status signifiers only */
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.chip-pending { color: #ffd166; border-color: rgba(255, 209, 102, 0.45); }
.chip-working { color: var(--accent); border-color: rgba(0, 255, 157, 0.45); }
.chip-done    { color: var(--accent-ink); background: var(--accent); border-color: transparent; }
.chip-failed  { color: var(--danger); border-color: rgba(255, 93, 108, 0.5); }
.chip-free    { color: var(--accent-ink); background: var(--accent); border-color: transparent; }

/* ---------- Progress stages ---------- */

.stage-list {
  list-style: none;
  margin-top: 8px;
}

.stage-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  color: var(--dim);
  border-bottom: 1px solid var(--line);
  font-size: 0.98rem;
  transition: color 0.25s ease;
}

.stage-list li:last-child { border-bottom: none; }

.stage-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  flex-shrink: 0;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.stage-list li.active { color: var(--text); }

.stage-list li.active .stage-dot {
  border-color: var(--accent);
  background: var(--accent);
  animation: stage-ring 1.4s ease-in-out infinite;
}

.stage-list li.done { color: var(--muted); }

.stage-list li.done .stage-dot {
  border-color: var(--accent);
  background: var(--accent);
}

@keyframes stage-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 255, 157, 0.35); }
  50%      { box-shadow: 0 0 0 6px rgba(0, 255, 157, 0); }
}

/* Live timing line under the stage list (elapsed + ETA) */
.panel-timing {
  color: var(--dim);
  font-size: 0.85rem;
  margin-top: 16px;
}

/* Scanning strip on the preview results panel (partial results live) */
.scan-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(0, 255, 157, 0.35);
  background: rgba(0, 255, 157, 0.06);
  border-radius: var(--radius);
  padding: 11px 14px;
  margin-bottom: 20px;
  color: var(--text);
  font-size: 0.9rem;
}

.scan-strip .spinner { flex-shrink: 0; }

/* ---------- Results / clips grid ---------- */

.clips-grid {
  display: grid;
  gap: 22px;
  margin-top: 18px;
}

@media (min-width: 640px) {
  .clips-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .clips-grid { grid-template-columns: repeat(3, 1fr); }
}

.clip-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.clip-card video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 420px;
  object-fit: cover;
  background: #000;
}

.clip-info { padding: 14px 16px 16px; }

.clip-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.clip-time {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--dim);
  margin-bottom: 12px;
}

.clip-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 7px 0;
}

.clip-download:hover { text-decoration: underline; }

/* ---------- FAQ ---------- */

.faq-list { margin-top: 28px; border-top: 1px solid var(--line); }

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 44px 18px 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  position: relative;
}

.faq-item summary:hover { color: var(--accent); }

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }

.faq-item p { padding: 0 0 18px; color: var(--muted); font-size: 0.94rem; max-width: 66ch; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 44px 0 52px;
  text-align: center;
}

.footer-inner { display: grid; gap: 6px; justify-items: center; }

.brand--footer { font-size: 1.1rem; }

.footer-tag { color: var(--muted); font-size: 0.95rem; }
.footer-tag .mono { color: inherit; font-size: 0.85rem; }

.footer-small { color: var(--dim); font-size: 0.8rem; margin-top: 6px; }
.footer-contact { color: var(--muted); font-size: 0.9rem; margin-top: 10px; line-height: 1.7; }
.footer-contact a { color: var(--accent); text-decoration: underline; text-decoration-style: dotted; }
.footer-contact a:hover { color: var(--accent-hover); }
.footer-contact code.tiny { font-size: 0.8rem; opacity: 0.8; }

/* ---------- Utilities ---------- */

[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#payment-waiting.done-waiting { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Preview results panel ---------- */

/* Big vertical preview player with "FREE PREVIEW" ribbon */
.preview-player {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin: 8px auto 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}

.preview-player video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  background: #000;
}

.preview-ribbon {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 999px; /* status overlay over media — a signifier, not chrome */
  padding: 5px 14px;
  pointer-events: none;
}

/* "Your AI picks" header */
.picks-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 30px 0 4px;
}

.picks-head h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.free-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.picks-sub { color: var(--dim); font-size: 0.88rem; margin-bottom: 10px; }

/* Segment list — AI titles + virality scores, aligned rows */
.segment-list { list-style: none; margin-top: 6px; }

.segment-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.segment-item:last-child { border-bottom: none; }

.segment-body { min-width: 0; }

.segment-title {
  font-weight: 600;
  font-size: 0.97rem;
}

.segment-time {
  color: var(--dim);
  font-size: 0.78rem;
  margin-top: 2px;
}

.segment-score {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
}

/* High-scoring picks get the accent color — rank, not decoration */
.segment-score--hot {
  color: var(--accent);
  font-weight: 600;
}

/* Streaming preview clips grid — smaller cards than the paid results grid */
.clips-grid--previews {
  margin-top: 10px;
}

.clips-grid--previews .clip-card video {
  max-height: 280px;
}

/* Upgrade card — the single conversion surface gets the accent tint */
.upgrade-card {
  margin-top: 28px;
  padding: 26px 22px;
  border: 1px solid rgba(0, 255, 157, 0.5);
  border-radius: var(--radius);
  background: rgba(0, 255, 157, 0.05);
  display: grid;
  gap: 18px;
}

.upgrade-card h4 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.upgrade-points { list-style: none; }

.upgrade-points li {
  position: relative;
  padding: 5px 0 5px 24px;
  color: var(--muted);
  font-size: 0.93rem;
}

.upgrade-points li::before {
  content: "▸";
  position: absolute;
  left: 2px;
  color: var(--accent);
}

.upgrade-card .btn { width: 100%; }

@media (min-width: 620px) {
  .upgrade-card { grid-template-columns: 1fr auto; align-items: center; }
  .upgrade-card .btn { width: auto; white-space: nowrap; }
  .upgrade-card .form-error { grid-column: 1 / -1; margin-top: 0; }
}
