/*
 * Coach page (classes p08-) and the block its brief introduced, which any
 * industry page can use: the Timed demo (timeddemo). Linked only on pages
 * with those classes (peanut_scoped_css()). Tokens only. Layer blocks for the
 * static state, layer motion for what moves (docs/design/components.md,
 * "Industry pages").
 */

@layer blocks {
  /* ---------- Live card coach-discovery: the outcome tabs, the small
     calendar, "You're booked". The static card is the booked state ---------- */

  .p08-cal {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.375rem;
  }

  .p08-cal__day {
    padding: 0.375rem 0.25rem;
    border: var(--border);
    border-radius: 0.5rem;
    font-size: 0.6875rem;
    text-align: center;
    transition: background-color 200ms var(--ease-out);
  }

  .p08-cal__day b {
    display: block;
    margin-block-start: 0.125rem;
    font-weight: 600;
  }

  .p08-cal__day.is-tapped {
    background: var(--color-brand);
  }

  .p08-booked {
    display: flex;
    gap: 0.625rem;
    align-items: center;
  }

  .p08-booked__check {
    display: grid;
    flex: none;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    background: var(--color-brand);
    border: var(--border);
    border-radius: 50%;
  }

  .p08-booked__check svg {
    width: 1rem;
    height: 1rem;
  }

  .p08-when {
    margin: 0;
    font-weight: 500;
  }

  /* ---------- The drawings' own parts: the static drawing is the finished one ---------- */

  .diagram .p08-caps {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.6;
  }

  .diagram .p08-strong {
    font-size: 12px;
    font-weight: 600;
  }

  .diagram .p08-bold {
    font-weight: 600;
  }

  .diagram .p08-tight {
    font-size: 10px;
  }

  .diagram .p08-grey {
    opacity: 0.45;
  }

  .diagram .p08-ontext {
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    fill: var(--color-white);
  }

  .diagram .p08-arrow,
  .diagram .p08-head {
    fill: none;
    stroke: var(--color-accent-2);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .diagram .p08-arrow--cold,
  .diagram .p08-head--cold {
    stroke: var(--color-ink);
    opacity: 0.3;
  }

  .diagram .p08-trail,
  .diagram .p08-echo {
    fill: none;
    stroke: var(--color-ink);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 4 5;
    opacity: 0.6;
  }

  .diagram .p08-echo {
    opacity: 0.35;
  }

  .diagram .p08-tap {
    fill: none;
    stroke: var(--color-ink);
    stroke-width: 1.5;
    stroke-dasharray: 3 3;
    opacity: 0.6;
  }

  .diagram .p08-track {
    fill: var(--color-ink);
    opacity: 0.12;
  }

  /* the scroll thumb ends at the bottom, where the portrait is */
  .diagram .p08-thumb {
    fill: var(--color-ink);
    transform: translateY(232px);
  }

  .diagram .p08-mark {
    font-family: var(--font-heading);
    font-size: 30px;
    font-weight: var(--weight-heading);
  }

  .diagram .p08-avatar {
    stroke: var(--color-ink);
    stroke-width: 1.2;
  }

  .diagram .p08-field {
    stroke: var(--color-ink);
    stroke-width: 1;
    opacity: 0.7;
  }

  .p08-mini {
    max-width: 15rem;
  }

  .p08-pathviz {
    max-width: 22rem;
    margin-inline: auto;
  }

  /* ---------- You, before the services (visuals/p08-you): a sample coach hero,
     the portrait half the width, the offers only below it ---------- */

  .p08-you {
    position: relative;
    padding: var(--space-3);
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--step--1);
    line-height: 1.45;
  }

  .p08-you__hero {
    display: grid;
    gap: var(--space-3);
  }

  .p08-you__copy {
    display: grid;
    gap: 0.75rem;
    align-content: center;
  }

  .p08-you__headline {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--step-3);
    font-weight: var(--weight-heading);
    line-height: 1.15;
  }

  .p08-you__who,
  .p08-you__voice {
    margin: 0;
  }

  .p08-you__who strong {
    font-weight: 600;
  }

  .p08-you__voice {
    max-width: 36ch;
  }

  .p08-you__btn {
    justify-self: start;
    padding: 0.625rem 1rem;
    background: var(--color-ink);
    color: var(--color-white);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  /* a set width: the portrait never takes its width from what is inside it
     (the photo pick panel has none of its own) */
  .p08-you__portrait {
    width: 100%;
    max-width: 18rem;
  }

  .p08-you__offers {
    display: grid;
    gap: 0.5rem;
    margin: var(--space-3) 0 0;
    padding: var(--space-3) 0 0;
    list-style: none;
    border-block-start: var(--border);
  }

  .p08-you__offer {
    position: relative;
    display: grid;
    gap: 0.125rem;
    padding: 0.75rem 0.875rem;
    border: var(--border);
    border-radius: 0.5rem;
  }

  .p08-you__offer strong {
    font-weight: 600;
  }

  .p08-you__offer span:not(.p08-you__dot) {
    font-size: 0.75rem;
  }

  .p08-you__offer--first {
    background: var(--color-brand);
  }

  /* the order's marks: result, person, offer */
  .p08-you__dot {
    display: inline-grid;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    margin-inline-end: 0.5rem;
    background: var(--color-gold-soft);
    border: var(--border);
    border-radius: 50%;
    font-family: var(--font-body);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    vertical-align: 0.125em;
  }

  .p08-you__offer .p08-you__dot {
    position: absolute;
    top: -0.625rem;
    left: -0.625rem;
    margin: 0;
  }

  /* the line from the headline to the portrait to the first offer: two
     arcs drawn with borders, only once the hero has its two columns */
  .p08-you__arc {
    display: none;
  }

  @media (min-width: 48rem) {
    .p08-you {
      padding: var(--space-4);
    }

    .p08-you__hero {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: var(--space-5);
      align-items: center;
    }

    /* the portrait covers the line's ends, so it reads as going in and out of the photo */
    .p08-you__portrait {
      position: relative;
      z-index: 1;
      max-width: 20rem;
      margin-inline: auto;
    }

    .p08-you__offers {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    /* the arcs: two paths over the mock, drawn by p08-you.js from the
       marks' and the portrait's real positions; until then (or without the
       script) nothing shows */
    .p08-you__arc {
      display: block;
      position: absolute;
      inset: 0;
      z-index: 0;
      width: 100%;
      height: 100%;
      overflow: visible;
      pointer-events: none;
    }

    .p08-you__arc path {
      fill: none;
      stroke: var(--color-gold-soft);
      stroke-width: 1.5px;
    }
  }

  /* ---------- Timed demo (blocks/timeddemo): the steps beside the phone.
     Without the script, a strip of small phones, one per step ---------- */

  .timeddemo__head {
    max-width: 44rem;
    margin-block-end: var(--space-5);
  }

  .timeddemo__title {
    margin: 0;
  }

  .timeddemo__intro {
    margin: var(--space-3) 0 0;
    font-size: var(--text-body);
    line-height: var(--leading-body);
  }

  .timeddemo__grid {
    display: grid;
    gap: var(--space-5);
  }

  .timeddemo__aside {
    display: grid;
    gap: var(--space-3);
    align-content: start;
  }

  .timeddemo__setup {
    max-width: 44rem;
  }

  .timeddemo__setup p {
    margin: 0 0 var(--space-2);
  }

  .timeddemo__setup p:last-child {
    margin-block-end: 0;
  }

  .timeddemo__steps {
    display: grid;
    gap: var(--space-1);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .timeddemo__step {
    display: grid;
    grid-template-columns: 1.75rem minmax(0, 1fr);
    column-gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    transition: background-color 240ms var(--ease-out), border-color 240ms var(--ease-out);
  }

  .timeddemo__step.is-now {
    background: var(--color-brand);
    border-color: var(--color-ink);
  }

  .timeddemo__num {
    display: grid;
    grid-row: 1 / span 3;
    place-items: center;
    align-self: start;
    width: 1.75rem;
    height: 1.75rem;
    margin-block-start: 0.125rem;
    background: var(--color-gold-soft);
    border: var(--border);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
  }

  .timeddemo__text {
    grid-column: 2;
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--step-1);
    font-weight: var(--weight-heading);
    line-height: 1.25;
  }

  .timeddemo__checks {
    display: grid;
    grid-column: 2;
    gap: 0.5rem;
    margin: var(--space-2) 0 0;
    padding: 0;
    list-style: none;
  }

  .timeddemo__check {
    display: flex;
    gap: 0.625rem;
    align-items: start;
    font-size: var(--step--1);
    line-height: 1.45;
  }

  .timeddemo__box {
    display: grid;
    flex: none;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    margin-block-start: 0.0625rem;
    background: var(--color-white);
    border: var(--border);
    border-radius: 0.375rem;
    transition: background-color 240ms var(--ease-out);
  }

  .timeddemo__box svg {
    width: 0.875rem;
    height: 0.875rem;
  }

  .timeddemo__check.is-ticked .timeddemo__box {
    background: var(--color-brand);
  }

  .timeddemo__check:not(.is-ticked) .timeddemo__box svg {
    opacity: 0;
  }

  .timeddemo__checktext strong {
    font-weight: 600;
  }

  .timeddemo__answer {
    opacity: 0.75;
  }

  .timeddemo__done {
    grid-column: 2;
    margin: var(--space-2) 0 0;
    font-family: var(--font-heading);
    font-size: var(--step-3);
    font-weight: var(--weight-heading);
    line-height: 1.2;
  }

  .timeddemo__done[hidden],
  .timeddemo__play[hidden],
  .timeddemo__clock[hidden],
  .timeddemo__badge[hidden] {
    display: none;
  }

  .timeddemo__play {
    margin-block-start: var(--space-1);
  }

  .timeddemo__stage {
    position: relative;
    display: grid;
    gap: var(--space-2);
    justify-items: center;
    min-width: 0;
  }

  /* the strip scrolls inside its column; the column never grows to fit it */
  .timeddemo__strip {
    position: relative;
    display: flex;
    gap: var(--space-2);
    width: 100%;
    padding: 0.75rem 0.25rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    contain: inline-size;
  }

  .timeddemo__shot {
    display: grid;
    flex: none;
    gap: 0.5rem;
    justify-items: center;
    width: 9.5rem;
    min-width: 0;
    scroll-snap-align: start;
  }

  .timeddemo__phone {
    width: 100%;
    min-width: 0;
    padding: 0.375rem;
    background: var(--color-white);
    border: 2px solid var(--color-ink);
    border-radius: 1.5rem;
    box-shadow: var(--shadow-hard);
    font-size: 0.6875rem;
    line-height: 1.4;
  }

  .timeddemo__caption {
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-block-start: 0.25rem;
    background: var(--color-gold-soft);
    border: var(--border);
    border-radius: 50%;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
  }

  .timeddemo__bar {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0.75rem 0.125rem;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  .timeddemo__site {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .timeddemo__time {
    font-variant-numeric: tabular-nums;
  }

  .timeddemo__barbtn {
    flex: none;
    padding: 0.1875rem 0.5rem;
    background: var(--color-ink);
    border-radius: 0.125rem;
    color: var(--color-white);
    font-size: 0.5625rem;
    letter-spacing: 0.08em;
    transition: box-shadow 200ms var(--ease-out);
  }

  .timeddemo__barbtn.is-tapped {
    box-shadow: 0 0 0 0.25rem var(--color-brand);
  }

  .timeddemo__screen {
    display: grid;
    gap: 0.5rem;
    align-content: start;
    min-height: 15rem;
    padding: 0.5rem 0.625rem 0.75rem;
  }

  /* a text message */
  .timeddemo__screen--bubble {
    align-content: center;
  }

  .timeddemo__bubble {
    justify-self: start;
    max-width: 88%;
    margin: 0;
    padding: 0.5rem 0.75rem;
    background: var(--color-paper);
    border: var(--border);
    border-radius: 0.875rem 0.875rem 0.875rem 0.25rem;
  }

  .timeddemo__bubble--reply {
    justify-self: end;
    background: var(--color-brand);
    border-radius: 0.875rem 0.875rem 0.25rem 0.875rem;
  }

  /* a search and its results */
  .timeddemo__query {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 0;
    padding: 0.375rem 0.625rem;
    border: var(--border);
    border-radius: var(--radius-pill);
    font-weight: 500;
  }

  .timeddemo__glass {
    position: relative;
    flex: none;
    width: 0.625rem;
    height: 0.625rem;
    border: 1.5px solid currentColor;
    border-radius: 50%;
  }

  .timeddemo__glass::after {
    content: "";
    position: absolute;
    right: -0.25rem;
    bottom: -0.1875rem;
    width: 0.3125rem;
    height: 1.5px;
    background: currentColor;
    transform: rotate(45deg);
  }

  .timeddemo__result {
    display: grid;
    gap: 0.125rem;
    margin: 0;
    padding: 0.5rem 0.625rem;
    border: var(--border);
    border-radius: 0.5rem;
    transition: background-color 200ms var(--ease-out);
  }

  .timeddemo__result strong {
    font-weight: 600;
  }

  .timeddemo__result span {
    font-size: 0.625rem;
    opacity: 0.7;
  }

  .timeddemo__result.is-tapped {
    background: var(--color-brand);
  }

  /* the sample page: its parts light up as the checks tick */
  .timeddemo__part {
    padding: 0.375rem;
    border-radius: 0.5rem;
    transition: background-color 280ms var(--ease-out), box-shadow 280ms var(--ease-out), opacity 280ms var(--ease-out);
  }

  .timeddemo__part.is-lit {
    background: var(--color-brand);
  }

  .timeddemo__part.is-now {
    box-shadow: 0 0 0 0.25rem var(--color-brand);
  }

  .timeddemo.is-timing .timeddemo__part:not(.is-lit) {
    opacity: 0.5;
  }

  .timeddemo__headline {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: var(--weight-heading);
    line-height: 1.15;
  }

  .timeddemo__person {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr);
    gap: 0.625rem;
    align-items: start;
  }

  /* in the narrow phones of the static strip the avatar sits above the lines */
  .timeddemo:not(.is-live) .timeddemo__person {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.375rem;
  }

  .timeddemo__face {
    position: relative;
    width: 2.25rem;
    height: 2.25rem;
    overflow: hidden;
    background: var(--color-butter);
    border: 1px solid var(--color-ink);
    border-radius: 50%;
  }

  .timeddemo__face::before,
  .timeddemo__face::after {
    content: "";
    position: absolute;
    left: 50%;
    background: var(--color-white);
    border-radius: 50%;
    translate: -50% 0;
  }

  .timeddemo__face::before {
    top: 0.4375rem;
    width: 0.75rem;
    height: 0.75rem;
  }

  .timeddemo__face::after {
    top: 1.375rem;
    width: 1.5rem;
    height: 1.25rem;
  }

  .timeddemo__voice p {
    margin: 0 0 0.25rem;
  }

  .timeddemo__voice p:last-child {
    margin-block-end: 0;
  }

  .timeddemo__cta {
    margin: 0;
  }

  .timeddemo__btn {
    display: block;
    padding: 0.5625rem 0.625rem;
    background: var(--color-ink);
    color: var(--color-white);
    font-size: 0.5625rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-align: center;
    text-transform: uppercase;
  }

  /* choices, a switch, a closing screen */
  .timeddemo__label {
    margin: 0;
    font-weight: 600;
  }

  .timeddemo__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .timeddemo__chips li {
    padding: 0.375rem 0.75rem;
    border: var(--border);
    border-radius: var(--radius-pill);
    font-weight: 500;
    transition: background-color 200ms var(--ease-out);
  }

  .timeddemo__chips li.is-tapped {
    background: var(--color-brand);
  }

  .timeddemo__toggle {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 0.5rem 0.625rem;
    border: var(--border);
    border-radius: 0.5rem;
  }

  .timeddemo__switch {
    position: relative;
    flex: none;
    width: 2rem;
    height: 1.125rem;
    background: var(--color-white);
    border: 1px solid var(--color-ink);
    border-radius: var(--radius-pill);
    transition: background-color 240ms var(--ease-out);
  }

  .timeddemo__switch::after {
    content: "";
    position: absolute;
    top: 0.0625rem;
    left: 0.0625rem;
    width: 0.875rem;
    height: 0.875rem;
    background: var(--color-ink);
    border-radius: 50%;
    transition: translate 240ms var(--ease-out);
  }

  .timeddemo__switch.is-tapped {
    background: var(--color-brand);
  }

  .timeddemo__switch.is-tapped::after {
    translate: 0.875rem 0;
  }

  .timeddemo__thanks {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--step-2);
    font-weight: var(--weight-heading);
    line-height: 1.15;
  }

  .timeddemo__note {
    margin: 0;
  }

  /* the ring and the cursor only exist once the script folds the strip */
  .timeddemo__ring,
  .timeddemo__cursor {
    display: none;
  }

  .timeddemo__clock,
  .timeddemo__badge {
    margin: 0;
    padding: 0.375rem 0.875rem;
    background: var(--color-ink);
    border-radius: var(--radius-pill);
    color: var(--color-white);
    font-size: 0.6875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  .timeddemo__badge {
    background: var(--color-butter);
    color: var(--color-ink);
  }

  .timeddemo__outro {
    max-width: 40rem;
    margin: var(--space-5) auto 0;
    font-family: var(--font-heading);
    font-size: var(--step-3);
    font-weight: var(--weight-heading);
    line-height: 1.3;
    text-align: center;
    text-wrap: balance;
  }

  /* ---------- Opt-in parts (the nonprofit page's giving demo): the tap
     tag after a step, the label over the phone, the progress bar, the
     tap counter on the phone, the outro as a small boxed note ---------- */
  .timeddemo__taptag {
    display: inline-block;
    margin-inline-start: 0.25rem;
    padding: 0.1875rem 0.5rem;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    line-height: 1.3;
    text-transform: uppercase;
    vertical-align: 0.3em;
    white-space: nowrap;
  }

  .timeddemo__sample {
    margin: 0;
    padding: 0.25rem 0.75rem;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    line-height: 1.3;
    text-transform: uppercase;
  }

  .timeddemo__progress {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    gap: 0.25rem;
    width: 100%;
    max-width: 16rem;
    margin-block-start: var(--space-1);
  }

  .timeddemo__progress[hidden] {
    display: none;
  }

  .timeddemo__seg {
    display: block;
    height: 0.1875rem;
    overflow: hidden;
    background: var(--color-ink-track);
    border-radius: var(--radius-pill);
  }

  .timeddemo__fill {
    display: block;
    height: 100%;
    background: var(--color-ink);
    transform: scaleX(0);
    transform-origin: left;
  }

  .timeddemo__fill.is-full,
  .timeddemo__fill.is-filling {
    transform: scaleX(1);
  }

  /* the counter only exists while the folded demo plays */
  .timeddemo__counter {
    display: none;
  }

  .timeddemo__countmark {
    position: relative;
    flex: none;
    width: 0.875rem;
    height: 0.875rem;
    border: 1px solid var(--color-ink);
    border-radius: 50%;
  }

  .timeddemo__countmark::after {
    content: "";
    position: absolute;
    inset: 0.1875rem;
    background: var(--color-ink);
    border-radius: 50%;
  }

  /* after the phone in the HTML: on a phone it closes the section; beside
     the phone (60rem up, below) it sits under the steps */
  .timeddemo .timeddemo__outro--note {
    max-width: 44rem;
    margin: 0;
    padding: var(--space-3) var(--space-4);
    background: var(--color-paper);
    border: var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: var(--text-body);
    font-weight: 400;
    line-height: var(--leading-body);
    text-align: start;
    text-wrap: pretty;
  }

  .section--paper .timeddemo .timeddemo__outro--note {
    background: var(--color-white);
  }

  /* Auto-play (timeddemo--auto): the still state is the finished one, one
     phone on the clock step's sample page at the folded size, never the
     strip. The folded rules below show every shot again (stacked in one
     cell) once the demo is live with motion allowed. */
  .timeddemo--auto .timeddemo__shot:not(.timeddemo__shot--final) {
    display: none;
  }

  .timeddemo--auto .timeddemo__strip {
    justify-content: center;
    max-width: 20rem;
    padding: 0;
    overflow: visible;
    contain: none;
  }

  .timeddemo--auto .timeddemo__shot--final {
    width: 100%;
  }

  .timeddemo--auto .timeddemo__caption {
    display: none;
  }

  .timeddemo--auto .timeddemo__phone {
    padding: 0.5rem;
    border-radius: 2rem;
    font-size: 0.8125rem;
  }

  .timeddemo--auto .timeddemo__screen {
    min-height: 22rem;
    padding: var(--space-2) 0.75rem var(--space-3);
  }

  .timeddemo--auto .timeddemo__headline {
    font-size: var(--step-2);
  }

  .timeddemo--auto .timeddemo__btn {
    padding: 0.75rem;
    font-size: 0.6875rem;
  }

  .timeddemo.timeddemo--auto .timeddemo__person {
    grid-template-columns: 2.25rem minmax(0, 1fr);
    gap: 0.625rem;
  }

  /* the parts that come and go (button, clock, closing word, counter):
     data-td-off, not the hidden attribute, so while the demo is live they
     keep their space and nothing below them moves; still, they are gone */
  .timeddemo--auto:not(.is-live) [data-td-off] {
    display: none;
  }

  @media (prefers-reduced-motion: reduce) {
    .timeddemo--auto [data-td-off] {
      display: none;
    }
  }

  @media (prefers-reduced-motion: no-preference) {
    .timeddemo--auto.is-live [data-td-off] {
      visibility: hidden;
    }
  }

  /* The folded demo (is-live: from the server when the diagrams key is on, and
     from timeddemo.js). Only with motion allowed: under reduced motion the
     script does nothing, so the strip shows. Nothing moves after load: the
     parts the script hides and shows keep their space while hidden. */
  @media (prefers-reduced-motion: no-preference) {
    /* With the script: one phone, the shots stacked in one cell, the ring a
       little outside it */
    .timeddemo.is-live .timeddemo__strip {
      display: grid;
      width: 100%;
      max-width: 20rem;
      padding: 0;
      overflow: visible;
      contain: none;
    }

    .timeddemo.is-live .timeddemo__shot {
      display: block;
      grid-area: 1 / 1;
      width: 100%;
      visibility: hidden;
      opacity: 0;
      translate: 0 0.375rem;
      transition: opacity 320ms var(--ease-out), translate 320ms var(--ease-out), visibility 320ms;
    }

    .timeddemo.is-live .timeddemo__shot.is-on {
      visibility: visible;
      opacity: 1;
      translate: 0 0;
    }

    .timeddemo.is-live .timeddemo__caption {
      display: none;
    }

    .timeddemo.is-live .timeddemo__phone {
      padding: 0.5rem;
      border-radius: 2rem;
      font-size: 0.8125rem;
    }

    .timeddemo.is-live .timeddemo__screen {
      min-height: 22rem;
      padding: var(--space-2) 0.75rem var(--space-3);
    }

    .timeddemo.is-live .timeddemo__headline {
      font-size: var(--step-2);
    }

    .timeddemo.is-live .timeddemo__btn {
      padding: 0.75rem;
      font-size: 0.6875rem;
    }

    .timeddemo.is-live .timeddemo__ring {
      display: block;
      position: absolute;
      inset: -0.75rem;
      width: calc(100% + 1.5rem);
      max-width: none;
      height: calc(100% + 1.5rem);
      overflow: visible;
      pointer-events: none;
    }

    .timeddemo__ring-track {
      fill: none;
      stroke: var(--color-ink-track);
      stroke-width: 2;
    }

    .timeddemo__ring-fill {
      fill: none;
      stroke: var(--color-ink);
      stroke-width: 3;
      stroke-linecap: round;
      stroke-dasharray: 1;
      stroke-dashoffset: 1;
    }

    .timeddemo.is-timing .timeddemo__ring-fill {
      stroke-dashoffset: 0;
      transition: stroke-dashoffset var(--td-duration, 10s) linear;
    }

    .timeddemo.is-live .timeddemo__cursor {
      display: block;
      position: absolute;
      top: 0;
      left: 0;
      z-index: 3;
      width: 1.125rem;
      height: 1.125rem;
      margin: -0.5625rem 0 0 -0.5625rem;
      background: var(--color-ink);
      border: 2px solid var(--color-white);
      border-radius: 50%;
      opacity: 0;
      transition: transform 600ms var(--ease-out), opacity 200ms var(--ease-out);
      pointer-events: none;
    }

    .timeddemo.is-live .timeddemo__cursor.is-on {
      opacity: 0.85;
    }

    .timeddemo.is-live .timeddemo__clock {
      margin-block-start: var(--space-2);
    }

    .timeddemo.is-live :is(.timeddemo__done, .timeddemo__clock, .timeddemo__badge)[hidden] {
      display: block;
      visibility: hidden;
    }

    .timeddemo.is-live .timeddemo__play[hidden] {
      display: inline-flex;
      visibility: hidden;
    }

    .timeddemo.is-live .timeddemo__progress[hidden] {
      display: grid;
      visibility: hidden;
    }

    /* the tap counter: a mint chip low on the phone, shown when a counted
       tap lands */
    .timeddemo.is-live .timeddemo__counter {
      display: inline-flex;
      position: absolute;
      bottom: 1.5rem;
      left: 50%;
      z-index: 2;
      gap: 0.375rem;
      align-items: center;
      padding: 0.3125rem 0.75rem;
      background: var(--color-brand);
      border: var(--border);
      border-radius: var(--radius-pill);
      font-size: 0.6875rem;
      font-weight: 600;
      letter-spacing: var(--tracking-caps);
      line-height: 1.3;
      text-transform: uppercase;
      white-space: nowrap;
      opacity: 0;
      translate: -50% 0;
      scale: 0.8;
      transition: opacity 200ms var(--ease-out), scale 320ms var(--ease-pop);
      pointer-events: none;
    }

    .timeddemo.is-live .timeddemo__counter.is-on {
      opacity: 1;
      scale: 1;
    }

    .timeddemo__fill.is-filling {
      transition: transform var(--td-step, 2400ms) linear;
    }
  }

  @media (min-width: 60rem) {
    .timeddemo__grid {
      grid-template-columns: minmax(0, 1fr) minmax(0, 33rem);
      column-gap: var(--space-6);
      align-items: start;
    }

    .timeddemo__text {
      font-size: var(--step-2);
      line-height: 1.2;
    }


    .timeddemo__outro {
      margin-block-start: var(--space-6);
    }

    /* the note under the steps, the phone beside both */
    .timeddemo--note .timeddemo__aside {
      grid-row: 1;
    }

    .timeddemo--note .timeddemo__stage {
      grid-column: 2;
      grid-row: 1 / span 2;
    }

    .timeddemo.timeddemo--note .timeddemo__outro--note {
      grid-column: 1;
      grid-row: 2;
      margin-block-start: calc(var(--space-3) - var(--space-5));
    }
  }

  @media (min-width: 60rem) and (prefers-reduced-motion: no-preference) {
    .timeddemo.is-live .timeddemo__grid {
      grid-template-columns: minmax(0, 1fr) minmax(0, 24rem);
      column-gap: var(--space-7);
    }

    .timeddemo.is-live .timeddemo__stage {
      position: sticky;
      top: calc(var(--header-height) + var(--space-4));
    }
  }
}

@layer motion {
  @media screen and (prefers-reduced-motion: no-preference) {
    /* Live card: the calendar rises in, the check draws once the card is booked */
    .lcard.is-live .p08-cal {
      transition: translate 400ms var(--ease-out) 120ms;
    }

    .lcard.is-live [data-at]:not(.is-on) .p08-cal {
      translate: 0 0.625rem;
    }

    .lcard.is-live .p08-booked__check path {
      stroke-dasharray: 1;
      transition: stroke-dashoffset 480ms var(--ease-out) 320ms;
    }

    .lcard.is-live [data-at]:not(.is-on) .p08-booked__check path {
      stroke-dashoffset: 1;
    }

    /* Problem 01: the warm arrow draws in, then the cold one turns away */
    html[data-fx~="diagrams"] .pb-coach-referral .p08-arrow {
      stroke-dasharray: 1;
      animation: dg-draw 700ms var(--ease-out) both;
    }

    html[data-fx~="diagrams"] .pb-coach-referral .p08-arrow--warm {
      animation-delay: 350ms;
    }

    html[data-fx~="diagrams"] .pb-coach-referral .p08-head--warm {
      animation: dg-fade 300ms var(--ease-out) 950ms both;
    }

    html[data-fx~="diagrams"] .pb-coach-referral .p08-arrow--cold {
      animation-delay: 1250ms;
    }

    html[data-fx~="diagrams"] .pb-coach-referral .p08-head--cold {
      animation: dg-fade 300ms var(--ease-out) 1850ms both;
    }

    /* Problem 02: the cursor wanders between the cards, then leaves */
    html[data-fx~="diagrams"] .pb-coach-offers .p08-trail {
      stroke-dasharray: 1;
      animation: dg-draw 1100ms linear 1300ms both;
    }

    html[data-fx~="diagrams"] .pb-coach-offers .p08-tap {
      animation: dg-fade 300ms var(--ease-out) both;
    }

    html[data-fx~="diagrams"] .pb-coach-offers .p08-tap:nth-of-type(1) { animation-delay: 1500ms; }
    html[data-fx~="diagrams"] .pb-coach-offers .p08-tap:nth-of-type(2) { animation-delay: 1900ms; }
    html[data-fx~="diagrams"] .pb-coach-offers .p08-tap:nth-of-type(3) { animation-delay: 2300ms; }

    html[data-fx~="diagrams"] .pb-coach-offers .p08-leave .p08-trail {
      animation-duration: 600ms;
      animation-delay: 2600ms;
    }

    html[data-fx~="diagrams"] .pb-coach-offers .p08-cursor {
      animation: dg-fade 300ms var(--ease-out) 3000ms both;
    }

    /* Problem 03: the scroll thumb descends to the portrait at the bottom */
    html[data-fx~="diagrams"] .pb-coach-portrait .p08-thumb {
      animation: p08-descend 1700ms var(--ease-out) 1300ms both;
    }

    /* You, before the services (p08-you.js): built once in order when it
       comes into view: 1 the result headline, 2 you, with the line into the
       portrait, 3 the offers, with the line on to the first one. Only
       opacity, a small shift and clips: nothing moves the page */
    .p08-you.is-building [data-you-step] {
      opacity: 0;
      translate: 0 0.5rem;
      transition: opacity 600ms var(--ease-out), translate 600ms var(--ease-out);
    }

    .p08-you.is-at-1 [data-you-step="1"],
    .p08-you.is-at-2 :is([data-you-step="1"], [data-you-step="2"]),
    .p08-you.is-at-3 [data-you-step] {
      opacity: 1;
      translate: 0 0;
    }

    .p08-you.is-building .p08-you__voice[data-you-step] {
      transition-delay: 120ms;
    }

    .p08-you.is-building .p08-you__btn[data-you-step] {
      transition-delay: 240ms;
    }

    .p08-you.is-building .p08-you__arc {
      transition: clip-path 800ms var(--ease-out) 200ms;
    }

    .p08-you.is-building .p08-you__arc--1 {
      clip-path: inset(0 100% 0 0);
    }

    .p08-you.is-building .p08-you__arc--2 {
      clip-path: inset(0 0 0 100%);
    }

    .p08-you.is-at-2 .p08-you__arc--1,
    .p08-you.is-at-3 .p08-you__arc {
      clip-path: inset(0);
    }

    /* One path, one button: the steps light up in turn, the button echoes
       down the page outline */
    html.js-motion .showcase__visual[data-play]:not(.is-in) :is(.p08-step, .p08-btn) {
      opacity: 0;
    }

    html.js-motion .showcase__visual[data-play].is-in :is(.p08-step, .p08-btn) {
      animation: p08-in 480ms var(--ease-out) both;
    }

    html.js-motion .showcase__visual[data-play].is-in .p08-step--1 { animation-delay: 300ms; }
    html.js-motion .showcase__visual[data-play].is-in .p08-step--2 { animation-delay: 600ms; }
    html.js-motion .showcase__visual[data-play].is-in .p08-btn--0 { animation-delay: 1000ms; }
    html.js-motion .showcase__visual[data-play].is-in .p08-btn--1 { animation-delay: 1300ms; }
    html.js-motion .showcase__visual[data-play].is-in .p08-btn--2 { animation-delay: 1600ms; }
    html.js-motion .showcase__visual[data-play].is-in .p08-btn--3 { animation-delay: 1900ms; }

    html.js-motion .showcase__visual[data-play] .p08-echo {
      stroke-dasharray: 1;
      transition: stroke-dashoffset 1200ms var(--ease-out) 1000ms;
    }

    html.js-motion .showcase__visual[data-play]:not(.is-in) .p08-echo {
      stroke-dashoffset: 1;
    }

    /* Proof and room: the quote slides in beside the package; the two side
       cards slide in from the right */
    html.js-motion .minis__drawing[data-play]:not(.is-in) :is(.p08-quote, .p08-side) {
      opacity: 0;
    }

    html.js-motion .minis__drawing[data-play].is-in .p08-quote {
      animation: p08-in 600ms var(--ease-out) 300ms both;
    }

    html.js-motion .minis__drawing[data-play].is-in .p08-side {
      animation: p08-in-side 600ms var(--ease-out) both;
    }

    html.js-motion .minis__drawing[data-play].is-in .p08-side--0 { animation-delay: 300ms; }
    html.js-motion .minis__drawing[data-play].is-in .p08-side--1 { animation-delay: 600ms; }

    /* Timed demo: a check's tick draws, the closing word pops, a tapped
       result or chip settles */
    .timeddemo.is-live .timeddemo__box path {
      stroke-dasharray: 1;
      transition: stroke-dashoffset 320ms var(--ease-out) 80ms;
    }

    .timeddemo.is-live .timeddemo__check:not(.is-ticked) .timeddemo__box path {
      stroke-dashoffset: 1;
    }

    .timeddemo.is-live .timeddemo__done:not([hidden]) {
      animation: timeddemo-pop 480ms var(--ease-pop) both;
    }

    .timeddemo.is-live .timeddemo__badge:not([hidden]) {
      animation: timeddemo-pop 480ms var(--ease-pop) both;
    }

    /* auto-play: the pop plays each time the part comes back */
    .timeddemo--auto.is-live :is(.timeddemo__done, .timeddemo__badge)[data-td-off] {
      animation: none;
    }

    .timeddemo.is-live .timeddemo__shot.is-on :is(.timeddemo__bubble, .timeddemo__result, .timeddemo__chips li) {
      animation: timeddemo-in 360ms var(--ease-out) both;
    }

    .timeddemo.is-live .timeddemo__shot.is-on .timeddemo__bubble--reply {
      animation-delay: 500ms;
    }
  }

  @keyframes p08-descend {
    from {
      transform: translateY(0);
    }
  }

  @keyframes p08-in {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
  }

  @keyframes p08-in-side {
    from {
      opacity: 0;
      transform: translateX(14px);
    }
  }

  @keyframes timeddemo-in {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
  }

  @keyframes timeddemo-pop {
    from {
      opacity: 0;
      transform: scale(0.7);
    }
  }
}
