/* css/sections/37-next.css · G6 · E17: the closing statement of how-it-works
 * no photo (the page already opens on the parts render): the circle as the signature,
 * a bezel of two bare hairline rings (no glow), the words and the two paths beside it */
@layer sections {
  .s-next {
    --next-ring: min(120vw, 34rem);
    position: relative;
    isolation: isolate;
    overflow: clip;
    background: var(--color-paper);
    padding-block: calc(var(--next-ring) * 0.62) var(--gap-b);
  }
  /* decorative: the outer ring with the light inside, lit from above */
  .s-next::before,
  .s-next::after {
    content: "";
    position: absolute;
    z-index: -1;
    aspect-ratio: 1;
    border-radius: 50%;
    pointer-events: none;
  }
  .s-next::before {
    inline-size: var(--next-ring);
    inset-block-start: calc(var(--next-ring) * -0.3);
    inset-inline-end: calc(var(--next-ring) * -0.22);
    background: none;   /* two bare bezel rings, no glow */
    box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--color-ink) 18%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, var(--mask-ink) 30%, transparent 96%);
    mask-image: linear-gradient(to bottom, var(--mask-ink) 30%, transparent 96%);
  }
  /* the inner ring of the bezel, concentric, with a low crema fill where the light lands */
  .s-next::after {
    inline-size: calc(var(--next-ring) * 0.72);
    inset-block-start: calc(var(--next-ring) * -0.3 + var(--next-ring) * 0.14);
    inset-inline-end: calc(var(--next-ring) * -0.22 + var(--next-ring) * 0.14);
    background: none;
    box-shadow: inset 0 0 0 1px var(--color-rule);
    -webkit-mask-image: linear-gradient(to bottom, var(--mask-ink) 20%, transparent 90%);
    mask-image: linear-gradient(to bottom, var(--mask-ink) 20%, transparent 90%);
  }

  .s-next .next__inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
  }

  .s-next .next__body {
    position: relative;
    z-index: var(--z-raised);
    display: grid;
    gap: var(--space-lg);
    min-width: 0;
  }
  .s-next .next__title {
    font: var(--display-weight) var(--text-display-s)/var(--leading-statement) var(--font-display);
    letter-spacing: -0.02em;
    max-width: 14ch;
  }
  .s-next .next__text { color: var(--color-ink-2); max-width: 40ch; }
  .s-next .next__lead { color: var(--color-ink); }
  .s-next .next__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-md);
    padding-block-start: var(--space-md);
  }

  @media (max-width: 22.49em) {
    .s-next .next__actions .btn { width: 100%; }
  }

  /* ≥64em the words hold the left, the bezel sits in the right half, centred on the statement */
  @media (min-width: 64em) {
    .s-next {
      --next-ring: min(40rem, 44vw, 80svh);
      min-block-size: min(80svh, 52rem);
      display: grid;
      align-content: center;
      padding-block: var(--gap-b);
    }
    .s-next::before {
      inset-block-start: 50%;
      inset-inline-end: 6%;
      translate: 0 -50%;
    }
    .s-next::after {
      inset-block-start: 50%;
      inset-inline-end: calc(6% + var(--next-ring) * 0.14);
      translate: 0 -50%;
    }
    .s-next .next__inner { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); }
    .s-next .next__body { grid-column: 1 / 8; grid-row: 1; }
  }
  /* ≥75em the rail offset comes from base (main > [data-section] > .container): the words move right,
   * so the bezel gets smaller and sits closer to the edge, clear of the buttons */
  @media (min-width: 75em) {
    .s-next { --next-ring: min(36rem, 38vw, 76svh); }
    .s-next::before { inset-inline-end: 2%; }
    .s-next::after { inset-inline-end: calc(2% + var(--next-ring) * 0.14); }
  }
}
