/* Mantelab — Nexus-inspired visual system.
   Original Mantelab selectors and functional states are retained.
   Brand tokens and presentation are adapted from the supplied Nexus CSS. */

:root {
  --navy:      #0A2240;
  --navy-soft: #13345C;
  --blue-700:  #135EAB;
  --blue:      #135EAB;
  --blue-300:  #A7B2C2;
  --blue-100:  #DCE3EB;
  --blue-50:   #E4E9EF;

  --orange:      #E0491F;
  --orange-500:  #FF5C35;
  --orange-400:  #FF5C35;
  --orange-100:  #FFF0EA;

  --ink:      #0A2240;
  --ink-soft: #5C6F85;
  --paper:    #FFFFFF;
  --mist:     #F6F1EA;
  --rule:     #E4E9EF;

  --serif: "Poppins", system-ui, sans-serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --s1: 0.5rem;  --s2: 1rem;   --s3: 1.5rem;
  --s4: 2.5rem;  --s5: 4rem;   --s6: 6rem;
  --r: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-weight: 400;
}

.wrap { max-width: 74rem; margin: 0 auto; padding: 0 var(--s3); }

a { color: var(--blue-700); text-underline-offset: 0.18em; }
a:hover { color: var(--orange); }

:focus-visible { outline: 3px solid var(--orange-500); outline-offset: 2px; border-radius: 3px; }

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: var(--s3); top: var(--s2); z-index: 20;
  background: var(--navy); color: #fff; padding: 0.6rem 1rem; border-radius: var(--r);
}

/* ------------------------------------------------------------ masthead */

.masthead { background: var(--paper); border-bottom: 1px solid var(--rule); }

.masthead-in {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: var(--s2) var(--s4);
  padding-top: var(--s2); padding-bottom: var(--s2);
}

.mark { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); }
.mark-logo { width: 42px; height: 42px; flex: none; object-fit: contain; }
.mark-text { display: block; line-height: 1.15; }
.mark-name {
  display: block; font-family: var(--sans); font-size: 1.3125rem;
  font-weight: 600; letter-spacing: 0.01em; color: var(--blue-700);
}
.mark-sub { display: block; font-size: 0.75rem; color: var(--ink-soft); }

.nav { display: flex; flex-wrap: wrap; gap: 0.35rem; font-size: 0.9375rem; }
.nav a {
  text-decoration: none; color: var(--ink-soft);
  padding: 0.4rem 0.75rem; border-radius: 100px;
}
.nav a:hover { color: var(--blue-700); background: var(--blue-50); }
.nav a[aria-current="page"] { color: #fff; background: var(--blue); }

/* ------------------------------------------------------------ hero */

.hero {
  background: var(--navy);
  background-image: radial-gradient(circle at 82% 18%, rgba(255,92,53,0.22), transparent 55%),
                    radial-gradient(circle at 12% 88%, rgba(19,94,171,0.5), transparent 60%);
  color: #fff;
  padding-top: var(--s5); padding-bottom: var(--s4);
}
.hero-logo { width: 96px; height: auto; margin-bottom: var(--s3); }
.hero-h {
  margin: 0; max-width: 20ch;
  font-family: var(--serif); font-weight: 800;
  font-size: clamp(2.1rem, 5.6vw, 3.6rem); line-height: 1.08; letter-spacing: -0.02em;
}
.hero-h em { font-style: normal; color: var(--orange-400); }
.hero-sub { max-width: 46ch; margin: var(--s2) 0 0; color: var(--blue-100); font-size: 1.125rem; }

.hero-acts { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }

.trace-fig { margin: var(--s4) 0 0; }
.trace { display: block; width: 100%; height: clamp(90px, 15vw, 170px); overflow: visible; }
.trace-base { stroke: rgba(255,255,255,0.22); stroke-width: 1; }
.trace-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s cubic-bezier(.22,.61,.36,1) .25s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.trace-cap { display: flex; justify-content: space-between; margin-top: var(--s1); font-size: 0.8125rem; color: var(--blue-100); }
.trace-cap span:first-child { color: var(--orange-400); }
.trace-cap span:last-child { color: var(--blue-300); }

@media (prefers-reduced-motion: reduce) {
  .trace-line { animation: none; stroke-dashoffset: 0; }
  * { transition-duration: 0.01ms !important; }
}

/* ------------------------------------------------------------ buttons */

.cta, .btn-lead, .btn-ghost {
  display: inline-block; font-family: var(--sans); font-size: 0.9375rem; font-weight: 600;
  text-decoration: none; padding: 0.75rem 1.4rem; border-radius: 100px; border: 2px solid transparent;
}
.cta, .btn-lead { background: var(--orange-500); color: #fff; }
.cta:hover, .btn-lead:hover { background: var(--orange); color: #fff; }
.btn-ghost { border-color: rgba(255,255,255,0.5); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,0.12); color: #fff; }
.cta-wrap { margin: var(--s3) 0 var(--s1); }

/* ------------------------------------------------------------ bands & rails */

.band-mist { background: var(--mist); }
.band-navy { background: var(--navy); color: #fff; }
.band-navy h2, .band-navy h1 { color: #fff; }
.band-navy p { color: var(--blue-100); }
.band-navy a { color: var(--orange-400); }


/* Full-bleed alternating bands, no hairline rules: every other top-level
   section gets a tinted background that runs edge to edge, using the
   box-shadow bleed trick so the underlying markup never has to change. */
html, body { overflow-x: hidden; }

.rail {
  position: relative;
  display: grid; grid-template-columns: 11rem minmax(0,1fr);
  gap: var(--s2) var(--s4); max-width: 74rem; margin: 0 auto;
  padding: var(--s5) var(--s3);
}
main > .rail:nth-of-type(even) {
  background: var(--blue-50);
  box-shadow: 0 0 0 100vmax var(--blue-50);
  clip-path: inset(0 -100vmax);
}
main > .rail:nth-of-type(4n+1):not(:nth-of-type(1)) {
  background: var(--orange-100);
  box-shadow: 0 0 0 100vmax var(--orange-100);
  clip-path: inset(0 -100vmax);
}
main > .rail:last-child { padding-bottom: var(--s6); }

.rail-label {
  display: inline-block; margin: 0 0 0.5rem; padding: 0.3rem 0.9rem;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.03em;
  color: #fff; background: var(--orange-500); border-radius: 100px;
  align-self: start;
}
main > .rail:nth-of-type(even) .rail-label { background: var(--blue); }
.band-navy .rail-label { background: var(--orange-400); color: var(--navy); }
.rail-body > :first-child { margin-top: 0; }
.rail-body > :last-child { margin-bottom: 0; }
.rail-body p, .rail-body h1, .rail-body h2 { max-width: 66ch; }
.page-head { padding-top: var(--s5); }

h1 {
  margin: 0 0 var(--s2); font-family: var(--sans); font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.05; letter-spacing: -0.03em;
}
h2 { margin: 0 0 0.5rem; font-family: var(--serif); font-weight: 700; font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0 0 var(--s2); }
.lede { font-family: var(--sans); font-size: 1.3125rem; line-height: 1.55; }
.note { font-size: 0.9375rem; color: var(--ink-soft); max-width: 62ch; }
.more { font-size: 0.9375rem; font-weight: 600; }
.addr { line-height: 1.75; }
.crumb { font-size: 0.875rem; margin-bottom: var(--s2); }
.aud { font-size: 0.8125rem; font-weight: 600; color: #fff; background: var(--blue); display: inline-block; padding: 0.2rem 0.7rem; border-radius: 100px; }
.in-sec { font-size: 0.8125rem; color: var(--ink-soft); }
.empty { color: var(--ink-soft); }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------ stats */

.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem,1fr)); gap: var(--s3); margin: 0; }
.figures > div { padding: 0; }
.figures dt { font-family: var(--sans); font-size: clamp(2.4rem,5.4vw,3.4rem); line-height: 1; color: var(--orange-400); font-weight: 800; letter-spacing: -0.02em; }
.band-mist .figures dt { color: var(--blue); }
.figures dd { margin: 0.4rem 0 0; font-size: 0.875rem; color: var(--blue-100); max-width: 18ch; }
.band-mist .figures dd { color: var(--ink-soft); }

/* ------------------------------------------------------------ cards */

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(17rem,1fr)); }
.cards > li {
  background: var(--blue-50); border: none; border-radius: var(--r); padding: var(--s3);
}
.cards > li:nth-child(3n+2) { background: var(--orange-100); }
.cards > li:nth-child(3n+3) { background: var(--mist); }
.cards h2 { font-weight: 700; }
.cards h2 { font-size: 1.1875rem; }
.cards h2 a { text-decoration: none; }
.cards h2 a:hover { text-decoration: underline; }
.cards p { color: var(--ink-soft); margin: 0; font-size: 0.9375rem; }

/* themes / publications / courses lists */

.themes, .pub-list, .courses, .ccards, .people { list-style: none; margin: 0; padding: 0; }

.themes li, .pub-list li, .courses li, .ccards li {
  padding: var(--s3); margin-bottom: var(--s2); border-radius: var(--r); background: var(--mist);
}
.themes li:nth-child(3n+2), .pub-list li:nth-child(3n+2), .courses li:nth-child(3n+2), .ccards li:nth-child(3n+2) { background: var(--blue-50); }
.themes li:nth-child(3n+3), .pub-list li:nth-child(3n+3), .courses li:nth-child(3n+3), .ccards li:nth-child(3n+3) { background: var(--orange-100); }
.themes li:last-child, .pub-list li:last-child, .courses li:last-child, .ccards li:last-child { margin-bottom: 0; }
.themes p, .courses p, .ccard-blurb { color: var(--ink-soft); max-width: 60ch; }
.themes h2 a, .pub-list h2 a, .courses h2 a, .ccard h2 a { text-decoration: none; }
.themes h2 a:hover, .pub-list h2 a:hover, .courses h2 a:hover, .ccard h2 a:hover { text-decoration: underline; }

.pub-list h2 { font-size: 1.1875rem; font-weight: 400; line-height: 1.35; }
.pub-meta { font-size: 0.9375rem; color: var(--ink-soft); margin: 0; }
.doi { font-size: 0.8125rem; color: var(--blue); margin: 0; word-break: break-word; }
.pub-list-short li { padding: var(--s2) 0; }
.pub-list-short h2 { font-size: 1.0625rem; }
.course-meta, .ccard-meta { font-size: 0.8125rem; color: var(--orange); font-weight: 600; margin: 0; }
.ccard h2 { font-size: 1.3125rem; }
.ccard-prog { font-size: 0.8125rem; color: var(--blue); font-weight: 600; margin: 0.4rem 0 0; }
.ccard-prog.is-complete { color: var(--orange); }

/* ------------------------------------------------------------ filters */

.filters { margin-bottom: var(--s3); }
.field { display: block; max-width: 26rem; }
.field span { display: block; font-size: 0.8125rem; color: var(--ink-soft); margin-bottom: 0.3rem; }
.field input {
  width: 100%; font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 100px; padding: 0.6rem 1rem;
}
.field input:focus-visible { border-color: var(--blue); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s2); }
.chip {
  font-family: var(--sans); font-size: 0.875rem; font-weight: 500; color: var(--blue-700);
  background: var(--blue-50); border: 1px solid transparent; border-radius: 100px;
  padding: 0.35rem 0.95rem; cursor: pointer;
}
.chip:hover { border-color: var(--blue-300); }
.chip.is-on { background: var(--blue); color: #fff; }

/* ------------------------------------------------------------ people */

.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem,1fr)); gap: var(--s3); }
.person { display: block; }

.face {
  display: grid; place-items: center;
  width: 100%; aspect-ratio: 1 / 1; margin-bottom: 0.7rem;
  border-radius: var(--r); object-fit: cover;
  background: var(--blue-50); color: var(--blue);
  font-size: 1.5rem; font-weight: 600; letter-spacing: 0.03em;
}
span.face {
  border: 2px dashed var(--blue-100);
  position: relative;
}
span.face::after {
  content: "photo to come";
  position: absolute; bottom: 0.55rem; left: 0; right: 0;
  font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.02em;
  color: var(--ink-soft); opacity: 0.75;
}
img.face { border: 1px solid var(--rule); }

.person h2 { font-size: 1.0625rem; font-family: var(--sans); font-weight: 600; margin-bottom: 0.1rem; }
.person-role { font-size: 0.8125rem; font-weight: 600; color: var(--orange); margin: 0; }
.person-aff { font-size: 0.8125rem; color: var(--ink-soft); margin: 0; }
.person-lead { grid-column: 1 / -1; display: grid; grid-template-columns: 13rem minmax(0,1fr); gap: var(--s3); align-items: start; }
.person-lead .face { margin-bottom: 0; }
.person-lead h2 { font-size: 1.5rem; font-family: var(--serif); font-weight: 500; }

/* ------------------------------------------------------------ course pages */

.stats { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin: 0; }
.stats dt { font-size: 0.75rem; color: var(--ink-soft); margin-bottom: 0.1rem; }
.stats dd { margin: 0; font-size: 1.125rem; font-weight: 600; color: var(--blue-700); }

.prog { background: var(--blue-50); border-radius: var(--r); padding: var(--s3); }
.bar { height: 8px; background: #fff; border-radius: 100px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--orange-500); transition: width .3s ease, background-color .3s ease; border-radius: 100px; }
.prog.is-complete .bar-fill { background: var(--blue); }
.prog-text { font-size: 0.9375rem; color: var(--ink-soft); margin: 0.7rem 0 0; }
.prog-text strong { color: var(--blue-700); font-size: 1.125rem; }
.prog-acts { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }

.btn {
  font-family: var(--sans); font-size: 0.875rem; font-weight: 500; color: var(--blue-700);
  background: #fff; border: 1px solid var(--rule); border-radius: 100px; padding: 0.45rem 1rem; cursor: pointer;
}
.btn:hover { border-color: var(--blue); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--ink-soft); padding-left: 0; }
.btn-quiet:hover { color: var(--orange); border-color: transparent; }

.sec { background: var(--mist); border-radius: var(--r); padding: var(--s3); margin-bottom: var(--s2); }
.sec:last-child { margin-bottom: 0; }
.sec summary {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.5rem var(--s2); cursor: pointer; list-style: none; padding-left: 1.5rem; position: relative;
}
.sec summary::-webkit-details-marker { display: none; }
.sec summary::before {
  content: ""; position: absolute; left: 0.3rem; top: 0.5rem;
  width: 0.45rem; height: 0.45rem;
  border-right: 2px solid var(--blue); border-bottom: 2px solid var(--blue);
  transform: rotate(-45deg); transition: transform .2s ease;
}
.sec[open] summary::before { transform: rotate(45deg); }
.sec-title { font-family: var(--serif); font-size: 1.1875rem; font-weight: 500; }
.sec-count { font-size: 0.8125rem; color: var(--ink-soft); white-space: nowrap; }
.sec.is-done .sec-count { color: var(--orange); font-weight: 600; }
.sec-desc, .sec-note { font-size: 0.9375rem; color: var(--ink-soft); margin: var(--s1) 0 0 1.5rem; max-width: 62ch; }
.sec-empty summary { cursor: default; }
.sec-empty .sec-title { color: var(--ink-soft); }

.items { list-style: none; margin: var(--s2) 0 0; padding: 0 0 0 1.5rem; }
.item { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: start; gap: 0.75rem; padding: 0.6rem 0.2rem; border-radius: 6px; }
.item:hover { background: var(--paper); }
.tick { margin: 0.35rem 0 0; width: 1.05rem; height: 1.05rem; accent-color: var(--orange-500); cursor: pointer; }
.item-main { cursor: pointer; }
.item-title, .item-link { display: block; font-size: 1rem; line-height: 1.35; }
.item-link { text-decoration: none; color: var(--ink); }
.item-link:hover { color: var(--blue-700); text-decoration: underline; }
.tick:checked + .item-main .item-title, .tick:checked + .item-main .item-link { color: var(--ink-soft); text-decoration: line-through; }
.item-meta { display: block; font-size: 0.75rem; color: var(--ink-soft); margin-top: 0.15rem; }
.item-meta-lg { font-size: 0.8125rem; margin-bottom: 0.3rem; }
.kind { font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 100px; }
.kind-lesson { background: var(--blue-50); color: var(--blue-700); }
.kind-quiz { background: var(--orange-100); color: var(--orange); }
.kind-assignment { background: #E6F0E9; color: #2A6A48; }
.item-go { font-size: 0.8125rem; white-space: nowrap; }

.one-tick {
  display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.9375rem; font-weight: 500;
  background: var(--blue-50); border: 2px solid transparent; border-radius: 100px; padding: 0.6rem 1.1rem;
}
.one-tick label { cursor: pointer; }
.one-tick .tick-one { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--orange-500); cursor: pointer; }
.one-tick.is-on { border-color: var(--orange-500); color: var(--orange); }

/* ------------------------------------------------------------ prose */

.prose { max-width: 66ch; font-family: var(--sans); font-size: 1.125rem; line-height: 1.7; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 var(--s2); }
.prose h2 { font-size: 1.3125rem; margin: var(--s3) 0 var(--s1); padding-top: var(--s1); border-top: 1px solid var(--rule); }
.prose > h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.prose ul, .prose ol { margin: 0 0 var(--s2); padding-left: 1.3rem; }
.prose li { margin-bottom: 0.4rem; }
.prose li::marker { color: var(--orange-500); }
.prose strong { font-weight: 600; }
.prose img { display: block; max-width: 100%; height: auto; margin: var(--s3) 0; border-radius: var(--r); border: 1px solid var(--rule); }
.prose .fig { margin: var(--s3) 0; }
.prose .fig img { margin: 0; }
.prose blockquote { margin: var(--s3) 0; padding-left: var(--s2); border-left: 3px solid var(--orange-500); color: var(--ink-soft); }
.prose table { width: 100%; border-collapse: collapse; margin: var(--s3) 0; font-family: var(--sans); font-size: 0.9375rem; }
.prose th, .prose td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--rule); }
.prose th { background: var(--blue-50); font-weight: 600; font-size: 0.8125rem; }

.embed { margin: var(--s3) 0; }
.embed iframe { display: block; width: 100%; min-height: 34rem; border: 1px solid var(--rule); border-radius: var(--r); background: var(--mist); }
.embed-note { font-family: var(--sans); font-size: 0.8125rem; margin: 0.4rem 0 0; }
.dl { font-family: var(--sans); font-size: 0.9375rem; background: var(--orange-100); border-left: 3px solid var(--orange-500); padding: 0.8rem 1rem; border-radius: 0 var(--r) var(--r) 0; }
.src { font-family: var(--sans); font-size: 0.8125rem; color: var(--ink-soft); margin-top: var(--s3); }

/* ------------------------------------------------------------ prev / next */

.pn-wrap { display: flex; flex-wrap: wrap; gap: var(--s3); }
.pn {
  flex: 1 1 14rem; text-decoration: none; font-size: 1rem; font-weight: 500;
  background: var(--mist); border-radius: var(--r); padding: var(--s2) var(--s3); color: var(--ink);
}
.pn:hover { background: var(--blue-50); color: var(--blue-700); }
.pn span { display: block; font-size: 0.75rem; font-weight: 600; color: var(--orange); margin-bottom: 0.15rem; }

/* ------------------------------------------------------------ footer */

.foot { background: var(--navy); color: var(--blue-100); padding: var(--s4) 0; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2) var(--s4); font-size: 0.875rem; }
.foot-in p { margin: 0; }
.foot-addr { line-height: 1.65; }
.foot-logo { width: 130px; height: auto; margin-bottom: var(--s2); }

/* ------------------------------------------------------------ narrow */

@media (max-width: 52rem) {
  .rail { grid-template-columns: 1fr; gap: var(--s1); padding-top: var(--s3); padding-bottom: var(--s3); }
  .rail-label { margin-bottom: var(--s2); }
  .page-head, .hero { padding-top: var(--s4); }
  .nav { gap: 0.2rem; font-size: 0.875rem; }
  .nav a { padding: 0.35rem 0.6rem; }
  .people { grid-template-columns: repeat(auto-fill, minmax(9rem,1fr)); }
  .person-lead { grid-template-columns: 1fr; }
  .person-lead .face { max-width: 12rem; }
  .embed iframe { min-height: 24rem; }
}

/* ------------------------------------------------------------ sign-in bar
   Only appears when Supabase is configured in supabase-config.js. */

.authbar { display: flex; align-items: center; gap: 0.6rem; font-size: 0.8125rem; }
.authbar-who { color: var(--ink-soft); }

.badge-note {
  display: inline-block; font-size: 0.875rem; font-weight: 600; color: var(--blue-700);
  background: var(--blue-50); border-radius: 100px; padding: 0.5rem 1rem; margin: 0;
}

/* ------------------------------------------------------------ assignment
   submission — inert until Supabase is configured and the reader signs in;
   see supabase-sync.js and SUPABASE.md. */

.submit-box { margin: var(--s2) 0; }
.submit-signin { margin: 0 0 var(--s2); }
.submit-form {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2);
  background: var(--blue-50); border-radius: var(--r); padding: var(--s2) var(--s3);
}
.submit-form input[type="file"] { font-size: 0.875rem; max-width: 100%; }
.submit-status { font-size: 0.875rem; color: var(--ink-soft); margin: 0; width: 100%; }
.submit-list { margin-top: var(--s2); }
.submit-prev { font-size: 0.8125rem; font-weight: 600; color: var(--ink-soft); margin: 0 0 0.3rem; }
.submit-prev-list { list-style: none; margin: 0; padding: 0; font-size: 0.875rem; color: var(--ink-soft); }
.submit-prev-list li { padding: 0.2rem 0; }

/* ------------------------------------------------------------ interactive
   quizzes and reflection prompts (quiz-engine.js) */

.qz-note, .rf-field span + & { }
.qz-note { font-size: 0.9375rem; color: var(--ink-soft); background: var(--blue-50); border-radius: var(--r); padding: 0.8rem 1rem; }

.qz-q {
  border: none; margin: var(--s3) 0 0; padding: 0; background: var(--mist);
  border-radius: var(--r); padding: var(--s3);
}
.qz-q legend {
  font-family: var(--sans); font-weight: 700; font-size: 1.0625rem;
  padding: 0 0 var(--s2); float: left; width: 100%;
}
.qz-opt {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.5rem 0.7rem; border-radius: 8px; cursor: pointer; margin-bottom: 0.3rem;
}
.qz-opt:hover { background: var(--paper); }
.qz-opt input { margin-top: 0.2rem; accent-color: var(--blue); flex: none; }
.qz-opt span { font-size: 0.9375rem; }

.qz-q.qz-right, .qz-q.qz-off { padding-bottom: var(--s3); }
.opt-correct { background: #E1F3E7; }
.opt-correct span::after { content: " \2713"; color: #1E7A46; font-weight: 700; }
.opt-wrong { background: #FBE2DE; }
.opt-wrong span::after { content: " \2717"; color: #B3261E; font-weight: 700; }

.qz-explain {
  margin: var(--s2) 0 0; padding: 0.7rem 0.9rem; font-size: 0.875rem;
  background: var(--paper); border-left: 3px solid var(--blue); border-radius: 0 6px 6px 0;
  color: var(--ink-soft);
}

.qz-actions { margin-top: var(--s3); }
.qz-result {
  margin-top: var(--s3); padding: 0.9rem 1.1rem; border-radius: var(--r);
  font-weight: 600; font-size: 0.9375rem;
}
.qz-result.qz-pass { background: #E1F3E7; color: #145C33; }
.qz-result.qz-fail { background: #FBE2DE; color: #8A241D; }

.rf-field { display: block; margin: var(--s2) 0 0; }
.rf-field span { display: block; font-weight: 600; font-size: 0.9375rem; margin-bottom: 0.3rem; }
.rf-field textarea {
  width: 100%; font-family: var(--sans); font-size: 0.9375rem; color: var(--ink);
  background: var(--mist); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 0.7rem 0.9rem; resize: vertical;
}
.rf-field textarea:focus-visible { border-color: var(--blue); }
.rf-status { font-size: 0.8125rem; color: var(--ink-soft); margin-top: var(--s2); }

/* ------------------------------------------------------------ card polish
   matching the photo-card-with-pill pattern: lift on hover, a proper
   coloured tag instead of plain coloured text. */

.cards > li, .ccards > li, .person, .pub-list > li, .courses > li {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cards > li:hover, .ccards > li:hover, .person:hover, .pub-list > li:hover, .courses > li:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -12px rgba(10,34,64,0.16);
}

.person-role {
  display: inline-block; font-size: 0.75rem; font-weight: 700; color: #fff;
  background: var(--orange-500); border-radius: 100px; padding: 0.2rem 0.75rem; margin: 0.15rem 0 0.35rem;
}
.person:nth-child(3n+2) .person-role { background: var(--blue); }
.person:nth-child(3n+3) .person-role { background: var(--navy); }
.person-lead .person-role { background: var(--orange-500); }

.person-arrow {
  display: inline-block; margin-top: 0.5rem; font-weight: 700; color: var(--blue-700);
}

/* ------------------------------------------------------------ forms
   (registration on course pages, contact on the contact page) */

.mform { display: grid; gap: var(--s2); max-width: 34rem; }
.mform .f-row { display: grid; gap: 0.35rem; }
.mform label { font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.mform input, .mform textarea, .mform select {
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--rule); border-radius: 8px;
  padding: 0.65rem 0.85rem;
}
.mform input:focus-visible, .mform textarea:focus-visible, .mform select:focus-visible { border-color: var(--blue); }
.mform textarea { resize: vertical; min-height: 6rem; }
.mform .f-actions { margin-top: 0.25rem; }
.mform button[type="submit"] { cursor: pointer; border: none; }
.mform button[type="submit"]:disabled { opacity: 0.55; cursor: not-allowed; }
.mform-status { font-size: 0.875rem; margin: 0; }
.mform-status.is-ok { color: #145C33; font-weight: 600; }
.mform-status.is-err { color: #8A241D; font-weight: 600; }
.mform-status.is-off { color: var(--ink-soft); }

/* ------------------------------------------------------------ content gate
   real access control: the lock is shown until Supabase confirms a
   session and returns the row. See supabase-sync.js. */

.gate-lock {
  background: var(--blue-50); border: 1.5px dashed var(--blue-300);
  border-radius: var(--r); padding: var(--s4) var(--s3); text-align: center;
}
.gate-msg { font-family: var(--sans); font-weight: 700; font-size: 1.125rem; margin: 0 0 var(--s2); }
.gate-note { font-size: 0.8125rem; color: var(--ink-soft); margin: var(--s2) 0 0; }
.gate-loading { font-size: 0.9375rem; color: var(--ink-soft); }
.gate-error { font-size: 0.9375rem; color: #8A241D; background: #FBE2DE; border-radius: var(--r); padding: 0.8rem 1rem; }
.gate-content .prose { max-width: 66ch; }

/* ---- enrolment and records ---- */
[hidden] { display: none !important; }
.enrol-state { margin: 0 0 var(--s3); max-width: 34rem; }
.enrol-state p { margin: 0 0 var(--s2); }
.enrol-msg { padding: 0.8rem 1rem; border-radius: var(--r); background: var(--blue-50); border-left: 4px solid var(--blue); }
.enrol-msg.is-approved { background: #E4F4E9; border-left-color: #1E7B3A; }
.enrol-msg.is-declined { background: #FBE2DE; border-left-color: #8A241D; }
.record-line { font-size: 0.9375rem; color: var(--ink-soft); margin: var(--s1) 0 var(--s2); max-width: 62ch; }
.record-line.is-complete { color: #17612E; font-weight: 600; background: #E4F4E9; border-radius: var(--r); padding: 0.7rem 0.9rem; }
.submit-locked { font-size: 0.9375rem; color: var(--ink-soft); background: var(--mist); border-radius: var(--r); padding: 0.7rem 0.9rem; }
.record-head { margin-bottom: var(--s3); }
.record-who { font-family: var(--sans); font-weight: 700; font-size: 1.125rem; margin: 0; }
.record-date { font-size: 0.875rem; color: var(--ink-soft); margin: 0.15rem 0 0; }
.record-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; margin-bottom: var(--s3); }
.record-table th { text-align: left; font-family: var(--sans); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: #fff; background: var(--navy); padding: 0.6rem 0.75rem; }
.record-table td { padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.record-table td.is-done { color: #17612E; font-weight: 600; }
@media (max-width: 40rem) {
  .record-table thead { display: none; }
  .record-table tr { display: block; border-bottom: 2px solid var(--rule); padding: 0.4rem 0; }
  .record-table td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: 0.3rem 0; }
  .record-table td::before { content: attr(data-label); font-weight: 600; color: var(--ink-soft); }
}
@media print {
  .masthead, .foot, .skip, .record-print, .authbar { display: none !important; }
  .record-table th { background: #fff; color: #000; border-bottom: 2px solid #000; }
}


/* ==============================================================
   NEXUS-INSPIRED FINISHING LAYER
   Uses the actual Nexus brand tokens and shadow/radius values.
   The existing Mantelab class names and functional UI are intact.
   =============================================================== */
:root {
  --nexus-navy: #0A2240;
  --nexus-navy-light: #13345C;
  --nexus-orange: #FF5C35;
  --nexus-orange-dark: #E0491F;
  --nexus-blue: #135EAB;
  --nexus-teal: #004F51;
  --nexus-cream: #F6F1EA;
  --nexus-mist: #DCE3EB;
  --nexus-slate: #5C6F85;
  --shadow-card: 0 1px 2px #0a22400f, 0 8px 24px #0a224014;
  --shadow-lifted: 0 16px 40px #0a224029;
  --ease-spring: cubic-bezier(.22,1,.36,1);
}
body { background: var(--nexus-cream); }
.masthead { background: #fff; box-shadow: 0 1px 2px #0a22400f; }
.mark-name, h1, h2, .hero-h, .figures dt, .sec-title, .person-lead h2 {
  font-family: var(--serif);
}
.hero { background-color: var(--nexus-navy); }
.hero-h { font-size: clamp(2.75rem,5vw,5rem); line-height: 1.08; letter-spacing: -0.03em; }
.hero-sub { color: var(--nexus-mist); }
.cta, .btn-lead, .btn-ghost, .btn, .chip, .nav a {
  transition: background-color .18s ease, border-color .18s ease,
              color .18s ease, transform .18s var(--ease-spring), box-shadow .18s ease;
}
.cta:hover, .btn-lead:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.cards > li, .ccards > li, .courses > li, .pub-list > li,
.themes > li, .person, .sec, .prog, .pn {
  box-shadow: var(--shadow-card);
}
.cards > li, .ccards > li, .courses > li, .pub-list > li, .themes > li {
  background: #fff;
  border: 1px solid var(--rule);
}
.cards > li:nth-child(n), .ccards > li:nth-child(n),
.courses > li:nth-child(n), .pub-list > li:nth-child(n),
.themes > li:nth-child(n) { background: #fff; }
.cards > li:hover, .ccards > li:hover, .person:hover,
.pub-list > li:hover, .courses > li:hover, .themes > li:hover {
  box-shadow: var(--shadow-lifted);
}
.rail-label, .person-role, .chip, .aud { letter-spacing: .04em; }
.nav a[aria-current="page"] { background: var(--nexus-navy); }
.nav a:hover { background: var(--nexus-cream); color: var(--nexus-orange); }
.field input, .mform input, .mform textarea, .mform select, .rf-field textarea {
  background: #fff;
}
:focus-visible { outline-color: var(--nexus-orange); }
@media (prefers-reduced-motion: reduce) {
  .cta, .btn-lead, .btn-ghost, .btn, .chip, .nav a,
  .cards > li, .ccards > li, .person, .pub-list > li, .courses > li {
    transition: none !important;
  }
}


/* Homepage-specific refinements mapped to the supplied index.html.
   Existing HTML class names are retained for all other pages. */
.hero { background-image: radial-gradient(circle at 82% 18%, rgba(255,92,53,.19), transparent 55%), radial-gradient(circle at 12% 88%, rgba(19,94,171,.42), transparent 60%); }
.hero .wrap { padding-top: .5rem; }
.hero-h { max-width: 21ch; font-weight: 800; text-wrap: balance; }
.hero-h em { font-style: normal; color: var(--nexus-orange); }
.hero-sub { max-width: 57ch; line-height: 1.65; }
.hero-acts { align-items: center; }
.btn-lead { background: var(--nexus-orange); color: white; }
.btn-ghost { border-color: rgba(255,255,255,.55); }
.trace-cap span:first-child { color: var(--nexus-orange); }
.trace-cap span:last-child { color: var(--nexus-mist); }
.band-mist { background: var(--nexus-mist); }
.band-mist .figures dt { color: var(--nexus-navy); }
.band-mist .figures dd { color: var(--nexus-slate); }
.band-navy { background: var(--nexus-navy); }
.band-navy .rail-label { background: var(--nexus-orange); color: white; }
.rail-label { background: var(--nexus-orange); }
main > .rail:nth-of-type(even) { background: #fff; box-shadow: 0 0 0 100vmax #fff; }
main > .rail:nth-of-type(4n+1):not(:nth-of-type(1)) { background: var(--nexus-cream); box-shadow: 0 0 0 100vmax var(--nexus-cream); }
.cards > li { min-height: 10rem; }
.cards h2 { font-family: var(--serif); }
.cards h2 a { color: var(--nexus-navy); }
.cards h2 a:hover { color: var(--nexus-orange); }
.foot { background: var(--nexus-navy); color: var(--nexus-mist); }
@media (max-width: 52rem) { .hero-h { font-size: clamp(2.2rem,8vw,3.8rem); } }
