/* Category pages share the site's paper, ink and reading type. */
html.product-document:not(.chapter-paging) { scroll-snap-type: none; }
html.product-document body {
  display: grid; grid-template-rows: 1fr auto;
  min-height: 100vh; min-height: 100dvh;
}
.product-main {
  --product-line: #d6cdbb;
  --product-muted: #625b50;
  --product-width: min(68rem, calc(100% - 2 * var(--chapter-gutter)));
  --reading: var(--font-english), var(--font-chinese-body);
  background: var(--content-paper); color: var(--ink);
  padding-block: var(--header-height) clamp(64px, 9vw, 130px);
}
.product-shell, .catalog-hero { width: var(--product-width); margin-inline: auto; }
.product-main :is(h1,h2,h3) { overflow-wrap: anywhere; }
.product-main :is(p,li,figcaption,nav) { font-family: var(--reading); }
.catalog-hero { padding-block: var(--content-start-inset) clamp(32px, 4.5vw, 66px); }
html.product-document .product-main h1 {
  margin: 0; font-size: var(--page-title); line-height: 1.1; letter-spacing: -.04em;
}
.catalog-hero > p, .project-lead-copy > p {
  max-width: 46rem; margin: 18px 0 0; color: var(--product-muted);
  font-size: clamp(1.03rem, 1.45vw, 1.24rem); line-height: 1.68; text-wrap: pretty;
}
.data-hero > p { max-width: none; text-wrap: wrap; }
.catalog-hero > .benchmark-intro:lang(zh) { max-width: none; text-wrap: balance; }
.benchmark-intro:lang(zh) > span { display: inline-block; max-width: 100%; }
.product-main nav > a::after { content: none; }
.product-breadcrumb, .project-outline {
  inset: auto; max-height: none; overflow: visible; padding: 0; background: none; border: 0;
}
.product-breadcrumb {
  display: flex; position: static; justify-content: flex-start; flex-wrap: wrap;
  align-items:center; gap: 10px; margin-bottom: clamp(12px,2vw,24px);
}
.product-breadcrumb a, .product-breadcrumb span { color: var(--product-muted); font-size: .96rem; }
.product-breadcrumb a { padding: 7px 0; }
.product-breadcrumb a:hover, .project-outline a:hover { text-decoration: underline; text-underline-offset: .2em; }
/* The shared card surface and link treatment are also used on the homepage. */
.project-list { display: grid; grid-auto-rows: 1fr; gap: 12px; }
.project-list .project-card {
  position: relative;
  grid-template-columns: clamp(132px, 16vw, 204px) minmax(0, 1fr) max-content;
  gap: clamp(16px, 2.4vw, 34px);
  padding: 12px clamp(18px, 2.3vw, 32px) 12px 12px;
  scroll-margin-top: calc(var(--header-height) + 1em);
}
.project-card-copy { min-width: 0; }
.project-card-title {
  margin: 0; font: var(--heading-weight) clamp(1.35rem, 2vw, 1.78rem)/1.23 var(--font-heading);
  letter-spacing: -.022em;
}
.project-card p {
  margin: 8px 0 0; color: var(--product-muted);
  font: 400 1rem/1.55 var(--font-chinese-body); overflow-wrap: anywhere;
}
.project-link-arrow { font: 1em var(--font-chinese-body); color: #776344; }
.dataset-list { grid-template-columns: minmax(0, 1fr); }
.dataset-list .project-card-title, .dataset-sheet h1 { word-break: keep-all; }
.bookmark-anchor {
  position: absolute; inset: 0 auto auto 0; width: 1px; height: 1px;
  pointer-events: none; scroll-margin-top: calc(var(--header-height) + 1.5em);
}
.dataset-list .project-card p {
  margin-top: 12px;
  line-height: 1.65;
  text-wrap: pretty;
}
@media (min-width: 721px) {
  .dataset-list { gap: 16px; }
  .dataset-list .project-card {
    grid-template-columns: clamp(112px, 12vw, 160px) minmax(0, 1fr) auto;
    gap: clamp(24px, 3vw, 44px);
    padding: 16px clamp(24px, 3vw, 40px) 16px 16px;
  }
}
.quality-method { scroll-margin-top: calc(var(--header-height) + 1em); }
.quality-method { padding:clamp(20px,3vw,36px); margin:0 0 clamp(28px,4vw,48px); background:#ebe9df; border-radius:4px; }
.quality-method h2 { margin:0; font-size:var(--section-title); letter-spacing:-.025em; line-height:1.2; }
.quality-method > p { max-width:63ch; margin:14px 0 0; color:var(--product-muted); line-height:1.68; }
.quality-stages {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 28px 0 0; padding: 0; list-style: none; counter-reset: quality-step;
}
.quality-stages li {
  position: relative; min-width: 0; padding: 0 18px 0 0; counter-increment: quality-step;
}
.quality-stages li::before {
  content: counter(quality-step, decimal-leading-zero); display: grid; place-items: center;
  width: 2rem; height: 2rem; margin-bottom: 12px; border-radius: 50%;
  background: #356c66; color: #fff9e9; font: 500 .85rem/1 var(--font-english);
}
.quality-stages li:not(:last-child)::after {
  content: ""; position: absolute; inset: calc(1rem - 5px) 8px auto calc(2rem + 8px);
  height: 10px; background: #5f7d72;
  clip-path: polygon(0 42%, calc(100% - 8px) 42%, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, calc(100% - 8px) 58%, 0 58%);
}
.quality-stages p { margin: 7px 0 0; font-size: .98rem; line-height: 1.55; color: var(--product-muted); }
.quality-loop { position: relative; padding-inline: 1.25rem; }
.quality-feedback {
  padding-top: 24px; text-align: center; color: #335e56; font: 500 1rem/1.45 var(--reading);
}
.quality-feedback > span { position: relative; padding-inline: .6em; background: #ebe9df; }
@media (min-width: 721px) {
  .quality-stages li:last-child::after {
    content: ""; position: absolute; inset: calc(1rem - 1px) -1.25rem auto calc(2rem + 6px);
    height: 2px; background: #356c66;
  }
  .quality-feedback::before {
    content: ""; position: absolute; inset: calc(1rem - 1px) 0 calc(.725rem - 1px);
    border: solid #356c66; border-width: 0 2px 2px; border-radius: 0 0 9px 9px;
  }
  .quality-feedback::after {
    content: ""; position: absolute; left: 0; top: calc(1rem - 5px);
    width: 18px; height: 10px; background: #356c66;
    clip-path: polygon(0 40%, 10px 40%, 10px 0, 100% 50%, 10px 100%, 10px 60%, 0 60%);
  }
}
@media (max-width: 720px) {
  .quality-loop { padding: 0; --loop-gutter: 1.3rem; }
  .quality-stages { position: relative; grid-template-columns: 1fr; gap: 18px; padding-left: var(--loop-gutter); }
  .quality-stages::before {
    content: ""; position: absolute; inset: 1rem auto -.5rem 0; width: 14px;
    border: solid #356c66; border-width: 2px 0 0 2px; border-radius: 7px 0 0;
  }
  .quality-stages::after {
    content: ""; position: absolute; top: calc(1rem - 4px); left: 8px; width: 8px; height: 8px;
    border: solid #356c66; border-width: 2px 2px 0 0; transform: rotate(45deg);
  }
  .quality-stages li { display: grid; grid-template-columns: 2rem 1fr; gap: 0 .75rem; align-items: center; padding: 0; }
  .quality-stages li::before { margin: 0; }
  .quality-stages li:not(:last-child)::after {
    inset: 2.15rem auto -15px calc(1rem - 4px); width: 8px; height: auto;
    clip-path: polygon(40% 0, 60% 0, 60% calc(100% - 6px), 100% calc(100% - 6px), 50% 100%, 0 calc(100% - 6px), 40% calc(100% - 6px));
  }
  .quality-stages li:last-child::after {
    content: ""; position: absolute; inset: 2.15rem auto -.5rem calc(1rem - 1px);
    width: 2px; background: #356c66;
  }
  .quality-stages li p { grid-column: 2; margin-top: 3px; }
  .quality-feedback {
    position: relative; margin-top: .5rem; text-align: left; padding: 0 0 0 calc(var(--loop-gutter) + 2.75rem);
  }
  .quality-feedback::before {
    content: ""; position: absolute; box-sizing: border-box; inset: 0 auto auto 0;
    width: calc(var(--loop-gutter) + 1rem + 1px); height: 1rem;
    border: solid #356c66; border-width: 0 2px 2px; border-radius: 0 0 6px 6px; transform: none;
  }
  .quality-feedback > span { position: static; padding: 0; background: none; }
}
.project-hero { padding-block:var(--content-start-inset) clamp(38px,6vw,86px); }
.project-lead { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,.88fr); gap:clamp(28px,6vw,84px); align-items:center; }
.project-example {
  margin-top: clamp(20px, 2vw, 28px);
  padding-top: 16px;
  border-top: 1px solid var(--product-line);
}
.project-example p { margin: 0; line-height: 1.6; color: var(--product-muted); }
.project-example .project-example-question {
  margin-top: 6px;
  font-size: clamp(1.125rem, 1.55vw, 1.375rem);
  line-height: 1.45;
  color: var(--ink);
  text-wrap: balance;
}
.project-lead figure, .replay-frames figure { margin:0; }
.project-lead figure { align-self: start; }
.project-lead .catalog-illustration { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; }
.project-lead figcaption { margin-top:8px; font-size:.88rem; color:var(--product-muted); }
.project-reading {
  display:grid; grid-template-columns:minmax(10rem,.68fr) minmax(0,2fr); align-items:start;
  gap:clamp(32px,7vw,90px); border-top:1px solid var(--product-line); padding-top:clamp(26px,4vw,54px);
}
.project-outline { display:block; position:sticky; top:calc(var(--header-height) + 20px); }
.outline-title { font-size:.92rem; color:#776344; }
.project-outline ul { list-style:none; margin:8px 0 0; padding:0; }
.project-outline a { display:inline-block; padding-block:7px; line-height:1.45; }
.project-body { min-width:0; max-width:44rem; }
.project-section { scroll-margin-top:calc(var(--header-height) + 1em); }
.project-section + .project-section { margin-top:clamp(32px,5vw,56px); }
.project-section h2 { margin:0 0 14px; font-size:var(--section-title); line-height:1.22; letter-spacing:-.035em; }
.project-section p { margin:8px 0 0; line-height:1.76; color:var(--product-muted); }
.replay-frames { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:28px 18px; }
.replay-frames img { display:block; width:100%; height:auto; }
.replay-frames figcaption { margin-top:8px; }
.replay-frames figcaption p { margin:4px 0 0; font-size:.94rem; }
.clinical-replay-link { margin-top:12px; min-height:44px; gap:8px; }
.clinical-related { margin-top:clamp(32px,5vw,56px); padding-top:20px; border-top:1px solid var(--product-line); }
.clinical-related h2 { margin:0; font:500 1rem/1.5 var(--reading); color:var(--product-muted); }
.clinical-related ul { display:flex; flex-wrap:wrap; gap:0 24px; margin:4px 0 0; padding:0; list-style:none; }
.clinical-related a { min-height:44px; gap:6px; }
@media(max-width:720px) {
  .project-reading,.project-lead { grid-template-columns:minmax(0,1fr); }
  .project-outline { display:none; }
  .project-lead figure { max-width:32rem; }
  .project-list .project-card {
    grid-template-columns: clamp(96px, 21vw, 132px) minmax(0, 1fr) auto;
    gap: 14px; padding: 12px;
  }
  .project-card-title { font-size: clamp(1.18rem, 3.6vw, 1.45rem); }
  .project-card p { font-size: .94rem; line-height: 1.52; }
}
@media(max-width:410px) {
  .replay-frames { grid-template-columns:1fr; }

}

@media (max-width: 540px) {
  .project-list { gap: 10px; }
  .project-list .project-card {
    grid-template-columns: 74px minmax(0, 1fr); gap: 0 13px;
    align-content: center; min-height: 84px; padding: 13px;
  }
  .project-card-art { grid-column: 1; grid-row: 1; }
  .project-card-copy { display: contents; }
  .project-card-title { grid-column: 2; grid-row: 1; padding-right: 1.25rem; }
  .project-card p { grid-column: 1 / -1; grid-row: 2; margin: 9px 0 0; }
  .project-card .project-arrow { grid-area: 1 / 2; justify-self: end; }
}

.dataset-sheet > :is(.dataset-sections, .clinical-related) { max-width: 58rem; margin-inline: auto; }
.dataset-sheet h1 { text-wrap: balance; }
.dataset-sheet h1 > [data-i18n] { display: inline-block; max-width: 100%; }
.dataset-sections .project-section {
  display: grid;
  grid-template-columns: minmax(7.5rem, .31fr) minmax(0, 1fr);
  column-gap: clamp(20px, 3vw, 44px);
  align-items: baseline;
  border-top: 1px solid var(--product-line);
  padding-block: clamp(16px, 2.4vw, 26px);
  margin: 0;
}
.dataset-sections h2 {
  margin: 0;
  font-size: clamp(1.12rem, 1.55vw, 1.32rem);
  line-height: 1.4;
  letter-spacing: -.015em;
}
.dataset-sections p { grid-column: 2; max-width: 66ch; margin: 0; }
.dataset-sections p + p { margin-top: .8em; }
.dataset-sections p > strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}
@media (max-width: 540px) {
  .dataset-sheet h1 > [data-i18n] { display: block; }
  .dataset-title-divider { display: none; }
  .dataset-sections .project-section { display: block; }
  .dataset-sections h2 { margin-bottom: 6px; }
}
@media (max-width: 360px) {
  html.product-document .dataset-sheet h1 { font-size: 1.75rem; }
}
.research-paths-art { position: relative; }
.diagram-feedback {
  position: absolute; inset-inline: 0; bottom: calc(100% + .25rem);
  color: #613727;
  font: 500 clamp(.875rem, 1vw, 1rem)/1.2 var(--reading);
  text-align: center;
}
.project-lead .research-paths figcaption { color: var(--ink); font-size: 1rem; }
.research-paths ul { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.research-paths li { display: flex; gap: .65em; align-items: baseline; line-height: 1.5; }
.research-paths li::before { content: ""; width: 1.25em; border-top: 3px solid #a64b36; flex: none; transform: translateY(-.23em); }
.research-paths li + li::before { border-color: #176c73; }
