/* Hero film. The text sits at the top left. Martín, a little smaller, fills the right. The story cards appear one under
   another in a column right of the text (never touching it): the current card opens, and when its
   part is done it closes to its title with a check and stays. The daily is the one big moment:
   the call window grows from its card and takes the right side, where he is, over the dimmed
   cards (never the text), and his picture goes dark until he leaves the call.
   v7: after the merge, Sarah's message stays under the cards, and a last line under the buttons
   points to Book a call. No checklist under the text: the cards carry the checks.
   The script measures his head and the text and places the column between them.
   Up to 1239 px everything flows below the text. */

.hero:has(.film) {
  --glass: rgba(14, 15, 18, .72);
  --ring: rgba(255, 255, 255, .12);
  --sarah: #4f93ff;
  --pad: 14px;
}

/* ---------- text at the top, checks under the buttons ---------- */
@media (min-width: 1240px) {
  /* a little shorter than the screen: the next band (the deal: $0 up front, 3–5 days…) shows at the
     bottom of the first screen, so it reads as a page that goes on */
  .hero:has(.film) { height: max(580px, calc(100svh - clamp(96px, 12.5svh, 124px))); }
  .hero:has(.film) .hero-in { bottom: auto; top: calc(var(--nav-h) + clamp(32px, 12.5svh, 150px)); }
  .hero:has(.film) .hero-shade {
    background:
      linear-gradient(90deg, rgba(0,0,0,.86) 0%, rgba(0,0,0,.6) 34%, rgba(0,0,0,.14) 60%, rgba(0,0,0,0) 78%),
      linear-gradient(0deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 34%),
      linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 28%);
  }
  /* Martín a little smaller: the picture rests bottom right and fades into the black at its edges */
  .hero:has(.film) .hero-video.is-film {
    position: absolute; left: auto; top: auto; right: 0; bottom: 0; margin: 0;
    width: 90%; height: 92%;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16%), linear-gradient(180deg, transparent 0, #000 12%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent 0, #000 16%), linear-gradient(180deg, transparent 0, #000 12%);
    mask-composite: intersect;
  }
}
/* the last line of the story: the next step is the visitor's, and it goes to the same Book a call */
.film-next {
  display: block; width: fit-content; margin-top: 22px;
  font-size: 15px; font-weight: 500; color: var(--white); text-decoration: none; opacity: 0;
}
.film-next svg { display: inline-block; vertical-align: -3px; margin-left: 8px; width: 16px; height: 16px; max-width: none; fill: none; stroke: var(--orange); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s; }
.film-next:hover { text-decoration: underline; text-underline-offset: 4px; }
.film-next:hover svg { transform: translateX(3px); }
.film-next:focus-visible { outline: 2px solid var(--white); outline-offset: 4px; border-radius: 4px; }
.film-next.is-still { opacity: 1; }

/* ---------- the film layer ---------- */
.film {
  position: absolute; inset: 0; pointer-events: none;
  font-family: var(--f-text); font-size: 13px; line-height: 1.35; color: var(--white);
  will-change: transform;
}
.film > *, .film-col > * { pointer-events: auto; }

/* the column: placed by the script between the text and his head */
.film-col {
  position: absolute; left: var(--col-x, 55%); top: var(--col-y, 20%); width: var(--col-w, 280px);
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.fcard {
  border-radius: 14px; overflow: hidden;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 0 0 1px var(--ring), 0 24px 50px -28px rgba(0, 0, 0, .8);
  transition: box-shadow .4s;
}
.fcard.is-on { box-shadow: 0 0 0 1px rgba(236, 98, 25, .55), 0 0 0 5px rgba(236, 98, 25, .1), 0 24px 50px -28px rgba(0, 0, 0, .8); }
.fc-tag { padding: 11px var(--pad) 12px 13px; box-shadow: inset 3px 0 0 var(--orange), 0 0 0 1px var(--ring), 0 24px 50px -28px rgba(0, 0, 0, .8); }
.fc-name { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.film-on { width: 7px; height: 7px; border-radius: 50%; background: var(--run); box-shadow: 0 0 0 4px rgba(43, 182, 115, .18); }
.fc-role { margin-top: 2px; font-weight: 500; }
.fc-sub { color: rgba(255, 255, 255, .7); font-size: 12.5px; }

.fc-head {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 44px; padding: 0 12px 0 var(--pad);
  border: 0; background: none; color: inherit; font: 500 13px/1.2 var(--f-text); text-align: left; cursor: pointer;
}
.fc-head > span:first-of-type { flex: 1; }
.fc-head:focus-visible { outline: 2px solid var(--white); outline-offset: -3px; border-radius: 14px; }
.fc-body { height: 0; overflow: hidden; }
.fc-in { padding: 0 var(--pad) var(--pad); }
.fst-ico { flex: none; width: 16px; height: 16px; max-width: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.fst-state { display: grid; place-items: center; flex: none; width: 18px; height: 18px; }
.fst-state > * { grid-area: 1 / 1; opacity: 0; }
.fst-live { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); }
.fst-ok { width: 18px; height: 18px; max-width: none; border-radius: 50%; background: var(--run); }
.fst-ok path, .tick path { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.tick { flex: none; position: relative; width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.tick svg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; border-radius: 50%; background: var(--run); }
.fc-list, .work-pr { list-style: none; display: grid; gap: 8px; }
.fc-list li, .work-pr li { position: relative; display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: rgba(255, 255, 255, .92); }

/* Sarah's message after the merge: the result the buyer pays for, in the team's chat (blue = Sarah) */
.fc-msg { display: flex; align-items: flex-start; gap: 10px; padding: 11px var(--pad) 12px 12px; box-shadow: inset 3px 0 0 var(--sarah), 0 0 0 1px var(--ring), 0 24px 50px -28px rgba(0, 0, 0, .8); }
.fc-msg .face { flex: none; }
.fc-msg-who { font-size: 12px; color: rgba(255, 255, 255, .62); }
.fc-msg-who b { color: var(--white); font-weight: 600; }
.fc-msg-text { margin-top: 2px; font-size: 13px; line-height: 1.35; }

/* daily: the faces of the call, his own joins last */
.faces { display: flex; gap: 6px; }
.face { width: 28px; height: 28px; border-radius: 50%; background: #2a2c31 center / cover; }
.face.is-ours { box-shadow: 0 0 0 2px var(--orange); }

/* the work: ticket, code typing, then the PR in the same place */
.work-top { display: flex; align-items: center; gap: 8px; }
.work-id { font-family: var(--f-code); font-size: 12px; color: var(--mute-d); }
.pill { padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.pill-todo { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .78); }
.pill-doing { background: var(--orange-soft); color: #ff9e68; }
.pill-review { background: rgba(79, 147, 255, .16); color: #8db8ff; }
.pill-merged { background: rgba(43, 182, 115, .16); color: #5fd6a0; }
.work-title { margin-top: 7px; font-weight: 500; line-height: 1.3; }
.work-views { display: grid; margin-top: 10px; }
.work-views > * { grid-area: 1 / 1; min-width: 0; }
.work-code {
  font-family: var(--f-code); font-size: 10.5px; line-height: 1.7; color: #d9dce2; white-space: pre; overflow: hidden;
  padding: 10px 11px; border-radius: 8px; background: rgba(0, 0, 0, .34);
}
.work-code .k { color: #7ea8ff; }
.work-code .f { color: #fff; }
.work-code .caret { display: inline-block; width: 6px; height: 1.1em; margin-bottom: -.2em; background: #fff; }
.work-pr { align-content: start; opacity: 0; }
.work-pr .tick.is-run { background: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .16); }
.work-pr .spin { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: #e2a548; border-right-color: #e2a548; opacity: 0; }
.approve { position: absolute; right: 0; top: 50%; translate: 0 -50%; padding: 4px 11px; border-radius: 7px; font-size: 11.5px; font-weight: 600; background: var(--white); color: #111; opacity: 0; }
/* two values in one place: the next fades in over the previous */
.swap { display: inline-grid; vertical-align: bottom; }
.swap > * { grid-area: 1 / 1; white-space: nowrap; justify-self: start; }
.swap > * + * { opacity: 0; }

/* ---------- the daily call: grows out of its card ---------- */
.call-win {
  position: absolute; z-index: 2; left: var(--call-x, 50%); top: var(--call-y, 30%); width: var(--call-w, 600px);
  padding: 0 12px 12px; border-radius: 16px; visibility: hidden; opacity: 0; transform-origin: 0 0;
  background: rgba(14, 15, 18, .9);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 0 0 1px var(--ring), 0 40px 90px -30px rgba(0, 0, 0, .9);
}
.cw-bar { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 2px; font-weight: 500; }
.cw-live { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--orange-soft); color: #ff9e68; }
.cw-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* while he is in the call his picture goes fully dark: only the call is seen */
.hero-veil { position: absolute; inset: 0; pointer-events: none; background: #000; opacity: 0; }
.call-grid { position: relative; aspect-ratio: 808 / 304; border-radius: 8px; overflow: hidden; background: #0e0f12; container-type: inline-size; }
.call-grid video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.city {
  position: absolute; left: calc(var(--c) * 33.663% + 1.6%); bottom: calc((1 - var(--r)) * 51.3% + 3.5%);
  max-width: 31.5%; padding: .2em .5em; border-radius: 5px; font-size: clamp(7.5px, 2.35cqw, 10.5px); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(8, 9, 11, .66); color: #fff;
}
.city.is-ours { background: var(--orange); }
/* his seat in the call stays empty until his own picture lands in it (the grid video has someone else there) */
.ba-wait { position: absolute; left: 67.327%; top: 51.316%; width: 32.673%; height: 48.684%; display: grid; place-items: center; border-radius: 6px; background: #17181c; color: rgba(255, 255, 255, .45); font-size: clamp(8px, 2.2cqw, 11px); }
.mirror { position: absolute; left: 67.327%; top: 51.316%; width: 32.673%; height: 48.684%; border-radius: 6px; opacity: 0; }
.ours-ring { position: absolute; left: 67.327%; top: 51.316%; width: 32.673%; height: 48.684%; border-radius: 6px; box-shadow: inset 0 0 0 2px var(--orange); opacity: 0; }
.mirror-fly { position: absolute; left: 0; top: 0; z-index: 3; width: 10px; height: 10px; border-radius: 10px; visibility: hidden; pointer-events: none; box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .9); }

/* ---------- the cursors ---------- */
.cur { position: absolute; left: 0; top: 0; z-index: 4; display: flex; align-items: flex-start; pointer-events: none; opacity: 0; will-change: transform; }
.cur svg { flex: none; width: 20px; height: 22px; max-width: none; margin: -2px -3px 0 -3px; filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .45)); transform-origin: 4px 3px; }
.cur span { flex: none; margin-top: 15px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; color: #fff; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .6); }
.cur i { position: absolute; left: -11px; top: -11px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; }
/* Martín's pointer comes from the left and carries his name outside the card it clicks */
.cur-m { color: var(--orange); flex-direction: row-reverse; width: 0; }
.cur-m svg { margin: -2px -17px 0 -3px; transform-origin: 16px 3px; }
.cur-m span { background: var(--orange); }
.cur-s { color: var(--sarah); }
.cur-s span { background: var(--blue); }

.hero-video.is-film { object-position: 72% 34%; }

/* without scripts or with reduced motion: the finished day, nothing moving */
.film.is-still .fst-ok,
.film.is-still .tick svg { opacity: 1; transform: none; }
.film.is-still .work-code,
.film.is-still .approve,
.film.is-still .cur,
.film.is-still .call-win,
.film.is-still .mirror-fly { display: none; }
.film.is-still .swap > :not(:last-child) { display: none; }
.film.is-still .swap > :last-child { opacity: 1; }

/* small laptops (1001–1239 px): there is no room for a column between the text and his head,
   so the hero flows like on tablets: picture, text, then the cards below */
@media (min-width: 1001px) and (max-width: 1239px) {
  .hero:has(.film) { height: auto; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding: calc(var(--nav-h) + 26svh) var(--side) 40px; }
  .hero:has(.film) .hero-in { position: relative; left: auto; right: auto; bottom: auto; top: auto; width: 100%; max-width: 640px; }
  .hero:has(.film) .hero-shade { background: linear-gradient(0deg, rgba(0,0,0,.92) 0%, rgba(0,0,0,.6) 48%, rgba(0,0,0,.1) 78%), linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,0) 24%); }
}
@media (min-width: 1600px) {
  .film { font-size: 14px; }
  .fc-head { font-size: 14px; height: 48px; }
  .fc-name { font-size: 16px; }
  .fc-list li, .work-pr li, .fc-sub, .fc-msg-text { font-size: 13.5px; }
  .fc-msg-who { font-size: 12.5px; }
  .work-code { font-size: 11.5px; }
}

/* ---------- in flow: small laptops, tablets and phones ---------- */
@media (max-width: 1239px) {
  .film { position: relative; inset: auto; margin-top: 22px; width: 100%; max-width: 520px; }
  .film-col { position: static; width: auto; }
  .call-win { position: relative; left: auto; top: auto; width: auto; margin-top: 10px; overflow: hidden; }
  .film-next { overflow: hidden; }
  .cur { display: none; }
  .hero-video.is-film { object-position: 86% 30%; }
}
@media (max-width: 640px) {
  .hero:has(.film) .hero-media {
    bottom: auto; height: 62svh;
    -webkit-mask-image: linear-gradient(#000 62%, transparent);
    mask-image: linear-gradient(#000 62%, transparent);
  }
  .hero-video.is-film { object-position: 100% 0; }
}

/* ---------- phones: the film, the text and the button ----------
   The story cards make sense beside the film. Stacked under the button, on black, they read as loose boxes
   (Alan, 2026-11-19), so a phone gets the film alone; the last line goes with them, since it speaks of the
   story. */
@media (max-width: 640px) {
  .film,
  .film-next { display: none; }
}
