/* IMJ Institute of Research — site styles */

@font-face {
  font-family: "Bricolage";
  src: url("fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif";
  src: url("fonts/sourceserif.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif";
  src: url("fonts/sourceserif-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --vac: #0c1618;        /* vacuum: hero + footer */
  --vac-2: #15252a;
  --ink: #1a2226;
  --ink-soft: #4a575c;
  --mist: #eef1ee;       /* page */
  --paper: #fafbf9;      /* raised surfaces */
  --line: #cfd6d2;
  --uv: #7b5cff;         /* 397 nm fluorescence */
  --uv-ink: #5438d4;     /* violet readable on light */
  --leaf: #2f5d46;       /* paddy green */
  --on-dark: #e8ecea;
  --on-dark-soft: #9fb0ad;

  --display: "Bricolage", "Helvetica Neue", Arial, sans-serif;
  --text: "Source Serif", Georgia, "Times New Roman", serif;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1180px;
  --measure: 38rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.68;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--uv-ink); }
:focus-visible { outline: 2px solid var(--uv); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 6vw, 4.75rem); font-weight: 500; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.35rem; letter-spacing: -0.01em; }
p { margin: 0 0 1.1em; max-width: var(--measure); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

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

/* ---------- header ---------- */
.site-head {
  position: absolute; inset: 0 0 auto 0; z-index: 20;
  color: var(--on-dark);
}
.site-head.on-light { position: relative; color: var(--ink); background: var(--mist); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand small { display: block; font-weight: 400; font-size: 0.78rem; opacity: 0.7; letter-spacing: 0; }
.nav { display: flex; gap: 4px; }
.nav a {
  font-family: var(--display); font-size: 0.95rem; text-decoration: none;
  padding: 8px 12px; border-radius: 999px; opacity: 0.85;
}
.nav a:hover { opacity: 1; color: inherit; background: color-mix(in srgb, currentColor 10%, transparent); }
.nav a[aria-current="page"] { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
.nav-toggle { display: none; background: none; border: 1px solid currentColor; color: inherit; border-radius: 999px; padding: 6px 14px; font-family: var(--display); font-size: 0.9rem; cursor: pointer; }

@media (max-width: 1100px) {
  .nav-toggle { display: inline-block; }
  .nav {
    display: none; position: absolute; top: 80px; left: var(--gutter); right: var(--gutter);
    flex-direction: column; background: var(--paper); color: var(--ink);
    border: 1px solid var(--line); border-radius: 14px; padding: 8px;
    box-shadow: 0 20px 40px -20px rgba(12,22,24,.35);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; border-radius: 10px; }
}

.brand-wrap { display: flex; align-items: center; gap: 14px; }
.logo-chip { display: inline-flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 5px 10px; box-shadow: 0 1px 0 rgba(12,22,24,.08); }
.logo-chip a { display: block; line-height: 0; }
.head-right { display: flex; align-items: center; gap: 14px; }
.logo-right { padding: 8px 12px; line-height: 0; }
.logo-right .logo-imj { height: 40px; }
.logo-chip a + a { border-left: 1px solid #dde3df; padding-left: 10px; }
.logo-imjir { height: 50px; width: auto; }
.logo-imj { height: 38px; width: auto; }
.site-head .wrap { min-height: 84px; }
@media (max-width: 560px) {
  .brand small { display: none; }
  .logo-imjir { height: 40px; } .logo-imj, .logo-right .logo-imj { height: 30px; }
  .head-right { gap: 8px; }
}
@media (max-width: 380px) { .brand { display: none; } }
.foot-logos { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.foot-logos img { background: #fff; border-radius: 12px; padding: 10px; height: 116px; width: auto; display: block; }
.foot-logos a { display: block; line-height: 0; }

/* ---------- home hero ---------- */
.hero {
  position: relative; min-height: 100svh; background: var(--vac); color: var(--on-dark);
  display: flex; align-items: flex-end; overflow: hidden;
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero .wrap { position: relative; width: 100%; padding-bottom: clamp(48px, 10vh, 112px); }
.hero h1 { max-width: 13ch; margin-bottom: 0.35em; }
.hero p { color: var(--on-dark-soft); font-size: 1.2rem; max-width: 30rem; }
.hero-note {
  position: absolute; right: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))); top: 57%;
  font-family: var(--display); font-size: 0.8rem; color: var(--on-dark-soft); text-align: right; line-height: 1.4;
}
.hero-note b { color: #b9a8ff; font-weight: 500; }
@media (max-width: 760px) { .hero-note { top: calc(34% + 76px); left: var(--gutter); text-align: center; font-size: 0.75rem; } .hero-note br { display: none; } }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-size: 1rem; font-weight: 500;
  padding: 13px 22px; border-radius: 999px; text-decoration: none;
  border: 1px solid transparent; transition: background .15s, color .15s;
}
.btn-uv { background: var(--uv); color: #fff; }
.btn-uv:hover { background: #8d72ff; color: #fff; }
.btn-ghost { border-color: color-mix(in srgb, currentColor 40%, transparent); }
.btn-ghost:hover { color: inherit; border-color: currentColor; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--uv-ink); color: #fff; }

/* ---------- home: three doors ---------- */
.doors { padding: clamp(56px, 9vw, 112px) 0; }
.doors ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.doors li { border-bottom: 1px solid var(--line); }
.doors a {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 24px; align-items: baseline;
  padding: 28px 0; text-decoration: none;
}
.doors a:hover { color: var(--ink); }
.doors a:hover .door-title { color: var(--uv-ink); }
.door-title { font-family: var(--display); font-size: clamp(1.6rem, 3.4vw, 2.6rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1; transition: color .15s; }
.door-text { color: var(--ink-soft); margin: 0; }
.door-arrow { width: 28px; height: 28px; transition: transform .2s; }
.doors a:hover .door-arrow { transform: translateX(4px); }
@media (max-width: 700px) {
  .doors a { grid-template-columns: 1fr auto; gap: 8px 16px; }
  .door-text { grid-column: 1; grid-row: 2; }
  .door-arrow { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
}

/* ---------- partners ---------- */
.partners { padding: 0 0 clamp(56px, 8vw, 96px); }
.partners h2 { font-size: 1rem; font-family: var(--display); font-weight: 500; color: var(--ink-soft); letter-spacing: 0; margin-bottom: 20px; }
.logo-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; list-style: none; margin: 0; padding: 0; }
.logo-row li { min-width: 0; overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; height: 92px; display: grid; place-items: center; padding: 16px; }
.logo-row img { font-size: 0.75rem; color: var(--ink-soft); max-height: 52px; max-width: 100%; object-fit: contain; filter: grayscale(1); opacity: .85; transition: filter .2s, opacity .2s; }
.logo-row li:hover img { filter: none; opacity: 1; }
@media (max-width: 800px) { .logo-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- inner pages ---------- */
.page-head { padding-top: clamp(56px, 9vw, 120px); padding-bottom: clamp(32px, 5vw, 56px); }
.page-head h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); max-width: 16ch; }
.lede { font-size: clamp(1.2rem, 2vw, 1.45rem); line-height: 1.5; color: var(--ink-soft); max-width: 36rem; }

.section { padding: clamp(40px, 6vw, 80px) 0; border-top: 1px solid var(--line); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(24px, 5vw, 72px); }
.split > :first-child h2 { position: sticky; top: 24px; }
@media (max-width: 800px) { .split { grid-template-columns: minmax(0, 1fr); } .split > :first-child h2 { position: static; } }

.figure { margin: 0; border-radius: 16px; overflow: hidden; background: var(--vac-2); }
.figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.figure figcaption { font-size: 0.85rem; color: var(--on-dark-soft); padding: 10px 16px; font-family: var(--display); }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin: 0; padding: 0; list-style: none; }
.pillars li { border-top: 2px solid var(--ink); padding-top: 16px; }
.pillars h3 { margin-bottom: 6px; }
.pillars p { color: var(--ink-soft); font-size: 1.02rem; margin: 0; }
@media (max-width: 800px) { .pillars { grid-template-columns: 1fr; gap: 24px; } }

/* experiments */
.experiment { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; padding: 32px 0; }
.experiment + .experiment { border-top: 1px solid var(--line); }
.experiment svg { width: 100%; height: auto; background: var(--vac); border-radius: 16px; }
.experiment h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.status { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 0.85rem; color: var(--leaf); margin-bottom: 10px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--leaf); }
@media (max-width: 800px) { .experiment { grid-template-columns: 1fr; } .experiment svg { order: -1; } }

/* people */
.lead-person { display: grid; grid-template-columns: 280px 1fr; gap: clamp(24px, 4vw, 56px); padding: 32px 0; align-items: start; }
.lead-person + .lead-person { border-top: 1px solid var(--line); }
.portrait { border-radius: 14px; overflow: hidden; background: var(--line); aspect-ratio: 4 / 5; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.role { font-family: var(--display); color: var(--uv-ink); font-size: 1rem; margin: -4px 0 16px; }
.links { display: flex; flex-wrap: wrap; gap: 16px; font-family: var(--display); font-size: 0.95rem; }
@media (max-width: 700px) { .lead-person { grid-template-columns: 1fr; } .lead-person .portrait { max-width: 220px; } }

.team { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; list-style: none; margin: 0; padding: 0; }
.team .portrait { aspect-ratio: 1; margin-bottom: 14px; }
.team h3 { margin-bottom: 2px; }
.team .role { margin: 0 0 10px; font-size: 0.92rem; }
.team p { font-size: 1rem; color: var(--ink-soft); }
@media (max-width: 900px) { .team { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .team { grid-template-columns: 1fr; } }

/* projects / facts */
.projects { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.project { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 24px 26px; }
.project h3 { margin-bottom: 8px; }
.project p { color: var(--ink-soft); font-size: 1.02rem; margin-bottom: 8px; }
.project .fit { font-family: var(--display); font-size: 0.9rem; color: var(--leaf); margin: 0; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--line); }
.facts div { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-family: var(--display); font-size: 0.85rem; color: var(--ink-soft); }
.facts dd { margin: 2px 0 0; font-size: 1.05rem; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 24px; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; margin-bottom: 14px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--ink); font-family: var(--display); font-size: 0.85rem; display: grid; place-items: center; }

.notice { background: var(--paper); border-left: 3px solid var(--uv); padding: 16px 20px; border-radius: 0 10px 10px 0; font-size: 1rem; max-width: var(--measure); }
.notice p { margin: 0; }

/* speakers */
.speakers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 28px; }
.speakers li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.speakers b { display: block; font-family: var(--display); font-weight: 500; }
.speakers span { color: var(--ink-soft); font-size: 0.95rem; }

/* posts */
.posts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.posts li { border-bottom: 1px solid var(--line); }
.posts a { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 22px 0; text-decoration: none; }
.posts .t { font-family: var(--display); font-size: clamp(1.25rem, 2.4vw, 1.7rem); letter-spacing: -0.02em; line-height: 1.2; }
.posts time { font-family: var(--display); font-size: 0.9rem; color: var(--ink-soft); white-space: nowrap; }

/* visit */
.map { border: 0; width: 100%; aspect-ratio: 4 / 3; border-radius: 16px; background: var(--line); }
.contact-list { list-style: none; padding: 0; margin: 0 0 24px; }
.contact-list li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.contact-list span { display: block; font-family: var(--display); font-size: 0.85rem; color: var(--ink-soft); }
.contact-list a { font-size: 1.15rem; }
.route { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: var(--display); font-size: 0.95rem; margin: 8px 0 20px; }
.route span { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }

.contact-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.contact-table th, .contact-table td { text-align: left; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.contact-table th { font-family: var(--display); font-weight: 500; }


/* publications */
.pub-list { padding-bottom: clamp(56px, 8vw, 96px); }
.pub-year { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; border-top: 1px solid var(--ink); padding: 28px 0 8px; }
.pub-year h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 500; letter-spacing: -0.03em; color: var(--uv-ink); }
.pubs { list-style: none; margin: 0; padding: 0; }
.pub { padding: 0 0 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.pub:last-child { border-bottom: 0; margin-bottom: 0; }
.pub p { margin: 0; max-width: 46rem; }
.pub-title { font-family: var(--display); font-size: 1.2rem; font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; margin-bottom: 6px !important; }
.pub-title a { text-decoration-color: var(--uv); }
.pub-authors { font-size: 1rem; color: var(--ink-soft); }
.pub-authors b { color: var(--ink); font-weight: 600; }
.pub-venue { font-size: 1rem; margin-top: 4px !important; }
.pub-kind { display: inline-block; font-family: var(--display); font-size: 0.78rem; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 1px 9px; margin-right: 10px; vertical-align: 2px; color: var(--leaf); }
sup { font-size: 0.7em; line-height: 0; }
@media (max-width: 700px) { .pub-year { grid-template-columns: 1fr; gap: 8px; } }
@media (max-width: 1260px) and (min-width: 1101px) { .nav a { padding: 8px 9px; font-size: 0.92rem; } }


/* learn */
.toc { margin-bottom: 8px; }
.toc ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; counter-reset: t; }
.toc li { counter-increment: t; }
.toc a { display: inline-flex; gap: 8px; align-items: center; font-family: var(--display); font-size: 0.92rem; text-decoration: none; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 8px; }
.toc a::before { content: counter(t); width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-size: 0.75rem; }
.toc a:hover { border-color: var(--uv); color: var(--ink); }
.learn { scroll-margin-top: 16px; }
.step-no { font-family: var(--display); font-size: 0.9rem; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--ink); display: grid; place-items: center; margin-bottom: 14px; }
.learn .split > :first-child h2 { position: static; }
.learn .split > :first-child { position: sticky; top: 24px; align-self: start; }
@media (max-width: 800px) { .learn .split > :first-child { position: static; } }
.demo-fig { margin: 28px 0; background: var(--vac); border-radius: 16px; overflow: hidden; }
.demo-fig svg { width: 100%; height: auto; display: block; padding: 8px; }
.demo-fig figcaption { color: var(--on-dark-soft); font-family: var(--display); font-size: 0.9rem; padding: 0 18px 16px; line-height: 1.45; }
.saddle .ph-a { animation: ph 2.4s ease-in-out infinite; }
.saddle .ph-b { animation: ph 2.4s ease-in-out infinite reverse; }
@keyframes ph { 0%, 40% { opacity: 1; } 50%, 90% { opacity: 0; } 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .saddle .ph-b { opacity: .35; } }
.demo { background: var(--vac); color: var(--on-dark); border-radius: 18px; padding: 22px 22px 18px; margin: 28px 0; }
.demo h3 { color: var(--on-dark); margin-bottom: 6px; }
.demo-help { color: var(--ink-soft); font-size: 1rem; }
.demo .demo-help { color: var(--on-dark-soft); }
.demo-plot { position: relative; height: 240px; margin: 8px 0 16px; background: #0a1214; border-radius: 10px; overflow: hidden; }
.demo-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.demo, .demo * { touch-action: manipulation; }
.demo-controls input[type=range] { touch-action: pan-y; font-size: 16px; }
.split > * { min-width: 0; }
.demo-controls { display: grid; gap: 10px; font-family: var(--display); font-size: 0.95rem; }
.demo-controls output { color: #b9a8ff; font-weight: 600; }
.demo-controls input[type=range] { width: 100%; accent-color: var(--uv); height: 28px; }
.demo-controls .check { display: flex; gap: 8px; align-items: center; color: var(--on-dark-soft); }
.verdict { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; font-size: 1rem; max-width: none; background: #15252a; border-left: 3px solid var(--on-dark-soft); }
.verdict.good { border-color: #7fd0a8; }
.verdict.ok { border-color: #e3c16f; }
.verdict.bad { border-color: #ff8a7a; }
.table-scroll { overflow-x: auto; margin: 12px 0; }
.laser-table { width: 100%; border-collapse: collapse; font-size: 0.98rem; min-width: 520px; }
.laser-table th { font-family: var(--display); font-weight: 500; font-size: 0.88rem; color: var(--ink-soft); text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--ink); }
.laser-table td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.laser-table td:first-child { font-family: var(--display); font-weight: 500; white-space: nowrap; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.credit { font-size: 0.95rem; color: var(--ink-soft); font-style: italic; }

/* ---------- footer ---------- */
.site-foot { background: var(--vac); color: var(--on-dark-soft); padding: 64px 0 32px; font-size: 0.98rem; }
.site-foot a { color: var(--on-dark); text-decoration: none; }
.site-foot a:hover { color: #b9a8ff; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.foot-grid h2 { font-size: 0.95rem; color: var(--on-dark); font-weight: 500; letter-spacing: 0; margin-bottom: 12px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin-bottom: 6px; }
.foot-grid address { font-style: normal; line-height: 1.6; }
.foot-base { margin-top: 48px; padding-top: 20px; border-top: 1px solid #22363b; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-family: var(--display); font-size: 0.85rem; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.hero-note .artist { display: block; font-style: italic; color: #e8ecea; margin-bottom: 4px; }

/* Q-SFDP links */
.nav a.nav-cta { opacity: 1; border: 1px solid var(--uv); color: inherit; margin-left: 4px; }
.site-head:not(.on-light) .nav a.nav-cta { border-color: #b9a8ff; }
.nav a.nav-cta:hover { background: var(--uv); color: #fff; border-color: var(--uv); }
@media (max-width: 1100px) { .nav a.nav-cta { margin: 4px 0 0; text-align: center; } }
.hero-flag { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 0.95rem; text-decoration: none; color: var(--on-dark); border: 1px solid rgba(185,168,255,.55); background: rgba(123,92,255,.14); border-radius: 999px; padding: 7px 16px 7px 12px; margin-bottom: 22px; }
.hero-flag:hover { color: #fff; background: rgba(123,92,255,.3); }
.flag-dot { width: 8px; height: 8px; border-radius: 50%; background: #b9a8ff; box-shadow: 0 0 0 4px rgba(185,168,255,.18); }

/* keep hero content clear of the header on short screens */
.hero { padding-top: 120px; }
@media (max-height: 760px) and (min-width: 761px) {
  .hero h1 { font-size: clamp(2.4rem, 7.5vh, 4.75rem); }
  .hero .wrap { padding-bottom: 48px; }
  .hero-flag { margin-bottom: 14px; }
}

/* keep hero text clear of the header when the window is short or zoomed in */
.hero { padding-top: 112px; }
@media (max-height: 640px) and (min-width: 761px) { .hero-note { top: auto; bottom: 24px; } }

/* collaborator logos in full colour */
.logo-row img { filter: none; opacity: 1; }

/* project positions */
.positions { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 16px; }
.position { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 24px 26px; }
.position h3 { margin-bottom: 8px; }
.position > p { color: var(--ink-soft); font-size: 1.02rem; }
.pos-code { font-family: var(--display); font-size: 0.88rem; color: var(--uv-ink); margin-bottom: 6px !important; }
.pos-facts { margin: 14px 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.pos-facts div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pos-facts div:last-child { border-bottom: 0; padding-bottom: 0; }
.pos-facts dt { font-family: var(--display); font-size: 0.88rem; color: var(--ink-soft); }
.pos-facts dd { margin: 0; font-size: 1rem; }
@media (max-width: 560px) { .pos-facts div { grid-template-columns: 1fr; gap: 2px; } }

/* registration form */
.pos-action { margin: 16px 0 0 !important; }
.apply-form { max-width: 40rem; }
.apply-form fieldset { border: 0; padding: 0; margin: 0 0 32px; }
.apply-form legend { font-family: var(--display); font-weight: 600; font-size: 1.25rem; letter-spacing: -0.01em; margin-bottom: 10px; padding: 0; }
.apply-form label { display: block; font-family: var(--display); font-size: 0.95rem; margin: 14px 0 6px; }
.apply-form .hint { color: var(--ink-soft); font-weight: 400; }
.apply-form input[type=text], .apply-form input[type=email], .apply-form input[type=tel], .apply-form select, .apply-form textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.apply-form textarea { resize: vertical; line-height: 1.5; }
.apply-form input:focus, .apply-form select:focus, .apply-form textarea:focus { outline: 2px solid var(--uv); outline-offset: 1px; border-color: var(--uv); }
.apply-form input[type=file] { font-family: var(--display); font-size: 0.95rem; }
.apply-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .apply-form .two { grid-template-columns: 1fr; } }
.apply-form .consent { display: flex; gap: 10px; align-items: flex-start; font-family: var(--text); font-size: 1rem; margin: 0 0 22px; }
.apply-form .consent input { margin-top: 5px; accent-color: var(--uv); }
.apply-form button { border: 0; cursor: pointer; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { border-left-color: #c2410c; margin-bottom: 24px; }

/* same dark header on every page */
.site-head.on-light { position: relative; color: var(--on-dark); background: var(--vac); border-bottom: 1px solid #1d2f33; }
.site-head.on-light .nav a.nav-cta { border-color: #b9a8ff; }
@media (max-width: 1100px) { .site-head .nav a { color: var(--ink); } }

/* open positions list */
.open-meta { display: block; font-family: var(--display); font-size: 0.9rem; color: var(--leaf); margin-bottom: 6px; }

/* nine menu items: keep labels on one line, switch to the Menu button earlier */
.nav a, .brand, .brand small { white-space: nowrap; }
.nav { gap: 2px; }
@media (max-width: 1439px) and (min-width: 1281px) { .nav a { padding: 8px 9px; font-size: 0.92rem; } .brand small { display: none; } }
@media (max-width: 1280px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; top: 80px; left: var(--gutter); right: var(--gutter);
    flex-direction: column; background: var(--paper); color: var(--ink);
    border: 1px solid var(--line); border-radius: 14px; padding: 8px; box-shadow: 0 20px 40px -20px rgba(12,22,24,.35); z-index: 30; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; border-radius: 10px; color: var(--ink); font-size: 1rem; }
  .nav a.nav-cta { margin: 4px 0 0; text-align: center; border-color: var(--uv); }
}
.logo-chip, .logo-right { flex: none; }
@media (max-width: 1519px) and (min-width: 1440px) { .nav a { padding: 8px 9px; font-size: 0.92rem; } }

/* full IMJIR logo (with tagline) in the header */
.site-head .wrap { min-height: 96px; }
.logo-chip { padding: 4px 6px; }
.logo-imjir { height: 76px; }
.logo-right .logo-imj { height: 52px; }
.logo-right { padding: 10px 12px; }
.hero { padding-top: 124px; }
@media (max-width: 1280px) { .nav { top: 92px; } }
@media (max-width: 560px) { .site-head .wrap { min-height: 84px; } .logo-imjir { height: 66px; } .logo-right .logo-imj { height: 36px; } .nav { top: 84px; } }

/* Q-SFDP: draw the eye with a soft pulsing glow and a passing shine */
@keyframes qsfdp-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(155,133,255,.75); }
  70%  { box-shadow: 0 0 0 12px rgba(155,133,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(155,133,255,0); }
}
@keyframes qsfdp-shine { 0%, 55% { background-position: -150% 0; } 100% { background-position: 250% 0; } }
@keyframes qsfdp-blink { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.nav a.nav-cta, .hero-flag {
  position: relative; overflow: visible;
  background-color: rgba(123,92,255,.28);
  background-image: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  background-size: 200% 100%; background-repeat: no-repeat;
  animation: qsfdp-pulse 2s ease-out infinite, qsfdp-shine 3.5s ease-in-out infinite;
  font-weight: 600; color: #fff;
}
.site-head .nav a.nav-cta { color: #fff; }
.nav a.nav-cta:hover, .hero-flag:hover { background-color: var(--uv); color: #fff; }
.flag-dot { animation: qsfdp-blink 1.2s ease-in-out infinite; background: #d6ccff; }
@media (max-width: 1280px) {
  .nav a.nav-cta, .site-head .nav a.nav-cta { background-color: var(--uv); color: #fff; }
  .nav-toggle { animation: qsfdp-pulse 2s ease-out infinite; }
}
@media (prefers-reduced-motion: reduce) {
  .nav a.nav-cta, .hero-flag, .flag-dot, .nav-toggle { animation: none; }
}

/* About: two photos side by side */
.photo-pair { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.photo-pair .figure { display: flex; flex-direction: column; }
.photo-pair .figure img { flex: 1; width: 100%; height: 100%; min-height: 0; aspect-ratio: auto; object-fit: cover; }
.photo-pair .figure:first-child img { aspect-ratio: 16 / 10; }
@media (max-width: 760px) {
  .photo-pair { grid-template-columns: 1fr; }
  .photo-pair .figure img, .photo-pair .figure:first-child img { aspect-ratio: 4 / 3; height: auto; }
}

/* programme schedules */
.sched-intro { color: var(--ink-soft); margin-bottom: 18px; }
.sched { width: 100%; border-collapse: collapse; font-size: 0.98rem; min-width: 640px; }
.sched th { font-family: var(--display); font-weight: 500; font-size: 0.85rem; color: var(--ink-soft); text-align: left; padding: 8px 14px 8px 0; border-bottom: 1px solid var(--ink); }
.sched td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.sched td:first-child { font-family: var(--display); white-space: nowrap; color: var(--ink-soft); font-size: 0.92rem; }
.sched td:nth-child(2) { font-weight: 500; }
.sched:not(.sched-5) td:nth-child(2) { width: 52%; }
.sched-5 td:nth-child(2) { font-family: var(--display); white-space: nowrap; color: var(--ink-soft); font-size: 0.92rem; font-weight: 400; }
.sched-5 td:nth-child(3) { font-weight: 500; }
.sched-5 td:last-child { color: var(--leaf); font-family: var(--display); font-size: 0.9rem; white-space: nowrap; }
.facts-wide { grid-template-columns: 1fr; }
.facts-wide div { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; }
@media (max-width: 560px) { .facts-wide div { grid-template-columns: 1fr; gap: 2px; } }
