/* Homepage gutters, spacing and type shared by the reviewed scenes. */
body[data-launch-page="home"] {
  --home-gutter: 6.5vw;
  --home-section-top: 172px;
  --home-section-bottom: 76px;
  --home-section-link-gap: 24px;
  --home-body-size: 16px;
  --home-link-size: 12px;
}

@media (min-width: 1700px) {
  body[data-launch-page="home"] { --home-gutter: 8vw; }
}

@media (min-width: 761px) and (max-height: 850px) {
  body[data-launch-page="home"] { --home-section-bottom: 65px; }
}

@media (max-width: 760px) {
  body[data-launch-page="home"] {
    --home-gutter: 7vw;
    --home-section-bottom: 70px;
    --home-body-size: 15px;
  }
}

#main > .scene {
  padding-block: var(--home-section-top) var(--home-section-bottom);
  block-size: auto;
  min-block-size: 0;
  justify-content: flex-start;
}

#main > #mission {
  min-block-size: 100svh;
  padding-inline-start: var(--home-gutter);
}

#main > .scene > :is(.section-label, .scene-foot) { position: static; }
#main > .scene > .section-label { margin-block-end: var(--home-section-link-gap); }
#main > .scene > .scene-foot { margin-block-start: var(--home-section-link-gap); }

#main > #mission > .scene-foot {
  justify-content: center;
  margin-block-start: auto;
  padding-block-start: var(--home-section-link-gap);
}

#mission .hero-copy { padding-block-end: 0; }
#world .eyebrow { margin-block-start: 0; }
#main .factory-copy { padding-block-start: 0; }

#main > .scene .body-copy,
#main .news-story .news-summary,
#main #product-copy { font-size: var(--home-body-size); }

body[data-launch-page="home"] #main a[href]:not(.button) { font-size: var(--home-link-size); }

/* Destination links keep the scale of the market labels they replace. */
body[data-launch-page="home"] #main .mission-domains a[href] { font-size: inherit; }

/* Balance the content without shifting the opening hero. */
#main > .scene:not(#mission) {
  --home-content-inset: clamp(70px, 8.6vw, 124px);
  padding-block: var(--home-content-inset);
  justify-content: center;
}

/* Keep the new stories on the homepage's established type scale. */
#main > :is(#why-nai, #change, #people, #history, #architecture, #made, #world, #partner) {
  --story-heading-size: clamp(42px, 4.6vw, 75px);
  padding-inline: var(--home-gutter);
  block-size: auto;
  min-block-size: 0;
}

@media (min-width: 761px) and (max-height: 850px) {
  #main > :is(#why-nai, #change, #people, #history, #architecture, #made, #world, #partner) {
    --story-heading-size: 45px;
  }
}

@media (min-width: 761px) and (max-width: 1000px) {
  #main > :is(#why-nai, #change, #people, #history, #architecture, #made, #world, #partner) {
    --story-heading-size: 40px;
  }
}

#main > :is(#why-nai, #change, #people, #history, #architecture, #made, #world, #partner) h2,
#main #world .world-evidence-heading h3 {
  font-size: var(--story-heading-size);
  line-height: 1.04;
  letter-spacing: -.058em;
}

#main > :is(#why-nai, #change, #people, #history, #architecture, #made, #world, #partner)
  :is(.eyebrow, .section-label, .scene-foot, .text-link) {
  font-size: var(--home-link-size);
}

#main > :is(#why-nai, #change, #people, #history, #architecture, #made, #world, #partner) .body-copy,
#main #history .milestone-copy p,
#main #architecture .investment-steps p,
#main #world :is(.world-evidence-heading > p, .mission-cases article > p:not(.case-category)),
#main #partner .standards-proof > p:not(.eyebrow) {
  font-size: var(--home-body-size);
}

#main > :is(#made, #partner) > .section-label {
  margin-block-end: var(--home-section-link-gap);
}

#main #why-nai :is(.purpose-place, .purpose-place span),
#main #change :is(.change-scroll-cue, .change-slot span, .change-software, .change-bus span, .change-payload span),
#main #people .company-history span,
#main #history :is(.milestone-art-note, .history-references, .history-bottom-links a),
#main #architecture :is(.investment-art figcaption, .step-number),
#main #made :is(.factory-controls button, .workforce small),
#main #world :is(.case-visual figcaption, .case-category),
#main #partner :is(.standards-proof a, .standards-proof small) {
  font-size: var(--home-link-size);
}

#main #partner .standards-copy > .body-copy {
  max-inline-size: var(--standards-copy-width, 540px);
}

#main #partner .standards-proof small {
  max-inline-size: none;
}

#main #partner .standards-proof {
  border-block-end: 0;
  padding-block-end: 0;
}

@media (width > 760px) {
  #main #partner .standards-layout {
    --standards-column-gap: 8vw;
    --standards-proof-min: 0px;
    grid-template-columns: minmax(0, 1.1fr) var(--standards-column-gap) minmax(var(--standards-proof-min), .9fr);
    column-gap: 0;
  }

  #main #partner .standards-layout::before {
    content: "";
    grid-area: 1 / 2;
    justify-self: center;
    align-self: stretch;
    position: relative;
    inset-inline-end: var(--standards-divider-shift, 0px);
    border-inline-start: 1px solid #486977;
  }

  #main #partner .standards-proof {
    grid-area: 1 / 3;
    border-block-start: 0;
    padding-block-start: 0;
  }
}

@media (760px < width <= 1050px) {
  #main #partner .standards-layout {
    --standards-column-gap: 5vw;
  }
}

@media (min-width: 1200px) {
  #main #partner .standards-layout {
    --standards-proof-min: 32rem;
    /* Let the divider track narrow where the note needs more room. */
    --standards-column-gap: clamp(2rem, calc(100% - 61rem), 8vw);
  }
}

#main #why-nai .purpose-place {
  inset-inline-end: var(--home-gutter);
  inset-block-end: var(--home-content-inset);
}

/* Share the deep teal palette across the requirements and investment stories. */
#main > :is(#change, #architecture) {
  --requirements-background: #0b2733;
  background-color: var(--requirements-background);
  color: #fff;
}

#main :is(#change, #architecture) h2 {
  color: inherit;
}

#main :is(#change, #architecture) h2 em,
#main #architecture :is(.step-number, .step-topic, .text-link) {
  color: #82cdd0;
}

#main :is(#change, #architecture) .body-copy,
#main #architecture :is(.investment-steps p, .investment-art figcaption) {
  color: #bdd0d8;
}

#main :is(#change .change-cosa-link, #architecture .investment-bottom .button) {
  color: #102733;
}

#main :is(#change .change-cosa-link, #architecture .investment-bottom .button):hover {
  background-color: #bde8e8;
}

#main #architecture .text-link:hover {
  color: #fff;
}

#main #change .change-example {
  background: linear-gradient(135deg, #163744, #102d39);
  border-color: #557480;
}

#main #change .change-picker {
  background-color: var(--requirements-background);
  border-color: #647f8c;
}

#main #change .change-picker button:hover:not([aria-pressed="true"]) {
  background-color: #244954;
}

#main #change .change-platform {
  background-color: #0e2530;
}

#main #change :is(.change-slot:not(.change-module), .change-payload) {
  background-color: #15333f;
}

#main #change .change-software {
  background-color: #204452;
}

#main #change .change-wire {
  background-color: #7796a1;
}

#main #change .change-revision {
  font-family: inherit;
}

#main #change .scene-foot {
  justify-content: flex-end;
  margin-block-start: var(--home-section-link-gap);
}

/* Stack the copy and photo where two columns would squeeze the headline. */
#main > #people.story-company {
  grid-template-columns: minmax(0, 1fr);
  gap: var(--home-content-inset);
}

#main #people .company-image {
  block-size: min(54svh, 470px);
  min-block-size: 0;
  margin-inline: calc(-1 * var(--home-gutter));
  margin-block: 0 calc(-1 * var(--home-content-inset));
}

#main #people .company-image img {
  object-position: 45% 48%;
}

#main #people .company-image::after {
  inset-block-start: 0;
  background: linear-gradient(to top, #07131fb3, #07131f99 20%, transparent 46%);
}

#main #people .company-copy {
  min-inline-size: 0;
  padding: 0;
}

#main #people h2 em {
  color: #a9c8d8;
}

#main #people .lede {
  color: inherit;
}

#main #people .body-copy {
  color: #aebdc7;
  max-inline-size: var(--company-paragraph-width, 540px);
}

#main #people :is(.eyebrow, .company-history span) {
  color: #a5b9c7;
}

#main #people .company-history {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(12px, 1.5vw, 24px);
  max-inline-size: var(--company-paragraph-width, 540px);
  position: relative;
  border-top-color: transparent;
}

#main #people .company-history > :nth-child(2) {
  text-align: center;
}

#main #people .company-history > :last-child {
  text-align: end;
}

#main #people .company-history > :last-child strong {
  align-self: flex-end;
  white-space: nowrap;
}

#main #people .company-history::before {
  content: "";
  position: absolute;
  inset-block-start: -1px;
  inset-inline-start: 0;
  inline-size: var(--company-divider-width, 100%);
  border-block-start: 1px solid #596974;
}

@media (width <= 500px) {
  #main #people .company-history {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #main #people .company-history > :nth-child(2) {
    text-align: end;
  }

  #main #people .company-history > :last-child {
    grid-column: 1 / -1;
  }
}

@media (width > 900px) {
  #main > #people.story-company {
    grid-template-columns: minmax(0, 54fr) minmax(0, 46fr);
    align-items: center;
    gap: clamp(24px, 4vw, 72px);
  }

  #main #people .company-image {
    align-self: stretch;
    block-size: auto;
    margin-inline-start: 0;
    margin-block: calc(-1 * var(--home-content-inset));
  }

  #main #people .company-image img {
    object-position: 49% 48%;
    mask-image: linear-gradient(to right, transparent, #000 15%);
  }
}

#main #history .history-heading {
  display: block;
  text-align: center;
}

#main #history .history-heading-note {
  margin: clamp(16px, 1.5vw, 24px) 0 0;
  text-align: inherit;
  line-height: 1.55;
}

#main #history .history-bottom:has(> p) {
  justify-content: space-between;
}

#main #history .history-bottom > p {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
}

#main #history .history-bottom strong {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -.025em;
}

@media (max-width: 560px) {
  #main #history .history-bottom:has(> p) .history-bottom-links {
    margin-block-start: 18px;
  }
}

#main :is(#people .company-identity, #history .history-heading-note) {
  font-size: 21px;
}

#main #history .milestone-art {
  --history-art-gap: clamp(6px, .5vw, 10px);
  --history-art-image-height: 100px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
}

#main #history .milestone-art-products {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: var(--history-art-gap);
}

#main #history .milestone-art-products > img {
  position: static;
  flex: none;
  inline-size: auto;
  block-size: auto;
  max-inline-size: 100%;
  max-block-size: var(--history-art-image-height);
  object-position: left bottom;
  transform: none;
}

#main #history .milestone-art-products > .logo-diamond {
  max-inline-size: 85%;
  max-block-size: 72px;
}

#main #history .history-precision .milestone-art-products > .analog-instrument {
  max-inline-size: 80%;
  max-block-size: calc(var(--history-art-image-height) * .8);
}

#main #history .milestone-art-products > .era-instrument {
  max-inline-size: calc((100% - var(--history-art-gap)) * 2 / 5);
}

#main #history .milestone-art-products > .era-2250 {
  max-inline-size: calc((100% - var(--history-art-gap)) * 3 / 5);
}

#main #history .history-systems .milestone-art-products {
  --history-art-gap: clamp(3px, .35vw, 6px);
  --history-system-track: calc((100% - 2 * var(--history-art-gap)) / 3.8);
}

#main #history .milestone-art-products > :is(.era-power, .era-io-boards) {
  max-inline-size: var(--history-system-track);
}

/* Frame the chassis from the original photo, with the separate cards outside the crop. */
#main #history .milestone-system-image {
  position: relative;
  flex: none;
  inline-size: min(calc(var(--history-system-track) * 1.8), calc(var(--history-art-image-height) * 845 / 640));
  aspect-ratio: 845 / 640;
}

#main #history .milestone-chassis-crop {
  position: absolute;
  inset: 0;
}

#main #history .milestone-chassis-crop,
#history-image-dialog[data-cropped-chassis] .history-image-frame {
  clip-path: polygon(0 0, 100% 0, 100% 83%, 96.5% 83%, 96.5% 100%, 0 100%);
}

#main #history .milestone-chassis-crop > img,
#history-image-dialog[data-cropped-chassis] .history-image-frame > img {
  position: absolute;
  inset: -26.56% auto auto -5.92%;
  inline-size: 182.84%;
  block-size: auto;
  max-inline-size: none;
  max-block-size: none;
}

#main #history .history-image-hint {
  margin: 12px 0 0;
  color: var(--teal);
  font-size: 12px;
  font-weight: 600;
}

#main #history [aria-controls="history-image-dialog"] {
  cursor: zoom-in;
}

#main #history [aria-controls="history-image-dialog"]:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

#main #history .milestone-art::after {
  pointer-events: none;
}

#history-image-dialog {
  width: min(960px, calc(100% - 24px));
  max-height: calc(100svh - 24px);
  padding: clamp(14px, 2.5vw, 28px);
  background: #fff;
}

#main #history-image-dialog #history-image-title {
  margin: 0 0 18px;
  padding-inline-end: 56px;
  font-size: clamp(17px, 2vw, 24px);
  line-height: 1.2;
  letter-spacing: -.025em;
}

#history-image-dialog .close {
  display: grid;
  place-items: center;
  inset: 8px 8px auto auto;
  inline-size: 44px;
  block-size: 44px;
  padding: 0;
  background: #eef4f4;
  line-height: 1;
}

#history-image-dialog .history-image-frame > img {
  display: block;
  max-inline-size: 100%;
  max-block-size: min(68svh, 700px);
  margin-inline: auto;
  object-fit: contain;
}

#history-image-dialog[data-cropped-chassis] .history-image-frame {
  position: relative;
  inline-size: min(100%, 680px, calc(68svh * 845 / 640));
  aspect-ratio: 845 / 640;
  margin-inline: auto;
}

@media (width <= 1050px) {
  #main #history .milestone-art {
    block-size: clamp(112px, 18vw, 152px);
  }
}

@media (width <= 560px) {
  #main #history .milestone-art {
    justify-self: start;
  }

  #main #history .milestone-art-products {
    justify-content: flex-start;
  }
}

@media (width > 1050px) {
  #main #history {
    --history-art-height: clamp(128px, 8.5vw, 175px);
  }

  #main #history .milestone-art {
    --history-art-image-height: clamp(56px, 6vw, 110px);
    --history-year-line-inset: 17px;
    align-content: end;
    margin-inline-end: calc(-1 * var(--history-year-line-inset));
    padding-inline: calc(var(--history-year-line-inset) + 10px) 10px;
    padding-block-end: 18px;
  }

  #main #history .history-milestone:last-child .milestone-art {
    margin-inline-end: 0;
    padding-inline: calc(var(--history-year-line-inset) + 2px) 2px;
  }

  #main #history .history-modularity .milestone-art {
    container-type: inline-size;
  }

  /* Match the 1992 board, which occupies two fifths of its row after the gap. */
  #main #history .milestone-art-products > .modules {
    max-block-size: min(var(--history-art-image-height),
      calc((100cqi - var(--history-art-gap)) * 2 / 5 * 800 / 601));
  }
}

#main #history .milestone-copy {
  overflow-wrap: anywhere;
}

/* Keep the numbered rows and actions alongside the exploded view. */
#main #architecture .investment-layout {
  grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
  gap: clamp(28px, 3.5vw, 64px);
  align-items: center;
}

#main #architecture .investment-copy {
  min-inline-size: 0;
}

#main #architecture .investment-copy > .body-copy {
  max-inline-size: none;
  margin-block-end: 0;
}

#main #architecture .investment-steps {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin-block-start: clamp(16px, 1.6vw, 24px);
}

#main #architecture .investment-steps > li {
  display: grid;
  grid-template-columns: 2ch minmax(0, 1fr);
  gap: 2px clamp(12px, 1.4vw, 20px);
  padding-block: clamp(8px, .7vw, 12px);
  border-block-start: 1px solid #45616d;
}

#main #architecture :is(.step-number, .step-topic) {
  font-size: var(--home-link-size);
  font-weight: 600;
  letter-spacing: .11em;
  line-height: 1.5;
}

#main #architecture .investment-steps :is(h3, p) {
  grid-column: 2;
  max-inline-size: none;
  margin: 0;
}

#main #architecture .investment-bottom {
  gap: 8px 20px;
  margin-block-start: clamp(16px, 1.6vw, 24px);
  padding-block-start: 0;
  border-block-start: 0;
}

#main #architecture .investment-art img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  max-block-size: 660px;
  mix-blend-mode: normal;
}

#main #architecture .investment-art figcaption {
  flex-flow: row wrap;
  gap: 6px 16px;
  margin-block-start: 12px;
  padding-block: 0;
  border-block-end: 0;
}

#main #architecture .investment-art figcaption span {
  text-align: start;
}

@media (width <= 900px) {
  #main #architecture .investment-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Position the new factory material in flow alongside the existing controls. */
#main > #made.story-made {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 170px);
  align-items: start;
  gap: var(--home-section-link-gap);
}

#main #made :is(.section-label, .workforce, .scene-foot) {
  grid-column: 1 / -1;
  margin-block: 0;
}

#main #made .factory-controls {
  position: static;
  align-self: center;
  width: 100%;
  margin: 0;
}

#main #made .workforce {
  display: flex;
  gap: clamp(14px, 3vw, 35px);
  border-block-start: 0;
  padding-block-start: 0;
}

#main #made .workforce-stats {
  inline-size: min(100%, var(--workforce-width, 100%));
  container-type: inline-size;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  column-gap: 3%;
  border-block-start: 1px solid #597583;
  padding-block-start: 28px;
}

#main #made .workforce-stats p {
  inline-size: max-content;
  justify-self: start;
  align-items: center;
  gap: 8px;
  text-align: center;
}

#main #made .workforce-stats p:nth-child(2) {
  justify-self: center;
}

#main #made .workforce-stats p:last-child {
  justify-self: end;
}

#main #made .workforce-stats p span {
  /* The figures set the column positions while longer labels center under them. */
  contain: inline-size;
  inline-size: 125%;
}

#main #made .workforce-stats strong {
  font-size: clamp(26px, 10.5cqw, 52px);
  white-space: nowrap;
}

#main #made .workforce small {
  flex: 0 0 auto;
}

/* The Earth artwork and the light examples panel meet the scene edges. */
#main > #world.story-world {
  padding-block: 0;
}

#main #world :is(.world-hero, .world-evidence) {
  margin-inline: calc(-1 * var(--home-gutter));
  padding-block: var(--home-content-inset);
  padding-inline: var(--home-gutter);
}

#main #world .world-actions {
  flex-flow: row wrap;
  align-items: center;
}

#main #world .world-evidence-heading {
  --evidence-heading-gap: clamp(18px, 1.45vw, 22px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "title" "intro" "markets";
  gap: var(--evidence-heading-gap) clamp(28px, 3vw, 48px);
  margin-block-end: clamp(28px, 2.2vw, 36px);
}

#main #world .world-evidence-heading > div {
  grid-area: title;
}

#main #world .world-evidence-heading > p {
  grid-area: intro;
  max-inline-size: none;
}

#main #world .world-evidence-heading .mission-domains {
  grid-area: markets;
  max-inline-size: 100%;
  margin: 0;
}

@media (width >= 1180px) {
  #main #world .world-evidence-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "eyebrow ." "title markets" "intro .";
    row-gap: 0;
  }

  #main #world .world-evidence-heading > div {
    display: contents;
  }

  #main #world .world-evidence-heading > div > .eyebrow {
    grid-area: eyebrow;
  }

  #main #world .world-evidence-heading h3 {
    grid-area: title;
    align-self: start;
  }

  #main #world .world-evidence-heading > p {
    margin-block-start: var(--evidence-heading-gap);
  }

  #main #world .world-evidence-heading .mission-domains {
    align-self: start;
    justify-self: end;
    /* Align the rule with the top of the Manrope letters. */
    margin-block-start: calc(.16 * var(--story-heading-size));
  }
}

#main :is(#world-examples .global-support, #partner .partner-promise) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

#main #partner .partner-promise {
  --summary-divider-color: #8ac9cf;
}

#main :is(#world-examples .global-support, #partner .partner-promise) h3 {
  line-height: 1.14;
}

#main :is(#world-examples .global-support, #partner .partner-promise) p {
  font-size: var(--home-body-size);
  line-height: 1.75;
  max-inline-size: 610px;
}

#main #world-examples .global-support > a {
  justify-self: start;
}

@media (width >= 1000px) {
  #main :is(#world-examples .global-support, #partner .partner-promise) {
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    column-gap: clamp(22px, 2vw, 32px);
  }

  #main #world-examples .global-support {
    grid-template-columns: max-content minmax(0, 1fr) auto;
  }

  #main :is(#world-examples .global-support, #partner .partner-promise) h3 {
    border-inline-end: 1px solid var(--summary-divider-color, var(--teal));
    padding-inline-end: clamp(22px, 2vw, 32px);
  }

  #main #world-examples .global-support > a {
    justify-self: end;
  }
}

#main #next .next-copy {
  padding-block: 0;
}

/* Keep the jump link at the edge of the closing panel. */
#main #next .next-back-to-top {
  position: absolute;
  inset-inline-end: var(--home-gutter);
  inset-block-end: 25px;
  margin-block: 0;
}

@media (max-width: 760px) {
  #main :is(#people .company-identity, #history .history-heading-note) {
    font-size: 18px;
  }

  #main > :is(#why-nai, #change, #people, #history, #architecture, #made, #world, #partner) {
    --story-heading-size: 42px;
  }

  #main #why-nai .purpose-shade {
    background: linear-gradient(to bottom, #07152012, #071520ed var(--home-content-inset), #071520 calc(var(--home-content-inset) + 100px));
  }

  #main #change .change-schematic {
    grid-template-columns: minmax(0, 1fr) minmax(48px, 18%) minmax(56px, 17%);
  }

  #main #change .change-platform {
    grid-template-rows: 22px repeat(3, 42px) minmax(88px, auto) 42px;
  }

  #main > #made.story-made {
    grid-template-columns: minmax(0, 1fr);
  }

  #main #made .workforce {
    flex-direction: column;
    align-items: flex-start;
  }

  #main #made .workforce small {
    align-self: flex-end;
    text-align: end;
  }

  #main #world .world-hero {
    padding-block: 0;
  }

  #main #world .world-copy {
    padding: var(--home-content-inset) 0;
  }

  #main #world .world-earth {
    width: calc(100% + 2 * var(--home-gutter));
    margin-inline: calc(-1 * var(--home-gutter));
  }

  #main #news .news-story {
    padding-block: 29px;
  }

  #main #next .next-back-to-top {
    inset-inline: var(--home-gutter) auto;
  }
}

/* Use the portfolio's navy surface for the company story as well. */
#main > :is(#people, #products) {
  background: var(--navy);
}

/* Keep the studio artwork and product links on a shared stage. */
#main > #products {
  block-size: auto;
  min-block-size: 0;
}

#products > .section-label {
  grid-area: catalog;
  position: static;
  justify-content: flex-end;
  margin-block: 0 var(--home-section-link-gap, 24px);
}

#products > .section-label > span,
#products #product-word,
#products .product-stage > [hidden] {
  display: none;
}

#products .product-layout,
#main > #products:not(:has(> .product-layout)) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: 'heading' 'stage' 'details';
  gap: 20px;
}

#main > #products:not(:has(> .product-layout)) {
  grid-template-areas: 'catalog' 'heading' 'stage' 'details';
}

#main > #products:not(:has(> .product-layout)) > .section-label {
  margin-block-end: 0;
}

#products .product-heading h2 {
  font-size: clamp(42px, 4.6vw, 75px);
}

#products .product-tabs {
  gap: 4px clamp(12px, 1.45vw, 24px);
}

#products .product-tabs button {
  min-height: 44px;
  font-size: var(--home-link-size, 12px);
}

#products .product-tabs button[aria-pressed="true"] {
  border-bottom: 2px solid var(--cyan);
}

#products .product-stage {
  grid-area: stage;
  position: relative;
  display: block;
  inline-size: 100%;
  block-size: auto;
  min-inline-size: 0;
  min-block-size: 0;
  max-block-size: none;
  aspect-ratio: 16 / 9;
  margin: 0;
}

#products .product-stage.has-lineup {
  aspect-ratio: auto;
}

#products .product-stage > #product-image {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  max-block-size: none;
  object-fit: contain;
  mix-blend-mode: lighten;
}

#products #product-copy {
  font-size: var(--home-body-size, 16px);
}

#products .product-lineup {
  --studio-height: clamp(238px, 23.5vw, 420px);
  --portfolio-studio-image: url("assets/portfolio-studio-background.webp");
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.11fr) minmax(0, 1.03fr);
  grid-template-rows: var(--studio-height) auto;
  column-gap: clamp(9px, 1.15vw, 18px);
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
}

#products .product-lineup::before {
  position: absolute;
  z-index: -1;
  inset: 0 -12px auto;
  block-size: var(--studio-height);
  background: center / 100% 100% no-repeat var(--portfolio-studio-image);
  mask-image: radial-gradient(ellipse 69% 68% at 50% 52%, #000 47%, transparent 87%);
  pointer-events: none;
  content: "";
}

#products .portfolio-item {
  display: grid;
  grid-row: span 2;
  grid-template: subgrid / minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  min-inline-size: 0;
  padding: 0;
  border: 0;
}

#products .portfolio-item-art {
  --studio-floor: calc(.14 * var(--studio-height));
  position: relative;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  align-items: end;
  justify-items: center;
  block-size: auto;
  min-block-size: 0;
  min-inline-size: 0;
  padding: 11% 0 var(--studio-floor);
  overflow: visible;
}

#products .portfolio-item-photo {
  --bitmap-height: min(100cqh, calc(100cqw / var(--photo-ratio)));
  --bitmap-width: calc(var(--bitmap-height) * var(--photo-ratio));
  --photo-bottom-gap: calc(var(--bitmap-height) * var(--photo-base-inset));
  position: relative;
  inset-block-start: var(--product-align-offset, 0px);
  inline-size: 100%;
  block-size: 100%;
  min-inline-size: 0;
  min-block-size: 0;
  max-inline-size: 100%;
  max-block-size: 100%;
  container-type: size;
}

#products .portfolio-item-photo::before,
#products .portfolio-item-photo::after {
  position: absolute;
  inset-inline-start: 50%;
  inset-block-start: calc(100% - var(--photo-bottom-gap));
  pointer-events: none;
  content: "";
}

#products .portfolio-item-photo::before {
  z-index: 2;
  inline-size: calc(var(--bitmap-width) * .72);
  block-size: clamp(5px, calc(var(--studio-floor) * .28), 13px);
  background: radial-gradient(ellipse, #01060ca3, #01060c52 46%, transparent 74%);
  transform: translate(-50%, -38%);
}

#products .portfolio-item-photo::after {
  inline-size: calc(var(--bitmap-width) * 1.15);
  block-size: min(42px, var(--studio-floor));
  background:
    radial-gradient(ellipse 27% 67% at var(--table-glint-position, 52%) 35%, var(--table-glint, #a9bfc533), transparent 79%),
    radial-gradient(ellipse at 50% 43%, #8baec41a, #548bab0a 41%, transparent 76%);
  transform: translate(-50%, -17%);
}

#products [data-product-lineup="boards"] .portfolio-item:nth-child(2) .portfolio-item-photo {
  --table-glint-position: 38%;
  --table-glint: #e8b36c42;
}

#products .portfolio-item.compact .portfolio-item-photo {
  inline-size: min(65%, calc(.4 * var(--studio-height)));
  block-size: 80%;
}

#products .portfolio-item.niu3e .portfolio-item-photo {
  inline-size: 63%;
  block-size: 68%;
}

#products .portfolio-item-photo > img {
  position: relative;
  inline-size: 100%;
  block-size: 100%;
  max-block-size: none;
  object-fit: contain;
  object-position: center bottom;
  mix-blend-mode: normal;
  filter: drop-shadow(0 -1px 1px #7bb9eb57) drop-shadow(0 7px 6px #01050978);
  mask: none;
  transform: none;
}

#products .portfolio-item-photo > img:first-child {
  z-index: 3;
}

/* Keep the contact point sharp and diffuse reflected highlights along the tabletop. */
#products .portfolio-item-photo > .portfolio-item-reflection {
  --reflection-depth: min(64px, calc(1.17 * var(--studio-floor)));
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  filter: url(#portfolio-reflection-scatter);
  opacity: .44;
  transform: scaleY(-.8);
  transform-origin: center calc(100% - var(--photo-bottom-gap));
  mask-image: linear-gradient(to top,
    transparent var(--photo-bottom-gap),
    #000 calc(var(--photo-bottom-gap) + 3px),
    #0009 calc(var(--photo-bottom-gap) + var(--reflection-depth) * .32),
    #0003 calc(var(--photo-bottom-gap) + var(--reflection-depth) * .65),
    transparent calc(var(--photo-bottom-gap) + var(--reflection-depth)));
}

/* Remove the Power photos' translucent white matte before adding the dark contact shadow. */
#products [data-product-lineup="power"] .portfolio-item-photo > img:first-child {
  filter: url(#power-photo-matte) drop-shadow(0 7px 6px #01050978);
}

#products [data-product-lineup="power"] .portfolio-item-reflection {
  --reflection-depth: min(52px, calc(1.05 * var(--studio-floor)));
  filter: url(#power-photo-matte) url(#portfolio-reflection-scatter);
  opacity: .30;
}

#products :is(.closed-board, [data-product-lineup="power"] .portfolio-item:last-child) {
  --product-align-offset: 7%;
}

#products .portfolio-item-caption {
  min-inline-size: 0;
  margin: 0;
  padding: 13px 0 0;
  border-block-start: 1px solid #435868;
  overflow-wrap: anywhere;
}

#products .portfolio-item-caption > span {
  display: block;
  margin-block-end: 6px;
  color: #b9cbd6;
  font-size: var(--home-link-size, 12px);
  line-height: 1.5;
}

#products .portfolio-item-caption > strong {
  display: block;
  font-size: clamp(15px, 1.3vw, 22px);
  line-height: 1.35;
  font-weight: 600;
}

#products .portfolio-item-caption strong > span {
  margin-inline-start: .25em;
  white-space: nowrap;
  color: #88d6df;
  font-size: inherit;
}

#products .portfolio-item:hover strong {
  color: #88d6df;
}

#products .portfolio-item:focus-visible {
  outline: 2px solid #88d6df;
  outline-offset: 4px;
}

@media (width > 900px) {
  #products .product-layout,
  #main > #products:not(:has(> .product-layout)) {
    --portfolio-gap: clamp(24px, 3vw, 62px);
    grid-template-columns: max-content minmax(0, calc((100% - var(--portfolio-gap)) * .56));
    grid-template-areas: '. stage' 'heading stage' 'details stage' '. stage';
    grid-template-rows: 1fr auto auto 1fr;
    column-gap: var(--portfolio-gap);
    row-gap: 0;
    justify-content: space-between;
  }

  /* The two-line headline sets the shared right edge for the left column. */
  #products :is(.product-tabs, .product-bottom) {
    contain: inline-size;
    min-inline-size: 0;
  }

  #products .product-tabs {
    max-inline-size: none;
    justify-content: space-between;
    column-gap: clamp(8px, .9vw, 16px);
  }

  #products .product-bottom {
    margin-block-start: 26px;
  }

  #products :is(#product-title, #product-copy) {
    max-inline-size: none;
  }

  #products [data-product-lineup="boards"] .closed-board .portfolio-item-art {
    container-type: inline-size;
  }

  #products [data-product-lineup="boards"] .closed-board .portfolio-item-photo {
    /* Let the portrait cutout fill its column when height would otherwise limit it. */
    block-size: clamp(100%, calc(100cqw / var(--photo-ratio)), 152%);
    max-block-size: none;
  }

  #main > #products:not(:has(> .product-layout)) {
    grid-template-areas: 'catalog catalog' '. stage' 'heading stage' 'details stage' '. stage';
    grid-template-rows: auto 1fr auto auto 1fr;
  }
}

@media (min-width: 761px) and (max-height: 850px) {
  #products .product-heading h2 {
    font-size: 45px;
  }
}

@media (min-width: 761px) and (max-width: 1000px) {
  #products .product-heading h2 {
    font-size: 40px;
  }
}

@media (max-width: 600px) {
  #products .product-lineup {
    --studio-height: clamp(98px, 28vw, 165px);
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  #products .product-lineup::before {
    content: none;
  }

  #products .portfolio-item {
    grid-row: auto;
    grid-template: auto / minmax(0, .43fr) minmax(0, .57fr);
    align-items: center;
    gap: 15px;
    padding: 8px 0;
    border-block-end: 1px solid #435868;
  }

  #products .portfolio-item:last-child {
    border-block-end: 0;
  }

  #products .portfolio-item-art {
    block-size: var(--studio-height);
    padding: 8% 0 var(--studio-floor);
  }

  #products [data-product-lineup="systems"] .portfolio-item-art {
    --studio-height: clamp(126px, 36vw, 212px);
  }

  #products [data-product-lineup="boards"] .portfolio-item.closed-board .portfolio-item-art {
    --studio-height: clamp(146px, 41vw, 246px);
  }

  #products .portfolio-item-art::after {
    position: absolute;
    z-index: -1;
    inset: 0 -8px;
    background: center / auto 100% no-repeat var(--portfolio-studio-image);
    mask-image: radial-gradient(ellipse, #000 30%, transparent 69%);
    pointer-events: none;
    content: "";
  }

  #products .portfolio-item-caption {
    padding: 0;
    border: 0;
  }
}

/* Secondary actions in the closing invitation. */
#main .next-paths {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 30px;
  margin-top: 24px;
  color: var(--teal);
}

#main .next-paths a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 600px) {
  #main .next-paths {
    flex-direction: column;
    align-items: center;
  }
}

/* Match the white title panel in VIPER's integration chapter. */
#main :is(#news, #history, #world-examples, #next) {
  --home-light-muted: #62717a;
  --home-light-rule: #cbd7d9;
  background-color: white;
  color: var(--ink);
}

#main :is(#news, #history, #world-examples, #next) :is(.eyebrow, h2 em),
#main #world-examples .world-evidence-heading h3 em {
  color: var(--teal);
}

/* Keep the news story artwork and its brand-specific card colors. */
#main #news :is(.news-heading > a, .news-continue, .news-arrow) {
  color: var(--teal);
}

#main #news .news-arrow {
  border-color: var(--teal);
}

#main #news .news-arrow:hover {
  color: white;
  background-color: var(--teal);
}

#main #news .news-continue {
  border-top-color: var(--home-light-rule);
}

#main #news .news-picker button[aria-pressed="false"]::before {
  background-color: #788e97;
}

#main #news:not([data-story="stonybrook"]) .news-picker button[aria-pressed="true"]::before {
  background-color: var(--teal);
}

#main #history :is(.history-heading-note, .milestone-copy p, .history-bottom p, .history-references) {
  color: var(--home-light-muted);
}

#main #history .history-bottom strong {
  color: var(--ink);
}

#main #history :is(.history-bottom-links a, .history-references a, .timeline-arrow) {
  color: var(--teal);
}

#main #history .history-bottom-links a {
  border-bottom-color: currentColor;
}

#main #history :is(.history-bottom, .history-milestone) {
  border-bottom-color: var(--home-light-rule);
  border-top-color: var(--home-light-rule);
}

#main #history .milestone-date {
  background-color: #eef5f6;
  border-top-color: var(--teal);
}

#main #history .history-milestone:nth-child(even) .milestone-date {
  background-color: #e4eef0;
}

#main #history .history-milestone.history-networks .milestone-date {
  background-color: var(--teal);
}

#main #history .history-networks .timeline-arrow {
  color: white;
}

#main #history .milestone-node {
  background-color: var(--teal);
  border-color: white;
  box-shadow: 0 0 0 1px var(--teal);
}

#main #world-examples :is(.world-evidence-heading > p, .mission-cases article > p:not(.case-category), .global-support p),
#main #next .lede {
  color: var(--home-light-muted);
}

#main #world-examples :is(.case-category, .text-link),
#main #next .next-back-to-top {
  color: var(--teal);
}

#main #world-examples :is(.mission-domains, .mission-domains li, .global-support) {
  border-color: var(--home-light-rule);
}

#main #news :is(.news-carousel, .news-heading > a, .news-continue, button):focus-visible,
#main #history :is(a, summary):focus-visible,
#main #world-examples a:focus-visible,
#main #next :is(a, button):focus-visible {
  outline-color: var(--teal);
}

@media (max-width: 1050px) {
  #main #history :is(.milestone-date, .timeline-arrow) {
    color: var(--teal) !important;
  }
}
