/* Continuous reading with the original right-hand section navigator. */
html { overflow-y: scroll; scrollbar-gutter: stable; scrollbar-color: var(--accent) var(--bg-soft); scroll-padding-top: var(--reading-offset, 104px); }
.multipage .section .component-h, .multipage .section[id], .multipage .page-intro, .multipage .hero, .multipage #what { scroll-margin-top: 0; }
.reading-nav a[aria-current="location"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border-left-color: var(--accent); font-weight: 600; }
.reading-nav a:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.reading-nav { background: transparent; }
/* Attach progress to the sticky header so it stays visible at every viewport size. */
.page-progress { position: absolute; inset: calc(100% + 1px) 0 auto; z-index: 1; display: block; width: 100%; height: 4px; margin: 0; padding: 0; border: 0; appearance: none; pointer-events: none; background: var(--line); color: var(--accent); }
.page-progress::-webkit-progress-bar { background: var(--line); }
.page-progress::-webkit-progress-value { background: var(--accent); }
.page-progress::-moz-progress-bar { background: var(--accent); }
.related-pages { padding-top: 18px; border-top: 1px solid var(--line); }
.related-pages .page-nav-title { margin-bottom: 6px; }
.reading-nav .side-demo { margin-top: 16px; background: transparent; }
.mobile-index { display: none; }
.result-intro { margin-bottom: 36px; }
/* The comparison is a subsection of zero-shot results, using its original grid. */
.comparison-section .section-heading h3 { margin: 0; font-size: var(--heading-component); line-height: 1.35; font-weight: 650; letter-spacing: -0.025em; }
.comparison-section .section-heading { margin-bottom: 28px; }
.results-sequence .section + .section { border-top: 2px solid var(--accent); margin-top: 16px; }
.results-sequence .section:first-child { padding-top: 24px; }

/* Fade only at the viewport edges; the central reading area stays fully opaque.
   No content is removed from document flow, focus order, search, or printing. */
html[data-scroll-motion="enabled"] [data-scroll-scene] {
  opacity: var(--scene-opacity, 1);
  transform: translate3d(0, var(--scene-shift, 0px), 0);
}
html[data-scroll-motion="enabled"] [data-scroll-scene]:focus-within {
  opacity: 1 !important;
  transform: none !important;
}

@media (min-width: 1280px) {
  .multipage { --layout: min(1456px, calc(100vw - 80px)); --content: calc(var(--layout) - 256px); --shell-left: calc((100vw - var(--layout)) / 2); }
  .multipage .content-width, .multipage .hero .container, .multipage .section, .multipage .site-footer .inner { width: var(--content); margin-left: var(--shell-left); margin-right: 0; }
  .multipage .hero-grid { gap: 44px; }
  .reading-nav { top: calc(var(--topbar-height, 82px) + 24px); padding-block: 10px; max-height: calc(100dvh - var(--topbar-height, 82px) - 48px); }
  .reading-nav a { font-size: 13px; min-height: 42px; }
}
@media (max-width: 1279px) {
  html { scroll-padding-top: var(--reading-offset, 156px); }
  .mobile-index { display: block; position: sticky; top: var(--topbar-height, 82px); z-index: 40; background: var(--bg); border-bottom: 1px solid var(--line); }
  .mobile-index details { width: var(--layout); margin-inline: auto; position: relative; }
  .mobile-index summary { display: flex; align-items: center; gap: 10px; min-height: 50px; cursor: pointer; list-style: none; font-size: 13px; color: var(--ink-soft); }
  .mobile-index summary > .icon { width: 18px; height: 18px; }
  .mobile-index summary > .icon:last-child { margin-left: auto; width: 16px; }
  .mobile-index [data-current-section] { color: var(--accent); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-left: 8px; }
  .mobile-index ul { position: absolute; top: 100%; left: 0; width: 100%; list-style: none; padding: 8px; margin: 0; max-height: min(65vh, 420px); overflow-y: auto; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 10px 20px #20293610; }
  .mobile-index a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px; color: var(--ink-soft); border-left: 2px solid transparent; font-size: 14px; line-height: 1.4; }
  .mobile-index a[aria-current="location"] { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
  .mobile-index a:hover { background: var(--bg-soft); text-decoration: none; }
  .mobile-index details[open] summary > .icon:last-child { transform: rotate(180deg); }
}
@media (max-width: 700px) {
  html { scroll-padding-top: var(--reading-offset, 146px); }
  .mobile-index { top: var(--topbar-height, 72px); }
  .mobile-index summary { gap: 8px; }
  .mobile-index summary > span:first-of-type { white-space: nowrap; }
  .mobile-index [data-current-section] { margin-left: 2px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html [data-scroll-scene] { opacity: 1 !important; transform: none !important; }
}
@media print {
  html { overflow: visible; scrollbar-gutter: auto; }
  .reading-nav, .mobile-index, .page-progress { display: none !important; }
  html [data-scroll-scene] { opacity: 1 !important; transform: none !important; }
  .multipage { --layout: 100%; --content: 100%; --shell-left: 0px; }
  .multipage .content-width, .multipage .hero .container, .multipage .section, .multipage .site-footer .inner { width: 100%; margin: 0; }
}

/* Release details and usable citation/video controls. */
.hero-anim { position: relative; padding: 0; background: transparent; border: 0; border-radius: 0; }
.video-replay { position: absolute; top: 12px; right: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 5px; background: #fffffff2; color: #2c5885; font: 600 12px/1.4 var(--font); cursor: pointer; }
.video-error { padding: 12px; font-size: var(--text-caption); color: var(--figure-ink); }
.video-error a { color: var(--figure-link); }
.resource-details { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); scroll-margin-top: 100px; }
.resource-details h3 { margin-bottom: 10px; }
.dataset-links { padding: 0; list-style: none; }
.dataset-links li { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-block: 12px; }
.dataset-links span { color: var(--ink-mute); font-size: var(--text-detail); }
.citation-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; margin-block: 22px 14px; }
.citation-actions button, .citation-actions a { border: 1px solid var(--line); background: var(--bg-elev); color: var(--accent); padding: 10px 14px; border-radius: 5px; font: 600 14px/1.5 var(--font); cursor: pointer; }
#citation-status { color: var(--ink-soft); font-size: var(--text-caption); }
@media print { .video-replay, .citation-actions button { display: none; } }

/* Approved compact schematic alongside the few-shot calibration introduction. */
.fewshot-intro-layout { display: grid; gap: 24px; align-items: center; }
.fewshot-intro-layout > .lede { margin: 0; min-width: 0; }
.fewshot-schematic { width: 100%; max-width: 680px; min-width: 0; margin: 0; justify-self: center; }
.fewshot-schematic .figure-link { background: var(--figure-bg); }
.fewshot-schematic img { display: block; width: 100%; height: auto; }
.fewshot-schematic figcaption { margin-top: 8px; text-align: right; font-size: var(--text-caption); line-height: 1.5; }
.fewshot-schematic figcaption a { color: var(--accent); text-decoration: underline; }
@media (min-width: 1100px) {
  .fewshot-intro-layout { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 32px; }
}

/* Optional metric definitions precede the results; equations open by default. */
.metric-guide .metric-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; }
.metric-guide .data-details { margin-top: 0; min-width: 0; }
.metric-guide .data-details summary { min-height: 56px; }
.metric-guide .data-details summary .icon { flex-shrink: 0; }
.metric-guide .data-details p { font-size: var(--text-detail); margin-bottom: 16px; }
@media (max-width: 850px) {
  .metric-guide .metric-items { grid-template-columns: 1fr; gap: 0; }
}
