/* Reading layout rebuilt from measured tokens (study 168, data/01 to 07). Values are read from computed styles; comments name the token. */

/* ---------- fonts ---------- */
html.f-sub{--sans:var(--sub-sans,"Inter"),sans-serif;--serif:"Source Serif 4",serif;--mono:"JetBrains Mono",monospace}

/* ---------- tokens ---------- */
:root{
  /* fluid scale: size = clamp(base, base + (desk - base) * (100vw - 390px) / (1920px - 390px), desk) */
  --rs-min:390px; --rs-max:1920px;
  --f:clamp(0, (100vw - var(--rs-min)) / (var(--rs-max) - var(--rs-min)), 1);
  /* grid: 4 columns, margin 32 below 768; 12 columns, margin 48 from 768; margin 80 from 1280 */
  --cols:4; --gutter:16px; --margin:32px; --reading-max:720px; --max:1920px;
  --header:84px; --page-top:48px; --spacer-sm:48px; --spacer-lg:64px;
  /* ivory theme (body) */
  --fg-1:#141413; --fg-2:#30302e; --fg-3:#5e5d59; --fg-4:#87867f;
  --bg-1:#faf9f5; --bg-2:#f5f4ed; --border-1:#c2c0b6; --border-2:#dedcd1;
  --btn-1-bg:#141413; --btn-1-fg:#faf9f5; --btn-1-hover:#3d3d3a; --btn-3-bg:#f5f4ed; --btn-3-fg:#3d3d3a; --btn-3-border:#e8e6dc;
  --ease-out-quart:cubic-bezier(.165,.84,.44,1);
}
@media (min-width:768px){:root{--cols:12;--margin:48px;--page-top:64px}}
@media (min-width:1024px){:root{--spacer-lg:96px}}
@media (min-width:1280px){:root{--margin:80px;--page-top:80px}}
/* ivory-medium theme (cover section) */
.theme-cover{--fg-2:#3d3d3a;--bg-1:#f0eee6;--bg-2:#e8e6dc;--border-1:#d1cfc5;--border-2:#d1cfc5;--btn-3-border:#d1cfc5}

/* ---------- type styles (base / desktop px, line-height) ---------- */
.t-headline-3{font-family:var(--sans);font-weight:700;font-variation-settings:"opsz" 48;font-size:calc(32px + 29px * var(--f));line-height:116%}
@media (min-width:768px){.t-headline-3{line-height:114%}}
@media (min-width:1280px){.t-headline-3{line-height:108%}}
.t-headline-4{font-family:var(--sans);font-weight:700;font-variation-settings:"opsz" 16;font-size:calc(22px + 6px * var(--f));line-height:125%}
@media (min-width:1280px){.t-headline-4{line-height:120%;font-variation-settings:"opsz" 48}}
.t-headline-5{font-family:var(--sans);font-weight:700;font-variation-settings:"opsz" 16;font-size:calc(20px + 2px * var(--f));line-height:125%}
.t-headline-6{font-family:var(--sans);font-weight:700;font-variation-settings:"opsz" 16;font-size:calc(15px + 2px * var(--f));line-height:130%}
.t-body-1-serif{font-family:var(--serif);font-size:calc(20px + 2px * var(--f));line-height:145%}
.t-body-3-serif{font-family:var(--serif);font-size:calc(16px + 1px * var(--f));line-height:153%}
.t-caption{font-family:var(--sans);font-size:13px;line-height:154%;letter-spacing:.01em}
.t-caption-mono{font-family:var(--mono);font-size:13px;line-height:154%;letter-spacing:.01em;text-transform:uppercase}
[class*="t-"]{font-feature-settings:"pnum" on,"lnum" on,"liga" on}

/* ---------- base ---------- */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{background:var(--bg-1)}
body{font-family:var(--sans);font-size:calc(16px + 1px * var(--f));line-height:153%;color:var(--fg-1);background:var(--bg-1);
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-synthesis:none}
::selection{color:#141413;background:rgba(94,93,89,.25)}
img{display:block;max-inline-size:100%}
ol,ul{list-style:none}
:where(a){color:inherit;text-decoration:inherit}

/* ---------- layout ---------- */
.site-header{position:sticky;top:0;z-index:50;height:var(--header);background:#f0eee6}
.wrap{width:100%;max-width:var(--max);margin-inline:auto;padding-inline:var(--margin)}
.grid{display:grid;grid-template-columns:repeat(var(--cols),1fr);column-gap:var(--gutter)}
.col{grid-column:1/span 4;width:100%;max-width:var(--reading-max);justify-self:center}
@media (min-width:768px){.col{grid-column:3/span 8}}
@media (min-width:1280px){.col{grid-column:4/span 6}}

/* cover section */
.cover{background:var(--bg-1);padding-top:var(--page-top);padding-bottom:var(--spacer-sm)}
.hero{display:flex;flex-direction:column;align-items:center;gap:24px}
.hero .picture{width:45vw;max-width:168px;height:auto}
.hero h1{text-align:center;text-wrap:balance;max-width:var(--reading-max)}
.hero .summary{text-align:center;text-wrap:balance;max-width:var(--reading-max)}
.intro{margin-top:var(--spacer-lg)}

/* reading text */
.post-text{color:var(--fg-1)}
.post-text + .post-text{margin-top:24px}
.post-heading,.post-section,.post-subsection{margin-top:48px;margin-bottom:24px;text-wrap:pretty;scroll-margin-top:calc(160px - var(--header))}
.post-heading + .post-section{margin-top:0}
.post-heading + .post-subsection,.post-section + .post-subsection{margin-top:24px}
.col > :first-child{margin-top:0}
.post-text a{text-decoration:underline;text-decoration-thickness:.08em;text-underline-offset:.18em;transition:color .2s ease-out}
ol.post-text{display:flex;flex-direction:column;gap:24px;padding-left:1.5em;list-style:decimal outside}
ul.post-text{display:flex;flex-direction:column;gap:24px;padding-left:1.5em;list-style:disc outside}
.post-text strong{font-weight:600}
.footnote{font-family:var(--sans);font-size:13px;line-height:154%;letter-spacing:.01em;color:var(--fg-3);margin-block:16px}
/* the live page also sets max-width:600px on the footnote, but a later reading-column rule overrides it to the column width */

/* summary row (collapsed accordion inside the cover) */
.summary-row{display:flex;justify-content:space-between;align-items:center;padding:20px 0;border-top:1px solid #d1cfc5;cursor:pointer}

/* body section with the contents column */
.body{background:var(--bg-1);padding-top:48px;position:relative}
@media (min-width:1024px){.body{padding-top:96px}}
.toc-layer{display:none}
@media (min-width:1440px){
  .toc-layer{display:block;position:absolute;top:96px;left:0;right:0;bottom:0;padding:0 var(--margin);pointer-events:none}
  .toc-layer > .toc-sticky{position:sticky;top:calc(var(--header) + 32px);width:200px;pointer-events:auto}
}
.toc-list li{border-top:1px solid var(--border-2)}
.toc-list a{display:flex;align-items:flex-start;gap:16px;padding:12px 0;text-decoration:none;color:var(--fg-1);transition:background-color .2s ease-out}
.toc-list a > *{transition:color .2s ease-out}
.toc-list .n{color:var(--fg-3);flex-shrink:0}
.toc-list:has(a:hover) a:not(:hover) .n,.toc-list:has(a:hover) a:not(:hover) .tx{color:var(--fg-4)}
.toc-list a:hover{background:var(--bg-2)}
.toc-downloads{display:flex;flex-direction:column;gap:8px;padding:16px 0;border-top:1px solid var(--border-2)}
.btn{display:inline-flex;align-items:center;gap:4px;height:28px;padding:8px 12px 8px 16px;border-radius:8px;border:1px solid;font-family:var(--sans);font-size:13px;line-height:154%;letter-spacing:.01em;text-decoration:none;max-width:80%}
.btn-1{background:var(--btn-1-bg);color:var(--btn-1-fg);border-color:var(--btn-1-bg)}
.btn-1:hover{background:var(--btn-1-hover);border-color:var(--btn-1-hover)}
.btn-3{background:var(--btn-3-bg);color:var(--btn-3-fg);border-color:var(--btn-3-border)}

/* ===== additions for the full copy (study 168, data/21, 22) ===== */
.post-section{scroll-margin-top:calc(160px - var(--header))}
.t-headline-5{font-family:var(--sans);font-weight:700;font-variation-settings:"opsz" 16;font-size:calc(20px + 2px * var(--f));line-height:125%}
/* empty paragraphs keep their 24 px top margin, as on the live page (acknowledgements) */
p.post-text:empty{height:0}
/* nested lists */
.post-text li > ul,.post-text li > ol{display:flex;flex-direction:column;gap:24px;padding-left:1.5em;margin-top:12px}
.post-text ul ul{list-style:circle outside}
/* summary panel (inside the cover, CSS checkbox) */
.summary-block input{position:absolute;opacity:0;pointer-events:none}
.summary-row{border-top:1px solid #d1cfc5}
.summary-row .plus{position:relative;width:24px;height:24px;flex-shrink:0}
.summary-row .plus::before,.summary-row .plus::after{content:"";position:absolute;left:5.25px;top:11.375px;width:13.5px;height:1.25px;background:var(--fg-1)}
.summary-row .plus::after{transform:rotate(90deg);transition:transform .25s var(--ease-out-quart),opacity .25s var(--ease-out-quart)}
.summary-block input:checked + .summary-row .plus::after{transform:rotate(180deg);opacity:0}
.summary-panel{max-height:0;opacity:0;overflow:hidden;transition:max-height .5s var(--ease-out-quart) .1s,opacity .3s var(--ease-out-quart) .1s}
.summary-block input:checked ~ .summary-panel{max-height:10000px;opacity:1;transition:max-height 1s cubic-bezier(1,0,0,1),opacity .4s cubic-bezier(1,0,0,1)}
.summary-panel .col > .post-text:first-child{margin-top:0}
/* Read more cards (media column + expandable section) */
.media-col{grid-column:1/span 4;width:100%;max-width:var(--reading-max);justify-self:center;margin-block:48px}
@media (min-width:768px){.media-col{grid-column:3/span 8}}
@media (min-width:1280px){.media-col{grid-column:4/span 6;margin-block:64px}}
.media-col:has(+ .post-heading),.media-col:has(+ .post-section),.media-col:has(+ .post-subsection){margin-bottom:0}
.post-heading + .media-col,.post-section + .media-col,.post-subsection + .media-col{margin-top:0}
.card{background:#e8e6dc;border-radius:12px;padding:16px}
.card-header{display:flex;flex-direction:column;gap:12px}
.card-summary{font-family:var(--sans);font-size:13px;line-height:154%;letter-spacing:.01em;color:var(--fg-3);font-style:italic;transition:opacity .3s var(--ease-out-quart)}
.card.expanded .card-summary{opacity:0;height:0;overflow:hidden}
.card-content{display:grid;grid-template-rows:0fr;overflow:hidden;transition:grid-template-rows .5s var(--ease-out-quart)}
.card.expanded .card-content{grid-template-rows:1fr}
.card-body{min-height:0;opacity:0;overflow:hidden;transform:translateY(10px);transition:opacity .3s var(--ease-out-quart),transform .3s var(--ease-out-quart)}
.card.expanded .card-body{opacity:1;padding-top:24px;padding-bottom:16px;transform:none}
.card-body > h2,.card-body > h3,.card-body > h4{font-family:var(--sans);font-weight:600;font-size:calc(18px + 2px * var(--f));line-height:150%;text-wrap:pretty;margin-top:2rem;margin-bottom:.75rem}
@media (min-width:480px){.card-body > h2,.card-body > h3,.card-body > h4{margin-top:2.5rem}}
.card-body > p,.card-body > ul,.card-body > ol{margin-top:0;margin-bottom:1.25rem;font-family:var(--serif);font-size:calc(16px + 1px * var(--f));line-height:153%}
.card-body > :first-child{margin-top:0}
.card-body > :last-child{margin-bottom:0}
.card-body ul,.card-body ol{padding-left:1.5rem}
.card-body ul li{list-style:disc outside}
.card-body ul ul li{list-style:circle}
.card-body ol li{list-style:decimal}
.card-body li{padding-left:.25ch}
.card-body a{text-decoration:underline;text-decoration-thickness:.08em;text-underline-offset:.18em}
.card-body strong{font-weight:600}
.card-buttons{padding-top:16px;display:flex;justify-content:center}
.card.expanded .card-buttons{padding:32px 16px 24px;margin:0 -16px -16px;background:linear-gradient(180deg,transparent 0%,#e8e6dc 50%);border-radius:0 0 12px 12px;position:sticky;bottom:0}
.card-btn{display:inline-flex;align-items:center;justify-content:center;gap:0;width:100%;height:36px;padding:12px 20px 12px 24px;border-radius:10px;border:1px solid #e8e6dc;background:#f5f4ed;color:#3d3d3a;
  font-family:var(--sans);font-size:calc(16px + 1px * var(--f));cursor:pointer;transition:border-color .2s ease-in-out,box-shadow .2s ease-in-out,background-color .2s ease-in-out,color .2s ease-in-out}
.card-btn:hover{background:#e8e6dc;color:#141413;box-shadow:0 0 0 1px #e8e6dc}
.card-icon{display:flex;width:16px;height:16px;transition:transform .3s var(--ease-out-quart)}
.card.expanded .card-icon{transform:rotate(45deg)}
/* the end section uses the cover theme */
.end-section{background:var(--bg-1);padding-top:var(--page-top);padding-bottom:var(--spacer-sm)}
@media (prefers-reduced-motion:reduce){.card-content,.card-body,.card-icon,.summary-row .plus::after{transition:none}}
.body{padding-bottom:var(--spacer-lg)}
/* every block is its own grid item in the 12-column body grid, as on the live page (margins add, never collapse) */
.flow{display:grid;grid-template-columns:repeat(var(--cols),1fr);column-gap:var(--gutter)}
.flow > *{grid-column:1/span 4;width:100%;max-width:var(--reading-max);justify-self:center}
@media (min-width:768px){.flow > *{grid-column:3/span 8}}
@media (min-width:1280px){.flow > *{grid-column:4/span 6}}
.flow > :first-child{margin-top:0}
.post-section + .post-subsection,.post-heading + .post-subsection{margin-top:24px}
/* chapter bar (below 1440) and its panel; values from agents/motion/REPORT_motion.md */
.chapter-bar{position:sticky;top:var(--header);z-index:30;height:50px;margin-bottom:-50px;visibility:hidden}
.chapter-bar.is-shown{visibility:visible}
@media (min-width:1280px){.chapter-bar .bar-inner{transform:translateY(-100%);transition:transform .3s ease-out,visibility 0s .3s}.chapter-bar.is-shown .bar-inner{transform:none;transition:transform .3s ease-out}}
@media (min-width:1440px){.chapter-bar{display:none}}
.bar-inner{position:relative;background:var(--bg-1);border-bottom:1px solid var(--border-2)}
.bar-trigger{display:flex;width:100%;height:49px;align-items:center;gap:16px;padding:0 var(--margin);background:none;border:0;cursor:pointer;color:var(--fg-1);text-align:left;font:inherit}
.bar-trigger .n{color:var(--fg-3)}
.bar-trigger .tx{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chev{width:20px;height:20px;flex-shrink:0}
@media (prefers-reduced-motion:no-preference){.chev{transition:transform .15s ease-out}.bar-panel{transition:height .5s cubic-bezier(.4,0,.2,1)}}
.chapter-bar.is-open .chev{transform:rotate(180deg)}
.bar-panel{position:absolute;top:100%;left:0;right:0;height:0;overflow:hidden;background:var(--bg-1);box-shadow:0 4px 24px rgba(0,0,0,.05)}
.chapter-bar.is-open .bar-panel{border-bottom:1px solid var(--border-2)}
.bar-panel-inner{max-height:calc(100dvh - var(--header) - 48px - 2px);overflow-y:auto;overscroll-behavior:contain}
.bar-panel .toc-list a{padding:12px var(--margin)}
.bar-panel .toc-list a.is-current .n{color:var(--fg-1)}
.bar-panel .toc-downloads{padding:16px var(--margin)}
@media (min-width:440px){.bar-panel .toc-downloads{display:grid;grid-template-columns:200px 200px}}
.bar-panel .toc-downloads .btn{max-width:none;width:100%}
@media (min-width:1920px){.toc-layer > .toc-sticky{width:280px}}
.toc-layer > .toc-sticky{max-height:calc(100dvh - var(--header) - 64px);overflow-y:auto;overscroll-behavior:contain}
.btn-1:hover{box-shadow:0 0 0 1px #141413}
.btn-3:hover{background:#e8e6dc;color:#141413;box-shadow:0 0 0 1px #e8e6dc}
.btn{transition:border-color .2s ease-in-out,box-shadow .2s ease-in-out,background-color .2s ease-in-out,color .2s ease-in-out}
.btn:focus-visible{outline:2px solid #154c92;outline-offset:4px}
.post-text a:hover{color:var(--fg-4)}
html{scroll-padding-top:var(--header)}
/* section spacers follow the site-wide breakpoints 992 and 1024 (css/: --section-spacer-sm 32/40/48, --section-spacer-lg 64/80/96) */
:root{--spacer-sm:32px;--spacer-lg:64px}
@media (min-width:992px){:root{--spacer-sm:40px;--spacer-lg:80px}}
@media (min-width:1024px){:root{--spacer-sm:48px;--spacer-lg:96px}}
.body{padding-top:var(--spacer-lg)}
@media (min-width:1440px){.toc-layer{top:var(--spacer-lg)}}
.media-col + .media-col{margin-top:0}
.btn svg{width:16px;height:16px;flex-shrink:0}
.chev{display:inline-flex}
.chev svg{display:block}
