:root {
  --paper-ink: #33465a;
  --edge: max(24px, 4.6vw);
}

[hidden] { display: none !important; }

.wrap {
  width: min(88rem, calc(100% - var(--edge) * 2));
}

header {
  position: relative;
  z-index: 2;
  background: var(--navy);
}

.bar {
  min-height: 80px;
  gap: clamp(.7rem, 2.1vw, 2rem);
  padding-block: .6rem;
}

.brand {
  flex: 0 1 16rem;
}

.brand span {
  max-width: 12rem;
  font-size: 1rem;
}

.section-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(.7rem, 2vw, 2.1rem);
  flex-wrap: wrap;
}

.section-menu a,
.school-return {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: .88rem;
  color: var(--ivory);
  text-decoration: none;
  text-underline-offset: .42em;
}

.section-menu a:hover,
.section-menu a:focus-visible,
.school-return:hover {
  color: var(--light);
  text-decoration: underline;
}

.langs { margin-inline-start: auto; }

.hero {
  isolation: isolate;
  background: var(--navy);
}

.hero .opening {
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 47fr) minmax(0, 53fr);
  align-items: stretch;
  gap: 0;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 3.5vw, 4rem) clamp(1.1rem, 3vw, 3.2rem) clamp(2rem, 3vw, 3.4rem) 0;
}

.hero-copy .eyebrow {
  max-width: 34ch;
  letter-spacing: .09em;
}

.hero-copy .eyebrow::before {
  content: "";
  display: block;
  width: 2.8rem;
  height: 1px;
  margin-bottom: .9rem;
  background: var(--gold);
}

.opening .hero-copy h1 {
  max-width: none;
  margin: 1.1rem 0 1.2rem;
  font-size: clamp(2.1rem, 4.1vw, 5rem);
  line-height: 1.02;
  letter-spacing: -.045em;
  text-wrap: pretty;
}

.hero-copy h1 span {
  display: block;
}

.hero-copy h1 span:nth-child(2) {
  margin-block: .07em;
  color: var(--light);
}

.hero-copy h1 span:last-child {
  font-size: .76em;
  letter-spacing: -.039em;
}

.hero-copy .dek {
  max-width: 42ch;
  font-size: clamp(1rem, 1.22vw, 1.125rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem 1.3rem;
  margin-top: 1.45rem;
}

.hero-actions a {
  min-height: 48px;
  font-size: .88rem;
}

.hero-secondary {
  display: inline-flex;
  align-items: center;
}

.hero-copy .project-lead { margin-top: 1.6rem; }

.editorial-media {
  position: relative;
  isolation: isolate;
  display: grid;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
}

.editorial-media img {
  display: block;
  height: 100%;
  width: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center;
}

.editorial-media figcaption {
  position: absolute;
  inset: auto .9rem .9rem auto;
  z-index: 1;
  max-width: calc(100% - 1.8rem);
  padding: .4rem .65rem;
  color: var(--ivory);
  background: var(--navy);
  font-size: .73rem;
  line-height: 1.45;
}

.hero .editorial-media {
  min-height: clamp(30rem, 44vw, 43rem);
  margin: 0 calc(-1 * var(--edge) / 2) 0 0;
}

.hero .editorial-media img {
  position: absolute;
  inset: 0;
  object-position: 56% center;
}

.hero .editorial-media figcaption {
  inset: .9rem .9rem auto auto;
}

.hero .editorial-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(3,18,37,.53), transparent 27%),
              linear-gradient(0deg, rgba(3,18,37,.42), transparent 33%);
}

.band {
  padding-block: clamp(3.25rem, 7vw, 7rem);
}

.section-head {
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
  align-items: end;
  gap: 1rem clamp(1.4rem, 5vw, 5rem);
  margin-block-end: clamp(1.65rem, 4vw, 3rem);
}

.section-head h2 {
  font-size: clamp(2rem, 4.4vw, 4.2rem);
  line-height: 1.04;
}

#programmes .section-head h2 { max-width: 15ch; }

.programmes.is-enhanced {
  grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
  gap: 0;
  border: 1px solid var(--line);
  margin-bottom: 2.6rem;
}

.programme-tabs {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.programme-tabs button {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-inline-start: 3px solid transparent;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .6rem;
  padding: .85rem clamp(.8rem, 2.6vw, 2rem);
  min-height: 3.85rem;
  background: transparent;
  color: var(--muted);
  font: 500 .99rem/1.4 Golos, 'Segoe UI',sans-serif;
  text-align: start;
  cursor: pointer;
}

.programme-tabs button::after {
  content: "↗";
  color: var(--gold);
  font-size: 1.1em;
}

.programme-tabs button:last-child { border-bottom: 0; }
.programme-tabs button:hover { color: var(--ivory); }

.programme-tabs button[aria-selected="true"] {
  border-inline-start-color: var(--gold);
  color: var(--ivory);
  background: var(--surface);
}

.programme-tabs button:focus-visible,
.programme-panels .programme:focus-visible {
  outline: 2px solid var(--light);
  outline-offset: -4px;
}

.programme-panels {
  display: grid;
  align-content: center;
  min-width: 0;
  background:
    radial-gradient(ellipse at bottom right, var(--surface) 0, transparent 72%),
    var(--navy);
  border-inline-start: 1px solid var(--line);
}

.programme-panels .programme {
  border: 0;
  padding: clamp(1.4rem, 5.2vw, 4.8rem);
}

.programme-panels h3 {
  max-width: 21ch;
  font-size: clamp(1.85rem, 3.35vw, 3.35rem);
}

.programme-panels p:last-child {
  max-width: 42ch;
}

#programmes > .wrap > .lead { margin-bottom: 1.55rem; }

#centres .centres { gap: 0 3rem; }
#centres details p { max-width: 52ch; }

.research-spread {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.6rem, 4.5vw, 5rem);
  align-items: stretch;
}

.research-spread .editorial-media { min-height: 16rem; }
.research-spread .editorial-media img { object-position: 45% center; }

.research-spread .research {
  align-content: center;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.8rem);
}

#development { background: var(--surface); }
#development .steps .kind {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  font-weight: 500;
}

#documents {
  background: var(--paper);
  color: var(--navy);
  border-block: 0;
  color-scheme: light;
}

#documents .lead { color: var(--paper-ink); }
#documents .paths {
  margin-block: 0;
  gap: 0 clamp(1.6rem, 4vw, 4.4rem);
}

#documents .paths div {
  padding: .95rem 0 .85rem;
  border-color: var(--paper-rule);
}

#documents .paths dt {
  color: var(--navy);
  font-size: clamp(1.17rem, 2vw, 1.56rem);
  max-width: 36ch;
}

#documents .paths dd { color: var(--paper-ink); }

#documents .paths a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--navy);
  text-decoration-color: var(--gold-deep);
  font-weight: 600;
  font-size: .88rem;
}

#documents a:hover { text-decoration-thickness: 2px; }
#documents a:focus-visible { outline-color: var(--navy); }

.migration-page .hero .opening {
  grid-template-columns: minmax(0, 1fr) minmax(0, .68fr);
  align-items: center;
  gap: clamp(1.5rem, 6vw, 6rem);
}

.migration-page .opening .hero-copy h1 { max-width: 15ch; }
.migration-page .jump { margin-block-end: 2rem; }
.migration-page .band .lead + .lead { margin-bottom: 1rem; }

@media (max-width: 68rem) {
  .bar { flex-wrap: wrap; gap: 0 .7rem; }
  .brand { flex-basis: auto; }
  .section-menu {
    order: 1;
    justify-content: flex-start;
    width: 100%;
    gap: .1rem clamp(.75rem, 3vw, 1.8rem);
  }
}

@media (max-width: 54rem) {
  .section-head {
    grid-template-columns: 1fr;
    gap: .7rem;
  }
  .hero .opening { grid-template-columns: minmax(0, 1fr); }
  .hero-copy {
    padding: 2.1rem 0 1.45rem;
    max-width: 40rem;
  }
  .opening .hero-copy h1 {
    font-size: clamp(2.25rem, 7.9vw, 4.1rem);
  }
  .hero .editorial-media {
    min-height: 0;
    margin: 0 0 1.4rem;
    aspect-ratio: 16 / 9;
  }
  .hero .editorial-media img { object-position: 55% 43%; }
  .hero .editorial-media::after { background: linear-gradient(0deg, rgba(3,18,37,.4), transparent 50%); }
  .research-spread { grid-template-columns: 1fr; }
  .research-spread .editorial-media img { max-height: 24rem; }
  .migration-page .hero .opening { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 39rem) {
  :root { --edge: clamp(1rem, 4.5vw, 1.7rem); }
  .bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    padding-block: .5rem 0;
  }
  .brand { max-width: none; }
  .brand span { font-size: .89rem; }
  .section-menu { grid-column: 1 / -1; gap: 0 .85rem; padding-block: .25rem; }
  .section-menu a { font-size: .79rem; min-height: 36px; }
  .school-return { grid-column: 1 / -1; order: 1; }
  .hero-copy { padding-top: 1.85rem; }
  .hero-copy .project-lead { margin-top: 1rem; }
  .hero .editorial-media { aspect-ratio: 5 / 3; }
  .hero .editorial-media figcaption { inset: auto auto .55rem .55rem; }
  body:not(.migration-page) .hero-copy { display: contents; }
  body:not(.migration-page) .hero-copy .eyebrow { grid-row: 1; margin-top: 1.7rem; }
  body:not(.migration-page) .hero-copy h1 { grid-row: 2; margin-block: .8rem 1.1rem; }
  body:not(.migration-page) .hero .editorial-media { grid-row: 3; margin-bottom: 1.2rem; }
  body:not(.migration-page) .hero-copy .dek { grid-row: 4; }
  body:not(.migration-page) .hero-actions { grid-row: 5; margin-top: 1rem; }
  body:not(.migration-page) .hero-copy .project-lead { grid-row: 6; margin-bottom: 1.65rem; }
  .programmes.is-enhanced { grid-template-columns: 1fr; }
  .programme-tabs button { min-height: 3.2rem; padding-block: .6rem; }
  .programme-tabs button:last-child { border-bottom: 1px solid var(--line); }
  .programme-panels { min-height: 14.5rem; border-inline-start: 0; align-content: start; }
  .research-spread .research { grid-template-columns: 1fr; }
  .research-spread .editorial-media { min-height: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: intro .58s ease-out both; }
  .hero-copy h1 { animation-delay: .04s; }
  .hero-copy .dek { animation-delay: .1s; }
  .hero-actions { animation-delay: .14s; }
  .hero-copy .project-lead { animation-delay: .18s; }
  .programme-tabs button { transition: color .18s, background-color .18s, border-color .18s; }
  .programme-panels .programme:not([hidden]) { animation: intro .23s ease-out both; }

  @keyframes intro {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
