/* Reading sizes in rem scale with the reader's browser preferences. */
:root {
  --reading-size: clamp(1.125rem, 1.02rem + .35vw, 1.3125rem);
  --control-size: clamp(1.0625rem, 1rem + .18vw, 1.1875rem);
  --secondary-size: .9375rem;
  --reading-color: #d8e0d9;
  --secondary-color: #bfcabf;
}

.desktop-nav a,
.header-cta,
.mobile-nav a,
.footer-about,
.site-footer .footer-about {
  font-size: 1rem;
  line-height: 1.4;
}

.desktop-nav a {
  color: var(--reading-color);
}

.section-heading h2 {
  font-size: clamp(2.5rem, 1.7rem + 3.4vw, 5.4rem);
  line-height: 1.06;
}

.muted-heading,
.closing-line p span {
  color: #b7c6b8;
}

.section-intro,
.channel-info > p,
.ecosystem-note,
.method-grid p,
.result-explainer,
.dialog-intro,
#about-dialog > p {
  font-size: var(--reading-size);
  line-height: 1.55;
  color: var(--reading-color);
}

.section-intro { max-width: 31ch; }
.channel-info > p, .method-grid p { max-width: 52ch; }
.section-heading > *, .campaign-lab > * { min-width: 0; }

.section-heading .eyebrow,
.method-top .eyebrow,
.channel-info .eyebrow,
.dialog-top .eyebrow,
.step-number {
  font-size: .875rem;
  line-height: 1.5;
  letter-spacing: .055em;
  color: var(--secondary-color);
}

.channel-info .eyebrow { color: var(--accent); }
.channel-info h3, .method-grid h3 {
  font-size: clamp(1.625rem, 1.45rem + .8vw, 2.375rem);
  line-height: 1.14;
}

.channel-list button > span:not(.channel-number) {
  font-size: clamp(1.375rem, 1.1rem + .8vw, 1.875rem);
}

.channel-info .text-link,
.brief-trigger,
.result-footer .text-link,
#brief-form .button,
#about-dialog .text-link {
  font-size: var(--control-size);
  line-height: 1.4;
}

.campaign-controls .lab-heading .micro,
.campaign-result .lab-heading .micro,
.duration-row,
.intensity-heading,
.intensity-heading output,
.media-options label,
.result-label,
#brief-form > label,
#brief-form input,
#brief-form select,
.duration-row select {
  font-size: var(--control-size);
  line-height: 1.45;
}

.campaign-result .lab-heading .micro {
  letter-spacing: .025em;
}

.lab-heading,
.media-options label,
.duration-row,
.result-footer,
.site-footer,
.site-footer > div {
  flex-wrap: wrap;
}

.lab-heading { row-gap: .5rem; }
.media-options label { padding-block: .6rem; gap: .35rem .85rem; }
.media-options label > .media-kind { font-size: .8125rem; letter-spacing: .035em; }
.campaign-controls .media-options { min-width: 0; }

.estimate-disclaimer,
.form-note,
.range-labels,
.result-footer > span,
.site-footer p,
.site-footer .footer-byline {
  font-size: var(--secondary-size);
  line-height: 1.55;
  color: var(--secondary-color);
}

.brief-summary, .download-status {
  font-size: 1.0625rem;
  line-height: 1.6;
}

.chart-bars { gap: clamp(2px, .5vw, 9px); }
.chart-item > span {
  font: 600 .8125rem/1.3 Arial, Helvetica, sans-serif;
  height: auto;
  min-height: 1.8rem;
  color: var(--secondary-color);
  overflow-wrap: anywhere;
}

dialog h2 {
  font-size: clamp(2.25rem, 1.7rem + 2.1vw, 3.25rem);
}

#brief-form input, #brief-form select, .duration-row select {
  max-width: 100%;
  min-width: 0;
}

/* The menu remains reachable when wider text consumes the navigation row. */
@media (max-width: 53rem) {
  .desktop-nav { display: none; }
  .site-header .header-cta { display: inline-flex; margin-left: auto; }
  .menu-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 0 44px;
    min-height: 44px;
    padding: 0;
  }
  .menu-toggle > span {
    width: 20px;
    height: 1px;
    background: var(--ink);
  }
  .menu-toggle[aria-expanded="true"] > span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] > span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .mobile-nav { top: 100%; }
}

@media (max-width: 48rem) {
  .campaign-lab { grid-template-columns: minmax(0, 1fr); }
  .campaign-result { border-inline-start: 0; border-block-start: 1px solid var(--line); }
  .section-heading { flex-wrap: wrap; }
  .section-heading .section-intro { max-width: 42ch; padding-top: .5rem; }
  .method-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .channel-list { flex-wrap: wrap; }
  .channel-list button {
    flex: 1 1 7rem;
    flex-direction: row;
    gap: .5rem;
    padding: .5rem;
    min-height: 54px;
  }
  .channel-list button > span:not(.channel-number) { font-size: 1.0625rem; }
  .ecosystem-note { align-items: flex-start; }
  .method-grid article { grid-template-columns: minmax(0, 1fr); }
  .site-footer > div { align-items: flex-start; }
  .site-footer .footer-byline { margin-left: 0; }
}

@media (max-width: 26rem) {
  .site-header .header-cta { display: none; }
  .site-header .menu-toggle { margin-left: auto; }
  .chart-item > span { font-size: .75rem; }
  .channel-info { padding-inline: 1rem; }
}
