/* Copy an Edit - opening screen (rebuilt 2026-10-22, owner: "it looks a
   little too simplistic"). One-line value, a demo that shows the real steps
   (upload, add clips, generate, done), a progress bar in step with the demo,
   one button. The demo frame is the OPPOSITE colour of the page so it pops:
   dark on the light theme, light on the dark theme. Motion: copy-edit-cover.js. */

html.ce-cover-open,
html.ce-cover-open body { overflow: hidden; }
html.ce-cover-skip .ce-cover { display: none !important; }

.ce-cover {
  --cv-bg: var(--cf-bg, #0a0a0d);
  --cv-fg: var(--cf-text, #fff);
  --cv-fg2: var(--cf-text-2, rgba(255,255,255,.7));
  --cv-fg3: var(--cf-text-3, rgba(255,255,255,.5));
  --cv-line: var(--cf-border, #2a2c36);
  --cv-accent: var(--cf-accent, #3b82f6);
  /* the stage: opposite of the page (dark page -> light stage) */
  --st-bg: #F3F5F9; --st-bg2: #FFFFFF; --st-fg: #0C0E16; --st-fg2: rgba(12,14,22,.6); --st-line: #DDE1E8; --st-shadow: 0 30px 70px rgba(0,0,0,.55);
  position: fixed; inset: 0; z-index: 400;
  display: flex; flex-direction: column;
  background:
    radial-gradient(90% 55% at 50% 0%, color-mix(in srgb, var(--cv-accent) 16%, transparent), transparent 70%),
    var(--cv-bg);
  color: var(--cv-fg);
  transition: opacity .32s ease, transform .32s ease;
}
html[data-theme="light"] .ce-cover {
  --st-bg: #0B0D14; --st-bg2: #161925; --st-fg: #FFFFFF; --st-fg2: rgba(255,255,255,.62); --st-line: #262A38; --st-shadow: 0 30px 60px rgba(16,24,40,.28);
}
.ce-cover.is-dismissed { opacity: 0; pointer-events: none; transform: translateY(-8px); }

.ce-cover-inner {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) max(18px, env(safe-area-inset-left, 0px)) calc(env(safe-area-inset-bottom, 0px) + 16px);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}

/* ---- text ---- */
.cv-head { width: 100%; max-width: 420px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cv-eyebrow {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  font: 800 11px/1 var(--cf-font, Inter, sans-serif); letter-spacing: .14em; text-transform: uppercase;
  color: var(--cv-accent); background: color-mix(in srgb, var(--cv-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--cv-accent) 28%, transparent);
}
.cv-eyebrow svg { width: 12px; height: 12px; }
.ce-cover-title { margin: 0; font: 900 30px/1.06 var(--cf-font, Inter, sans-serif); letter-spacing: -.035em; text-wrap: balance; }
.ce-cover-title em { font-style: normal; color: var(--cv-accent); }
.ce-cover-lead { margin: 0; max-width: 330px; font-size: 14.5px; line-height: 1.45; color: var(--cv-fg2); text-wrap: balance; }

/* ---- the stage ---- */
.cv-stage-wrap { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cv-stage-wrap::before { /* soft glow behind the frame */
  content: ""; position: absolute; left: 50%; top: 46%; width: 120%; height: 70%; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--cv-accent) 30%, transparent), transparent); filter: blur(30px); opacity: .55; pointer-events: none;
}
.ce-demo {
  position: relative; overflow: hidden; isolation: isolate;
  width: min(72vw, 290px, calc((100dvh - 330px) * 9 / 15));
  aspect-ratio: 9 / 15; border-radius: 26px;
  background: radial-gradient(120% 80% at 50% 0%, var(--st-bg2), var(--st-bg));
  color: var(--st-fg); border: 1px solid var(--st-line); box-shadow: var(--st-shadow);
}
.cv-cap {
  position: absolute; left: 0; right: 0; top: 14px; z-index: 6; text-align: center;
  font: 800 13px/1.2 var(--cf-font, Inter, sans-serif); letter-spacing: -.01em; color: var(--st-fg);
  transition: opacity .25s ease, transform .25s ease;
}
.cv-cap.swap { opacity: 0; transform: translateY(-4px); }
.cv-scene { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.ce-demo[data-phase="upload"] .cv-s-upload,
.ce-demo[data-phase="clips"] .cv-s-clips,
.ce-demo[data-phase="generate"] .cv-s-clips,
.ce-demo[data-phase="generate"] .cv-s-gen,
.ce-demo[data-phase="build"] .cv-s-build,
.ce-demo[data-phase="done"] .cv-s-done { opacity: 1; }

/* upload */
.cv-up {
  position: absolute; left: 12%; right: 12%; top: 26%; padding: 18px 14px 16px; border-radius: 18px; text-align: center;
  background: color-mix(in srgb, var(--st-fg) 6%, transparent); border: 1.5px dashed color-mix(in srgb, var(--st-fg) 22%, transparent);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.cv-up svg { width: 26px; height: 26px; color: var(--cv-accent); }
.cv-up b { font-size: 13px; }
.cv-up small { font-size: 10.5px; color: var(--st-fg2); margin-top: -4px; }
.cv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: 10px; background: var(--cv-accent); color: #fff; font: 800 12px var(--cf-font, Inter, sans-serif); }
.cv-ref {
  position: absolute; left: 22%; right: 22%; top: 24%; aspect-ratio: 9 / 13; border-radius: 14px; overflow: hidden; opacity: 0;
  box-shadow: 0 16px 34px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.14); background: #111 center / cover;
}
.cv-ref .cv-tag { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 999px; background: var(--cv-accent); color: #fff; font: 800 9px var(--cf-font, Inter, sans-serif); letter-spacing: .06em; text-transform: uppercase; }
.cv-ref .cv-ok { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); white-space: nowrap; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font: 700 10px var(--cf-font, Inter, sans-serif); backdrop-filter: blur(6px); }
.cv-finger {
  position: absolute; z-index: 7; width: 30px; height: 30px; border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.95) 0 35%, rgba(255,255,255,.35) 36% 60%, transparent 61%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.15);
}
html[data-theme="light"] .cv-finger { background: radial-gradient(circle, rgba(255,255,255,.95) 0 35%, rgba(255,255,255,.3) 36% 60%, transparent 61%); }

/* clips */
.cv-tray { position: absolute; left: 9%; right: 9%; top: 18%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cv-clip { aspect-ratio: 3 / 4; border-radius: 10px; background: #222 center / cover; opacity: 0; box-shadow: 0 8px 18px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.12); }
.cv-count { position: absolute; left: 50%; top: 66%; transform: translateX(-50%); white-space: nowrap; padding: 6px 12px; border-radius: 999px; font: 700 11px var(--cf-font, Inter, sans-serif); background: color-mix(in srgb, var(--st-fg) 8%, transparent); border: 1px solid color-mix(in srgb, var(--st-fg) 16%, transparent); color: var(--st-fg); }
.cv-gen { position: absolute; left: 50%; bottom: 9%; transform: translateX(-50%); padding: 11px 26px; border-radius: 13px; font-size: 13px; box-shadow: 0 12px 28px color-mix(in srgb, var(--cv-accent) 45%, transparent); }
.cv-gen svg { width: 14px; height: 14px; }

/* build: orbit + core */
.cv-orbit { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.cv-orb { position: absolute; left: 0; top: 0; width: 38px; height: 50px; margin: -25px 0 0 -19px; border-radius: 9px; background: #222 center / cover; box-shadow: 0 6px 14px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.14); opacity: 0; will-change: transform, opacity; }
.cv-core { position: absolute; left: 50%; top: 50%; width: 92px; height: 92px; margin: -46px 0 0 -46px; border-radius: 50%; display: grid; place-items: center; z-index: 3; }
.cv-core-face { position: absolute; inset: 0; border-radius: inherit; background: var(--st-bg2) center / cover; box-shadow: 0 0 0 1px var(--st-line), 0 10px 30px rgba(0,0,0,.35); overflow: hidden; }
.cv-core svg { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); transform: rotate(-90deg); }
.cv-core .trk { fill: none; stroke: color-mix(in srgb, var(--st-fg) 12%, transparent); stroke-width: 4; }
.cv-core .bar { fill: none; stroke: var(--cv-accent); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .18s linear; }
.cv-pct { position: relative; z-index: 2; font: 900 20px/1 var(--cf-font, Inter, sans-serif); color: var(--st-fg); letter-spacing: -.02em; }

/* done: the real result plays */
.cv-s-done { z-index: 4; }
.cv-result { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.cv-s-done::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35), transparent 22%, transparent 70%, rgba(0,0,0,.55)); pointer-events: none; }
.cv-done {
  position: absolute; z-index: 2; left: 50%; bottom: 14px; transform: translateX(-50%); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px;
  background: rgba(16, 185, 129, .92); color: #fff; font: 800 11.5px var(--cf-font, Inter, sans-serif); box-shadow: 0 8px 20px rgba(0,0,0,.35);
}
.ce-demo[data-phase="done"] .cv-cap { color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.5); }

/* ---- step progress (in step with the demo) ---- */
.cv-steps { width: min(80vw, 320px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cv-step { display: flex; flex-direction: column; gap: 6px; font: 700 11.5px/1 var(--cf-font, Inter, sans-serif); color: var(--cv-fg3); text-align: center; transition: color .25s ease; }
.cv-step i { display: block; height: 3px; border-radius: 3px; background: var(--cv-line); overflow: hidden; }
.cv-step i b { display: block; height: 100%; width: 0; background: var(--cv-accent); }
.cv-step.on { color: var(--cv-fg); }
.cv-step.past i b { width: 100% !important; }

/* ---- button + trust line ---- */
.ce-cover-body { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: auto; }
.ce-cover-cta {
  width: 100%; height: 54px; border: 0; border-radius: 16px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--cv-accent); color: #fff; font: 800 16px var(--cf-font, Inter, sans-serif); letter-spacing: -.01em;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--cv-accent) 38%, transparent);
  transition: transform .12s ease, box-shadow .2s ease;
}
.ce-cover-cta:active { transform: scale(.98); }
.ce-cover-cta svg { width: 18px; height: 18px; }
.cv-trust { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--cv-fg3); }
.cv-trust span { display: inline-flex; align-items: center; gap: 5px; }
.cv-trust svg { width: 13px; height: 13px; color: var(--cf-ok, #34d399); }

@media (min-width: 900px) {
  .ce-cover-inner {
    display: grid; grid-template-columns: minmax(0, 400px) auto; grid-template-areas: "head stage" "body stage";
    justify-content: center; align-content: center; column-gap: 72px; row-gap: 22px;
  }
  .cv-head { grid-area: head; align-self: end; text-align: left; align-items: flex-start; max-width: 400px; }
  .ce-cover-title { font-size: 46px; }
  .ce-cover-lead { max-width: none; font-size: 16px; }
  .cv-stage-wrap { grid-area: stage; }
  .ce-cover-body { grid-area: body; align-self: start; margin-top: 0; align-items: flex-start; }
  .cv-trust { justify-content: flex-start; }
  .ce-demo { width: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  .cv-scene, .cv-cap { transition: none; }
}
