/* Group "how": the How it works page (/how-it-works).
   Refines the shared patterns in site.css and pages.css. Everything drawn
   here mirrors a real screen: the video page's editing steps, the upload
   form's file list and "look" step, the versions in the video chat and the
   files you download. Tokens only; the one fixed colour is the sample brand
   swatch, which shows the value written beside it. */

/* ================================================================ shared */
.how-flush { margin-bottom: 0; }
/* The closing box is always dark, so its timecode needs the light grey (beats .tc b). */
.tc b.how-tc-dim { color: var(--ink-400); }
/* A jump from the chapters or a menu lands with the band right under the header. */
.how-anchor { scroll-margin-top: var(--header-h); }

/* ============================================================ hero */
.how-hero { padding-bottom: clamp(2rem, 1rem + 3vw, 3.5rem); }

/* The video page while it edits: a real frame beside the editing steps,
   with the same labels and states the job page shows. */
.how-job { width: 100%; max-width: 32rem; }
.how-job__body { display: grid; grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr); gap: var(--space-5); align-items: center; padding: var(--space-5); }
.how-job__frame { width: 100%; max-height: none; box-shadow: var(--shadow-md); }
.how-job__side { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.how-job__title { font-family: var(--font-display); font-weight: var(--font-bold); font-size: var(--text-base); letter-spacing: -0.01em; color: var(--text-strong); }
.how-job .stg { min-height: 2.25rem; gap: var(--space-2); }
.how-job .stg + .stg::before { top: -0.625rem; height: 0.875rem; }
.how-job .stg__label { min-width: 0; line-height: 1.3; }
.how-job__eta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-3); padding-top: var(--space-3);
  border-top: var(--border-w) solid var(--border); font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-subtle); }
.how-job__eta span:last-child { color: var(--accent-text); }
/* Small laptops: the window gets a little more of the hero and the steps
   most of the window, so no step name breaks beside its state and the two
   hero buttons still share a row. */
@media (min-width: 1024px) and (max-width: 1279px) {
  .how-hero .phero__grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: var(--space-10); }
  .how-job__body { grid-template-columns: minmax(0, 0.56fr) minmax(0, 1.44fr); gap: var(--space-4); }
  .how-job .stg { font-size: var(--text-xs); }
}
@media (max-width: 479px) {
  .how-job__body { grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr); gap: var(--space-4); padding: var(--space-4); align-items: start; }
  .how-job .stg { min-height: 2rem; font-size: var(--text-xs); }
  .how-job .stg__state { display: none; }
  .how-job .stg + .stg::before { top: -0.5rem; height: 0.75rem; }
}

/* Chapters: the page's five parts as marks on a timeline. The top rule is
   the scrubber; the part you point at fills in blue. Phones scroll it
   sideways like a video's chapter list. */
.how-chapters { margin-top: clamp(2.5rem, 1.5rem + 3vw, 4rem); }
.how-chapters ol { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 2px solid var(--border); }
.how-chapters li { position: relative; min-width: 0; }
.how-chapters li::before { content: ""; position: absolute; left: 0; top: -0.5rem; width: 2px; height: 0.875rem; border-radius: 1px; background: var(--border-strong); }
.how-chapters a { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 0.15rem; min-height: 3.75rem;
  padding: var(--space-3) var(--space-4) var(--space-2) var(--space-3); color: var(--text-muted); font-weight: var(--font-medium); font-size: var(--text-sm);
  transition: color var(--duration-instant) var(--ease-default); }
.how-chapters a b { font-family: var(--font-mono); font-size: var(--text-2xs); font-weight: var(--font-medium); letter-spacing: var(--tracking-caps); color: var(--text-subtle); }
.how-chapters a::after { content: ""; position: absolute; left: 0; right: var(--space-2); top: -2px; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform var(--duration-fast) var(--ease-default); }
.how-chapters a:hover, .how-chapters a:focus-visible { color: var(--text-strong); }
.how-chapters a:hover b, .how-chapters a:focus-visible b { color: var(--cut-text); }
.how-chapters a:hover::after, .how-chapters a:focus-visible::after { transform: scaleX(1); }
.how-chapters a:focus-visible { outline: var(--border-w-thick) solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }
@media (max-width: 767px) {
  .how-chapters { margin-inline: calc(-1 * var(--gutter)); overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); scrollbar-width: none;
    padding-top: 0.5rem; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .how-chapters::-webkit-scrollbar { display: none; }
  .how-chapters ol { display: flex; width: max-content; min-width: 100%; padding-inline: var(--gutter); border-top: 0; }
  .how-chapters li { flex: none; width: 8.5rem; scroll-snap-align: start; border-top: 2px solid var(--border); }
  .how-chapters li:last-child { width: calc(8.5rem + var(--space-8)); padding-right: var(--space-8); }
}
@media (prefers-reduced-motion: reduce) { .how-chapters a::after { transition: none; } }

/* ============================================================ the steps */
.how-who { align-self: flex-start; }
/* Phones: the drawing gets the card's full width, under the words. */
@media (max-width: 559px) { .step2 .step2__art { grid-column: 1 / -1; } }
/* Small laptops: two columns would squeeze each drawing to a sliver, so the
   heading sits on top and the steps get the full width, as on a tablet. */
@media (min-width: 1024px) and (max-width: 1279px) {
  .how-steps.steps2 { grid-template-columns: minmax(0, 1fr); gap: var(--space-10); }
  .how-steps .steps2__head { position: static; }
}
.step2 .step2__body .how-who + h3 { margin-top: var(--space-1); }

/* Step 1: the upload's file list, each file with the role it was given. */
.how-files, .how-outs { display: flex; flex-direction: column; gap: 6px; }
.how-file, .how-out { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); min-height: 2.5rem;
  padding: 0.4rem 0.75rem; border: var(--border-w) solid var(--border); border-radius: var(--radius-md); background: var(--bg-subtle); font-size: var(--text-sm); }
.how-file svg, .how-out svg { color: var(--accent-text); }
.how-file b, .how-out b { font-weight: var(--font-medium); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.how-file em { font-style: normal; font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-subtle); padding: 0.1rem 0.5rem;
  border: var(--border-w) solid var(--border); border-radius: var(--radius-full); background: var(--surface); }

/* Step 2: the step under way. */
.how-work { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border-radius: var(--radius-md); background: var(--bg-subtle);
  border: var(--border-w) solid var(--border); }
.how-work__now { margin-top: var(--space-1); font-size: var(--text-sm); font-weight: var(--font-semibold); color: var(--text-strong); }
.how-work__meta { font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-subtle); }

/* Step 3: one change in the video's chat, and the versions it made. */
.how-chat { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border-radius: var(--radius-md); background: var(--bg-subtle);
  border: var(--border-w) solid var(--border); }
.how-chat .bub { max-width: 92%; }
.how-chat__vers { display: flex; gap: 6px; margin-top: var(--space-1); }
.how-chat__vers i { font-style: normal; font-family: var(--font-mono); font-size: var(--text-2xs); padding: 0.2rem 0.6rem; border-radius: var(--radius-full);
  border: var(--border-w) solid var(--border); color: var(--text-muted); background: var(--surface); }
.how-chat__vers i.is-on { border-color: var(--accent); background: var(--accent-subtle); color: var(--accent-text); }

/* Step 4: what you download, each file drawn in its shape. */
.how-out__shape { display: block; width: 0.75rem; height: 1.2rem; margin-inline: 0.25rem; border: 2px solid var(--text-subtle); border-radius: 3px; }
.how-out__shape--wide { width: 1.25rem; height: 0.8rem; margin-inline: 0; }

/* ======================================================= make it yours */
.how-note { display: flex; gap: var(--space-4); align-items: flex-start; margin-top: var(--space-2); padding: var(--space-4) var(--space-5);
  border: var(--border-w) solid var(--border); border-radius: var(--radius-lg); background: var(--surface); max-width: 34rem; }
.how-note p { font-size: var(--text-sm); line-height: 1.55; color: var(--text-muted); }
.how-note b { display: block; margin-bottom: 2px; font-size: var(--text-base); color: var(--text-strong); }

/* The "look" step of the upload form, drawn with what each choice does. */
.how-look { background: var(--surface); border: var(--border-w) solid var(--border); border-radius: var(--radius-2xl); box-shadow: var(--shadow-lg); overflow: hidden; min-width: 0; }
.how-look__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-6);
  border-bottom: var(--border-w) solid var(--border); background: var(--surface-subtle); }
.how-look__bar span { display: flex; flex-direction: column; font-family: var(--font-display); font-weight: var(--font-bold); font-size: var(--text-lg);
  letter-spacing: -0.015em; color: var(--text-strong); line-height: 1.2; }
.how-look__bar small { font-family: var(--font-mono); font-weight: var(--font-medium); font-size: var(--text-2xs); letter-spacing: var(--tracking-caps);
  text-transform: uppercase; color: var(--text-subtle); }
.how-look__bar em { font-style: normal; white-space: nowrap; }
.how-look__list { list-style: none; padding: 0 var(--space-6); }
.how-look__list li { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) auto; gap: var(--space-2) var(--space-4); align-items: start; padding-block: var(--space-5); }
.how-look__list li + li { border-top: var(--border-w) solid var(--border-subtle); }
.how-look__list b { display: block; font-weight: var(--font-semibold); color: var(--text-strong); }
.how-look__list p { margin-top: 2px; font-size: var(--text-sm); line-height: 1.5; color: var(--text-muted); }
.how-chip { align-self: center; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.6rem; border: var(--border-w) dashed var(--border-strong);
  border-radius: var(--radius-sm); background: var(--bg-subtle); font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-subtle); white-space: nowrap; }
.how-chip--color i { width: 0.75rem; height: 0.75rem; border-radius: 3px; background: var(--brand-500); }
@media (min-width: 1024px) and (max-width: 1279px) {
  .how-look__list li { grid-template-columns: 2.75rem minmax(0, 1fr); }
  .how-chip { grid-column: 2; justify-self: start; }
}
/* The smallest phones: the pill drops under the step name instead of
   squeezing it onto two lines. */
@media (max-width: 379px) { .how-look__bar { flex-wrap: wrap; } }
@media (max-width: 559px) {
  .how-look__bar, .how-look__list { padding-inline: var(--space-4); }
  .how-look__list li { grid-template-columns: 2.75rem minmax(0, 1fr); padding-block: var(--space-4); }
  .how-chip { grid-column: 2; justify-self: start; }
}

/* ============================================================ on screen */
/* Three frames fit side by side at every width, so none hides off screen. */
@media (max-width: 767px) {
  .frames.how-frames { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin-inline: 0; padding-inline: 0; overflow: visible; }
}
@media (max-width: 479px) { .how-frames figcaption { font-size: var(--text-2xs); } }
/* The band's next step, under the frames it follows from. */
.how-cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5); margin-top: var(--space-8); }
/* The dark band's link colour: the light theme's link blue is too dark on ink. */
.sx--ink .how-cta { --text-link: var(--brand-300); }
.how-cta .s-link { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: var(--font-medium); }
@media (max-width: 479px) { .how-cta .s-btn { width: 100%; } }

/* ============================================================ how long */
.how-time { gap: var(--space-4); }
.how-time__head { display: flex; flex-direction: column; gap: var(--space-2); padding-bottom: var(--space-4); border-bottom: var(--border-w) solid var(--border); }
.how-time__total { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); }
.how-time__total b { font-family: var(--font-display); font-size: clamp(1.875rem, 1.5rem + 1.2vw, 2.5rem); font-weight: var(--font-extrabold);
  letter-spacing: -0.035em; line-height: 1; color: var(--text-strong); }
.card2 .how-time__total span { color: var(--text-muted); font-size: var(--text-sm); }
.how-time__rows { list-style: none; padding: 0; display: flex; flex-direction: column; }
.how-time__rows li { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr) 3.75rem; grid-template-areas: "name bar time";
  gap: var(--space-2) var(--space-4); align-items: center; min-height: 2.75rem; padding-block: var(--space-1); font-size: var(--text-sm);
  border-bottom: var(--border-w) solid var(--border-subtle); }
.how-time__name { grid-area: name; color: var(--text-muted); }
.how-time__bar { grid-area: bar; display: block; height: 0.5rem; border-radius: var(--radius-full); background: var(--bg-subtle); box-shadow: inset 0 0 0 1px var(--border-subtle); }
.how-time__bar i { display: block; height: 100%; width: calc(var(--w, 0) * 100%); min-width: 0.375rem; border-radius: inherit; background: var(--accent); }
.how-time__rows b { grid-area: time; font-family: var(--font-mono); font-weight: var(--font-medium); font-size: var(--text-xs); text-align: right; color: var(--text-strong); white-space: nowrap; }
@media (max-width: 479px) {
  .how-time__rows li { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name time" "bar bar"; gap: var(--space-2) var(--space-3);
    padding-block: var(--space-3); }
}

/* ======================================================= your footage */
.how-trust { list-style: none; padding: 0; display: grid; gap: var(--space-5); margin-block: var(--space-2); }
@media (min-width: 640px) and (max-width: 1023px) { .how-trust { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5) var(--space-8); } }
.how-trust li { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.how-trust b { display: block; font-weight: var(--font-semibold); color: var(--text-strong); }
.how-trust li span:not(.card2__icon) { display: block; margin-top: 2px; font-size: var(--text-sm); line-height: 1.5; color: var(--text-muted); }
.how-limits .s-table-wrap { margin-top: calc(-1 * var(--space-1)); }
.how-limits .s-table tbody tr:last-child th { border-bottom: 0; }
/* The smallest phones: a little less padding so all four columns fit
   without scrolling the table sideways. */
@media (max-width: 359px) {
  .how-limits { padding: var(--space-5) var(--space-4); }
  .how-limits .tbl2 th, .how-limits .tbl2 td { padding-inline: 0.3125rem; }
  .how-limits .tbl2 th:first-child { padding-left: 0; }
  .how-limits .tbl2 th:last-child, .how-limits .tbl2 td:last-child { padding-right: 0; }
}

/* ============================================================ your turn */
/* The smallest phones (320px): the shared closing box is a little too
   padded for its button, so it gives back some room here. */
@media (max-width: 359px) {
  .final { padding: var(--space-6) var(--space-4); }
  .final__drop { padding: var(--space-5) var(--space-3); }
}
