/* Board artwork, destination order and the hero each belong to their board.
   The chooser and footer use the same navigation rhythm across shell variants. */
@media screen {
  :is(#site-header, footer.site-footer) {
    --discovery-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --discovery-line: var(--site-directory-line, #415858);
    --discovery-focus: var(--site-directory-focus, #f3c783);
  }
  @layer premium-navigation {
    #site-header.site-header :is(.shell-mobile-products, .after-dark-product-list) > a.shell-mobile-product:not([hidden]) {
      grid-template-columns: 3.5rem minmax(0, 1fr) .8rem !important;
      gap: .75rem !important;
      padding: .5rem .7rem .5rem .4rem !important;
      border: 0 !important;
      border-bottom: 1px solid var(--discovery-line) !important;
      border-radius: 0 !important;
      background: transparent !important;
    }
    #site-header.site-header :is(.shell-mobile-products, .after-dark-product-list) > a.shell-mobile-product img {
      width: 3.5rem !important;
      height: 3.5rem !important;
      border-radius: .25rem !important;
    }
    #site-header.site-header :is(.shell-mobile-products, .after-dark-product-list) > a.shell-mobile-product .shell-mobile-product-copy strong {
      font: 650 .81rem/1.2 var(--discovery-ui) !important;
    }
    #site-header.site-header :is(.shell-mobile-products, .after-dark-product-list) > a.shell-mobile-product .shell-mobile-product-copy em {
      font: 680 1rem/1.32 var(--discovery-ui) !important;
      text-wrap: pretty;
    }
    #site-header.site-header :is(.shell-mobile-products, .after-dark-product-list) > a.shell-mobile-product:is([aria-current], :focus-visible, :active):not([hidden]) {
      background: var(--stud-theme-nav-selected-surface, #253b3b) !important;
      color: var(--stud-theme-nav-selected-ink, #fff2d9) !important;
      box-shadow: inset 3px 0 var(--discovery-focus);
    }
    #site-header.site-header .shell-mobile-nav--open-wall .shell-mobile-products { gap: 0 !important; }

    /* The complete footer list stays in a single predictable order. Give
       each link the entire cell, including where its text wraps on a phone. */
    footer.site-footer .site-footer-utilities .site-footer-group li > a {
      display: flex !important;
      align-items: center;
      inline-size: 100%;
      box-sizing: border-box;
      min-block-size: 44px;
      font: 560 .95rem/1.35 var(--discovery-ui) !important;
    }
    footer.site-footer .site-footer-utilities .site-footer-group ul a:is(:active, :focus-visible) {
      background: var(--stud-theme-nav-hover-surface, #244044);
      color: var(--stud-theme-nav-hover-ink, #fff2d9) !important;
    }
    @media (hover: hover) {
      #site-header.site-header :is(.shell-mobile-products, .after-dark-product-list) > a.shell-mobile-product:hover:not([hidden]) {
        background: var(--stud-theme-nav-hover-surface, #244044) !important;
      }
    }
    @media (max-width: 760px) {
      footer.site-footer .site-footer-utilities .site-footer-group + .site-footer-group {
        padding-block-start: .95rem;
        border-block-start: 1px solid var(--discovery-line);
      }
      footer.site-footer .site-footer-utilities .site-footer-group li { border-block-end: 0; }
    }
    @media (forced-colors: active) {
      #site-header.site-header :is(.shell-mobile-products, .after-dark-product-list) > a.shell-mobile-product[aria-current] {
        border-inline-start: 3px solid LinkText !important;
      }
    }
  }

  /* Keep the book and its continuous chapters. A part heading, numbered
     chapter and lesson link should each look like a different level. */
  .biohack-page .biohack-shell .book-contents {
    row-gap: clamp(1.65rem, 3.4vw, 2.75rem);
  }
  .biohack-page .biohack-shell .contents-part {
    border-block-start: 2px solid var(--stud-theme-line, var(--line));
    padding-block-start: .95rem;
  }
  .biohack-page .biohack-shell .contents-part .contents-description strong {
    line-height: 1.3;
    text-wrap: pretty;
  }
  .biohack-page .biohack-shell .book-cover-actions,
  .biohack-page .biohack-shell .chapter-shortcuts {
    gap: .25rem 1rem;
  }
  .biohack-page .biohack-shell :is(.book-cover-actions, .chapter-shortcuts, .foundations-entry, .related-region, .path-card) a.text-link {
    display: inline-flex;
    min-block-size: 44px;
    align-items: center;
    text-underline-offset: .22em;
  }
  .biohack-page .biohack-shell :is(.book-cover-actions, .contents-part, .related-region, .path-card, .chapter-shortcuts) a:focus-visible {
    outline: 3px solid var(--stud-theme-focus, #d2e7a8);
    outline-offset: 2px;
  }
  .biohack-page .biohack-shell .chapter-pagination .path-next strong {
    font-weight: 650;
  }
}
