/* MAPEL study website. IBM Plex Sans, petrol and navy on white. Light only. */

@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/IBMPlexSans-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/IBMPlexSans-Medium.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); }

:root {
  --white: #FFFFFF;
  --pale: #F8FAFC;
  --navy: #12384E;
  --petrol: #0E6873;
  --petrol-dark: #0B4E57;
  --text: #22333D;
  --muted: #5E6E7A;
  --rule: #E2E8F0;
  --bar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body { margin: 0; background: var(--white); color: var(--text); font-family: "IBM Plex Sans", system-ui, sans-serif; font-size: 17px; line-height: 1.65; }
img { display: block; max-width: 100%; }
a { color: var(--petrol); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--petrol-dark); }
:focus-visible { outline: 2px solid var(--petrol); outline-offset: 3px; border-radius: 2px; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 40px; }

.skip-link { position: absolute; left: 12px; top: -80px; z-index: 20; background: var(--white); color: var(--navy); padding: 10px 14px; border: 1px solid var(--rule); border-radius: 4px; }
.skip-link:focus { top: 12px; }

/* Top bar */
.bar { position: sticky; top: 0; z-index: 10; background: var(--white); border-bottom: 1px solid var(--rule); }
.bar .wrap { display: flex; align-items: center; gap: 32px; height: var(--bar-h); }
.wordmark { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; font-size: 18px; font-weight: 600; letter-spacing: 0.02em; color: var(--navy); text-decoration: none; }
.wordmark .logo { display: block; flex: none; width: 21px; height: 21px; position: relative; top: -1px; }
.wordmark:hover { color: var(--navy); }
.nav { display: flex; gap: 28px; margin: 0; padding: 0; list-style: none; font-size: 15px; }
.nav a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; min-height: 40px; }
.nav a:hover { color: var(--petrol); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border-radius: 4px; border: 0; background: var(--petrol); color: var(--white); font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--petrol-dark); color: var(--white); }
.btn--small { min-height: 40px; padding: 0 18px; font-size: 15px; }
.btn--light { background: var(--white); color: var(--navy); }
.btn--light:hover { background: #E7EEF2; color: var(--navy); }

/* Hero. Photo behind the text from 1024px, photo above the text below 1024px.
   Below 1440px the photo is pinned to the right edge, so the person and monitor stay right as the window narrows. */
.hero { position: relative; background: var(--white); overflow: hidden; }
.hero picture img { width: 100%; height: 100%; object-fit: cover; }
.hero-text h1 { margin: 0; font-size: 56px; line-height: 1.08; font-weight: 500; letter-spacing: -0.022em; color: var(--navy); }
.hero-text .lead { margin: 24px 0 0; font-size: 19px; line-height: 1.6; color: var(--text); }
.hero-act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 36px; }
.hero-act .meta { font-size: 15px; color: var(--text); }

@media (min-width: 1024px) {
  .hero { --text-w: 600px; --text-left: max(40px, calc((100vw - 1200px) / 2 + 40px));
    min-height: 640px; display: flex; align-items: center; }
  .hero picture { position: absolute; inset: 0; }
  .hero picture img { object-position: 72% 50%; }
  .hero::before { content: ""; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(90deg,
      rgba(255,255,255,0.72) 0,
      rgba(255,255,255,0.72) calc(var(--text-left) + var(--text-w) - 24px),
      rgba(255,255,255,0) calc(var(--text-left) + var(--text-w) + 56px)); }
  .hero .wrap { position: relative; z-index: 2; padding-top: 72px; padding-bottom: 72px; }
  .hero-text { max-width: var(--text-w); }
}
@media (min-width: 1280px) and (max-width: 1439px) {
  .hero { --text-w: 520px; min-height: 580px; }
  .hero picture img { object-position: 100% 50%; }
  .hero .wrap { padding-top: 52px; padding-bottom: 52px; }
  .hero-text h1 { font-size: 46px; }
  .hero-text .lead { font-size: 18px; margin-top: 20px; }
  .hero-act { margin-top: 30px; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .hero { --text-w: min(520px, calc(100vw - 615px)); min-height: 540px; }
  .hero picture img { object-position: 100% 50%; }
  .hero .wrap { padding-top: 36px; padding-bottom: 36px; }
  .hero-text h1 { font-size: 36px; }
  .hero-text .lead { font-size: 17px; margin-top: 18px; }
  .hero-act { margin-top: 28px; }
}

@media (max-width: 1023px) {
  .hero { display: flex; flex-direction: column; }
  .hero picture { order: -1; }
  .hero picture img { aspect-ratio: 4 / 3; max-height: 40vh; object-position: 50% 35%; }
  .hero .wrap { position: relative; z-index: 1; margin-top: -28px; background: var(--white); border-radius: 16px 16px 0 0; padding-top: 32px; padding-bottom: 40px; }
  .hero-text { max-width: 640px; }
  .hero-text h1 { font-size: 44px; }
  .hero-text .lead { font-size: 18px; }
}
@media (max-width: 899px) {
  .hero-act .btn { flex: 1 1 100%; }
  .hero-act .meta { flex: 1 1 100%; }
}

/* Sections */
.section { padding: 112px 0; }
.section--pale { background: var(--pale); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.section h2 { margin: 0 0 24px; font-size: 36px; line-height: 1.2; font-weight: 600; letter-spacing: -0.015em; color: var(--navy); }
.section h3 { margin: 0 0 6px; font-size: 19px; line-height: 1.35; font-weight: 600; color: var(--navy); }
.prose { max-width: 40rem; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: start; }
.split .intro { color: var(--text); }
.intro-note { color: var(--muted); font-size: 16px; }

/* What the study looks at */
.topics { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.topics li { padding: 22px 0; border-bottom: 1px solid var(--rule); }
.topics p { margin: 0; color: var(--text); }

/* Why it matters */
.matters { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; }
.matters h3 { margin-top: 32px; }
.matters h3:first-of-type { margin-top: 0; }
sup.ref { font-size: 0.68em; line-height: 0; margin-left: 1px; font-weight: 600; }
sup.ref a { text-decoration: none; }

/* Why now, with one sourced figure */
.figure { border-left: 2px solid var(--petrol); padding: 4px 0 4px 24px; align-self: start; }
.figure .num { font-size: 64px; line-height: 1; font-weight: 500; letter-spacing: -0.02em; color: var(--navy); }
.figure .cap { margin: 12px 0 0; font-size: 16px; color: var(--text); }
.figure .src { margin: 8px 0 0; font-size: 14px; color: var(--muted); }

/* Privacy */
.facts { margin: 0; padding: 0; list-style: none; }
.facts li { padding: 14px 0 14px 0; border-top: 1px solid var(--rule); }
.facts li:last-child { border-bottom: 1px solid var(--rule); }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; }
.person { font-size: 19px; color: var(--navy); font-weight: 500; margin: 0 0 6px; }
.person-role { color: var(--text); margin: 0 0 16px; }
.links { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 15px; }
.links a { display: inline-flex; align-items: center; min-height: 40px; }
.about h3 { margin-top: 28px; }
.about h3:first-child { margin-top: 0; }

/* Navy band */
.band { background: var(--navy); color: #E3EBF0; padding: 96px 0; }
.band h2 { margin: 0 0 16px; font-size: 36px; line-height: 1.2; font-weight: 600; letter-spacing: -0.015em; color: var(--white); }
.band p { color: #D3DFE6; max-width: 36rem; }
.band-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 64px; align-items: start; }
.share-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.share-link { flex: 1 1 240px; min-height: 48px; display: flex; align-items: center; padding: 0 16px; border: 1px solid rgba(255,255,255,0.35); border-radius: 4px; color: var(--white); font-weight: 500; overflow-wrap: anywhere; }
.share-status { min-height: 1.6em; margin: 10px 0 0; font-size: 15px; color: #C7D6DE; }
.band .btn-start { margin-top: 24px; }
.band h2 { margin-bottom: 20px; }

/* Contact and references */
.contact { padding: 96px 0 0; }
details.refs { margin-top: 48px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
details.refs summary { cursor: pointer; padding: 18px 0; font-size: 17px; font-weight: 600; color: var(--navy); }
details.refs ol { margin: 0; padding: 0 0 24px 24px; font-size: 14px; line-height: 1.55; color: var(--text); max-width: 60rem; }
details.refs li { margin: 0 0 10px; padding-left: 6px; overflow-wrap: anywhere; scroll-margin-top: calc(var(--bar-h) + 16px); }
details.refs li:target { background: #EEF4F6; }

/* Footer */
footer { margin-top: 96px; border-top: 1px solid var(--rule); }
footer .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; padding-top: 28px; padding-bottom: 40px; font-size: 15px; }
footer .footer-name { font-weight: 600; color: var(--navy); margin-right: auto; }
footer a { display: inline-flex; align-items: center; min-height: 40px; }
footer .updated { width: 100%; margin: 0; font-size: 14px; color: var(--muted); }

/* Legal pages */
.page-head { padding: 72px 0 8px; }
.page-head h1 { margin: 0; font-size: 44px; line-height: 1.15; font-weight: 500; letter-spacing: -0.02em; color: var(--navy); }
.page-head .meta { margin: 12px 0 0; color: var(--muted); font-size: 15px; }
.legal-body { max-width: 44rem; }
.legal-body section { padding-top: 40px; }
.legal-body h2 { margin: 0 0 10px; font-size: 22px; line-height: 1.3; font-weight: 600; color: var(--navy); }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 8px 0 16px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--rule); }
tr:last-child td { border-bottom: 0; }
th { font-weight: 600; color: var(--navy); font-size: 14px; }
td code { font-family: inherit; font-weight: 600; color: var(--navy); overflow-wrap: anywhere; }
dl.notice { margin: 0; border-top: 1px solid var(--rule); }
dl.notice div { display: grid; grid-template-columns: 220px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
dl.notice dt { color: var(--muted); }
dl.notice dd { margin: 0; color: var(--navy); }

/* Medium screens */
@media (max-width: 1023px) {
  .nav { display: none; }
  .section { padding: 80px 0; }
  .split, .matters, .about, .band-grid { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 899px) {
  .wrap { padding: 0 20px; }
  .hero-text h1 { font-size: 34px; }
  .hero-text .lead { font-size: 18px; }
  .section { padding: 64px 0; }
  .section h2, .band h2 { font-size: 28px; }
  .band { padding: 64px 0; }
  .figure .num { font-size: 52px; }
  .page-head { padding-top: 48px; }
  .page-head h1 { font-size: 34px; }
  dl.notice div { grid-template-columns: 1fr; gap: 2px; }
  .contact { padding-top: 64px; }
  footer { margin-top: 64px; }
}
@media (max-width: 420px) {
  .bar .btn--small { padding: 0 14px; }
  .hero-text h1 { font-size: 32px; }
}

/* Additions: governance labels, footer icons */
.links a { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.orcid-icon { display: inline-block; flex: none; width: 16px; height: 16px; background: url("../img/orcid-id.png") center / contain no-repeat; }
.label { margin: 16px 0 2px; font-size: 14px; color: var(--muted); }
.about h2 + .label { margin-top: 0; }
.person { margin-bottom: 2px; }
.person-role { margin: 0 0 4px; }
.flink { gap: 8px; }
.flink svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--petrol); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.pi-photo { width: 168px; height: 168px; border-radius: 8px; object-fit: cover; margin: 4px 0 20px; }

/* Hero call to action: the button leads, details sit quietly below */
.hero-act { margin-top: 40px; display: block; }
.hero-act .btn { min-height: 56px; padding: 0 34px; font-size: 17px; }
.hero-act .meta { display: block; margin-top: 16px; font-size: 14px; }
@media (min-width: 1024px) and (max-width: 1279px) { .hero-act { margin-top: 30px; } .hero-act .meta { margin-top: 12px; } }
@media (max-width: 899px) { .hero-act .btn { width: 100%; } }

/* Figure: more air between number, caption and source */
.figure { margin-top: 40px; padding: 6px 0 6px 28px; }
.figure .cap { margin-top: 18px; max-width: 26em; line-height: 1.55; }
.figure .src { margin-top: 14px; font-size: 13px; line-height: 1.5; max-width: 30em; }

/* Hero note under the intro, governance refinements */
.hero-note { margin: 14px 0 0; font-size: 15px; color: var(--text); }
.hero-act { margin-top: 32px; }
.pi-photo { width: 120px; height: 120px; margin: 0 0 18px; }
.role-line { font-size: 15px; color: var(--muted); }
#governance h2 { margin-bottom: 32px; }
@media (max-width: 600px) {
  .hero picture img { aspect-ratio: 16 / 10; }
  .hero-act { margin-top: 24px; }
}
#governance .links { margin-top: 28px; }
@media (min-width: 1024px) { #governance .prose h3:first-child { padding-top: 4px; } }

/* Hero from 1440px: the photo is drawn 2% narrower and anchored right, so less of the top is cropped. The left edge fades into the white behind the text */
@media (min-width: 1440px) {
  .hero picture img { display: block; width: 98%; margin-left: auto;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 160px);
    mask-image: linear-gradient(90deg, transparent 0, #000 160px); }
}
