/* NLG-HYPE-TYPOGRAPHY-009. One fluid scale for all public routes and panels.
   Segoe UI / Inter / Arial and the HYPE colour system are inherited unchanged. */
:root {
  --type-hero: clamp(2.75rem, 1.8rem + 3vw, 5.5rem);
  --type-h1: clamp(2rem, 1.3rem + 2.8vw, 4rem);
  --type-chapter: clamp(2rem, 1.1rem + 3.5vw, 4.5rem);
  --type-h2: clamp(1.75rem, 1.2rem + 2vw, 3rem);
  --type-subheading: clamp(1.375rem, 1.1rem + 1vw, 1.875rem);
  --type-h3: clamp(1.25rem, 1.1rem + .55vw, 1.625rem);
  --type-label: clamp(1.0625rem, 1rem + .3vw, 1.25rem);
  --leading-title: 1.14;
  --leading-subtitle: 1.25;
  --tracking-title: -.035em;
  --tracking-subtitle: -.015em;
  --measure-title: 24ch;
}

.hy-theme :is(#app, .site-footer, #infoDialog, #gimiPanel) :is(h1,h2,h3,h4) {
  font-family: var(--hy-head);
  line-height: var(--leading-title);
  letter-spacing: var(--tracking-title);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-wrap: balance;
  max-inline-size: 100%;
}
.hy-theme :is(#app, .site-footer, #infoDialog) h1 { font-size: var(--type-h1); max-inline-size: min(100%, 24ch); }
.hy-theme :is(#app, .site-footer, #infoDialog) h2 { font-size: var(--type-h2); max-inline-size: min(100%, var(--measure-title)); }
.hy-theme :is(#app, .site-footer, #infoDialog) :is(h3,h4) {
  font-size: var(--type-h3);
  line-height: var(--leading-subtitle);
  letter-spacing: var(--tracking-subtitle);
}
.hy-theme #app :is(.r1-card,.r1-extra-card,.r1-article,.r1-exercise,.r1-next,.r1-staff-group,.r1-calendar-heading,.contact-details) h2,
.hy-theme #app .r1-subsection > h2,
.hy-theme #infoDialog h2 { font-size: var(--type-subheading); line-height: var(--leading-subtitle); }
.hy-theme #app .r1-heading h2 { font-size: var(--type-h2); }
.hy-theme #app .teacher-detail h3 { font-size: var(--type-label) !important; }
.hy-theme .site-footer .modern-footer-links h3,
.hy-theme #gimiPanel h2 { font-size: var(--type-label); line-height: var(--leading-subtitle); }

/* Content determines height: smaller titles do not leave a fixed empty slab. */
.hy-theme #app .hy-intro { height: auto; min-height: 0; }
.hy-theme #app .hy-intro-content {
  height: auto;
  min-height: 0;
  padding-block: clamp(2rem, 4vw, 4rem);
  padding-inline: clamp(1.125rem, 2.8vw, 2.5rem);
}
.hy-theme #app .hy-intro h1 {
  font-size: var(--type-hero);
  line-height: 1.08;
  letter-spacing: var(--tracking-title);
  margin-block: 1.25rem;
  max-inline-size: 12ch;
}
.hy-theme #app .hy-intro h1 span,
.hy-theme #app .hy-stage-title span { white-space: nowrap; }
.hy-theme #app .hy-intro .hy-tagline { font-size: clamp(1rem, .9rem + .4vw, 1.375rem); max-inline-size: 36ch; }
.hy-theme #app .hy-intro .hy-overline { max-inline-size: 100%; line-height: 1.6; }
.hy-theme #app .hy-intro-counter { top: 3rem; }
.hy-theme #app .hy-pagehero { height: auto; min-height: 0; padding-block: clamp(2rem, 5vw, 4.5rem); }
.hy-theme #app .hy-pagehero .container { padding-block: 0; }
.hy-theme #app .hy-pagehero h1 { margin-block: 1rem; }
.hy-theme #app .hy-pagehero p { font-size: clamp(1rem, .9rem + .5vw, 1.375rem); max-inline-size: 54ch; }

.hy-theme #app .hy-stage-title { font-size: var(--type-chapter); line-height: 1.12; }
.hy-theme #app .hy-stage-content > div { width: min(55rem, calc(100% - 13rem)); min-width: 0; }
.hy-theme #app .hy-stage-content { padding-block: 2rem 5.5rem; }
.hy-theme #app .hy-stage-description { max-inline-size: 46ch; font-size: clamp(1rem, .9rem + .4vw, 1.25rem); }
.hy-theme #app .hy-stage-content .hy-btn { margin-top: 1rem; }
.hy-theme #app .hy-section-head { gap: clamp(1.5rem, 4vw, 4rem); }
.hy-theme #app :is(.hy-section-head,.hy-world-head) > * { min-width: 0; }
/* The portrait-card aspect ratio must not size the textual roster link. */
.hy-theme #app .hy-crew .hy-ghost-link {
  display: inline-flex; aspect-ratio: auto; border: 0; border-radius: 0;
  overflow: visible; background: transparent;
}
.hy-theme #app .hy-crew .hy-ghost-link::after { content: none; }
.hy-theme #app .hy-call { padding-block: clamp(3.5rem, 6vw, 6rem); }
.hy-theme #app .hy-call .container { align-items: center; flex-wrap: wrap; }
.hy-theme #app .hy-call .container > div { flex: 1 1 35rem; min-width: 0; }
.hy-theme #app .hy-call h2 { max-inline-size: 21ch; }
.hy-theme #app .hy-call .hy-btn { flex: 0 0 auto; margin-block: 0; }
.hy-theme #app .hy-world-copy h3 { font-size: var(--type-subheading); max-inline-size: 26ch; }
.hy-theme #app .hy-topic strong { font-size: var(--type-h3); line-height: var(--leading-subtitle); }
.hy-theme #app :is(.r1-feature-grid,.r1-home-extra,.hype-campaign-grid,.modern-admissions-steps-grid) > * { min-width: 0; }
.hy-theme :is(#app,.site-footer) :is(h1,h2,h3,h4) { scroll-margin-block: 7rem 6rem; }

@media (min-width: 901px) {
  /* Keep the application CTA clear of the floating launcher while scrolling. */
  .hy-theme #app .hy-call .container { padding-inline-end: 12rem; }
}
@media (max-width: 900px) {
  .hy-theme #app .hy-stage-content > div { width: 100%; }
  .hy-theme #app .hy-stage-rail {
    top: auto; bottom: 1.75rem; left: 1.125rem; right: auto;
    width: calc(100% - 15rem); display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .25rem;
  }
  .hy-theme #app .hy-stage-rail button { padding: .5rem .25rem; font-size: .5625rem; letter-spacing: .03em; text-align: left; }
  .hy-theme #app .hy-call .container { display: flex; flex-direction: column; align-items: flex-start; }
  .hy-theme #app .hy-call .container > div { flex: auto; }
}
@media (max-width: 600px) {
  .hy-theme #app .hy-stage-rail { width: calc(100% - 7rem); }
}
