/* The "jobs you won't have to do anymore" part of the landing page: the pile that empties as the page
   scrolls, the small window that shows how one job runs, the drawn samples that play in it, and the
   preview that follows the mouse. The script is jobs.js. Colours and sizes shared with the rest of the
   site come from styles.css. */

.jobs { margin-top: clamp(30px, 3.6vw, 48px); }
.jobs-next { margin-top: clamp(40px, 4.4vw, 60px); }
.jobs-next + .workflow-stage { margin-top: 14px; }

.job-icon { display: grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px; color: #3a34a8; background: linear-gradient(140deg, #e3e6f6, #efe5f2); }
.job-icon svg, .slip-tick svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.job-icon svg { width: 22px; height: 22px; stroke-width: 1.7; }
.slip-tick { display: grid; place-items: center; flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; color: white; background: #4338ca; }
.slip-tick svg { width: 15px; height: 15px; stroke-width: 2.6; }
.jobs-label { display: flex; align-items: center; gap: 10px; color: #4c5359; font-size: 12px; font-weight: 670; line-height: 1.45; letter-spacing: .038em; }
.jobs-label b { display: grid; place-items: center; min-width: 24px; height: 24px; padding-inline: 7px; border-radius: var(--pill); color: white; background: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: 0; }

/* ---- The pile: scrolling moves the jobs off your desk ----
   Every job always sits in the "handled" list, so the page never changes shape. While a job still
   counts as on your desk, the script only slides it over to the pile (--t: 0 on the desk, 1 handled). */
.pile { --slip-height: 92px; --peek: 9px; isolation: isolate; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 5vw, 72px); align-items: start; }
.pile-yours { position: sticky; top: 112px; }
.pile-desk { position: relative; height: calc(var(--slip-height) + var(--peek) * 5 + 8px); margin-top: 14px; }
.pile-clear { position: absolute; inset: 0 0 auto; display: grid; place-items: center; height: var(--slip-height); padding-inline: 16px; border: 1.5px dashed #c4bfb1; border-radius: 18px; color: var(--muted); font-size: 16px; font-weight: 600; text-align: center; }
.pile-done { position: relative; display: grid; align-content: start; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
/* Under the pile: a big count of the jobs that have left the desk, so the left side is never empty. */
.pile-after { margin-top: clamp(14px, 2vw, 26px); }
.pile-tally { display: flex; align-items: baseline; gap: clamp(10px, 1.2vw, 16px); font-variant-numeric: tabular-nums; }
.pile-tally b { font-size: clamp(96px, 12vw, 164px); font-weight: 620; line-height: .86; letter-spacing: -.06em; }
.pile-tally span { color: #60656c; font-size: clamp(22px, 2.3vw, 32px); font-weight: 475; letter-spacing: -.03em; }
.pile-tally-line { margin-top: 12px; font-size: clamp(28px, 3.1vw, 44px); font-weight: 580; line-height: 1.08; letter-spacing: -.045em; }
.pile-tally-line em { color: #60656c; font-weight: 475; }
.pile-note { margin-top: 14px; color: var(--muted); font-size: 17px; line-height: 1.6; }
.pile-call { margin-top: 6px; }
.pile.is-live :is(.pile-note, .pile-call) { opacity: 0; transition: opacity .35s; }
.pile.is-live.is-clear :is(.pile-note, .pile-call) { opacity: 1; }
.pile.is-live:not(.is-clear) .pile-call { visibility: hidden; }
.slip { --tile: 56px; --side: 20px; isolation: isolate; position: relative; display: flex; align-items: center; gap: 18px; min-height: var(--slip-height); padding: 18px var(--side); }
/* On a job card the picture is a dark tile, like the logo's, so it stands apart from the words. */
.slip .job-icon { width: var(--tile); height: var(--tile); border-radius: 17px; color: white; background: var(--ink); }
.slip .job-icon svg { width: 50%; height: 50%; stroke-width: 1.8; }
/* The "handled" tick sits on the corner of the tile, which leaves the right edge for the arrow that opens the card. */
.slip .slip-tick { position: absolute; left: calc(var(--side) + var(--tile) - 15px); top: calc(50% + var(--tile) / 2 - 15px); width: 24px; height: 24px; box-shadow: 0 0 0 3px #fffdf9; }
.slip .slip-tick svg { width: 14px; height: 14px; }
.slip-more, .slip-open, .jobs-hint { display: none; }
/* The sheet of paper behind a job. On the pile it is only as tall as the job's name. */
.slip::before { content: ""; position: absolute; z-index: -1; inset: 0 0 auto; height: 100%; border: 1px solid #e2ddd0; border-radius: 18px; background: #fffdf9; box-shadow: 0 12px 26px -20px #4b453a70; }
.slip-text { flex: 1 1 auto; min-width: 0; }
.slip-text strong { display: block; font-size: clamp(21px, 1.9vw, 25px); font-weight: 650; line-height: 1.18; letter-spacing: -.034em; }
.slip-text > span { display: block; margin-top: 5px; color: var(--muted); font-size: 16px; line-height: 1.4; }
.pile.is-live .slip { will-change: transform; }
.pile.is-live .slip::before { height: calc(var(--slip-height) + (100% - var(--slip-height)) * var(--t, 1)); }
.pile.is-live .slip > :not(.slip-open) { transform: translateY(calc(var(--rise, 0px) * (1 - var(--t, 1)))); }
.pile.is-live .slip strong { transform: translateY(calc(var(--drop, 0px) * (1 - var(--t, 1)))); }
.pile.is-live .slip-text > span, .pile.is-live .slip-more { opacity: var(--show, 1); }
.pile.is-live .slip > .job-icon, .pile.is-live .slip > .slip-text { opacity: var(--top, 1); }
.pile.is-live .slip > .slip-tick { opacity: var(--show, 1); transform: translateY(calc(var(--rise, 0px) * (1 - var(--t, 1)))) scale(calc(.5 + .5 * var(--show, 1))); }

/* A handled job opens a small window that shows how it runs (only once the script says it can). */
.has-how .jobs-hint { display: block; margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: 0; }
.has-how .jobs-label { flex-wrap: wrap; }
.has-how .slip-more { display: grid; flex: 0 0 auto; color: #8a8d91; transition: color .2s, translate .25s var(--ease-out); }
.slip-more svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.has-how .slip-open { display: block; position: absolute; inset: 0; z-index: 1; width: 100%; padding: 0; border: 0; border-radius: 18px; background: transparent; }
.pile.is-live .slip:not(.is-handled) .slip-open { pointer-events: none; }
.slip::before { transition: border-color .2s, box-shadow .25s, background-color .2s; }
.slip:has(.slip-open:active)::before { background: #f8f4ea; }
@media (hover: hover) and (pointer: fine) {
  .slip:has(.slip-open:hover)::before { border-color: #4338ca; box-shadow: 0 0 0 1px #4338ca, 0 18px 32px -20px #4338ca73; }
  .slip:has(.slip-open:hover) .slip-more { color: var(--ink); translate: 3px 0; }
}

@media (max-width: 760px) {
  /* One column: the pile, then the list, then the count as the closing line. */
  .pile { grid-template-columns: 1fr; gap: 26px; }
  .pile-yours { display: contents; }
  .pile-mine { order: 2; }
  .pile-after { order: 3; margin-top: 4px; }
  .pile { --slip-height: 84px; }
  .slip { --tile: 48px; --side: 16px; gap: 14px; }
  .slip .job-icon { border-radius: 15px; }
}

/* ---- the small window: how one job runs ---- */
html:has(dialog.how[open]) { overflow: hidden; scrollbar-gutter: stable; }
.how { width: min(480px, calc(100% - 28px)); max-height: calc(100dvh - 28px); margin: auto; padding: 0; overflow: auto; border: 1px solid #e2ddd0; border-radius: 28px; color: var(--ink); background: #fffdf9; box-shadow: 0 40px 90px -30px #17191c8c; }
.how::backdrop { background: rgb(23 25 28 / 30%); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.how-body { position: relative; padding: clamp(22px, 5vw, 32px); }
.how-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: transparent; }
.how-close:hover { color: var(--ink); background: #17191c0f; }
.how-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.how-head { display: flex; align-items: center; gap: 16px; padding-right: 40px; }
.how-head .job-icon { width: 56px; height: 56px; border-radius: 17px; color: white; background: var(--ink); }
.how-head .job-icon svg { width: 28px; height: 28px; stroke-width: 1.8; }
.how-head h3 { margin-top: 3px; font-size: clamp(24px, 6.4vw, 30px); font-weight: 650; line-height: 1.12; letter-spacing: -.036em; }
.how-steps { --dot: 30px; --between: 20px; display: grid; gap: var(--between); margin: 26px 0 0; padding: 0; list-style: none; counter-reset: how-step; }
.how-steps li { position: relative; padding-left: calc(var(--dot) + 16px); counter-increment: how-step; }
.how-steps li::before { content: counter(how-step); position: absolute; z-index: 1; top: 0; left: 0; display: grid; place-items: center; width: var(--dot); height: var(--dot); border: 1.5px solid #cfc9ba; border-radius: 50%; background: #fffdf9; font-size: 13px; font-weight: 700; }
.how-steps li:nth-child(2)::before { border-color: var(--ink); color: white; background: var(--ink); }
.how-steps li:last-child::before { content: ""; border-color: #4338ca; background: #4338ca url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7'/%3E%3C/svg%3E") center / 16px no-repeat; }
/* The line from one step to the next, with a short stroke running down it: the job moving along by itself. */
.how-steps li:not(:last-child)::after { content: ""; position: absolute; top: var(--dot); bottom: calc(var(--between) * -1); left: calc(var(--dot) / 2 - 1px); width: 2px; background: linear-gradient(#4338ca, #4338ca) 0 -90% / 100% 45% no-repeat #e2ddd0; }
.how-steps span { display: block; padding-top: 1px; color: #4c5359; font-size: 12px; font-weight: 670; line-height: 1.45; letter-spacing: .038em; }
.how-steps p { margin-top: 2px; font-size: 18px; font-weight: 560; line-height: 1.36; letter-spacing: -.012em; }
.how-foot { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; line-height: 1.5; }
.how-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* The screen: the job being done. A clip, or for lead scoring a drawn sample that moves.
   Everything drawn inside is sized from the screen's own width (cqw), so it scales like a video. */
.how-screen { container-type: inline-size; position: relative; aspect-ratio: 16 / 10; margin-top: 20px; overflow: hidden; border: 1px solid #e2ddd0; border-radius: 20px; background: #f1ece2; }
.how-screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.how-screen-empty { display: grid; place-items: center; border: 1.5px dashed #c4bfb1; background: #f6f2e8; text-align: center; }
.how-screen-empty b { display: block; font-size: 16px; }
.how-screen-empty span { display: block; margin-top: 4px; color: var(--muted); font: 12px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; }
.how-screen + .how-rest .how-steps { margin-top: 22px; }
@media (min-width: 900px) {
  /* Room to watch: the screen on the left, the three steps beside it. */
  .how:has(.how-sheet:not([hidden]) .how-screen) { width: min(920px, calc(100% - 28px)); }
  .how-sheet:has(.how-screen) { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 32px; }
  .how-sheet:has(.how-screen) .how-screen { grid-column: 1; grid-row: 1 / 3; align-self: center; aspect-ratio: 4 / 3; margin-top: 0; }
  .how-sheet:has(.how-screen) .how-head { grid-column: 2; grid-row: 1; }
  .how-sheet:has(.how-screen) .how-rest { grid-column: 2; grid-row: 2; }
}
/* Only the chosen job's sheet shows. Written this strongly so it also beats the side-by-side layout above. */
.how .how-sheet[hidden] { display: none; }

/* Lead scoring, drawn: the leads come in, each gets a score, the list sorts itself. */
/* What every light drawn sample shares: the sheet it sits on and its top line (title, what is happening, "Sample"). */
.draw { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 2.6cqw; padding: 4.5cqw 5cqw; background: #fffdf9; opacity: var(--fade, 1); }
.score-demo { --row: 10cqw; --gap: 1.5cqw; }
.draw-top { display: flex; align-items: center; gap: 2cqw; font-size: 3.1cqw; line-height: 1.3; }
.draw-top b { font-weight: 680; }
.draw-top span { color: var(--muted); }
.draw-top i { margin-left: auto; padding: .5cqw 1.8cqw; border: 1px solid #d5d3cb; border-radius: var(--pill); color: #4c5359; font-size: 2.5cqw; font-style: normal; font-weight: 650; letter-spacing: .04em; }
.score-rows { display: grid; gap: var(--gap); margin: 0; padding: 0; list-style: none; }
.score-rows li { display: grid; grid-template-columns: auto minmax(0, 1fr) 24cqw 8cqw; align-items: center; gap: 2.6cqw; height: var(--row); padding: 0 2.6cqw; border: 1px solid #e6e1d5; border-radius: 2.6cqw; background: white; transform: translateY(calc((var(--slot, var(--i)) - var(--i)) * (var(--row) + var(--gap)))); transition: border-color .25s, box-shadow .25s; }
.score-face { display: grid; place-items: center; width: 6.4cqw; height: 6.4cqw; border-radius: 50%; color: #3a34a8; background: #ece9f8; font-size: 2.5cqw; font-weight: 700; }
.score-who { display: flex; align-items: center; gap: 1.8cqw; min-width: 0; font-size: 3.7cqw; font-weight: 640; letter-spacing: -.02em; white-space: nowrap; }
.score-who em { padding: .45cqw 1.7cqw; border-radius: var(--pill); color: white; background: #4338ca; font-size: 2.5cqw; font-style: normal; font-weight: 700; letter-spacing: 0; opacity: 0; transform: scale(.6); transition: opacity .25s, transform .3s cubic-bezier(.23, 1, .32, 1); }
.score-meter { height: 1.7cqw; overflow: hidden; border-radius: var(--pill); background: #ebe7dc; }
.score-meter span { display: block; height: 100%; border-radius: inherit; background: #9d97ea; transform: scaleX(var(--fill, calc(var(--score) / 100))); transform-origin: left; transition: background-color .25s; }
.score-num { font-size: 4.2cqw; font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -.03em; text-align: right; }
/* The lead to call first: the top row when nothing moves, or the row the script marks once the list has sorted. */
.score-demo:not(.is-live) li:first-child, .score-rows li.is-first { border-color: #4338ca; box-shadow: 0 0 0 .5cqw #4338ca24; }
.score-demo:not(.is-live) li:first-child em, .score-rows li.is-first em { opacity: 1; transform: none; }
.score-demo:not(.is-live) li:first-child .score-meter span, .score-rows li.is-first .score-meter span { background: #4338ca; }

/* ---- four more drawn samples. Each part is "on" (.is-on) from its moment in the loop, and some are
   lit only for a while (.is-now). The plain rules are the finished picture; the .is-live rules are
   how a part looks before its moment. ---- */
.draw-label { margin-bottom: 1.4cqw; color: var(--muted); font-size: 2.4cqw; font-weight: 600; line-height: 1.3; }
.draw ul { margin: 0; padding: 0; list-style: none; }
.draw em { font-style: normal; }

/* Lead follow-up: every new lead gets a reply, then follow-ups, by itself. */
.follow-demo { --columns: minmax(0, 1fr) 13cqw 13cqw 13cqw; }
.follow-head, .follow-row { display: grid; grid-template-columns: var(--columns); align-items: center; padding: 0 2.6cqw; }
.follow-head { margin-bottom: -1.2cqw; color: var(--muted); font-size: 2.4cqw; font-weight: 600; line-height: 1.3; text-align: center; }
.follow-rows { display: grid; gap: 1.5cqw; }
.follow-row { height: 10cqw; border: 1px solid #e6e1d5; border-radius: 2.6cqw; background: white; transition: opacity .35s, transform .45s cubic-bezier(.23, 1, .32, 1); }
.follow-lead { display: flex; align-items: center; gap: 2.4cqw; font-size: 3.7cqw; font-weight: 640; letter-spacing: -.02em; }
.follow-dot { justify-self: center; width: 5.2cqw; height: 5.2cqw; border-radius: 50%; background: #4338ca url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7'/%3E%3C/svg%3E") center / 62% no-repeat; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1), background-color .2s; }
.is-live .follow-row:not(.is-on) { opacity: 0; transform: translateX(-4cqw); }
.is-live .follow-dot:not(.is-on) { background: #ebe7dc; transform: scale(.5); }

/* Monday briefing: Friday's updates on the left become the briefing on the right. */
.brief-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.32fr); align-items: center; gap: 3.4cqw; }
.brief-notes { display: grid; gap: 1.4cqw; }
.brief-note { display: grid; gap: 1.3cqw; padding: 2.1cqw 2.4cqw; border: 1px solid #e6e1d5; border-radius: 2.2cqw; background: white; font-size: 3.1cqw; font-weight: 640; line-height: 1.2; letter-spacing: -.02em; transition: opacity .3s, transform .4s cubic-bezier(.23, 1, .32, 1), border-color .25s, box-shadow .25s; }
.brief-note i, .brief-line i { display: block; height: 1.3cqw; border-radius: var(--pill); background: #e4dfd3; }
.brief-note i { width: 82%; }
.brief-note.is-now { border-color: #4338ca; box-shadow: 0 0 0 .5cqw #4338ca24; }
.brief-sheet { position: relative; padding: 2.6cqw 3.2cqw 2.8cqw; border: 1px solid #e2ddd0; border-radius: 2.6cqw; background: white; box-shadow: 0 2.4cqw 5cqw -3cqw #425a7280; }
.brief-title b { font: 500 3.7cqw/1.15 Georgia, Cambria, serif; letter-spacing: -.03em; white-space: nowrap; }
.brief-title em { position: absolute; top: -1.9cqw; right: 2.4cqw; padding: .5cqw 1.7cqw; border-radius: var(--pill); color: white; background: #4338ca; font-size: 2.3cqw; font-weight: 700; white-space: nowrap; transition: opacity .25s, transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.brief-line { display: grid; gap: 1cqw; margin-top: 1.8cqw; padding-top: 1.8cqw; border-top: 1px solid #ebe7dc; }
.brief-line b { color: #256f64; font-size: 2.6cqw; line-height: 1.2; transition: opacity .25s; }
.brief-line i { height: 1.1cqw; }
.brief-line i { transform-origin: left; transition: transform .6s cubic-bezier(.23, 1, .32, 1); }
.brief-line i:last-child { width: 68%; transition-delay: .18s; }
.is-live .brief-note:not(.is-on) { opacity: 0; transform: translateY(2cqw); }
.is-live .brief-title em:not(.is-on) { opacity: 0; transform: scale(.6); }
.is-live .brief-line:not(.is-on) b { opacity: 0; }
.is-live .brief-line:not(.is-on) i { transform: scaleX(0); transition-delay: 0s; }

/* Agent onboarding: the week runs along the top; each step is sent on its day. */
.week-days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.2cqw; }
.week-days b { display: grid; place-items: center; height: 5.6cqw; border-radius: 1.6cqw; color: white; background: #4338ca; font-size: 2.6cqw; font-weight: 650; transition: color .25s, background-color .25s; }
.week-tasks { display: grid; gap: 1.4cqw; }
.week-task { display: grid; grid-template-columns: 8.5cqw minmax(0, 1fr) auto; align-items: center; gap: 2.4cqw; height: 9.8cqw; padding: 0 2.6cqw; border: 1px solid #e6e1d5; border-radius: 2.6cqw; background: white; transition: border-color .25s, box-shadow .25s; }
.week-task.is-now { border-color: #4338ca; box-shadow: 0 0 0 .5cqw #4338ca24; }
.week-day { display: grid; place-items: center; height: 5cqw; border-radius: 1.4cqw; color: #3a34a8; background: #ece9f8; font-size: 2.4cqw; font-weight: 700; }
.week-what { display: grid; gap: .3cqw; min-width: 0; }
.week-what b { overflow: hidden; font-size: 3.2cqw; font-weight: 640; line-height: 1.2; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.week-what i { color: var(--muted); font-size: 2.5cqw; font-style: normal; line-height: 1.2; }
.week-task em { padding: .6cqw 1.9cqw; border-radius: var(--pill); color: #256f64; background: #e2f1ee; font-size: 2.4cqw; font-weight: 700; transition: opacity .25s, transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.is-live .week-days b:not(.is-on) { color: #6a6f77; background: #ebe7dc; }
.is-live .week-days b.is-now { color: white; background: var(--ink); }
.is-live .week-task em:not(.is-on) { opacity: 0; transform: scale(.6); }

/* Listing file checks: each line is checked; what is fine fades back and the gaps stay. */
.file-rows { display: grid; gap: 1.5cqw; }
.file-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2.4cqw; height: 10cqw; padding: 0 2.8cqw; border: 1px solid #e6e1d5; border-radius: 2.6cqw; background: white; font-size: 3.6cqw; letter-spacing: -.02em; transition: opacity .4s, border-color .25s, box-shadow .25s; }
.file-row b { font-weight: 640; }
.file-row.is-fine { opacity: .45; }
.file-row.is-now { border-color: #4338ca; box-shadow: 0 0 0 .5cqw #4338ca24; }
.file-row.is-now::after { content: ""; width: 2.6cqw; height: 2.6cqw; margin-right: 1.4cqw; border-radius: 50%; background: #4338ca; }
.file-row em { padding: .6cqw 1.9cqw; border-radius: var(--pill); font-size: 2.5cqw; font-weight: 700; letter-spacing: 0; transition: opacity .25s, transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.file-row.is-gap em { color: #a2401d; background: #fbe6dc; }
.file-row.is-fine em { color: #256f64; background: #e2f1ee; }
.file-sum { display: flex; align-items: center; gap: 1.6cqw; padding: 2.3cqw 2.8cqw; border-radius: 2.6cqw; color: white; background: var(--ink); font-size: 3cqw; line-height: 1.3; transition: opacity .35s, transform .45s cubic-bezier(.23, 1, .32, 1); }
.file-sum b { font-weight: 700; }
.is-live .file-row.is-fine:not(.is-on) { opacity: 1; }
.is-live .file-row em:not(.is-on) { display: none; }
.is-live .file-sum:not(.is-on) { opacity: 0; transform: translateY(2cqw); }

/* Video editing, drawn: a dark editing screen. The pauses are cut out, B-roll, captions and sound go on,
   then the finished film plays. Without the script it shows the finished edit. */
.edit-demo { --lane: 3.1cqw; --names: 5cqw; position: absolute; inset: 0; display: flex; flex-direction: column; gap: 2.4cqw; padding: 3.6cqw 4cqw; color: #e9e9ec; background: #1b1c20; opacity: var(--fade, 1); }
.edit-top { display: flex; align-items: center; gap: 1.6cqw; font-size: 2.9cqw; font-weight: 600; line-height: 1.3; }
.edit-top::before { content: ""; flex: 0 0 auto; width: 1.7cqw; height: 1.7cqw; border-radius: 50%; background: #8f86ff; }
.edit-top i { margin-left: auto; padding: .5cqw 1.8cqw; border: 1px solid #ffffff40; border-radius: var(--pill); color: #c9cad1; font-size: 2.5cqw; font-style: normal; font-weight: 650; letter-spacing: .04em; }
.edit-main { flex: 1 1 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4.5cqw; min-height: 0; }
/* The viewer: an upright frame, like the finished films. */
.edit-viewer { position: relative; height: min(100%, 34cqw); aspect-ratio: 9 / 16; overflow: hidden; border-radius: 1.6cqw; background: linear-gradient(160deg, #7468e0, #2b2f6b); }
.edit-viewer::before, .edit-viewer::after { content: ""; position: absolute; left: 50%; background: #ffffff38; translate: -50% 0; }
.edit-viewer::before { top: 24%; width: 34%; aspect-ratio: 1; border-radius: 50%; }
.edit-viewer::after { top: 48%; width: 72%; height: 60%; border-radius: 40% 40% 0 0; }
.edit-viewer.is-broll { background: linear-gradient(160deg, #46b3a6, #1d4c54); }
.edit-viewer.is-broll::before, .edit-viewer.is-broll::after { opacity: 0; }
.edit-viewer span { position: absolute; z-index: 1; right: 12%; bottom: 12%; left: 12%; height: 7%; border-radius: var(--pill); background: white; opacity: var(--caption, 1); transition: opacity .2s; }
.edit-steps { display: grid; gap: 1.5cqw; margin: 0; padding: 0; list-style: none; font-size: 3.4cqw; font-weight: 600; line-height: 1.25; }
.edit-steps li { display: flex; align-items: center; gap: 2cqw; color: #d6d7dd; }
.edit-steps li::before { content: ""; flex: 0 0 auto; width: 3.8cqw; height: 3.8cqw; border: .35cqw solid #8f86ff; border-radius: 50%; background: #8f86ff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b1c20' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7'/%3E%3C/svg%3E") center / 70% no-repeat; }
.edit-steps li[data-state="wait"] { color: #7f818c; }
.edit-steps li[data-state="wait"]::before { border-color: #ffffff3d; background: none; }
.edit-steps li[data-state="now"] { color: white; }
.edit-steps li[data-state="now"]::before { background: none; }
.edit-lanes { position: relative; display: grid; gap: .7cqw; }
.edit-lane { display: grid; grid-template-columns: var(--names) minmax(0, 1fr); align-items: center; height: var(--lane); }
.edit-lane b { color: #7d7f8a; font-size: 2.1cqw; font-weight: 600; }
.edit-track { position: relative; height: 100%; overflow: hidden; border-radius: .6cqw; background: #27282e; }
.edit-clip { position: absolute; top: 0; bottom: 0; left: calc(var(--x) * 1%); width: calc(var(--w) * 1%); border-right: .3cqw solid #27282e; border-radius: .6cqw; }
.edit-pause { border-right-width: 0; } /* a cut pause leaves nothing behind, not even its edge */
.edit-picture { background: color-mix(in srgb, #d0555c calc(var(--mark, 0) * 100%), #4f79b8); }
.edit-voice { background: repeating-linear-gradient(90deg, #ffffff38 0 .35cqw, transparent .35cqw .95cqw) color-mix(in srgb, #d0555c calc(var(--mark, 0) * 100%), #3f9b6c); }
.edit-broll { background: #8f86ff; opacity: var(--in, 1); transform: translateY(calc((1 - var(--in, 1)) * -110%)); }
.edit-caption { background: #d9a441; opacity: var(--in, 1); transform: scaleX(var(--in, 1)); transform-origin: left; }
.edit-music { background: repeating-linear-gradient(90deg, #ffffff2b 0 .25cqw, transparent .25cqw .7cqw) #2f8f83; transform: scaleX(var(--music, 1)); transform-origin: left; }
/* The playhead: the red line that runs along the finished film. */
.edit-head { position: absolute; top: -1cqw; bottom: -1cqw; left: calc(var(--names) + (100% - var(--names)) * var(--head, 0) / 100); width: .4cqw; border-radius: var(--pill); background: #ff5d5d; }

@media (prefers-reduced-motion: no-preference) {
  .edit-demo.is-working .edit-top::before, .edit-steps li[data-state="now"]::before, .file-row.is-now::after { animation: edit-pulse 1s ease-in-out infinite; }
  .how[open] { animation: how-in .32s cubic-bezier(.23, 1, .32, 1) both; }
  .how[open]::backdrop { animation: how-fade .25s ease-out both; }
  .how[open] .how-steps li:not(:last-child)::after { animation: how-flow 1.7s .35s linear infinite; }
  .how[open] .how-steps li:nth-child(2)::after { animation-delay: 1.2s; }
}
@keyframes edit-pulse { 50% { opacity: .35; } }
@keyframes how-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes how-fade { from { opacity: 0; } }
@keyframes how-flow { to { background-position: 0 190%; } }
/* ---- A small preview that follows the mouse (peek() in the script). It is only a picture: it takes no
   clicks, is hidden from screen readers, and never shows without a mouse. ---- */
.peek { position: fixed; z-index: 20; top: 0; left: 0; width: min(340px, calc(100vw - 24px)); pointer-events: none; opacity: 0; visibility: hidden; filter: drop-shadow(0 20px 26px #17191c3d); transition: opacity .16s, visibility 0s .16s; will-change: transform; }
.peek.is-on { opacity: 1; visibility: visible; transition: opacity .12s; }
.peek-frame { overflow: hidden; border-radius: 18px; background: #fffdf9; clip-path: inset(0 0 100% round 18px); transition: clip-path .32s var(--ease-out); }
.peek.is-on .peek-frame { clip-path: inset(0 round 18px); }
.peek .how-screen { margin: 0; border: 0; border-radius: 0; aspect-ratio: 16 / 10; }
