/* Three destinations share the full header; local links sit beneath their module. */
:root { --tf-header-height: 200px; }
html { scroll-padding-top: calc(var(--tf-header-height) + 18px); }
.site-header.has-destinations, .analytics-page .ba-header {
  position: sticky; top: 0; left: auto; right: auto; z-index: 40;
  display: grid; grid-template-columns: repeat(3,minmax(0,1fr));
  align-items: center; gap: 0; min-height: 0; padding: 0;
  border-bottom: 1px solid #d9e3ef; background: rgba(255,255,255,.97);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 5px 24px #07133406;
}
.has-destinations .destination-switch, .analytics-page .ba-header .destination-switch {
  grid-column: 1/-1; grid-row: 1; justify-self: stretch;
  display: grid; grid-template-columns: repeat(3,minmax(0,1fr));
  width: 100%; max-width: none; margin: 0; padding: 0; gap: 0;
  border: 0; border-bottom: 1px solid #dfe7f1; border-radius: 0;
  background: #f8fafc;
}
.destination-switch a {
  --destination-accent: #245bff;
  position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  min-width: 0; min-height: 146px; padding: 18px 24px;
  border: 0; border-radius: 0; color: #53647c; text-decoration: none;
  font: 600 14px/1.4 Arial, Helvetica, sans-serif; text-align: center;
  transition: color 180ms ease, background-color 180ms ease;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.destination-switch a + a { border-left: 1px solid #dfe7f1; }
.destination-switch a[data-destination="materials"] { --destination-accent: #148d90; }
.destination-switch a[data-destination="studio"] { --destination-accent: #175eaa; }
.destination-switch a::after {
  content: ''; position: absolute; inset: auto 0 -1px; height: 3px;
  background: var(--destination-accent); opacity: 0;
  transition: opacity 180ms ease;
}
.destination-switch .destination-brand {
  display: flex; align-items: center; justify-content: center;
  width: min(320px,100%); height: 82px;
  transition: transform 200ms ease;
}
.destination-switch .destination-logo { display: block; width: 100%; height: auto; max-height: 82px; object-fit: contain; }
.destination-switch .destination-logo-tissueforge { width: 292px; max-width: 100%; }
.destination-switch .destination-logo-analysis { width: 292px; max-width: 100%; }
.destination-switch .destination-logo-merotope { width: 270px; max-width: 100%; }
.destination-switch .destination-logo-merotope-compact { display: none; width: 48px; height: 48px; }
.destination-switch .destination-wordmark {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  max-width: 100%; color: #102956;
  font: 600 34px/1.05 Arial, Helvetica, sans-serif; letter-spacing: -.045em;
}
.destination-switch .destination-wordmark > span {
  display: block; color: #245bff; font-size: 25px; line-height: 1.1;
  font-weight: 500; letter-spacing: -.025em;
}
.destination-switch .destination-label { display: block; max-width: 100%; }
.destination-switch .destination-studio { font-weight: 700; }
.destination-switch a[aria-current="page"] { color: #0b245d; }
.destination-switch a[data-destination="materials"][aria-current="page"] { background: linear-gradient(110deg,#f1f8f9,#e9f5f4 55%,#f0f7fa); }
.destination-switch a[data-destination="analysis"][aria-current="page"] { background: linear-gradient(110deg,#f2f6fd,#eaf0ff 55%,#f2f5fc); }
.destination-switch a[data-destination="studio"][aria-current="page"] { background: linear-gradient(110deg,#f1f6fc,#eaf3fb 55%,#f0f7fa); }
.destination-switch a[aria-current="page"]::after { opacity: 1; }
.destination-switch a:focus-visible { z-index: 1; outline: 3px solid #245bff; outline-offset: -5px; }
@media (hover: hover) {
  .destination-switch a:hover { background-color: #eaf0f8; color: #0b245d; }
  .destination-switch a:hover .destination-brand { transform: translateY(-2px); }
  .destination-switch a:not([aria-current="page"]):hover::after { opacity: .3; }
}
.has-destinations .site-nav, .analytics-page .analytics-subnav, .analytics-page .studio-subnav {
  display: flex; grid-column: 1; grid-row: 2; justify-self: stretch;
  align-items: center; justify-content: center; gap: 16px;
  margin: 0; padding: 5px 16px; min-width: 0; min-height: 54px; border: 0;
}
.analytics-page .analytics-subnav { grid-column: 2; gap: 24px; }
.analytics-page .studio-subnav { grid-column: 3; gap: 24px; }
.has-destinations .site-nav a, .analytics-page .analytics-subnav a, .analytics-page .studio-subnav a {
  display: inline-flex; align-items: center; min-height: 44px;
  color: #263b65; font-size: 12px; font-weight: 600; text-decoration: none;
}
.analytics-page .analytics-subnav a, .analytics-page .studio-subnav a { gap: 8px; justify-content: center; text-align: center; }
.analytics-page .analytics-subnav a:hover, .analytics-page .studio-subnav a:hover { color: #245bff; }
.has-destinations .site-nav a:focus-visible,
.analytics-page .analytics-subnav a:focus-visible,
.analytics-page .studio-subnav a:focus-visible,
.has-destinations .menu-button:focus-visible { outline: 2px solid #245bff; outline-offset: 3px; border-radius: 3px; }
.has-destinations .site-nav a::after { bottom: 3px; height: 2px; background: #245bff; }
.has-destinations .menu-button { display: none; }
.has-destinations~main>.hero { padding-top: 0; min-height: calc(49rem - 12.5rem); }
@media (max-width: 1440px) {
  .has-destinations .menu-button {
    grid-column: 1; grid-row: 2; justify-self: center;
    display: inline-flex; align-items: center; justify-content: center; gap: 12px;
    width: auto; height: 44px; min-height: 44px; margin: 5px 0; padding: 0 15px;
    border: 0; border-radius: 10px; color: #263b65; background: transparent;
    font: 600 12px/1.3 Arial, Helvetica, sans-serif; cursor: pointer;
  }
  .has-destinations .menu-button .module-menu-label {
    display: inline; width: auto; height: auto; background: none; transform: none;
  }
  .has-destinations .menu-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
  .has-destinations .menu-button:hover, .has-destinations .menu-button[aria-expanded="true"] { background: #eef6f8; }
  .has-destinations .site-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    width: 100%; grid-column: auto; grid-row: auto; margin: 0; padding: 10px 24px 24px;
    min-height: 0; max-height: calc(100dvh - var(--tf-header-height));
    overflow-y: auto; overscroll-behavior: contain; justify-self: stretch;
    align-content: start; justify-content: stretch; gap: 0;
    border-top: 1px solid #dbe3ef; border-bottom: 1px solid #dbe3ef;
    background: rgba(255,255,255,.99); box-shadow: 0 15px 25px #0713340b;
  }
  .has-destinations .site-nav.is-open { display: grid; }
  .has-destinations .site-nav a { font-size: 15px; padding: 16px 0; border-bottom: 1px solid #e6edf5; }
  .has-destinations .site-nav a::after { display: none; }
}
@media (max-width: 1100px) {
  .destination-switch a { padding-inline: 18px; font-size: 13px; }
  .destination-switch .destination-logo-tissueforge { width: 270px; }
  .destination-switch .destination-logo-analysis { width: 270px; }
  .destination-switch .destination-logo-merotope { width: 250px; }
  .analytics-page .analytics-subnav, .analytics-page .studio-subnav { gap: 0; padding-inline: 10px; }
  .analytics-page .analytics-subnav .analytics-examples-link,
  .analytics-page .studio-subnav .studio-analytics-link { display: none; }
}
@media (max-width: 680px) {
  .destination-switch a { gap: 7px; min-height: 116px; padding: 12px 12px; font-size: 11px; }
  .destination-switch .destination-brand { height: 48px; }
  .destination-switch .destination-logo { max-height: 48px; }
  .destination-switch .destination-wordmark { font-size: 23px; }
  .destination-switch .destination-wordmark > span { font-size: 18px; }
  .destination-switch .destination-label { min-height: 30px; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; column-gap: 3px; line-height: 1.35; }
  .analytics-page .analytics-subnav, .analytics-page .studio-subnav { padding-inline: 6px; }
  .analytics-page .analytics-subnav a, .analytics-page .studio-subnav a { font-size: 11px; gap: 5px; min-width: 0; white-space: normal; }
  .has-destinations .menu-button { gap: 7px; padding-inline: 8px; font-size: 11px; max-width: 100%; }
  .has-destinations .menu-button svg { width: 18px; height: 18px; flex-shrink: 0; }
  .has-destinations~main>.hero { padding-top: 0; min-height: 0; }
}
@media (max-width: 420px) {
  .destination-switch a { padding-inline: 8px; min-height: 110px; }
  .destination-switch .destination-brand { height: 42px; }
  .destination-switch .destination-logo { max-height: 42px; }
  .destination-switch .destination-wordmark { font-size: 18px; }
  .destination-switch .destination-wordmark > span { font-size: 15px; }
  .destination-switch .destination-label { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .destination-switch a, .destination-switch a::after, .destination-switch .destination-brand { transition: none; }
  .destination-switch a:hover .destination-brand { transform: none; }
}

/* Supplied simplified Merotope mark keeps its cell outlines legible in narrow tabs. */
@media(max-width:860px){.destination-switch .destination-logo-merotope{display:none}.destination-switch .destination-logo-merotope-compact{display:block;width:48px;height:48px}}
@media(max-width:420px){.destination-switch .destination-logo-merotope-compact{width:42px;height:42px}}
