/*
 * Founder block (docs/design/components.md, "Founder"): home and About. Linked
 * in the head where the markup has it (peanut_scoped_css()). Layer: blocks.
 * The stage stacks, back to front: the mint shape, the coral line, the
 * cut-out, then (variant A) the line's front arc.
 */

@layer blocks {
  .block-founder {
    overflow-x: clip;
  }

  /* --founder-stage is the cut-out's widest. The portrait column adds room for
     the shape and the line, which reach past the cut-out, so the 64px gap is
     measured from them to the text. */
  .founder {
    --founder-height: 28.75rem;
    --founder-stage: calc(var(--founder-height) * 15 / 16);
    --founder-reach: 1.22;
    display: grid;
    gap: var(--space-5);
  }

  .founder--about {
    --founder-height: 35rem;
  }

  .founder__portrait {
    min-width: 0;
    margin: 0;
  }

  /* The cut-out's crop: 15 wide by 16 tall */
  .founder__stage {
    position: relative;
    isolation: isolate;
    width: min(calc(100% / var(--founder-reach)), var(--founder-stage));
    aspect-ratio: 15 / 16;
    margin-inline: auto;
  }

  .founder__shape {
    position: absolute;
    z-index: 0;
    inset: 44% -9% -3%;
    border-radius: 56% 44% 50% 50% / 46% 54% 46% 54%;
    background: var(--color-brand);
  }

  .founder__line {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    fill: none;
    stroke: var(--color-accent-2);
    stroke-linecap: round;
    stroke-width: 1.5;
  }

  .founder__line path {
    vector-effect: non-scaling-stroke;
  }

  .founder__line--back {
    z-index: 1;
  }

  .founder__line--front {
    z-index: 3;
  }

  /* The straight crop becomes a curve inside the mint shape: she sits in it */
  .founder__photo {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    clip-path: ellipse(64% 66% at 50% 34%);
  }

  .founder__caption {
    margin-block-start: var(--space-4);
    font-size: var(--step--1);
    text-align: center;
  }

  .founder--b .founder__caption {
    margin-block-start: var(--space-5);
  }

  .founder__body {
    position: relative;
    min-width: 0;
    max-width: 35rem;
    margin-inline: auto;
  }

  .founder__title {
    margin: var(--space-1) 0 var(--space-3);
    font-family: var(--font-heading);
    font-size: var(--step-4);
    font-weight: var(--weight-display);
    line-height: var(--leading-heading);
  }

  .founder__text > :last-child {
    margin-block-end: 0;
  }

  .founder__signature {
    margin-block: var(--space-3) 0;
  }

  .founder__body .button-group {
    margin-block-start: var(--space-3);
  }

  /* The heading's top lines up with the top of her head, 2.8 percent down the
     crop; the eyebrow sits above that line, out of the flow, so the text and
     the photo share their top and stay centered on each other. */
  @media (min-width: 60rem) {
    .founder {
      grid-template-columns: minmax(0, calc(var(--founder-stage) * var(--founder-reach))) minmax(0, 35rem);
      justify-content: center;
      gap: var(--space-6);
    }

    .founder--about {
      --founder-height: min(35rem, 39vw);
    }

    .founder--right {
      grid-template-columns: minmax(0, 35rem) minmax(0, calc(var(--founder-stage) * var(--founder-reach)));
    }

    .founder--right .founder__portrait {
      order: 2;
    }

    .founder__body {
      --space-label: 0px;
      margin: calc(var(--founder-height) * 0.028) 0 0;
    }

    .founder__body > .eyebrow {
      position: absolute;
      inset-block-end: 100%;
      margin-block-end: var(--space-2);
    }
  }

  @media (max-width: 47.9375rem) {
    .founder {
      --founder-height: 17.5rem;
    }
  }
}
