@import url('./course-colors.css');

:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --ink: #0d0d0d;
  --ink2: #4a4a4a;
  --ink3: #888888;
  --rule: #e0e0e0;
  --soft: #f2f2f2;
  --accent: #1a56db;
  --accent-soft: #e8f0fe;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;
  --maxw: 1100px;

  /* Colour palette */
  --c-blue:        #1a56db;
  --c-blue-soft:   #e8f0fe;
  --c-amber:       #b45309;
  --c-amber-soft:  #fef3c7;
  --c-teal:        #0f766e;
  --c-teal-soft:   #ccfbf1;
  --c-green:       #166534;
  --c-green-soft:  #f0fdf4;
  --c-purple:      #7c3aed;
  --c-purple-soft: #ede9fe;
  --c-red:         #dc2626;
  --c-red-soft:    #fee2e2;

  /* Per-page accent — override in each page's <style> block */
  --page-accent:      var(--c-blue);
  --page-accent-soft: var(--c-blue-soft);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-weight: 300;
}
a { color: inherit; }
.wrap, .nav-inner, .footer-inner { width: min(var(--maxw), calc(100% - 2.2rem)); margin: 0 auto; }
nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  min-height: 54px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand {
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
}
.brand strong, .nav-name { font-size: 0.95rem; font-weight: 600; letter-spacing: -0.01em; }
.brand span, .nav-affil {
  font-family: var(--mono); font-size: 0.68rem; color: var(--ink3);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.nav-links { display: flex; align-items: center; gap: 0.2rem; flex-wrap: wrap; list-style: none; }
.nav-links a {
  text-decoration: none; color: var(--ink2); font-size: 0.8rem;
  padding: 0.3rem 0.7rem; border-radius: 3px; transition: .15s ease;
}
.nav-links a:hover { background: var(--soft); color: var(--ink); box-shadow: none; }
.nav-links a.active { background: var(--soft); color: var(--page-accent); box-shadow: none; }
.nav-cta {
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; padding: 0.38rem 0.9rem; border-radius: 3px;
  background: var(--accent); color: white; font-weight: 500; font-size: 0.75rem;
  transition: opacity .15s ease;
  font-family: var(--mono);
}
.nav-cta:hover { opacity: .85; }
main { padding: 1.8rem 0 3rem; }
.shell {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: none;
}
.eyebrow, .kicker, .meta-label, .tag, .year, .mini-k, .section-kicker {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.hero { padding: 2rem; }
.hero.compact { padding: 1.9rem 2rem; }
.eyebrow { color: var(--page-accent); font-size: 0.7rem; margin-bottom: 0.8rem; }
h1 {
  margin: 0 0 0.8rem;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1; letter-spacing: -0.03em;
}
.lead {
  margin: 0 0 1rem; color: var(--ink); font-size: 0.95rem; max-width: 48rem;
  border-left: 2px solid var(--page-accent); padding-left: 0.85rem;
}
.intro, .section-sub, .body-copy { margin: 0; color: var(--ink2); font-size: 0.9rem; }
.hero-actions, .row-actions, .pub-actions, .tag-row {
  display: flex; flex-wrap: wrap; gap: 0.65rem;
}
.hero-actions { margin-top: 1.3rem; }
.btn, .btn-ghost, .pub-action, .tiny-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 36px; padding: 0.45rem 1rem; border-radius: 3px; text-decoration: none;
  font-size: 0.75rem; font-weight: 500; transition: .15s ease; border: 1px solid transparent; cursor: pointer;
  font-family: var(--mono);
}
.btn { background: var(--ink); color: white; border-color: var(--ink); box-shadow: none; }
.btn:hover { opacity: 0.85; transform: none; box-shadow: none; }
.btn-ghost, .pub-action, .tiny-btn { background: transparent; color: var(--ink2); border: 1px solid var(--rule); }
.btn-ghost:hover, .pub-action:hover, .tiny-btn:hover { border-color: var(--ink); background: var(--soft); transform: none; }
.tiny-btn { min-height: 32px; padding: 0.35rem 0.75rem; font-size: 0.72rem; }
.section { padding: 1.75rem 2rem; }
.section + .section { border-top: 1px solid var(--rule); }
.section-kicker { color: var(--ink3); font-size: 0.67rem; margin-bottom: 0.35rem; }
h2 { margin: 0 0 0.4rem; font-size: 1.4rem; line-height: 1.1; letter-spacing: -0.02em; }
.section-sub { max-width: 48rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.card {
  background: white;
  border: 1px solid var(--rule); border-radius: 4px; padding: 1.1rem;
}
.jump-card {
  text-decoration: none; color: var(--ink);
  background: white;
  border: 1px solid var(--rule); border-radius: 4px; padding: 1.1rem;
  transition: .15s ease; display: flex; flex-direction: column; gap: .45rem;
}
.jump-card:hover { transform: none; border-color: var(--ink2); box-shadow: var(--shadow); }
.card-kicker { font-size: 0.67rem; color: var(--page-accent); }
.card h3, .jump-card h3, .pub-title, .timeline-title {
  margin: 0; font-size: 0.98rem; line-height: 1.35; letter-spacing: -0.01em;
}
.card p, .jump-card p, .muted, .timeline-desc, .pub-meta, .pub-note {
  margin: 0; color: var(--ink2); font-size: 0.82rem;
}
.tag-row { margin-top: 0.7rem; }
.tag {
  font-size: 0.6rem; font-weight: 500; padding: 0.17rem 0.45rem; border-radius: 2px;
  background: var(--soft); color: var(--ink2); border: 1px solid var(--rule);
}
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.stat-stack { display: grid; gap: 0.8rem; }
.stat {
  display: grid; grid-template-columns: 90px 1fr; gap: 0.8rem;
  padding-top: 0.8rem; border-top: 1px solid var(--rule);
}
.stat:first-child { border-top: none; padding-top: 0; }
.meta-label { font-size: 0.63rem; color: var(--ink3); padding-top: 0.15rem; }
.timeline { display: grid; gap: 1rem; }
.timeline-row {
  display: grid; grid-template-columns: 110px 1fr; gap: 0.9rem;
  padding-top: 1rem; border-top: 1px solid var(--rule);
}
.timeline-row:first-child { padding-top: 0; border-top: none; }
.year { font-size: 0.67rem; color: var(--ink3); padding-top: 0.15rem; }
.timeline-org, .pub-venue { color: var(--ink3); font-size: 0.78rem; margin-top: 0.15rem; }
.pub-list { display: grid; gap: 0; }
.pub-item { display: grid; grid-template-columns: 64px 1fr; gap: 0.95rem; padding: 1rem 0; border-top: 1px solid var(--rule); }
.pub-item:first-child { border-top: none; padding-top: 0; }
.pub-title { font-size: 0.95rem; font-weight: 500; margin-bottom: 0.25rem; }
.pub-authors { color: var(--ink2); font-size: 0.8rem; margin-bottom: 0.2rem; }
.pub-authors .self { font-weight: 600; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }
.pub-note { margin-top: 0.55rem; max-width: 48rem; }
.pub-actions { margin-top: 0.7rem; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.mini-list { display: grid; gap: 0.7rem; }
.mini-item { display: grid; grid-template-columns: 92px 1fr; gap: 0.75rem; padding-top: 0.7rem; border-top: 1px solid var(--rule); }
.mini-item:first-child { border-top: none; padding-top: 0; }
.mini-k { font-size: 0.62rem; color: var(--ink3); padding-top: 0.15rem; }
.mini-v { color: var(--ink2); font-size: 0.82rem; }
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 1rem; }
.form-grid { display: grid; gap: 0.9rem; }
.frow-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
label { display: grid; gap: 0.35rem; }
label span {
  font-family: var(--mono); font-size: 0.63rem; color: var(--ink3);
  text-transform: uppercase; letter-spacing: 0.08em;
}
input, textarea, select {
  width: 100%; border: 1px solid var(--rule); border-radius: 3px; background: white;
  padding: 0.72rem 0.8rem; font: inherit; color: var(--ink); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 144px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(26, 86, 219, 0.15); }
.note {
  margin-top: 0.75rem; padding: 0.9rem 1rem; border-radius: 3px;
  background: var(--soft); color: var(--ink2); font-size: 0.82rem;
}
footer { padding: 0 0 2rem; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: var(--ink3); font-size: 0.75rem;
}
.footer-name { font-family: var(--mono); color: var(--ink); font-weight: 500; }
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--ink); }
.footer-copy { width: 100%; text-align: center; margin-top: 0.5rem; font-size: 0.7rem; color: var(--ink3); }
.print-only { display: none; }

/* --- Accordion / collapsible --- */
.accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 0.75rem 0;
  border-top: 1px solid var(--rule);
  margin-top: 1.2rem;
  user-select: none;
}
.accordion-toggle h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.accordion-toggle::after {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--ink3);
  border-bottom: 1.5px solid var(--ink3);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 0.75rem;
}
.accordion.open .accordion-toggle::after {
  transform: rotate(-135deg);
}
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.accordion.open .accordion-body {
  max-height: 1000px;
}

/* Stat row for research metrics */
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 0.8rem;
}
.stat-item { text-align: center; }
.stat-number {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}
.stat-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--ink3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* HAMBURGER / MOBILE NAV */
.nav-hamburger {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  width: 36px; height: 36px; padding: 0; flex-shrink: 0;
  background: none; border: 1px solid var(--rule); border-radius: 3px; cursor: pointer;
  gap: 5px;
}
.nav-hamburger span {
  display: block; width: 18px; height: 1.5px;
  background: var(--ink2); border-radius: 1px;
}
.mobile-nav {
  display: none;
  border-top: 1px solid var(--rule);
  padding: 0.4rem 0.5rem 0.6rem;
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block; text-decoration: none; color: var(--ink2); font-size: 0.85rem;
  padding: 0.55rem 0.75rem; border-radius: 3px; transition: .15s ease;
}
.mobile-nav a:hover { background: var(--soft); color: var(--ink); }
.mobile-nav a.active { background: var(--soft); color: var(--page-accent); }
.mobile-nav-cta {
  margin-top: 0.4rem; background: var(--accent) !important; color: white !important;
  font-family: var(--mono); font-size: 0.75rem; font-weight: 500;
}

@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3, .grid-2, .info-grid, .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-inner { padding: 0.3rem 0; align-items: center; }
  .nav-links { display: none !important; }
  .nav-cta { display: none !important; }
  .nav-hamburger { display: flex; }
  .hero, .hero.compact, .section { padding: 1.25rem; }
  .stat-row { gap: 1rem; }
  .accordion-toggle { padding: 0.6rem 0; }
  .pub-item, .timeline-row, .stat, .mini-item { grid-template-columns: 1fr; }
  .year, .meta-label, .mini-k { padding-top: 0; }
  .frow-2 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
}
@media print {
  nav, .hero-actions, .nav-cta, footer, .no-print { display: none !important; }
  body { background: white; }
  main { padding: 0; }
  .shell { border: none; box-shadow: none; }
  .section, .hero { padding: 0.85rem 0; }
  .print-only { display: block; }
  .accordion-body { max-height: none !important; overflow: visible; }
  .accordion-toggle::after { display: none; }
}
