/* Shared readable scale and fluid gutters. No content or section order changes. */
:root {
  --page-gutter: clamp(18px, 4vw, 160px);
  --text-copy: clamp(1rem, .88rem + .2vw, 1.25rem);
  --text-small: clamp(.875rem, .81rem + .1vw, 1rem);
  --container-max: none;
}
.site-container, .discovery .container {
  width: calc(100% - 2 * var(--page-gutter));
  margin-inline: auto;
  padding-inline: 0;
}
.portal-content .site-container { width: 100%; }
.site-container.portal-document { max-width: 56.25rem; }
.xb-nav { padding-inline: var(--page-gutter); height: auto; flex-wrap: wrap; padding-block: 8px; }
.xb-nav__links { flex-wrap: wrap; }
.xb-nav__link, .xb-nav__actions .xb-btn { font-size: var(--text-small); line-height: 1.5; }
.xb-btn, .xb-input { font-size: 1rem; }
.xb-btn {
  white-space: normal; text-align: center; line-height: 1.5; padding-block: .5rem;
  /* Change the foreground/background pair together when the theme changes. */
  transition: border-color 160ms, box-shadow 160ms;
}
.xb-btn--sm { font-size: .875rem; }
.theme-toggle { width: 44px; height: 44px; flex: 0 0 44px; padding: 0; color: var(--ink); }
.theme-toggle svg { flex: none; }
.theme-sun { display: none; }
[data-theme=dark] .theme-moon { display: none; }
[data-theme=dark] .theme-sun { display: block; }
.auth-theme-control { position: absolute; top: 18px; inset-inline-end: 24px; z-index: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) .theme-moon { display: none; }
  :root:not([data-theme=light]) .theme-sun { display: block; }
}
.body, .body-lg, .public-page-heading .body-lg { font-size: var(--text-copy); line-height: 1.8; }
.body-sm, .label, .xb-label, .xb-help, .xb-error, .data-sm { font-size: .875rem; line-height: 1.6; }
.xb-feature__body, .xb-price__list, [data-view=pricing] .xb-price__list { font-size: var(--text-copy); }
.portal-sidebar .portal-nav a, .getting-started-steps a, .first-project { font-size: .875rem; }
.module-example-copy p, .module-dossier ul, .module-next p, .plan-assistant-intro p, .plan-advice p { font-size: var(--text-copy); }
.module-example-copy .module-example-note, .module-example-values, .module-dossier p,
.module-jump, .module-related a, .module-guide-heading>a { font-size: .875rem; }

/* Reading lines stay comfortable while illustrations, tables and grids use the screen. */
.discovery .section-head h2 { max-width: 24ch; }
.discovery .section-head>* { min-width: 0; }
.discovery :is(h1,h2,h3) { overflow-wrap: anywhere; }
.discovery .section-head p { max-width: 48ch; font-size: var(--text-copy); }
.discovery .hero-copy .lead { max-width: 42rem; font-size: var(--text-copy); }
[data-view=home] .hero-copy h1 { font-size: clamp(2.375rem, 1.25rem + 3vw, 5.25rem); }
.discovery h2 { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 3.5rem); }
.discovery .hero-copy .fine, .discovery .hero-copy .codes,
.discovery .hero-footer, #home-motion { font-size: var(--text-small); }
.discovery .hero .xb-btn { font-size: 1rem; }
.discovery .eyebrow, .discovery .tag, .public-eyebrow { font-size: .875rem; }
.discovery .page-title p, .discovery .closing p, .code-grid p { font-size: var(--text-copy); }
.discovery .closing h2 { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 3.5rem); }
.discovery .page-title p, .discovery .closing p { max-width: 48ch; }
.code-grid span, .code-family span, .code-family bdi { font-size: .875rem; }
.studio-top, [dir=rtl] .studio-top>span, .studio-steps bdi, .studio-coordinates { font-size: .75rem; }
.studio-steps button, .studio-controls, .studio-button { font-size: .875rem; }
.studio-steps button, .studio-button { min-height: 44px; }
.studio-steps button { flex-wrap: wrap; }
.studio-steps bdi { opacity: 1; }
.studio-controls { flex-wrap: wrap; }
.hero-studio .studio-button { min-height: 44px; }
.section-inset>span, .focus-label, .studio-disclaimer { font-size: .75rem; }
.result-inset .tag, .result-inset p, .result-inset strong small,
.result-ratio span:last-child { font-size: .75rem; }
.result-inset strong { font-size: 1.125rem; white-space: normal; }
.result-inset>div:first-child { flex-wrap: wrap; }
.result-ratio { flex-wrap: wrap; }
.explorer-tab>span, .drawing-controls button { font-size: .875rem; }
.explorer-tab>span { overflow-wrap: anywhere; }
.explorer-tab>bdi { font-size: .75rem; }
.drawing-controls { flex-wrap: wrap; }
.drawing-controls button { min-height: 44px; }
.explorer-info .explorer-lead, .explorer-facts p { font-size: var(--text-copy); }
.explorer-info h2, .explorer-info h3 { font-size: clamp(1.75rem, 1.1rem + 1.6vw, 3rem); }
.explorer-facts>div>span, .explorer-checks li, .explorer-tags .tag,
.explorer-visual-head, .explorer-visual-foot, .explorer-code-note,
.explorer-code-note>div, .drawing-legend { font-size: .875rem; }
.explorer-visual-head bdi, .drawing-legend bdi { font-size: .75rem; }
.explorer-code-note, .explorer-code-note>div { flex-wrap: wrap; }
.explorer-info .eyebrow { font-size: .875rem; }
.journey-description { font-size: var(--text-copy); }
.journey-step>strong { font-size: 1.125rem; }
.journey-number, .journey-detail p, .journey-detail .mono { font-size: .875rem; }
.journey-detail { flex-wrap: wrap; }
.discovery :is(th, td), .workbench-table td>bdi, .workbench-table button,
.workbench-note, .workbench-note bdi, .workbench-table .tag { font-size: .875rem; }
.workbench-table .panel-head h3 { font-size: 1.125rem; }
.inspection-label, .inspection-label bdi, .inspection-data>.eyebrow,
.inspection-data dt, .inspection-data dd, .inspection-data .tag,
.inspection-data p, .drawing-caption { font-size: .875rem; }
.check-context>span:not(.tag), .check-context>bdi, .check-card-title>bdi,
.check-card dt, .check-card small, .check-card p, .clause-link,
.discovery .check-reference summary, .discovery .check-reference p { font-size: .875rem; }
.check-card-title { flex-wrap: wrap; }
.check-card dd { font-size: clamp(1.125rem, 1rem + .3vw, 1.5rem); }

@media (min-width: 1101px) {
  [data-view=home] .hero-inner { gap: clamp(2.625rem, 4vw, 7rem); min-height: clamp(40rem, 38vw, 60rem); }
  .studio-canvas { height: clamp(23.125rem, 27vw, 48rem); }
  .section-inset, .result-inset { max-width: 18rem; }
  .section-inset .section-graphic { height: clamp(12rem, 13vw, 21rem); }
  .explorer-art { min-height: clamp(20.625rem, 26vw, 40rem); }
  .explorer-art .structural-art { max-height: none; }
  .explorer-art .section-graphic { height: clamp(18.75rem, 25vw, 36rem); }
}
@media (max-width: 1100px) {
  .xb-nav__links, .xb-nav__actions { display: none; }
  .xb-nav__menu { display: block; }
  .xb-nav>.theme-toggle { margin-inline-start: auto; }
  .xb-nav__menu { margin-inline-start: 0; }
  .explorer-facts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 800px) {
  .discovery .hero-copy { max-width: none; }
  .discovery .section-head h2 { max-width: none; }
  .studio-steps button { column-gap: 4px; row-gap: 0; }
}
@media (max-width: 520px) {
  .discovery .hero .actions .xb-btn { flex: 1 1 auto; }
  .discovery .hero-footer { gap: 1rem; }
  .discovery .section-head h2 { font-size: 1.75rem; }
  .engineering-journey { grid-template-columns: minmax(0, 1fr); }
  .journey-diagram { max-height: 13rem; }
  .explorer-info { padding-inline: 0; }
  .studio-canvas { height: 23rem; }
  .result-inset { width: 49%; padding-inline: 4px; }
  .result-inset strong { font-size: 1rem; }
  .studio-steps button { flex-direction: column; }
  .inspection-data { padding-inline: 0; }
  .inspection-data dl { gap: 0 1rem; }
  .check-card dl { flex-wrap: wrap; }
}
