/* Groundwork: the research story as one readable thread. Type comes from the shared design-system tokens. */
.site-system.ground-page { --gw-display: var(--ds-display); --gw-body: var(--ds-font); }
body.site-system.ground-page { --bg: #fff; margin: 0; background: #fff; font-family: var(--gw-body); font-size: 16px; line-height: 1.65; }
.site-system.ground-page .site-connect { --chrome-paper: #fff; }
.site-system.ground-page :is(h1, h2, h3) { font-family: var(--gw-display); font-weight: 600; letter-spacing: -.012em; font-variant-numeric: lining-nums; }
.groundwork { width: min(1184px, calc(100% - 96px)); margin: 0 auto; padding-bottom: 72px; }
.groundwork *, .groundwork *::before, .groundwork *::after { box-sizing: border-box; }
.groundwork p { margin: 0 0 16px; }
.groundwork a { color: inherit; -webkit-tap-highlight-color: transparent; }
.groundwork a:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 4px; }
.groundwork .ground-kicker { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 14px; font: 400 11px/1.6 var(--gw-body); letter-spacing: .1em; text-transform: uppercase; color: var(--ds-muted); }
.groundwork .ground-kicker > :first-child, .groundwork .ground-kicker .is-preprint { color: var(--ds-accent); }
.groundwork .ground-link { display: inline-flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--ds-line); font-size: 14px; text-decoration: none; }
.groundwork .ground-link:hover { color: var(--ds-accent); border-color: currentColor; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Masthead: the name, the thesis, and the page at a glance. */
.ground-hero { padding: 52px 0 40px; }
.ground-hero > .ground-kicker { margin-bottom: 16px; }
.ground-hero > .ground-kicker > :first-child { color: var(--ds-muted); }
.ground-hero h1 { margin: 0 0 8px; font-size: clamp(52px, 7vw, 92px); font-weight: 500; line-height: .98; letter-spacing: -.02em; color: var(--ds-ink); }
.groundwork .ground-deck { margin: 0 0 28px; font: 400 clamp(24px, 2.7vw, 34px)/1.25 var(--gw-display); color: var(--ds-ink); }
.ground-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px 64px; align-items: end; }
.groundwork .ground-intro { max-width: 620px; margin: 0; font-size: 19px; line-height: 1.6; color: var(--ds-text); }
.ground-facts { display: flex; flex-wrap: wrap; gap: 14px 30px; margin: 0 0 6px; padding: 0; }
.ground-facts > div { padding-left: 14px; border-left: 1px solid var(--ds-line); }
.ground-facts dt { font: 400 10.5px/1.6 var(--gw-body); letter-spacing: .1em; text-transform: uppercase; color: var(--ds-muted); }
.ground-facts dd { margin: 2px 0 0; font: 500 24px/1.2 var(--gw-display); font-variant-numeric: lining-nums; color: var(--ds-ink); white-space: nowrap; }
.ground-hero-links { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--ds-ink); }
.ground-hero-links a { padding: 6px 0; border-bottom: 1px solid var(--ds-line); font-size: 14.5px; text-decoration: none; }
.ground-hero-links a:hover { color: var(--ds-accent); border-color: currentColor; }

/* Sections */
.ground-section { padding: 44px 0 56px; border-top: 1px solid var(--ds-line); scroll-margin-top: calc(var(--nav-h, 84px) + 16px); }
.ground-section-heading { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 10px 48px; align-items: end; margin-bottom: 30px; }
.ground-section-heading .ground-kicker { grid-column: 1 / -1; margin-bottom: 6px; }
.ground-section-heading h2 { margin: 0; font-size: clamp(30px, 3.4vw, 40px); line-height: 1.12; }
.ground-section-heading > p:not(.ground-kicker) { max-width: 420px; margin: 0; justify-self: end; font-size: 15px; line-height: 1.6; color: var(--ds-muted); }

/* The thread index: five steps in a row. */
.thread-index { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0 0 40px; padding: 0; border-top: 1px solid var(--ds-line); border-bottom: 1px solid var(--ds-line); }
.thread-index a { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 16px 14px; border-left: 1px solid var(--ds-line); text-decoration: none; transition: color .18s, box-shadow .18s; }
.thread-index li:first-child a { padding-left: 0; border-left: 0; }
.thread-index .thread-num { font: 400 11px/1.6 var(--gw-body); letter-spacing: .1em; color: var(--ds-accent); }
.thread-index .thread-name { font: 600 18px/1.25 var(--gw-display); color: var(--ds-ink); }
.thread-index .thread-year { font-size: 12.5px; color: var(--ds-muted); }
.thread-index a:hover .thread-name, .thread-index a[aria-current="true"] .thread-name { color: var(--ds-accent); }
.thread-index a[aria-current="true"] { box-shadow: inset 0 -2px 0 var(--ds-accent); }

/* The steps: a numbered rail with every paper open. */
.thread-steps { list-style: none; margin: 0; padding: 0; }
.thread-step { position: relative; display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 0 24px; scroll-margin-top: calc(var(--nav-h, 84px) + 20px); }
.thread-step::before { content: ""; position: absolute; left: 22px; top: 52px; bottom: 0; border-left: 1px solid var(--ds-line); }
.thread-step:last-child::before { bottom: 36px; }
.step-rail { position: relative; }
.step-num { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--ds-ink); border-radius: 50%; background: #fff; font: 500 16px/1 var(--gw-display); font-variant-numeric: lining-nums; color: var(--ds-ink); }
.step-body { max-width: 760px; padding: 4px 0 34px; }
.step-body .ground-kicker { margin-bottom: 12px; }
.step-body h3 { margin: 0 0 14px; font-size: clamp(26px, 3vw, 34px); line-height: 1.15; }
.groundwork .step-answer { margin-bottom: 14px; font-size: 17px; line-height: 1.7; color: var(--ds-text); }
.groundwork .step-caution { margin: 0 0 22px; font-size: 14px; line-height: 1.6; color: var(--ds-muted); }
.step-caution span { display: inline-block; margin-right: 10px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ds-accent); }
.step-citation { display: grid; gap: 6px; padding: 18px 22px; border: 1px solid var(--ds-line); border-radius: 3px; background: var(--ds-paper); }
.paper-status { justify-self: start; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ds-muted); }
.paper-status.is-preprint { color: var(--ds-accent); }
.groundwork .citation-title { margin: 0; font: 600 17px/1.35 var(--gw-display); color: var(--ds-ink); }
.groundwork .citation-meta { margin: 0 0 6px; font-size: 13px; line-height: 1.6; color: var(--ds-muted); }
.step-citation .ground-link { justify-self: start; }
.groundwork .step-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 0; font-size: 13px; }
.step-links > span { margin-right: 4px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ds-muted); }
.step-links a { padding: 4px 10px; border: 1px solid var(--ds-line); border-radius: 999px; text-decoration: none; }
.step-links a:hover { border-color: var(--ds-accent); color: var(--ds-accent); }
.thread-bridge { grid-column: 2; display: flex; gap: 16px; align-items: baseline; max-width: 760px; padding: 0 0 36px; }
.thread-bridge .bridge-mark { font: 400 22px/1 var(--gw-display); color: var(--ds-accent); }
.thread-bridge p { margin: 0; font: 400 21px/1.35 var(--gw-display); color: var(--ds-ink); }
.ground-open-question { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 0 24px; align-items: start; }
.ground-open-question > .ground-kicker { margin: 0; padding-top: 22px; }
.open-question-body { max-width: 760px; padding: 20px 24px; border: 1px solid var(--ds-ink); border-radius: 3px; }
.open-question-body p { margin: 0 0 10px; font: 500 clamp(22px, 2.4vw, 28px)/1.3 var(--gw-display); }
.open-question-body a { font-size: 14px; color: var(--ds-accent); text-decoration: none; }
.open-question-body a:hover { text-decoration: underline; text-underline-offset: 3px; }
.groundwork .ground-method { margin: 28px 0 0 108px; max-width: 620px; font-size: 13px; line-height: 1.6; color: var(--ds-muted); }

/* The field trial: three systems, five readings, two sourced figures. */
.site-system.ground-page { --fst-cnv: #85877b; --fst-leg: #5d7d45; --fst-mnr: var(--ds-accent); }
.groundwork .fst-intro { max-width: 760px; margin: 0 0 28px; font-size: 19px; line-height: 1.6; color: var(--ds-text); }
.fst-systems { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; margin: 0; padding: 0; }
.fst-system { padding: 18px 0 0; border-top: 1px solid var(--ds-ink); }
.groundwork .fst-system-name { display: flex; gap: 10px; align-items: center; margin: 0 0 4px; font: 600 22px/1.2 var(--gw-display); color: var(--ds-ink); }
.fst-swatch { flex: none; width: 12px; height: 12px; border-radius: 50%; }
.fst-swatch.is-cnv, .fst-bar.is-cnv, .fst-band.is-cnv { background: var(--fst-cnv); }
.fst-swatch.is-leg, .fst-bar.is-leg, .fst-band.is-leg { background: var(--fst-leg); }
.fst-swatch.is-mnr, .fst-bar.is-mnr, .fst-band.is-mnr { background: var(--fst-mnr); }
.groundwork .fst-system-model { margin: 0 0 14px; font-size: 14px; font-style: italic; color: var(--ds-muted); }
.fst-system dl { display: grid; gap: 10px; margin: 0; }
.fst-system dt { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ds-muted); }
.fst-system dd { margin: 2px 0 0; font-size: 15px; line-height: 1.5; color: var(--ds-text); }
.groundwork .fst-plot { display: grid; grid-template-columns: 1fr 1fr; margin: 16px 0 0; border: 1px solid var(--ds-line); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ds-ink); }
.fst-plot span { padding: 9px 10px; }
.fst-plot span:first-child { border-right: 1px solid var(--ds-line); background: repeating-linear-gradient(90deg, #e9e6dc 0 1px, transparent 1px 7px); }
.fst-plot span:last-child { background: var(--ds-paper); }
.groundwork .fst-tillage { margin: 14px 0 44px; font-size: 14px; color: var(--ds-muted); }
.groundwork .fst-subhead { margin: 0 0 16px; font-size: clamp(24px, 2.6vw, 30px); line-height: 1.2; }
.fst-reading { scroll-margin-top: calc(var(--nav-h, 84px) + 20px); }
.fst-reading .step-body { padding-bottom: 46px; }
.fst-reading:last-child .step-body { padding-bottom: 8px; }
.fst-figure { margin: 4px 0 20px; padding: 18px 20px 16px; border: 1px solid var(--ds-line); border-radius: 3px; }
.fst-figure-title { margin: 0 0 14px; font: 600 17px/1.3 var(--gw-display); color: var(--ds-ink); }
.fst-figure-title span { margin-left: 6px; font: 400 12px/1.3 var(--gw-body); letter-spacing: .04em; color: var(--ds-muted); }
.fst-bar-group + .fst-bar-group { margin-top: 16px; }
.groundwork .fst-group-label { margin: 0 0 8px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ds-muted); }
.fst-bars { list-style: none; display: grid; gap: 9px; margin: 0; padding: 0; }
.fst-bars li { display: grid; grid-template-columns: 168px minmax(0, 1fr) 176px; gap: 14px; align-items: center; font-size: 13.5px; line-height: 1.35; color: var(--ds-ink); }
.fst-track { position: relative; height: 14px; overflow: hidden; border-radius: 2px; background: var(--ds-paper); }
.fst-bar, .fst-band { position: absolute; top: 0; bottom: 0; left: 0; }
.fst-band { opacity: .32; }
.fst-value { font-variant-numeric: lining-nums tabular-nums; }
.fst-diff { margin-left: 8px; font-size: 12.5px; color: var(--ds-accent); }
.groundwork .fst-axis { display: flex; justify-content: space-between; margin: 6px 0 0; padding: 0 190px 0 182px; font-size: 11px; color: var(--ds-muted); }
.groundwork .fst-figure-note { margin: 14px 0 4px; font-size: 13px; line-height: 1.55; color: var(--ds-muted); }
.groundwork .fst-figure-source { margin: 0; font-size: 12px; line-height: 1.5; color: var(--ds-muted); }

/* Connecting the dots: each pattern names the readings it draws on and the idea it meets. */
.fst-dots { list-style: none; margin: 0 0 40px; padding: 0; }
.fst-dot { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 14px 48px; padding: 28px 0; border-top: 1px solid var(--ds-line); }
.fst-dot:first-child { border-top-color: var(--ds-ink); }
.fst-dot-head { display: flex; gap: 16px; align-items: baseline; }
.fst-dot-num { flex: none; font-size: 11px; letter-spacing: .1em; color: var(--ds-accent); }
.fst-dot h3 { margin: 0; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; }
.groundwork .fst-dot-body > p { margin: 0 0 18px; font-size: 16px; line-height: 1.7; color: var(--ds-text); }
.fst-link { display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); gap: 0 12px; align-items: end; }
.groundwork .fst-end { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; font-size: 13px; }
.fst-end > span { width: 100%; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ds-muted); }
.fst-end a { padding: 4px 10px; border: 1px solid var(--ds-line); border-radius: 999px; text-decoration: none; }
.fst-end:last-child a { border-color: var(--ds-accent); color: var(--ds-accent); }
.fst-end a:hover { border-color: var(--ds-accent); color: var(--ds-accent); }
.fst-wire { position: relative; height: 1px; margin-bottom: 15px; background: var(--ds-accent); }
.fst-wire::before, .fst-wire::after { content: ""; position: absolute; top: -4px; width: 9px; height: 9px; border: 1px solid var(--ds-accent); border-radius: 50%; }
.fst-wire::before { left: -4px; background: var(--ds-accent); }
.fst-wire::after { right: -4px; background: #fff; }
.groundwork .fst-next .open-question-body .fst-next-caution { margin: 0 0 12px; font: 400 14.5px/1.6 var(--gw-body); color: var(--ds-muted); }
.groundwork .pub, .ground-open-question { scroll-margin-top: calc(var(--nav-h, 84px) + 20px); }

/* The journey: three chapters side by side. */
.journey-grid { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; margin: 0; padding: 0; }
.journey-chapter { padding: 22px 0 8px; border-top: 1px solid var(--ds-ink); scroll-margin-top: calc(var(--nav-h, 84px) + 20px); }
.journey-chapter .ground-kicker { margin-bottom: 18px; }
.groundwork .chapter-word { margin: 0 0 2px; font: 400 clamp(30px, 3vw, 38px)/1.1 var(--gw-display); color: var(--ds-accent); }
.journey-chapter h3 { margin: 0 0 8px; font-size: 24px; line-height: 1.2; }
.groundwork .chapter-place { margin: 0 0 16px; font-size: 13px; color: var(--ds-muted); }
.groundwork .chapter-question { margin: 0 0 12px; font: 500 19px/1.4 var(--gw-display); color: var(--ds-ink); }
.groundwork .chapter-body { font-size: 15px; line-height: 1.65; color: var(--ds-text); }
.chapter-carry { margin: 0 0 16px; padding: 14px 18px; border-left: 2px solid var(--ds-accent); background: var(--ds-paper); }
.chapter-carry span { display: block; margin-bottom: 4px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ds-accent); }
.chapter-carry p { margin: 0; font-size: 14.5px; line-height: 1.55; }
.groundwork .chapter-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.chapter-tags span { padding: 3px 9px; border: 1px solid var(--ds-line); border-radius: 999px; font-size: 12px; color: var(--ds-muted); }

/* Other work: the papers around the thread. */
.pub-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; margin: 0; padding: 0; }
.groundwork .pub { padding: 22px 0 24px; border: 0; border-top: 1px solid var(--ds-line); border-radius: 0; background: none; box-shadow: none; }
.groundwork .pub .ground-kicker { margin-bottom: 10px; }
.groundwork .pub h3 { margin: 0 0 10px; font-size: 22px; line-height: 1.25; }
.pub h3 a { text-decoration: none; }
.pub h3 a:hover { color: var(--ds-accent); }
.pub h3 a span { margin-left: 4px; font-size: 16px; color: var(--ds-muted); }
.groundwork .pub p:last-child { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ds-text); }

/* Closing invitation. */
.ground-connect { padding: 40px 0 0; border-top: 1px solid var(--ds-line); }
.ground-connect h2 { margin: 0 0 12px; font-size: clamp(28px, 3vw, 36px); }
.ground-connect p:not(.ground-kicker) { max-width: 560px; font-size: 16px; color: var(--ds-text); }
.ground-connect > div { display: flex; flex-wrap: wrap; gap: 12px 26px; }
.ground-connect > div a { font-size: 14px; color: var(--ds-accent); text-decoration: none; }
.ground-connect > div a:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 1000px) {
  .groundwork { width: calc(100% - 64px); }
  .ground-hero-grid { grid-template-columns: 1fr; gap: 22px; align-items: start; }
  .ground-section-heading { grid-template-columns: 1fr; }
  .ground-section-heading > p:not(.ground-kicker) { justify-self: start; }
  .thread-index .thread-name { font-size: 16px; }
  .journey-grid { grid-template-columns: 1fr; gap: 0; }
  .journey-chapter { padding: 24px 0 10px; }
  .groundwork .ground-method { margin-left: 0; }
  .fst-systems { gap: 0 20px; }
  .fst-dot { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .groundwork { width: calc(100% - 40px); }
  .ground-hero { padding: 34px 0 28px; }
  .ground-hero h1 { font-size: clamp(44px, 13vw, 62px); }
  .groundwork .ground-deck { font-size: 23px; }
  .groundwork .ground-intro { font-size: 17px; }
  .ground-facts { gap: 12px 22px; }
  .ground-facts dd { font-size: 20px; }
  .ground-hero-links { gap: 8px 20px; }
  .ground-section { padding: 30px 0 40px; }
  .thread-index { grid-template-columns: 1fr; border-bottom: 0; }
  .thread-index a, .thread-index li:first-child a { flex-direction: row; align-items: baseline; gap: 12px; padding: 10px 0; border-left: 0; border-bottom: 1px solid var(--ds-line); }
  .thread-index .thread-name { flex: 1; font-size: 17px; }
  .thread-index a[aria-current="true"] { box-shadow: none; }
  .thread-step { grid-template-columns: 1fr; }
  .thread-step::before { display: none; }
  .step-rail { margin-bottom: 12px; }
  .step-num { width: 36px; height: 36px; font-size: 14px; }
  .step-body { padding-bottom: 26px; }
  .step-body h3 { font-size: 26px; }
  .groundwork .step-answer { font-size: 16px; }
  .step-citation { padding: 16px 18px; }
  .thread-bridge { grid-column: 1; padding-bottom: 26px; }
  .thread-bridge p { font-size: 19px; }
  .ground-open-question { grid-template-columns: 1fr; gap: 10px; }
  .ground-open-question > .ground-kicker { padding-top: 0; }
  .pub-list { grid-template-columns: 1fr; }
  .groundwork .pub h3 { font-size: 20px; }
  .groundwork .fst-intro { font-size: 17px; }
  .fst-systems { grid-template-columns: 1fr; gap: 22px; }
  .fst-figure { padding: 16px 14px 14px; }
  .fst-bars li { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .fst-bars .fst-track { grid-column: 1 / -1; grid-row: 2; }
  .fst-value { text-align: right; }
  .groundwork .fst-axis { padding: 0; }
  .fst-link { grid-template-columns: 1fr; gap: 0; }
  .fst-wire { width: 1px; height: 26px; margin: 10px 0 10px 14px; }
  .fst-wire::before, .fst-wire::after { left: -4px; right: auto; }
  .fst-wire::before { top: -4px; }
  .fst-wire::after { top: auto; bottom: -4px; }
}
@media (prefers-reduced-motion: reduce) {
  .groundwork *, .groundwork *::before, .groundwork *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .groundwork { width: 100%; }
  .thread-step, .journey-chapter, .pub, .fst-figure, .fst-dot { break-inside: avoid; }
  .ground-hero-links, .thread-index { display: none; }
}
