:root {
  --bg: #fbf8f2;
  --wash: #f4efe2;
  --ink: #16233f;
  --ink-2: #2c3b57;
  --muted: #666f7c;
  --faint: #93998f;
  --faint-2: #9aa0ab;
  --rule: #e6ded0;
  --rule-strong: #d6c9b2;
  --blue: #1f4e8c;
  --blue-dark: #16385f;
  --blue-wash: #eaf0f8;
  --crimson: #9c3b46;
  --crimson-wash: #f8ecec;
  --sans: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --col: 720px;
  --col-wide: 1040px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 248, 242, 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  max-width: var(--col-wide);
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}
.running-title {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.running-title span { color: var(--faint-2); font-weight: 500; }
.topnav { display: flex; gap: 26px; }
.topnav a {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.12s;
}
.topnav a:hover { color: var(--blue); }
.nav-toggle {
  display: none;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  background: none;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  padding: 5px 12px;
  color: var(--ink);
  cursor: pointer;
}

/* ---------- Shared column ---------- */
.masthead,
.section {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 32px;
}
.section { margin-top: 72px; }
.section:last-of-type { margin-bottom: 60px; }

/* ---------- Masthead ---------- */
.masthead { padding-top: 88px; }
.kicker {
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 22px;
}
h1 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(2.1rem, 5vw, 3.15rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
  color: var(--ink);
}
.dek {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 28px;
  font-weight: 400;
  max-width: 34ch;
}
.authors {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--ink-2);
  font-weight: 500;
  margin: 0 0 4px;
}
.term {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--faint);
  font-weight: 400;
  margin: 0 0 40px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--rule);
}
.term .dot { margin: 0 8px; color: var(--rule-strong); }

.abstract { margin: 0 0 40px; }
.abstract-label {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 10px;
}
.abstract p {
  font-size: 1.05rem;
  color: var(--ink-2);
  margin: 0;
  line-height: 1.62;
}

/* Facts strip */
.facts {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  margin: 0;
  padding: 26px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.facts > div { padding: 0 18px; border-left: 1px solid var(--rule); }
.facts > div:first-child { padding-left: 0; border-left: none; }
.facts dt {
  font-family: var(--sans);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.facts dd {
  margin: 4px 0 0;
  font-family: var(--sans);
  font-size: 0.76rem;
  line-height: 1.32;
  color: var(--muted);
}

/* ---------- Headings ---------- */
h2 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.55rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 20px;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.secnum {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-wash);
  border: 1px solid rgba(31, 78, 140, 0.18);
  border-radius: 3px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transform: translateY(-1px);
}
h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.3;
  margin: 32px 0 12px;
  color: var(--ink);
}

p { margin: 0 0 20px; }
em { font-style: italic; }
b { font-weight: 600; }
a { color: var(--blue); text-decoration: none; border-bottom: 1px solid rgba(31, 78, 140, 0.3); }
a:hover { color: var(--blue-dark); border-bottom-color: var(--blue-dark); }

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82em;
  color: var(--ink-2);
  background: var(--wash);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ---------- Pill / labels ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--blue-wash);
  color: var(--blue-dark);
  border: 1px solid rgba(31, 78, 140, 0.15);
}
.pill.crimson {
  background: var(--crimson-wash);
  color: var(--crimson);
  border-color: rgba(156, 59, 70, 0.18);
}

/* ---------- Research question callout ---------- */
.question-callout {
  position: relative;
  margin: 4px 0 28px;
  padding: 22px 0 22px 50px;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}
.question-callout::before {
  content: "\201C";
  position: absolute;
  left: 0;
  top: 14px;
  font-family: var(--serif);
  font-size: 3.4rem;
  line-height: 1;
  font-weight: 500;
  color: var(--blue);
  opacity: 0.45;
}
.question-callout p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.22rem;
  line-height: 1.55;
  color: var(--ink);
  margin: 0;
}
.sub-questions {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
.sub-questions li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  font-size: 1rem;
  color: var(--ink-2);
}
.sub-questions li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--crimson);
  opacity: 0.75;
}

/* ---------- Pipeline / hardware table ---------- */
.pipeline-table { margin: 26px 0 16px; }
.pipeline-table table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.9rem;
}
.pipeline-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0 16px 10px 0;
  border-bottom: 1px solid var(--rule-strong);
}
.pipeline-table td {
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
  vertical-align: top;
}
.pipeline-table td:first-child { font-weight: 600; color: var(--ink); white-space: nowrap; }
.tools {
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--muted);
}

/* ---------- Stimulus conditions strip ---------- */
.stim-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 28px 0 18px;
  padding: 24px 0;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}
.stim-strip > div { padding: 0 22px; border-left: 1px solid var(--rule); }
.stim-strip > div:first-child { padding-left: 0; border-left: none; }
.stim-strip .stim-level {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 10px;
}
.stim-strip .stim-level.high { color: var(--crimson); }
.stim-strip p:not(.stim-level) {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}

/* ---------- Bar chart (findings) ---------- */
.bar-chart {
  margin: 34px 0;
  padding: 28px 28px 18px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--bg);
}
.bar-chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 220px;
  gap: 28px;
  border-bottom: 1px solid var(--rule-strong);
  padding: 0 8px;
}
.bar-chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  flex: 1;
  max-width: 140px;
}
.bar-chart-value {
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}
.bar-chart-bar {
  width: 56%;
  border-radius: 5px 5px 0 0;
  background: var(--blue);
  height: 0;
  transition: height 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.bar-chart-col:nth-child(2) .bar-chart-bar { background: #4f7db3; }
.bar-chart-col:nth-child(3) .bar-chart-bar { background: var(--crimson); }
.bar-chart-labels {
  display: flex;
  justify-content: space-around;
  gap: 28px;
  padding: 12px 8px 0;
}
.bar-chart-labels span {
  flex: 1;
  max-width: 140px;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}
.bar-chart-caption {
  font-family: var(--sans);
  font-size: 0.86rem;
  color: var(--muted);
  margin-top: 18px;
}
.bar-chart-caption b { color: var(--ink-2); font-weight: 600; }

/* ---------- Two column lists ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
}
.two-col h3 { margin-top: 0; }
.two-col ul, .resource-list { margin: 0; padding: 0; list-style: none; }
.two-col li {
  font-size: 0.96rem;
  line-height: 1.5;
  color: var(--muted);
  padding: 11px 0 11px 20px;
  position: relative;
  border-bottom: 1px solid var(--rule);
}
.two-col li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20px;
  width: 6px;
  height: 1px;
  background: var(--faint);
}

/* ---------- Research poster ---------- */
.poster-card {
  max-width: var(--col-wide);
  margin: 26px 0 18px;
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 32px;
}
.poster-frame {
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--bg);
  padding: 14px;
  box-shadow: 0 12px 32px -18px rgba(22, 35, 63, 0.25);
  overflow: hidden;
}
.poster-frame .poster-scroll {
  overflow-x: auto;
  border-radius: 6px;
}
.poster-frame img {
  display: block;
  width: 100%;
  height: auto;
  min-width: 640px;
  max-width: 900px;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 6px;
}
.poster-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
  padding: 0 4px;
}
.poster-caption {
  font-family: var(--sans);
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0;
  max-width: 56ch;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 600;
  color: #fff;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 6px;
  padding: 9px 16px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }

/* ---------- Resources ---------- */
.resource-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.98rem;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.resource-list li:first-child { border-top: 1px solid var(--rule-strong); }
.resource-list a { font-weight: 600; }
.resource-list span { color: var(--muted); font-family: var(--serif); }

.muted { color: var(--faint) !important; }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--col);
  margin: 0 auto;
  padding: 22px 32px 60px;
  border-top: 1px solid var(--rule);
}
.footer p {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--faint);
  margin: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .poster-frame img { min-width: 560px; }
}
@media (max-width: 680px) {
  body { font-size: 18px; }
  .topnav { display: none; }
  .nav-toggle { display: inline-block; }
  .topnav.open {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    padding: 18px 32px;
  }
  .facts { grid-template-columns: repeat(2, 1fr); gap: 20px 0; }
  .facts > div { padding: 0 16px; }
  .facts > div:nth-child(odd) { border-left: none; padding-left: 0; }
  .two-col { grid-template-columns: 1fr; gap: 8px; }
  .stim-strip { grid-template-columns: 1fr; gap: 20px 0; padding: 20px 0; }
  .stim-strip > div { padding: 0 0 0 16px; border-left: 2px solid var(--rule); }
  .stim-strip > div:first-child { padding-left: 16px; border-left: 2px solid var(--rule); }
  .poster-card { padding: 0 20px; }
  .poster-actions { flex-direction: column; align-items: flex-start; }
  .bar-chart-bars { gap: 14px; }
  .bar-chart-labels { gap: 14px; }
  .masthead, .section { padding: 0 20px; }
}
