/* RevMatic AI | /how-it-works/ page
   The audit, step by step: five chapters. From 1024px each chapter's head (big number, headline, lede,
   a five part meter) pins on the left while its steps pass on the right; phones and tablets stack and get
   the shared sticky jump row. /assets/js/pages/how.js marks the chapter and the step the reader is on
   (html.how-live); without it every step shows at full strength.
   Only what site.css does not already cover. Tokens only: no new colors, fonts, shadows or radii.
   Loaded after site.css on /how-it-works/index.html.

   1 The sequence wrapper   4 01 What we look at    7 04 What happens after
   2 Chapter layout         5 02 How it happens     8 05 What we will not do
   3 Chapter head           6 03 What you get       9 Motion off */

/* ================================================================ 1 The sequence wrapper */
.section.how { padding: 0; border-top: 0; }
.how > .jump:first-child { margin: 0; }

/* ================================================================ 2 Chapter layout */
.chap {
  --numfs: clamp(58px, 1.2rem + 7vw, 136px);
  position: relative; padding: clamp(56px, 2rem + 5vw, 132px) 0; border-top: 1px solid var(--line);
}
.how > .jump + .chap { border-top: 0; }
.chap__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px; }
.chap__lede { margin-top: 20px; }
.chap__note { margin-top: clamp(26px, 1rem + 1.5vw, 38px); max-width: 36em; font: 400 17px/1.6 var(--font-text); color: var(--ink-88); }
.chap__note b { font-weight: 500; color: var(--platinum); }
.chap__more { margin-top: 18px; }
.beats + .chap__more { margin-top: clamp(30px, 1rem + 2vw, 44px); }

@media (min-width: 768px) and (max-width: 1023px) {
  .chap__lede { max-width: 38em; }
}
@media (min-width: 1024px) {
  .chap__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 clamp(56px, 6vw, 112px); }
  /* the head column stretches to the chapter's height, so its content can pin inside it */
  .chap__pin { position: sticky; top: calc(var(--stick) + 24px); transition: top 0.4s var(--ease-out); }
  [data-hdr="up"] .chap__pin { top: calc(var(--header-h) + 32px); }
  /* the steps start level with the headline, under the big number */
  .chap__body { padding-top: calc(var(--numfs) * 0.8 + 26px); }
  .chap__h { font-size: clamp(2.2rem, 1rem + 1.9vw, 3.05rem); }
}
/* a short window cannot hold a pinned head: let it scroll */
@media (min-width: 1024px) and (max-height: 700px) {
  .chap__pin { position: static; }
}

/* ================================================================ 3 Chapter head: number, count, meter */
.chap__top { display: flex; align-items: flex-end; gap: clamp(20px, 1rem + 1vw, 32px); margin-bottom: 26px; }
.chap__num {
  position: relative; display: block; font-family: var(--font-display); font-weight: 800; font-stretch: 108%;
  font-size: var(--numfs); line-height: 0.8; letter-spacing: -0.045em;
  color: transparent; -webkit-text-stroke: 1.2px rgba(187, 169, 255, 0.5); transition: -webkit-text-stroke-color 0.8s var(--ease-out);
}
/* the chapter the reader is on fills with the afterglow (the same number laid over the outline) */
.chap__num::after {
  content: attr(data-n); position: absolute; left: 0; top: 0;
  background: var(--afterglow); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; -webkit-text-stroke: 0 transparent;
  opacity: 0; transition: opacity 0.8s var(--ease-out);
}
html:not(.how-live) .chap__num::after, .chap.is-now .chap__num::after { opacity: 1; }
/* filled, the outline steps back so no rim shows around the fill */
html:not(.how-live) .chap__num, .chap.is-now .chap__num { -webkit-text-stroke-color: transparent; }
.chap__side { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding-bottom: 3px; }
.chap__count { letter-spacing: 0.1em; white-space: nowrap; }
.chap__count b { font-weight: 500; color: var(--platinum); }
/* five thin parts, one per step; together they read as one afterglow rule */
.chap__meter { display: flex; gap: 4px; width: 128px; }
.chap__meter i { position: relative; flex: 1; height: 2px; border-radius: 2px; overflow: hidden; background: var(--line-strong); }
.chap__meter i::after {
  content: ""; position: absolute; inset: 0; background: var(--afterglow); background-size: 500% 100%;
  transform-origin: 0 50%; transform: scaleX(0);
}
.chap__meter i:nth-child(2)::after { background-position: 25% 0; }
.chap__meter i:nth-child(3)::after { background-position: 50% 0; }
.chap__meter i:nth-child(4)::after { background-position: 75% 0; }
.chap__meter i:nth-child(5)::after { background-position: 100% 0; }
.chap__meter i.is-done::after { transform: none; }
/* how.js sets --p: how far the reader is through this chapter */
.chap__meter i.is-cur::after { transform: scaleX(var(--p, 1)); }
@media (max-width: 767px) {
  .chap { --numfs: 56px; }
  .chap__top { margin-bottom: 18px; }
  .chap__meter { display: none; }
  .chap__grid { gap: 30px; }
}

/* the ring that marks a step: open until the reader reaches it, then lit */
.lens__row::before, .look::before, .beat::before {
  content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%;
  border: 1.5px solid var(--smoke); background: var(--void);
  transition: border-color 0.35s, background-color 0.35s, box-shadow 0.35s;
}
html:not(.how-live) .lens__row::before, html:not(.how-live) .look::before, html:not(.how-live) .beat::before,
.lens__row.is-lit::before, .look.is-lit::before, .beat.is-lit::before {
  border-color: var(--plasma-soft); background: var(--plasma); box-shadow: 0 0 12px rgba(140, 112, 255, 0.8);
}
/* the line from one step to the next fills once the next step is reached */
.look:not(:last-child)::after, .beat:not(:last-child)::after {
  content: ""; position: absolute; width: 1px;
  background: linear-gradient(180deg, var(--plasma-soft), var(--plasma)) no-repeat 0 0 / 100% 0%, var(--line-strong);
  transition: background-size 0.9s var(--ease-out);
}
html:not(.how-live) .look:not(:last-child)::after, html:not(.how-live) .beat:not(:last-child)::after,
.look.is-past::after, .beat.is-past::after { background-size: 100% 100%, auto; }

/* ================================================================ 4 01 What we look at */
.lens__head { display: none; }
.lens { border-bottom: 1px solid var(--line); }
.lens__row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 20px 0 22px 30px; border-top: 1px solid var(--line); }
.lens__row::before { left: 1px; top: 27px; }
.lens__t { font: 600 17.5px/1.35 var(--font-text); letter-spacing: -0.003em; color: var(--platinum); }
.lens__d { margin-top: 3px; font: 400 15px/1.5 var(--font-text); color: var(--smoke); }
.lens__q { font: 400 clamp(1.3rem, 1.1rem + 0.55vw, 1.62rem)/1.24 var(--font-sig); font-style: italic; color: var(--platinum); text-wrap: pretty; transition: color 0.45s; }
/* reading along: the row the reader is on speaks up, the rest stay quieter */
.how-live .lens__row:not(.is-now) .lens__q { color: var(--ink-70); }
.lens__row--plus { margin-top: 16px; border-top-color: var(--line-strong); }
.lens__plus { color: var(--plasma-soft); }
@media (min-width: 768px) {
  .lens__head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; padding: 0 0 14px 30px; }
  .lens__head .mono { letter-spacing: 0.08em; }
  .lens__row { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 8px 32px; padding: 26px 0 28px 30px; }
  .lens__row::before { top: 33px; }
  .lens__plus { grid-column: 1 / -1; }
}

/* ================================================================ 5 02 How the audit happens
   Phones: three steps down one line. From 768px: the two looks side by side, two lines drawing down
   from them into the third. */
.looks { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; padding-left: 30px; }
.look { position: relative; }
.look::before { left: -29px; top: 3px; }
.look:not(:last-child)::after { left: -25px; top: 20px; bottom: -32px; }
.look__k { margin-bottom: 10px; }
.look--join .look__k { color: var(--plasma-soft); }
.look__t, .beat__t {
  font-family: var(--font-display); font-weight: 800; font-stretch: 106%; letter-spacing: -0.02em;
  font-size: clamp(1.4rem, 1rem + 1vw, 2rem); line-height: 1.1; color: var(--platinum); text-wrap: balance;
}
.look__p, .beat__p { margin-top: 12px; max-width: 32em; font: 400 16.5px/1.62 var(--font-text); color: var(--ink-88); }
.look__lines { display: none; }
@media (min-width: 768px) {
  .looks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(28px, 3vw, 48px); padding-left: 0; }
  .look--in, .look--out { padding-top: 26px; border-top: 1px solid var(--line-strong); }
  .look--in::before, .look--out::before { left: 0; top: -5px; }
  .look:not(:last-child)::after { display: none; }
  .look--join { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; text-align: center; }
  .look--join::before { left: 50%; top: 110px; margin-left: -5px; }
  .look__lines { display: block; width: 100%; height: 110px; margin-bottom: 30px; overflow: visible; }
  .look__lines path { fill: none; stroke-width: 1.2; }
  .look--join .look__p { max-width: 34em; }
  /* the two lines draw down as the reader reaches them */
  .how-live .look__lines path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.3s var(--ease-out); }
  .how-live .look--join.is-lit .look__lines path { stroke-dashoffset: 0; }
  .how-live .look--join::before { transition-delay: 0.9s; }
}

/* ================================================================ 6 03 What you get
   One made-up finding on the shared option line (.opts, .opt), at page size. */
.ladder__label { display: block; margin-bottom: 18px; letter-spacing: 0.08em; }
.ladder { padding-top: clamp(22px, 1rem + 1.5vw, 34px); border-top: 1px solid var(--line); }
.ladder__q { margin-top: 16px; }
.ladder__q p { max-width: 17em; font: 400 clamp(1.85rem, 1.1rem + 1.9vw, 2.9rem)/1.1 var(--font-sig); font-style: italic; color: var(--platinum); text-wrap: balance; }
.ladder__opts.opts { margin-top: clamp(26px, 1rem + 2vw, 46px); }
.ladder .opt__txt { font-size: 16.5px; line-height: 1.5; }
@media (min-width: 768px) {
  .ladder__opts.opts { gap: 28px; }
  .ladder .opt { padding-top: 26px; gap: 6px; }
  .ladder .opt:not(:last-child)::after { right: -28px; }
  .ladder .opt__step { font-size: 12.5px; }
  .ladder .opt__txt { font-size: 17px; }
}
/* the options arrive one after another, the line drawing between them (the .reveal on .ladder sets .is-in) */
.js .ladder .opt { opacity: 0; transform: translateY(10px); transition: opacity 0.7s var(--ease-out), transform 0.8s var(--ease-out); }
.js .ladder .opt--2 { transition-delay: 0.45s; }
.js .ladder .opt--3 { transition-delay: 0.9s; }
.js .ladder .opt:not(:last-child)::after { transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.7s var(--ease-out) 0.3s; }
.js .ladder .opt--2::after { transition-delay: 0.75s; }
.ladder.is-in .opt { opacity: 1; transform: none; }
.ladder.is-in .opt:not(:last-child)::after { transform: none; }
@media (max-width: 767px) {
  .js .ladder .opt:not(:last-child)::after { transform: scaleY(0); transform-origin: 50% 0; }
  .ladder.is-in .opt:not(:last-child)::after { transform: none; }
}

/* ================================================================ 7 04 What happens after */
.beats { position: relative; padding-left: 40px; }
.beat { position: relative; padding-bottom: clamp(32px, 1rem + 2.4vw, 50px); }
.beat:last-child { padding-bottom: 0; }
.beat::before { left: -40px; top: 3px; }
.beat:not(:last-child)::after { left: -36px; top: 20px; bottom: 3px; }
.beat__k { margin-bottom: 10px; }
.beat--ours .beat__k { color: var(--plasma-soft); }
.beat__p { margin-top: 10px; }

/* ================================================================ 8 05 What we will not do */
.promises { display: grid; gap: clamp(40px, 1.5rem + 3vw, 64px); }
.promise { position: relative; padding-top: 28px; }
.promise::before { content: ""; position: absolute; left: 0; top: 0; width: 64px; height: 1px; background: var(--afterglow); }
.promise__t { max-width: 15em; font: 400 clamp(2rem, 1.1rem + 2.3vw, 3.3rem)/1.05 var(--font-sig); font-style: italic; letter-spacing: -0.01em; color: var(--platinum); text-wrap: balance; }
.promise__p { margin-top: 16px; max-width: 32em; font: 400 17px/1.62 var(--font-text); color: var(--ink-88); }
@media (max-width: 767px) {
  .promise__p, .chap__note { font-size: 16px; }
}

/* ================================================================ 9 Motion off (?still for screenshots, and reduced motion) */
.still .ladder .opt, .still .ladder .opt::after, .still .look__lines path,
.still .chap__num::after, .still .lens__q, .still .chap__pin { transition: none !important; }
