/*
 * Holistic wellness page (2026-11-20). Loaded for the class prefix p12-
 * (site/plugins/peanut-site/extensions/stylesheets.php): the live card
 * (livecards/p12-first-session), the three problem drawings
 * (diagrams/problem-p12-words, -nerves, -handoffs) and the three showcase
 * visuals (visuals/p12-visit, p12-explain, p12-choose). The tap hint and
 * the progress bar are the shared ones (snippets/demo/hint, demo/progress,
 * industry.css). Tokens only. Layer blocks for
 * the static state, layer motion for what moves (docs/design/components.md,
 * "Industry pages").
 */

@layer blocks {
  /* ---------- Live card p12-first-session: the two formats, then the
     three lines and the drawn book button. The static card is the
     finished one ---------- */

  .p12-lcard__rows {
    font-size: 0.75rem;
  }

  /* the choosing state fills the card as the finished one does: the two
     formats share the height left under the title */
  .lcard.p12-lcard .lcard__scene.lcard__early {
    display: flex;
    flex-direction: column;
    align-self: stretch;
  }

  .lcard.p12-lcard .lcard__early .lcard__choices {
    flex: 1 0 auto;
    grid-auto-rows: 1fr;
  }

  .lcard.p12-lcard .lcard__early .lcard__choice {
    align-content: center;
  }

  .p12-lcard__btn {
    margin: var(--space-2) 0 0;
    padding: 0.5rem 0.875rem;
    background: var(--color-ink);
    border-radius: var(--radius-pill);
    color: var(--color-white);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-align: center;
    text-transform: uppercase;
    transition: background-color 200ms var(--ease-out), color 200ms var(--ease-out);
  }

  .p12-lcard__btn.is-tapped {
    background: var(--color-brand);
    color: var(--color-ink);
  }

  /* ---------- The problem drawings (Scene drawing "own"): their parts
     beyond the shared drawing classes in blocks.css. The static drawing is
     the finished one ---------- */

  .diagram :is(.p12-ground, .p12-line, .p12-sep, .p12-trail) {
    fill: none;
    stroke: var(--color-ink);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* the ground line every drawing stands on */
  .diagram .p12-ground {
    opacity: 0.2;
  }

  .diagram .p12-sep {
    stroke-width: 1;
    opacity: 0.3;
  }

  .diagram .p12-trail {
    stroke-dasharray: 3 5;
    opacity: 0.55;
  }

  .diagram .p12-card {
    stroke: var(--color-ink);
    stroke-width: 1.2;
  }

  .diagram .p12-day {
    stroke-width: 1.2;
  }

  .diagram .p12-fade {
    opacity: 0.45;
  }

  .diagram .p12-strong {
    font-weight: 600;
  }

  /* the small words in pills and lists: small enough to stay inside them */
  .diagram .p12-tag {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0;
  }

  .diagram .p12-hello {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: var(--weight-heading);
    letter-spacing: 0;
  }

  .diagram .p12-on-ink {
    fill: var(--color-white);
  }

  /* ---------- Your first session (visuals/p12-visit) and Say what a
     session is (visuals/p12-explain), both in blocks/showcase: buttons with
     a pressed state beside a sample page in a browser frame ---------- */

  .p12-visit,
  .p12-explain {
    display: grid;
    gap: var(--space-2);
    margin: 0;
    font-size: var(--step--1);
    line-height: 1.5;
  }

  .p12-visit__cap,
  .p12-explain__cap,
  .p12-visit__kicker,
  .p12-explain__kicker {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  .p12-visit__controls,
  .p12-explain__controls {
    display: grid;
    gap: 0.5rem;
  }

  .p12-visit__controls[hidden],
  .p12-explain__controls[hidden] {
    display: none;
  }

  /* the second choice, In the studio or online, under its own small label */
  .p12-visit__second {
    display: grid;
    gap: 0.5rem;
  }

  .p12-visit__ask {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
  }

  .p12-visit__steps,
  .p12-visit__where,
  .p12-explain__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .p12-visit__btn,
  .p12-explain__chip {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    min-height: 2.75rem;
    margin: 0;
    padding: 0.5rem 1rem;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
    color: var(--color-ink);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
  }

  .p12-visit__btn[aria-pressed="true"],
  .p12-explain__chip[aria-pressed="true"] {
    background: var(--color-ink);
    color: var(--color-white);
  }

  .p12-visit__btn--where[aria-pressed="true"] {
    background: var(--color-brand);
    color: var(--color-ink);
  }

  .p12-visit__btn:focus-visible,
  .p12-explain__chip:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
  }

  .p12-visit__num {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
  }

  .p12-visit__frame,
  .p12-explain__frame {
    overflow: hidden;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-sm);
  }

  .p12-visit__bar,
  .p12-explain__bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin: 0;
    padding: 0.5rem 0.875rem;
    border-block-end: var(--border);
    font-size: 0.75rem;
    overflow-wrap: anywhere;
  }

  /* three small dots, the browser frame's buttons */
  .p12-visit__dots,
  .p12-explain__dots {
    flex: none;
    width: 0.375rem;
    height: 0.375rem;
    margin-inline-end: 1.25rem;
    background: var(--color-ink);
    border-radius: 50%;
    box-shadow: 0.625rem 0 0 var(--color-ink), 1.25rem 0 0 var(--color-ink);
    opacity: 0.45;
  }

  .p12-visit__page,
  .p12-explain__page {
    display: grid;
    gap: 0.625rem;
    padding: var(--space-3);
  }

  .p12-visit__h,
  .p12-explain__h {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--step-2);
    font-weight: var(--weight-heading);
    line-height: 1.2;
  }

  .p12-visit__meta {
    margin: 0;
    font-weight: 500;
  }

  .p12-visit__stack {
    display: grid;
    gap: var(--space-3);
    padding-block-start: 0.625rem;
    border-block-start: 1px solid var(--color-ink-line-faint);
  }

  .p12-visit__step {
    display: grid;
    gap: 0.5rem;
    align-content: start;
  }

  .p12-visit__pair {
    display: grid;
    gap: 0.5rem;
  }

  .p12-visit__line {
    margin: 0;
  }

  /* the place a line belongs to, as a small mint label */
  .p12-visit__tag {
    display: inline-block;
    margin-inline-end: 0.25rem;
    padding: 0.0625rem 0.5rem;
    background: var(--color-mint-pale);
    border-radius: var(--radius-pill);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  /* a drawn button: the sample page's, not a control */
  .p12-visit__book {
    justify-self: start;
    margin: 0.25rem 0 0;
    padding: 0.5rem 0.875rem;
    background: var(--color-ink);
    border-radius: var(--radius-pill);
    color: var(--color-white);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  /* with the script: the steps share one cell, the two versions of a step
     share one cell, so the tallest sets the height and nothing moves */
  .p12-visit.is-live .p12-visit__stack,
  .p12-visit.is-live .p12-visit__pair {
    gap: 0;
  }

  .p12-visit.is-live .p12-visit__step,
  .p12-visit.is-live .p12-visit__line {
    grid-area: 1 / 1;
  }

  .p12-visit.is-live :is(.p12-visit__step, .p12-visit__line)[data-off] {
    visibility: hidden;
  }

  .p12-explain__stack {
    display: grid;
    gap: var(--space-4);
  }

  .p12-explain__set {
    display: grid;
    gap: var(--space-2);
    align-content: start;
  }

  .p12-explain__text {
    margin: 0;
  }

  .p12-explain__note {
    display: grid;
    gap: 0.5rem;
    padding: var(--space-2) var(--space-3);
    background: var(--color-butter);
    border: var(--border);
    border-radius: var(--radius-sm);
  }

  .p12-explain__avoid,
  .p12-explain__say {
    margin: 0;
  }

  /* the struck claim stays in full ink, so it reads at AA */
  .p12-explain__avoid del {
    color: var(--color-ink);
    text-decoration-thickness: 1px;
  }

  .p12-explain__label {
    display: inline-block;
    margin-inline-end: 0.25rem;
    padding: 0.0625rem 0.5rem;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .p12-explain__label--say {
    background: var(--color-brand);
  }

  /* with the script: the four share one cell */
  .p12-explain.is-live .p12-explain__stack {
    gap: 0;
  }

  .p12-explain.is-live .p12-explain__set {
    grid-area: 1 / 1;
  }

  .p12-explain.is-live .p12-explain__set[data-off] {
    visibility: hidden;
  }

  /* ---------- The session chooser (visuals/p12-choose, in blocks/showcase):
     two questions of two answers each in a phone, the session that fits
     under them. Without the script (and in print) the answers are hidden
     and the four results stand one after the other, each headed by its
     answers ---------- */

  .p12-choose {
    display: grid;
    gap: var(--space-2);
    width: 100%;
    max-width: 21rem;
    margin: 0 auto;
    font-size: var(--step--1);
    line-height: 1.4;
  }

  .p12-choose__cap {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  .p12-choose__help {
    display: grid;
    gap: 0.5rem;
  }

  .p12-choose__help[hidden],
  .p12-choose__answers[hidden] {
    display: none;
  }

  .p12-choose__phone {
    padding: 0.5rem;
    background: var(--color-white);
    border: 2px solid var(--color-ink);
    border-radius: 2rem;
    box-shadow: var(--shadow-hard);
  }

  .p12-choose__bar {
    display: flex;
    gap: var(--space-2);
    justify-content: space-between;
    margin: 0;
    padding: 0.5rem 0.875rem 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  .p12-choose__time {
    font-variant-numeric: tabular-nums;
  }

  .p12-choose__screen {
    display: grid;
    gap: var(--space-2);
    padding: var(--space-1) 0.625rem var(--space-3);
  }

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

  .p12-choose__q {
    display: grid;
    gap: 0.5rem;
  }

  /* without the script the answers are hidden, so the bare questions are
     too (each result is headed by its answers); they stay in the text for
     screen readers, as .visually-hidden does */
  .p12-choose:not(.is-live) .p12-choose__q {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .p12-choose__ask {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    margin: 0;
    font-weight: 600;
  }

  /* the question's number, a small ink disc */
  .p12-choose__num {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    background: var(--color-ink);
    border-radius: 50%;
    color: var(--color-white);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
  }

  .p12-choose__answers {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.5rem;
  }

  .p12-choose__btn {
    min-height: 2.75rem;
    margin: 0;
    padding: 0.5rem 0.625rem;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-sm);
    color: var(--color-ink);
    font: inherit;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
  }

  .p12-choose__btn[aria-pressed="true"] {
    background: var(--color-ink);
    color: var(--color-white);
  }

  .p12-choose__btn:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
  }

  .p12-choose__results {
    display: grid;
    gap: var(--space-3);
    padding-block-start: var(--space-2);
    border-block-start: 1px solid var(--color-ink-line-faint);
  }

  .p12-choose__result {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  /* the answers a result belongs to: only without the script and in print */
  .p12-choose__for {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .p12-choose.is-live .p12-choose__for {
    display: none;
  }

  .p12-choose__title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--step-1);
    font-weight: var(--weight-heading);
    line-height: 1.2;
  }

  /* a result with fewer rows than the tallest keeps its rows in the
     middle of the room between its title and its button */
  .p12-choose__rows {
    display: grid;
    flex: 1 0 auto;
    gap: 0;
    align-content: center;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  /* plain list rows with a small tick and a hairline between them, so
     they read as the session's details, not as more answers */
  .p12-choose__row {
    position: relative;
    padding: 0.5625rem 0 0.5625rem 1.375rem;
  }

  .p12-choose__row + .p12-choose__row {
    border-block-start: 1px solid var(--color-ink-line-faint);
  }

  .p12-choose__row::before {
    content: "";
    position: absolute;
    inset-block-start: 0.875rem;
    inset-inline-start: 0.25rem;
    width: 0.3125rem;
    height: 0.5625rem;
    border-block-end: 2px solid var(--color-ink);
    border-inline-end: 2px solid var(--color-ink);
    transform: rotate(45deg);
  }

  /* a drawn button: the sample site's, not a control. It sits at the
     bottom of every result, so nothing is empty under it */
  .p12-choose__book {
    margin: auto 0 0;
    padding: 0.625rem 0.875rem;
    background: var(--color-ink);
    border-radius: var(--radius-pill);
    color: var(--color-white);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-align: center;
    text-transform: uppercase;
  }

  /* with the script: the four results share one cell, the tallest sets the
     height, and only the one that fits is seen */
  .p12-choose.is-live .p12-choose__results {
    gap: 0;
  }

  .p12-choose.is-live .p12-choose__result {
    grid-area: 1 / 1;
  }

  .p12-choose.is-live .p12-choose__result[data-off] {
    visibility: hidden;
  }

  /* the live card in print: the finished card, even mid-loop */
  @media print {
    .lcard.p12-lcard.is-live .lcard__scene.lcard__early {
      visibility: hidden;
      opacity: 0;
    }

    .lcard.p12-lcard.is-live .lcard__scene:not(.lcard__early) {
      visibility: visible;
      opacity: 1;
      translate: none;
    }

    .lcard.p12-lcard .lcard__cursor {
      display: none;
    }
  }

  /* Print: no buttons, hints or bars; every step, both versions, all four
     practices and all four sessions, one after the other, as without the
     script (each session headed by its answers) */
  @media print {
    .p12-visit__controls,
    .p12-explain__controls,
    .p12-choose__help,
    .p12-choose__answers,
    .p12-choose__q {
      display: none;
    }

    .p12-visit.is-live .p12-visit__stack,
    .p12-visit.is-live .p12-visit__pair,
    .p12-explain.is-live .p12-explain__stack,
    .p12-choose.is-live .p12-choose__results {
      display: block;
    }

    .p12-visit.is-live :is(.p12-visit__step, .p12-visit__line)[data-off],
    .p12-explain.is-live .p12-explain__set[data-off],
    .p12-choose.is-live .p12-choose__result[data-off] {
      visibility: visible;
    }

    .p12-choose.is-live .p12-choose__for {
      display: block;
    }

    .p12-visit.is-live .p12-visit__step + .p12-visit__step,
    .p12-visit.is-live .p12-visit__line + .p12-visit__line,
    .p12-explain.is-live .p12-explain__set + .p12-explain__set,
    .p12-choose.is-live .p12-choose__result + .p12-choose__result {
      margin-block-start: var(--space-2);
    }

    .p12-choose__result {
      break-inside: avoid;
    }
  }
}

@layer motion {
  @media screen and (prefers-reduced-motion: no-preference) {
    /* A drawing waits until it is seen: beside the rows, when its row
       becomes current; on phones, when its still scrolls into view */
    html.js-motion .pscene--own[data-play]:not(.is-in) .pscene__own .p12-drawing :is(.pb-step, .dg-cursor),
    html.js-motion .pscene--own .pscene__own:not(.is-active) .p12-drawing :is(.pb-step, .dg-cursor),
    html.js-motion .pscene--own .pscene__still[data-play]:not(.is-in) .p12-drawing :is(.pb-step, .dg-cursor) {
      animation-play-state: paused;
    }

    /* 01: the cursor leaves the vague words for someone else's explainer */
    html[data-fx~="diagrams"] .diagram--problem .p12-leave {
      animation: p12-leave 1800ms var(--ease-out) 1900ms both;
    }

    /* 02: the cursor comes from the questions toward Book now, and stops short */
    html[data-fx~="diagrams"] .diagram--problem .p12-hesitate {
      animation: p12-hesitate 2000ms var(--ease-out) 1900ms both;
    }

    /* 03: the dot drops between two stops, the cursor arrives at the paper form */
    html[data-fx~="diagrams"] .diagram--problem .p12-drop {
      animation: p12-drop 900ms var(--ease-out) 1700ms both;
    }

    html[data-fx~="diagrams"] .diagram--problem .p12-retype {
      animation: p12-retype 1400ms var(--ease-out) 2200ms both;
    }

    /* the visuals: the step, practice or session shown rises in when it
       changes */
    .p12-visit.is-live :is(.p12-visit__step, .p12-visit__line):not([data-off]),
    .p12-explain.is-live .p12-explain__set:not([data-off]),
    .p12-choose.is-live .p12-choose__result:not([data-off]) {
      animation: p12-rise 420ms var(--ease-out) both;
    }

    /* the chooser while it plays: a short ring on the answer it changes */
    .p12-choose.is-playing .p12-choose__btn.is-tapped {
      animation: p12-tap 900ms var(--ease-out) both;
    }
  }

  @keyframes p12-leave {
    0% {
      opacity: 0;
      transform: translate(-200px, 60px);
    }

    25% {
      opacity: 1;
    }

    60% {
      transform: translate(-90px, 30px);
    }

    100% {
      transform: none;
    }
  }

  @keyframes p12-hesitate {
    0% {
      opacity: 0;
      transform: translate(110px, -80px);
    }

    25% {
      opacity: 1;
    }

    65% {
      transform: translate(-22px, 6px);
    }

    100% {
      transform: none;
    }
  }

  @keyframes p12-drop {
    0% {
      opacity: 0;
      transform: translateY(-140px);
    }

    30% {
      opacity: 1;
    }

    100% {
      transform: none;
    }
  }

  @keyframes p12-retype {
    0% {
      opacity: 0;
      transform: translate(-40px, -120px);
    }

    30% {
      opacity: 1;
    }

    100% {
      transform: none;
    }
  }

  @keyframes p12-tap {
    0% {
      box-shadow: 0 0 0 0 var(--color-brand);
    }

    35% {
      box-shadow: 0 0 0 0.375rem var(--color-brand);
    }

    100% {
      box-shadow: 0 0 0 0 var(--color-brand);
    }
  }

  @keyframes p12-rise {
    0% {
      opacity: 0;
      transform: translateY(6px);
    }

    100% {
      opacity: 1;
      transform: none;
    }
  }
}
