/* The paths express the actual three sources of information and their purpose. */
.method-demo {
  --method-duration: 6000ms;
  --method-ease: cubic-bezier(0.23, 1, 0.32, 1);
  border-top: 1px solid var(--line);
  padding-top: 32px;
}
.method-demo [hidden] {
  display: none !important;
}
.method-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 32px;
}
.method-heading .three-legs {
  margin: 0;
  max-width: 58ch;
}
.method-play {
  flex-shrink: 0;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cream);
  font: 12px/1.7 var(--body);
  cursor: pointer;
}
.method-demo button:focus-visible,
.method-demo [role="tabpanel"]:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 5px;
}
.method-play:hover {
  border-color: var(--lime);
}
.method-visual {
  position: relative;
  height: 320px;
  margin-block: 40px;
  isolation: isolate;
}
.method-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  z-index: -1;
}
.method-lines-mobile {
  display: none;
}
.method-wire {
  fill: none;
  stroke: var(--line);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.method-sources {
  position: absolute;
  left: 0;
  inset-block: 0;
  width: 26%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.method-source {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  min-height: 88px;
  border: 1px solid var(--line);
  background: var(--black);
  transition:
    border-color 280ms var(--method-ease),
    background 280ms var(--method-ease);
}
.method-source > span {
  color: var(--muted);
  font-size: 11px;
}
.method-source p {
  font-family: var(--title);
  font-size: 16px;
  line-height: 1.5;
}
.method-coach {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: var(--black);
  padding: 12px;
}
.method-portrait {
  position: relative;
  width: 104px;
  height: 104px;
  overflow: hidden;
  border: 2px solid var(--lime);
  border-radius: 50%;
}
.method-portrait img {
  /* Keep the existing face centre without enlarging a small composited layer.
     At 5.5x the 1600px photo also supplies enough pixels for a 3x Retina circle. */
  position: absolute;
  width: 550%;
  height: 550%;
  max-width: none;
  left: -18.0625%;
  top: -212.96875%;
  object-fit: cover;
  object-position: 0 0;
  transform: none;
}
.method-coach > p {
  margin-top: 12px;
  font-size: 12px;
}
.method-output {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 26%;
  padding: 24px;
  background: var(--surface);
  border-left: 3px solid var(--line);
  /* Switch text and background together: intermediate colour blends lose contrast. */
  transition: border-left-color 400ms var(--method-ease);
}
.method-output > span {
  display: block;
  font-size: 11px;
  line-height: 1.8;
}
.method-output > p {
  font-family: var(--title);
  font-size: 26px;
  line-height: 1.25;
  margin-block: 16px;
}
.method-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--line);
}
.method-tabs button {
  position: relative;
  padding: 16px 12px;
  min-height: 68px;
  text-align: left;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-bottom: 3px solid transparent;
  font: 14px/1.6 var(--body);
  cursor: pointer;
}
.method-tabs button > span {
  display: block;
  font-size: 11px;
  margin-bottom: 4px;
}
.method-tabs button[aria-selected="true"] {
  color: var(--lime);
  border-bottom-color: var(--lime);
}
.method-tabs button:hover {
  color: var(--cream);
}
.method-demo.is-enhanced .weekly-layout {
  display: block;
  min-height: 340px;
  padding-top: 32px;
}
.method-demo.is-enhanced .weekly-inputs {
  display: contents;
}
.method-demo.is-enhanced .weekly-input {
  border-top: 0;
  padding: 0;
  max-width: 80ch;
}
.method-demo.is-enhanced .weekly-input h3 {
  font-size: clamp(22px, 2vw, 28px);
}
.method-demo.is-enhanced .weekly-input p {
  font-size: 16px;
}
.method-demo.is-enhanced .weekly-decision {
  padding: 32px;
}
.method-demo.is-enhanced .weekly-decision h3 {
  margin-top: 12px;
}
.method-demo.is-enhanced .weekly-decision > p:not(.eyebrow) {
  margin-top: 16px;
}
.method-demo.is-enhanced .weekly-decision .section-footnote {
  margin-top: 20px;
  padding-top: 20px;
}
.method-demo[data-phase="0"] [data-source="0"],
.method-demo[data-phase="1"] [data-source="1"],
.method-demo[data-phase="2"] [data-source="2"],
.method-demo[data-phase="3"] .method-source {
  border-color: var(--lime);
  background: var(--surface);
}
.method-demo[data-phase="3"] .method-output {
  background: var(--lime);
  color: var(--black);
  border-left-color: var(--lime);
}
@media (prefers-reduced-motion: no-preference) {
  .method-demo.is-enhanced .method-tabs button[aria-selected="true"]::after {
    content: "";
    position: absolute;
    inset: auto 0 -3px;
    height: 3px;
    background: var(--cream);
    transform-origin: left;
    animation: method-step-progress var(--method-duration) linear both;
  }
  .method-demo[data-playing="false"] .method-tabs button::after {
    animation-play-state: paused !important;
  }
  @keyframes method-step-progress {
    from {
      transform: scaleX(0);
    }
    to {
      transform: scaleX(1);
    }
  }
  .method-demo.is-enhanced[data-phase="0"] .method-wire[data-flow="0"],
  .method-demo.is-enhanced[data-phase="1"] .method-wire[data-flow="1"],
  .method-demo.is-enhanced[data-phase="2"] .method-wire[data-flow="2"],
  .method-demo.is-enhanced[data-phase="3"] .method-wire[data-flow="3"] {
    stroke: var(--lime);
    stroke-dasharray: 12 12;
    animation: method-transfer 1600ms linear infinite;
  }
  .method-demo[data-playing="false"] .method-wire {
    animation-play-state: paused !important;
  }
  .method-demo.is-enhanced [role="tabpanel"]:not([hidden]) {
    animation: method-panel-enter 400ms var(--method-ease) both;
  }
  @keyframes method-transfer {
    to {
      stroke-dashoffset: -48;
    }
  }
  @keyframes method-panel-enter {
    from {
      transform: translateY(12px);
    }
    to {
      transform: none;
    }
  }
}
@media (max-width: 1000px) {
  .method-source {
    padding: 16px 12px;
    gap: 12px;
  }
  .method-source p {
    font-size: 14px;
  }
  .method-output {
    padding: 20px;
  }
  .method-output > p {
    font-size: 22px;
  }
}
@media (max-width: 760px) {
  .method-heading {
    flex-direction: column;
    gap: 16px;
  }
  .method-visual {
    height: 520px;
    margin-block: 32px;
  }
  .method-lines-desktop {
    display: none;
  }
  .method-lines-mobile {
    display: block;
  }
  .method-sources {
    width: 100%;
    inset: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .method-source {
    flex-direction: column;
    align-items: start;
    gap: 8px;
    padding: 12px;
    min-height: 112px;
  }
  .method-source p {
    font-size: 12px;
  }
  .method-coach {
    top: 53%;
  }
  .method-portrait {
    width: 96px;
    height: 96px;
  }
  .method-output {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    transform: none;
    padding: 20px 24px;
  }
  .method-output > p {
    font-size: 24px;
    margin-block: 8px;
  }
  .method-output > span:last-child {
    font-size: 12px;
  }
  .method-tabs {
    grid-template-columns: 1fr 1fr;
  }
  .method-tabs button {
    font-size: 13px;
    padding: 12px;
    min-height: 64px;
  }
  .method-tabs button > span {
    display: inline;
    margin-right: 8px;
  }
  .method-demo.is-enhanced .weekly-layout {
    min-height: 560px;
    padding-top: 24px;
  }
  .method-demo.is-enhanced .weekly-input h3 {
    font-size: 22px;
  }
  .method-demo.is-enhanced .weekly-decision {
    padding: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .method-demo *,
  .method-demo *::before,
  .method-demo *::after {
    animation: none !important;
    transition: none !important;
  }
}
