/*
 * Method: three design principles, each with one specified figure
 * (DESIGN_SPEC_A 9.13).
 *
 * Entries are hairline-separated, the copy sits in a narrower column than the
 * figure, and the figures alternate sides and differ in width so the three
 * never read as identical rows. Figures are inline SVG with real <text>
 * labels; the only motion is a one-time stroke reveal driven by these
 * transitions, so the section never asks for an animation frame.
 */

.method {
  padding-top: var(--section-y);
}

.method-head {
  max-width: 46ch;
  margin-bottom: clamp(2.5rem, 5vw, 4.25rem);
}

.method-principle {
  border-top: 1px solid var(--line);
  padding-top: clamp(1.5rem, 2.3vw, 2.25rem);
  padding-bottom: clamp(2.5rem, 5vw, 4.25rem);
}

.method-principle:last-child {
  padding-bottom: 0;
}

.method-index {
  font-family: var(--mono);
  font-size: var(--type-mono);
  line-height: var(--lh-mono);
  letter-spacing: var(--track-mono);
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: 0.9rem;
}

.method-title {
  font-size: var(--type-section);
  line-height: var(--lh-section);
  letter-spacing: var(--track-section);
  font-weight: 600;
  text-wrap: balance;
}

.method-text {
  margin-top: 1.05rem;
  font-size: var(--type-body);
  line-height: var(--lh-body);
  color: var(--ink-muted);
  /* Holds the measure at 62 to 67 characters wherever there is room for it. */
  max-width: 31.5rem;
}

/* Figures ------------------------------------------------------------ */

.mfig {
  margin: 0;
  width: 100%;
}

.mfig--socket {
  max-width: 520px;
}

.mfig--seal {
  max-width: 560px;
}

.mfig--space {
  max-width: 540px;
}

.mfig-svg {
  display: block;
  width: 100%;
  height: auto;
}

.mfig .s,
.mfig .s-strong,
.mfig .s-thin,
.mfig .s-soft,
.mfig .s-faint,
.mfig .s-accent {
  fill: none;
  stroke-width: 1;
  /* Butt caps: a round cap on a fully dashed-out stroke leaves a visible dot
     before the reveal has run. */
  stroke-linecap: butt;
  stroke-linejoin: round;
}

.mfig .s-strong {
  stroke: var(--ink-faint);
}

.mfig .s {
  stroke: var(--line-strong);
}

/* Second weight: secondary detail sits behind the structure without
   competing with it. */
.mfig .s-thin {
  stroke: var(--line-strong);
  stroke-width: 0.75;
  stroke-opacity: 0.72;
}

.mfig .s-soft {
  stroke: var(--line);
}

.mfig .s-faint {
  stroke: var(--ink-faint);
  stroke-opacity: 0.5;
}

.mfig .s-accent {
  stroke: var(--accent);
  stroke-width: 1.5;
}

.mfig .f-accent {
  fill: var(--accent);
  stroke: none;
}

.mfig text {
  font-family: var(--mono);
  /* Figure labels follow the mono token, never a per-scene size. */
  font-size: var(--type-mono);
  letter-spacing: var(--track-mono-value);
  fill: var(--ink);
  /* A line passing behind a label reads as clear space, not a strikethrough. */
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 3px;
  stroke-linejoin: round;
  font-weight: 600;
}

.mfig text.t-strong {
  fill: var(--ink);
}

/* One-time reveal: strokes draw, everything else fades, then it is over. */
.mfig [data-draw] {
  transition: stroke-dashoffset 540ms var(--ease-css) var(--delay, 0ms);
}

.mfig.is-drawn [data-draw] {
  stroke-dashoffset: 0 !important;
}

.mfig text,
.mfig [data-fade] {
  opacity: 0;
  transition: opacity 320ms var(--ease-css) var(--delay, 0ms);
}

.mfig.is-drawn text,
.mfig.is-drawn [data-fade] {
  opacity: 1;
}

.mfig.is-instant,
.mfig.is-instant * {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .mfig,
  .mfig * {
    transition: none !important;
  }
}

/* Layout ------------------------------------------------------------- */

@media (min-width: 1120px) {
  /* Copy in the narrower column, figure in the wider one, sides alternating. */
  .method-principle {
    display: grid;
    grid-template-columns: minmax(0, 33rem) minmax(0, 35rem);
    column-gap: clamp(40px, 4.4vw, 64px);
    align-items: start;
  }

  .method-index,
  .method-title,
  .method-body {
    grid-column: 1;
  }

  .mfig {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
    justify-self: start;
  }

  .method-principle:nth-child(even) .method-index,
  .method-principle:nth-child(even) .method-title,
  .method-principle:nth-child(even) .method-body {
    grid-column: 2;
  }

  .method-principle:nth-child(even) .mfig {
    grid-column: 1;
    justify-self: end;
  }
}

@media (max-width: 1119px) {
  .mfig {
    margin-top: clamp(1.75rem, 4vw, 2.5rem);
  }
}
