/* Bargaon design-system overrides (20 Nov 2026). Only the changes Himanshu approved:
   type floor, heading scale, code overflow, contrast, line length, About page, library hub tiles.
   Loaded last (priority 99). Selectors carry an "html" prefix where they must win over page-level inline styles. */

/* 1. Type tokens: card text 13 -> 15, body 15 -> 16, caps labels 11 -> 12, section H2 48/32 -> 40/30 */
:root{
--text-body-sm:.9375rem;--text-body-sm--line-height:1.5rem;
--text-body-md:1rem;--text-body-md--line-height:1.625rem;
--text-label-caps:.75rem;--text-label-caps--line-height:1rem;--text-label-caps--letter-spacing:.1em;
--text-headline-lg:2.5rem;--text-headline-lg--line-height:2.875rem;
--text-headline-lg-mobile:1.875rem;--text-headline-lg-mobile--line-height:2.25rem;
}

/* 2. One H1 scale on every template except the homepage hero */
html body:not(.home) main h1{font-size:2.375rem;line-height:1.1;font-weight:600;letter-spacing:-.03em}
@media (min-width:1024px){
html body:not(.home) main h1{font-size:3.5rem;line-height:1.07}
html .uk-h2,html .uk-cta__t{font-size:2.5rem;line-height:1.15}
}

/* 3. Small-text floor for component styles (nothing under 12px; figure micro-labels 11px) */
html :is(.btn,.eyebrow){font-size:.75rem;line-height:1.35}
html :is(.field-label,.nav-link,.prose-bargaon th,.blog-chip,.blog-author__eyebrow,.lib-chip,.res-chip,.res-ready__kind,.res-q__dim,.res-score__band,.res-card__btn,.res-related__kind,.res-related__btn,.tool-chip,.tool-card__btn,.tool-field label,.tool-label,.tool-badge,.tool-table th,.tool-formula span,.lib-label,.lib-rail__group,.lib-level,.lib-copy,.lib-related__kind),html :is(.guide-body,.content-body) :is(.stat__source,.callout__title,.answer-box__label,.blog-cta__eyebrow,.related-assets__type,.system-node>span:nth-child(3),figcaption,.gs-funnel-rate span,.gs-funnel figcaption,.guide-stage p,.diagnostic-card p,.guide-study-step span,.guide-study-card p,.guide-study-figure figcaption,.study-figure figcaption){font-size:.75rem}
html :is(.notice,.mega-l3){font-size:.875rem;line-height:1.54}
html :is(.prose-bargaon table,.blog-pagination .page-numbers,.blog-byline,.blog-deeper__text,.res-note,.res-q__help,.res-dim,.res-card__text,.res-related__text,.wp-cover-card__text,.wp-gate__list li,.res-whitepaper .res-body .system-node>span:nth-of-type(1),.tool-card__text,.tool-principles p,.tool-field textarea,.tool-table,.tool-checks dd,.tool-formula,.lib-rail li a,.lib-rail li span,.lib-side li a,.lib-side li span,.lib-card__needs,.lib-tile__text,.lib-term__links,.uk-plan__for,.uk-pnote,.bg-arr,.svc-arr,.proc-out,.cta-next-h),html :is(.guide-body,.content-body) :is(.data-table,.stat__label,.gs-funnel-insight,.diagnostic-card strong,.guide-study-step strong,.guide-study-card strong){font-size:.9375rem}
html :is(.prose-bargaon figcaption,.blog-cover figcaption,.blog-author__role,.res-disclaimer,.res-small,.wp-stat p,.wp-cover-card__list,.wp-toc a,.wp-box ul,.wp-box p,.res-whitepaper .res-body .system-node>span:nth-of-type(2),.res-whitepaper .res-body .system-figure .figure-note,.tool-hint,.tool-kpi__label,.lib-term__example,.uk-sticky__plan,.nav-res__desc,.mega-head,.mega-l3s,.blog-loadmore__btn,.blog-loadmore__prev),html :is(.guide-body,.content-body) :is(.bar-chart__label,.prompt-card pre,.gs-funnel-label,.study-step strong){font-size:.875rem}
html .wp-stat .wp-lbl,html :is(.guide-body,.content-body) :is(.node-num,.system-node small,.research-label,.axis,.gs-funnel .gs-funnel-eyebrow,.gs-funnel-label small,.gs-funnel-scale,.guide-stage-num,.diagnostic-card .diagnostic-signal,.diagnostic-card .diagnostic-hypothesis,.guide-study-step small,.guide-study-card small,.study-figure .figure-eyebrow,.study-step span){font-size:.6875rem}
html :is(.guide-body,.content-body) .guide-table{font-size:.8125rem}
@media (max-width:1023px){
html .wp-cover__title{font-size:.9375rem}
html .wp-cover__bot{font-size:.625rem}
}
@media (max-width:760px){
html :is(.guide-body,.content-body) :is(.feedback,.bar-top){font-size:.75rem}
html :is(.guide-body,.content-body) .gs-funnel-insight{font-size:.875rem}
}

/* 4. Code blocks stay inside the screen (no page-level horizontal scroll) */
html .prose-bargaon pre{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
html .prose-bargaon :not(pre)>code{overflow-wrap:anywhere;word-break:break-word}

/* 5. Contrast (AA) */
html .form-light .field::placeholder{color:#6b6b6b}
html .wp-toc a.is-locked{color:#6b6b6b}
html :is(.lib-rail,.lib-side) .is-soon{color:#6b6b6b}
html .lib-az span{color:#8a8a8a}
html .uk-x{color:#767676}
html .uk-plan__list li.is-off{color:#6b6b6b}
html :is(.content-body,.guide-body) .blog-cta:not(.blog-cta--whitepaper):not(.blog-cta--tool) a:not(.blog-cta__button){color:#fdba74}

/* 6. Line length (about 65-75 characters per line) */
html .prose-bargaon>:is(p,ul,ol,blockquote),html .prose-bargaon details>p{max-width:56ch}
html .lib-term__def{max-width:35rem}
html :is(.lib-term__part,.lib-card__desc,.lib-card__needs,.res-note,.uk-pnote){max-width:33rem}
html main p.text-body-lg{max-width:38rem}
html main p.text-body-md,html main .grid.grid-cols-12>p.col-span-12{max-width:35rem}

/* 7. Prompt text blocks: 13 -> 14 */
html .lib-pre{font-size:.875rem}

/* 8. The homepage hero stays exactly as it was: no type changes inside it */
html .bgh .btn{font-size:.6875rem;line-height:.875rem}
html .bgh .field-label{font-size:.6875rem}

/* ===== Shared helpers ===== */

/* Card number (same look as the homepage numbers) */
.sys-num{font-family:'Space Grotesk',Inter,system-ui,sans-serif;font-weight:600;font-size:1.25rem;line-height:1;letter-spacing:-.01em;color:#ea580c}
.bg-primary .sys-num{color:#f97316}

/* Card rows that never leave a half-empty row: set --cols on the wrapper */
.sys-flex{display:flex;flex-wrap:wrap;gap:1.5rem}
.sys-flex>*{flex:1 1 calc((100% - (var(--cols,3) - 1)*1.5rem)/var(--cols,3));min-width:min(100%,15rem)}

html .btn.sys-btn-ink{background:#0a0a0a;border-color:#0a0a0a;color:#fff}
html .btn.sys-btn-ink:hover{background:#262626;border-color:#262626}

/* About page */
.sys-about{display:grid;grid-template-columns:minmax(0,1fr);gap:2.5rem}
.sys-about__panel{background:#0a0a0a;color:#fff;padding:1.75rem}
.sys-about__label{display:block;margin-bottom:.75rem;color:#a3a3a3;font-family:'JetBrains Mono',ui-monospace,monospace;font-size:.75rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase}
.sys-about__panel a{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.9375rem 0;border-top:1px solid #262626;color:#fff;font-family:'Space Grotesk',Inter,system-ui,sans-serif;font-weight:600;font-size:1.0625rem;line-height:1.3;text-decoration:none;transition:color .2s}
.sys-about__panel a:hover{color:#f97316}
.sys-about__n{display:inline-block;width:2.25rem;color:#f97316}
.sys-lead{display:grid;grid-template-columns:minmax(0,1fr);gap:1.5rem;padding:1.75rem;border:1px solid var(--color-outline-variant,#d4d4d4);background:#fff}
.sys-lead__mark{width:6rem;height:6rem;display:grid;place-items:center;background:#0a0a0a;color:#f97316;font-family:'Space Grotesk',Inter,system-ui,sans-serif;font-weight:600;font-size:2rem;letter-spacing:-.02em}
.sys-lead__role{display:block;margin:.375rem 0 1rem;color:#c2410c;font-family:'JetBrains Mono',ui-monospace,monospace;font-size:.75rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase}
@media (min-width:768px){.sys-lead{grid-template-columns:6rem minmax(0,1fr);gap:2rem;padding:2.5rem}}
@media (min-width:1024px){.sys-about{grid-template-columns:minmax(0,7fr) minmax(0,5fr);gap:4rem;align-items:end}}

/* Library hubs (Glossary, Prompt Library): tiles in the last row stretch, so no empty grey cell is left */
html .lib-grid{display:flex;flex-wrap:wrap}
html .lib-grid>.lib-tile{flex:1 1 calc(33.333% - 1px);min-width:min(100%,16rem)}
