/* Method section + animated "gradient ascent" chart
   Source: Figma "Northbeam-Final", node 52:4282 (Wrapper Boxed). The chart replaces the Figma placeholder image.
   Values: css/tokens.css (Method block). Chart behaviour: js/method-chart.js. Reveal: data-reveal (js/motion.js).

   Desktop (1025px and wider): text on the left two thirds, the button under it, and the chart tucked in underneath,
   right-aligned and overlapping the bottom of the text block, as in Figma.
   Tablet and mobile (1024px and below): everything in one column, chart full width below the button. */

.method {
  background: var(--color-snow);
  color: var(--color-ink);
  padding: var(--outputs-pad-y) var(--outputs-pad-x) var(--method-pad-bottom);
}
.method__inner {
  display: flex;
  flex-direction: column;
  max-width: var(--outputs-max-width);
  margin-inline: auto;
}

/* ---------- Text block (max-width includes the 80px inner padding, as in Figma) ---------- */
.method__head {
  position: relative;                      /* above the chart where they overlap */
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  row-gap: var(--outputs-gap);
  column-gap: var(--outputs-gap);
  padding-inline: var(--outputs-inner-pad-x);
}
.method__titles { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.method__label {
  margin: 0;
  font: var(--type-weight-regular) var(--type-size-32)/var(--type-line-height-36) var(--type-family-display);
  color: var(--color-ink-70);
}
.method__title {
  margin: 0;
  font: var(--type-weight-regular) var(--type-size-section-title)/1 var(--type-family-display);
  letter-spacing: var(--type-tracking-minus-064);
  color: var(--color-ink);
}
.method__title em { font-style: normal; color: var(--color-accent); }
.method__intro {
  margin: 0;
  max-width: 640px;
  font: var(--type-weight-regular) var(--type-size-18)/var(--type-line-height-26) var(--type-family-body);
  letter-spacing: var(--type-tracking-03);
  color: var(--color-ink-80);
}
.method__intro strong { font-weight: var(--type-weight-semibold); }
.method__action { grid-column: 1; grid-row: 2; justify-self: start; align-self: end; }

/* ---------- Chart ---------- */
.method__chart {
  position: relative;
  z-index: 0;
  align-self: flex-end;
  width: var(--method-chart-width);        /* 997 / 1240 */
  aspect-ratio: 997 / 495;
  margin-top: var(--method-chart-overlap); /* tucks under the button row */
  pointer-events: none;                    /* never blocks the button it overlaps */
}
.method__chart canvas {
  position: absolute;
  left: 0;
  top: calc(var(--method-chart-headroom) * -1);   /* extra strip above the chart so peak labels are never cut off */
  width: 100%;
  height: calc(100% + var(--method-chart-headroom));
  display: block;
}

/* ---------- Tablet and mobile ---------- */
@media (max-width: 1024px) {
  .method { padding-bottom: var(--outputs-pad-y); }
  .method__head { grid-template-columns: minmax(0, 1fr); padding-inline: 0; }
  .method__action { grid-row: auto; }
  .method__chart {
    align-self: stretch;
    width: 100%;
    aspect-ratio: auto;
    height: clamp(320px, 62vw, 495px);
    margin-top: var(--outputs-card-gap);
  }
}
