/* Inner pages of the marketing site: product, case studies, blog, pricing.
   They share the navigation, the product screens, the closing and the footer of the home page (home.css);
   this file adds the page header, the chapters and the reading column. */
.page-head { position: relative; overflow: hidden; padding: clamp(7.5rem, 14vw, 11rem) 0 clamp(3rem, 7vw, 6rem); }
.page-head > .wrap { position: relative; }
.page-title { display: grid; gap: clamp(1.1rem, 2vw, 1.75rem); justify-items: start; }
.page-title h1 { font-family: var(--display); font-weight: 700; font-size: clamp(2.6rem, 1.3rem + 5.6vw, 6.5rem); line-height: 0.96; letter-spacing: -0.04em; max-width: 17ch; }

.reading .page-title h1 { font-size: clamp(2.2rem, 1.3rem + 3.6vw, 4.5rem); max-width: 22ch; line-height: 1.02; }
.page-lead { font-size: var(--text-lg); line-height: 1.5; color: var(--on-night); max-width: 58ch; }
.crumbs { font-size: var(--text-sm); font-weight: 500; color: #aab3c8; }
.crumbs a { color: inherit; text-underline-offset: 4px; }
.nav-links a[aria-current]::after { transform: scaleX(1); }

/* Chapter index of the product page: follows the reader under the navigation. */
.chapters { position: sticky; top: 3.7rem; z-index: 20; background: var(--ivory); border-bottom: 1px solid var(--line); }
.chapters .wrap { display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.chapters .wrap::-webkit-scrollbar { display: none; }
.chapters a { display: inline-flex; align-items: baseline; gap: 0.45rem; padding: 0.5rem 0.8rem; border-radius: 99px; font-size: var(--text-sm); text-decoration: none; white-space: nowrap; color: var(--ink-2); transition: background 0.3s var(--ease), color 0.3s var(--ease); }
.chapters a span { font-weight: 700; font-size: 0.8rem; color: var(--blue); }
.chapters a:hover { color: var(--ink); }
.chapters a.on { background: var(--forest-2); color: var(--ivory); }
.chapters a.on span { color: var(--lime); }

main > .chapter { padding: clamp(3.5rem, 8vw, 7.5rem) 0; scroll-margin-top: 6rem; }
main > .chapter:nth-of-type(even) { background: var(--paper); }
.split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.split > * { min-width: 0; }
.chapter-head { display: grid; gap: 1rem; position: sticky; top: 8rem; }
.chapter-head h2 { font-family: var(--display); font-weight: 700; font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.4rem); line-height: 1.02; letter-spacing: -0.03em; }

.chapter-screen { margin-top: 1.25rem; padding: clamp(1rem, 2.5vw, 2rem); border-radius: 24px; background: var(--forest-2); }

.prose { max-width: 66ch; font-size: var(--text-base); }
.prose > * + * { margin-top: 1.1rem; }
.prose p, .prose li { color: var(--ink-2); line-height: 1.75; }
.prose h2 { font-family: var(--display); font-weight: 700; font-size: var(--text-2xl); line-height: 1.1; letter-spacing: -0.03em; margin-top: 3.25rem; color: var(--ink); }
.prose h3 { font-weight: 650; font-size: var(--text-lg); margin-top: 2rem; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.2rem; display: grid; gap: 0.5rem; }
.prose a { color: var(--ink); text-decoration-color: var(--forest); text-underline-offset: 4px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose code { font-family: var(--mono); font-size: 0.86em; background: var(--ivory-2); padding: 0.1em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }
.prose pre { font-family: var(--mono); font-size: 0.82rem; line-height: 1.6; background: var(--forest-2); color: var(--ivory); padding: 1.1rem 1.25rem; border-radius: 14px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose blockquote { margin: 2rem 0 0; padding: 0; font-family: var(--display); font-weight: 600; font-size: var(--text-xl); line-height: 1.3; color: var(--ink); }
.scroll { overflow-x: auto; }
.prose table, .grid-table { width: 100%; min-width: 30rem; border-collapse: collapse; font-size: var(--text-sm); }
.prose th, .prose td, .grid-table th, .grid-table td { text-align: left; padding: 0.75rem 0.9rem 0.75rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th, .grid-table th { font-size: 0.78rem; color: var(--ink-2); font-weight: 500; }
.grid-table td:first-child { color: var(--ink); font-weight: 550; white-space: nowrap; }
.grid-table td { color: var(--ink-2); }
.mono { font-family: var(--mono); font-size: 0.88em; }
.note { margin-top: 1.5rem; padding: 1.1rem 1.25rem; border-radius: 14px; background: var(--ivory-2); font-size: var(--text-sm); color: var(--ink-2); line-height: 1.65; max-width: 78ch; }
.note a { color: var(--ink); }
.meta { font-size: var(--text-sm); font-weight: 500; color: var(--ink-2); }
.source { margin-top: 1rem; }

/* Case studies. */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: clamp(1.25rem, 3vw, 2.5rem); margin: clamp(2.5rem, 6vw, 5rem) 0 0; padding-top: clamp(1.5rem, 3vw, 2.5rem); border-top: 1px solid var(--forest-line); }
.facts div { display: grid; gap: 0.5rem; align-content: start; }
.facts dt { font-family: var(--display); font-weight: 700; font-size: clamp(2.3rem, 1.5rem + 3vw, 4rem); line-height: 0.95; letter-spacing: -0.04em; color: var(--lime); }
.facts dd { margin: 0; font-size: var(--text-sm); line-height: 1.5; color: var(--on-night); max-width: 26ch; }
.case-sum { color: var(--ink-2); font-size: var(--text-sm); line-height: 1.6; max-width: 52ch; }
.case.big .case-sum { color: var(--on-night); }
.case-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(0.75rem, 1.5vw, 1.25rem); margin-top: clamp(0.75rem, 1.5vw, 1.25rem); }
.next { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem 2rem; align-items: end; margin-top: clamp(2.5rem, 5vw, 4rem); padding: clamp(1.4rem, 3vw, 2.5rem); border-radius: 24px; background: var(--forest-2); color: var(--ivory); text-decoration: none; transition: background 0.4s var(--ease); }
.next:hover, .next:focus-visible { background: var(--forest); }
.next .eyebrow { grid-column: 1 / -1; color: #aab3c8; }
.next-title { font-family: var(--display); font-weight: 700; font-size: var(--text-2xl); line-height: 1.08; letter-spacing: -0.03em; max-width: 24ch; }
.next .case-figure { color: var(--lime); }

/* Blog. */
.feature { display: grid; gap: 1.1rem; justify-items: start; padding: clamp(1.5rem, 4vw, 3.5rem); margin-bottom: clamp(2rem, 4vw, 3.5rem); border-radius: 28px; background: var(--forest-2); color: var(--ivory); text-decoration: none; transition: background 0.4s var(--ease); }
.feature:hover, .feature:focus-visible { background: var(--forest); }
.feature .eyebrow { color: var(--lime); }
.feature h2 { font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 1.2rem + 3.2vw, 3.9rem); line-height: 1.02; letter-spacing: -0.04em; max-width: 18ch; }
.feature p:not(.eyebrow) { color: var(--on-night); font-size: var(--text-lg); line-height: 1.5; max-width: 56ch; }
.feature .more { font-weight: 600; text-decoration: underline; text-underline-offset: 5px; }
main > .article { padding: clamp(3rem, 7vw, 6rem) 0; background: var(--paper); }
.article .prose { margin: 0 auto; font-size: var(--text-lg); }
.article .prose > p:first-child { font-size: var(--text-xl); line-height: 1.45; color: var(--ink); font-weight: 500; }
.journal .lead-in { margin-bottom: 1.25rem; }
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 40; }
.progress i { display: block; height: 100%; background: var(--lime); transform-origin: left; transform: scaleX(0); }

@media (max-width: 960px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .chapter-head { position: static; }
  .case-row { grid-template-columns: minmax(0, 1fr); }
  .next { grid-template-columns: minmax(0, 1fr); }
}
/* Tables never push the page wider than the screen: they scroll inside their own box. */
.prose > table { display: block; overflow-x: auto; min-width: 0; max-width: 100%; }
.prose > pre { max-width: 100%; }
.chapter-head > *, .chapter-screen > * { min-width: 0; }

.page-head.on-dark .eyebrow, .feature .eyebrow { color: var(--sun); }
.case .case-sum { font-weight: 400; }
.next .eyebrow { color: #aab3c8; }
.chapter-screen { background: var(--sand); }
main > .chapter:nth-of-type(even) .chapter-screen { background: #e4ebff; }
.journal .feature + .posts .eyebrow, .journal .posts .eyebrow { color: var(--blue); }

/* ---------- case studies as results: numbered blocks, before and after, figures ---------- */
.head-cta { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: clamp(1.5rem, 3vw, 2.5rem); }
.result-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(1.75rem, 5vw, 5rem); align-items: start; }
.result-grid > * { min-width: 0; }
.result-text { display: grid; gap: 1.1rem; justify-items: start; }
.result-n { font-family: var(--display); font-weight: 700; font-size: var(--text-lg); letter-spacing: -0.02em; display: inline-flex; align-items: center; gap: 0.6rem; }
.result-n::before { content: ''; width: 2.2rem; height: 0.55rem; border-radius: 99px; background: var(--sun); }
.result h2 { font-family: var(--display); font-weight: 700; font-size: clamp(1.8rem, 1.2rem + 2.4vw, 3.2rem); line-height: 1.04; letter-spacing: -0.035em; max-width: 20ch; }
.ba { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; width: 100%; }
.ba > div { display: grid; gap: 0.4rem; align-content: start; padding: 1.1rem 1.2rem; border-radius: 18px; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.ba .ba-after { background: var(--night); color: #fff; box-shadow: none; }
.ba-h { font-weight: 700; font-size: var(--text-sm); color: var(--bad); }
.ba-after .ba-h { color: var(--sun); }
.ba p:not(.ba-h) { font-size: var(--text-sm); line-height: 1.6; color: var(--ink-2); }
.ba-after p:not(.ba-h) { color: var(--on-night); }
.result-q { margin: 0; display: grid; gap: 0.4rem; }
.result-q p { font-family: var(--display); font-weight: 600; font-size: var(--text-xl); line-height: 1.3; letter-spacing: -0.02em; max-width: 34ch; }
.result-q footer { font-size: var(--text-sm); color: var(--ink-2); }
.result-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.result-tags span { padding: 0.3rem 0.8rem; border-radius: 99px; border: 1px solid var(--line); font-size: var(--text-xs); font-weight: 600; }
.result-figures { position: sticky; top: 8rem; display: grid; gap: clamp(1.25rem, 3vw, 2rem); padding: clamp(1.4rem, 3vw, 2.5rem); border-radius: 28px; background: var(--sand); }
.result.first .result-figures { background: var(--blue); color: #fff; }
.result-big { font-family: var(--display); font-weight: 700; font-size: clamp(3rem, 1.6rem + 5.5vw, 6.5rem); line-height: 0.92; letter-spacing: -0.05em; }
.result.first .result-big { color: var(--sun); }
.result-figures dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1.25rem; }
.result-figures dt { font-family: var(--display); font-weight: 700; font-size: var(--text-2xl); letter-spacing: -0.03em; line-height: 1; }
.result-figures dd { margin: 0.3rem 0 0; font-size: var(--text-sm); line-height: 1.45; color: var(--ink-2); }
.result.first .result-figures dd { color: #dbe3ff; }
main > .result:nth-of-type(even) .result-figures { background: var(--card); box-shadow: 0 0 0 1px var(--line); }
@media (max-width: 960px) {
  .result-grid { grid-template-columns: minmax(0, 1fr); }
  .result-figures { position: static; }
}
@media (max-width: 560px) { .ba, .result-figures dl { grid-template-columns: minmax(0, 1fr); } }
