/* Formal homepage only. One type scale and one control system, after legacy styles. */
body.a-page.a-homepage:not(.a-demo-a) {
  --a-type: "Bob Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --home-title: 32px;
  --home-subtitle: 20px;
  --home-body: 16px;
  --home-secondary: 14px;
  --home-caption: 12px;
  --home-caption-ink: #536783;
  --home-normal: 400;
  --home-medium: 500;
  --home-bold: 600;
  --home-control-height: 48px;
  --home-control-radius: 6px;
  --home-surface-radius: 12px;
  font-family: var(--a-type);
  font-weight: var(--home-normal);
}
body.a-page.a-homepage:not(.a-demo-a) :is(h1,h2,h3,h4,p,a,button,summary,span,strong,dt,dd,li,figcaption) {
  font-family: var(--a-type);
  font-style: normal;
}

/* The main statement keeps its original responsive size; all peer headings match. */
body.a-page.a-homepage:not(.a-demo-a) .a-hero h1,
body.a-page.a-homepage:not(.a-demo-a) :is(.a-heading-line,.a-ai-word) {
  font-weight: var(--home-bold);
  letter-spacing: 0;
}
body.a-page.a-homepage:not(.a-demo-a) .a-heading-stop { margin-left: .08em; letter-spacing: 0; }
body.a-page.a-homepage:not(.a-demo-a) main :is(.a-section,.a-reach,.a-case-gallery) h2,
body.a-page.a-homepage:not(.a-demo-a) .preview-dialog h2 {
  font-size: var(--home-title);
  font-weight: var(--home-bold);
  line-height: 1.45;
  letter-spacing: 0;
}
body.a-page.a-homepage:not(.a-demo-a) :is(.a-brand,.a-hero-name > span) {
  font-size: var(--home-title);
  font-weight: var(--home-bold);
  letter-spacing: -.025em;
}
body.a-page.a-homepage:not(.a-demo-a) :is(.a-hero-name,.a-community-wordmark) {
  font-size: var(--home-subtitle);
  font-weight: var(--home-medium);
  letter-spacing: 0;
}
body.a-page.a-homepage:not(.a-demo-a) :is(.a-format-sheet h3,.a-course summary strong,.a-consultation-steps h3,.a-library-heading h3,.a-resource-feature h4,.a-resource-link h4,.a-channel strong,.a-image-dialog-header h2) {
  font-size: var(--home-subtitle);
  font-weight: var(--home-bold);
  line-height: 1.6;
  letter-spacing: 0;
}

/* Reading copy, supporting descriptions and metadata have stable, separate roles. */
body.a-page.a-homepage:not(.a-demo-a) :is(.a-hero-description,.a-section-opening > p,.a-format-list dd,.a-course-content > p,.a-consultation-copy > p,.a-consultation-steps p,.a-bio-copy > p,.a-community-intro > p,.a-reach-copy > p,.a-case-intro) {
  font-size: var(--home-body);
  font-weight: var(--home-normal);
  line-height: 1.9;
  letter-spacing: 0;
}
body.a-page.a-homepage:not(.a-demo-a) :is(.a-format-list dt,.a-bio-background dd,.a-social-name,.a-pending-contact strong,.pending-contact strong) {
  font-size: var(--home-body);
  font-weight: var(--home-medium);
  line-height: 1.8;
  letter-spacing: 0;
}
body.a-page.a-homepage:not(.a-demo-a) :is(.a-hero-credentials,.a-course summary > span:first-child > span,.a-course-content dd,.a-case-facts,.a-resource-feature > p,.a-resource-link-copy > span,.a-channel > span > span,.dialog-intro,.dialog-description) {
  font-size: var(--home-secondary);
  font-weight: var(--home-normal);
  line-height: 1.9;
  letter-spacing: 0;
}
body.a-page.a-homepage:not(.a-demo-a) :is(.a-hero-credentials strong,.dialog-intro strong) {
  font-weight: var(--home-medium);
}
body.a-page.a-homepage:not(.a-demo-a) :is(.a-curriculum-intro h3,.a-lab-controls > p,.a-hero-eyebrow,.a-navigation a,.a-resource-feature-foot) {
  font-size: var(--home-secondary);
  font-weight: var(--home-medium);
  line-height: 1.8;
  letter-spacing: 0;
}
body.a-page.a-homepage:not(.a-demo-a) :is(.a-brand-affiliation strong,.a-brand-affiliation > span > span,.a-hero-eyebrow > span,.a-case-eyebrow,.a-case-eyebrow > span,.a-case-attribution,.a-case-media figcaption,.a-case-media figcaption > span:last-child,.a-topic-link,.a-format-note,.a-curriculum-intro > span,.a-course-content dt,.a-consultation-copy > .a-consultation-note,.a-bio-background dt,.a-community-brand > span,.a-library-heading > span,.a-resource-kicker,.a-resource-number,.a-library-bottom,.a-contact-pending,.a-social-area h3,.a-social-state,.a-social-alias,.a-footer > p,.a-copyright,.dialog-top,.dialog-note,.pending-contact span,.a-image-dialog-header p,.a-image-dialog-footer p) {
  font-size: var(--home-caption);
  font-weight: var(--home-normal);
  line-height: 1.8;
  letter-spacing: 0;
  color: var(--home-caption-ink);
}
body.a-page.a-homepage:not(.a-demo-a) .a-step-index { font-size: var(--home-caption); font-weight: var(--home-medium); }
body.a-page.a-homepage:not(.a-demo-a) :is(.a-footer > p,.a-copyright) { color: var(--home-caption-ink) !important; }
body.a-page.a-homepage:not(.a-demo-a) :is(.a-topic-link,.a-library-all,.a-image-dialog-footer a) {
  min-height: 44px;
  font-weight: var(--home-medium);
  color: var(--a-blue);
}
body.a-page.a-homepage:not(.a-demo-a) .a-library-all { font-size: var(--home-secondary); }
body.a-page.a-homepage:not(.a-demo-a) .a-image-dialog-footer a { font-size: var(--home-caption); }

/* Primary actions and text actions share type, target size and icon proportions. */
body.a-page.a-homepage:not(.a-demo-a) :is(.a-button,.a-header-contact,.a-text-link,.dialog-done,.a-image-dialog button) {
  min-height: var(--home-control-height);
  gap: 12px;
  border-radius: var(--home-control-radius);
  font-size: var(--home-secondary) !important;
  font-weight: var(--home-medium) !important;
  line-height: 1.5;
  letter-spacing: 0;
}
body.a-page.a-homepage:not(.a-demo-a) :is(.a-button,.a-header-contact,.dialog-done) { padding: 12px 18px; }
body.a-page.a-homepage:not(.a-demo-a) .a-text-link { padding: 12px 0; }
body.a-page.a-homepage:not(.a-demo-a) :is(.a-button,.a-header-contact,.a-text-link,.dialog-done) .a-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}
body.a-page.a-homepage:not(.a-demo-a) .a-button-solid:hover { background: #1b38a8; box-shadow: none; }
body.a-page.a-homepage:not(.a-demo-a) .a-channel { border-radius: var(--home-surface-radius); }
body.a-page.a-homepage:not(.a-demo-a) .a-channel-arrow { width: 18px; height: 18px; flex-basis: 18px; }

/* Segmented choices keep the same weight in both states, avoiding text-width shifts. */
body.a-page.a-homepage:not(.a-demo-a) :is(.a-example-tabs,.contact-tabs) {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 0;
  border-radius: 8px;
  background: #e6ebf5;
}
body.a-page.a-homepage:not(.a-demo-a) :is(.a-example-tabs,.contact-tabs) button {
  min-width: 0;
  min-height: var(--home-control-height);
  padding: 12px 16px;
  border: 0;
  border-radius: var(--home-control-radius);
  background: transparent;
  color: #53647e !important;
  font-size: var(--home-secondary) !important;
  font-weight: var(--home-medium);
  line-height: 1.5;
  letter-spacing: 0;
}
body.a-page.a-homepage:not(.a-demo-a) :is(.a-example-tabs,.contact-tabs) button[aria-selected=true] {
  background: #fff;
  color: var(--a-blue) !important;
  box-shadow: 0 2px 5px #233b6c12;
  font-weight: var(--home-medium);
}
body.a-page.a-homepage:not(.a-demo-a) .contact-tabs button { flex: 1; }
body.a-page.a-homepage:not(.a-demo-a) #contact-dialog[data-qr-channels] .contact-tabs button { padding-inline: 4px; white-space: nowrap; }
body.a-page.a-homepage:not(.a-demo-a) .a-contact-qr {
  position: relative;
  width: min(100%, 248px);
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
}
body.a-page.a-homepage:not(.a-demo-a) .a-contact-qr img {
  position: absolute;
  display: block;
  max-width: none;
  height: auto;
}
body.a-page.a-homepage:not(.a-demo-a) .a-contact-qr-hint {
  margin: 16px 0 0;
  color: var(--a-muted);
  font-size: var(--home-secondary);
  font-weight: var(--home-normal);
  line-height: 1.8;
  text-align: center;
}
body.a-page.a-homepage:not(.a-demo-a) .a-contact-qr-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 24px;
  margin-top: 8px;
}
body.a-page.a-homepage:not(.a-demo-a) .a-contact-qr-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--a-blue);
  font-size: var(--home-secondary);
  font-weight: var(--home-medium);
}
body.a-page.a-homepage:not(.a-demo-a) #contact-dialog[data-qr-channels] .dialog-note {
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--a-rule);
  color: #304d72;
  font-size: var(--home-secondary);
  text-align: center;
}
body.a-page.a-homepage:not(.a-demo-a) :is(.a-menu-toggle,.dialog-close,.a-image-dialog .a-image-close) {
  width: var(--home-control-height);
  height: var(--home-control-height);
  min-height: var(--home-control-height);
  flex: 0 0 var(--home-control-height);
  padding: 0;
  border-radius: var(--home-control-radius);
}
body.a-page.a-homepage:not(.a-demo-a) :is(.dialog-close,.a-image-dialog .a-image-close) {
  font-size: 28px !important;
  font-weight: var(--home-normal) !important;
  line-height: 1;
}
body.a-page.a-homepage:not(.a-demo-a) :is(.a-course,.a-channel,.a-course-content,.a-social-area,.preview-dialog) {
  min-width: 0;
}

/* Two supplied portraits share one photo stack. Both exposed edges remain tappable. */
body.a-page.a-homepage:not(.a-demo-a) .a-portrait-stack {
  position: relative;
  isolation: isolate;
  flex: 0 0 136px;
  width: 136px;
  height: 120px;
}
body.a-page.a-homepage:not(.a-demo-a) .a-portrait-card {
  position: absolute;
  width: 88px;
  height: 100px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}
body.a-page.a-homepage:not(.a-demo-a) .a-portrait-frame {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 13px #233b6c24;
  transform: rotate(var(--portrait-angle));
  transition: transform 220ms cubic-bezier(.16,1,.3,1), box-shadow 220ms;
}
body.a-page.a-homepage:not(.a-demo-a) .a-portrait-card[data-portrait=avatar] {
  --portrait-angle: -7deg;
  left: 0;
  top: 12px;
}
body.a-page.a-homepage:not(.a-demo-a) .a-portrait-card[data-portrait=real] {
  --portrait-angle: 8deg;
  left: 48px;
  top: 3px;
}
body.a-page.a-homepage:not(.a-demo-a) .a-portrait-card[aria-pressed=false] { z-index: 1; }
body.a-page.a-homepage:not(.a-demo-a) .a-portrait-card[aria-pressed=true] { z-index: 2; }
body.a-page.a-homepage:not(.a-demo-a) .a-portrait-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
body.a-page.a-homepage:not(.a-demo-a) .a-portrait-card:focus-visible {
  outline: 2px solid var(--a-blue);
  outline-offset: 5px;
}
body.a-page.a-homepage:not(.a-demo-a) .a-portrait-card:focus-visible .a-portrait-frame {
  transform: translateY(-4px) rotate(0);
}
@media (hover: hover) and (pointer: fine) {
  body.a-page.a-homepage:not(.a-demo-a) .a-portrait-card:hover .a-portrait-frame {
    transform: translateY(-4px) rotate(0) scale(1.04);
    box-shadow: 0 9px 18px #233b6c30;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.a-page.a-homepage:not(.a-demo-a) .a-portrait-frame { transition: none; }
  body.a-page.a-homepage:not(.a-demo-a) .a-portrait-card:is(:hover,:focus-visible) .a-portrait-frame { transform: rotate(var(--portrait-angle)); }
}

@media (max-width: 1000px) {
  body.a-page.a-homepage:not(.a-demo-a) .a-case-gallery .a-lab-controls { flex-wrap: wrap; gap: 12px 20px; }
  body.a-page.a-homepage:not(.a-demo-a) .a-case-gallery .a-topic-link { margin-left: 0; }
}
@media (max-width: 760px) {
  body.a-page.a-homepage:not(.a-demo-a) { --home-title: 28px; }
  body.a-page.a-homepage:not(.a-demo-a) .a-header { gap: 12px; }
  body.a-page.a-homepage:not(.a-demo-a) .a-header-contact { margin-left: auto; }
  body.a-page.a-homepage:not(.a-demo-a) .a-hero-actions { gap: 18px; }
  body.a-page.a-homepage:not(.a-demo-a) .a-portrait-stack { flex-basis: 116px; width: 116px; height: 104px; }
  body.a-page.a-homepage:not(.a-demo-a) .a-portrait-card { width: 72px; height: 86px; }
  body.a-page.a-homepage:not(.a-demo-a) .a-portrait-card[data-portrait=real] { left: 44px; }
  body.a-page.a-homepage:not(.a-demo-a) .a-example-tabs { width: 100%; }
  body.a-page.a-homepage:not(.a-demo-a) .a-example-tabs button { flex: 1; padding-inline: 8px; white-space: nowrap; }
  body.a-page.a-homepage:not(.a-demo-a) .a-image-dialog-header { flex-wrap: wrap; }
  body.a-page.a-homepage:not(.a-demo-a) .a-image-dialog-header > div:first-child { flex: 1 1 180px; min-width: 0; }
  body.a-page.a-homepage:not(.a-demo-a) .a-image-dialog-actions { margin-left: auto; }
  body.a-page.a-homepage:not(.a-demo-a) .a-image-dialog-header h2 { overflow-wrap: anywhere; }
}
@media (max-width: 380px) {
  body.a-page.a-homepage:not(.a-demo-a) .a-brand-lockup { gap: 10px; }
  body.a-page.a-homepage:not(.a-demo-a) .a-brand-affiliation { padding-left: 10px; }
  body.a-page.a-homepage:not(.a-demo-a) .a-header-contact { gap: 8px; padding-inline: 12px; }
  body.a-page.a-homepage:not(.a-demo-a) .a-header { gap: 8px; }
  body.a-page.a-homepage:not(.a-demo-a) .a-hero-actions { gap: 16px; }
}
