.md-home-section-stack {
  position: relative;
  z-index: 1;
  isolation: isolate;
  margin-block: 0 !important;
  width: 100%;
  max-width: none !important;
}

.md-home-section-stack > .md-exhibition-section,
.md-biography-sequence > .md-home-biography {
  margin-block: 0 !important;
}

.wp-site-blocks .md-home-biography {
  --md-button-idle-ink: #fff;
  --md-button-idle-border: #fff;
  --md-button-focus-color: #fff;
  --md-button-contrast-fill: #fff;
  --md-button-contrast-ink: var(--md-ink);
  box-sizing: border-box;
  padding: 0 !important;
  background: var(--md-ink) !important;
  color: #fff;
}

.wp-site-blocks .md-home-biography > .md-biography-stage {
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
  position: relative;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--md-home-gutter);
  padding-block: calc(2 * var(--md-home-gutter));
  padding-inline: var(--md-page-start) var(--md-page-end);
}

.wp-site-blocks .md-home-biography-copy {
  width: max-content;
  max-width: 100%;
  color: #fff;
}

.wp-site-blocks .md-home-biography-copy :is(h3, p) {
  color: #fff !important;
}

.wp-site-blocks .md-home-biography .md-home-biography-title {
  margin: 0;
  font: var(--md-home-display-font) !important;
  letter-spacing: var(--md-home-display-tracking);
  text-transform: none !important;
  overflow-wrap: anywhere;
}

.wp-site-blocks .md-home-biography-copy > p:not(:empty) {
  max-inline-size: 36ch;
  margin-block: var(--md-home-copy-gap) 0 !important;
  font: var(--md-home-copy-font) !important;
  text-wrap: pretty;
}

/* Preserve the heading's position after removing the small name line. */
@media (min-width: 701px) {
  .wp-site-blocks .md-home-biography-copy::before {
    content: "";
    display: block;
    font: var(--md-home-copy-font);
    height: 1lh;
    margin-block-end: var(--md-home-gutter);
  }
}

.md-home-biography-copy .wp-block-buttons {
  margin-block-start: var(--md-home-copy-gap) !important;
}

.md-biography-side-name,
.md-biography-portrait {
  display: none;
}

.wp-site-blocks .md-biography-atelier {
  margin: 0 !important;
  max-width: none !important;
}

.md-biography-atelier:not(.md-biography-works) img,
.md-biography-portrait,
.md-pencil-frame img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  border-radius: 0 !important;
  filter: grayscale(1);
}

.md-biography-works {
  position: relative;
  aspect-ratio: 6 / 5;
  overflow: hidden;
}

.md-biography-works-link {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.md-biography-works-link:focus-visible {
  outline: 1px solid #fff;
  outline-offset: -3px;
  position: relative;
  z-index: 1;
}

.md-biography-works-link img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  visibility: hidden;
}

.md-biography-works-link img.is-current {
  visibility: visible;
}

.md-pencil-scene {
  position: relative;
  margin-block: 0 !important;
}

.md-pencil-frame {
  height: min(65svh, 62vw);
  background: #fff;
}

.md-pencil-frame > img {
  opacity: var(--md-pencil-opacity, 1);
}

/* The feed and footer share an opaque foreground with a single scroll endpoint. */
.wp-site-blocks:has(> .md-home-finale:last-child) {
  padding-block-end: 0 !important;
}

.md-home-finale {
  margin-block: 0;
  max-width: none !important;
}

.md-home-end-panel {
  position: relative;
  z-index: 2;
  isolation: isolate;
  background: #fff;
}

.md-home-end-panel > footer {
  position: relative !important;
  inset: auto !important;
  background: #fff !important;
}

.md-home-end-panel .md-site-footer-content > p {
  color: var(--md-ink) !important;
}

@media (min-width: 900px) and (min-height: 560px) and (prefers-reduced-motion: no-preference) {
  .md-biography-sequence {
    position: relative;
    z-index: 1;
    --md-biography-travel: .81;
  }

  .md-biography-sequence::after {
    content: '';
    display: block;
    height: calc(100svh * var(--md-biography-travel) + 24svh);
  }

  .md-biography-sequence > .md-home-biography {
    position: sticky;
    top: min(0px, calc(100svh - var(--md-biography-height, 100svh)));
    overflow: clip;
  }

  .wp-site-blocks .md-home-biography > .md-biography-stage {
    --md-bio-progress: 0;
    --md-bio-remaining: calc(1 - var(--md-bio-progress));
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: max-content minmax(clamp(128px, 22svh, 240px), 1fr);
    align-items: start;
    gap: var(--md-home-copy-gap);
    min-height: 100svh;
    padding: 0 0 var(--md-home-gutter);
  }

  .wp-site-blocks .md-home-biography-copy {
    grid-area: 1 / 1;
    position: relative;
    z-index: 2;
    margin-block: 18.5svh 0;
    margin-inline-start: var(--md-page-start);
    max-inline-size: calc(100% - var(--md-page-start) - var(--md-page-end));
  }

  .wp-site-blocks .md-home-biography-copy::before {
    margin-block-end: clamp(18px, 3.3svh, 48px);
  }

  .md-biography-side-name {
    position: absolute;
    z-index: 3;
    display: block;
    inset-block-start: 11%;
    inset-inline-start: var(--md-page-start);
    font: 800 var(--md-gallery-heading-size)/1.04 "Bricolage Grotesque", sans-serif;
    letter-spacing: -.04em;
    white-space: nowrap;
    writing-mode: vertical-rl;
    translate: 0 var(--md-bio-name-offset, 100svh);
    pointer-events: none;
  }

  .md-biography-portrait,
  .wp-site-blocks .md-biography-atelier {
    display: block;
    grid-area: 2 / 1;
    align-self: end;
    height: 100% !important;
    max-height: calc(50svh - var(--md-home-gutter));
    min-height: 0;
    contain: size;
  }

  .md-biography-portrait {
    width: calc(100% / 3) !important;
    margin-inline-start: var(--md-page-start);
    object-position: center;
    translate: calc((-36vw - var(--md-page-start)) * var(--md-bio-progress)) 0;
  }

  .wp-site-blocks .md-biography-atelier {
    justify-self: end;
    margin-inline-end: var(--md-page-end) !important;
    width: calc(50% - var(--md-page-end) - var(--md-home-gutter) / 4);
    translate: calc(39vw * var(--md-bio-remaining)) 0;
  }

  .md-home-finale {
    display: grid;
    grid-template: 175svh auto / minmax(0, 1fr);
    margin-block-start: -100svh !important;
  }

  .md-pencil-scene {
    z-index: 0;
    grid-area: 1 / 1 / 3 / 2;
  }

  .md-pencil-frame {
    position: sticky;
    top: 0;
    height: 100svh;
  }

  .md-home-end-panel {
    grid-area: 2 / 1;
  }
}

@media (max-width: 700px) {
  .wp-site-blocks .md-home-biography > .md-biography-stage {
    min-height: 100dvh;
    align-content: start;
    padding-block: clamp(105px, 38vw, 170px) 5vw;
    gap: clamp(18px, 6vw, 35px);
  }

  .wp-site-blocks .md-home-biography-copy {
    --md-home-copy-font: 400 clamp(12px, 3.6vw, 18px)/1.35 var(--wp--preset--font-family--barlow, "Barlow", sans-serif);
  }

  .wp-site-blocks .md-biography-atelier {
    margin-inline-start: calc(-1 * var(--md-page-start)) !important;
    inline-size: calc(100% + var(--md-page-start) + var(--md-page-end));
    aspect-ratio: 6 / 5;
    overflow: hidden;
  }

  .md-home-end-panel {
    padding-block-end: env(safe-area-inset-bottom, 0px);
    display: flex;
    flex-direction: column;
  }

  .md-home-end-panel > footer {
    margin-block-start: 0 !important;
  }

  .md-home-biography .md-biography-portrait {
    display: none;
  }

  .md-pencil-frame {
    height: 100dvh;
  }
}

@media (max-width: 700px) and (prefers-reduced-motion: no-preference) {
  .md-biography-sequence {
    position: relative;
    z-index: 1;
  }

  .md-biography-stage {
    overflow: clip;
  }

  .md-home-finale {
    display: grid;
    grid-template: 155dvh auto / minmax(0, 1fr);
    margin-block-start: -100dvh !important;
  }

  .md-pencil-scene {
    grid-area: 1 / 1 / 3 / 2;
  }

  .md-pencil-frame {
    position: sticky;
    top: 0;
  }

  .md-home-end-panel {
    grid-area: 2 / 1;
  }

}
