/* Top editorial styles and the integrator-approved composite PNG hero. */
.page-top main .hero__copy .hero__intro p {
  max-width: 100%;
}

/* Complete transparent artwork: no mask, crop, background or inner motion. */
.page-top main .top-hero {
  inset: auto;
  top: 168px;
  left: calc(50% - 465px);
  width: min(1025px, calc(50% + 441px));
  aspect-ratio: 1025 / 830;
  isolation: isolate;
}
.page-top main .top-hero-slide {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  opacity: 0;
  mix-blend-mode: plus-lighter;
}
.page-top main .top-hero > picture:first-child .top-hero-slide { opacity: 1; }
@media (min-width: 768px) and (max-width: 1100px) {
  .page-top main .top-hero { left: 24px; width: calc(100% - 48px); }
}
@media (max-width: 767px) {
  .page-top main .top-hero { top: 75px; left: 24px; width: calc(100% - 48px); }
}

.page-top main .recruit__copy {
  max-width: 42em;
  margin-inline: auto;
  padding-inline: 20px;
  text-wrap: balance;
}

@media (min-width: 768px) {
  .page-top main .top-work-heading p {
    max-width: 25em;
    line-height: 1.8;
  }

  .page-top main .hero__copy .hero__intro {
    grid-template-columns: minmax(0, 680px) minmax(14rem, 1fr);
    gap: 32px;
  }
}

@media (max-width: 767px) {
  .page-top main .hero__copy .hero__intro p {
    line-height: 1.6;
  }

  .page-top main .hero__copy .hero__links {
    margin-top: 24px;
  }

  /* Make reading space above the existing photo without moving its protected frame. */
  .page-top main .button-row {
    padding-bottom: calc(120px + max(0px, calc(10rem - 160px)));
  }

  .page-top main .top-work-heading {
    position: relative;
    top: calc(-96px - max(0px, calc(10rem - 160px)));
  }

  .page-top main .recruit__copy {
    max-width: 21em;
    padding-inline: 25px;
    line-height: 1.5;
  }
}

/* TOP SP: use the complete 752 x 1891 artwork as the sizing reference.
 * Both grid items contribute their natural height; copy can grow freely. */
@media (max-width: 767px) {
  .page-top main .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    height: auto;
    min-height: 0;
    padding-top: 75px;
    container-type: inline-size;
  }

  /* These red accents are already part of each supplied SP PNG. */
  .page-top main .hero__accents { display: none; }

  .page-top main .top-hero {
    position: relative;
    grid-area: 1 / 1;
    inset: auto;
    width: 100%;
    aspect-ratio: 752 / 1891;
    margin: 0;
  }

  .page-top main .hero__copy {
    grid-area: 1 / 1;
    /* The reference heading begins 1370px down the 752px-wide artwork,
     * on SP03's blue shape. This scales with the image, not a fixed gap. */
    padding: calc(100cqw * 1370 / 752) 22px 48px;
  }

  .page-top main .top-hero-text {
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    background-color: transparent;
    transition: background-color 1200ms ease-in-out;
  }

  /* SP01/02 have photographs behind the same copy position. Back only
   * the text lines with paper, keeping the complete artwork in place. */
  .page-top main .hero:has(.top-hero[data-current="1"]) .top-hero-text,
  .page-top main .hero:has(.top-hero[data-current="2"]) .top-hero-text {
    background-color: var(--paper);
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .page-top main .top-hero-text { transition: none; }
}

/* One facility overview link beside the section heading. */
.page-top .facilities__heading-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px 32px;
  justify-content: space-between;
}
.page-top .facilities__overview-link {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  height: auto;
  min-height: 49px;
  padding-block: 10px;
  line-height: 1.4;
}

/* Text stays in normal flow so font changes and enlarged text grow the HERO.
 * Retain overflow clipping for the absolute artwork, with no text clipping. */
@media (min-width: 768px) {
  .page-top main .hero {
    height: auto;
    min-height: 1280px;
    padding-bottom: 64px;
  }
  .page-top main .hero__copy {
    width: min(1000px, calc(100% - 64px));
  }
}
.page-top main .hero__links { min-width: 0; }
.page-top main .hero__links .pill-link {
  width: min(100%, 14rem);
  min-width: max-content;
  min-height: 49px;
  height: auto;
  padding-block: 10px;
  line-height: 1.5;
  white-space: nowrap;
}

/* TOP: keep the existing autoplay, omit its visible count and toggle UI. */
.page-top .bento-gallery__autoplay,
.page-top .bento-gallery__count { display: none; }

/* Optically center the chevron glyphs within the circular gallery buttons. */
.page-top .bento-gallery .gallery-arrow { padding: 0 0 9px; }

@media (min-width: 768px) {
  .page-top main .button-row {
    width: max-content;
    flex-wrap: nowrap;
    gap: 16px;
  }
}

@media (min-width: 1101px) {
  .page-top main .button-row {
    margin-left: calc(100% - 580px);
    margin-right: 0;
    justify-content: flex-start;
  }
}

@media (min-width: 768px) {
  .page-top .bento__inner { --bento-copy-gap: 41px; }
  .page-top main .bento__text,
  .page-top main .button-row { margin-top: var(--bento-copy-gap); }
}

@media (min-width: 768px) {
  .page-top main .hero__intro { align-items: end; }
  .page-top main .hero__links .pill-link:last-child { margin-bottom: 0; }
}

/* Enlarge only the PC composite artwork; preserve the existing crossfade. */
@media (min-width: 768px) {
  .page-top main .top-hero {
    transform: scale(1.1);
    transform-origin: center top;
  }
}

/* Keep the introduction in a clear left column, independent of moving artwork. */
@media (min-width: 768px) {
  .page-top .top-work-heading {
    width: min(40%, 400px);
    margin-left: clamp(24px, 4vw, 56px);
    position: relative;
    top: 64px;
  }
  .page-top main .work__shape--blue { left: calc(50% - 110px); }
  .page-top .work__accents { clip-path: none; }
}
@media (max-width: 767px) {
  .page-top .work__shape--blue { top: 260px; }
}

/* Staff and oval share one motion layer and a generous lead-in. */
.page-top main .recruit__stage { margin-top: 80px; }
.page-top main .recruit { height: calc(970px + max(0px, calc(24rem - 384px))); }
@media (max-width: 767px) {
  .page-top main .recruit__stage { margin-top: 48px; }
  .page-top main .recruit { height: calc(1088px + max(0px, calc(24rem - 384px))); }
}

/* Keep full decorative shapes outside the mobile copy column. */
@media (max-width: 767px) {
  .page-top .recruit__pattern { left: calc(100% - 60px); top: 0; width: 450px; }
}

.page-top .facilities { min-height: 0; padding-bottom: 96px; }
.page-top .facilities .section-heading > p { margin-top: 36px; }
/* Desktop: align the overview button with the bottom of the introduction. */
@media (min-width: 768px) {
  .page-top .facilities .section-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 32px;
    align-items: end;
  }
  .page-top .facilities__heading-row { display: contents; }
  .page-top .facilities__heading-row .section-title { grid-area: 1 / 1 / 2 / 3; }
  .page-top .facilities .section-heading > p { grid-area: 2 / 1; margin-bottom: 0; }
  .page-top .facilities__overview-link { grid-area: 2 / 2; align-self: end; }
}

.page-top .facility-list { margin-top: 32px; row-gap: 56px; }
.page-top .facility-card h3 { margin-top: 24px; }
.page-top .facility-card__details { margin-top: 20px; display: grid; gap: 4px; }
@media (max-width: 767px) {
  .page-top .facilities { min-height: 0; padding-bottom: 64px; }
  .page-top .facilities__heading-row { gap: 16px; }
  .page-top .facilities__heading-row .section-title { font-size: 1.25rem; }
  .page-top .facilities__heading-row .section-title__mark { width: 32px; margin-right: 10px; }
  .page-top .facilities__overview-link { min-width: 0; padding-inline: 16px; }
}
@media (max-width: 359px) {
  .page-top .facilities__heading-row { gap: 8px; }
  .page-top .facilities__overview-link { padding-inline: 10px; font-size: .875rem; }
  .page-top .facilities__overview-link .pill-link__icon { width: 24px; height: 24px; margin-left: 8px; }
}

/* Mobile review 01: content-driven sections; PC geometry is unchanged. */
@media (max-width: 767px) {
  .page-top main .hero__copy { grid-area: 2 / 1; padding: 24px 22px 48px; }
  .page-top main .hero .top-hero-text { background: transparent; }
  .page-top main .button-row { padding-bottom: 32px; }
  /* Use the longest label to size all three mobile bento links equally. */
  .page-top main .bento .button-row {
    display: grid;
    width: max-content;
    max-width: calc(100% - 50px);
    gap: 0;
  }
  .page-top main .bento .button-row .pill-link {
    width: 100%;
    min-width: 0;
    justify-content: space-between;
  }
  .page-top main .work { height: auto; padding-bottom: 140px; }
  .page-top main .work__inner { height: auto; padding-top: 24px; }
  .page-top main .top-work-heading { top: auto; }
  .page-top main .work__photo { position: relative; top: auto; left: auto; width: calc(100% - 32px); margin: 48px auto 0; }
  .page-top main .work-carousel .carousel-controls { width: auto; left: 8px; right: 8px; }
  .page-top main .work-menu { position: relative; inset: auto; width: calc(100% - 48px); margin: 48px auto 0; }
  .page-top main .work__shape--blue { top: -230px; left: calc(100% - 115px); width: 230px; }
  .page-top main .work__shape--green { top: auto; bottom: 300px; left: -110px; width: 285px; }
  .page-top main .work__shape--yellow { top: auto; bottom: 32px; left: calc(100% - 245px); width: 320px; }
  .page-top main .recruit { height: auto; padding-bottom: 64px; }
  .page-top main .recruit__inner { padding-top: 72px; }
  .page-top main .recruit__stage { position: relative; top: auto; height: auto; margin-top: 24px; }
  .page-top main .recruit__stage::before { content: none; }
  .page-top main .recruit__staff--revised { position: relative; inset: auto; width: 100%; transform: none; }
  .page-top main .recruit__staff--revised img { width: 100%; height: auto; }
  .page-top main .recruit__button { position: relative; inset: auto; transform: none; margin: 0 auto; }
}
