/* How it works (/how-it-works): the heading, the stage (the workbench in its window, Reach's phone
   in front of its corner, the four steps under it with their progress and the pause, the line that
   says what each step is), how involved you are, and the last call. how-frame.css draws the
   workbench; how-plan.css, how-shape.css and how-build.css its first three steps, how-earn.css the
   fourth (Reach in use), with how-console.css and how-console-parts.css drawing Reach's own
   console. Only tokens. */

.hw-top {
  padding-top: calc(var(--nav-height) + var(--space-16));
  padding-bottom: var(--space-24);
  overflow: hidden;
}
.hw-top h1 {
  margin-top: var(--space-5);
  font-size: clamp(40px, 5vw, 64px);
}
.hw-top h1 .quiet {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--size-h3);
  line-height: var(--leading-heading);
}
.hw-top .lead {
  max-width: 640px;
  margin: var(--space-6) auto 0;
}

/* The stage */
.hw {
  container-type: inline-size;
  max-width: 1120px;
  margin: var(--space-16) auto 0;
}
.hw-win {
  position: relative;
}
/* Reach on a phone, in front of the window's corner over the loop, once it's live */
.hw-phone {
  position: absolute;
  inset: auto auto calc(-1 * var(--space-8)) calc(-1 * var(--space-6));
  z-index: 4;
  width: 19%;
  max-width: 210px;
}

/* The three steps: each fills as it plays; a step pressed plays from its start */
.hw-steps {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-16);
}
.hw-steps ol {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}
.hw-tab {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2) var(--space-3);
  width: 100%;
  min-height: var(--target);
  padding: 0 0 var(--space-2);
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
}
.hw-tab:hover,
.hw-tab[aria-pressed="true"] {
  color: var(--text-strong);
}
.hw-tab .bar {
  grid-column: 1 / -1;
  display: block;
  height: 3px;
  margin-bottom: var(--space-2);
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--line);
}
.hw-tab .bar i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
}
.hw-tab.done .bar i,
.hw:not(.js) .hw-tab[aria-pressed="true"] .bar i {
  width: 100%;
}
/* The playing step fills over its length (how.js sets --len); paused, it holds */
.hw-tab.run .bar i {
  animation: hw-fill var(--len, 12s) linear forwards;
}
.hw.paused .hw-tab.run .bar i {
  animation-play-state: paused;
}
@keyframes hw-fill {
  to {
    width: 100%;
  }
}
.hw-tab .n {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: var(--border) solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: var(--weight-medium);
}
.hw-tab[aria-pressed="true"] .n {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--text-on-accent);
}
.hw-tab .t {
  font-size: 17px;
  font-weight: var(--weight-medium);
  line-height: var(--leading-ui);
}
.hw-pause {
  flex: none;
  align-self: start;
}
.hw-cap {
  min-height: 3em;
  margin-top: var(--space-4);
  font-size: 17px;
  line-height: var(--leading-ui);
  color: var(--text-muted);
}
.hw-cap span {
  display: none;
}
.hw[data-step="1"] [data-cap="1"],
.hw[data-step="2"] [data-cap="2"],
.hw[data-step="3"] [data-cap="3"],
.hw[data-step="4"] [data-cap="4"] {
  display: block;
}

/* How involved you are: the four settings, the one the stage plays on marked, and the six
   approvals that are always the person's */
.hw-modes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin: var(--space-12) 0 0;
  padding: 0;
  list-style: none;
}
.hw-modes .tile {
  gap: var(--space-3);
  padding: var(--space-6);
}
.hw-modes .now {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.hw-modes h3,
.hw-always h3 {
  font-size: var(--size-h4);
}
.hw-modes p {
  margin: 0;
  font-size: 16px;
  line-height: var(--leading-ui);
  color: var(--text);
}
.hw-always {
  gap: var(--space-4);
  margin-top: var(--space-4);
  padding: var(--space-6);
}
.hw-always h3 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.hw-always ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2) var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
  line-height: var(--leading-ui);
}
.hw-always li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 var(--space-3) 2px 0;
  border-radius: 50%;
  background: var(--accent);
}
.hw-reach {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding: var(--space-5) var(--space-6);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--duration-fast) var(--ease-out);
}
.hw-reach:hover {
  border-color: var(--line-strong);
}
.hw-reach:hover .mk-go .icon {
  transform: translateX(3px);
}
.hw-reach b {
  display: block;
  font-size: var(--size-h4);
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
}
.hw-reach small {
  display: block;
  font-size: 15px;
  color: var(--text-muted);
}
.hw-reach .mk-go {
  margin-top: 0;
}

.hw-final .lead {
  max-width: 560px;
  margin: var(--space-5) auto 0;
}
.hw-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

@media (max-width: 1080px) {
  .hw-modes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hw-always ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .hw-top {
    padding-top: calc(var(--nav-height) + var(--space-12));
    padding-bottom: var(--space-16);
  }
  .hw-top h1 .quiet {
    font-size: var(--size-h4);
  }
  .hw {
    margin-top: var(--space-10);
  }
  /* On a phone the chat sits under the page, where Reach's phone would hide its words */
  .hw-phone {
    display: none;
  }
  .hw-steps {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }
  .hw-steps ol {
    gap: var(--space-2);
  }
  .hw-tab {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .hw-tab .t {
    font-size: 14px;
  }
  .hw-pause {
    align-self: center;
  }
  .hw-cap {
    font-size: 16px;
    text-align: center;
  }
  .hw-modes {
    grid-template-columns: 1fr;
  }
  .hw-modes .tile,
  .hw-always {
    padding: var(--space-5);
  }
  .hw-always ul {
    grid-template-columns: 1fr;
  }
  .hw-reach {
    grid-template-columns: 52px minmax(0, 1fr);
  }
  .hw-reach .mk-go {
    grid-column: 1 / -1;
  }
  .hw-cta .btn {
    width: 100%;
  }
}
