/* Sell or Scale. /how-it-works: the page's own stylesheet. Loaded after site.css and kit.css.
   Here: the seven steps as one list (each step a line, and one step open under its line), the few pieces of an app
   screen the kit has no part for, and "Your next six months" (the two figures, the chart, the milestones).
   Nothing here needs a script: without how.js the seven steps stand open, one under the other. With it, a step that
   is not open is marked .is-closed and shows as its line alone. */

/* ---------- the seven steps: one list, hairlines between ----------
   A step is the foundation's tested step block: the light numeral with the name and the timing under it, the
   title and the words in one column, and its screen beside them from 1280 wide (.split--wide's two columns, 5 and 7
   with the same gap), under them below that. The line (.step__line) is the step's number, name, timing and title:
   the head of an open step, and all there is of a closed one. */

.prog { border-top: 1px solid var(--rule-2); }
.step {
  --in: calc(8.5rem + 24px);      /* the numeral's column and its gap: where the words start */
  padding-block: 30px; border-bottom: 1px solid var(--rule);
}
/* the title is the step's heading (h2); the line inside it is one piece, which how.js makes a button */
.step__head { margin-left: var(--in); font: inherit; letter-spacing: normal; text-wrap: wrap; }
.step__line {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); width: 100%;
  margin: 0; padding: 0; border: 0; background: none; color: inherit;
  font: inherit; letter-spacing: inherit; text-align: left;
  -webkit-appearance: none; appearance: none;
}
.step__n { position: absolute; left: calc(-1 * var(--in)); top: 0; width: 8.5rem; font-size: 1.0625rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.25; }
.step__n b { display: block; margin: 0.03em 0 0.2em -0.04em; }      /* (the numeral itself is site.css's: .step__n b) */
/* (the figure 1 stands in a wide cell, as every tabular 1 does: step 1's numeral is moved out by that much, so its foot
   starts on the column's edge with the name under it) */
.step:first-child:not(.is-closed) .step__n b { margin-left: -0.13em; }
.step__name { display: block; }
.step__when { display: block; font-size: 0.9375rem; font-weight: 400; letter-spacing: 0; line-height: 1.5; color: var(--text-2); white-space: nowrap; }
/* beside its numeral, the title hangs from the numeral's top: the capitals' tops and the figure's top on one line */
.step__title { margin-top: calc(var(--num) * 0.135 - 0.274em); font-weight: 560; font-size: 1.3125rem; line-height: 1.2; letter-spacing: -0.018em; text-wrap: balance; }
.step__sign { display: none; }

.step__words { margin-left: var(--in); }
.step__job { display: grid; row-gap: 6px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--rule); }
.step__job span { font-size: 0.9375rem; line-height: 1.5; color: var(--text-2); }
.step__job s { font-size: 1.1875rem; line-height: 1.42; letter-spacing: -0.01em; text-decoration: line-through; text-decoration-thickness: 1.5px; }
.step .ui-screen { margin-top: 36px; }
.step__next { margin-top: 30px; }

/* where a finger may be the pointer, the open step's line is a 44px target too, drawn as it is */
@media (max-width: 59.9375em) {     /* 959px */
  .step:not(.is-closed) .step__line::after { content: ""; position: absolute; inset: -9px 0; }
}
/* the step keeps to a reading measure where its screen goes under it */
@media (max-width: 1279px) {
  .step__head, .step__words { max-width: calc(40rem - var(--in)); }
  /* (a drawn phone is narrower than the words: it stands under them, on their edge, and so does its button) */
  .step--phone .ui-screen, .step--phone .step__next { margin-left: var(--in); }
}
/* beside its screen: the split's two columns. The words take the left one, row by row (the line, the words, the
   button), and the screen the right one, its top edge on the line of the numeral's top. */
@media (min-width: 1280px) {
  .step:not(.is-closed) { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto auto 1fr; column-gap: clamp(32px, 7vw, 104px); }
  .step:not(.is-closed) > .step__head { grid-area: 1 / 1; }
  .step:not(.is-closed) > .step__more { display: contents; }
  .step__words { grid-area: 2 / 1; }
  .step__next { grid-area: 3 / 1; margin-left: var(--in); }
  .step .ui-screen { grid-area: 1 / 2 / 4 / 3; margin-top: calc(var(--num) * 0.126); }
}

/* ---------- a closed step: its line alone, in one row ----------
   The number and the name where the numeral stands, the title where the words start, the timing at the right, and
   the sign that it opens. The line is the whole row: a 64px target. */

.step.is-closed { padding-block: 0; }
.is-closed .step__head { margin-left: 0; max-width: none; }
.is-closed .step__line { grid-template-columns: 8.5rem minmax(0, 1fr) 7.5rem 11px; column-gap: 24px; align-items: baseline; padding-block: 18px; cursor: pointer; }
.is-closed .step__n { display: contents; }
.is-closed .step__n b { grid-area: 1 / 1; margin: 0; font-size: inherit; font-weight: 400; line-height: inherit; letter-spacing: 0; color: var(--text-2); }
.is-closed .step__name { grid-area: 1 / 1; padding-left: 1.75rem; }
.is-closed .step__when { grid-area: 1 / 3; }
.is-closed .step__title { grid-area: 1 / 2; margin-top: 0; font-weight: 400; font-size: 1.1875rem; line-height: 1.42; letter-spacing: -0.01em; text-wrap: pretty; }
/* a plus, as a question has: its strokes end on the column's edge */
.is-closed .step__sign { display: block; grid-area: 1 / 4; align-self: center; width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
/* (a closed step's panel is hidden="until-found" where the browser has it: it keeps its box and skips its contents, so
   find-in-page still finds a word in it, and how.js opens the step. site.css leaves that value to the browser.) */

/* too narrow for one row: the number, the name and the timing, and the title under them */
@media (max-width: 56.1875em) {      /* 899px at the usual text size; in em, so a reader's larger type gets there sooner */
  /* (a row that wraps: should a reader's larger type leave no room for the timing beside the name, it goes under it) */
  .is-closed .step__line { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0; row-gap: 3px; padding-right: 35px; }
  .is-closed .step__n b { width: 1.75rem; }
  .is-closed .step__name { padding-left: 0; margin-right: 0.8em; }
  .is-closed .step__title { flex: 0 0 100%; }
  .is-closed .step__sign { position: absolute; right: 0; top: calc(50% - 5.5px); }
}

/* a phone: the numeral stands in the line of its name and timing, and the words take the whole column */
@media (max-width: 599px) {
  .step { --in: 0px; }
  .step__n { position: static; width: auto; }
  .step__n b { display: inline; margin: 0 0.12em 0 -0.04em; }
  .step__name { display: inline; }
  .step__when { display: inline; margin-left: 0.5em; }
  .step__title { margin-top: 12px; }
  .step__job s { font-size: 1.0625rem; }
  .step .ui-screen { margin-top: 30px; }
  .step__next .btn { width: 100%; }
  .is-closed .step__n b { display: block; }
  .is-closed .step__name, .is-closed .step__when { display: block; }
  .is-closed .step__when { margin-left: 0; }
  .is-closed .step__title { margin-top: 0; font-size: 1.0625rem; }
}

/* a step a reader has just opened comes up in place: once, short, and never under reduced motion */
@keyframes step-in { from { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .step.is-in .step__words, .step.is-in .ui-screen, .step.is-in .step__next { animation: step-in 0.35s var(--ease) backwards; }
}

/* under the list, once: the note and the caption, on the split's two columns */
.prog__notes { row-gap: 0; }
@media (max-width: 899px) {
  .prog__notes .cap + .cap { margin-top: 6px; }
}

/* ---------- inside an app screen: what the kit has no part for ----------
   (Reported to the kit: a page of one column, a table cell of two lines, a line with two ends, and a part across
   both columns of Proof. Each only places the kit's own parts; none restyles one.) */

.piece { padding: 24px var(--ui-g) 20px; }                 /* a page of one column, with the room .ui-split and .ui-cols give theirs */
.piece__cell { display: grid; padding-block: 11px; }      /* two lines in a table's cell: a 68px row */
.piece__pair { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.piece__wide { grid-column: 1 / -1; }
@container ui (max-width: 599px) {
  .piece { padding: 0 0 16px; }                            /* as the phone app the kit's .ui-open brings its own top and sides */
}

/* ---------- "Your next six months": the two figures, the chart, the milestones ---------- */

/* 60 to 8: the home page's light numerals, a drawn arrow between them, and their line */
.drop { display: flex; flex-wrap: wrap; align-items: flex-end; align-items: last baseline; gap: 12px 18px; }
.drop__n { display: inline-flex; align-items: center; font-size: clamp(4rem, 3rem + 3.2vw, 5.75rem); font-weight: 320; line-height: 0.8; letter-spacing: -0.045em; margin-left: -0.04em; }
.drop__to { flex: none; width: 0.46em; height: 0.167em; margin: 0 0.15em 0 0.19em; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.drop__to path { vector-effect: non-scaling-stroke; }
.drop__t { font-size: 1.1875rem; font-weight: 500; letter-spacing: -0.012em; line-height: 1.3; }

/* The chart: ink on hairlines. The scale's four lines run to the column's right edge; the estimate's line runs from
   month 1 to month 6 inside them, with room at its end for what month 6 is. The words keep their size at every
   width: only the picture stretches (the line is one path in a box of its own, its stroke never scaled). */
.chart { margin-top: 36px; }
.chart__in { --yw: 1.75rem; --start: 3.5rem; --end: 6.5rem; position: relative; padding: 2rem 0 0 var(--yw); font-size: 0.9375rem; line-height: 1; color: var(--text-2); }
.chart__plot { position: relative; height: clamp(12.5rem, 9.5rem + 10vw, 17.5rem); }
.chart__rule { position: absolute; left: 0; right: 0; border-top: 1px solid var(--rule); }
.chart__rule--60 { top: 0; }
.chart__rule--40 { top: 33.333%; }
.chart__rule--20 { top: 66.667%; }
.chart__rule--0 { top: 100%; border-top-color: var(--rule-2); }
.chart__rule span { position: absolute; right: calc(100% + 10px); top: calc(-0.5em - 0.5px); }
.chart__run { position: absolute; inset: 0 var(--end) 0 var(--start); }
.chart__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; color: var(--text); }
.chart__svg path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart__svg circle { fill: var(--paper); stroke: currentColor; stroke-width: 1.5; }
.chart__svg .chart__last { fill: currentColor; }
.chart__v { position: absolute; transform: translate(-0.28em, calc(-100% - 11px)); font-weight: 560; letter-spacing: -0.01em; color: var(--text); }
.chart__v--1 { left: 0; top: 0; }
.chart__v--5 { left: 80%; top: 53.333%; }
.chart__end { position: absolute; left: calc(100% - var(--end) + 16px); top: 86.667%; display: grid; row-gap: 5px; transform: translateY(-50%); white-space: nowrap; }
.chart__end b { font-weight: 560; letter-spacing: -0.01em; color: var(--text); }
.chart__x { position: relative; display: flex; justify-content: space-between; margin-top: 0.875rem; padding: 0 var(--end) 0 var(--start); }
.chart__x span { display: flex; justify-content: center; width: 0; white-space: nowrap; }
/* (the word starts on the column's edge, and the 1 follows it) */
.chart__x b { position: absolute; left: calc(-1 * var(--yw)); font-weight: 400; }
.chart + .ledger { margin-top: 30px; }
/* beside the words (two columns): the scale hangs in the gap, so the chart's lines start on the column's edge, as
   the rows under them do */
@media (min-width: 900px) {
  .chart__in { margin-left: calc(-1 * var(--yw)); }
  .chart__x b { left: 0; }
}
/* in one column the scale stands inside it, and the word takes the scale's room too */
@media (max-width: 899px) {
  .chart__in { --start: 1.75rem; }
}
@media (max-width: 599px) {
  .drop__t { font-size: 1.0625rem; }
  .chart__in { --end: 5.5rem; }
}
/* a narrow window with a reader's larger type (never at the usual size: 18em is 288px there): the line keeps the
   chart's width, month 6 is named over the line's end, where the chart is empty, and "Month" goes under the figures */
@media (max-width: 18em) {
  .chart__in { --start: 0.75rem; --end: 0.75rem; }
  .chart__end { left: auto; right: 0; top: 0.75em; justify-items: end; transform: none; }
  .chart__x { flex-wrap: wrap; row-gap: 0.4em; }
  .chart__x b { position: static; order: 1; flex: 0 0 100%; margin-left: calc(-1 * (var(--start) + var(--yw))); }
}
@media (forced-colors: active) {
  .chart__svg circle { fill: Canvas; }
  .chart__svg .chart__last { fill: CanvasText; }
}
